From xen-changelog-bounces@lists.xen.org Mon Sep 03 13:33:10 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Sep 2012 13:33:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T8Wm3-000368-0x; Mon, 03 Sep 2012 13:33:07 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8Wm2-00035g-6F
	for xen-changelog@lists.xensource.com; Mon, 03 Sep 2012 13:33:06 +0000
Received: from [85.158.143.99:19688] by server-3.bemta-4.messagelabs.com id
	76/B5-08232-191B4405; Mon, 03 Sep 2012 13:33:05 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-216.messagelabs.com!1346679183!23003039!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9574 invoked from network); 3 Sep 2012 13:33:04 -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;
	3 Sep 2012 13:33: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 1T8Wlz-0000fV-OP
	for xen-changelog@lists.xensource.com; Mon, 03 Sep 2012 13:33:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8Wlz-00071d-9u
	for xen-changelog@lists.xensource.com; Mon, 03 Sep 2012 13:33:03 +0000
Message-Id: <E1T8Wlz-00071d-9u@xenbits.xen.org>
Date: Mon, 03 Sep 2012 13:33: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] xen/sysfs: Use
	XENVER_guest_handle to query UUID
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Daniel De Graaf <dgdegra@tycho.nsa.gov>
# Date 1346678256 -7200
# Node ID af558aa67990007d3570f68931be209f8c815a7f
# Parent  2d3239c1550132c77c2c306f294b2cd01d57ec81
xen/sysfs: Use XENVER_guest_handle to query UUID

This hypercall has been present since Xen 3.1, and is the preferred
method for a domain to obtain its UUID. Fall back to the xenstore method
if using an older version of Xen (which returns -ENOSYS).

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 2d3239c15501 -r af558aa67990 drivers/xen/core/xen_sysfs.c
--- a/drivers/xen/core/xen_sysfs.c	Tue Aug 07 08:08:12 2012 +0200
+++ b/drivers/xen/core/xen_sysfs.c	Mon Sep 03 15:17:36 2012 +0200
@@ -104,9 +104,21 @@ static void xen_sysfs_version_destroy(vo
 
 static ssize_t uuid_show(struct hyp_sysfs_attr *attr, char *buffer)
 {
+	xen_domain_handle_t uuid;
 	char *vm, *val;
-	int ret;
+	int ret = HYPERVISOR_xen_version(XENVER_guest_handle, uuid);
 
+	if (!ret)
+		return sprintf(buffer,
+			       "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x\n",
+			       uuid[0], uuid[1], uuid[2], uuid[3],
+			       uuid[4], uuid[5],
+			       uuid[6], uuid[7],
+			       uuid[8], uuid[9],
+			       uuid[10], uuid[11], uuid[12],
+			       uuid[13], uuid[14], uuid[15]);
+
+#if CONFIG_XEN_COMPAT < 0x030100
 	if (!is_xenstored_ready())
 		return -EBUSY;
 
@@ -119,6 +131,11 @@ static ssize_t uuid_show(struct hyp_sysf
 		return PTR_ERR(val);
 	ret = sprintf(buffer, "%s\n", val);
 	kfree(val);
+#else /* prevent unused variable warnings */
+	asm("" : "=r" (vm), "=r" (val));
+	asm("" : : "r" (vm), "r" (val));
+#endif
+
 	return ret;
 }
 

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

From xen-changelog-bounces@lists.xen.org Mon Sep 03 13:33:10 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Sep 2012 13:33:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T8Wm3-000368-0x; Mon, 03 Sep 2012 13:33:07 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8Wm2-00035g-6F
	for xen-changelog@lists.xensource.com; Mon, 03 Sep 2012 13:33:06 +0000
Received: from [85.158.143.99:19688] by server-3.bemta-4.messagelabs.com id
	76/B5-08232-191B4405; Mon, 03 Sep 2012 13:33:05 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-216.messagelabs.com!1346679183!23003039!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9574 invoked from network); 3 Sep 2012 13:33:04 -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;
	3 Sep 2012 13:33: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 1T8Wlz-0000fV-OP
	for xen-changelog@lists.xensource.com; Mon, 03 Sep 2012 13:33:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8Wlz-00071d-9u
	for xen-changelog@lists.xensource.com; Mon, 03 Sep 2012 13:33:03 +0000
Message-Id: <E1T8Wlz-00071d-9u@xenbits.xen.org>
Date: Mon, 03 Sep 2012 13:33: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] xen/sysfs: Use
	XENVER_guest_handle to query UUID
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Daniel De Graaf <dgdegra@tycho.nsa.gov>
# Date 1346678256 -7200
# Node ID af558aa67990007d3570f68931be209f8c815a7f
# Parent  2d3239c1550132c77c2c306f294b2cd01d57ec81
xen/sysfs: Use XENVER_guest_handle to query UUID

This hypercall has been present since Xen 3.1, and is the preferred
method for a domain to obtain its UUID. Fall back to the xenstore method
if using an older version of Xen (which returns -ENOSYS).

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 2d3239c15501 -r af558aa67990 drivers/xen/core/xen_sysfs.c
--- a/drivers/xen/core/xen_sysfs.c	Tue Aug 07 08:08:12 2012 +0200
+++ b/drivers/xen/core/xen_sysfs.c	Mon Sep 03 15:17:36 2012 +0200
@@ -104,9 +104,21 @@ static void xen_sysfs_version_destroy(vo
 
 static ssize_t uuid_show(struct hyp_sysfs_attr *attr, char *buffer)
 {
+	xen_domain_handle_t uuid;
 	char *vm, *val;
-	int ret;
+	int ret = HYPERVISOR_xen_version(XENVER_guest_handle, uuid);
 
+	if (!ret)
+		return sprintf(buffer,
+			       "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x\n",
+			       uuid[0], uuid[1], uuid[2], uuid[3],
+			       uuid[4], uuid[5],
+			       uuid[6], uuid[7],
+			       uuid[8], uuid[9],
+			       uuid[10], uuid[11], uuid[12],
+			       uuid[13], uuid[14], uuid[15]);
+
+#if CONFIG_XEN_COMPAT < 0x030100
 	if (!is_xenstored_ready())
 		return -EBUSY;
 
@@ -119,6 +131,11 @@ static ssize_t uuid_show(struct hyp_sysf
 		return PTR_ERR(val);
 	ret = sprintf(buffer, "%s\n", val);
 	kfree(val);
+#else /* prevent unused variable warnings */
+	asm("" : "=r" (vm), "=r" (val));
+	asm("" : : "r" (vm), "r" (val));
+#endif
+
 	return ret;
 }
 

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

From xen-changelog-bounces@lists.xen.org Mon Sep 03 13:33:11 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Sep 2012 13:33:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T8Wm4-00036U-4H; Mon, 03 Sep 2012 13:33:08 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8Wm2-00035k-JZ
	for xen-changelog@lists.xensource.com; Mon, 03 Sep 2012 13:33:06 +0000
Received: from [85.158.139.83:10843] by server-9.bemta-5.messagelabs.com id
	F6/35-20529-191B4405; Mon, 03 Sep 2012 13:33:05 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-182.messagelabs.com!1346679184!24421843!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6176 invoked from network); 3 Sep 2012 13:33:05 -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;
	3 Sep 2012 13:33: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 1T8Wm0-0000fY-3g
	for xen-changelog@lists.xensource.com; Mon, 03 Sep 2012 13:33:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8Wlz-00071s-PI
	for xen-changelog@lists.xensource.com; Mon, 03 Sep 2012 13:33:03 +0000
Message-Id: <E1T8Wlz-00071s-PI@xenbits.xen.org>
Date: Mon, 03 Sep 2012 13: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] x86-64: fix hypercall page
	unwind info
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1346678334 -7200
# Node ID 341104e962db9697186669899917bc3c8ed59525
# Parent  af558aa67990007d3570f68931be209f8c815a7f
x86-64: fix hypercall page unwind info

This apparently was a copy-and-paste oversight.

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


diff -r af558aa67990 -r 341104e962db arch/x86_64/kernel/head-xen.S
--- a/arch/x86_64/kernel/head-xen.S	Mon Sep 03 15:17:36 2012 +0200
+++ b/arch/x86_64/kernel/head-xen.S	Mon Sep 03 15:18:54 2012 +0200
@@ -86,7 +86,7 @@ NEXT_PAGE(hypercall_page)
 	CFI_REL_OFFSET	rcx,0
 	.skip 2 /* push %r11 */
 	CFI_ADJUST_CFA_OFFSET	8
-	CFI_REL_OFFSET	rcx,0
+	CFI_REL_OFFSET	r11,0
 	.skip 5 /* mov $#,%eax */
 	.skip 2 /* syscall */
 	.skip 2 /* pop %r11 */

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

From xen-changelog-bounces@lists.xen.org Mon Sep 03 13:33:11 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Sep 2012 13:33:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T8Wm4-00036U-4H; Mon, 03 Sep 2012 13:33:08 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8Wm2-00035k-JZ
	for xen-changelog@lists.xensource.com; Mon, 03 Sep 2012 13:33:06 +0000
Received: from [85.158.139.83:10843] by server-9.bemta-5.messagelabs.com id
	F6/35-20529-191B4405; Mon, 03 Sep 2012 13:33:05 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-182.messagelabs.com!1346679184!24421843!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6176 invoked from network); 3 Sep 2012 13:33:05 -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;
	3 Sep 2012 13:33: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 1T8Wm0-0000fY-3g
	for xen-changelog@lists.xensource.com; Mon, 03 Sep 2012 13:33:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8Wlz-00071s-PI
	for xen-changelog@lists.xensource.com; Mon, 03 Sep 2012 13:33:03 +0000
Message-Id: <E1T8Wlz-00071s-PI@xenbits.xen.org>
Date: Mon, 03 Sep 2012 13: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] x86-64: fix hypercall page
	unwind info
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1346678334 -7200
# Node ID 341104e962db9697186669899917bc3c8ed59525
# Parent  af558aa67990007d3570f68931be209f8c815a7f
x86-64: fix hypercall page unwind info

This apparently was a copy-and-paste oversight.

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


diff -r af558aa67990 -r 341104e962db arch/x86_64/kernel/head-xen.S
--- a/arch/x86_64/kernel/head-xen.S	Mon Sep 03 15:17:36 2012 +0200
+++ b/arch/x86_64/kernel/head-xen.S	Mon Sep 03 15:18:54 2012 +0200
@@ -86,7 +86,7 @@ NEXT_PAGE(hypercall_page)
 	CFI_REL_OFFSET	rcx,0
 	.skip 2 /* push %r11 */
 	CFI_ADJUST_CFA_OFFSET	8
-	CFI_REL_OFFSET	rcx,0
+	CFI_REL_OFFSET	r11,0
 	.skip 5 /* mov $#,%eax */
 	.skip 2 /* syscall */
 	.skip 2 /* pop %r11 */

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 14:44:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 14:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T8uMQ-00023F-6J; Tue, 04 Sep 2012 14:44:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8uMO-00022y-II
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:12 +0000
Received: from [85.158.139.83:6272] by server-3.bemta-5.messagelabs.com id
	83/B0-21836-BB316405; Tue, 04 Sep 2012 14:44:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-182.messagelabs.com!1346769849!28795534!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=ML_RADAR_SPEW_LINKS_23,
	spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29761 invoked from network); 4 Sep 2012 14:44: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;
	4 Sep 2012 14: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 1T8uML-0002PM-Lw
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8uML-0000pX-B6
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:09 +0000
Message-Id: <E1T8uML-0000pX-B6@xenbits.xen.org>
Date: Tue, 04 Sep 2012 14:44:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] README: Update references to PyXML
	to lxml
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <Ian.Campbell@citrix.com>
# Date 1346406124 -3600
# Node ID ebe7b65c6f5952b8e5a4f332a1b71706e67a7fba
# Parent  b199b9d71c4533442d0e11c74dda31f17c53cb75
README: Update references to PyXML to lxml

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


diff -r b199b9d71c45 -r ebe7b65c6f59 README
--- a/README	Fri Aug 31 10:42:03 2012 +0100
+++ b/README	Fri Aug 31 10:42:04 2012 +0100
@@ -148,9 +148,9 @@ Xend (the Xen daemon) has the following 
           URL:    http://www.pangalactic.org/PyPAM/
           Debian: python-pam
 
-    * For optional XenAPI support in XM, PyXML:
-          URL:    http://codespeak.net/lxml/
-	  Debian: python-lxml
+    * For optional XenAPI support in XM, lxml:
+          URL:    http://lxml.de/
+          Debian: python-lxml
           YUM:    python-lxml
 
 

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 14:44:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 14:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T8uMQ-00023F-6J; Tue, 04 Sep 2012 14:44:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8uMO-00022y-II
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:12 +0000
Received: from [85.158.139.83:6272] by server-3.bemta-5.messagelabs.com id
	83/B0-21836-BB316405; Tue, 04 Sep 2012 14:44:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-182.messagelabs.com!1346769849!28795534!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=ML_RADAR_SPEW_LINKS_23,
	spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29761 invoked from network); 4 Sep 2012 14:44: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;
	4 Sep 2012 14: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 1T8uML-0002PM-Lw
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8uML-0000pX-B6
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:09 +0000
Message-Id: <E1T8uML-0000pX-B6@xenbits.xen.org>
Date: Tue, 04 Sep 2012 14:44:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] README: Update references to PyXML
	to lxml
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <Ian.Campbell@citrix.com>
# Date 1346406124 -3600
# Node ID ebe7b65c6f5952b8e5a4f332a1b71706e67a7fba
# Parent  b199b9d71c4533442d0e11c74dda31f17c53cb75
README: Update references to PyXML to lxml

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


diff -r b199b9d71c45 -r ebe7b65c6f59 README
--- a/README	Fri Aug 31 10:42:03 2012 +0100
+++ b/README	Fri Aug 31 10:42:04 2012 +0100
@@ -148,9 +148,9 @@ Xend (the Xen daemon) has the following 
           URL:    http://www.pangalactic.org/PyPAM/
           Debian: python-pam
 
-    * For optional XenAPI support in XM, PyXML:
-          URL:    http://codespeak.net/lxml/
-	  Debian: python-lxml
+    * For optional XenAPI support in XM, lxml:
+          URL:    http://lxml.de/
+          Debian: python-lxml
           YUM:    python-lxml
 
 

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 14:44:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 14:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T8uMR-00023f-E3; Tue, 04 Sep 2012 14:44:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8uMQ-000239-5g
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:14 +0000
Received: from [85.158.143.99:37858] by server-1.bemta-4.messagelabs.com id
	FA/69-12504-DB316405; Tue, 04 Sep 2012 14:44:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-216.messagelabs.com!1346769851!23150431!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10390 invoked from network); 4 Sep 2012 14:44:12 -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;
	4 Sep 2012 14:44: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 1T8uMN-0002PV-0f
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8uMM-0000qG-SN
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:10 +0000
Message-Id: <E1T8uMM-0000qG-SN@xenbits.xen.org>
Date: Tue, 04 Sep 2012 14:44:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hotplug/NetBSD: write error message
	to hotplug-error
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Roger Pau Monne <roger.pau@citrix.com>
# Date 1346406126 -3600
# Node ID e1f6699e54f4cd6d3c284913a332c4e9d648f550
# Parent  9abb6d9344b9f495d917cc9fa5dc29f338ae9f31
hotplug/NetBSD: write error message to hotplug-error

As recommended by Ian Campbell, write the hotplug error to
hotplug-error, just as the Linux hotplug script does.

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


diff -r 9abb6d9344b9 -r e1f6699e54f4 tools/hotplug/NetBSD/block
--- a/tools/hotplug/NetBSD/block	Fri Aug 31 10:42:05 2012 +0100
+++ b/tools/hotplug/NetBSD/block	Fri Aug 31 10:42:06 2012 +0100
@@ -12,7 +12,8 @@ export PATH
 
 error() {
 	echo "$@" >&2
-	xenstore-write $xpath/hotplug-status error
+	xenstore-write $xpath/hotplug-status error \
+	               $xpath/hotplug-error "$@"
 	exit 1
 }
 	

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 14:44:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 14:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T8uMR-00023f-E3; Tue, 04 Sep 2012 14:44:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8uMQ-000239-5g
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:14 +0000
Received: from [85.158.143.99:37858] by server-1.bemta-4.messagelabs.com id
	FA/69-12504-DB316405; Tue, 04 Sep 2012 14:44:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-216.messagelabs.com!1346769851!23150431!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10390 invoked from network); 4 Sep 2012 14:44:12 -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;
	4 Sep 2012 14:44: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 1T8uMN-0002PV-0f
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8uMM-0000qG-SN
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:10 +0000
Message-Id: <E1T8uMM-0000qG-SN@xenbits.xen.org>
Date: Tue, 04 Sep 2012 14:44:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hotplug/NetBSD: write error message
	to hotplug-error
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Roger Pau Monne <roger.pau@citrix.com>
# Date 1346406126 -3600
# Node ID e1f6699e54f4cd6d3c284913a332c4e9d648f550
# Parent  9abb6d9344b9f495d917cc9fa5dc29f338ae9f31
hotplug/NetBSD: write error message to hotplug-error

As recommended by Ian Campbell, write the hotplug error to
hotplug-error, just as the Linux hotplug script does.

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


diff -r 9abb6d9344b9 -r e1f6699e54f4 tools/hotplug/NetBSD/block
--- a/tools/hotplug/NetBSD/block	Fri Aug 31 10:42:05 2012 +0100
+++ b/tools/hotplug/NetBSD/block	Fri Aug 31 10:42:06 2012 +0100
@@ -12,7 +12,8 @@ export PATH
 
 error() {
 	echo "$@" >&2
-	xenstore-write $xpath/hotplug-status error
+	xenstore-write $xpath/hotplug-status error \
+	               $xpath/hotplug-error "$@"
 	exit 1
 }
 	

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 14:44:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 14: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.xen.org>)
	id 1T8uMT-00024J-Lq; Tue, 04 Sep 2012 14:44:17 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8uMS-00023r-8Z
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:16 +0000
Received: from [85.158.139.83:6766] by server-5.bemta-5.messagelabs.com id
	2F/ED-30514-FB316405; Tue, 04 Sep 2012 14:44:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1346769853!24568945!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14820 invoked from network); 4 Sep 2012 14:44: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;
	4 Sep 2012 14:44: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 1T8uMP-0002Pk-IQ
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8uMP-0000rW-HE
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:13 +0000
Message-Id: <E1T8uMP-0000rW-HE@xenbits.xen.org>
Date: Tue, 04 Sep 2012 14:44:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xencommons: Attempt to load blktap2
	driver
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <Ian.Campbell@citrix.com>
# Date 1346408028 -3600
# Node ID f2905910f7315481b96109b0f8e266edec185628
# Parent  49625db443bcefc5088a417d595b18630cf42547
xencommons: Attempt to load blktap2 driver

Older kernels, such as those found in Debian Squeeze:
* Have bugs in handling of AIO into foreign pages
* Have blktap modules, which will cause qemu not to use AIO, but
  which are not loaded on boot.

Attempt to load blktap in xencommons, to make sure modern qemu's which
use AIO will work properly on those kernels.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

Prefer to load blktap2 if it exists. This is the name of the driver in
classic-Xen ports, while in mainline kernels the driver is called just
blktap.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Jan Beulich <JBeulich@suse.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 49625db443bc -r f2905910f731 tools/hotplug/Linux/init.d/xencommons
--- a/tools/hotplug/Linux/init.d/xencommons	Fri Aug 31 10:42:09 2012 +0100
+++ b/tools/hotplug/Linux/init.d/xencommons	Fri Aug 31 11:13:48 2012 +0100
@@ -68,6 +68,7 @@ do_start () {
 	modprobe usbbk 2>/dev/null
 	modprobe pciback 2>/dev/null
 	modprobe xen-acpi-processor 2>/dev/null
+	modprobe blktap2 2>/dev/null || modprobe blktap 2>/dev/null
 	mkdir -p /var/run/xen
 
 	if ! `xenstore-read -s / >/dev/null 2>&1`

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 14:44:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 14: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.xen.org>)
	id 1T8uMU-00024Z-Om; Tue, 04 Sep 2012 14:44:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8uMT-00023y-1g
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:17 +0000
Received: from [85.158.143.35:6349] by server-2.bemta-4.messagelabs.com id
	85/0A-21239-0C316405; Tue, 04 Sep 2012 14:44:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-21.messagelabs.com!1346769854!11098295!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19687 invoked from network); 4 Sep 2012 14:44:15 -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;
	4 Sep 2012 14:44: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 1T8uMQ-0002Pn-3o
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8uMQ-0000rl-2F
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:14 +0000
Message-Id: <E1T8uMQ-0000rl-2F@xenbits.xen.org>
Date: Tue, 04 Sep 2012 14:44:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools: remove --disable-pythontools
	option
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <Ian.Campbell@citrix.com>
# Date 1346408029 -3600
# Node ID 1dfbae8dd282da8eff8d765714eaa27bb581bb46
# Parent  f2905910f7315481b96109b0f8e266edec185628
tools: remove --disable-pythontools option

This incorrectly removes the $(PYTHON) variable which is used at build
time as well as by the tools.

Remove and revisit for 4.3.

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


diff -r f2905910f731 -r 1dfbae8dd282 config/Tools.mk.in
--- a/config/Tools.mk.in	Fri Aug 31 11:13:48 2012 +0100
+++ b/config/Tools.mk.in	Fri Aug 31 11:13:49 2012 +0100
@@ -45,7 +45,6 @@ GIT_HTTP            := @githttp@
 XENSTAT_XENTOP      := @monitors@
 VTPM_TOOLS          := @vtpm@
 LIBXENAPI_BINDINGS  := @xenapi@
-PYTHON_TOOLS        := @pythontools@
 OCAML_TOOLS         := @ocamltools@
 CONFIG_MINITERM     := @miniterm@
 CONFIG_LOMOUNT      := @lomount@
diff -r f2905910f731 -r 1dfbae8dd282 tools/Makefile
--- a/tools/Makefile	Fri Aug 31 11:13:48 2012 +0100
+++ b/tools/Makefile	Fri Aug 31 11:13:49 2012 +0100
@@ -48,8 +48,8 @@ SUBDIRS-$(CONFIG_TESTS) += tests
 
 # These don't cross-compile
 ifeq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH))
-SUBDIRS-$(PYTHON_TOOLS) += python
-SUBDIRS-$(PYTHON_TOOLS) += pygrub
+SUBDIRS-y += python
+SUBDIRS-y += pygrub
 SUBDIRS-$(OCAML_TOOLS) += ocaml
 endif
 
diff -r f2905910f731 -r 1dfbae8dd282 tools/configure
--- a/tools/configure	Fri Aug 31 11:13:48 2012 +0100
+++ b/tools/configure	Fri Aug 31 11:13:49 2012 +0100
@@ -664,7 +664,6 @@ ovmf
 lomount
 miniterm
 ocamltools
-pythontools
 xenapi
 vtpm
 monitors
@@ -722,7 +721,6 @@ enable_githttp
 enable_monitors
 enable_vtpm
 enable_xenapi
-enable_pythontools
 enable_ocamltools
 enable_miniterm
 enable_lomount
@@ -1383,7 +1381,6 @@ Optional Features:
   --enable-vtpm           Enable Virtual Trusted Platform Module (default is
                           DISABLED)
   --enable-xenapi         Enable Xen API Bindings (default is DISABLED)
-  --disable-pythontools   Disable Python tools (default is ENABLED)
   --disable-ocamltools    Disable Ocaml tools (default is ENABLED)
   --enable-miniterm       Enable miniterm (default is DISABLED)
   --enable-lomount        Enable lomount (default is DISABLED)
@@ -2486,29 +2483,6 @@ xenapi=$ax_cv_xenapi
 
 
 
-# Check whether --enable-pythontools was given.
-if test "${enable_pythontools+set}" = set; then :
-  enableval=$enable_pythontools;
-fi
-
-
-if test "x$enable_pythontools" = "xno"; then :
-
-    ax_cv_pythontools="n"
-
-elif test "x$enable_pythontools" = "xyes"; then :
-
-    ax_cv_pythontools="y"
-
-elif test -z $ax_cv_pythontools; then :
-
-    ax_cv_pythontools="y"
-
-fi
-pythontools=$ax_cv_pythontools
-
-
-
 # Check whether --enable-ocamltools was given.
 if test "${enable_ocamltools+set}" = set; then :
   enableval=$enable_ocamltools;
@@ -4897,6 +4871,74 @@ if test x"${BASH}" == x"no"
 then
     as_fn_error $? "Unable to find bash, please install bash" "$LINENO" 5
 fi
+if echo "$PYTHON" | grep -q "^/"; then :
+
+    PYTHONPATH=$PYTHON
+    PYTHON=`basename $PYTHONPATH`
+
+elif test -z "$PYTHON"; then :
+  PYTHON="python"
+else
+  as_fn_error $? "PYTHON specified, but is not an absolute path" "$LINENO" 5
+fi
+# Extract the first word of "$PYTHON", so it can be a program name with args.
+set dummy $PYTHON; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_PYTHONPATH+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PYTHONPATH in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PYTHONPATH="$PYTHONPATH" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PYTHONPATH="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_PYTHONPATH" && ac_cv_path_PYTHONPATH="no"
+  ;;
+esac
+fi
+PYTHONPATH=$ac_cv_path_PYTHONPATH
+if test -n "$PYTHONPATH"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHONPATH" >&5
+$as_echo "$PYTHONPATH" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+if test x"${PYTHONPATH}" == x"no"
+then
+    as_fn_error $? "Unable to find $PYTHON, please install $PYTHON" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for python version >= 2.3 " >&5
+$as_echo_n "checking for python version >= 2.3 ... " >&6; }
+`$PYTHON -c 'import sys; sys.exit(eval("sys.version_info < (2, 3)"))'`
+if test "$?" != "0"
+then
+    python_version=`$PYTHON -V 2>&1`
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    as_fn_error $? "$python_version is too old, minimum required version is 2.3" "$LINENO" 5
+else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
 
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
@@ -5295,76 +5337,6 @@ fi
 done
 
 
-if test "x$pythontools" = "xy"; then :
-
-    if echo "$PYTHON" | grep -q "^/"; then :
-
-        PYTHONPATH=$PYTHON
-        PYTHON=`basename $PYTHONPATH`
-
-elif test -z "$PYTHON"; then :
-  PYTHON="python"
-else
-  as_fn_error $? "PYTHON specified, but is not an absolute path" "$LINENO" 5
-fi
-    # Extract the first word of "$PYTHON", so it can be a program name with args.
-set dummy $PYTHON; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PYTHONPATH+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $PYTHONPATH in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_PYTHONPATH="$PYTHONPATH" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_PYTHONPATH="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  test -z "$ac_cv_path_PYTHONPATH" && ac_cv_path_PYTHONPATH="no"
-  ;;
-esac
-fi
-PYTHONPATH=$ac_cv_path_PYTHONPATH
-if test -n "$PYTHONPATH"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHONPATH" >&5
-$as_echo "$PYTHONPATH" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-if test x"${PYTHONPATH}" == x"no"
-then
-    as_fn_error $? "Unable to find $PYTHON, please install $PYTHON" "$LINENO" 5
-fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python version >= 2.3 " >&5
-$as_echo_n "checking for python version >= 2.3 ... " >&6; }
-`$PYTHON -c 'import sys; sys.exit(eval("sys.version_info < (2, 3)"))'`
-if test "$?" != "0"
-then
-    python_version=`$PYTHON -V 2>&1`
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-    as_fn_error $? "$python_version is too old, minimum required version is 2.3" "$LINENO" 5
-else
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-fi
 
 ac_previous_cppflags=$CPPFLAGS
 ac_previous_ldflags=$LDFLAGS
@@ -5496,9 +5468,7 @@ fi
 CPPFLAGS=$ac_previous_cppflags
 LDLFAGS=$ac_previous_ldflags
 
-
-fi
- # Extract the first word of "xgettext", so it can be a program name with args.
+# Extract the first word of "xgettext", so it can be a program name with args.
 set dummy xgettext; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
diff -r f2905910f731 -r 1dfbae8dd282 tools/configure.ac
--- a/tools/configure.ac	Fri Aug 31 11:13:48 2012 +0100
+++ b/tools/configure.ac	Fri Aug 31 11:13:49 2012 +0100
@@ -40,7 +40,6 @@ AX_ARG_DEFAULT_DISABLE([githttp], [Downl
 AX_ARG_DEFAULT_ENABLE([monitors], [Disable xenstat and xentop monitoring tools])
 AX_ARG_DEFAULT_DISABLE([vtpm], [Enable Virtual Trusted Platform Module])
 AX_ARG_DEFAULT_DISABLE([xenapi], [Enable Xen API Bindings])
-AX_ARG_DEFAULT_ENABLE([pythontools], [Disable Python tools])
 AX_ARG_DEFAULT_ENABLE([ocamltools], [Disable Ocaml tools])
 AX_ARG_DEFAULT_DISABLE([miniterm], [Enable miniterm])
 AX_ARG_DEFAULT_DISABLE([lomount], [Enable lomount])
@@ -93,17 +92,15 @@ AS_IF([test "x$ocamltools" = "xy"], [
     ])
 ])
 AX_PATH_PROG_OR_FAIL([BASH], [bash])
-AS_IF([test "x$pythontools" = "xy"], [
-    AS_IF([echo "$PYTHON" | grep -q "^/"], [
-        PYTHONPATH=$PYTHON
-        PYTHON=`basename $PYTHONPATH`
-    ],[test -z "$PYTHON"], [PYTHON="python"],
-    [AC_MSG_ERROR([PYTHON specified, but is not an absolute path])])
-    AX_PATH_PROG_OR_FAIL([PYTHONPATH], [$PYTHON])
-    AX_CHECK_PYTHON_VERSION([2], [3])
-     AX_CHECK_PYTHON_DEVEL()
- ])
- AX_PATH_PROG_OR_FAIL([XGETTEXT], [xgettext])
+AS_IF([echo "$PYTHON" | grep -q "^/"], [
+    PYTHONPATH=$PYTHON
+    PYTHON=`basename $PYTHONPATH`
+],[test -z "$PYTHON"], [PYTHON="python"],
+[AC_MSG_ERROR([PYTHON specified, but is not an absolute path])])
+AX_PATH_PROG_OR_FAIL([PYTHONPATH], [$PYTHON])
+AX_CHECK_PYTHON_VERSION([2], [3])
+ AX_CHECK_PYTHON_DEVEL()
+AX_PATH_PROG_OR_FAIL([XGETTEXT], [xgettext])
 dnl as86, ld86, bcc and iasl are only required when the host system is x86*.
 dnl "host" here means the platform on which the hypervisor and tools is
 dnl going to run, not the platform on which we are building (known as

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 14:44:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 14: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.xen.org>)
	id 1T8uMT-00024J-Lq; Tue, 04 Sep 2012 14:44:17 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8uMS-00023r-8Z
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:16 +0000
Received: from [85.158.139.83:6766] by server-5.bemta-5.messagelabs.com id
	2F/ED-30514-FB316405; Tue, 04 Sep 2012 14:44:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1346769853!24568945!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14820 invoked from network); 4 Sep 2012 14:44: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;
	4 Sep 2012 14:44: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 1T8uMP-0002Pk-IQ
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8uMP-0000rW-HE
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:13 +0000
Message-Id: <E1T8uMP-0000rW-HE@xenbits.xen.org>
Date: Tue, 04 Sep 2012 14:44:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xencommons: Attempt to load blktap2
	driver
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <Ian.Campbell@citrix.com>
# Date 1346408028 -3600
# Node ID f2905910f7315481b96109b0f8e266edec185628
# Parent  49625db443bcefc5088a417d595b18630cf42547
xencommons: Attempt to load blktap2 driver

Older kernels, such as those found in Debian Squeeze:
* Have bugs in handling of AIO into foreign pages
* Have blktap modules, which will cause qemu not to use AIO, but
  which are not loaded on boot.

Attempt to load blktap in xencommons, to make sure modern qemu's which
use AIO will work properly on those kernels.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

Prefer to load blktap2 if it exists. This is the name of the driver in
classic-Xen ports, while in mainline kernels the driver is called just
blktap.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Jan Beulich <JBeulich@suse.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 49625db443bc -r f2905910f731 tools/hotplug/Linux/init.d/xencommons
--- a/tools/hotplug/Linux/init.d/xencommons	Fri Aug 31 10:42:09 2012 +0100
+++ b/tools/hotplug/Linux/init.d/xencommons	Fri Aug 31 11:13:48 2012 +0100
@@ -68,6 +68,7 @@ do_start () {
 	modprobe usbbk 2>/dev/null
 	modprobe pciback 2>/dev/null
 	modprobe xen-acpi-processor 2>/dev/null
+	modprobe blktap2 2>/dev/null || modprobe blktap 2>/dev/null
 	mkdir -p /var/run/xen
 
 	if ! `xenstore-read -s / >/dev/null 2>&1`

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 14:44:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 14: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.xen.org>)
	id 1T8uMU-00024Z-Om; Tue, 04 Sep 2012 14:44:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8uMT-00023y-1g
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:17 +0000
Received: from [85.158.143.35:6349] by server-2.bemta-4.messagelabs.com id
	85/0A-21239-0C316405; Tue, 04 Sep 2012 14:44:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-21.messagelabs.com!1346769854!11098295!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19687 invoked from network); 4 Sep 2012 14:44:15 -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;
	4 Sep 2012 14:44: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 1T8uMQ-0002Pn-3o
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8uMQ-0000rl-2F
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:14 +0000
Message-Id: <E1T8uMQ-0000rl-2F@xenbits.xen.org>
Date: Tue, 04 Sep 2012 14:44:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools: remove --disable-pythontools
	option
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <Ian.Campbell@citrix.com>
# Date 1346408029 -3600
# Node ID 1dfbae8dd282da8eff8d765714eaa27bb581bb46
# Parent  f2905910f7315481b96109b0f8e266edec185628
tools: remove --disable-pythontools option

This incorrectly removes the $(PYTHON) variable which is used at build
time as well as by the tools.

Remove and revisit for 4.3.

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


diff -r f2905910f731 -r 1dfbae8dd282 config/Tools.mk.in
--- a/config/Tools.mk.in	Fri Aug 31 11:13:48 2012 +0100
+++ b/config/Tools.mk.in	Fri Aug 31 11:13:49 2012 +0100
@@ -45,7 +45,6 @@ GIT_HTTP            := @githttp@
 XENSTAT_XENTOP      := @monitors@
 VTPM_TOOLS          := @vtpm@
 LIBXENAPI_BINDINGS  := @xenapi@
-PYTHON_TOOLS        := @pythontools@
 OCAML_TOOLS         := @ocamltools@
 CONFIG_MINITERM     := @miniterm@
 CONFIG_LOMOUNT      := @lomount@
diff -r f2905910f731 -r 1dfbae8dd282 tools/Makefile
--- a/tools/Makefile	Fri Aug 31 11:13:48 2012 +0100
+++ b/tools/Makefile	Fri Aug 31 11:13:49 2012 +0100
@@ -48,8 +48,8 @@ SUBDIRS-$(CONFIG_TESTS) += tests
 
 # These don't cross-compile
 ifeq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH))
-SUBDIRS-$(PYTHON_TOOLS) += python
-SUBDIRS-$(PYTHON_TOOLS) += pygrub
+SUBDIRS-y += python
+SUBDIRS-y += pygrub
 SUBDIRS-$(OCAML_TOOLS) += ocaml
 endif
 
diff -r f2905910f731 -r 1dfbae8dd282 tools/configure
--- a/tools/configure	Fri Aug 31 11:13:48 2012 +0100
+++ b/tools/configure	Fri Aug 31 11:13:49 2012 +0100
@@ -664,7 +664,6 @@ ovmf
 lomount
 miniterm
 ocamltools
-pythontools
 xenapi
 vtpm
 monitors
@@ -722,7 +721,6 @@ enable_githttp
 enable_monitors
 enable_vtpm
 enable_xenapi
-enable_pythontools
 enable_ocamltools
 enable_miniterm
 enable_lomount
@@ -1383,7 +1381,6 @@ Optional Features:
   --enable-vtpm           Enable Virtual Trusted Platform Module (default is
                           DISABLED)
   --enable-xenapi         Enable Xen API Bindings (default is DISABLED)
-  --disable-pythontools   Disable Python tools (default is ENABLED)
   --disable-ocamltools    Disable Ocaml tools (default is ENABLED)
   --enable-miniterm       Enable miniterm (default is DISABLED)
   --enable-lomount        Enable lomount (default is DISABLED)
@@ -2486,29 +2483,6 @@ xenapi=$ax_cv_xenapi
 
 
 
-# Check whether --enable-pythontools was given.
-if test "${enable_pythontools+set}" = set; then :
-  enableval=$enable_pythontools;
-fi
-
-
-if test "x$enable_pythontools" = "xno"; then :
-
-    ax_cv_pythontools="n"
-
-elif test "x$enable_pythontools" = "xyes"; then :
-
-    ax_cv_pythontools="y"
-
-elif test -z $ax_cv_pythontools; then :
-
-    ax_cv_pythontools="y"
-
-fi
-pythontools=$ax_cv_pythontools
-
-
-
 # Check whether --enable-ocamltools was given.
 if test "${enable_ocamltools+set}" = set; then :
   enableval=$enable_ocamltools;
@@ -4897,6 +4871,74 @@ if test x"${BASH}" == x"no"
 then
     as_fn_error $? "Unable to find bash, please install bash" "$LINENO" 5
 fi
+if echo "$PYTHON" | grep -q "^/"; then :
+
+    PYTHONPATH=$PYTHON
+    PYTHON=`basename $PYTHONPATH`
+
+elif test -z "$PYTHON"; then :
+  PYTHON="python"
+else
+  as_fn_error $? "PYTHON specified, but is not an absolute path" "$LINENO" 5
+fi
+# Extract the first word of "$PYTHON", so it can be a program name with args.
+set dummy $PYTHON; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_PYTHONPATH+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PYTHONPATH in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PYTHONPATH="$PYTHONPATH" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PYTHONPATH="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_PYTHONPATH" && ac_cv_path_PYTHONPATH="no"
+  ;;
+esac
+fi
+PYTHONPATH=$ac_cv_path_PYTHONPATH
+if test -n "$PYTHONPATH"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHONPATH" >&5
+$as_echo "$PYTHONPATH" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+if test x"${PYTHONPATH}" == x"no"
+then
+    as_fn_error $? "Unable to find $PYTHON, please install $PYTHON" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for python version >= 2.3 " >&5
+$as_echo_n "checking for python version >= 2.3 ... " >&6; }
+`$PYTHON -c 'import sys; sys.exit(eval("sys.version_info < (2, 3)"))'`
+if test "$?" != "0"
+then
+    python_version=`$PYTHON -V 2>&1`
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    as_fn_error $? "$python_version is too old, minimum required version is 2.3" "$LINENO" 5
+else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
 
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
@@ -5295,76 +5337,6 @@ fi
 done
 
 
-if test "x$pythontools" = "xy"; then :
-
-    if echo "$PYTHON" | grep -q "^/"; then :
-
-        PYTHONPATH=$PYTHON
-        PYTHON=`basename $PYTHONPATH`
-
-elif test -z "$PYTHON"; then :
-  PYTHON="python"
-else
-  as_fn_error $? "PYTHON specified, but is not an absolute path" "$LINENO" 5
-fi
-    # Extract the first word of "$PYTHON", so it can be a program name with args.
-set dummy $PYTHON; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PYTHONPATH+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $PYTHONPATH in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_PYTHONPATH="$PYTHONPATH" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_PYTHONPATH="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  test -z "$ac_cv_path_PYTHONPATH" && ac_cv_path_PYTHONPATH="no"
-  ;;
-esac
-fi
-PYTHONPATH=$ac_cv_path_PYTHONPATH
-if test -n "$PYTHONPATH"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHONPATH" >&5
-$as_echo "$PYTHONPATH" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-if test x"${PYTHONPATH}" == x"no"
-then
-    as_fn_error $? "Unable to find $PYTHON, please install $PYTHON" "$LINENO" 5
-fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python version >= 2.3 " >&5
-$as_echo_n "checking for python version >= 2.3 ... " >&6; }
-`$PYTHON -c 'import sys; sys.exit(eval("sys.version_info < (2, 3)"))'`
-if test "$?" != "0"
-then
-    python_version=`$PYTHON -V 2>&1`
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-    as_fn_error $? "$python_version is too old, minimum required version is 2.3" "$LINENO" 5
-else
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-fi
 
 ac_previous_cppflags=$CPPFLAGS
 ac_previous_ldflags=$LDFLAGS
@@ -5496,9 +5468,7 @@ fi
 CPPFLAGS=$ac_previous_cppflags
 LDLFAGS=$ac_previous_ldflags
 
-
-fi
- # Extract the first word of "xgettext", so it can be a program name with args.
+# Extract the first word of "xgettext", so it can be a program name with args.
 set dummy xgettext; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
diff -r f2905910f731 -r 1dfbae8dd282 tools/configure.ac
--- a/tools/configure.ac	Fri Aug 31 11:13:48 2012 +0100
+++ b/tools/configure.ac	Fri Aug 31 11:13:49 2012 +0100
@@ -40,7 +40,6 @@ AX_ARG_DEFAULT_DISABLE([githttp], [Downl
 AX_ARG_DEFAULT_ENABLE([monitors], [Disable xenstat and xentop monitoring tools])
 AX_ARG_DEFAULT_DISABLE([vtpm], [Enable Virtual Trusted Platform Module])
 AX_ARG_DEFAULT_DISABLE([xenapi], [Enable Xen API Bindings])
-AX_ARG_DEFAULT_ENABLE([pythontools], [Disable Python tools])
 AX_ARG_DEFAULT_ENABLE([ocamltools], [Disable Ocaml tools])
 AX_ARG_DEFAULT_DISABLE([miniterm], [Enable miniterm])
 AX_ARG_DEFAULT_DISABLE([lomount], [Enable lomount])
@@ -93,17 +92,15 @@ AS_IF([test "x$ocamltools" = "xy"], [
     ])
 ])
 AX_PATH_PROG_OR_FAIL([BASH], [bash])
-AS_IF([test "x$pythontools" = "xy"], [
-    AS_IF([echo "$PYTHON" | grep -q "^/"], [
-        PYTHONPATH=$PYTHON
-        PYTHON=`basename $PYTHONPATH`
-    ],[test -z "$PYTHON"], [PYTHON="python"],
-    [AC_MSG_ERROR([PYTHON specified, but is not an absolute path])])
-    AX_PATH_PROG_OR_FAIL([PYTHONPATH], [$PYTHON])
-    AX_CHECK_PYTHON_VERSION([2], [3])
-     AX_CHECK_PYTHON_DEVEL()
- ])
- AX_PATH_PROG_OR_FAIL([XGETTEXT], [xgettext])
+AS_IF([echo "$PYTHON" | grep -q "^/"], [
+    PYTHONPATH=$PYTHON
+    PYTHON=`basename $PYTHONPATH`
+],[test -z "$PYTHON"], [PYTHON="python"],
+[AC_MSG_ERROR([PYTHON specified, but is not an absolute path])])
+AX_PATH_PROG_OR_FAIL([PYTHONPATH], [$PYTHON])
+AX_CHECK_PYTHON_VERSION([2], [3])
+ AX_CHECK_PYTHON_DEVEL()
+AX_PATH_PROG_OR_FAIL([XGETTEXT], [xgettext])
 dnl as86, ld86, bcc and iasl are only required when the host system is x86*.
 dnl "host" here means the platform on which the hypervisor and tools is
 dnl going to run, not the platform on which we are building (known as

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 14:44:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 14:44:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T8uMQ-00023T-BM; Tue, 04 Sep 2012 14:44: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 1T8uMP-000234-AY
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:13 +0000
Received: from [85.158.138.51:14005] by server-11.bemta-3.messagelabs.com id
	BA/3B-30250-CB316405; Tue, 04 Sep 2012 14:44:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1346769849!28594736!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28515 invoked from network); 4 Sep 2012 14:44:10 -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;
	4 Sep 2012 14: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 1T8uML-0002PJ-0Q
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8uMK-0000pI-NX
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:08 +0000
Message-Id: <E1T8uMK-0000pI-NX@xenbits.xen.org>
Date: Tue, 04 Sep 2012 14:44:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: improve documentation of Xen
	command line parameters
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Matt Wilson <msw@amazon.com>
# Date 1346406123 -3600
# Node ID b199b9d71c4533442d0e11c74dda31f17c53cb75
# Parent  9e5665f9f430a25e3447431047f1cea59320667f
docs: improve documentation of Xen command line parameters

This change improves documentation for several Xen command line
parameters. Some of the Itanium-specific options are now removed. A
more thorough check should be performed to remove any other remnants.

I've reformatted some of the entries to fit in 80 column terminals.

Options that are yet undocumented but accept standard boolean /
integer values are now annotated as such.

The size suffixes have been corrected to use the binary prefixes
instead of decimal prefixes.

Signed-off-by: Matt Wilson <msw@amazon.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 9e5665f9f430 -r b199b9d71c45 docs/misc/xen-command-line.markdown
--- a/docs/misc/xen-command-line.markdown	Thu Aug 30 18:17:20 2012 +0100
+++ b/docs/misc/xen-command-line.markdown	Fri Aug 31 10:42:03 2012 +0100
@@ -46,9 +46,9 @@ if a leading `0` is present.
 
 A size parameter may be any integer, with a size suffix
 
-* `G` or `g`: Giga (2^30)
-* `M` or `m`: Mega (2^20)
-* `K` or `k`: Kilo (2^10)
+* `G` or `g`: GiB (2^30)
+* `M` or `m`: MiB (2^20)
+* `K` or `k`: KiB (2^10)
 * `B` or `b`: Bytes
 
 Without a size suffix, the default will be kilo.
@@ -107,8 +107,10 @@ Specify which ACPI MADT table to parse f
 than one is present.
 
 ### acpi\_pstate\_strict
+> `= <integer>`
 
 ### acpi\_skip\_timer\_override
+> `= <boolean>`
 
 Instruct Xen to ignore timer-interrupt override.
 
@@ -117,6 +119,8 @@ the domain 0 kernel this option is autom
 domain 0 command line
 
 ### acpi\_sleep
+> `= s3_bios | s3_mode`
+
 ### allowsuperpage
 > `= <boolean>`
 
@@ -136,12 +140,12 @@ there are more than 8 CPUs, Xen will swi
 
 > Default: `false`
 
-Force boot on potentially unsafe systems. By default Xen will refuse to boot on
-systems with the following errata:
+Force boot on potentially unsafe systems. By default Xen will refuse
+to boot on systems with the following errata:
 
 * AMD Erratum 121. Processors with this erratum are subject to a guest
-  triggerable Denial of Service. Override only if you trust all of your PV
-  guests.
+  triggerable Denial of Service. Override only if you trust all of
+  your PV guests.
 
 ### apic\_verbosity
 > `= verbose | debug`
@@ -153,15 +157,16 @@ Increase the verbosity of the APIC code 
 
 > Default: `true`
 
-Permits Xen to set up and use PCI Address Translation Services, which is required
-for PCI Passthrough.
+Permits Xen to set up and use PCI Address Translation Services, which
+is required for PCI Passthrough.
 
 ### availmem
 > `= <size>`
 
 > Default: `0` (no limit)
 
-Specify a maximum amount of available memory, to which Xen will clamp the e820 table.
+Specify a maximum amount of available memory, to which Xen will clamp
+the e820 table.
 
 ### badpage
 > `= List of [ <integer> | <integer>-<integer> ]`
@@ -176,8 +181,9 @@ Xen's command line.
 
 > Default: `true`
 
-Scrub free RAM during boot.  This is a safety feature to prevent accidentally leaking
-sensitive VM data into other VMs if Xen crashes and reboots.
+Scrub free RAM during boot.  This is a safety feature to prevent
+accidentally leaking sensitive VM data into other VMs if Xen crashes
+and reboots.
 
 ### cachesize
 > `= <size>`
@@ -227,7 +233,6 @@ Both option `com1` and `com2` follow the
 
 A typical setup for most situations might be `com1=115200,8n1`
 
-
 ### conring\_size
 > `= <size>`
 
@@ -300,25 +305,30 @@ Indicate where the responsibility for dr
 ### cpuid\_mask\_cpu (AMD only)
 > `= fam_0f_rev_c | fam_0f_rev_d | fam_0f_rev_e | fam_0f_rev_f | fam_0f_rev_g | fam_10_rev_b | fam_10_rev_c | fam_11_rev_b`
 
-If the other **cpuid\_mask\_{,ext\_}e{c,d}x** options are fully set (unspecified
-on the command line), specify a pre-canned cpuid mask to mask the current
-processor down to appear as the specified processor.  It is important to ensure
-that all hosts in a pool appear the same to guests to allow successful live
-migration.
+If the other **cpuid\_mask\_{,ext\_}e{c,d}x** options are fully set
+(unspecified on the command line), specify a pre-canned cpuid mask to
+mask the current processor down to appear as the specified processor.
+It is important to ensure that all hosts in a pool appear the same to
+guests to allow successful live migration.
 
 ### cpuid\_mask\_ ecx,edx,ext\_ecx,ext\_edx,xsave_eax
 > `= <integer>`
 
 > Default: `~0` (all bits set)
 
-These five command line parameters are used to specify cpuid masks to help with
-cpuid levelling across a pool of hosts.  Setting a bit in the mask indicates that
-the feature should be enabled, while clearing a bit in the mask indicates that
-the feature should be disabled.  It is important to ensure that all hosts in a
-pool appear the same to guests to allow successful live migration.
+These five command line parameters are used to specify cpuid masks to
+help with cpuid levelling across a pool of hosts.  Setting a bit in
+the mask indicates that the feature should be enabled, while clearing
+a bit in the mask indicates that the feature should be disabled.  It
+is important to ensure that all hosts in a pool appear the same to
+guests to allow successful live migration.
 
 ### cpuidle
+> `= <boolean>`
+
 ### cpuinfo
+> `= <boolean>`
+
 ### crashinfo_maxaddr
 > `= <size>`
 
@@ -328,17 +338,42 @@ Specify the maximum address to allocate 
 combination with the `low_crashinfo` command line option.
 
 ### crashkernel
+> `= <ramsize-range>:<size>[,...][@<offset>]`
+
 ### credit2\_balance\_over
+> `= <integer>`
+
 ### credit2\_balance\_under
+> `= <integer>`
+
 ### credit2\_load\_window\_shift
+> `= <integer>`
+
 ### debug\_stack\_lines
+> `= <integer>`
+
+> Default: `20`
+
+Limits the number lines printed in Xen stack traces.
+
 ### debugtrace
+> `= <integer>`
+
+> Default: `128`
+
+Specify the size of the console debug trace buffer in KiB. The debug
+trace feature is only enabled in debugging builds of Xen.
+
 ### dma\_bits
 > `= <integer>`
 
 Specify the bit width of the DMA heap.
 
 ### dom0\_ioports\_disable
+> `= List of <hex>-<hex>`
+
+Specify a list of IO ports to be excluded from dom0 access.
+
 ### dom0\_max\_vcpus
 > `= <integer>`
 
@@ -372,6 +407,8 @@ For example, to set dom0's initial memor
 allow it to balloon up as far as 1GB use `dom0_mem=512M,max:1G`
 
 ### dom0\_shadow
+> `= <boolean>`
+
 ### dom0\_vcpus\_pin
 > `= <boolean>`
 
@@ -379,10 +416,21 @@ allow it to balloon up as far as 1GB use
 
 Pin dom0 vcpus to their respective pcpus
 
-### dom0\_vhpt\_size\_log2
-### dom\_rid\_bits
 ### e820-mtrr-clip
+> `= <boolean>`
+
+Flag that specifies if RAM should be clipped to the highest cacheable
+MTRR.
+
+> Default: `true` on Intel CPUs, otherwise `false`
+
 ### e820-verbose
+> `= <boolean>`
+
+> Default: `false`
+
+Flag that enables verbose output when processing e820 information and
+applying clipping.
 
 ### edd (x86)
 > `= off | on | skipmbr`
@@ -397,17 +445,32 @@ Either force retrieval of monitor EDID i
 disable it (edid=no). This option should not normally be required
 except for debugging purposes.
 
-### efi\_print
 ### extra\_guest\_irqs
 > `= <number>`
 
 Increase the number of PIRQs available for the guest. The default is 32. 
 
 ### flask\_enabled
+> `= <integer>`
+
 ### flask\_enforcing
+> `= <integer>`
+
 ### font
+> `= <height>` where height is `8x8 | 8x14 | 8x16 '`
+
+Specify the font size when using the VESA console driver.
+
 ### gdb
+> `= <baud>[/<clock_hz>][,DPS[,<io-base>[,<irq>[,<port-bdf>[,<bridge-bdf>]]]] | pci | amt ] `
+
+Specify the serial parameters for the GDB stub.
+
 ### gnttab\_max\_nr\_frames
+> `= <integer>`
+
+Specify the maximum number of frames per grant table operation.
+
 ### guest\_loglvl
 > `= <level>[/<rate-limited level>]` where level is `none | error | warning | info | debug | all`
 
@@ -420,15 +483,41 @@ The optional `<rate-limited level>` opti
 should be rate limited.
 
 ### hap\_1gb
+> `= <boolean>`
+
+> Default: `true`
+
+Flag to enable 1 GB host page table support for Hardware Assisted
+Paging (HAP).
+
 ### hap\_2mb
+> `= <boolean>`
+
+> Default: `true`
+
+Flag to enable 1 GB host page table support for Hardware Assisted
+Paging (HAP).
+
 ### hpetbroadcast
+> `= <boolean>`
+
 ### hvm\_debug
+> `= <integer>`
+
 ### hvm\_port80
+> `= <boolean>`
+
 ### idle\_latency\_factor
+> `= <integer>`
+
 ### ioapic\_ack
 ### iommu
 ### iommu\_inclusive\_mapping
+> `= <boolean>`
+
 ### irq\_ratelimit
+> `= <integer>`
+
 ### irq\_vector\_map
 ### lapic
 
@@ -437,7 +526,11 @@ if left disabled by the BIOS.  This opti
 all.
 
 ### lapic\_timer\_c2\_ok
+> `= <boolean>`
+
 ### ler
+> `= <boolean>`
+
 ### loglvl
 > `= <level>[/<rate-limited level>]` where level is `none | error | warning | info | debug | all`
 
@@ -461,18 +554,38 @@ so the crash kernel may find find them. 
 with **crashinfo_maxaddr**.
 
 ### max\_cstate
+> `= <integer>`
+
 ### max\_gsi\_irqs
+> `= <integer>`
+
 ### maxcpus
+> `= <integer>`
+
 ### mce
+> `= <integer>`
+
 ### mce\_fb
+> `= <integer>`
+
 ### mce\_verbosity
+> `= verbose`
+
+Specify verbose machine check output.
+
 ### mem
 > `= <size>`
 
-Specifies the maximum address of physical RAM.  Any RAM beyond this
+Specify the maximum address of physical RAM.  Any RAM beyond this
 limit is ignored by Xen.
 
 ### mmcfg
+> `= <boolean>[,amd-fam10]`
+
+> Default: `1`
+
+Specify if the MMConfig space should be enabled.
+
 ### nmi
 > `= ignore | dom0 | fatal`
 
@@ -493,6 +606,8 @@ domain 0 kernel this option is automatic
 0 command line.
 
 ### nofxsr
+> `= <boolean>`
+
 ### noirqbalance
 > `= <boolean>`
 
@@ -501,11 +616,15 @@ systems such as Dell 1850/2850 that have
 IRQ routing issues.
 
 ### nolapic
+> `= <boolean>`
+
+> Default: `false`
 
 Ignore the local APIC on a uniprocessor system, even if enabled by the
 BIOS.  This option will accept value.
 
 ### no-real-mode (x86)
+> `= <boolean>`
 
 Do not execute real-mode bootstrap code when booting Xen. This option
 should not be used except for debugging. It will effectively disable
@@ -519,6 +638,10 @@ catching debug output.  Defaults to auto
 seconds.
 
 ### noserialnumber
+> `= <boolean>`
+
+Disable CPU serial number reporting.
+
 ### nosmp
 > `= <boolean>`
 
@@ -526,11 +649,39 @@ Disable SMP support.  No secondary proce
 Defaults to booting secondary processors.
 
 ### nr\_irqs
+> `= <integer>`
+
 ### numa
-### pervcpu\_vhpt
+> `= on | off | fake=<integer> | noacpi`
+
+Default: `on`
+
 ### ple\_gap
+> `= <integer>`
+
 ### ple\_window
+> `= <integer>`
+
 ### reboot
+> `= b[ios] | t[riple] | k[bd] | n[o] [, [w]arm | [c]old]`
+
+Default: `0`
+
+Specify the host reboot method.
+
+`warm` instructs Xen to not set the cold reboot flag.
+
+`cold` instructs Xen to set the cold reboot flag.
+
+`bios` instructs Xen to reboot the host by jumping to BIOS. This is
+only available on 32-bit x86 platforms.
+
+`triple` instructs Xen to reboot the host by causing a triple fault.
+
+`kbd` instructs Xen to reboot the host via the keyboard controller.
+
+`acpi` instructs Xen to reboot the host using RESET_REG in the ACPI FADT.
+
 ### sched
 > `= credit | credit2 | sedf | arinc653`
 
@@ -539,10 +690,20 @@ Defaults to booting secondary processors
 Choose the default scheduler.
 
 ### sched\_credit2\_migrate\_resist
+> `= <integer>`
+
 ### sched\_credit\_default\_yield
+> `= <boolean>`
+
 ### sched\_credit\_tslice\_ms
+> `= <integer>`
+
 ### sched\_ratelimit\_us
+> `= <integer>`
+
 ### sched\_smt\_power\_savings
+> `= <boolean>`
+
 ### serial\_tx\_buffer
 > `= <size>`
 
@@ -551,7 +712,15 @@ Choose the default scheduler.
 Set the serial transmit buffer size.
 
 ### smep
+> `= <boolean>`
+
+> Default: `true`
+
+Flag to enable Supervisor Mode Execution Protection
+
 ### snb\_igd\_quirk
+> `= <boolean>`
+
 ### sync\_console
 > `= <boolean>`
 
@@ -561,28 +730,80 @@ Flag to force synchronous console output
 not suitable for production environments due to incurred overhead.
 
 ### tboot
+> `= 0x<phys_addr>`
+
+Specify the physical address of the trusted boot shared page.
+
 ### tbuf\_size
 > `= <integer>`
 
 Specify the per-cpu trace buffer size in pages.
 
 ### tdt
+> `= <boolean>`
+
+> Default: `true`
+
+Flag to enable TSC deadline as the APIC timer mode.
+
 ### tevt\_mask
+> `= <integer>`
+
+Specify a mask for Xen event tracing. This allows Xen tracing to be
+enabled at boot. Refer to the xentrace(8) documentation for a list of
+valid event mask values. In order to enable tracing, a buffer size (in
+pages) must also be specified via the tbuf\_size parameter.
+
 ### tickle\_one\_idle\_cpu
+> `= <boolean>`
+
 ### timer\_slop
+> `= <integer>`
+
 ### tmem
+> `= <boolean>`
+
 ### tmem\_compress
+> `= <boolean>`
+
 ### tmem\_dedup
+> `= <boolean>`
+
 ### tmem\_lock
+> `= <integer>`
+
 ### tmem\_shared\_auth
+> `= <boolean>`
+
 ### tmem\_tze
+> `= <integer>`
+
 ### tsc
+> `= unstable | skewed`
+
 ### ucode
 ### unrestricted\_guest
+> `= <boolean>`
+
 ### vcpu\_migration\_delay
+> `= <integer>`
+
+> Default: `0`
+
+Specify a delay, in microseconds, between migrations of a VCPU between
+PCPUs when using the credit1 scheduler. This prevents rapid fluttering
+of a VCPU between CPUs, and reduces the implicit overheads such as
+cache-warming. 1ms (1000) has been measured as a good value.
+
 ### vesa-map
+> `= <integer>`
+
 ### vesa-mtrr
+> `= <integer>`
+
 ### vesa-ram
+> `= <integer>`
+
 ### vga
 > `= ( ask | current | text-80x<rows> | gfx-<width>x<height>x<depth> | mode-<mode> )[,keep]`
 

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 14:44:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 14:44:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T8uMQ-00023T-BM; Tue, 04 Sep 2012 14:44: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 1T8uMP-000234-AY
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:13 +0000
Received: from [85.158.138.51:14005] by server-11.bemta-3.messagelabs.com id
	BA/3B-30250-CB316405; Tue, 04 Sep 2012 14:44:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1346769849!28594736!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28515 invoked from network); 4 Sep 2012 14:44:10 -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;
	4 Sep 2012 14: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 1T8uML-0002PJ-0Q
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8uMK-0000pI-NX
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:08 +0000
Message-Id: <E1T8uMK-0000pI-NX@xenbits.xen.org>
Date: Tue, 04 Sep 2012 14:44:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: improve documentation of Xen
	command line parameters
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Matt Wilson <msw@amazon.com>
# Date 1346406123 -3600
# Node ID b199b9d71c4533442d0e11c74dda31f17c53cb75
# Parent  9e5665f9f430a25e3447431047f1cea59320667f
docs: improve documentation of Xen command line parameters

This change improves documentation for several Xen command line
parameters. Some of the Itanium-specific options are now removed. A
more thorough check should be performed to remove any other remnants.

I've reformatted some of the entries to fit in 80 column terminals.

Options that are yet undocumented but accept standard boolean /
integer values are now annotated as such.

The size suffixes have been corrected to use the binary prefixes
instead of decimal prefixes.

Signed-off-by: Matt Wilson <msw@amazon.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 9e5665f9f430 -r b199b9d71c45 docs/misc/xen-command-line.markdown
--- a/docs/misc/xen-command-line.markdown	Thu Aug 30 18:17:20 2012 +0100
+++ b/docs/misc/xen-command-line.markdown	Fri Aug 31 10:42:03 2012 +0100
@@ -46,9 +46,9 @@ if a leading `0` is present.
 
 A size parameter may be any integer, with a size suffix
 
-* `G` or `g`: Giga (2^30)
-* `M` or `m`: Mega (2^20)
-* `K` or `k`: Kilo (2^10)
+* `G` or `g`: GiB (2^30)
+* `M` or `m`: MiB (2^20)
+* `K` or `k`: KiB (2^10)
 * `B` or `b`: Bytes
 
 Without a size suffix, the default will be kilo.
@@ -107,8 +107,10 @@ Specify which ACPI MADT table to parse f
 than one is present.
 
 ### acpi\_pstate\_strict
+> `= <integer>`
 
 ### acpi\_skip\_timer\_override
+> `= <boolean>`
 
 Instruct Xen to ignore timer-interrupt override.
 
@@ -117,6 +119,8 @@ the domain 0 kernel this option is autom
 domain 0 command line
 
 ### acpi\_sleep
+> `= s3_bios | s3_mode`
+
 ### allowsuperpage
 > `= <boolean>`
 
@@ -136,12 +140,12 @@ there are more than 8 CPUs, Xen will swi
 
 > Default: `false`
 
-Force boot on potentially unsafe systems. By default Xen will refuse to boot on
-systems with the following errata:
+Force boot on potentially unsafe systems. By default Xen will refuse
+to boot on systems with the following errata:
 
 * AMD Erratum 121. Processors with this erratum are subject to a guest
-  triggerable Denial of Service. Override only if you trust all of your PV
-  guests.
+  triggerable Denial of Service. Override only if you trust all of
+  your PV guests.
 
 ### apic\_verbosity
 > `= verbose | debug`
@@ -153,15 +157,16 @@ Increase the verbosity of the APIC code 
 
 > Default: `true`
 
-Permits Xen to set up and use PCI Address Translation Services, which is required
-for PCI Passthrough.
+Permits Xen to set up and use PCI Address Translation Services, which
+is required for PCI Passthrough.
 
 ### availmem
 > `= <size>`
 
 > Default: `0` (no limit)
 
-Specify a maximum amount of available memory, to which Xen will clamp the e820 table.
+Specify a maximum amount of available memory, to which Xen will clamp
+the e820 table.
 
 ### badpage
 > `= List of [ <integer> | <integer>-<integer> ]`
@@ -176,8 +181,9 @@ Xen's command line.
 
 > Default: `true`
 
-Scrub free RAM during boot.  This is a safety feature to prevent accidentally leaking
-sensitive VM data into other VMs if Xen crashes and reboots.
+Scrub free RAM during boot.  This is a safety feature to prevent
+accidentally leaking sensitive VM data into other VMs if Xen crashes
+and reboots.
 
 ### cachesize
 > `= <size>`
@@ -227,7 +233,6 @@ Both option `com1` and `com2` follow the
 
 A typical setup for most situations might be `com1=115200,8n1`
 
-
 ### conring\_size
 > `= <size>`
 
@@ -300,25 +305,30 @@ Indicate where the responsibility for dr
 ### cpuid\_mask\_cpu (AMD only)
 > `= fam_0f_rev_c | fam_0f_rev_d | fam_0f_rev_e | fam_0f_rev_f | fam_0f_rev_g | fam_10_rev_b | fam_10_rev_c | fam_11_rev_b`
 
-If the other **cpuid\_mask\_{,ext\_}e{c,d}x** options are fully set (unspecified
-on the command line), specify a pre-canned cpuid mask to mask the current
-processor down to appear as the specified processor.  It is important to ensure
-that all hosts in a pool appear the same to guests to allow successful live
-migration.
+If the other **cpuid\_mask\_{,ext\_}e{c,d}x** options are fully set
+(unspecified on the command line), specify a pre-canned cpuid mask to
+mask the current processor down to appear as the specified processor.
+It is important to ensure that all hosts in a pool appear the same to
+guests to allow successful live migration.
 
 ### cpuid\_mask\_ ecx,edx,ext\_ecx,ext\_edx,xsave_eax
 > `= <integer>`
 
 > Default: `~0` (all bits set)
 
-These five command line parameters are used to specify cpuid masks to help with
-cpuid levelling across a pool of hosts.  Setting a bit in the mask indicates that
-the feature should be enabled, while clearing a bit in the mask indicates that
-the feature should be disabled.  It is important to ensure that all hosts in a
-pool appear the same to guests to allow successful live migration.
+These five command line parameters are used to specify cpuid masks to
+help with cpuid levelling across a pool of hosts.  Setting a bit in
+the mask indicates that the feature should be enabled, while clearing
+a bit in the mask indicates that the feature should be disabled.  It
+is important to ensure that all hosts in a pool appear the same to
+guests to allow successful live migration.
 
 ### cpuidle
+> `= <boolean>`
+
 ### cpuinfo
+> `= <boolean>`
+
 ### crashinfo_maxaddr
 > `= <size>`
 
@@ -328,17 +338,42 @@ Specify the maximum address to allocate 
 combination with the `low_crashinfo` command line option.
 
 ### crashkernel
+> `= <ramsize-range>:<size>[,...][@<offset>]`
+
 ### credit2\_balance\_over
+> `= <integer>`
+
 ### credit2\_balance\_under
+> `= <integer>`
+
 ### credit2\_load\_window\_shift
+> `= <integer>`
+
 ### debug\_stack\_lines
+> `= <integer>`
+
+> Default: `20`
+
+Limits the number lines printed in Xen stack traces.
+
 ### debugtrace
+> `= <integer>`
+
+> Default: `128`
+
+Specify the size of the console debug trace buffer in KiB. The debug
+trace feature is only enabled in debugging builds of Xen.
+
 ### dma\_bits
 > `= <integer>`
 
 Specify the bit width of the DMA heap.
 
 ### dom0\_ioports\_disable
+> `= List of <hex>-<hex>`
+
+Specify a list of IO ports to be excluded from dom0 access.
+
 ### dom0\_max\_vcpus
 > `= <integer>`
 
@@ -372,6 +407,8 @@ For example, to set dom0's initial memor
 allow it to balloon up as far as 1GB use `dom0_mem=512M,max:1G`
 
 ### dom0\_shadow
+> `= <boolean>`
+
 ### dom0\_vcpus\_pin
 > `= <boolean>`
 
@@ -379,10 +416,21 @@ allow it to balloon up as far as 1GB use
 
 Pin dom0 vcpus to their respective pcpus
 
-### dom0\_vhpt\_size\_log2
-### dom\_rid\_bits
 ### e820-mtrr-clip
+> `= <boolean>`
+
+Flag that specifies if RAM should be clipped to the highest cacheable
+MTRR.
+
+> Default: `true` on Intel CPUs, otherwise `false`
+
 ### e820-verbose
+> `= <boolean>`
+
+> Default: `false`
+
+Flag that enables verbose output when processing e820 information and
+applying clipping.
 
 ### edd (x86)
 > `= off | on | skipmbr`
@@ -397,17 +445,32 @@ Either force retrieval of monitor EDID i
 disable it (edid=no). This option should not normally be required
 except for debugging purposes.
 
-### efi\_print
 ### extra\_guest\_irqs
 > `= <number>`
 
 Increase the number of PIRQs available for the guest. The default is 32. 
 
 ### flask\_enabled
+> `= <integer>`
+
 ### flask\_enforcing
+> `= <integer>`
+
 ### font
+> `= <height>` where height is `8x8 | 8x14 | 8x16 '`
+
+Specify the font size when using the VESA console driver.
+
 ### gdb
+> `= <baud>[/<clock_hz>][,DPS[,<io-base>[,<irq>[,<port-bdf>[,<bridge-bdf>]]]] | pci | amt ] `
+
+Specify the serial parameters for the GDB stub.
+
 ### gnttab\_max\_nr\_frames
+> `= <integer>`
+
+Specify the maximum number of frames per grant table operation.
+
 ### guest\_loglvl
 > `= <level>[/<rate-limited level>]` where level is `none | error | warning | info | debug | all`
 
@@ -420,15 +483,41 @@ The optional `<rate-limited level>` opti
 should be rate limited.
 
 ### hap\_1gb
+> `= <boolean>`
+
+> Default: `true`
+
+Flag to enable 1 GB host page table support for Hardware Assisted
+Paging (HAP).
+
 ### hap\_2mb
+> `= <boolean>`
+
+> Default: `true`
+
+Flag to enable 1 GB host page table support for Hardware Assisted
+Paging (HAP).
+
 ### hpetbroadcast
+> `= <boolean>`
+
 ### hvm\_debug
+> `= <integer>`
+
 ### hvm\_port80
+> `= <boolean>`
+
 ### idle\_latency\_factor
+> `= <integer>`
+
 ### ioapic\_ack
 ### iommu
 ### iommu\_inclusive\_mapping
+> `= <boolean>`
+
 ### irq\_ratelimit
+> `= <integer>`
+
 ### irq\_vector\_map
 ### lapic
 
@@ -437,7 +526,11 @@ if left disabled by the BIOS.  This opti
 all.
 
 ### lapic\_timer\_c2\_ok
+> `= <boolean>`
+
 ### ler
+> `= <boolean>`
+
 ### loglvl
 > `= <level>[/<rate-limited level>]` where level is `none | error | warning | info | debug | all`
 
@@ -461,18 +554,38 @@ so the crash kernel may find find them. 
 with **crashinfo_maxaddr**.
 
 ### max\_cstate
+> `= <integer>`
+
 ### max\_gsi\_irqs
+> `= <integer>`
+
 ### maxcpus
+> `= <integer>`
+
 ### mce
+> `= <integer>`
+
 ### mce\_fb
+> `= <integer>`
+
 ### mce\_verbosity
+> `= verbose`
+
+Specify verbose machine check output.
+
 ### mem
 > `= <size>`
 
-Specifies the maximum address of physical RAM.  Any RAM beyond this
+Specify the maximum address of physical RAM.  Any RAM beyond this
 limit is ignored by Xen.
 
 ### mmcfg
+> `= <boolean>[,amd-fam10]`
+
+> Default: `1`
+
+Specify if the MMConfig space should be enabled.
+
 ### nmi
 > `= ignore | dom0 | fatal`
 
@@ -493,6 +606,8 @@ domain 0 kernel this option is automatic
 0 command line.
 
 ### nofxsr
+> `= <boolean>`
+
 ### noirqbalance
 > `= <boolean>`
 
@@ -501,11 +616,15 @@ systems such as Dell 1850/2850 that have
 IRQ routing issues.
 
 ### nolapic
+> `= <boolean>`
+
+> Default: `false`
 
 Ignore the local APIC on a uniprocessor system, even if enabled by the
 BIOS.  This option will accept value.
 
 ### no-real-mode (x86)
+> `= <boolean>`
 
 Do not execute real-mode bootstrap code when booting Xen. This option
 should not be used except for debugging. It will effectively disable
@@ -519,6 +638,10 @@ catching debug output.  Defaults to auto
 seconds.
 
 ### noserialnumber
+> `= <boolean>`
+
+Disable CPU serial number reporting.
+
 ### nosmp
 > `= <boolean>`
 
@@ -526,11 +649,39 @@ Disable SMP support.  No secondary proce
 Defaults to booting secondary processors.
 
 ### nr\_irqs
+> `= <integer>`
+
 ### numa
-### pervcpu\_vhpt
+> `= on | off | fake=<integer> | noacpi`
+
+Default: `on`
+
 ### ple\_gap
+> `= <integer>`
+
 ### ple\_window
+> `= <integer>`
+
 ### reboot
+> `= b[ios] | t[riple] | k[bd] | n[o] [, [w]arm | [c]old]`
+
+Default: `0`
+
+Specify the host reboot method.
+
+`warm` instructs Xen to not set the cold reboot flag.
+
+`cold` instructs Xen to set the cold reboot flag.
+
+`bios` instructs Xen to reboot the host by jumping to BIOS. This is
+only available on 32-bit x86 platforms.
+
+`triple` instructs Xen to reboot the host by causing a triple fault.
+
+`kbd` instructs Xen to reboot the host via the keyboard controller.
+
+`acpi` instructs Xen to reboot the host using RESET_REG in the ACPI FADT.
+
 ### sched
 > `= credit | credit2 | sedf | arinc653`
 
@@ -539,10 +690,20 @@ Defaults to booting secondary processors
 Choose the default scheduler.
 
 ### sched\_credit2\_migrate\_resist
+> `= <integer>`
+
 ### sched\_credit\_default\_yield
+> `= <boolean>`
+
 ### sched\_credit\_tslice\_ms
+> `= <integer>`
+
 ### sched\_ratelimit\_us
+> `= <integer>`
+
 ### sched\_smt\_power\_savings
+> `= <boolean>`
+
 ### serial\_tx\_buffer
 > `= <size>`
 
@@ -551,7 +712,15 @@ Choose the default scheduler.
 Set the serial transmit buffer size.
 
 ### smep
+> `= <boolean>`
+
+> Default: `true`
+
+Flag to enable Supervisor Mode Execution Protection
+
 ### snb\_igd\_quirk
+> `= <boolean>`
+
 ### sync\_console
 > `= <boolean>`
 
@@ -561,28 +730,80 @@ Flag to force synchronous console output
 not suitable for production environments due to incurred overhead.
 
 ### tboot
+> `= 0x<phys_addr>`
+
+Specify the physical address of the trusted boot shared page.
+
 ### tbuf\_size
 > `= <integer>`
 
 Specify the per-cpu trace buffer size in pages.
 
 ### tdt
+> `= <boolean>`
+
+> Default: `true`
+
+Flag to enable TSC deadline as the APIC timer mode.
+
 ### tevt\_mask
+> `= <integer>`
+
+Specify a mask for Xen event tracing. This allows Xen tracing to be
+enabled at boot. Refer to the xentrace(8) documentation for a list of
+valid event mask values. In order to enable tracing, a buffer size (in
+pages) must also be specified via the tbuf\_size parameter.
+
 ### tickle\_one\_idle\_cpu
+> `= <boolean>`
+
 ### timer\_slop
+> `= <integer>`
+
 ### tmem
+> `= <boolean>`
+
 ### tmem\_compress
+> `= <boolean>`
+
 ### tmem\_dedup
+> `= <boolean>`
+
 ### tmem\_lock
+> `= <integer>`
+
 ### tmem\_shared\_auth
+> `= <boolean>`
+
 ### tmem\_tze
+> `= <integer>`
+
 ### tsc
+> `= unstable | skewed`
+
 ### ucode
 ### unrestricted\_guest
+> `= <boolean>`
+
 ### vcpu\_migration\_delay
+> `= <integer>`
+
+> Default: `0`
+
+Specify a delay, in microseconds, between migrations of a VCPU between
+PCPUs when using the credit1 scheduler. This prevents rapid fluttering
+of a VCPU between CPUs, and reduces the implicit overheads such as
+cache-warming. 1ms (1000) has been measured as a good value.
+
 ### vesa-map
+> `= <integer>`
+
 ### vesa-mtrr
+> `= <integer>`
+
 ### vesa-ram
+> `= <integer>`
+
 ### vga
 > `= ( ask | current | text-80x<rows> | gfx-<width>x<height>x<depth> | mode-<mode> )[,keep]`
 

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 14:44:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 14:44:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T8uMQ-00023K-8r; Tue, 04 Sep 2012 14:44: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 1T8uMO-00022z-V5
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:13 +0000
Received: from [85.158.138.51:13932] by server-4.bemta-3.messagelabs.com id
	44/99-24831-CB316405; Tue, 04 Sep 2012 14:44:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-174.messagelabs.com!1346769850!20546386!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18796 invoked from network); 4 Sep 2012 14:44:11 -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;
	4 Sep 2012 14: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 1T8uMM-0002PP-3w
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8uML-0000pm-S9
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:09 +0000
Message-Id: <E1T8uML-0000pm-S9@xenbits.xen.org>
Date: Tue, 04 Sep 2012 14:44:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenconsoled: clean-up after all dead
	domains
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User David Vrabel <david.vrabel@citrix.com>
# Date 1346406124 -3600
# Node ID 574d7bd438e56f0c2370653f0e740651a66bcdbd
# Parent  ebe7b65c6f5952b8e5a4f332a1b71706e67a7fba
xenconsoled: clean-up after all dead domains

xenconsoled expected domains that are being shutdown to end up in the
the DYING state and would only clean-up such domains.  HVM domains
either didn't enter the DYING state or weren't in long enough for
xenconsoled to notice.

For every shutdown HVM domain, xenconsoled would leak memory, grow its
list of domains and (if guest console logging was enabled) leak the
log file descriptor.  If the file descriptors were leaked and enough
HVM domains were shutdown, no more console connections would work as
the evtchn device could not be opened.  Guests would then block
waiting to send console output.

Fix this by tagging domains that exist in enum_domains().  Afterwards,
all untagged domains are assumed to be dead and are shutdown and
cleaned up.

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


diff -r ebe7b65c6f59 -r 574d7bd438e5 tools/console/daemon/io.c
--- a/tools/console/daemon/io.c	Fri Aug 31 10:42:04 2012 +0100
+++ b/tools/console/daemon/io.c	Fri Aug 31 10:42:04 2012 +0100
@@ -84,6 +84,7 @@ struct domain {
 	int slave_fd;
 	int log_fd;
 	bool is_dead;
+	unsigned last_seen;
 	struct buffer buffer;
 	struct domain *next;
 	char *conspath;
@@ -727,12 +728,16 @@ static void shutdown_domain(struct domai
 	d->xce_handle = NULL;
 }
 
+static unsigned enum_pass = 0;
+
 void enum_domains(void)
 {
 	int domid = 1;
 	xc_dominfo_t dominfo;
 	struct domain *dom;
 
+	enum_pass++;
+
 	while (xc_domain_getinfo(xc, domid, 1, &dominfo) == 1) {
 		dom = lookup_domain(dominfo.domid);
 		if (dominfo.dying) {
@@ -740,8 +745,10 @@ void enum_domains(void)
 				shutdown_domain(dom);
 		} else {
 			if (dom == NULL)
-				create_domain(dominfo.domid);
+				dom = create_domain(dominfo.domid);
 		}
+		if (dom)
+			dom->last_seen = enum_pass;
 		domid = dominfo.domid + 1;
 	}
 }
@@ -1069,6 +1076,9 @@ void handle_io(void)
 							   &writefds))
 				handle_tty_write(d);
 
+			if (d->last_seen != enum_pass)
+				shutdown_domain(d);
+
 			if (d->is_dead)
 				cleanup_domain(d);
 		}

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 14:44:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 14:44:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T8uMQ-00023K-8r; Tue, 04 Sep 2012 14:44: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 1T8uMO-00022z-V5
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:13 +0000
Received: from [85.158.138.51:13932] by server-4.bemta-3.messagelabs.com id
	44/99-24831-CB316405; Tue, 04 Sep 2012 14:44:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-174.messagelabs.com!1346769850!20546386!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18796 invoked from network); 4 Sep 2012 14:44:11 -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;
	4 Sep 2012 14: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 1T8uMM-0002PP-3w
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8uML-0000pm-S9
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:09 +0000
Message-Id: <E1T8uML-0000pm-S9@xenbits.xen.org>
Date: Tue, 04 Sep 2012 14:44:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenconsoled: clean-up after all dead
	domains
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User David Vrabel <david.vrabel@citrix.com>
# Date 1346406124 -3600
# Node ID 574d7bd438e56f0c2370653f0e740651a66bcdbd
# Parent  ebe7b65c6f5952b8e5a4f332a1b71706e67a7fba
xenconsoled: clean-up after all dead domains

xenconsoled expected domains that are being shutdown to end up in the
the DYING state and would only clean-up such domains.  HVM domains
either didn't enter the DYING state or weren't in long enough for
xenconsoled to notice.

For every shutdown HVM domain, xenconsoled would leak memory, grow its
list of domains and (if guest console logging was enabled) leak the
log file descriptor.  If the file descriptors were leaked and enough
HVM domains were shutdown, no more console connections would work as
the evtchn device could not be opened.  Guests would then block
waiting to send console output.

Fix this by tagging domains that exist in enum_domains().  Afterwards,
all untagged domains are assumed to be dead and are shutdown and
cleaned up.

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


diff -r ebe7b65c6f59 -r 574d7bd438e5 tools/console/daemon/io.c
--- a/tools/console/daemon/io.c	Fri Aug 31 10:42:04 2012 +0100
+++ b/tools/console/daemon/io.c	Fri Aug 31 10:42:04 2012 +0100
@@ -84,6 +84,7 @@ struct domain {
 	int slave_fd;
 	int log_fd;
 	bool is_dead;
+	unsigned last_seen;
 	struct buffer buffer;
 	struct domain *next;
 	char *conspath;
@@ -727,12 +728,16 @@ static void shutdown_domain(struct domai
 	d->xce_handle = NULL;
 }
 
+static unsigned enum_pass = 0;
+
 void enum_domains(void)
 {
 	int domid = 1;
 	xc_dominfo_t dominfo;
 	struct domain *dom;
 
+	enum_pass++;
+
 	while (xc_domain_getinfo(xc, domid, 1, &dominfo) == 1) {
 		dom = lookup_domain(dominfo.domid);
 		if (dominfo.dying) {
@@ -740,8 +745,10 @@ void enum_domains(void)
 				shutdown_domain(dom);
 		} else {
 			if (dom == NULL)
-				create_domain(dominfo.domid);
+				dom = create_domain(dominfo.domid);
 		}
+		if (dom)
+			dom->last_seen = enum_pass;
 		domid = dominfo.domid + 1;
 	}
 }
@@ -1069,6 +1076,9 @@ void handle_io(void)
 							   &writefds))
 				handle_tty_write(d);
 
+			if (d->last_seen != enum_pass)
+				shutdown_domain(d);
+
 			if (d->is_dead)
 				cleanup_domain(d);
 		}

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 14:44:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 14: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.xen.org>)
	id 1T8uMS-000241-Gd; Tue, 04 Sep 2012 14:44:16 +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 1T8uMR-00023Y-Bb
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:15 +0000
Received: from [85.158.138.51:19219] by server-5.bemta-3.messagelabs.com id
	07/93-13133-EB316405; Tue, 04 Sep 2012 14:44:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-174.messagelabs.com!1346769852!20495604!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30724 invoked from network); 4 Sep 2012 14:44:13 -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;
	4 Sep 2012 14:44: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 1T8uMO-0002Pe-G4
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8uMO-0000r0-Ek
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:12 +0000
Message-Id: <E1T8uMO-0000r0-Ek@xenbits.xen.org>
Date: Tue, 04 Sep 2012 14:44:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] uninstall: push tools uninstall down
	into tools/Makefile
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <Ian.Campbell@citrix.com>
# Date 1346406128 -3600
# Node ID eac962bcabdec53a7d0f25a8203b601db4493b93
# Parent  be1f4a84783178467e2e4ad2bb5e124b6a9bb244
uninstall: push tools uninstall down into tools/Makefile

Many of the rules here depend on having run configure and the
variables which it defines in config/Tools.mk

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Looks-good: Jan Beulich <JBeulich@suse.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r be1f4a847831 -r eac962bcabde Makefile
--- a/Makefile	Fri Aug 31 10:42:08 2012 +0100
+++ b/Makefile	Fri Aug 31 10:42:08 2012 +0100
@@ -229,34 +229,7 @@ uninstall:
 	rm -f  $(D)$(SYSCONFIG_DIR)/xendomains
 	rm -f  $(D)$(SYSCONFIG_DIR)/xencommons
 	rm -rf $(D)/var/run/xen* $(D)/var/lib/xen*
-	rm -rf $(D)$(LIBDIR)/xen* $(D)$(BINDIR)/lomount
-	rm -rf $(D)$(BINDIR)/cpuperf-perfcntr $(D)$(BINDIR)/cpuperf-xen
-	rm -rf $(D)$(BINDIR)/xc_shadow
-	rm -rf $(D)$(BINDIR)/pygrub
-	rm -rf $(D)$(BINDIR)/setsize $(D)$(BINDIR)/tbctl
-	rm -rf $(D)$(BINDIR)/xsls
-	rm -rf $(D)$(BINDIR)/xenstore* $(D)$(BINDIR)/xentrace*
-	rm -rf $(D)$(BINDIR)/xen-detect $(D)$(BINDIR)/xencons
-	rm -rf $(D)$(BINDIR)/xenpvnetboot $(D)$(BINDIR)/qemu-*-xen
-	rm -rf $(D)$(INCLUDEDIR)/xenctrl* $(D)$(INCLUDEDIR)/xenguest.h
-	rm -rf $(D)$(INCLUDEDIR)/xs_lib.h $(D)$(INCLUDEDIR)/xs.h
-	rm -rf $(D)$(INCLUDEDIR)/xenstore-compat/xs_lib.h $(D)$(INCLUDEDIR)/xenstore-compat/xs.h
-	rm -rf $(D)$(INCLUDEDIR)/xenstore_lib.h $(D)$(INCLUDEDIR)/xenstore.h
-	rm -rf $(D)$(INCLUDEDIR)/xen
-	rm -rf $(D)$(INCLUDEDIR)/_libxl* $(D)$(INCLUDEDIR)/libxl*
-	rm -rf $(D)$(INCLUDEDIR)/xenstat.h $(D)$(INCLUDEDIR)/xentoollog.h
-	rm -rf $(D)$(LIBDIR)/libxenctrl* $(D)$(LIBDIR)/libxenguest*
-	rm -rf $(D)$(LIBDIR)/libxenstore* $(D)$(LIBDIR)/libxlutil*
-	rm -rf $(D)$(LIBDIR)/python/xen $(D)$(LIBDIR)/python/grub
-	rm -rf $(D)$(LIBDIR)/xen/
-	rm -rf $(D)$(LIBEXEC)/xen*
-	rm -rf $(D)$(SBINDIR)/setmask
-	rm -rf $(D)$(SBINDIR)/xen* $(D)$(SBINDIR)/netfix $(D)$(SBINDIR)/xm
-	rm -rf $(D)$(SHAREDIR)/doc/xen
-	rm -rf $(D)$(SHAREDIR)/xen
-	rm -rf $(D)$(SHAREDIR)/qemu-xen
-	rm -rf $(D)$(MAN1DIR)/xen*
-	rm -rf $(D)$(MAN8DIR)/xen*
+	make -C tools uninstall
 	rm -rf $(D)/boot/tboot*
 
 # Legacy targets for compatibility
diff -r be1f4a847831 -r eac962bcabde tools/Makefile
--- a/tools/Makefile	Fri Aug 31 10:42:08 2012 +0100
+++ b/tools/Makefile	Fri Aug 31 10:42:08 2012 +0100
@@ -71,6 +71,38 @@ install: subdirs-install
 	$(INSTALL_DIR) $(DESTDIR)/var/lib/xen
 	$(INSTALL_DIR) $(DESTDIR)/var/lock/subsys
 
+.PHONY: uninstall
+uninstall: D=$(DESTDIR)
+uninstall:
+	rm -rf $(D)$(LIBDIR)/xen* $(D)$(BINDIR)/lomount
+	rm -rf $(D)$(BINDIR)/cpuperf-perfcntr $(D)$(BINDIR)/cpuperf-xen
+	rm -rf $(D)$(BINDIR)/xc_shadow
+	rm -rf $(D)$(BINDIR)/pygrub
+	rm -rf $(D)$(BINDIR)/setsize $(D)$(BINDIR)/tbctl
+	rm -rf $(D)$(BINDIR)/xsls
+	rm -rf $(D)$(BINDIR)/xenstore* $(D)$(BINDIR)/xentrace*
+	rm -rf $(D)$(BINDIR)/xen-detect $(D)$(BINDIR)/xencons
+	rm -rf $(D)$(BINDIR)/xenpvnetboot $(D)$(BINDIR)/qemu-*-xen
+	rm -rf $(D)$(INCLUDEDIR)/xenctrl* $(D)$(INCLUDEDIR)/xenguest.h
+	rm -rf $(D)$(INCLUDEDIR)/xs_lib.h $(D)$(INCLUDEDIR)/xs.h
+	rm -rf $(D)$(INCLUDEDIR)/xenstore-compat/xs_lib.h $(D)$(INCLUDEDIR)/xenstore-compat/xs.h
+	rm -rf $(D)$(INCLUDEDIR)/xenstore_lib.h $(D)$(INCLUDEDIR)/xenstore.h
+	rm -rf $(D)$(INCLUDEDIR)/xen
+	rm -rf $(D)$(INCLUDEDIR)/_libxl* $(D)$(INCLUDEDIR)/libxl*
+	rm -rf $(D)$(INCLUDEDIR)/xenstat.h $(D)$(INCLUDEDIR)/xentoollog.h
+	rm -rf $(D)$(LIBDIR)/libxenctrl* $(D)$(LIBDIR)/libxenguest*
+	rm -rf $(D)$(LIBDIR)/libxenstore* $(D)$(LIBDIR)/libxlutil*
+	rm -rf $(D)$(LIBDIR)/python/xen $(D)$(LIBDIR)/python/grub
+	rm -rf $(D)$(LIBDIR)/xen/
+	rm -rf $(D)$(LIBEXEC)/xen*
+	rm -rf $(D)$(SBINDIR)/setmask
+	rm -rf $(D)$(SBINDIR)/xen* $(D)$(SBINDIR)/netfix $(D)$(SBINDIR)/xm
+	rm -rf $(D)$(SHAREDIR)/doc/xen
+	rm -rf $(D)$(SHAREDIR)/xen
+	rm -rf $(D)$(SHAREDIR)/qemu-xen
+	rm -rf $(D)$(MAN1DIR)/xen*
+	rm -rf $(D)$(MAN8DIR)/xen*
+
 .PHONY: clean
 clean: subdirs-clean
 

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 14:44:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 14: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.xen.org>)
	id 1T8uMS-000241-Gd; Tue, 04 Sep 2012 14:44:16 +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 1T8uMR-00023Y-Bb
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:15 +0000
Received: from [85.158.138.51:19219] by server-5.bemta-3.messagelabs.com id
	07/93-13133-EB316405; Tue, 04 Sep 2012 14:44:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-174.messagelabs.com!1346769852!20495604!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30724 invoked from network); 4 Sep 2012 14:44:13 -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;
	4 Sep 2012 14:44: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 1T8uMO-0002Pe-G4
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8uMO-0000r0-Ek
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:12 +0000
Message-Id: <E1T8uMO-0000r0-Ek@xenbits.xen.org>
Date: Tue, 04 Sep 2012 14:44:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] uninstall: push tools uninstall down
	into tools/Makefile
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <Ian.Campbell@citrix.com>
# Date 1346406128 -3600
# Node ID eac962bcabdec53a7d0f25a8203b601db4493b93
# Parent  be1f4a84783178467e2e4ad2bb5e124b6a9bb244
uninstall: push tools uninstall down into tools/Makefile

Many of the rules here depend on having run configure and the
variables which it defines in config/Tools.mk

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Looks-good: Jan Beulich <JBeulich@suse.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r be1f4a847831 -r eac962bcabde Makefile
--- a/Makefile	Fri Aug 31 10:42:08 2012 +0100
+++ b/Makefile	Fri Aug 31 10:42:08 2012 +0100
@@ -229,34 +229,7 @@ uninstall:
 	rm -f  $(D)$(SYSCONFIG_DIR)/xendomains
 	rm -f  $(D)$(SYSCONFIG_DIR)/xencommons
 	rm -rf $(D)/var/run/xen* $(D)/var/lib/xen*
-	rm -rf $(D)$(LIBDIR)/xen* $(D)$(BINDIR)/lomount
-	rm -rf $(D)$(BINDIR)/cpuperf-perfcntr $(D)$(BINDIR)/cpuperf-xen
-	rm -rf $(D)$(BINDIR)/xc_shadow
-	rm -rf $(D)$(BINDIR)/pygrub
-	rm -rf $(D)$(BINDIR)/setsize $(D)$(BINDIR)/tbctl
-	rm -rf $(D)$(BINDIR)/xsls
-	rm -rf $(D)$(BINDIR)/xenstore* $(D)$(BINDIR)/xentrace*
-	rm -rf $(D)$(BINDIR)/xen-detect $(D)$(BINDIR)/xencons
-	rm -rf $(D)$(BINDIR)/xenpvnetboot $(D)$(BINDIR)/qemu-*-xen
-	rm -rf $(D)$(INCLUDEDIR)/xenctrl* $(D)$(INCLUDEDIR)/xenguest.h
-	rm -rf $(D)$(INCLUDEDIR)/xs_lib.h $(D)$(INCLUDEDIR)/xs.h
-	rm -rf $(D)$(INCLUDEDIR)/xenstore-compat/xs_lib.h $(D)$(INCLUDEDIR)/xenstore-compat/xs.h
-	rm -rf $(D)$(INCLUDEDIR)/xenstore_lib.h $(D)$(INCLUDEDIR)/xenstore.h
-	rm -rf $(D)$(INCLUDEDIR)/xen
-	rm -rf $(D)$(INCLUDEDIR)/_libxl* $(D)$(INCLUDEDIR)/libxl*
-	rm -rf $(D)$(INCLUDEDIR)/xenstat.h $(D)$(INCLUDEDIR)/xentoollog.h
-	rm -rf $(D)$(LIBDIR)/libxenctrl* $(D)$(LIBDIR)/libxenguest*
-	rm -rf $(D)$(LIBDIR)/libxenstore* $(D)$(LIBDIR)/libxlutil*
-	rm -rf $(D)$(LIBDIR)/python/xen $(D)$(LIBDIR)/python/grub
-	rm -rf $(D)$(LIBDIR)/xen/
-	rm -rf $(D)$(LIBEXEC)/xen*
-	rm -rf $(D)$(SBINDIR)/setmask
-	rm -rf $(D)$(SBINDIR)/xen* $(D)$(SBINDIR)/netfix $(D)$(SBINDIR)/xm
-	rm -rf $(D)$(SHAREDIR)/doc/xen
-	rm -rf $(D)$(SHAREDIR)/xen
-	rm -rf $(D)$(SHAREDIR)/qemu-xen
-	rm -rf $(D)$(MAN1DIR)/xen*
-	rm -rf $(D)$(MAN8DIR)/xen*
+	make -C tools uninstall
 	rm -rf $(D)/boot/tboot*
 
 # Legacy targets for compatibility
diff -r be1f4a847831 -r eac962bcabde tools/Makefile
--- a/tools/Makefile	Fri Aug 31 10:42:08 2012 +0100
+++ b/tools/Makefile	Fri Aug 31 10:42:08 2012 +0100
@@ -71,6 +71,38 @@ install: subdirs-install
 	$(INSTALL_DIR) $(DESTDIR)/var/lib/xen
 	$(INSTALL_DIR) $(DESTDIR)/var/lock/subsys
 
+.PHONY: uninstall
+uninstall: D=$(DESTDIR)
+uninstall:
+	rm -rf $(D)$(LIBDIR)/xen* $(D)$(BINDIR)/lomount
+	rm -rf $(D)$(BINDIR)/cpuperf-perfcntr $(D)$(BINDIR)/cpuperf-xen
+	rm -rf $(D)$(BINDIR)/xc_shadow
+	rm -rf $(D)$(BINDIR)/pygrub
+	rm -rf $(D)$(BINDIR)/setsize $(D)$(BINDIR)/tbctl
+	rm -rf $(D)$(BINDIR)/xsls
+	rm -rf $(D)$(BINDIR)/xenstore* $(D)$(BINDIR)/xentrace*
+	rm -rf $(D)$(BINDIR)/xen-detect $(D)$(BINDIR)/xencons
+	rm -rf $(D)$(BINDIR)/xenpvnetboot $(D)$(BINDIR)/qemu-*-xen
+	rm -rf $(D)$(INCLUDEDIR)/xenctrl* $(D)$(INCLUDEDIR)/xenguest.h
+	rm -rf $(D)$(INCLUDEDIR)/xs_lib.h $(D)$(INCLUDEDIR)/xs.h
+	rm -rf $(D)$(INCLUDEDIR)/xenstore-compat/xs_lib.h $(D)$(INCLUDEDIR)/xenstore-compat/xs.h
+	rm -rf $(D)$(INCLUDEDIR)/xenstore_lib.h $(D)$(INCLUDEDIR)/xenstore.h
+	rm -rf $(D)$(INCLUDEDIR)/xen
+	rm -rf $(D)$(INCLUDEDIR)/_libxl* $(D)$(INCLUDEDIR)/libxl*
+	rm -rf $(D)$(INCLUDEDIR)/xenstat.h $(D)$(INCLUDEDIR)/xentoollog.h
+	rm -rf $(D)$(LIBDIR)/libxenctrl* $(D)$(LIBDIR)/libxenguest*
+	rm -rf $(D)$(LIBDIR)/libxenstore* $(D)$(LIBDIR)/libxlutil*
+	rm -rf $(D)$(LIBDIR)/python/xen $(D)$(LIBDIR)/python/grub
+	rm -rf $(D)$(LIBDIR)/xen/
+	rm -rf $(D)$(LIBEXEC)/xen*
+	rm -rf $(D)$(SBINDIR)/setmask
+	rm -rf $(D)$(SBINDIR)/xen* $(D)$(SBINDIR)/netfix $(D)$(SBINDIR)/xm
+	rm -rf $(D)$(SHAREDIR)/doc/xen
+	rm -rf $(D)$(SHAREDIR)/xen
+	rm -rf $(D)$(SHAREDIR)/qemu-xen
+	rm -rf $(D)$(MAN1DIR)/xen*
+	rm -rf $(D)$(MAN8DIR)/xen*
+
 .PHONY: clean
 clean: subdirs-clean
 

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 14:44:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 14: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.xen.org>)
	id 1T8uMV-00025G-T8; Tue, 04 Sep 2012 14:44:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8uMS-00023k-2C
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:18 +0000
Received: from [85.158.139.83:38453] by server-7.bemta-5.messagelabs.com id
	36/C8-19703-FB316405; Tue, 04 Sep 2012 14:44:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1346769853!24568942!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14799 invoked from network); 4 Sep 2012 14:44: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;
	4 Sep 2012 14:44: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 1T8uMP-0002Ph-5J
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8uMP-0000rH-0j
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:13 +0000
Message-Id: <E1T8uMP-0000rH-0j@xenbits.xen.org>
Date: Tue, 04 Sep 2012 14:44:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools: remove vestigial
	default_lib.m4 macros and adjust substitutions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Matt Wilson <msw@amazon.com>
# Date 1346406129 -3600
# Node ID 49625db443bcefc5088a417d595b18630cf42547
# Parent  eac962bcabdec53a7d0f25a8203b601db4493b93
tools: remove vestigial default_lib.m4 macros and adjust substitutions

LIB_PATH is no longer used, so the AX_DEFAULT_LIB macro is no longer
needed. Additionally lower case make variables are now used as
autoconf substitutions, which allows for more correct overrides at
build time.

I've checked the file layout in dist/install from the build made
before this change versus after with ./configure values of:
 1) ./configure (no flags provided)
 2) ./configure --libdir=/usr/lib/x86_64-linux-gnu (Debian style)
 3) ./configure --libdir='${exec_prefix}/lib' (late variable expansion)

Signed-off-by: Matt Wilson <msw@amazon.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
[ ijc - reran autogen.sh ]
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r eac962bcabde -r 49625db443bc config/Tools.mk.in
--- a/config/Tools.mk.in	Fri Aug 31 10:42:08 2012 +0100
+++ b/config/Tools.mk.in	Fri Aug 31 10:42:09 2012 +0100
@@ -1,7 +1,9 @@
 # Prefix and install folder
-PREFIX              := @prefix@
+prefix              := @prefix@
+PREFIX              := $(prefix)
 exec_prefix         := @exec_prefix@
-LIBDIR              := @libdir@
+libdir              := @libdir@
+LIBDIR              := $(libdir)
 
 # A debug build of tools?
 debug               := @debug@
diff -r eac962bcabde -r 49625db443bc tools/configure
--- a/tools/configure	Fri Aug 31 10:42:08 2012 +0100
+++ b/tools/configure	Fri Aug 31 10:42:09 2012 +0100
@@ -606,7 +606,6 @@ libgcrypt
 libext2fs
 system_aio
 zlib
-LIB_PATH
 glib_LIBS
 glib_CFLAGS
 PKG_CONFIG_LIBDIR
@@ -2311,8 +2310,6 @@ case $host_os in *\ *) host_os=`echo "$h
 
 
 
-
-
 # pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
 # serial 1 (pkg-config-0.24)
 #
@@ -6125,31 +6122,6 @@ else
 
 fi
 
-# Check library path
-if test "\${exec_prefix}/lib" = "$libdir"; then :
-  if test "$exec_prefix" = "NONE" && test "$prefix" != "NONE"; then :
-  exec_prefix=$prefix
-fi
-    if test "$exec_prefix" = "NONE"; then :
-  exec_prefix=$ac_default_prefix
-fi
-    if test -d "${exec_prefix}/lib64"; then :
-
-        LIB_PATH="lib64"
-
-else
-
-        LIB_PATH="lib"
-
-fi
-
-else
-
-    LIB_PATH="${libdir:`expr length "$exec_prefix" + 1`}"
-
-fi
-
-
 # Checks for libraries.
 ac_fn_c_check_header_mongrel "$LINENO" "bzlib.h" "ac_cv_header_bzlib_h" "$ac_includes_default"
 if test "x$ac_cv_header_bzlib_h" = x""yes; then :
diff -r eac962bcabde -r 49625db443bc tools/configure.ac
--- a/tools/configure.ac	Fri Aug 31 10:42:08 2012 +0100
+++ b/tools/configure.ac	Fri Aug 31 10:42:09 2012 +0100
@@ -28,7 +28,6 @@ m4_include([m4/path_or_fail.m4])
 m4_include([m4/python_version.m4])
 m4_include([m4/python_devel.m4])
 m4_include([m4/ocaml.m4])
-m4_include([m4/default_lib.m4])
 m4_include([m4/set_cflags_ldflags.m4])
 m4_include([m4/uuid.m4])
 m4_include([m4/pkg.m4])
@@ -121,9 +120,6 @@ esac
  AX_CHECK_CURSES
 PKG_CHECK_MODULES(glib, [glib-2.0 >= 2.12])
 
-# Check library path
-AX_DEFAULT_LIB
-
 # Checks for libraries.
 AC_CHECK_HEADER([bzlib.h], [
 AC_CHECK_LIB([bz2], [BZ2_bzDecompressInit], [zlib="$zlib -DHAVE_BZLIB -lbz2"])
diff -r eac962bcabde -r 49625db443bc tools/m4/default_lib.m4
--- a/tools/m4/default_lib.m4	Fri Aug 31 10:42:08 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-AC_DEFUN([AX_DEFAULT_LIB],
-[AS_IF([test "\${exec_prefix}/lib" = "$libdir"],
-    [AS_IF([test "$exec_prefix" = "NONE" && test "$prefix" != "NONE"],
-        [exec_prefix=$prefix])
-    AS_IF([test "$exec_prefix" = "NONE"], [exec_prefix=$ac_default_prefix])
-    AS_IF([test -d "${exec_prefix}/lib64"], [
-        LIB_PATH="lib64"
-    ],[
-        LIB_PATH="lib"
-    ])
-], [
-    LIB_PATH="${libdir:`expr length "$exec_prefix" + 1`}"
-])
-AC_SUBST(LIB_PATH)])

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 14:44:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 14: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.xen.org>)
	id 1T8uMV-00025G-T8; Tue, 04 Sep 2012 14:44:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8uMS-00023k-2C
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:18 +0000
Received: from [85.158.139.83:38453] by server-7.bemta-5.messagelabs.com id
	36/C8-19703-FB316405; Tue, 04 Sep 2012 14:44:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1346769853!24568942!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14799 invoked from network); 4 Sep 2012 14:44: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;
	4 Sep 2012 14:44: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 1T8uMP-0002Ph-5J
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8uMP-0000rH-0j
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:13 +0000
Message-Id: <E1T8uMP-0000rH-0j@xenbits.xen.org>
Date: Tue, 04 Sep 2012 14:44:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools: remove vestigial
	default_lib.m4 macros and adjust substitutions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Matt Wilson <msw@amazon.com>
# Date 1346406129 -3600
# Node ID 49625db443bcefc5088a417d595b18630cf42547
# Parent  eac962bcabdec53a7d0f25a8203b601db4493b93
tools: remove vestigial default_lib.m4 macros and adjust substitutions

LIB_PATH is no longer used, so the AX_DEFAULT_LIB macro is no longer
needed. Additionally lower case make variables are now used as
autoconf substitutions, which allows for more correct overrides at
build time.

I've checked the file layout in dist/install from the build made
before this change versus after with ./configure values of:
 1) ./configure (no flags provided)
 2) ./configure --libdir=/usr/lib/x86_64-linux-gnu (Debian style)
 3) ./configure --libdir='${exec_prefix}/lib' (late variable expansion)

Signed-off-by: Matt Wilson <msw@amazon.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
[ ijc - reran autogen.sh ]
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r eac962bcabde -r 49625db443bc config/Tools.mk.in
--- a/config/Tools.mk.in	Fri Aug 31 10:42:08 2012 +0100
+++ b/config/Tools.mk.in	Fri Aug 31 10:42:09 2012 +0100
@@ -1,7 +1,9 @@
 # Prefix and install folder
-PREFIX              := @prefix@
+prefix              := @prefix@
+PREFIX              := $(prefix)
 exec_prefix         := @exec_prefix@
-LIBDIR              := @libdir@
+libdir              := @libdir@
+LIBDIR              := $(libdir)
 
 # A debug build of tools?
 debug               := @debug@
diff -r eac962bcabde -r 49625db443bc tools/configure
--- a/tools/configure	Fri Aug 31 10:42:08 2012 +0100
+++ b/tools/configure	Fri Aug 31 10:42:09 2012 +0100
@@ -606,7 +606,6 @@ libgcrypt
 libext2fs
 system_aio
 zlib
-LIB_PATH
 glib_LIBS
 glib_CFLAGS
 PKG_CONFIG_LIBDIR
@@ -2311,8 +2310,6 @@ case $host_os in *\ *) host_os=`echo "$h
 
 
 
-
-
 # pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
 # serial 1 (pkg-config-0.24)
 #
@@ -6125,31 +6122,6 @@ else
 
 fi
 
-# Check library path
-if test "\${exec_prefix}/lib" = "$libdir"; then :
-  if test "$exec_prefix" = "NONE" && test "$prefix" != "NONE"; then :
-  exec_prefix=$prefix
-fi
-    if test "$exec_prefix" = "NONE"; then :
-  exec_prefix=$ac_default_prefix
-fi
-    if test -d "${exec_prefix}/lib64"; then :
-
-        LIB_PATH="lib64"
-
-else
-
-        LIB_PATH="lib"
-
-fi
-
-else
-
-    LIB_PATH="${libdir:`expr length "$exec_prefix" + 1`}"
-
-fi
-
-
 # Checks for libraries.
 ac_fn_c_check_header_mongrel "$LINENO" "bzlib.h" "ac_cv_header_bzlib_h" "$ac_includes_default"
 if test "x$ac_cv_header_bzlib_h" = x""yes; then :
diff -r eac962bcabde -r 49625db443bc tools/configure.ac
--- a/tools/configure.ac	Fri Aug 31 10:42:08 2012 +0100
+++ b/tools/configure.ac	Fri Aug 31 10:42:09 2012 +0100
@@ -28,7 +28,6 @@ m4_include([m4/path_or_fail.m4])
 m4_include([m4/python_version.m4])
 m4_include([m4/python_devel.m4])
 m4_include([m4/ocaml.m4])
-m4_include([m4/default_lib.m4])
 m4_include([m4/set_cflags_ldflags.m4])
 m4_include([m4/uuid.m4])
 m4_include([m4/pkg.m4])
@@ -121,9 +120,6 @@ esac
  AX_CHECK_CURSES
 PKG_CHECK_MODULES(glib, [glib-2.0 >= 2.12])
 
-# Check library path
-AX_DEFAULT_LIB
-
 # Checks for libraries.
 AC_CHECK_HEADER([bzlib.h], [
 AC_CHECK_LIB([bz2], [BZ2_bzDecompressInit], [zlib="$zlib -DHAVE_BZLIB -lbz2"])
diff -r eac962bcabde -r 49625db443bc tools/m4/default_lib.m4
--- a/tools/m4/default_lib.m4	Fri Aug 31 10:42:08 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-AC_DEFUN([AX_DEFAULT_LIB],
-[AS_IF([test "\${exec_prefix}/lib" = "$libdir"],
-    [AS_IF([test "$exec_prefix" = "NONE" && test "$prefix" != "NONE"],
-        [exec_prefix=$prefix])
-    AS_IF([test "$exec_prefix" = "NONE"], [exec_prefix=$ac_default_prefix])
-    AS_IF([test -d "${exec_prefix}/lib64"], [
-        LIB_PATH="lib64"
-    ],[
-        LIB_PATH="lib"
-    ])
-], [
-    LIB_PATH="${libdir:`expr length "$exec_prefix" + 1`}"
-])
-AC_SUBST(LIB_PATH)])

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 14:44:37 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 14:44:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T8uMm-0002At-3F; Tue, 04 Sep 2012 14:44:36 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8uMl-0002A6-6o
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:35 +0000
Received: from [85.158.143.99:29994] by server-2.bemta-4.messagelabs.com id
	B7/9A-21239-2D316405; Tue, 04 Sep 2012 14:44:34 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-216.messagelabs.com!1346769872!28470715!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25195 invoked from network); 4 Sep 2012 14:44:33 -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;
	4 Sep 2012 14:44: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 1T8uMN-0002PY-Er
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8uMN-0000qV-DN
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:11 +0000
Message-Id: <E1T8uMN-0000qV-DN@xenbits.xen.org>
Date: Tue, 04 Sep 2012 14:44:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hotplug/NetBSD: check type of file
	to attach from params
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Roger Pau Monne <roger.pau@citrix.com>
# Date 1346406127 -3600
# Node ID e23bbadd1ad7fdaaee3a7355c20ba3c17e71d297
# Parent  e1f6699e54f4cd6d3c284913a332c4e9d648f550
hotplug/NetBSD: check type of file to attach from params

xend used to set the xenbus backend entry "type" to either "phy" or
"file", but now libxl sets it to "phy" for both file and block device.
We have to manually check for the type of the "param" field in order
to detect if we are trying to attach a file or a block device.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Roger Pau Monne <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r e1f6699e54f4 -r e23bbadd1ad7 tools/hotplug/NetBSD/block
--- a/tools/hotplug/NetBSD/block	Fri Aug 31 10:42:06 2012 +0100
+++ b/tools/hotplug/NetBSD/block	Fri Aug 31 10:42:07 2012 +0100
@@ -20,8 +20,17 @@ error() {
 
 xpath=$1
 xstatus=$2
-xtype=$(xenstore-read "$xpath/type")
 xparams=$(xenstore-read "$xpath/params")
+if [ -b "$xparams" ]; then
+	xtype="phy"
+elif [ -f "$xparams" ]; then
+	xtype="file"
+elif [ -z "$xparams" ]; then
+	error "$xpath/params is empty, unable to attach block device."
+else
+	error "$xparams is not a valid file type to use as block device." \
+	      "Only block and regular image files accepted."
+fi
 
 case $xstatus in
 6)

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 14:44:37 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 14:44:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T8uMm-0002At-3F; Tue, 04 Sep 2012 14:44:36 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8uMl-0002A6-6o
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:35 +0000
Received: from [85.158.143.99:29994] by server-2.bemta-4.messagelabs.com id
	B7/9A-21239-2D316405; Tue, 04 Sep 2012 14:44:34 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-216.messagelabs.com!1346769872!28470715!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25195 invoked from network); 4 Sep 2012 14:44:33 -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;
	4 Sep 2012 14:44: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 1T8uMN-0002PY-Er
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8uMN-0000qV-DN
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:11 +0000
Message-Id: <E1T8uMN-0000qV-DN@xenbits.xen.org>
Date: Tue, 04 Sep 2012 14:44:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hotplug/NetBSD: check type of file
	to attach from params
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Roger Pau Monne <roger.pau@citrix.com>
# Date 1346406127 -3600
# Node ID e23bbadd1ad7fdaaee3a7355c20ba3c17e71d297
# Parent  e1f6699e54f4cd6d3c284913a332c4e9d648f550
hotplug/NetBSD: check type of file to attach from params

xend used to set the xenbus backend entry "type" to either "phy" or
"file", but now libxl sets it to "phy" for both file and block device.
We have to manually check for the type of the "param" field in order
to detect if we are trying to attach a file or a block device.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Roger Pau Monne <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r e1f6699e54f4 -r e23bbadd1ad7 tools/hotplug/NetBSD/block
--- a/tools/hotplug/NetBSD/block	Fri Aug 31 10:42:06 2012 +0100
+++ b/tools/hotplug/NetBSD/block	Fri Aug 31 10:42:07 2012 +0100
@@ -20,8 +20,17 @@ error() {
 
 xpath=$1
 xstatus=$2
-xtype=$(xenstore-read "$xpath/type")
 xparams=$(xenstore-read "$xpath/params")
+if [ -b "$xparams" ]; then
+	xtype="phy"
+elif [ -f "$xparams" ]; then
+	xtype="file"
+elif [ -z "$xparams" ]; then
+	error "$xpath/params is empty, unable to attach block device."
+else
+	error "$xparams is not a valid file type to use as block device." \
+	      "Only block and regular image files accepted."
+fi
 
 case $xstatus in
 6)

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 14:44:37 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 14:44:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T8uMm-0002An-0v; Tue, 04 Sep 2012 14:44:36 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8uMk-00029m-DS
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:34 +0000
Received: from [85.158.139.83:11260] by server-5.bemta-5.messagelabs.com id
	DC/AE-30514-1D316405; Tue, 04 Sep 2012 14:44:33 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-182.messagelabs.com!1346769871!28795643!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32129 invoked from network); 4 Sep 2012 14:44:32 -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;
	4 Sep 2012 14:44: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 1T8uMM-0002PS-Gf
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8uMM-0000q1-C9
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:10 +0000
Message-Id: <E1T8uMM-0000q1-C9@xenbits.xen.org>
Date: Tue, 04 Sep 2012 14:44:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hotplug/NetBSD: fix xenstore_write
	usage in error
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Roger Pau Monne <roger.pau@citrix.com>
# Date 1346406125 -3600
# Node ID 9abb6d9344b9f495d917cc9fa5dc29f338ae9f31
# Parent  574d7bd438e56f0c2370653f0e740651a66bcdbd
hotplug/NetBSD: fix xenstore_write usage in error

xenstore_write doesn't exist, use xenstore-write instead. The error
function is currently broken without this change.

Signed-off-by: Roger Pau Monne <roger.pau@citrix.com>
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 574d7bd438e5 -r 9abb6d9344b9 tools/hotplug/NetBSD/block
--- a/tools/hotplug/NetBSD/block	Fri Aug 31 10:42:04 2012 +0100
+++ b/tools/hotplug/NetBSD/block	Fri Aug 31 10:42:05 2012 +0100
@@ -12,7 +12,7 @@ export PATH
 
 error() {
 	echo "$@" >&2
-	xenstore_write $xpath/hotplug-status error
+	xenstore-write $xpath/hotplug-status error
 	exit 1
 }
 	

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 14:44:37 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 14:44:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T8uMm-0002An-0v; Tue, 04 Sep 2012 14:44:36 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8uMk-00029m-DS
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:34 +0000
Received: from [85.158.139.83:11260] by server-5.bemta-5.messagelabs.com id
	DC/AE-30514-1D316405; Tue, 04 Sep 2012 14:44:33 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-182.messagelabs.com!1346769871!28795643!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32129 invoked from network); 4 Sep 2012 14:44:32 -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;
	4 Sep 2012 14:44: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 1T8uMM-0002PS-Gf
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8uMM-0000q1-C9
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:10 +0000
Message-Id: <E1T8uMM-0000q1-C9@xenbits.xen.org>
Date: Tue, 04 Sep 2012 14:44:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hotplug/NetBSD: fix xenstore_write
	usage in error
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Roger Pau Monne <roger.pau@citrix.com>
# Date 1346406125 -3600
# Node ID 9abb6d9344b9f495d917cc9fa5dc29f338ae9f31
# Parent  574d7bd438e56f0c2370653f0e740651a66bcdbd
hotplug/NetBSD: fix xenstore_write usage in error

xenstore_write doesn't exist, use xenstore-write instead. The error
function is currently broken without this change.

Signed-off-by: Roger Pau Monne <roger.pau@citrix.com>
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 574d7bd438e5 -r 9abb6d9344b9 tools/hotplug/NetBSD/block
--- a/tools/hotplug/NetBSD/block	Fri Aug 31 10:42:04 2012 +0100
+++ b/tools/hotplug/NetBSD/block	Fri Aug 31 10:42:05 2012 +0100
@@ -12,7 +12,7 @@ export PATH
 
 error() {
 	echo "$@" >&2
-	xenstore_write $xpath/hotplug-status error
+	xenstore-write $xpath/hotplug-status error
 	exit 1
 }
 	

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 14:44:43 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 14:44:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T8uMo-0002CL-5a; Tue, 04 Sep 2012 14:44:38 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8uMm-0002Ar-Lx
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:36 +0000
Received: from [85.158.139.83:11505] by server-9.bemta-5.messagelabs.com id
	97/F1-20529-3D316405; Tue, 04 Sep 2012 14:44:35 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1346769873!24569048!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16996 invoked from network); 4 Sep 2012 14:44:34 -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;
	4 Sep 2012 14:44: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 1T8uMO-0002Pb-5I
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8uMN-0000qk-UK
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:11 +0000
Message-Id: <E1T8uMN-0000qk-UK@xenbits.xen.org>
Date: Tue, 04 Sep 2012 14:44:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] uninstall: do not remove kernels or
	modules on uninstall.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <Ian.Campbell@citrix.com>
# Date 1346406128 -3600
# Node ID be1f4a84783178467e2e4ad2bb5e124b6a9bb244
# Parent  e23bbadd1ad7fdaaee3a7355c20ba3c17e71d297
uninstall: do not remove kernels or modules on uninstall.

The pattern used is very broad and will delete any kernel with xen in
its filename, likewise modules, including those which come packages
from the distribution etc.

I don't think this was ever the right thing to do but it is doubly
wrong now that Xen does not even build or install a kernel by default.

Push cleanup of the installed hypervisor down into xen/Makefile so that
it can cleanup exactly what it actually installs.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Looks-good: Jan Beulich <JBeulich@suse.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r e23bbadd1ad7 -r be1f4a847831 Makefile
--- a/Makefile	Fri Aug 31 10:42:07 2012 +0100
+++ b/Makefile	Fri Aug 31 10:42:08 2012 +0100
@@ -220,6 +220,7 @@ help:
 uninstall: D=$(DESTDIR)
 uninstall:
 	[ -d $(D)$(XEN_CONFIG_DIR) ] && mv -f $(D)$(XEN_CONFIG_DIR) $(D)$(XEN_CONFIG_DIR).old-`date +%s` || true
+	$(MAKE) -C xen uninstall
 	rm -rf $(D)$(CONFIG_DIR)/init.d/xendomains $(D)$(CONFIG_DIR)/init.d/xend
 	rm -rf $(D)$(CONFIG_DIR)/init.d/xencommons $(D)$(CONFIG_DIR)/init.d/xen-watchdog
 	rm -rf $(D)$(CONFIG_DIR)/hotplug/xen-backend.agent
@@ -228,8 +229,6 @@ uninstall:
 	rm -f  $(D)$(SYSCONFIG_DIR)/xendomains
 	rm -f  $(D)$(SYSCONFIG_DIR)/xencommons
 	rm -rf $(D)/var/run/xen* $(D)/var/lib/xen*
-	rm -rf $(D)/boot/*xen*
-	rm -rf $(D)/lib/modules/*xen*
 	rm -rf $(D)$(LIBDIR)/xen* $(D)$(BINDIR)/lomount
 	rm -rf $(D)$(BINDIR)/cpuperf-perfcntr $(D)$(BINDIR)/cpuperf-xen
 	rm -rf $(D)$(BINDIR)/xc_shadow
diff -r e23bbadd1ad7 -r be1f4a847831 xen/Makefile
--- a/xen/Makefile	Fri Aug 31 10:42:07 2012 +0100
+++ b/xen/Makefile	Fri Aug 31 10:42:08 2012 +0100
@@ -20,8 +20,8 @@ default: build
 .PHONY: dist
 dist: install
 
-.PHONY: build install clean distclean cscope TAGS tags MAP gtags
-build install debug clean distclean cscope TAGS tags MAP gtags::
+.PHONY: build install uninstall clean distclean cscope TAGS tags MAP gtags
+build install uninstall debug clean distclean cscope TAGS tags MAP gtags::
 	$(MAKE) -f Rules.mk _$@
 
 .PHONY: _build
@@ -48,6 +48,21 @@ _install: $(TARGET).gz
 		fi; \
 	fi
 
+.PHONY: _uninstall
+_uninstall: D=$(DESTDIR)
+_uninstall: T=$(notdir $(TARGET))
+_uninstall:
+	rm -f $(D)/boot/$(T)-$(XEN_FULLVERSION).gz
+	rm -f $(D)/boot/$(T)-$(XEN_VERSION).$(XEN_SUBVERSION).gz
+	rm -f $(D)/boot/$(T)-$(XEN_VERSION).gz
+	rm -f $(D)/boot/$(T).gz
+	rm -f $(D)/boot/$(T)-syms-$(XEN_FULLVERSION)
+	rm -f $(D)$(EFI_DIR)/$(T)-$(XEN_FULLVERSION).efi
+	rm -f $(D)$(EFI_DIR)/$(T)-$(XEN_VERSION).$(XEN_SUBVERSION).efi
+	rm -f $(D)$(EFI_DIR)/$(T)-$(XEN_VERSION).efi
+	rm -f $(D)$(EFI_DIR)/$(T).efi
+	rm -f $(D)$(EFI_MOUNTPOINT)/efi/$(EFI_VENDOR)/$(T)-$(XEN_FULLVERSION).efi
+
 .PHONY: _debug
 _debug:
 	objdump -D -S $(TARGET)-syms > $(TARGET).s

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 14:44:43 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 14:44:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T8uMo-0002CL-5a; Tue, 04 Sep 2012 14:44:38 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8uMm-0002Ar-Lx
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:36 +0000
Received: from [85.158.139.83:11505] by server-9.bemta-5.messagelabs.com id
	97/F1-20529-3D316405; Tue, 04 Sep 2012 14:44:35 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1346769873!24569048!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16996 invoked from network); 4 Sep 2012 14:44:34 -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;
	4 Sep 2012 14:44: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 1T8uMO-0002Pb-5I
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T8uMN-0000qk-UK
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 14:44:11 +0000
Message-Id: <E1T8uMN-0000qk-UK@xenbits.xen.org>
Date: Tue, 04 Sep 2012 14:44:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] uninstall: do not remove kernels or
	modules on uninstall.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <Ian.Campbell@citrix.com>
# Date 1346406128 -3600
# Node ID be1f4a84783178467e2e4ad2bb5e124b6a9bb244
# Parent  e23bbadd1ad7fdaaee3a7355c20ba3c17e71d297
uninstall: do not remove kernels or modules on uninstall.

The pattern used is very broad and will delete any kernel with xen in
its filename, likewise modules, including those which come packages
from the distribution etc.

I don't think this was ever the right thing to do but it is doubly
wrong now that Xen does not even build or install a kernel by default.

Push cleanup of the installed hypervisor down into xen/Makefile so that
it can cleanup exactly what it actually installs.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Looks-good: Jan Beulich <JBeulich@suse.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r e23bbadd1ad7 -r be1f4a847831 Makefile
--- a/Makefile	Fri Aug 31 10:42:07 2012 +0100
+++ b/Makefile	Fri Aug 31 10:42:08 2012 +0100
@@ -220,6 +220,7 @@ help:
 uninstall: D=$(DESTDIR)
 uninstall:
 	[ -d $(D)$(XEN_CONFIG_DIR) ] && mv -f $(D)$(XEN_CONFIG_DIR) $(D)$(XEN_CONFIG_DIR).old-`date +%s` || true
+	$(MAKE) -C xen uninstall
 	rm -rf $(D)$(CONFIG_DIR)/init.d/xendomains $(D)$(CONFIG_DIR)/init.d/xend
 	rm -rf $(D)$(CONFIG_DIR)/init.d/xencommons $(D)$(CONFIG_DIR)/init.d/xen-watchdog
 	rm -rf $(D)$(CONFIG_DIR)/hotplug/xen-backend.agent
@@ -228,8 +229,6 @@ uninstall:
 	rm -f  $(D)$(SYSCONFIG_DIR)/xendomains
 	rm -f  $(D)$(SYSCONFIG_DIR)/xencommons
 	rm -rf $(D)/var/run/xen* $(D)/var/lib/xen*
-	rm -rf $(D)/boot/*xen*
-	rm -rf $(D)/lib/modules/*xen*
 	rm -rf $(D)$(LIBDIR)/xen* $(D)$(BINDIR)/lomount
 	rm -rf $(D)$(BINDIR)/cpuperf-perfcntr $(D)$(BINDIR)/cpuperf-xen
 	rm -rf $(D)$(BINDIR)/xc_shadow
diff -r e23bbadd1ad7 -r be1f4a847831 xen/Makefile
--- a/xen/Makefile	Fri Aug 31 10:42:07 2012 +0100
+++ b/xen/Makefile	Fri Aug 31 10:42:08 2012 +0100
@@ -20,8 +20,8 @@ default: build
 .PHONY: dist
 dist: install
 
-.PHONY: build install clean distclean cscope TAGS tags MAP gtags
-build install debug clean distclean cscope TAGS tags MAP gtags::
+.PHONY: build install uninstall clean distclean cscope TAGS tags MAP gtags
+build install uninstall debug clean distclean cscope TAGS tags MAP gtags::
 	$(MAKE) -f Rules.mk _$@
 
 .PHONY: _build
@@ -48,6 +48,21 @@ _install: $(TARGET).gz
 		fi; \
 	fi
 
+.PHONY: _uninstall
+_uninstall: D=$(DESTDIR)
+_uninstall: T=$(notdir $(TARGET))
+_uninstall:
+	rm -f $(D)/boot/$(T)-$(XEN_FULLVERSION).gz
+	rm -f $(D)/boot/$(T)-$(XEN_VERSION).$(XEN_SUBVERSION).gz
+	rm -f $(D)/boot/$(T)-$(XEN_VERSION).gz
+	rm -f $(D)/boot/$(T).gz
+	rm -f $(D)/boot/$(T)-syms-$(XEN_FULLVERSION)
+	rm -f $(D)$(EFI_DIR)/$(T)-$(XEN_FULLVERSION).efi
+	rm -f $(D)$(EFI_DIR)/$(T)-$(XEN_VERSION).$(XEN_SUBVERSION).efi
+	rm -f $(D)$(EFI_DIR)/$(T)-$(XEN_VERSION).efi
+	rm -f $(D)$(EFI_DIR)/$(T).efi
+	rm -f $(D)$(EFI_MOUNTPOINT)/efi/$(EFI_VENDOR)/$(T)-$(XEN_FULLVERSION).efi
+
 .PHONY: _debug
 _debug:
 	objdump -D -S $(TARGET)-syms > $(TARGET).s

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 22:00:33 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 22: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.xen.org>)
	id 1T91Aa-0002D2-8d; Tue, 04 Sep 2012 22:00:28 +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 1T91AY-0002CU-O9
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-27.messagelabs.com!1346796018!9536272!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14299 invoked from network); 4 Sep 2012 22:00:19 -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 Sep 2012 22:00: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 1T91AQ-0007rg-JU
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T91AH-0002jr-6k
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:10 +0000
Message-Id: <E1T91AH-0002jr-6k@xenbits.xen.org>
Date: Tue, 04 Sep 2012 22:00:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: fix double free on some
	config parser errors
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1346412297 -3600
# Node ID cba297a18e3347c2b01fc453055e1fb5e62e68f9
# Parent  1dfbae8dd282da8eff8d765714eaa27bb581bb46
libxl: fix double free on some config parser errors

If libxlu_cfg_y.y encountered a config file error, the code generated
by bison would sometimes _both_ run the %destructor _and_ call
xlu__cfg_set_store for the same XLU_ConfigSetting* semantic value.
The result would be a double free.

This appears to be because of the use of a mid-rule action.  There is
some discussion of the problems with destructors and mid-rule action
error handling in "(bison)Mid-Rule Actions".  This area is complex and
best avoided.

So fix the bug by abolishing the use of a mid-rule action, which was
in any case not necessary here.

Also while we are there rename the nonterminal rule "setting" to
"assignment", to avoid confusion with the token type "setting", which
had an identically name in a different namespace.  This was especially
confusing because the nonterminal "setting" did not have "setting" as
the type of its semantic value!  (In fact the nonterminal, now called
"assignment", does not have a value so it does not have a value type.)

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


diff -r 1dfbae8dd282 -r cba297a18e33 tools/libxl/libxlu_cfg_y.c
--- a/tools/libxl/libxlu_cfg_y.c	Fri Aug 31 11:13:49 2012 +0100
+++ b/tools/libxl/libxlu_cfg_y.c	Fri Aug 31 12:24:57 2012 +0100
@@ -380,11 +380,11 @@ union yyalloc
 /* YYNTOKENS -- Number of terminals.  */
 #define YYNTOKENS  12
 /* YYNNTS -- Number of nonterminals.  */
-#define YYNNTS  10
+#define YYNNTS  9
 /* YYNRULES -- Number of rules.  */
-#define YYNRULES  20
+#define YYNRULES  19
 /* YYNRULES -- Number of states.  */
-#define YYNSTATES  29
+#define YYNSTATES  28
 
 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
 #define YYUNDEFTOK  2
@@ -430,28 +430,26 @@ static const yytype_uint8 yytranslate[] 
    YYRHS.  */
 static const yytype_uint8 yyprhs[] =
 {
-       0,     0,     3,     4,     7,     8,    14,    16,    19,    21,
-      23,    25,    30,    32,    34,    35,    37,    41,    44,    50,
-      51
+       0,     0,     3,     4,     7,    12,    14,    17,    19,    21,
+      23,    28,    30,    32,    33,    35,    39,    42,    48,    49
 };
 
 /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
 static const yytype_int8 yyrhs[] =
 {
-      13,     0,    -1,    -1,    13,    14,    -1,    -1,     3,     7,
-      17,    15,    16,    -1,    16,    -1,     1,     6,    -1,     6,
-      -1,     8,    -1,    18,    -1,     9,    21,    19,    10,    -1,
-       4,    -1,     5,    -1,    -1,    20,    -1,    20,    11,    21,
-      -1,    18,    21,    -1,    20,    11,    21,    18,    21,    -1,
-      -1,    21,     6,    -1
+      13,     0,    -1,    -1,    13,    14,    -1,     3,     7,    16,
+      15,    -1,    15,    -1,     1,     6,    -1,     6,    -1,     8,
+      -1,    17,    -1,     9,    20,    18,    10,    -1,     4,    -1,
+       5,    -1,    -1,    19,    -1,    19,    11,    20,    -1,    17,
+      20,    -1,    19,    11,    20,    17,    20,    -1,    -1,    20,
+       6,    -1
 };
 
 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
 static const yytype_uint8 yyrline[] =
 {
-       0,    47,    47,    48,    50,    50,    52,    53,    55,    56,
-      58,    59,    61,    62,    64,    65,    66,    68,    69,    71,
-      73
+       0,    47,    47,    48,    50,    52,    53,    55,    56,    58,
+      59,    61,    62,    64,    65,    66,    68,    69,    71,    73
 };
 #endif
 
@@ -461,7 +459,7 @@ static const yytype_uint8 yyrline[] =
 static const char *const yytname[] =
 {
   "$end", "error", "$undefined", "IDENT", "STRING", "NUMBER", "NEWLINE",
-  "'='", "';'", "'['", "']'", "','", "$accept", "file", "setting", "$@1",
+  "'='", "';'", "'['", "']'", "','", "$accept", "file", "assignment",
   "endstmt", "value", "atom", "valuelist", "values", "nlok", 0
 };
 #endif
@@ -479,17 +477,15 @@ static const yytype_uint16 yytoknum[] =
 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
 static const yytype_uint8 yyr1[] =
 {
-       0,    12,    13,    13,    15,    14,    14,    14,    16,    16,
-      17,    17,    18,    18,    19,    19,    19,    20,    20,    21,
-      21
+       0,    12,    13,    13,    14,    14,    14,    15,    15,    16,
+      16,    17,    17,    18,    18,    18,    19,    19,    20,    20
 };
 
 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
 static const yytype_uint8 yyr2[] =
 {
-       0,     2,     0,     2,     0,     5,     1,     2,     1,     1,
-       1,     4,     1,     1,     0,     1,     3,     2,     5,     0,
-       2
+       0,     2,     0,     2,     4,     1,     2,     1,     1,     1,
+       4,     1,     1,     0,     1,     3,     2,     5,     0,     2
 };
 
 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
@@ -497,15 +493,15 @@ static const yytype_uint8 yyr2[] =
    means the default is an error.  */
 static const yytype_uint8 yydefact[] =
 {
-       2,     0,     1,     0,     0,     8,     9,     3,     6,     7,
-       0,    12,    13,    19,     4,    10,    14,     0,    20,    19,
-       0,    15,     5,    17,    11,    19,    16,    19,    18
+       2,     0,     1,     0,     0,     7,     8,     3,     5,     6,
+       0,    11,    12,    18,     0,     9,    13,     4,    19,    18,
+       0,    14,    16,    10,    18,    15,    18,    17
 };
 
 /* YYDEFGOTO[NTERM-NUM].  */
 static const yytype_int8 yydefgoto[] =
 {
-      -1,     1,     7,    17,     8,    14,    15,    20,    21,    16
+      -1,     1,     7,     8,    14,    15,    20,    21,    16
 };
 
 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
@@ -513,15 +509,15 @@ static const yytype_int8 yydefgoto[] =
 #define YYPACT_NINF -17
 static const yytype_int8 yypact[] =
 {
-     -17,     1,   -17,    -3,     5,   -17,   -17,   -17,   -17,   -17,
-      10,   -17,   -17,   -17,   -17,   -17,    12,     0,   -17,   -17,
-      11,     9,   -17,    16,   -17,   -17,    12,   -17,    16
+     -17,     2,   -17,    -5,    -3,   -17,   -17,   -17,   -17,   -17,
+      10,   -17,   -17,   -17,    14,   -17,    12,   -17,   -17,   -17,
+      11,    -4,     6,   -17,   -17,    12,   -17,     6
 };
 
 /* YYPGOTO[NTERM-NUM].  */
 static const yytype_int8 yypgoto[] =
 {
-     -17,   -17,   -17,   -17,     6,   -17,   -16,   -17,   -17,   -14
+     -17,   -17,   -17,     9,   -17,   -16,   -17,   -17,   -13
 };
 
 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
@@ -531,25 +527,25 @@ static const yytype_int8 yypgoto[] =
 #define YYTABLE_NINF -1
 static const yytype_uint8 yytable[] =
 {
-      19,     2,     3,     9,     4,    23,     5,     5,     6,     6,
-      27,    26,    10,    28,    11,    12,    11,    12,    18,    13,
-      25,    24,    18,    22
+      19,     9,     2,     3,    10,     4,    22,    24,     5,    26,
+       6,    25,    18,    27,    11,    12,    11,    12,    18,    13,
+       5,    23,     6,    17
 };
 
 static const yytype_uint8 yycheck[] =
 {
-      16,     0,     1,     6,     3,    19,     6,     6,     8,     8,
-      26,    25,     7,    27,     4,     5,     4,     5,     6,     9,
-      11,    10,     6,    17
+      16,     6,     0,     1,     7,     3,    19,    11,     6,    25,
+       8,    24,     6,    26,     4,     5,     4,     5,     6,     9,
+       6,    10,     8,    14
 };
 
 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
    symbol of state STATE-NUM.  */
 static const yytype_uint8 yystos[] =
 {
-       0,    13,     0,     1,     3,     6,     8,    14,    16,     6,
-       7,     4,     5,     9,    17,    18,    21,    15,     6,    18,
-      19,    20,    16,    21,    10,    11,    21,    18,    21
+       0,    13,     0,     1,     3,     6,     8,    14,    15,     6,
+       7,     4,     5,     9,    16,    17,    20,    15,     6,    17,
+      18,    19,    20,    10,    11,    20,    17,    20
 };
 
 #define yyerrok		(yyerrstatus = 0)
@@ -1081,7 +1077,7 @@ yydestruct (yymsg, yytype, yyvaluep, yyl
 	{ free((yyvaluep->string)); };
 
 /* Line 1000 of yacc.c  */
-#line 1085 "libxlu_cfg_y.c"
+#line 1081 "libxlu_cfg_y.c"
 	break;
       case 4: /* "STRING" */
 
@@ -1090,7 +1086,7 @@ yydestruct (yymsg, yytype, yyvaluep, yyl
 	{ free((yyvaluep->string)); };
 
 /* Line 1000 of yacc.c  */
-#line 1094 "libxlu_cfg_y.c"
+#line 1090 "libxlu_cfg_y.c"
 	break;
       case 5: /* "NUMBER" */
 
@@ -1099,43 +1095,43 @@ yydestruct (yymsg, yytype, yyvaluep, yyl
 	{ free((yyvaluep->string)); };
 
 /* Line 1000 of yacc.c  */
-#line 1103 "libxlu_cfg_y.c"
+#line 1099 "libxlu_cfg_y.c"
 	break;
-      case 17: /* "value" */
+      case 16: /* "value" */
 
 /* Line 1000 of yacc.c  */
 #line 43 "libxlu_cfg_y.y"
 	{ xlu__cfg_set_free((yyvaluep->setting)); };
 
 /* Line 1000 of yacc.c  */
-#line 1112 "libxlu_cfg_y.c"
+#line 1108 "libxlu_cfg_y.c"
 	break;
-      case 18: /* "atom" */
+      case 17: /* "atom" */
 
 /* Line 1000 of yacc.c  */
 #line 40 "libxlu_cfg_y.y"
 	{ free((yyvaluep->string)); };
 
 /* Line 1000 of yacc.c  */
-#line 1121 "libxlu_cfg_y.c"
+#line 1117 "libxlu_cfg_y.c"
 	break;
-      case 19: /* "valuelist" */
+      case 18: /* "valuelist" */
 
 /* Line 1000 of yacc.c  */
 #line 43 "libxlu_cfg_y.y"
 	{ xlu__cfg_set_free((yyvaluep->setting)); };
 
 /* Line 1000 of yacc.c  */
-#line 1130 "libxlu_cfg_y.c"
+#line 1126 "libxlu_cfg_y.c"
 	break;
-      case 20: /* "values" */
+      case 19: /* "values" */
 
 /* Line 1000 of yacc.c  */
 #line 43 "libxlu_cfg_y.y"
 	{ xlu__cfg_set_free((yyvaluep->setting)); };
 
 /* Line 1000 of yacc.c  */
-#line 1139 "libxlu_cfg_y.c"
+#line 1135 "libxlu_cfg_y.c"
 	break;
 
       default:
@@ -1466,67 +1462,67 @@ yyreduce:
         case 4:
 
 /* Line 1455 of yacc.c  */
-#line 50 "libxlu_cfg_y.y"
-    { xlu__cfg_set_store(ctx,(yyvsp[(1) - (3)].string),(yyvsp[(3) - (3)].setting),(yylsp[(3) - (3)]).first_line); ;}
+#line 51 "libxlu_cfg_y.y"
+    { xlu__cfg_set_store(ctx,(yyvsp[(1) - (4)].string),(yyvsp[(3) - (4)].setting),(yylsp[(3) - (4)]).first_line); ;}
     break;
 
-  case 10:
+  case 9:
 
 /* Line 1455 of yacc.c  */
 #line 58 "libxlu_cfg_y.y"
     { (yyval.setting)= xlu__cfg_set_mk(ctx,1,(yyvsp[(1) - (1)].string)); ;}
     break;
 
-  case 11:
+  case 10:
 
 /* Line 1455 of yacc.c  */
 #line 59 "libxlu_cfg_y.y"
     { (yyval.setting)= (yyvsp[(3) - (4)].setting); ;}
     break;
 
-  case 12:
+  case 11:
 
 /* Line 1455 of yacc.c  */
 #line 61 "libxlu_cfg_y.y"
     { (yyval.string)= (yyvsp[(1) - (1)].string); ;}
     break;
 
-  case 13:
+  case 12:
 
 /* Line 1455 of yacc.c  */
 #line 62 "libxlu_cfg_y.y"
     { (yyval.string)= (yyvsp[(1) - (1)].string); ;}
     break;
 
-  case 14:
+  case 13:
 
 /* Line 1455 of yacc.c  */
 #line 64 "libxlu_cfg_y.y"
     { (yyval.setting)= xlu__cfg_set_mk(ctx,0,0); ;}
     break;
 
-  case 15:
+  case 14:
 
 /* Line 1455 of yacc.c  */
 #line 65 "libxlu_cfg_y.y"
     { (yyval.setting)= (yyvsp[(1) - (1)].setting); ;}
     break;
 
-  case 16:
+  case 15:
 
 /* Line 1455 of yacc.c  */
 #line 66 "libxlu_cfg_y.y"
     { (yyval.setting)= (yyvsp[(1) - (3)].setting); ;}
     break;
 
-  case 17:
+  case 16:
 
 /* Line 1455 of yacc.c  */
 #line 68 "libxlu_cfg_y.y"
     { (yyval.setting)= xlu__cfg_set_mk(ctx,2,(yyvsp[(1) - (2)].string)); ;}
     break;
 
-  case 18:
+  case 17:
 
 /* Line 1455 of yacc.c  */
 #line 69 "libxlu_cfg_y.y"
@@ -1536,7 +1532,7 @@ yyreduce:
 
 
 /* Line 1455 of yacc.c  */
-#line 1540 "libxlu_cfg_y.c"
+#line 1536 "libxlu_cfg_y.c"
       default: break;
     }
   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
diff -r 1dfbae8dd282 -r cba297a18e33 tools/libxl/libxlu_cfg_y.y
--- a/tools/libxl/libxlu_cfg_y.y	Fri Aug 31 11:13:49 2012 +0100
+++ b/tools/libxl/libxlu_cfg_y.y	Fri Aug 31 12:24:57 2012 +0100
@@ -45,10 +45,10 @@
 %%
 
 file: /* empty */
- |     file setting
+ |     file assignment
 
-setting: IDENT '=' value      { xlu__cfg_set_store(ctx,$1,$3,@3.first_line); }
-                     endstmt
+assignment: IDENT '=' value endstmt
+                            { xlu__cfg_set_store(ctx,$1,$3,@3.first_line); }
  |      endstmt
  |      error NEWLINE
 

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 22:00:33 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 22: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.xen.org>)
	id 1T91Aa-0002D2-8d; Tue, 04 Sep 2012 22:00:28 +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 1T91AY-0002CU-O9
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-27.messagelabs.com!1346796018!9536272!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14299 invoked from network); 4 Sep 2012 22:00:19 -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 Sep 2012 22:00: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 1T91AQ-0007rg-JU
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T91AH-0002jr-6k
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:10 +0000
Message-Id: <E1T91AH-0002jr-6k@xenbits.xen.org>
Date: Tue, 04 Sep 2012 22:00:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: fix double free on some
	config parser errors
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1346412297 -3600
# Node ID cba297a18e3347c2b01fc453055e1fb5e62e68f9
# Parent  1dfbae8dd282da8eff8d765714eaa27bb581bb46
libxl: fix double free on some config parser errors

If libxlu_cfg_y.y encountered a config file error, the code generated
by bison would sometimes _both_ run the %destructor _and_ call
xlu__cfg_set_store for the same XLU_ConfigSetting* semantic value.
The result would be a double free.

This appears to be because of the use of a mid-rule action.  There is
some discussion of the problems with destructors and mid-rule action
error handling in "(bison)Mid-Rule Actions".  This area is complex and
best avoided.

So fix the bug by abolishing the use of a mid-rule action, which was
in any case not necessary here.

Also while we are there rename the nonterminal rule "setting" to
"assignment", to avoid confusion with the token type "setting", which
had an identically name in a different namespace.  This was especially
confusing because the nonterminal "setting" did not have "setting" as
the type of its semantic value!  (In fact the nonterminal, now called
"assignment", does not have a value so it does not have a value type.)

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


diff -r 1dfbae8dd282 -r cba297a18e33 tools/libxl/libxlu_cfg_y.c
--- a/tools/libxl/libxlu_cfg_y.c	Fri Aug 31 11:13:49 2012 +0100
+++ b/tools/libxl/libxlu_cfg_y.c	Fri Aug 31 12:24:57 2012 +0100
@@ -380,11 +380,11 @@ union yyalloc
 /* YYNTOKENS -- Number of terminals.  */
 #define YYNTOKENS  12
 /* YYNNTS -- Number of nonterminals.  */
-#define YYNNTS  10
+#define YYNNTS  9
 /* YYNRULES -- Number of rules.  */
-#define YYNRULES  20
+#define YYNRULES  19
 /* YYNRULES -- Number of states.  */
-#define YYNSTATES  29
+#define YYNSTATES  28
 
 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
 #define YYUNDEFTOK  2
@@ -430,28 +430,26 @@ static const yytype_uint8 yytranslate[] 
    YYRHS.  */
 static const yytype_uint8 yyprhs[] =
 {
-       0,     0,     3,     4,     7,     8,    14,    16,    19,    21,
-      23,    25,    30,    32,    34,    35,    37,    41,    44,    50,
-      51
+       0,     0,     3,     4,     7,    12,    14,    17,    19,    21,
+      23,    28,    30,    32,    33,    35,    39,    42,    48,    49
 };
 
 /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
 static const yytype_int8 yyrhs[] =
 {
-      13,     0,    -1,    -1,    13,    14,    -1,    -1,     3,     7,
-      17,    15,    16,    -1,    16,    -1,     1,     6,    -1,     6,
-      -1,     8,    -1,    18,    -1,     9,    21,    19,    10,    -1,
-       4,    -1,     5,    -1,    -1,    20,    -1,    20,    11,    21,
-      -1,    18,    21,    -1,    20,    11,    21,    18,    21,    -1,
-      -1,    21,     6,    -1
+      13,     0,    -1,    -1,    13,    14,    -1,     3,     7,    16,
+      15,    -1,    15,    -1,     1,     6,    -1,     6,    -1,     8,
+      -1,    17,    -1,     9,    20,    18,    10,    -1,     4,    -1,
+       5,    -1,    -1,    19,    -1,    19,    11,    20,    -1,    17,
+      20,    -1,    19,    11,    20,    17,    20,    -1,    -1,    20,
+       6,    -1
 };
 
 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
 static const yytype_uint8 yyrline[] =
 {
-       0,    47,    47,    48,    50,    50,    52,    53,    55,    56,
-      58,    59,    61,    62,    64,    65,    66,    68,    69,    71,
-      73
+       0,    47,    47,    48,    50,    52,    53,    55,    56,    58,
+      59,    61,    62,    64,    65,    66,    68,    69,    71,    73
 };
 #endif
 
@@ -461,7 +459,7 @@ static const yytype_uint8 yyrline[] =
 static const char *const yytname[] =
 {
   "$end", "error", "$undefined", "IDENT", "STRING", "NUMBER", "NEWLINE",
-  "'='", "';'", "'['", "']'", "','", "$accept", "file", "setting", "$@1",
+  "'='", "';'", "'['", "']'", "','", "$accept", "file", "assignment",
   "endstmt", "value", "atom", "valuelist", "values", "nlok", 0
 };
 #endif
@@ -479,17 +477,15 @@ static const yytype_uint16 yytoknum[] =
 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
 static const yytype_uint8 yyr1[] =
 {
-       0,    12,    13,    13,    15,    14,    14,    14,    16,    16,
-      17,    17,    18,    18,    19,    19,    19,    20,    20,    21,
-      21
+       0,    12,    13,    13,    14,    14,    14,    15,    15,    16,
+      16,    17,    17,    18,    18,    18,    19,    19,    20,    20
 };
 
 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
 static const yytype_uint8 yyr2[] =
 {
-       0,     2,     0,     2,     0,     5,     1,     2,     1,     1,
-       1,     4,     1,     1,     0,     1,     3,     2,     5,     0,
-       2
+       0,     2,     0,     2,     4,     1,     2,     1,     1,     1,
+       4,     1,     1,     0,     1,     3,     2,     5,     0,     2
 };
 
 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
@@ -497,15 +493,15 @@ static const yytype_uint8 yyr2[] =
    means the default is an error.  */
 static const yytype_uint8 yydefact[] =
 {
-       2,     0,     1,     0,     0,     8,     9,     3,     6,     7,
-       0,    12,    13,    19,     4,    10,    14,     0,    20,    19,
-       0,    15,     5,    17,    11,    19,    16,    19,    18
+       2,     0,     1,     0,     0,     7,     8,     3,     5,     6,
+       0,    11,    12,    18,     0,     9,    13,     4,    19,    18,
+       0,    14,    16,    10,    18,    15,    18,    17
 };
 
 /* YYDEFGOTO[NTERM-NUM].  */
 static const yytype_int8 yydefgoto[] =
 {
-      -1,     1,     7,    17,     8,    14,    15,    20,    21,    16
+      -1,     1,     7,     8,    14,    15,    20,    21,    16
 };
 
 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
@@ -513,15 +509,15 @@ static const yytype_int8 yydefgoto[] =
 #define YYPACT_NINF -17
 static const yytype_int8 yypact[] =
 {
-     -17,     1,   -17,    -3,     5,   -17,   -17,   -17,   -17,   -17,
-      10,   -17,   -17,   -17,   -17,   -17,    12,     0,   -17,   -17,
-      11,     9,   -17,    16,   -17,   -17,    12,   -17,    16
+     -17,     2,   -17,    -5,    -3,   -17,   -17,   -17,   -17,   -17,
+      10,   -17,   -17,   -17,    14,   -17,    12,   -17,   -17,   -17,
+      11,    -4,     6,   -17,   -17,    12,   -17,     6
 };
 
 /* YYPGOTO[NTERM-NUM].  */
 static const yytype_int8 yypgoto[] =
 {
-     -17,   -17,   -17,   -17,     6,   -17,   -16,   -17,   -17,   -14
+     -17,   -17,   -17,     9,   -17,   -16,   -17,   -17,   -13
 };
 
 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
@@ -531,25 +527,25 @@ static const yytype_int8 yypgoto[] =
 #define YYTABLE_NINF -1
 static const yytype_uint8 yytable[] =
 {
-      19,     2,     3,     9,     4,    23,     5,     5,     6,     6,
-      27,    26,    10,    28,    11,    12,    11,    12,    18,    13,
-      25,    24,    18,    22
+      19,     9,     2,     3,    10,     4,    22,    24,     5,    26,
+       6,    25,    18,    27,    11,    12,    11,    12,    18,    13,
+       5,    23,     6,    17
 };
 
 static const yytype_uint8 yycheck[] =
 {
-      16,     0,     1,     6,     3,    19,     6,     6,     8,     8,
-      26,    25,     7,    27,     4,     5,     4,     5,     6,     9,
-      11,    10,     6,    17
+      16,     6,     0,     1,     7,     3,    19,    11,     6,    25,
+       8,    24,     6,    26,     4,     5,     4,     5,     6,     9,
+       6,    10,     8,    14
 };
 
 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
    symbol of state STATE-NUM.  */
 static const yytype_uint8 yystos[] =
 {
-       0,    13,     0,     1,     3,     6,     8,    14,    16,     6,
-       7,     4,     5,     9,    17,    18,    21,    15,     6,    18,
-      19,    20,    16,    21,    10,    11,    21,    18,    21
+       0,    13,     0,     1,     3,     6,     8,    14,    15,     6,
+       7,     4,     5,     9,    16,    17,    20,    15,     6,    17,
+      18,    19,    20,    10,    11,    20,    17,    20
 };
 
 #define yyerrok		(yyerrstatus = 0)
@@ -1081,7 +1077,7 @@ yydestruct (yymsg, yytype, yyvaluep, yyl
 	{ free((yyvaluep->string)); };
 
 /* Line 1000 of yacc.c  */
-#line 1085 "libxlu_cfg_y.c"
+#line 1081 "libxlu_cfg_y.c"
 	break;
       case 4: /* "STRING" */
 
@@ -1090,7 +1086,7 @@ yydestruct (yymsg, yytype, yyvaluep, yyl
 	{ free((yyvaluep->string)); };
 
 /* Line 1000 of yacc.c  */
-#line 1094 "libxlu_cfg_y.c"
+#line 1090 "libxlu_cfg_y.c"
 	break;
       case 5: /* "NUMBER" */
 
@@ -1099,43 +1095,43 @@ yydestruct (yymsg, yytype, yyvaluep, yyl
 	{ free((yyvaluep->string)); };
 
 /* Line 1000 of yacc.c  */
-#line 1103 "libxlu_cfg_y.c"
+#line 1099 "libxlu_cfg_y.c"
 	break;
-      case 17: /* "value" */
+      case 16: /* "value" */
 
 /* Line 1000 of yacc.c  */
 #line 43 "libxlu_cfg_y.y"
 	{ xlu__cfg_set_free((yyvaluep->setting)); };
 
 /* Line 1000 of yacc.c  */
-#line 1112 "libxlu_cfg_y.c"
+#line 1108 "libxlu_cfg_y.c"
 	break;
-      case 18: /* "atom" */
+      case 17: /* "atom" */
 
 /* Line 1000 of yacc.c  */
 #line 40 "libxlu_cfg_y.y"
 	{ free((yyvaluep->string)); };
 
 /* Line 1000 of yacc.c  */
-#line 1121 "libxlu_cfg_y.c"
+#line 1117 "libxlu_cfg_y.c"
 	break;
-      case 19: /* "valuelist" */
+      case 18: /* "valuelist" */
 
 /* Line 1000 of yacc.c  */
 #line 43 "libxlu_cfg_y.y"
 	{ xlu__cfg_set_free((yyvaluep->setting)); };
 
 /* Line 1000 of yacc.c  */
-#line 1130 "libxlu_cfg_y.c"
+#line 1126 "libxlu_cfg_y.c"
 	break;
-      case 20: /* "values" */
+      case 19: /* "values" */
 
 /* Line 1000 of yacc.c  */
 #line 43 "libxlu_cfg_y.y"
 	{ xlu__cfg_set_free((yyvaluep->setting)); };
 
 /* Line 1000 of yacc.c  */
-#line 1139 "libxlu_cfg_y.c"
+#line 1135 "libxlu_cfg_y.c"
 	break;
 
       default:
@@ -1466,67 +1462,67 @@ yyreduce:
         case 4:
 
 /* Line 1455 of yacc.c  */
-#line 50 "libxlu_cfg_y.y"
-    { xlu__cfg_set_store(ctx,(yyvsp[(1) - (3)].string),(yyvsp[(3) - (3)].setting),(yylsp[(3) - (3)]).first_line); ;}
+#line 51 "libxlu_cfg_y.y"
+    { xlu__cfg_set_store(ctx,(yyvsp[(1) - (4)].string),(yyvsp[(3) - (4)].setting),(yylsp[(3) - (4)]).first_line); ;}
     break;
 
-  case 10:
+  case 9:
 
 /* Line 1455 of yacc.c  */
 #line 58 "libxlu_cfg_y.y"
     { (yyval.setting)= xlu__cfg_set_mk(ctx,1,(yyvsp[(1) - (1)].string)); ;}
     break;
 
-  case 11:
+  case 10:
 
 /* Line 1455 of yacc.c  */
 #line 59 "libxlu_cfg_y.y"
     { (yyval.setting)= (yyvsp[(3) - (4)].setting); ;}
     break;
 
-  case 12:
+  case 11:
 
 /* Line 1455 of yacc.c  */
 #line 61 "libxlu_cfg_y.y"
     { (yyval.string)= (yyvsp[(1) - (1)].string); ;}
     break;
 
-  case 13:
+  case 12:
 
 /* Line 1455 of yacc.c  */
 #line 62 "libxlu_cfg_y.y"
     { (yyval.string)= (yyvsp[(1) - (1)].string); ;}
     break;
 
-  case 14:
+  case 13:
 
 /* Line 1455 of yacc.c  */
 #line 64 "libxlu_cfg_y.y"
     { (yyval.setting)= xlu__cfg_set_mk(ctx,0,0); ;}
     break;
 
-  case 15:
+  case 14:
 
 /* Line 1455 of yacc.c  */
 #line 65 "libxlu_cfg_y.y"
     { (yyval.setting)= (yyvsp[(1) - (1)].setting); ;}
     break;
 
-  case 16:
+  case 15:
 
 /* Line 1455 of yacc.c  */
 #line 66 "libxlu_cfg_y.y"
     { (yyval.setting)= (yyvsp[(1) - (3)].setting); ;}
     break;
 
-  case 17:
+  case 16:
 
 /* Line 1455 of yacc.c  */
 #line 68 "libxlu_cfg_y.y"
     { (yyval.setting)= xlu__cfg_set_mk(ctx,2,(yyvsp[(1) - (2)].string)); ;}
     break;
 
-  case 18:
+  case 17:
 
 /* Line 1455 of yacc.c  */
 #line 69 "libxlu_cfg_y.y"
@@ -1536,7 +1532,7 @@ yyreduce:
 
 
 /* Line 1455 of yacc.c  */
-#line 1540 "libxlu_cfg_y.c"
+#line 1536 "libxlu_cfg_y.c"
       default: break;
     }
   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
diff -r 1dfbae8dd282 -r cba297a18e33 tools/libxl/libxlu_cfg_y.y
--- a/tools/libxl/libxlu_cfg_y.y	Fri Aug 31 11:13:49 2012 +0100
+++ b/tools/libxl/libxlu_cfg_y.y	Fri Aug 31 12:24:57 2012 +0100
@@ -45,10 +45,10 @@
 %%
 
 file: /* empty */
- |     file setting
+ |     file assignment
 
-setting: IDENT '=' value      { xlu__cfg_set_store(ctx,$1,$3,@3.first_line); }
-                     endstmt
+assignment: IDENT '=' value endstmt
+                            { xlu__cfg_set_store(ctx,$1,$3,@3.first_line); }
  |      endstmt
  |      error NEWLINE
 

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 22:00:33 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 22: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.xen.org>)
	id 1T91AZ-0002Cp-5Z; Tue, 04 Sep 2012 22:00:27 +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 1T91AY-0002CW-5G
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:26 +0000
Received: from [85.158.138.51:43107] by server-4.bemta-3.messagelabs.com id
	CC/F4-24831-9F976405; Tue, 04 Sep 2012 22:00:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1346796022!28661419!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12265 invoked from network); 4 Sep 2012 22:00:23 -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;
	4 Sep 2012 22:00: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 1T91AT-0007rm-Oj
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T91AT-0002le-Id
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:21 +0000
Message-Id: <E1T91AT-0002le-Id@xenbits.xen.org>
Date: Tue, 04 Sep 2012 22:00:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nestedsvm: fix interrupt handling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Christoph Egger <Christoph.Egger@amd.com>
# Date 1346444131 -3600
# Node ID 34e22386e7127f3ef77ac73098fc50c0fe7bab1f
# Parent  e9416bea04c103d3da1263322ed3c00c2d9cf46f
nestedsvm: fix interrupt handling

Give the l2 guest a chance to finish the delivery of the last injected
interrupt or exception before we emulate a VMEXIT.
For example after a NPF handled by the host there can be an interrupt
for the l1 guest.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r e9416bea04c1 -r 34e22386e712 xen/arch/x86/hvm/svm/nestedsvm.c
--- a/xen/arch/x86/hvm/svm/nestedsvm.c	Fri Aug 31 21:13:39 2012 +0100
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c	Fri Aug 31 21:15:31 2012 +0100
@@ -1164,6 +1164,8 @@ enum hvm_intblk nsvm_intr_blocked(struct
         return hvm_intblk_svm_gif;
 
     if ( nestedhvm_vcpu_in_guestmode(v) ) {
+        struct vmcb_struct *n2vmcb = nv->nv_n2vmcx;
+
         if ( svm->ns_hostflags.fields.vintrmask )
             if ( !svm->ns_hostflags.fields.rflagsif )
                 return hvm_intblk_rflags_ie;
@@ -1176,6 +1178,14 @@ enum hvm_intblk nsvm_intr_blocked(struct
          */
         if ( v->arch.hvm_vcpu.hvm_io.io_state != HVMIO_none )
             return hvm_intblk_shadow;
+
+        if ( !nv->nv_vmexit_pending && n2vmcb->exitintinfo.bytes != 0 ) {
+            /* Give the l2 guest a chance to finish the delivery of
+             * the last injected interrupt or exception before we
+             * emulate a VMEXIT (e.g. VMEXIT(INTR) ).
+             */
+            return hvm_intblk_shadow;
+        }
     }
 
     if ( nv->nv_vmexit_pending ) {

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 22:00:33 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 22: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.xen.org>)
	id 1T91AZ-0002Cp-5Z; Tue, 04 Sep 2012 22:00:27 +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 1T91AY-0002CW-5G
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:26 +0000
Received: from [85.158.138.51:43107] by server-4.bemta-3.messagelabs.com id
	CC/F4-24831-9F976405; Tue, 04 Sep 2012 22:00:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1346796022!28661419!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12265 invoked from network); 4 Sep 2012 22:00:23 -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;
	4 Sep 2012 22:00: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 1T91AT-0007rm-Oj
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T91AT-0002le-Id
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:21 +0000
Message-Id: <E1T91AT-0002le-Id@xenbits.xen.org>
Date: Tue, 04 Sep 2012 22:00:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nestedsvm: fix interrupt handling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Christoph Egger <Christoph.Egger@amd.com>
# Date 1346444131 -3600
# Node ID 34e22386e7127f3ef77ac73098fc50c0fe7bab1f
# Parent  e9416bea04c103d3da1263322ed3c00c2d9cf46f
nestedsvm: fix interrupt handling

Give the l2 guest a chance to finish the delivery of the last injected
interrupt or exception before we emulate a VMEXIT.
For example after a NPF handled by the host there can be an interrupt
for the l1 guest.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r e9416bea04c1 -r 34e22386e712 xen/arch/x86/hvm/svm/nestedsvm.c
--- a/xen/arch/x86/hvm/svm/nestedsvm.c	Fri Aug 31 21:13:39 2012 +0100
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c	Fri Aug 31 21:15:31 2012 +0100
@@ -1164,6 +1164,8 @@ enum hvm_intblk nsvm_intr_blocked(struct
         return hvm_intblk_svm_gif;
 
     if ( nestedhvm_vcpu_in_guestmode(v) ) {
+        struct vmcb_struct *n2vmcb = nv->nv_n2vmcx;
+
         if ( svm->ns_hostflags.fields.vintrmask )
             if ( !svm->ns_hostflags.fields.rflagsif )
                 return hvm_intblk_rflags_ie;
@@ -1176,6 +1178,14 @@ enum hvm_intblk nsvm_intr_blocked(struct
          */
         if ( v->arch.hvm_vcpu.hvm_io.io_state != HVMIO_none )
             return hvm_intblk_shadow;
+
+        if ( !nv->nv_vmexit_pending && n2vmcb->exitintinfo.bytes != 0 ) {
+            /* Give the l2 guest a chance to finish the delivery of
+             * the last injected interrupt or exception before we
+             * emulate a VMEXIT (e.g. VMEXIT(INTR) ).
+             */
+            return hvm_intblk_shadow;
+        }
     }
 
     if ( nv->nv_vmexit_pending ) {

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 22:00:33 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 22: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.xen.org>)
	id 1T91AZ-0002Cg-2o; Tue, 04 Sep 2012 22:00:27 +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 1T91AY-0002CV-2U
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:26 +0000
Received: from [85.158.138.51:9240] by server-9.bemta-3.messagelabs.com id
	ED/9D-15390-9F976405; Tue, 04 Sep 2012 22:00:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1346796021!28661418!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12150 invoked from network); 4 Sep 2012 22:00:22 -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;
	4 Sep 2012 22:00: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 1T91AT-0007rj-5g
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T91AR-0002lL-4J
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:19 +0000
Message-Id: <E1T91AR-0002lL-4J@xenbits.xen.org>
Date: Tue, 04 Sep 2012 22:00:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tmem: add matching unlock for an
	about-to-be-destroyed object
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dan Magenheimer <dan.magenheimer@oracle.com>
# Date 1346444019 -3600
# Node ID e9416bea04c103d3da1263322ed3c00c2d9cf46f
# Parent  cba297a18e3347c2b01fc453055e1fb5e62e68f9
tmem: add matching unlock for an about-to-be-destroyed object

A 4.2 changeset forces a preempt_disable/enable with
every lock/unlock.

Tmem has dynamically allocated "objects" that contain a
lock.  The lock is held when the object is destroyed.
No reason to unlock something that's about to be destroyed!
But with the preempt_enable/disable in the generic locking code,
and the fact that do_softirq ASSERTs that preempt_count
must be zero, a crash occurs soon after any object is
destroyed.

So force lock to be released before destroying objects.

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r cba297a18e33 -r e9416bea04c1 xen/common/tmem.c
--- a/xen/common/tmem.c	Fri Aug 31 12:24:57 2012 +0100
+++ b/xen/common/tmem.c	Fri Aug 31 21:13:39 2012 +0100
@@ -952,6 +952,7 @@ static NOINLINE void obj_free(obj_t *obj
     /* use no_rebalance only if all objects are being destroyed anyway */
     if ( !no_rebalance )
         rb_erase(&obj->rb_tree_node,&pool->obj_rb_root[oid_hash(&old_oid)]);
+    tmem_spin_unlock(&obj->obj_spinlock);
     tmem_free(obj,sizeof(obj_t),pool);
 }
 

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 22:00:33 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 22: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.xen.org>)
	id 1T91AZ-0002Cg-2o; Tue, 04 Sep 2012 22:00:27 +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 1T91AY-0002CV-2U
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:26 +0000
Received: from [85.158.138.51:9240] by server-9.bemta-3.messagelabs.com id
	ED/9D-15390-9F976405; Tue, 04 Sep 2012 22:00:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1346796021!28661418!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12150 invoked from network); 4 Sep 2012 22:00:22 -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;
	4 Sep 2012 22:00: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 1T91AT-0007rj-5g
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T91AR-0002lL-4J
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:19 +0000
Message-Id: <E1T91AR-0002lL-4J@xenbits.xen.org>
Date: Tue, 04 Sep 2012 22:00:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tmem: add matching unlock for an
	about-to-be-destroyed object
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dan Magenheimer <dan.magenheimer@oracle.com>
# Date 1346444019 -3600
# Node ID e9416bea04c103d3da1263322ed3c00c2d9cf46f
# Parent  cba297a18e3347c2b01fc453055e1fb5e62e68f9
tmem: add matching unlock for an about-to-be-destroyed object

A 4.2 changeset forces a preempt_disable/enable with
every lock/unlock.

Tmem has dynamically allocated "objects" that contain a
lock.  The lock is held when the object is destroyed.
No reason to unlock something that's about to be destroyed!
But with the preempt_enable/disable in the generic locking code,
and the fact that do_softirq ASSERTs that preempt_count
must be zero, a crash occurs soon after any object is
destroyed.

So force lock to be released before destroying objects.

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r cba297a18e33 -r e9416bea04c1 xen/common/tmem.c
--- a/xen/common/tmem.c	Fri Aug 31 12:24:57 2012 +0100
+++ b/xen/common/tmem.c	Fri Aug 31 21:13:39 2012 +0100
@@ -952,6 +952,7 @@ static NOINLINE void obj_free(obj_t *obj
     /* use no_rebalance only if all objects are being destroyed anyway */
     if ( !no_rebalance )
         rb_erase(&obj->rb_tree_node,&pool->obj_rb_root[oid_hash(&old_oid)]);
+    tmem_spin_unlock(&obj->obj_spinlock);
     tmem_free(obj,sizeof(obj_t),pool);
 }
 

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 22:00:34 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 22:00:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T91Aa-0002D7-Bd; Tue, 04 Sep 2012 22:00:28 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T91AZ-0002Cf-53
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:27 +0000
Received: from [85.158.143.99:35941] by server-3.bemta-4.messagelabs.com id
	F8/E8-08232-AF976405; Tue, 04 Sep 2012 22:00:26 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-216.messagelabs.com!1346796022!23210888!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13271 invoked from network); 4 Sep 2012 22:00:23 -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;
	4 Sep 2012 22:00: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 1T91AU-0007rp-BP
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T91AU-0002lt-5K
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:22 +0000
Message-Id: <E1T91AU-0002lt-5K@xenbits.xen.org>
Date: Tue, 04 Sep 2012 22:00:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: comment opaque expression in
	__page_to_virt()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1346653070 -7200
# Node ID 8fbdcc1c5613dc55c23be8b56f52a37f4d89e9fa
# Parent  34e22386e7127f3ef77ac73098fc50c0fe7bab1f
x86: comment opaque expression in __page_to_virt()

mm.h's __page_to_virt() has a rather opaque expression. Comment it.

Reported-By: Ian Campbell <ian.campbell@citrix.com>
Suggested-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 34e22386e712 -r 8fbdcc1c5613 xen/include/asm-x86/mm.h
--- a/xen/include/asm-x86/mm.h	Fri Aug 31 21:15:31 2012 +0100
+++ b/xen/include/asm-x86/mm.h	Mon Sep 03 08:17:50 2012 +0200
@@ -323,6 +323,12 @@ static inline struct page_info *__virt_t
 static inline void *__page_to_virt(const struct page_info *pg)
 {
     ASSERT((unsigned long)pg - FRAMETABLE_VIRT_START < FRAMETABLE_VIRT_END);
+    /*
+     * (sizeof(*pg) & -sizeof(*pg)) selects the LS bit of sizeof(*pg). The
+     * division and re-multiplication avoids one shift when sizeof(*pg) is a
+     * power of two (otherwise there would be a right shift followed by a
+     * left shift, which the compiler can't know it can fold into one).
+     */
     return (void *)(DIRECTMAP_VIRT_START +
                     ((unsigned long)pg - FRAMETABLE_VIRT_START) /
                     (sizeof(*pg) / (sizeof(*pg) & -sizeof(*pg))) *

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 22:00:34 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 22:00:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T91Aa-0002D7-Bd; Tue, 04 Sep 2012 22:00:28 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T91AZ-0002Cf-53
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:27 +0000
Received: from [85.158.143.99:35941] by server-3.bemta-4.messagelabs.com id
	F8/E8-08232-AF976405; Tue, 04 Sep 2012 22:00:26 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-216.messagelabs.com!1346796022!23210888!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13271 invoked from network); 4 Sep 2012 22:00:23 -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;
	4 Sep 2012 22:00: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 1T91AU-0007rp-BP
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T91AU-0002lt-5K
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:22 +0000
Message-Id: <E1T91AU-0002lt-5K@xenbits.xen.org>
Date: Tue, 04 Sep 2012 22:00:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: comment opaque expression in
	__page_to_virt()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1346653070 -7200
# Node ID 8fbdcc1c5613dc55c23be8b56f52a37f4d89e9fa
# Parent  34e22386e7127f3ef77ac73098fc50c0fe7bab1f
x86: comment opaque expression in __page_to_virt()

mm.h's __page_to_virt() has a rather opaque expression. Comment it.

Reported-By: Ian Campbell <ian.campbell@citrix.com>
Suggested-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 34e22386e712 -r 8fbdcc1c5613 xen/include/asm-x86/mm.h
--- a/xen/include/asm-x86/mm.h	Fri Aug 31 21:15:31 2012 +0100
+++ b/xen/include/asm-x86/mm.h	Mon Sep 03 08:17:50 2012 +0200
@@ -323,6 +323,12 @@ static inline struct page_info *__virt_t
 static inline void *__page_to_virt(const struct page_info *pg)
 {
     ASSERT((unsigned long)pg - FRAMETABLE_VIRT_START < FRAMETABLE_VIRT_END);
+    /*
+     * (sizeof(*pg) & -sizeof(*pg)) selects the LS bit of sizeof(*pg). The
+     * division and re-multiplication avoids one shift when sizeof(*pg) is a
+     * power of two (otherwise there would be a right shift followed by a
+     * left shift, which the compiler can't know it can fold into one).
+     */
     return (void *)(DIRECTMAP_VIRT_START +
                     ((unsigned long)pg - FRAMETABLE_VIRT_START) /
                     (sizeof(*pg) / (sizeof(*pg) & -sizeof(*pg))) *

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 22:00:37 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 22: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.xen.org>)
	id 1T91Af-0002Ds-FX; Tue, 04 Sep 2012 22:00:33 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T91Ad-0002DN-VR
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:32 +0000
Received: from [85.158.143.99:5543] by server-2.bemta-4.messagelabs.com id
	B1/7F-21239-FF976405; Tue, 04 Sep 2012 22:00:31 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-216.messagelabs.com!1346796028!23210902!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13508 invoked from network); 4 Sep 2012 22:00:29 -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;
	4 Sep 2012 22:00: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 1T91Aa-0007s1-JW
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T91Aa-0002mi-1f
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:28 +0000
Message-Id: <E1T91Aa-0002mi-1f@xenbits.xen.org>
Date: Tue, 04 Sep 2012 22:00:27 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl/xl: implement support for
	guest ioport and irq permissions.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1346667719 -3600
# Node ID 596eb118b86f8ab14bd45f3f19573417a97c70a8
# Parent  4746414def65746af0708d592ddd14834eaee590
libxl/xl: implement support for guest ioport and irq permissions.

This is useful for passing legacy ISA devices (e.g. com ports,
parallel ports) to guests.

Supported syntax is as described in
http://cmrg.fifthhorseman.net/wiki/xen#grantingaccesstoserialhardwaretoadomU

I tested this using Xen's 'q' key handler which prints out the I/O
port and IRQ ranges allowed for each domain. e.g.:

(XEN) Rangesets belonging to domain 31:
(XEN)     I/O Ports  { 2e8-2ef, 2f8-2ff }
(XEN)     Interrupts { 3, 5-6 }

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Tested-by: Dieter Bloms <dieter@bloms.de>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 4746414def65 -r 596eb118b86f docs/man/xl.cfg.pod.5
--- a/docs/man/xl.cfg.pod.5	Mon Sep 03 09:40:38 2012 +0200
+++ b/docs/man/xl.cfg.pod.5	Mon Sep 03 11:21:59 2012 +0100
@@ -402,6 +402,30 @@ for more information on the "permissive"
 
 =back
 
+=item B<ioports=[ "IOPORT_RANGE", "IOPORT_RANGE", ... ]>
+
+=over 4
+
+Allow guest to access specific legacy I/O ports. Each B<IOPORT_RANGE>
+is given in hexadecimal and may either a span e.g. C<2f8-2ff>
+(inclusive) or a single I/O port C<2f8>.
+
+It is recommended to use this option only for trusted VMs under
+administrator control.
+
+=back
+
+=item B<irqs=[ NUMBER, NUMBER, ... ]>
+
+=over 4
+
+Allow a guest to access specific physical IRQs.
+
+It is recommended to use this option only for trusted VMs under
+administrator control.
+
+=back
+
 =head2 Paravirtualised (PV) Guest Specific Options
 
 The following options apply only to Paravirtual guests.
diff -r 4746414def65 -r 596eb118b86f tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Mon Sep 03 09:40:38 2012 +0200
+++ b/tools/libxl/libxl_create.c	Mon Sep 03 11:21:59 2012 +0100
@@ -933,6 +933,36 @@ static void domcreate_launch_dm(libxl__e
         LOG(ERROR, "unable to add disk devices");
         goto error_out;
     }
+
+    for (i = 0; i < d_config->b_info.num_ioports; i++) {
+        libxl_ioport_range *io = &d_config->b_info.ioports[i];
+
+        LOG(DEBUG, "dom%d ioports %"PRIx32"-%"PRIx32,
+            domid, io->first, io->first + io->number - 1);
+
+        ret = xc_domain_ioport_permission(CTX->xch, domid,
+                                          io->first, io->number, 1);
+        if ( ret<0 ){
+            LOGE(ERROR,
+                 "failed give dom%d access to ioports %"PRIx32"-%"PRIx32,
+                 domid, io->first, io->first + io->number - 1);
+            ret = ERROR_FAIL;
+        }
+    }
+
+    for (i = 0; i < d_config->b_info.num_irqs; i++) {
+        uint32_t irq = d_config->b_info.irqs[i];
+
+        LOG(DEBUG, "dom%d irq %"PRIx32, domid, irq);
+
+        ret = xc_domain_irq_permission(CTX->xch, domid, irq, 1);
+        if ( ret<0 ){
+            LOGE(ERROR,
+                 "failed give dom%d access to irq %"PRId32, domid, irq);
+            ret = ERROR_FAIL;
+        }
+    }
+
     for (i = 0; i < d_config->num_nics; i++) {
         /* We have to init the nic here, because we still haven't
          * called libxl_device_nic_add at this point, but qemu needs
diff -r 4746414def65 -r 596eb118b86f tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Mon Sep 03 09:40:38 2012 +0200
+++ b/tools/libxl/libxl_types.idl	Mon Sep 03 11:21:59 2012 +0100
@@ -135,6 +135,11 @@ libxl_vga_interface_type = Enumeration("
 # Complex libxl types
 #
 
+libxl_ioport_range = Struct("ioport_range", [
+    ("first", uint32),
+    ("number", uint32),
+    ])
+
 libxl_vga_interface_info = Struct("vga_interface_info", [
     ("kind",    libxl_vga_interface_type),
     ])
@@ -277,6 +282,9 @@ libxl_domain_build_info = Struct("domain
     #  parameters for all type of scheduler
     ("sched_params",     libxl_domain_sched_params),
 
+    ("ioports",          Array(libxl_ioport_range, "num_ioports")),
+    ("irqs",             Array(uint32, "num_irqs")),
+
     ("u", KeyedUnion(None, libxl_domain_type, "type",
                 [("hvm", Struct(None, [("firmware",         string),
                                        ("bios",             libxl_bios_type),
diff -r 4746414def65 -r 596eb118b86f tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Mon Sep 03 09:40:38 2012 +0200
+++ b/tools/libxl/xl_cmdimpl.c	Mon Sep 03 11:21:59 2012 +0100
@@ -573,10 +573,12 @@ static void parse_config_data(const char
     long l;
     XLU_Config *config;
     XLU_ConfigList *cpus, *vbds, *nics, *pcis, *cvfbs, *cpuids;
+    XLU_ConfigList *ioports, *irqs;
+    int num_ioports, num_irqs;
     int pci_power_mgmt = 0;
     int pci_msitranslate = 0;
     int pci_permissive = 0;
-    int e;
+    int i, e;
 
     libxl_domain_create_info *c_info = &d_config->c_info;
     libxl_domain_build_info *b_info = &d_config->b_info;
@@ -919,6 +921,89 @@ static void parse_config_data(const char
         abort();
     }
 
+    if (!xlu_cfg_get_list(config, "ioports", &ioports, &num_ioports, 0)) {
+        b_info->num_ioports = num_ioports;
+        b_info->ioports = calloc(num_ioports, sizeof(*b_info->ioports));
+        if (b_info->ioports == NULL) {
+            fprintf(stderr, "unable to allocate memory for ioports\n");
+            exit(-1);
+        }
+
+        for (i = 0; i < num_ioports; i++) {
+            const char *buf2;
+            char *ep;
+            uint32_t start, end;
+            unsigned long ul;
+
+            buf = xlu_cfg_get_listitem (ioports, i);
+            if (!buf) {
+                fprintf(stderr,
+                        "xl: Unable to get element #%d in ioport list\n", i);
+                exit(1);
+            }
+            ul = strtoul(buf, &ep, 16);
+            if (ep == buf) {
+                fprintf(stderr, "xl: Invalid argument parsing ioport: %s\n",
+                        buf);
+                exit(1);
+            }
+            if (ul >= UINT32_MAX) {
+                fprintf(stderr, "xl: ioport %lx too big\n", ul);
+                exit(1);
+            }
+            start = end = ul;
+
+            if (*ep == '-') {
+                buf2 = ep + 1;
+                ul = strtoul(buf2, &ep, 16);
+                if (ep == buf2 || *ep != '\0' || start > end) {
+                    fprintf(stderr,
+                            "xl: Invalid argument parsing ioport: %s\n", buf);
+                    exit(1);
+                }
+                if (ul >= UINT32_MAX) {
+                    fprintf(stderr, "xl: ioport %lx too big\n", ul);
+                    exit(1);
+                }
+                end = ul;
+            } else if ( *ep != '\0' )
+                fprintf(stderr,
+                        "xl: Invalid argument parsing ioport: %s\n", buf);
+            b_info->ioports[i].first = start;
+            b_info->ioports[i].number = end - start + 1;
+        }
+    }
+
+    if (!xlu_cfg_get_list(config, "irqs", &irqs, &num_irqs, 0)) {
+        b_info->num_irqs = num_irqs;
+        b_info->irqs = calloc(num_irqs, sizeof(*b_info->irqs));
+        if (b_info->irqs == NULL) {
+            fprintf(stderr, "unable to allocate memory for ioports\n");
+            exit(-1);
+        }
+        for (i = 0; i < num_irqs; i++) {
+            char *ep;
+            unsigned long ul;
+            buf = xlu_cfg_get_listitem (irqs, i);
+            if (!buf) {
+                fprintf(stderr,
+                        "xl: Unable to get element %d in irq list\n", i);
+                exit(1);
+            }
+            ul = strtoul(buf, &ep, 10);
+            if (ep == buf) {
+                fprintf(stderr,
+                        "xl: Invalid argument parsing irq: %s\n", buf);
+                exit(1);
+            }
+            if (ul >= UINT32_MAX) {
+                fprintf(stderr, "xl: irq %lx too big\n", ul);
+                exit(1);
+            }
+            b_info->irqs[i] = ul;
+        }
+    }
+
     if (!xlu_cfg_get_list (config, "disk", &vbds, 0, 0)) {
         d_config->num_disks = 0;
         d_config->disks = NULL;

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 22:00:37 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 22: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.xen.org>)
	id 1T91Af-0002Ds-FX; Tue, 04 Sep 2012 22:00:33 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T91Ad-0002DN-VR
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:32 +0000
Received: from [85.158.143.99:5543] by server-2.bemta-4.messagelabs.com id
	B1/7F-21239-FF976405; Tue, 04 Sep 2012 22:00:31 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-216.messagelabs.com!1346796028!23210902!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13508 invoked from network); 4 Sep 2012 22:00:29 -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;
	4 Sep 2012 22:00: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 1T91Aa-0007s1-JW
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T91Aa-0002mi-1f
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:28 +0000
Message-Id: <E1T91Aa-0002mi-1f@xenbits.xen.org>
Date: Tue, 04 Sep 2012 22:00:27 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl/xl: implement support for
	guest ioport and irq permissions.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1346667719 -3600
# Node ID 596eb118b86f8ab14bd45f3f19573417a97c70a8
# Parent  4746414def65746af0708d592ddd14834eaee590
libxl/xl: implement support for guest ioport and irq permissions.

This is useful for passing legacy ISA devices (e.g. com ports,
parallel ports) to guests.

Supported syntax is as described in
http://cmrg.fifthhorseman.net/wiki/xen#grantingaccesstoserialhardwaretoadomU

I tested this using Xen's 'q' key handler which prints out the I/O
port and IRQ ranges allowed for each domain. e.g.:

(XEN) Rangesets belonging to domain 31:
(XEN)     I/O Ports  { 2e8-2ef, 2f8-2ff }
(XEN)     Interrupts { 3, 5-6 }

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Tested-by: Dieter Bloms <dieter@bloms.de>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 4746414def65 -r 596eb118b86f docs/man/xl.cfg.pod.5
--- a/docs/man/xl.cfg.pod.5	Mon Sep 03 09:40:38 2012 +0200
+++ b/docs/man/xl.cfg.pod.5	Mon Sep 03 11:21:59 2012 +0100
@@ -402,6 +402,30 @@ for more information on the "permissive"
 
 =back
 
+=item B<ioports=[ "IOPORT_RANGE", "IOPORT_RANGE", ... ]>
+
+=over 4
+
+Allow guest to access specific legacy I/O ports. Each B<IOPORT_RANGE>
+is given in hexadecimal and may either a span e.g. C<2f8-2ff>
+(inclusive) or a single I/O port C<2f8>.
+
+It is recommended to use this option only for trusted VMs under
+administrator control.
+
+=back
+
+=item B<irqs=[ NUMBER, NUMBER, ... ]>
+
+=over 4
+
+Allow a guest to access specific physical IRQs.
+
+It is recommended to use this option only for trusted VMs under
+administrator control.
+
+=back
+
 =head2 Paravirtualised (PV) Guest Specific Options
 
 The following options apply only to Paravirtual guests.
diff -r 4746414def65 -r 596eb118b86f tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Mon Sep 03 09:40:38 2012 +0200
+++ b/tools/libxl/libxl_create.c	Mon Sep 03 11:21:59 2012 +0100
@@ -933,6 +933,36 @@ static void domcreate_launch_dm(libxl__e
         LOG(ERROR, "unable to add disk devices");
         goto error_out;
     }
+
+    for (i = 0; i < d_config->b_info.num_ioports; i++) {
+        libxl_ioport_range *io = &d_config->b_info.ioports[i];
+
+        LOG(DEBUG, "dom%d ioports %"PRIx32"-%"PRIx32,
+            domid, io->first, io->first + io->number - 1);
+
+        ret = xc_domain_ioport_permission(CTX->xch, domid,
+                                          io->first, io->number, 1);
+        if ( ret<0 ){
+            LOGE(ERROR,
+                 "failed give dom%d access to ioports %"PRIx32"-%"PRIx32,
+                 domid, io->first, io->first + io->number - 1);
+            ret = ERROR_FAIL;
+        }
+    }
+
+    for (i = 0; i < d_config->b_info.num_irqs; i++) {
+        uint32_t irq = d_config->b_info.irqs[i];
+
+        LOG(DEBUG, "dom%d irq %"PRIx32, domid, irq);
+
+        ret = xc_domain_irq_permission(CTX->xch, domid, irq, 1);
+        if ( ret<0 ){
+            LOGE(ERROR,
+                 "failed give dom%d access to irq %"PRId32, domid, irq);
+            ret = ERROR_FAIL;
+        }
+    }
+
     for (i = 0; i < d_config->num_nics; i++) {
         /* We have to init the nic here, because we still haven't
          * called libxl_device_nic_add at this point, but qemu needs
diff -r 4746414def65 -r 596eb118b86f tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Mon Sep 03 09:40:38 2012 +0200
+++ b/tools/libxl/libxl_types.idl	Mon Sep 03 11:21:59 2012 +0100
@@ -135,6 +135,11 @@ libxl_vga_interface_type = Enumeration("
 # Complex libxl types
 #
 
+libxl_ioport_range = Struct("ioport_range", [
+    ("first", uint32),
+    ("number", uint32),
+    ])
+
 libxl_vga_interface_info = Struct("vga_interface_info", [
     ("kind",    libxl_vga_interface_type),
     ])
@@ -277,6 +282,9 @@ libxl_domain_build_info = Struct("domain
     #  parameters for all type of scheduler
     ("sched_params",     libxl_domain_sched_params),
 
+    ("ioports",          Array(libxl_ioport_range, "num_ioports")),
+    ("irqs",             Array(uint32, "num_irqs")),
+
     ("u", KeyedUnion(None, libxl_domain_type, "type",
                 [("hvm", Struct(None, [("firmware",         string),
                                        ("bios",             libxl_bios_type),
diff -r 4746414def65 -r 596eb118b86f tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Mon Sep 03 09:40:38 2012 +0200
+++ b/tools/libxl/xl_cmdimpl.c	Mon Sep 03 11:21:59 2012 +0100
@@ -573,10 +573,12 @@ static void parse_config_data(const char
     long l;
     XLU_Config *config;
     XLU_ConfigList *cpus, *vbds, *nics, *pcis, *cvfbs, *cpuids;
+    XLU_ConfigList *ioports, *irqs;
+    int num_ioports, num_irqs;
     int pci_power_mgmt = 0;
     int pci_msitranslate = 0;
     int pci_permissive = 0;
-    int e;
+    int i, e;
 
     libxl_domain_create_info *c_info = &d_config->c_info;
     libxl_domain_build_info *b_info = &d_config->b_info;
@@ -919,6 +921,89 @@ static void parse_config_data(const char
         abort();
     }
 
+    if (!xlu_cfg_get_list(config, "ioports", &ioports, &num_ioports, 0)) {
+        b_info->num_ioports = num_ioports;
+        b_info->ioports = calloc(num_ioports, sizeof(*b_info->ioports));
+        if (b_info->ioports == NULL) {
+            fprintf(stderr, "unable to allocate memory for ioports\n");
+            exit(-1);
+        }
+
+        for (i = 0; i < num_ioports; i++) {
+            const char *buf2;
+            char *ep;
+            uint32_t start, end;
+            unsigned long ul;
+
+            buf = xlu_cfg_get_listitem (ioports, i);
+            if (!buf) {
+                fprintf(stderr,
+                        "xl: Unable to get element #%d in ioport list\n", i);
+                exit(1);
+            }
+            ul = strtoul(buf, &ep, 16);
+            if (ep == buf) {
+                fprintf(stderr, "xl: Invalid argument parsing ioport: %s\n",
+                        buf);
+                exit(1);
+            }
+            if (ul >= UINT32_MAX) {
+                fprintf(stderr, "xl: ioport %lx too big\n", ul);
+                exit(1);
+            }
+            start = end = ul;
+
+            if (*ep == '-') {
+                buf2 = ep + 1;
+                ul = strtoul(buf2, &ep, 16);
+                if (ep == buf2 || *ep != '\0' || start > end) {
+                    fprintf(stderr,
+                            "xl: Invalid argument parsing ioport: %s\n", buf);
+                    exit(1);
+                }
+                if (ul >= UINT32_MAX) {
+                    fprintf(stderr, "xl: ioport %lx too big\n", ul);
+                    exit(1);
+                }
+                end = ul;
+            } else if ( *ep != '\0' )
+                fprintf(stderr,
+                        "xl: Invalid argument parsing ioport: %s\n", buf);
+            b_info->ioports[i].first = start;
+            b_info->ioports[i].number = end - start + 1;
+        }
+    }
+
+    if (!xlu_cfg_get_list(config, "irqs", &irqs, &num_irqs, 0)) {
+        b_info->num_irqs = num_irqs;
+        b_info->irqs = calloc(num_irqs, sizeof(*b_info->irqs));
+        if (b_info->irqs == NULL) {
+            fprintf(stderr, "unable to allocate memory for ioports\n");
+            exit(-1);
+        }
+        for (i = 0; i < num_irqs; i++) {
+            char *ep;
+            unsigned long ul;
+            buf = xlu_cfg_get_listitem (irqs, i);
+            if (!buf) {
+                fprintf(stderr,
+                        "xl: Unable to get element %d in irq list\n", i);
+                exit(1);
+            }
+            ul = strtoul(buf, &ep, 10);
+            if (ep == buf) {
+                fprintf(stderr,
+                        "xl: Invalid argument parsing irq: %s\n", buf);
+                exit(1);
+            }
+            if (ul >= UINT32_MAX) {
+                fprintf(stderr, "xl: irq %lx too big\n", ul);
+                exit(1);
+            }
+            b_info->irqs[i] = ul;
+        }
+    }
+
     if (!xlu_cfg_get_list (config, "disk", &vbds, 0, 0)) {
         d_config->num_disks = 0;
         d_config->disks = NULL;

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 22:00:37 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 22: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.xen.org>)
	id 1T91Ah-0002FD-Mq; Tue, 04 Sep 2012 22:00:35 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T91Af-0002Df-Hd
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:33 +0000
Received: from [85.158.143.99:36137] by server-1.bemta-4.messagelabs.com id
	3F/FD-12504-00A76405; Tue, 04 Sep 2012 22:00:32 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-216.messagelabs.com!1346796031!28529024!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18203 invoked from network); 4 Sep 2012 22:00:32 -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;
	4 Sep 2012 22:00: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 1T91Ad-0007s7-8D
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T91Ad-0002nD-6Q
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:31 +0000
Message-Id: <E1T91Ad-0002nD-6Q@xenbits.xen.org>
Date: Tue, 04 Sep 2012 22:00:30 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: correctly check for error on
	dom0 allocation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <Ian.Campbell@citrix.com>
# Date 1346667720 -3600
# Node ID 8c2cd070f258ba7dbdf3f6ca318a284a44378078
# Parent  294592457aab9c009b2029df7c250e6998b94274
arm: correctly check for error on dom0 allocation

Drop the redundant printk

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Jan Beulich <JBeulich@suse.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 294592457aab -r 8c2cd070f258 xen/arch/arm/setup.c
--- a/xen/arch/arm/setup.c	Mon Sep 03 11:22:00 2012 +0100
+++ b/xen/arch/arm/setup.c	Mon Sep 03 11:22:00 2012 +0100
@@ -238,9 +238,7 @@ void __init start_xen(unsigned long boot
 
     /* Create initial domain 0. */
     dom0 = domain_create(0, 0, 0);
-    if ( IS_ERR(dom0) )
-            printk("domain_create failed\n");
-    if ( (dom0 == NULL) || (alloc_dom0_vcpu0() == NULL) )
+    if ( IS_ERR(dom0) || (alloc_dom0_vcpu0() == NULL) )
             panic("Error creating domain 0\n");
 
     dom0->is_privileged = 1;

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 22:00:37 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 22: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.xen.org>)
	id 1T91Ah-0002FD-Mq; Tue, 04 Sep 2012 22:00:35 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T91Af-0002Df-Hd
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:33 +0000
Received: from [85.158.143.99:36137] by server-1.bemta-4.messagelabs.com id
	3F/FD-12504-00A76405; Tue, 04 Sep 2012 22:00:32 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-216.messagelabs.com!1346796031!28529024!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18203 invoked from network); 4 Sep 2012 22:00:32 -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;
	4 Sep 2012 22:00: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 1T91Ad-0007s7-8D
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T91Ad-0002nD-6Q
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:31 +0000
Message-Id: <E1T91Ad-0002nD-6Q@xenbits.xen.org>
Date: Tue, 04 Sep 2012 22:00:30 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: correctly check for error on
	dom0 allocation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <Ian.Campbell@citrix.com>
# Date 1346667720 -3600
# Node ID 8c2cd070f258ba7dbdf3f6ca318a284a44378078
# Parent  294592457aab9c009b2029df7c250e6998b94274
arm: correctly check for error on dom0 allocation

Drop the redundant printk

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Jan Beulich <JBeulich@suse.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 294592457aab -r 8c2cd070f258 xen/arch/arm/setup.c
--- a/xen/arch/arm/setup.c	Mon Sep 03 11:22:00 2012 +0100
+++ b/xen/arch/arm/setup.c	Mon Sep 03 11:22:00 2012 +0100
@@ -238,9 +238,7 @@ void __init start_xen(unsigned long boot
 
     /* Create initial domain 0. */
     dom0 = domain_create(0, 0, 0);
-    if ( IS_ERR(dom0) )
-            printk("domain_create failed\n");
-    if ( (dom0 == NULL) || (alloc_dom0_vcpu0() == NULL) )
+    if ( IS_ERR(dom0) || (alloc_dom0_vcpu0() == NULL) )
             panic("Error creating domain 0\n");
 
     dom0->is_privileged = 1;

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 22:00:38 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 22:00:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T91Ai-0002FX-Q3; Tue, 04 Sep 2012 22:00:36 +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 1T91Ag-0002EU-ME
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:34 +0000
Received: from [85.158.138.51:43434] by server-7.bemta-3.messagelabs.com id
	F7/D5-32000-10A76405; Tue, 04 Sep 2012 22:00:33 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-174.messagelabs.com!1346796031!26875778!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14219 invoked from network); 4 Sep 2012 22:00:32 -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;
	4 Sep 2012 22:00: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 1T91Ac-0007s4-Qf
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T91Ab-0002mx-3G
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:29 +0000
Message-Id: <E1T91Ab-0002mx-3G@xenbits.xen.org>
Date: Tue, 04 Sep 2012 22:00:28 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs/command line: Clarify the
	behavior with invalid input.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Andrew Cooper <Andrew.Cooper3@citrix.com>
# Date 1346667720 -3600
# Node ID 294592457aab9c009b2029df7c250e6998b94274
# Parent  596eb118b86f8ab14bd45f3f19573417a97c70a8
docs/command line: Clarify the behavior with invalid input.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.de>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 596eb118b86f -r 294592457aab docs/misc/xen-command-line.markdown
--- a/docs/misc/xen-command-line.markdown	Mon Sep 03 11:21:59 2012 +0100
+++ b/docs/misc/xen-command-line.markdown	Mon Sep 03 11:22:00 2012 +0100
@@ -11,7 +11,8 @@ Hypervisor.
 ## Types of parameter
 
 Most parameters take the form `option=value`.  Different options on
-the command line should be space delimited.
+the command line should be space delimited.  All options are case
+sensitive, as are all values unless explicitly noted.
 
 ### Boolean (`<boolean>`)
 
@@ -35,6 +36,9 @@ Disable x2apic support (if present)
 Enable synchronous console mode
 > `sync_console`
 
+Explicitly specifying any value other than those listed above is
+undefined, as is stacking a `no-` prefix with an explicit value.
+
 ### Integer (`<integer>`)
 
 An integer parameter will default to decimal and may be prefixed with
@@ -42,6 +46,9 @@ a `-` for negative numbers.  Alternative
 used by prefixing the number with `0x`, or an octal number may be used
 if a leading `0` is present.
 
+Providing a string which does not validly convert to an integer is
+undefined.
+
 ### Size (`<size>`)
 
 A size parameter may be any integer, with a size suffix
@@ -51,7 +58,8 @@ A size parameter may be any integer, wit
 * `K` or `k`: KiB (2^10)
 * `B` or `b`: Bytes
 
-Without a size suffix, the default will be kilo.
+Without a size suffix, the default will be kilo.  Providing a suffix
+other than those listed above is undefined.
 
 ### String
 

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 22:00:38 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 22:00:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T91Ai-0002FX-Q3; Tue, 04 Sep 2012 22:00:36 +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 1T91Ag-0002EU-ME
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:34 +0000
Received: from [85.158.138.51:43434] by server-7.bemta-3.messagelabs.com id
	F7/D5-32000-10A76405; Tue, 04 Sep 2012 22:00:33 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-174.messagelabs.com!1346796031!26875778!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14219 invoked from network); 4 Sep 2012 22:00:32 -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;
	4 Sep 2012 22:00: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 1T91Ac-0007s4-Qf
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T91Ab-0002mx-3G
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:29 +0000
Message-Id: <E1T91Ab-0002mx-3G@xenbits.xen.org>
Date: Tue, 04 Sep 2012 22:00:28 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs/command line: Clarify the
	behavior with invalid input.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Andrew Cooper <Andrew.Cooper3@citrix.com>
# Date 1346667720 -3600
# Node ID 294592457aab9c009b2029df7c250e6998b94274
# Parent  596eb118b86f8ab14bd45f3f19573417a97c70a8
docs/command line: Clarify the behavior with invalid input.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.de>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 596eb118b86f -r 294592457aab docs/misc/xen-command-line.markdown
--- a/docs/misc/xen-command-line.markdown	Mon Sep 03 11:21:59 2012 +0100
+++ b/docs/misc/xen-command-line.markdown	Mon Sep 03 11:22:00 2012 +0100
@@ -11,7 +11,8 @@ Hypervisor.
 ## Types of parameter
 
 Most parameters take the form `option=value`.  Different options on
-the command line should be space delimited.
+the command line should be space delimited.  All options are case
+sensitive, as are all values unless explicitly noted.
 
 ### Boolean (`<boolean>`)
 
@@ -35,6 +36,9 @@ Disable x2apic support (if present)
 Enable synchronous console mode
 > `sync_console`
 
+Explicitly specifying any value other than those listed above is
+undefined, as is stacking a `no-` prefix with an explicit value.
+
 ### Integer (`<integer>`)
 
 An integer parameter will default to decimal and may be prefixed with
@@ -42,6 +46,9 @@ a `-` for negative numbers.  Alternative
 used by prefixing the number with `0x`, or an octal number may be used
 if a leading `0` is present.
 
+Providing a string which does not validly convert to an integer is
+undefined.
+
 ### Size (`<size>`)
 
 A size parameter may be any integer, with a size suffix
@@ -51,7 +58,8 @@ A size parameter may be any integer, wit
 * `K` or `k`: KiB (2^10)
 * `B` or `b`: Bytes
 
-Without a size suffix, the default will be kilo.
+Without a size suffix, the default will be kilo.  Providing a suffix
+other than those listed above is undefined.
 
 ### String
 

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 22:00:38 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 22:00:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T91Aj-0002Fw-44; Tue, 04 Sep 2012 22:00:37 +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 1T91Ai-0002DL-Ao
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:36 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1346796027!9576327!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23525 invoked from network); 4 Sep 2012 22:00:28 -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;
	4 Sep 2012 22:00: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 1T91AZ-0007rw-HQ
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T91AZ-0002mT-F8
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:27 +0000
Message-Id: <E1T91AZ-0002mT-F8@xenbits.xen.org>
Date: Tue, 04 Sep 2012 22:00:26 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] make domain_create() return a proper
	error code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1346658038 -7200
# Node ID 4746414def65746af0708d592ddd14834eaee590
# Parent  d1736b98a702c375591931d5f61db3c47f381afc
make domain_create() return a proper error code

While triggered by the XSA-9 fix, this really is of more general use;
that fix just pointed out very sharply that the current situation
with all domain creation failures reported to user (tools) space as
-ENOMEM is very unfortunate (actively misleading users _and_ support
personnel).

Pull over the pointer <-> error code conversion infrastructure from
Linux, and use it in domain_create() and all it callers.

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


diff -r d1736b98a702 -r 4746414def65 xen/arch/arm/setup.c
--- a/xen/arch/arm/setup.c	Mon Sep 03 08:35:41 2012 +0200
+++ b/xen/arch/arm/setup.c	Mon Sep 03 09:40:38 2012 +0200
@@ -26,6 +26,7 @@
 #include <xen/serial.h>
 #include <xen/sched.h>
 #include <xen/console.h>
+#include <xen/err.h>
 #include <xen/init.h>
 #include <xen/irq.h>
 #include <xen/mm.h>
@@ -237,7 +238,7 @@ void __init start_xen(unsigned long boot
 
     /* Create initial domain 0. */
     dom0 = domain_create(0, 0, 0);
-    if ( dom0 == NULL )
+    if ( IS_ERR(dom0) )
             printk("domain_create failed\n");
     if ( (dom0 == NULL) || (alloc_dom0_vcpu0() == NULL) )
             panic("Error creating domain 0\n");
diff -r d1736b98a702 -r 4746414def65 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Mon Sep 03 08:35:41 2012 +0200
+++ b/xen/arch/x86/mm.c	Mon Sep 03 09:40:38 2012 +0200
@@ -91,7 +91,7 @@
 #include <xen/mm.h>
 #include <xen/domain.h>
 #include <xen/sched.h>
-#include <xen/errno.h>
+#include <xen/err.h>
 #include <xen/perfc.h>
 #include <xen/irq.h>
 #include <xen/softirq.h>
@@ -309,7 +309,7 @@ void __init arch_init_memory(void)
      * their domain field set to dom_xen.
      */
     dom_xen = domain_create(DOMID_XEN, DOMCRF_dummy, 0);
-    BUG_ON(dom_xen == NULL);
+    BUG_ON(IS_ERR(dom_xen));
 
     /*
      * Initialise our DOMID_IO domain.
@@ -317,14 +317,14 @@ void __init arch_init_memory(void)
      * array. Mappings occur at the priv of the caller.
      */
     dom_io = domain_create(DOMID_IO, DOMCRF_dummy, 0);
-    BUG_ON(dom_io == NULL);
+    BUG_ON(IS_ERR(dom_io));
     
     /*
-     * Initialise our DOMID_IO domain.
+     * Initialise our COW domain.
      * This domain owns sharable pages.
      */
     dom_cow = domain_create(DOMID_COW, DOMCRF_dummy, 0);
-    BUG_ON(dom_cow == NULL);
+    BUG_ON(IS_ERR(dom_cow));
 
     /* First 1MB of RAM is historically marked as I/O. */
     for ( i = 0; i < 0x100; i++ )
diff -r d1736b98a702 -r 4746414def65 xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c	Mon Sep 03 08:35:41 2012 +0200
+++ b/xen/arch/x86/setup.c	Mon Sep 03 09:40:38 2012 +0200
@@ -1,6 +1,7 @@
 #include <xen/config.h>
 #include <xen/init.h>
 #include <xen/lib.h>
+#include <xen/err.h>
 #include <xen/sched.h>
 #include <xen/sched-if.h>
 #include <xen/domain.h>
@@ -1319,7 +1320,7 @@ void __init __start_xen(unsigned long mb
 
     /* Create initial domain 0. */
     dom0 = domain_create(0, DOMCRF_s3_integrity, 0);
-    if ( (dom0 == NULL) || (alloc_dom0_vcpu0() == NULL) )
+    if ( IS_ERR(dom0) || (alloc_dom0_vcpu0() == NULL) )
         panic("Error creating domain 0\n");
 
     dom0->is_privileged = 1;
diff -r d1736b98a702 -r 4746414def65 xen/common/cpupool.c
--- a/xen/common/cpupool.c	Mon Sep 03 08:35:41 2012 +0200
+++ b/xen/common/cpupool.c	Mon Sep 03 09:40:38 2012 +0200
@@ -370,14 +370,18 @@ out:
 int cpupool_add_domain(struct domain *d, int poolid)
 {
     struct cpupool *c;
-    int rc = 1;
+    int rc;
     int n_dom = 0;
 
     if ( poolid == CPUPOOLID_NONE )
         return 0;
     spin_lock(&cpupool_lock);
     c = cpupool_find_by_id(poolid);
-    if ( (c != NULL) && cpumask_weight(c->cpu_valid) )
+    if ( c == NULL )
+        rc = -ESRCH;
+    else if ( !cpumask_weight(c->cpu_valid) )
+        rc = -ENODEV;
+    else
     {
         c->n_dom++;
         n_dom = c->n_dom;
diff -r d1736b98a702 -r 4746414def65 xen/common/domain.c
--- a/xen/common/domain.c	Mon Sep 03 08:35:41 2012 +0200
+++ b/xen/common/domain.c	Mon Sep 03 09:40:38 2012 +0200
@@ -9,7 +9,7 @@
 #include <xen/init.h>
 #include <xen/lib.h>
 #include <xen/ctype.h>
-#include <xen/errno.h>
+#include <xen/err.h>
 #include <xen/sched.h>
 #include <xen/sched-if.h>
 #include <xen/domain.h>
@@ -196,17 +196,17 @@ struct domain *domain_create(
     struct domain *d, **pd;
     enum { INIT_xsm = 1u<<0, INIT_watchdog = 1u<<1, INIT_rangeset = 1u<<2,
            INIT_evtchn = 1u<<3, INIT_gnttab = 1u<<4, INIT_arch = 1u<<5 };
-    int init_status = 0;
+    int err, init_status = 0;
     int poolid = CPUPOOLID_NONE;
 
     if ( (d = alloc_domain_struct()) == NULL )
-        return NULL;
+        return ERR_PTR(-ENOMEM);
 
     d->domain_id = domid;
 
     lock_profile_register_struct(LOCKPROF_TYPE_PERDOM, d, domid, "Domain");
 
-    if ( xsm_alloc_security_domain(d) != 0 )
+    if ( (err = xsm_alloc_security_domain(d)) != 0 )
         goto fail;
     init_status |= INIT_xsm;
 
@@ -226,6 +226,7 @@ struct domain *domain_create(
     spin_lock_init(&d->shutdown_lock);
     d->shutdown_code = -1;
 
+    err = -ENOMEM;
     if ( !zalloc_cpumask_var(&d->domain_dirty_cpumask) )
         goto fail;
 
@@ -251,7 +252,7 @@ struct domain *domain_create(
 
     if ( !is_idle_domain(d) )
     {
-        if ( xsm_domain_create(d, ssidref) != 0 )
+        if ( (err = xsm_domain_create(d, ssidref)) != 0 )
             goto fail;
 
         d->is_paused_by_controller = 1;
@@ -266,29 +267,30 @@ struct domain *domain_create(
 
         radix_tree_init(&d->pirq_tree);
 
-        if ( evtchn_init(d) != 0 )
+        if ( (err = evtchn_init(d)) != 0 )
             goto fail;
         init_status |= INIT_evtchn;
 
-        if ( grant_table_create(d) != 0 )
+        if ( (err = grant_table_create(d)) != 0 )
             goto fail;
         init_status |= INIT_gnttab;
 
         poolid = 0;
 
+        err = -ENOMEM;
         d->mem_event = xzalloc(struct mem_event_per_domain);
         if ( !d->mem_event )
             goto fail;
     }
 
-    if ( arch_domain_create(d, domcr_flags) != 0 )
+    if ( (err = arch_domain_create(d, domcr_flags)) != 0 )
         goto fail;
     init_status |= INIT_arch;
 
-    if ( cpupool_add_domain(d, poolid) != 0 )
+    if ( (err = cpupool_add_domain(d, poolid)) != 0 )
         goto fail;
 
-    if ( sched_init_domain(d) != 0 )
+    if ( (err = sched_init_domain(d)) != 0 )
         goto fail;
 
     if ( !is_idle_domain(d) )
@@ -329,7 +331,7 @@ struct domain *domain_create(
         xsm_free_security_domain(d);
     free_cpumask_var(d->domain_dirty_cpumask);
     free_domain_struct(d);
-    return NULL;
+    return ERR_PTR(err);
 }
 
 
diff -r d1736b98a702 -r 4746414def65 xen/common/domctl.c
--- a/xen/common/domctl.c	Mon Sep 03 08:35:41 2012 +0200
+++ b/xen/common/domctl.c	Mon Sep 03 09:40:38 2012 +0200
@@ -9,6 +9,7 @@
 #include <xen/config.h>
 #include <xen/types.h>
 #include <xen/lib.h>
+#include <xen/err.h>
 #include <xen/mm.h>
 #include <xen/sched.h>
 #include <xen/sched-if.h>
@@ -455,10 +456,12 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domc
         if ( op->u.createdomain.flags & XEN_DOMCTL_CDF_oos_off )
             domcr_flags |= DOMCRF_oos_off;
 
-        ret = -ENOMEM;
         d = domain_create(dom, domcr_flags, op->u.createdomain.ssidref);
-        if ( d == NULL )
+        if ( IS_ERR(d) )
+        {
+            ret = PTR_ERR(d);
             break;
+        }
 
         ret = 0;
 
diff -r d1736b98a702 -r 4746414def65 xen/common/schedule.c
--- a/xen/common/schedule.c	Mon Sep 03 08:35:41 2012 +0200
+++ b/xen/common/schedule.c	Mon Sep 03 09:40:38 2012 +0200
@@ -28,7 +28,7 @@
 #include <xen/softirq.h>
 #include <xen/trace.h>
 #include <xen/mm.h>
-#include <xen/errno.h>
+#include <xen/err.h>
 #include <xen/guest_access.h>
 #include <xen/multicall.h>
 #include <xen/cpu.h>
@@ -1323,7 +1323,7 @@ void __init scheduler_init(void)
         panic("scheduler returned error on init\n");
 
     idle_domain = domain_create(DOMID_IDLE, 0, 0);
-    BUG_ON(idle_domain == NULL);
+    BUG_ON(IS_ERR(idle_domain));
     idle_domain->vcpu = idle_vcpu;
     idle_domain->max_vcpus = nr_cpu_ids;
     if ( alloc_vcpu(idle_domain, 0, 0) == NULL )
diff -r d1736b98a702 -r 4746414def65 xen/include/xen/err.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/include/xen/err.h	Mon Sep 03 09:40:38 2012 +0200
@@ -0,0 +1,57 @@
+#if !defined(__XEN_ERR_H__) && !defined(__ASSEMBLY__)
+#define __XEN_ERR_H__
+
+#include <xen/compiler.h>
+#include <xen/errno.h>
+
+/*
+ * Kernel pointers have redundant information, so we can use a
+ * scheme where we can return either an error code or a dentry
+ * pointer with the same return value.
+ *
+ * This could be a per-architecture thing, to allow different
+ * error and pointer decisions.
+ */
+#define MAX_ERRNO	4095
+
+#define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO)
+
+static inline void *__must_check ERR_PTR(long error)
+{
+	return (void *)error;
+}
+
+static inline long __must_check PTR_ERR(const void *ptr)
+{
+	return (long)ptr;
+}
+
+static inline long __must_check IS_ERR(const void *ptr)
+{
+	return IS_ERR_VALUE((unsigned long)ptr);
+}
+
+static inline long __must_check IS_ERR_OR_NULL(const void *ptr)
+{
+	return !ptr || IS_ERR_VALUE((unsigned long)ptr);
+}
+
+/**
+ * ERR_CAST - Explicitly cast an error-valued pointer to another pointer type
+ * @ptr: The pointer to cast.
+ *
+ * Explicitly cast an error-valued pointer to another pointer type in such a
+ * way as to make it clear that's what's going on.
+ */
+static inline void * __must_check ERR_CAST(const void *ptr)
+{
+	/* cast away the const */
+	return (void *)ptr;
+}
+
+static inline int __must_check PTR_RET(const void *ptr)
+{
+	return IS_ERR(ptr) ? PTR_ERR(ptr) : 0;
+}
+
+#endif /* __XEN_ERR_H__ */

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 22:00:38 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 22:00:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T91Aj-0002Fw-44; Tue, 04 Sep 2012 22:00:37 +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 1T91Ai-0002DL-Ao
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:36 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1346796027!9576327!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23525 invoked from network); 4 Sep 2012 22:00:28 -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;
	4 Sep 2012 22:00: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 1T91AZ-0007rw-HQ
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T91AZ-0002mT-F8
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:27 +0000
Message-Id: <E1T91AZ-0002mT-F8@xenbits.xen.org>
Date: Tue, 04 Sep 2012 22:00:26 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] make domain_create() return a proper
	error code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1346658038 -7200
# Node ID 4746414def65746af0708d592ddd14834eaee590
# Parent  d1736b98a702c375591931d5f61db3c47f381afc
make domain_create() return a proper error code

While triggered by the XSA-9 fix, this really is of more general use;
that fix just pointed out very sharply that the current situation
with all domain creation failures reported to user (tools) space as
-ENOMEM is very unfortunate (actively misleading users _and_ support
personnel).

Pull over the pointer <-> error code conversion infrastructure from
Linux, and use it in domain_create() and all it callers.

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


diff -r d1736b98a702 -r 4746414def65 xen/arch/arm/setup.c
--- a/xen/arch/arm/setup.c	Mon Sep 03 08:35:41 2012 +0200
+++ b/xen/arch/arm/setup.c	Mon Sep 03 09:40:38 2012 +0200
@@ -26,6 +26,7 @@
 #include <xen/serial.h>
 #include <xen/sched.h>
 #include <xen/console.h>
+#include <xen/err.h>
 #include <xen/init.h>
 #include <xen/irq.h>
 #include <xen/mm.h>
@@ -237,7 +238,7 @@ void __init start_xen(unsigned long boot
 
     /* Create initial domain 0. */
     dom0 = domain_create(0, 0, 0);
-    if ( dom0 == NULL )
+    if ( IS_ERR(dom0) )
             printk("domain_create failed\n");
     if ( (dom0 == NULL) || (alloc_dom0_vcpu0() == NULL) )
             panic("Error creating domain 0\n");
diff -r d1736b98a702 -r 4746414def65 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Mon Sep 03 08:35:41 2012 +0200
+++ b/xen/arch/x86/mm.c	Mon Sep 03 09:40:38 2012 +0200
@@ -91,7 +91,7 @@
 #include <xen/mm.h>
 #include <xen/domain.h>
 #include <xen/sched.h>
-#include <xen/errno.h>
+#include <xen/err.h>
 #include <xen/perfc.h>
 #include <xen/irq.h>
 #include <xen/softirq.h>
@@ -309,7 +309,7 @@ void __init arch_init_memory(void)
      * their domain field set to dom_xen.
      */
     dom_xen = domain_create(DOMID_XEN, DOMCRF_dummy, 0);
-    BUG_ON(dom_xen == NULL);
+    BUG_ON(IS_ERR(dom_xen));
 
     /*
      * Initialise our DOMID_IO domain.
@@ -317,14 +317,14 @@ void __init arch_init_memory(void)
      * array. Mappings occur at the priv of the caller.
      */
     dom_io = domain_create(DOMID_IO, DOMCRF_dummy, 0);
-    BUG_ON(dom_io == NULL);
+    BUG_ON(IS_ERR(dom_io));
     
     /*
-     * Initialise our DOMID_IO domain.
+     * Initialise our COW domain.
      * This domain owns sharable pages.
      */
     dom_cow = domain_create(DOMID_COW, DOMCRF_dummy, 0);
-    BUG_ON(dom_cow == NULL);
+    BUG_ON(IS_ERR(dom_cow));
 
     /* First 1MB of RAM is historically marked as I/O. */
     for ( i = 0; i < 0x100; i++ )
diff -r d1736b98a702 -r 4746414def65 xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c	Mon Sep 03 08:35:41 2012 +0200
+++ b/xen/arch/x86/setup.c	Mon Sep 03 09:40:38 2012 +0200
@@ -1,6 +1,7 @@
 #include <xen/config.h>
 #include <xen/init.h>
 #include <xen/lib.h>
+#include <xen/err.h>
 #include <xen/sched.h>
 #include <xen/sched-if.h>
 #include <xen/domain.h>
@@ -1319,7 +1320,7 @@ void __init __start_xen(unsigned long mb
 
     /* Create initial domain 0. */
     dom0 = domain_create(0, DOMCRF_s3_integrity, 0);
-    if ( (dom0 == NULL) || (alloc_dom0_vcpu0() == NULL) )
+    if ( IS_ERR(dom0) || (alloc_dom0_vcpu0() == NULL) )
         panic("Error creating domain 0\n");
 
     dom0->is_privileged = 1;
diff -r d1736b98a702 -r 4746414def65 xen/common/cpupool.c
--- a/xen/common/cpupool.c	Mon Sep 03 08:35:41 2012 +0200
+++ b/xen/common/cpupool.c	Mon Sep 03 09:40:38 2012 +0200
@@ -370,14 +370,18 @@ out:
 int cpupool_add_domain(struct domain *d, int poolid)
 {
     struct cpupool *c;
-    int rc = 1;
+    int rc;
     int n_dom = 0;
 
     if ( poolid == CPUPOOLID_NONE )
         return 0;
     spin_lock(&cpupool_lock);
     c = cpupool_find_by_id(poolid);
-    if ( (c != NULL) && cpumask_weight(c->cpu_valid) )
+    if ( c == NULL )
+        rc = -ESRCH;
+    else if ( !cpumask_weight(c->cpu_valid) )
+        rc = -ENODEV;
+    else
     {
         c->n_dom++;
         n_dom = c->n_dom;
diff -r d1736b98a702 -r 4746414def65 xen/common/domain.c
--- a/xen/common/domain.c	Mon Sep 03 08:35:41 2012 +0200
+++ b/xen/common/domain.c	Mon Sep 03 09:40:38 2012 +0200
@@ -9,7 +9,7 @@
 #include <xen/init.h>
 #include <xen/lib.h>
 #include <xen/ctype.h>
-#include <xen/errno.h>
+#include <xen/err.h>
 #include <xen/sched.h>
 #include <xen/sched-if.h>
 #include <xen/domain.h>
@@ -196,17 +196,17 @@ struct domain *domain_create(
     struct domain *d, **pd;
     enum { INIT_xsm = 1u<<0, INIT_watchdog = 1u<<1, INIT_rangeset = 1u<<2,
            INIT_evtchn = 1u<<3, INIT_gnttab = 1u<<4, INIT_arch = 1u<<5 };
-    int init_status = 0;
+    int err, init_status = 0;
     int poolid = CPUPOOLID_NONE;
 
     if ( (d = alloc_domain_struct()) == NULL )
-        return NULL;
+        return ERR_PTR(-ENOMEM);
 
     d->domain_id = domid;
 
     lock_profile_register_struct(LOCKPROF_TYPE_PERDOM, d, domid, "Domain");
 
-    if ( xsm_alloc_security_domain(d) != 0 )
+    if ( (err = xsm_alloc_security_domain(d)) != 0 )
         goto fail;
     init_status |= INIT_xsm;
 
@@ -226,6 +226,7 @@ struct domain *domain_create(
     spin_lock_init(&d->shutdown_lock);
     d->shutdown_code = -1;
 
+    err = -ENOMEM;
     if ( !zalloc_cpumask_var(&d->domain_dirty_cpumask) )
         goto fail;
 
@@ -251,7 +252,7 @@ struct domain *domain_create(
 
     if ( !is_idle_domain(d) )
     {
-        if ( xsm_domain_create(d, ssidref) != 0 )
+        if ( (err = xsm_domain_create(d, ssidref)) != 0 )
             goto fail;
 
         d->is_paused_by_controller = 1;
@@ -266,29 +267,30 @@ struct domain *domain_create(
 
         radix_tree_init(&d->pirq_tree);
 
-        if ( evtchn_init(d) != 0 )
+        if ( (err = evtchn_init(d)) != 0 )
             goto fail;
         init_status |= INIT_evtchn;
 
-        if ( grant_table_create(d) != 0 )
+        if ( (err = grant_table_create(d)) != 0 )
             goto fail;
         init_status |= INIT_gnttab;
 
         poolid = 0;
 
+        err = -ENOMEM;
         d->mem_event = xzalloc(struct mem_event_per_domain);
         if ( !d->mem_event )
             goto fail;
     }
 
-    if ( arch_domain_create(d, domcr_flags) != 0 )
+    if ( (err = arch_domain_create(d, domcr_flags)) != 0 )
         goto fail;
     init_status |= INIT_arch;
 
-    if ( cpupool_add_domain(d, poolid) != 0 )
+    if ( (err = cpupool_add_domain(d, poolid)) != 0 )
         goto fail;
 
-    if ( sched_init_domain(d) != 0 )
+    if ( (err = sched_init_domain(d)) != 0 )
         goto fail;
 
     if ( !is_idle_domain(d) )
@@ -329,7 +331,7 @@ struct domain *domain_create(
         xsm_free_security_domain(d);
     free_cpumask_var(d->domain_dirty_cpumask);
     free_domain_struct(d);
-    return NULL;
+    return ERR_PTR(err);
 }
 
 
diff -r d1736b98a702 -r 4746414def65 xen/common/domctl.c
--- a/xen/common/domctl.c	Mon Sep 03 08:35:41 2012 +0200
+++ b/xen/common/domctl.c	Mon Sep 03 09:40:38 2012 +0200
@@ -9,6 +9,7 @@
 #include <xen/config.h>
 #include <xen/types.h>
 #include <xen/lib.h>
+#include <xen/err.h>
 #include <xen/mm.h>
 #include <xen/sched.h>
 #include <xen/sched-if.h>
@@ -455,10 +456,12 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domc
         if ( op->u.createdomain.flags & XEN_DOMCTL_CDF_oos_off )
             domcr_flags |= DOMCRF_oos_off;
 
-        ret = -ENOMEM;
         d = domain_create(dom, domcr_flags, op->u.createdomain.ssidref);
-        if ( d == NULL )
+        if ( IS_ERR(d) )
+        {
+            ret = PTR_ERR(d);
             break;
+        }
 
         ret = 0;
 
diff -r d1736b98a702 -r 4746414def65 xen/common/schedule.c
--- a/xen/common/schedule.c	Mon Sep 03 08:35:41 2012 +0200
+++ b/xen/common/schedule.c	Mon Sep 03 09:40:38 2012 +0200
@@ -28,7 +28,7 @@
 #include <xen/softirq.h>
 #include <xen/trace.h>
 #include <xen/mm.h>
-#include <xen/errno.h>
+#include <xen/err.h>
 #include <xen/guest_access.h>
 #include <xen/multicall.h>
 #include <xen/cpu.h>
@@ -1323,7 +1323,7 @@ void __init scheduler_init(void)
         panic("scheduler returned error on init\n");
 
     idle_domain = domain_create(DOMID_IDLE, 0, 0);
-    BUG_ON(idle_domain == NULL);
+    BUG_ON(IS_ERR(idle_domain));
     idle_domain->vcpu = idle_vcpu;
     idle_domain->max_vcpus = nr_cpu_ids;
     if ( alloc_vcpu(idle_domain, 0, 0) == NULL )
diff -r d1736b98a702 -r 4746414def65 xen/include/xen/err.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/include/xen/err.h	Mon Sep 03 09:40:38 2012 +0200
@@ -0,0 +1,57 @@
+#if !defined(__XEN_ERR_H__) && !defined(__ASSEMBLY__)
+#define __XEN_ERR_H__
+
+#include <xen/compiler.h>
+#include <xen/errno.h>
+
+/*
+ * Kernel pointers have redundant information, so we can use a
+ * scheme where we can return either an error code or a dentry
+ * pointer with the same return value.
+ *
+ * This could be a per-architecture thing, to allow different
+ * error and pointer decisions.
+ */
+#define MAX_ERRNO	4095
+
+#define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO)
+
+static inline void *__must_check ERR_PTR(long error)
+{
+	return (void *)error;
+}
+
+static inline long __must_check PTR_ERR(const void *ptr)
+{
+	return (long)ptr;
+}
+
+static inline long __must_check IS_ERR(const void *ptr)
+{
+	return IS_ERR_VALUE((unsigned long)ptr);
+}
+
+static inline long __must_check IS_ERR_OR_NULL(const void *ptr)
+{
+	return !ptr || IS_ERR_VALUE((unsigned long)ptr);
+}
+
+/**
+ * ERR_CAST - Explicitly cast an error-valued pointer to another pointer type
+ * @ptr: The pointer to cast.
+ *
+ * Explicitly cast an error-valued pointer to another pointer type in such a
+ * way as to make it clear that's what's going on.
+ */
+static inline void * __must_check ERR_CAST(const void *ptr)
+{
+	/* cast away the const */
+	return (void *)ptr;
+}
+
+static inline int __must_check PTR_RET(const void *ptr)
+{
+	return IS_ERR(ptr) ? PTR_ERR(ptr) : 0;
+}
+
+#endif /* __XEN_ERR_H__ */

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 22:00:39 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 22: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.xen.org>)
	id 1T91Aj-0002Fo-1A; Tue, 04 Sep 2012 22:00:37 +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 1T91Ah-0002Eo-4n
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:35 +0000
Received: from [85.158.138.51:43460] by server-8.bemta-3.messagelabs.com id
	0A/7B-24700-20A76405; Tue, 04 Sep 2012 22:00:34 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-174.messagelabs.com!1346796032!20703491!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18316 invoked from network); 4 Sep 2012 22:00:33 -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;
	4 Sep 2012 22:00: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 1T91Ae-0007sD-9S
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T91Ae-0002nh-83
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:32 +0000
Message-Id: <E1T91Ae-0002nh-83@xenbits.xen.org>
Date: Tue, 04 Sep 2012 22:00:31 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl.cfg: videoram and stdvga
	documentation improvements
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============2869802841751499081=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============2869802841751499081==
Content-Type: text/plain

# HG changeset patch
# User Pasi Kärkkäinen <pasik@iki.fi>
# Date 1346667722 -3600
# Node ID 9dc729b7559535af78209f325c76b16c767ef7bf
# Parent  d27de715b2edd2ae347944491b8dfe739e5ae4bb
xl.cfg: videoram and stdvga documentation improvements

- videoram: Document that only qemu-xen-traditional device-model currently
   supports changing the amount of video memory for stdvga graphics device.

- videoram: Better document the default amount of videoram for both stdvga
  and Cirrus.

- stdvga: Add a note that stdvga allows bigger amount of videoram and
  bigger resolutions.

Signed-off-by: Pasi Kärkkäinen <pasik@iki.fi>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r d27de715b2ed -r 9dc729b75595 docs/man/xl.cfg.pod.5
--- a/docs/man/xl.cfg.pod.5	Mon Sep 03 11:22:01 2012 +0100
+++ b/docs/man/xl.cfg.pod.5	Mon Sep 03 11:22:02 2012 +0100
@@ -740,10 +740,18 @@ in the B<VFB_SPEC_STRING> for configurin
 Sets the amount of RAM which the emulated video card will contain,
 which in turn limits the resolutions and bit depths which will be
 available. This option is only available when using the B<stdvga>
-option (see below). The default is 8MB which is sufficient for
-e.g. 1600x1200 at 32bpp. When not using the B<stdvga> option the
-amount of video ram is fixed at 4MB which is sufficient for 1024x768
-at 32 bpp.
+option (see below).
+The default amount of video ram for stdvga is 8MB which is sufficient
+for e.g. 1600x1200 at 32bpp.
+
+When using the emulated Cirrus graphics card (B<stdvga=0>)
+the amount of video ram is fixed at 4MB which is sufficient
+for 1024x768 at 32 bpp.
+
+videoram option is currently only available when using the
+qemu-xen-traditional device-model. Upstream qemu-xen device-model
+currently doesn't support changing the amount of video memory
+for the emulated graphics device.
 
 =item B<stdvga=BOOLEAN>
 
@@ -751,6 +759,7 @@ Select a standard VGA card with VBE (VES
 emulated graphics device. The default is false which means to emulate
 a Cirrus Logic GD5446 VGA card. If your guest supports VBE 2.0 or
 later (e.g. Windows XP onwards) then you should enable this.
+stdvga supports more video ram and bigger resolutions than Cirrus.
 
 =item B<vnc=BOOLEAN>
 


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

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 22:00:39 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 22: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.xen.org>)
	id 1T91Aj-0002Fo-1A; Tue, 04 Sep 2012 22:00:37 +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 1T91Ah-0002Eo-4n
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:35 +0000
Received: from [85.158.138.51:43460] by server-8.bemta-3.messagelabs.com id
	0A/7B-24700-20A76405; Tue, 04 Sep 2012 22:00:34 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-174.messagelabs.com!1346796032!20703491!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18316 invoked from network); 4 Sep 2012 22:00:33 -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;
	4 Sep 2012 22:00: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 1T91Ae-0007sD-9S
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T91Ae-0002nh-83
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:32 +0000
Message-Id: <E1T91Ae-0002nh-83@xenbits.xen.org>
Date: Tue, 04 Sep 2012 22:00:31 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl.cfg: videoram and stdvga
	documentation improvements
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============2869802841751499081=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============2869802841751499081==
Content-Type: text/plain

# HG changeset patch
# User Pasi Kärkkäinen <pasik@iki.fi>
# Date 1346667722 -3600
# Node ID 9dc729b7559535af78209f325c76b16c767ef7bf
# Parent  d27de715b2edd2ae347944491b8dfe739e5ae4bb
xl.cfg: videoram and stdvga documentation improvements

- videoram: Document that only qemu-xen-traditional device-model currently
   supports changing the amount of video memory for stdvga graphics device.

- videoram: Better document the default amount of videoram for both stdvga
  and Cirrus.

- stdvga: Add a note that stdvga allows bigger amount of videoram and
  bigger resolutions.

Signed-off-by: Pasi Kärkkäinen <pasik@iki.fi>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r d27de715b2ed -r 9dc729b75595 docs/man/xl.cfg.pod.5
--- a/docs/man/xl.cfg.pod.5	Mon Sep 03 11:22:01 2012 +0100
+++ b/docs/man/xl.cfg.pod.5	Mon Sep 03 11:22:02 2012 +0100
@@ -740,10 +740,18 @@ in the B<VFB_SPEC_STRING> for configurin
 Sets the amount of RAM which the emulated video card will contain,
 which in turn limits the resolutions and bit depths which will be
 available. This option is only available when using the B<stdvga>
-option (see below). The default is 8MB which is sufficient for
-e.g. 1600x1200 at 32bpp. When not using the B<stdvga> option the
-amount of video ram is fixed at 4MB which is sufficient for 1024x768
-at 32 bpp.
+option (see below).
+The default amount of video ram for stdvga is 8MB which is sufficient
+for e.g. 1600x1200 at 32bpp.
+
+When using the emulated Cirrus graphics card (B<stdvga=0>)
+the amount of video ram is fixed at 4MB which is sufficient
+for 1024x768 at 32 bpp.
+
+videoram option is currently only available when using the
+qemu-xen-traditional device-model. Upstream qemu-xen device-model
+currently doesn't support changing the amount of video memory
+for the emulated graphics device.
 
 =item B<stdvga=BOOLEAN>
 
@@ -751,6 +759,7 @@ Select a standard VGA card with VBE (VES
 emulated graphics device. The default is false which means to emulate
 a Cirrus Logic GD5446 VGA card. If your guest supports VBE 2.0 or
 later (e.g. Windows XP onwards) then you should enable this.
+stdvga supports more video ram and bigger resolutions than Cirrus.
 
 =item B<vnc=BOOLEAN>
 


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

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 22:00:39 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 22: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.xen.org>)
	id 1T91Ai-0002Fc-Ta; Tue, 04 Sep 2012 22:00:36 +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 1T91Ag-0002DG-Ml
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:34 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-27.messagelabs.com!1346796027!2599154!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15495 invoked from network); 4 Sep 2012 22:00:28 -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;
	4 Sep 2012 22:00: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 1T91AY-0007rs-Ui
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T91AU-0002m9-OC
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:23 +0000
Message-Id: <E1T91AU-0002m9-OC@xenbits.xen.org>
Date: Tue, 04 Sep 2012 22:00:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/HVM: RTC periodic timer
	emulation adjustments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1346654141 -7200
# Node ID d1736b98a702c375591931d5f61db3c47f381afc
# Parent  8fbdcc1c5613dc55c23be8b56f52a37f4d89e9fa
x86/HVM: RTC periodic timer emulation adjustments

- don't call rtc_timer_update() on REG_A writes when the value didn't
  change (doing the call always was reported to cause wall clock time
  lagging with the JVM running on Windows)
- don't call rtc_timer_update() on REG_B writes when RTC_PIE didn't
  change

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


diff -r 8fbdcc1c5613 -r d1736b98a702 xen/arch/x86/hvm/rtc.c
--- a/xen/arch/x86/hvm/rtc.c	Mon Sep 03 08:17:50 2012 +0200
+++ b/xen/arch/x86/hvm/rtc.c	Mon Sep 03 08:35:41 2012 +0200
@@ -365,6 +365,7 @@ static int rtc_ioport_write(void *opaque
 {
     RTCState *s = opaque;
     struct domain *d = vrtc_domain(s);
+    uint32_t orig;
 
     spin_lock(&s->lock);
 
@@ -382,6 +383,7 @@ static int rtc_ioport_write(void *opaque
         return 0;
     }
 
+    orig = s->hw.cmos_data[s->hw.cmos_index];
     switch ( s->hw.cmos_index )
     {
     case RTC_SECONDS_ALARM:
@@ -405,9 +407,9 @@ static int rtc_ioport_write(void *opaque
         break;
     case RTC_REG_A:
         /* UIP bit is read only */
-        s->hw.cmos_data[RTC_REG_A] = (data & ~RTC_UIP) |
-            (s->hw.cmos_data[RTC_REG_A] & RTC_UIP);
-        rtc_timer_update(s);
+        s->hw.cmos_data[RTC_REG_A] = (data & ~RTC_UIP) | (orig & RTC_UIP);
+        if ( (data ^ orig) & ~RTC_UIP )
+            rtc_timer_update(s);
         break;
     case RTC_REG_B:
         if ( data & RTC_SET )
@@ -436,7 +438,8 @@ static int rtc_ioport_write(void *opaque
                 hvm_isa_irq_assert(d, RTC_IRQ);
             }
         s->hw.cmos_data[RTC_REG_B] = data;
-        rtc_timer_update(s);
+        if ( (data ^ orig) & RTC_PIE )
+            rtc_timer_update(s);
         check_update_timer(s);
         alarm_timer_update(s);
         break;

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 22:00:39 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 22: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.xen.org>)
	id 1T91Ai-0002Fc-Ta; Tue, 04 Sep 2012 22:00:36 +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 1T91Ag-0002DG-Ml
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:34 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-27.messagelabs.com!1346796027!2599154!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15495 invoked from network); 4 Sep 2012 22:00:28 -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;
	4 Sep 2012 22:00: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 1T91AY-0007rs-Ui
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T91AU-0002m9-OC
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:23 +0000
Message-Id: <E1T91AU-0002m9-OC@xenbits.xen.org>
Date: Tue, 04 Sep 2012 22:00:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/HVM: RTC periodic timer
	emulation adjustments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1346654141 -7200
# Node ID d1736b98a702c375591931d5f61db3c47f381afc
# Parent  8fbdcc1c5613dc55c23be8b56f52a37f4d89e9fa
x86/HVM: RTC periodic timer emulation adjustments

- don't call rtc_timer_update() on REG_A writes when the value didn't
  change (doing the call always was reported to cause wall clock time
  lagging with the JVM running on Windows)
- don't call rtc_timer_update() on REG_B writes when RTC_PIE didn't
  change

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


diff -r 8fbdcc1c5613 -r d1736b98a702 xen/arch/x86/hvm/rtc.c
--- a/xen/arch/x86/hvm/rtc.c	Mon Sep 03 08:17:50 2012 +0200
+++ b/xen/arch/x86/hvm/rtc.c	Mon Sep 03 08:35:41 2012 +0200
@@ -365,6 +365,7 @@ static int rtc_ioport_write(void *opaque
 {
     RTCState *s = opaque;
     struct domain *d = vrtc_domain(s);
+    uint32_t orig;
 
     spin_lock(&s->lock);
 
@@ -382,6 +383,7 @@ static int rtc_ioport_write(void *opaque
         return 0;
     }
 
+    orig = s->hw.cmos_data[s->hw.cmos_index];
     switch ( s->hw.cmos_index )
     {
     case RTC_SECONDS_ALARM:
@@ -405,9 +407,9 @@ static int rtc_ioport_write(void *opaque
         break;
     case RTC_REG_A:
         /* UIP bit is read only */
-        s->hw.cmos_data[RTC_REG_A] = (data & ~RTC_UIP) |
-            (s->hw.cmos_data[RTC_REG_A] & RTC_UIP);
-        rtc_timer_update(s);
+        s->hw.cmos_data[RTC_REG_A] = (data & ~RTC_UIP) | (orig & RTC_UIP);
+        if ( (data ^ orig) & ~RTC_UIP )
+            rtc_timer_update(s);
         break;
     case RTC_REG_B:
         if ( data & RTC_SET )
@@ -436,7 +438,8 @@ static int rtc_ioport_write(void *opaque
                 hvm_isa_irq_assert(d, RTC_IRQ);
             }
         s->hw.cmos_data[RTC_REG_B] = data;
-        rtc_timer_update(s);
+        if ( (data ^ orig) & RTC_PIE )
+            rtc_timer_update(s);
         check_update_timer(s);
         alarm_timer_update(s);
         break;

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 22:00:39 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 22: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.xen.org>)
	id 1T91Ak-0002Gj-79; Tue, 04 Sep 2012 22:00:38 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T91Ai-0002Ep-Lx
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:36 +0000
Received: from [85.158.139.83:28663] by server-5.bemta-5.messagelabs.com id
	8C/D3-30514-20A76405; Tue, 04 Sep 2012 22:00:34 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-182.messagelabs.com!1346796032!24700910!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28455 invoked from network); 4 Sep 2012 22:00:33 -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;
	4 Sep 2012 22:00: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 1T91Ad-0007sA-Se
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T91Ad-0002nS-N3
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:31 +0000
Message-Id: <E1T91Ad-0002nS-N3@xenbits.xen.org>
Date: Tue, 04 Sep 2012 22:00:31 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: fix api check Makefile
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1346667721 -3600
# Node ID d27de715b2edd2ae347944491b8dfe739e5ae4bb
# Parent  8c2cd070f258ba7dbdf3f6ca318a284a44378078
libxl: fix api check Makefile

Touch the libxl.api-ok stamp file, and unconditionally put in place
the new _libxl.api-for-check.  This avoids needlessly rerunning the
preprocessor on libxl.h each time we call "make".

Ensure that _libxl.api-for-check gets the CFLAGS used for xl, so that
if it is asked for in a standalone make run it can find xentoollog.h.

Remove *.api-ok on clean.

Also fix .gitignore.

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


diff -r 8c2cd070f258 -r d27de715b2ed .gitignore
--- a/.gitignore	Mon Sep 03 11:22:00 2012 +0100
+++ b/.gitignore	Mon Sep 03 11:22:01 2012 +0100
@@ -189,7 +189,8 @@ tools/libxl/xl
 tools/libxl/testenum
 tools/libxl/testenum.c
 tools/libxl/tmp.*
-tools/libxl/libxl.api-for-check
+tools/libxl/_libxl.api-for-check
+tools/libxl/*.api-ok
 tools/libaio/src/*.ol
 tools/libaio/src/*.os
 tools/misc/cpuperf/cpuperf-perfcntr
diff -r 8c2cd070f258 -r d27de715b2ed .hgignore
--- a/.hgignore	Mon Sep 03 11:22:00 2012 +0100
+++ b/.hgignore	Mon Sep 03 11:22:01 2012 +0100
@@ -188,6 +188,7 @@
 ^tools/libxl/tmp\..*$
 ^tools/libxl/.*\.new$
 ^tools/libxl/_libxl\.api-for-check
+^tools/libxl/libxl\.api-ok
 ^tools/libvchan/vchan-node[12]$
 ^tools/libaio/src/.*\.ol$
 ^tools/libaio/src/.*\.os$
diff -r 8c2cd070f258 -r d27de715b2ed tools/libxl/Makefile
--- a/tools/libxl/Makefile	Mon Sep 03 11:22:00 2012 +0100
+++ b/tools/libxl/Makefile	Mon Sep 03 11:22:01 2012 +0100
@@ -85,7 +85,8 @@ LIBXLU_OBJS = libxlu_cfg_y.o libxlu_cfg_
 CLIENTS = xl testidl libxl-save-helper
 
 XL_OBJS = xl.o xl_cmdimpl.o xl_cmdtable.o xl_sxp.o
-$(XL_OBJS): CFLAGS += $(CFLAGS_libxenctrl) # For xentoollog.h
+$(XL_OBJS) _libxl.api-for-check: \
+            CFLAGS += $(CFLAGS_libxenctrl) # For xentoollog.h
 $(XL_OBJS): CFLAGS += $(CFLAGS_libxenlight)
 $(XL_OBJS): CFLAGS += -include $(XEN_ROOT)/tools/config.h # libxl_json.h needs it.
 
@@ -116,12 +117,13 @@ genpath-target = $(call buildmakevars2fi
 
 libxl.api-ok: check-libxl-api-rules _libxl.api-for-check
 	$(PERL) $^
+	touch $@
 
 _%.api-for-check: %.h
 	$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_$*.o) -c -E $< $(APPEND_CFLAGS) \
 		-DLIBXL_EXTERNAL_CALLERS_ONLY=LIBXL_EXTERNAL_CALLERS_ONLY \
 		>$@.new
-	$(call move-if-changed,$@.new,$@)
+	mv -f $@.new $@
 
 _paths.h: genpath
 	sed -e "s/\([^=]*\)=\(.*\)/#define \1 \2/g" $@.tmp >$@.2.tmp
@@ -211,7 +213,7 @@ install: all
 clean:
 	$(RM) -f _*.h *.o *.so* *.a $(CLIENTS) $(DEPS)
 	$(RM) -f _*.c *.pyc _paths.*.tmp _*.api-for-check
-	$(RM) -f testidl.c.new testidl.c
+	$(RM) -f testidl.c.new testidl.c *.api-ok
 
 distclean: clean
 

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

From xen-changelog-bounces@lists.xen.org Tue Sep 04 22:00:39 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Sep 2012 22: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.xen.org>)
	id 1T91Ak-0002Gj-79; Tue, 04 Sep 2012 22:00:38 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T91Ai-0002Ep-Lx
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:36 +0000
Received: from [85.158.139.83:28663] by server-5.bemta-5.messagelabs.com id
	8C/D3-30514-20A76405; Tue, 04 Sep 2012 22:00:34 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-182.messagelabs.com!1346796032!24700910!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28455 invoked from network); 4 Sep 2012 22:00:33 -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;
	4 Sep 2012 22:00: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 1T91Ad-0007sA-Se
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T91Ad-0002nS-N3
	for xen-changelog@lists.xensource.com; Tue, 04 Sep 2012 22:00:31 +0000
Message-Id: <E1T91Ad-0002nS-N3@xenbits.xen.org>
Date: Tue, 04 Sep 2012 22:00:31 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: fix api check Makefile
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1346667721 -3600
# Node ID d27de715b2edd2ae347944491b8dfe739e5ae4bb
# Parent  8c2cd070f258ba7dbdf3f6ca318a284a44378078
libxl: fix api check Makefile

Touch the libxl.api-ok stamp file, and unconditionally put in place
the new _libxl.api-for-check.  This avoids needlessly rerunning the
preprocessor on libxl.h each time we call "make".

Ensure that _libxl.api-for-check gets the CFLAGS used for xl, so that
if it is asked for in a standalone make run it can find xentoollog.h.

Remove *.api-ok on clean.

Also fix .gitignore.

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


diff -r 8c2cd070f258 -r d27de715b2ed .gitignore
--- a/.gitignore	Mon Sep 03 11:22:00 2012 +0100
+++ b/.gitignore	Mon Sep 03 11:22:01 2012 +0100
@@ -189,7 +189,8 @@ tools/libxl/xl
 tools/libxl/testenum
 tools/libxl/testenum.c
 tools/libxl/tmp.*
-tools/libxl/libxl.api-for-check
+tools/libxl/_libxl.api-for-check
+tools/libxl/*.api-ok
 tools/libaio/src/*.ol
 tools/libaio/src/*.os
 tools/misc/cpuperf/cpuperf-perfcntr
diff -r 8c2cd070f258 -r d27de715b2ed .hgignore
--- a/.hgignore	Mon Sep 03 11:22:00 2012 +0100
+++ b/.hgignore	Mon Sep 03 11:22:01 2012 +0100
@@ -188,6 +188,7 @@
 ^tools/libxl/tmp\..*$
 ^tools/libxl/.*\.new$
 ^tools/libxl/_libxl\.api-for-check
+^tools/libxl/libxl\.api-ok
 ^tools/libvchan/vchan-node[12]$
 ^tools/libaio/src/.*\.ol$
 ^tools/libaio/src/.*\.os$
diff -r 8c2cd070f258 -r d27de715b2ed tools/libxl/Makefile
--- a/tools/libxl/Makefile	Mon Sep 03 11:22:00 2012 +0100
+++ b/tools/libxl/Makefile	Mon Sep 03 11:22:01 2012 +0100
@@ -85,7 +85,8 @@ LIBXLU_OBJS = libxlu_cfg_y.o libxlu_cfg_
 CLIENTS = xl testidl libxl-save-helper
 
 XL_OBJS = xl.o xl_cmdimpl.o xl_cmdtable.o xl_sxp.o
-$(XL_OBJS): CFLAGS += $(CFLAGS_libxenctrl) # For xentoollog.h
+$(XL_OBJS) _libxl.api-for-check: \
+            CFLAGS += $(CFLAGS_libxenctrl) # For xentoollog.h
 $(XL_OBJS): CFLAGS += $(CFLAGS_libxenlight)
 $(XL_OBJS): CFLAGS += -include $(XEN_ROOT)/tools/config.h # libxl_json.h needs it.
 
@@ -116,12 +117,13 @@ genpath-target = $(call buildmakevars2fi
 
 libxl.api-ok: check-libxl-api-rules _libxl.api-for-check
 	$(PERL) $^
+	touch $@
 
 _%.api-for-check: %.h
 	$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_$*.o) -c -E $< $(APPEND_CFLAGS) \
 		-DLIBXL_EXTERNAL_CALLERS_ONLY=LIBXL_EXTERNAL_CALLERS_ONLY \
 		>$@.new
-	$(call move-if-changed,$@.new,$@)
+	mv -f $@.new $@
 
 _paths.h: genpath
 	sed -e "s/\([^=]*\)=\(.*\)/#define \1 \2/g" $@.tmp >$@.2.tmp
@@ -211,7 +213,7 @@ install: all
 clean:
 	$(RM) -f _*.h *.o *.so* *.a $(CLIENTS) $(DEPS)
 	$(RM) -f _*.c *.pyc _paths.*.tmp _*.api-for-check
-	$(RM) -f testidl.c.new testidl.c
+	$(RM) -f testidl.c.new testidl.c *.api-ok
 
 distclean: clean
 

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

From xen-changelog-bounces@lists.xen.org Wed Sep 05 01:01:42 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Sep 2012 01:01:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T93zs-00017B-KB; Wed, 05 Sep 2012 01:01:36 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T93zr-0000nh-DF
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:35 +0000
Received: from [85.158.143.35:31053] by server-2.bemta-4.messagelabs.com id
	7A/8B-21239-F64A6405; Wed, 05 Sep 2012 01:01:35 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-21.messagelabs.com!1346806893!16746535!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25932 invoked from network); 5 Sep 2012 01:01:34 -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;
	5 Sep 2012 01:01: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 1T93zo-0007N7-V4
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T93zo-0007AX-TE
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:32 +0000
Message-Id: <E1T93zo-0007AX-TE@xenbits.xen.org>
Date: Wed, 05 Sep 2012 01:01:32 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86-64: Fix off-by-one error in
	__addr_ok() macro
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Laszlo Ersek <lersek@redhat.com>
# Date 1346761678 -7200
# Node ID cde6c55bbc0777205679216aafb36d3cd02008be
# Parent  fc9fe622e5e03c6ffc21bec264969f0ca79dc456
x86-64: Fix off-by-one error in __addr_ok() macro

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 23800:72edc40e2942
xen-unstable date: Wed Aug 31 14:14:49 UTC 2011
---


diff -r fc9fe622e5e0 -r cde6c55bbc07 xen/include/asm-x86/x86_64/uaccess.h
--- a/xen/include/asm-x86/x86_64/uaccess.h	Tue Sep 04 14:23:18 2012 +0200
+++ b/xen/include/asm-x86/x86_64/uaccess.h	Tue Sep 04 14:27:58 2012 +0200
@@ -21,7 +21,7 @@ void free_compat_arg_xlat(struct vcpu *v
  * non-canonical address (and thus fault) before ever reaching VIRT_START.
  */
 #define __addr_ok(addr) \
-    (((unsigned long)(addr) < (1UL<<48)) || \
+    (((unsigned long)(addr) < (1UL<<47)) || \
      ((unsigned long)(addr) >= HYPERVISOR_VIRT_END))
 
 #define access_ok(addr, size) \

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

From xen-changelog-bounces@lists.xen.org Wed Sep 05 01:01:42 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Sep 2012 01:01:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T93zs-00017B-KB; Wed, 05 Sep 2012 01:01:36 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T93zr-0000nh-DF
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:35 +0000
Received: from [85.158.143.35:31053] by server-2.bemta-4.messagelabs.com id
	7A/8B-21239-F64A6405; Wed, 05 Sep 2012 01:01:35 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-21.messagelabs.com!1346806893!16746535!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25932 invoked from network); 5 Sep 2012 01:01:34 -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;
	5 Sep 2012 01:01: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 1T93zo-0007N7-V4
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T93zo-0007AX-TE
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:32 +0000
Message-Id: <E1T93zo-0007AX-TE@xenbits.xen.org>
Date: Wed, 05 Sep 2012 01:01:32 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86-64: Fix off-by-one error in
	__addr_ok() macro
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Laszlo Ersek <lersek@redhat.com>
# Date 1346761678 -7200
# Node ID cde6c55bbc0777205679216aafb36d3cd02008be
# Parent  fc9fe622e5e03c6ffc21bec264969f0ca79dc456
x86-64: Fix off-by-one error in __addr_ok() macro

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 23800:72edc40e2942
xen-unstable date: Wed Aug 31 14:14:49 UTC 2011
---


diff -r fc9fe622e5e0 -r cde6c55bbc07 xen/include/asm-x86/x86_64/uaccess.h
--- a/xen/include/asm-x86/x86_64/uaccess.h	Tue Sep 04 14:23:18 2012 +0200
+++ b/xen/include/asm-x86/x86_64/uaccess.h	Tue Sep 04 14:27:58 2012 +0200
@@ -21,7 +21,7 @@ void free_compat_arg_xlat(struct vcpu *v
  * non-canonical address (and thus fault) before ever reaching VIRT_START.
  */
 #define __addr_ok(addr) \
-    (((unsigned long)(addr) < (1UL<<48)) || \
+    (((unsigned long)(addr) < (1UL<<47)) || \
      ((unsigned long)(addr) >= HYPERVISOR_VIRT_END))
 
 #define access_ok(addr, size) \

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

From xen-changelog-bounces@lists.xen.org Wed Sep 05 01:01:44 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Sep 2012 01:01:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T93zy-0001ve-9U; Wed, 05 Sep 2012 01:01:42 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T93zx-0001ic-2h
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:41 +0000
Received: from [85.158.143.35:27093] by server-1.bemta-4.messagelabs.com id
	B9/9A-12504-474A6405; Wed, 05 Sep 2012 01:01:40 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-21.messagelabs.com!1346806898!12236211!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27491 invoked from network); 5 Sep 2012 01:01:39 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Sep 2012 01:01: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 1T93zu-0008Ib-CT
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T93zu-0007CI-AM
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:38 +0000
Message-Id: <E1T93zu-0007CI-AM@xenbits.xen.org>
Date: Wed, 05 Sep 2012 01:01:37 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] xen: fix page_list_splice()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1346762772 -7200
# Node ID f4cadbe5ce4bc3e05138c541e17f9601bfc35f1b
# Parent  3fe75068fa354d347029d20210d49c765babedac
xen: fix page_list_splice()

Other than in __list_splice(), the first element's prev pointer
doesn't need adjustment here - it already is PAGE_LIST_NULL. Rather
than fixing the assignment (to formally match __list_splice()), simply
assert that this assignment is really unnecessary.

Reported-by: Jisoo Yang <jisooy@gmail.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>

Also assert that the prev pointers are both PAGE_LIST_NULL.

Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25459:f6bfaf9daa50
xen-unstable date: Wed Jun  6 15:37:05 UTC 2012
---


diff -r 3fe75068fa35 -r f4cadbe5ce4b xen/include/xen/mm.h
--- a/xen/include/xen/mm.h	Tue Sep 04 14:45:42 2012 +0200
+++ b/xen/include/xen/mm.h	Tue Sep 04 14:46:12 2012 +0200
@@ -268,7 +268,8 @@ page_list_splice(struct page_list_head *
     last = list->tail;
     at = head->next;
 
-    first->list.prev = page_to_pdx(head->next);
+    ASSERT(first->list.prev == PAGE_LIST_NULL);
+    ASSERT(first->list.prev == at->list.prev);
     head->next = first;
 
     last->list.next = page_to_pdx(at);

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

From xen-changelog-bounces@lists.xen.org Wed Sep 05 01:01:44 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Sep 2012 01:01:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T93zy-0001ve-9U; Wed, 05 Sep 2012 01:01:42 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T93zx-0001ic-2h
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:41 +0000
Received: from [85.158.143.35:27093] by server-1.bemta-4.messagelabs.com id
	B9/9A-12504-474A6405; Wed, 05 Sep 2012 01:01:40 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-21.messagelabs.com!1346806898!12236211!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27491 invoked from network); 5 Sep 2012 01:01:39 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Sep 2012 01:01: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 1T93zu-0008Ib-CT
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T93zu-0007CI-AM
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:38 +0000
Message-Id: <E1T93zu-0007CI-AM@xenbits.xen.org>
Date: Wed, 05 Sep 2012 01:01:37 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] xen: fix page_list_splice()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1346762772 -7200
# Node ID f4cadbe5ce4bc3e05138c541e17f9601bfc35f1b
# Parent  3fe75068fa354d347029d20210d49c765babedac
xen: fix page_list_splice()

Other than in __list_splice(), the first element's prev pointer
doesn't need adjustment here - it already is PAGE_LIST_NULL. Rather
than fixing the assignment (to formally match __list_splice()), simply
assert that this assignment is really unnecessary.

Reported-by: Jisoo Yang <jisooy@gmail.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>

Also assert that the prev pointers are both PAGE_LIST_NULL.

Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25459:f6bfaf9daa50
xen-unstable date: Wed Jun  6 15:37:05 UTC 2012
---


diff -r 3fe75068fa35 -r f4cadbe5ce4b xen/include/xen/mm.h
--- a/xen/include/xen/mm.h	Tue Sep 04 14:45:42 2012 +0200
+++ b/xen/include/xen/mm.h	Tue Sep 04 14:46:12 2012 +0200
@@ -268,7 +268,8 @@ page_list_splice(struct page_list_head *
     last = list->tail;
     at = head->next;
 
-    first->list.prev = page_to_pdx(head->next);
+    ASSERT(first->list.prev == PAGE_LIST_NULL);
+    ASSERT(first->list.prev == at->list.prev);
     head->next = first;
 
     last->list.next = page_to_pdx(at);

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

From xen-changelog-bounces@lists.xen.org Wed Sep 05 01:01:45 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Sep 2012 01:01:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T93zx-0001lv-3b; Wed, 05 Sep 2012 01:01:41 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T93zv-0001Xu-R8
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:40 +0000
Received: from [85.158.143.99:32999] by server-3.bemta-4.messagelabs.com id
	03/06-08232-374A6405; Wed, 05 Sep 2012 01:01:39 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-216.messagelabs.com!1346806897!21527794!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15157 invoked from network); 5 Sep 2012 01:01:38 -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;
	5 Sep 2012 01:01: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 1T93zt-00087j-BB
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T93zt-0007Bn-9Y
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:37 +0000
Message-Id: <E1T93zt-0007Bn-9Y@xenbits.xen.org>
Date: Wed, 05 Sep 2012 01:01:36 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] # HG changeset patch
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1346762677 -7200
# Node ID 060fbf05ce532d86314bd9db96fe9510495abed3
# Parent  520ab355fbb09ca9a0df1c01515011bcaa636799
# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1337786286 -7200
# Node ID af559b5afbecba1048ad690347455ad54098f935
# Parent  340062faf2988eeea94e37dbb3943c5a449bff10
amd iommu: Add workaround for erratum 732 & 733

Signed-off-by: Wei Wang <wei.wang2@amd.com>

Add missing barriers. Fix early return from parse_ppr_log_entry().
Slightly adjust comments. Strip trailing blanks.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 25387:af559b5afbec
xen-unstable date: Wed May 23 15:18:06 UTC 2012
---


diff -r 520ab355fbb0 -r 060fbf05ce53 xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c	Tue Sep 04 14:43:57 2012 +0200
+++ b/xen/drivers/passthrough/amd/iommu_init.c	Tue Sep 04 14:44:37 2012 +0200
@@ -27,6 +27,7 @@
 #include <asm/hvm/svm/amd-iommu-proto.h>
 #include <asm-x86/fixmap.h>
 #include <mach_apic.h>
+#include <xen/delay.h>
 
 static struct amd_iommu **irq_to_iommu;
 static int nr_amd_iommus;
@@ -467,6 +468,7 @@ static void parse_event_log_entry(u32 en
     u16 domain_id, device_id, bdf, cword;
     u32 code;
     u64 *addr;
+    int count = 0;
     char * event_str[] = {"ILLEGAL_DEV_TABLE_ENTRY",
                           "IO_PAGE_FAULT",
                           "DEV_TABLE_HW_ERROR",
@@ -479,6 +481,25 @@ static void parse_event_log_entry(u32 en
     code = get_field_from_reg_u32(entry[1], IOMMU_EVENT_CODE_MASK,
                                             IOMMU_EVENT_CODE_SHIFT);
 
+    /*
+     * Workaround for erratum 732:
+     * It can happen that the tail pointer is updated before the actual entry
+     * got written. As suggested by RevGuide, we initialize the event log
+     * buffer to all zeros and clear event log entries after processing them.
+     */
+    while ( code == 0 )
+    {
+        if ( unlikely(++count == IOMMU_LOG_ENTRY_TIMEOUT) )
+        {
+            AMD_IOMMU_DEBUG("AMD-Vi: No event written to log\n");
+            return;
+        }
+        udelay(1);
+        rmb();
+        code = get_field_from_reg_u32(entry[1], IOMMU_EVENT_CODE_MASK,
+                                      IOMMU_EVENT_CODE_SHIFT);
+    }
+
     if ( (code > IOMMU_EVENT_INVALID_DEV_REQUEST) ||
         (code < IOMMU_EVENT_ILLEGAL_DEV_TABLE_ENTRY) )
     {
@@ -517,6 +538,8 @@ static void parse_event_log_entry(u32 en
         AMD_IOMMU_DEBUG("event 0x%08x 0x%08x 0x%08x 0x%08x\n", entry[0],
                         entry[1], entry[2], entry[3]);
     }
+
+    memset(entry, 0, IOMMU_EVENT_LOG_ENTRY_SIZE);
 }
 
 static void do_amd_iommu_irq(unsigned long data)
diff -r 520ab355fbb0 -r 060fbf05ce53 xen/include/asm-x86/hvm/svm/amd-iommu-defs.h
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h	Tue Sep 04 14:43:57 2012 +0200
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h	Tue Sep 04 14:44:37 2012 +0200
@@ -269,6 +269,8 @@
 #define IOMMU_EVENT_DEVICE_ID_MASK           0x0000FFFF
 #define IOMMU_EVENT_DEVICE_ID_SHIFT          0
 
+#define IOMMU_LOG_ENTRY_TIMEOUT                         1000
+
 /* Control Register */
 #define IOMMU_CONTROL_MMIO_OFFSET			0x18
 #define IOMMU_CONTROL_TRANSLATION_ENABLE_MASK		0x00000001

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

From xen-changelog-bounces@lists.xen.org Wed Sep 05 01:01:45 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Sep 2012 01:01:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T93zx-0001lv-3b; Wed, 05 Sep 2012 01:01:41 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T93zv-0001Xu-R8
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:40 +0000
Received: from [85.158.143.99:32999] by server-3.bemta-4.messagelabs.com id
	03/06-08232-374A6405; Wed, 05 Sep 2012 01:01:39 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-216.messagelabs.com!1346806897!21527794!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15157 invoked from network); 5 Sep 2012 01:01:38 -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;
	5 Sep 2012 01:01: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 1T93zt-00087j-BB
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T93zt-0007Bn-9Y
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:37 +0000
Message-Id: <E1T93zt-0007Bn-9Y@xenbits.xen.org>
Date: Wed, 05 Sep 2012 01:01:36 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] # HG changeset patch
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1346762677 -7200
# Node ID 060fbf05ce532d86314bd9db96fe9510495abed3
# Parent  520ab355fbb09ca9a0df1c01515011bcaa636799
# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1337786286 -7200
# Node ID af559b5afbecba1048ad690347455ad54098f935
# Parent  340062faf2988eeea94e37dbb3943c5a449bff10
amd iommu: Add workaround for erratum 732 & 733

Signed-off-by: Wei Wang <wei.wang2@amd.com>

Add missing barriers. Fix early return from parse_ppr_log_entry().
Slightly adjust comments. Strip trailing blanks.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 25387:af559b5afbec
xen-unstable date: Wed May 23 15:18:06 UTC 2012
---


diff -r 520ab355fbb0 -r 060fbf05ce53 xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c	Tue Sep 04 14:43:57 2012 +0200
+++ b/xen/drivers/passthrough/amd/iommu_init.c	Tue Sep 04 14:44:37 2012 +0200
@@ -27,6 +27,7 @@
 #include <asm/hvm/svm/amd-iommu-proto.h>
 #include <asm-x86/fixmap.h>
 #include <mach_apic.h>
+#include <xen/delay.h>
 
 static struct amd_iommu **irq_to_iommu;
 static int nr_amd_iommus;
@@ -467,6 +468,7 @@ static void parse_event_log_entry(u32 en
     u16 domain_id, device_id, bdf, cword;
     u32 code;
     u64 *addr;
+    int count = 0;
     char * event_str[] = {"ILLEGAL_DEV_TABLE_ENTRY",
                           "IO_PAGE_FAULT",
                           "DEV_TABLE_HW_ERROR",
@@ -479,6 +481,25 @@ static void parse_event_log_entry(u32 en
     code = get_field_from_reg_u32(entry[1], IOMMU_EVENT_CODE_MASK,
                                             IOMMU_EVENT_CODE_SHIFT);
 
+    /*
+     * Workaround for erratum 732:
+     * It can happen that the tail pointer is updated before the actual entry
+     * got written. As suggested by RevGuide, we initialize the event log
+     * buffer to all zeros and clear event log entries after processing them.
+     */
+    while ( code == 0 )
+    {
+        if ( unlikely(++count == IOMMU_LOG_ENTRY_TIMEOUT) )
+        {
+            AMD_IOMMU_DEBUG("AMD-Vi: No event written to log\n");
+            return;
+        }
+        udelay(1);
+        rmb();
+        code = get_field_from_reg_u32(entry[1], IOMMU_EVENT_CODE_MASK,
+                                      IOMMU_EVENT_CODE_SHIFT);
+    }
+
     if ( (code > IOMMU_EVENT_INVALID_DEV_REQUEST) ||
         (code < IOMMU_EVENT_ILLEGAL_DEV_TABLE_ENTRY) )
     {
@@ -517,6 +538,8 @@ static void parse_event_log_entry(u32 en
         AMD_IOMMU_DEBUG("event 0x%08x 0x%08x 0x%08x 0x%08x\n", entry[0],
                         entry[1], entry[2], entry[3]);
     }
+
+    memset(entry, 0, IOMMU_EVENT_LOG_ENTRY_SIZE);
 }
 
 static void do_amd_iommu_irq(unsigned long data)
diff -r 520ab355fbb0 -r 060fbf05ce53 xen/include/asm-x86/hvm/svm/amd-iommu-defs.h
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h	Tue Sep 04 14:43:57 2012 +0200
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h	Tue Sep 04 14:44:37 2012 +0200
@@ -269,6 +269,8 @@
 #define IOMMU_EVENT_DEVICE_ID_MASK           0x0000FFFF
 #define IOMMU_EVENT_DEVICE_ID_SHIFT          0
 
+#define IOMMU_LOG_ENTRY_TIMEOUT                         1000
+
 /* Control Register */
 #define IOMMU_CONTROL_MMIO_OFFSET			0x18
 #define IOMMU_CONTROL_TRANSLATION_ENABLE_MASK		0x00000001

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

From xen-changelog-bounces@lists.xen.org Wed Sep 05 01:01:45 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Sep 2012 01:01:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T93zv-0001dw-SF; Wed, 05 Sep 2012 01:01:39 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T93zu-0000nh-WA
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:39 +0000
Received: from [85.158.143.99:32976] by server-2.bemta-4.messagelabs.com id
	86/9B-21239-274A6405; Wed, 05 Sep 2012 01:01:38 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-216.messagelabs.com!1346806897!28575034!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9624 invoked from network); 5 Sep 2012 01:01:38 -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;
	5 Sep 2012 01:01: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 1T93zs-00082c-Uo
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T93zs-0007BY-Pk
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:36 +0000
Message-Id: <E1T93zs-0007BY-Pk@xenbits.xen.org>
Date: Wed, 05 Sep 2012 01:01:36 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86: don't hold off NMI delivery
	when MCE is masked
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1346762637 -7200
# Node ID 520ab355fbb09ca9a0df1c01515011bcaa636799
# Parent  201895ed11bcad4c74a2bb953f93e222c8f50abe
x86: don't hold off NMI delivery when MCE is masked

Likely through copy'n'paste, all three instances of guest MCE
processing jumped to the wrong place (where NMI processing code
correctly jumps to) when MCE-s are temporarily masked (due to one
currently being processed by the guest). A nested, unmasked NMI should
get delivered immediately, however.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25382:6dc80df50fa8
xen-unstable date: Tue May 22 14:30:11 UTC 2012
---


diff -r 201895ed11bc -r 520ab355fbb0 xen/arch/x86/x86_32/entry.S
--- a/xen/arch/x86/x86_32/entry.S	Tue Sep 04 14:42:16 2012 +0200
+++ b/xen/arch/x86/x86_32/entry.S	Tue Sep 04 14:43:57 2012 +0200
@@ -215,6 +215,7 @@ test_all_events:
         jnz  process_softirqs
         testb $1,VCPU_mce_pending(%ebx)
         jnz  process_mce
+.Ltest_guest_nmi:
         testb $1,VCPU_nmi_pending(%ebx)
         jnz  process_nmi
 test_guest_events:
@@ -244,7 +245,7 @@ process_softirqs:
 /* %ebx: struct vcpu */
 process_mce:
         testb $1 << VCPU_TRAP_MCE,VCPU_async_exception_mask(%ebx)
-        jnz  test_guest_events
+        jnz  .Ltest_guest_nmi
         sti
         movb $0,VCPU_mce_pending(%ebx)
         call set_guest_machinecheck_trapbounce
diff -r 201895ed11bc -r 520ab355fbb0 xen/arch/x86/x86_64/compat/entry.S
--- a/xen/arch/x86/x86_64/compat/entry.S	Tue Sep 04 14:42:16 2012 +0200
+++ b/xen/arch/x86/x86_64/compat/entry.S	Tue Sep 04 14:43:57 2012 +0200
@@ -104,6 +104,7 @@ ENTRY(compat_test_all_events)
         jnz   compat_process_softirqs
         testb $1,VCPU_mce_pending(%rbx)
         jnz   compat_process_mce
+.Lcompat_test_guest_nmi:
         testb $1,VCPU_nmi_pending(%rbx)
         jnz   compat_process_nmi
 compat_test_guest_events:
@@ -134,7 +135,7 @@ compat_process_softirqs:
 /* %rbx: struct vcpu */
 compat_process_mce:
         testb $1 << VCPU_TRAP_MCE,VCPU_async_exception_mask(%rbx)
-        jnz  compat_test_guest_events
+        jnz   .Lcompat_test_guest_nmi
         sti
         movb $0,VCPU_mce_pending(%rbx)
         call set_guest_machinecheck_trapbounce
diff -r 201895ed11bc -r 520ab355fbb0 xen/arch/x86/x86_64/entry.S
--- a/xen/arch/x86/x86_64/entry.S	Tue Sep 04 14:42:16 2012 +0200
+++ b/xen/arch/x86/x86_64/entry.S	Tue Sep 04 14:43:57 2012 +0200
@@ -204,6 +204,7 @@ test_all_events:
         jnz   process_softirqs
         testb $1,VCPU_mce_pending(%rbx)
         jnz   process_mce
+.Ltest_guest_nmi:
         testb $1,VCPU_nmi_pending(%rbx)
         jnz   process_nmi
 test_guest_events:
@@ -232,7 +233,7 @@ process_softirqs:
 /* %rbx: struct vcpu */
 process_mce:
         testb $1 << VCPU_TRAP_MCE,VCPU_async_exception_mask(%rbx)
-        jnz  test_guest_events
+        jnz  .Ltest_guest_nmi
         sti
         movb $0,VCPU_mce_pending(%rbx)
         call set_guest_machinecheck_trapbounce

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

From xen-changelog-bounces@lists.xen.org Wed Sep 05 01:01:45 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Sep 2012 01:01:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T93zv-0001dw-SF; Wed, 05 Sep 2012 01:01:39 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T93zu-0000nh-WA
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:39 +0000
Received: from [85.158.143.99:32976] by server-2.bemta-4.messagelabs.com id
	86/9B-21239-274A6405; Wed, 05 Sep 2012 01:01:38 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-216.messagelabs.com!1346806897!28575034!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9624 invoked from network); 5 Sep 2012 01:01:38 -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;
	5 Sep 2012 01:01: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 1T93zs-00082c-Uo
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T93zs-0007BY-Pk
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:36 +0000
Message-Id: <E1T93zs-0007BY-Pk@xenbits.xen.org>
Date: Wed, 05 Sep 2012 01:01:36 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86: don't hold off NMI delivery
	when MCE is masked
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1346762637 -7200
# Node ID 520ab355fbb09ca9a0df1c01515011bcaa636799
# Parent  201895ed11bcad4c74a2bb953f93e222c8f50abe
x86: don't hold off NMI delivery when MCE is masked

Likely through copy'n'paste, all three instances of guest MCE
processing jumped to the wrong place (where NMI processing code
correctly jumps to) when MCE-s are temporarily masked (due to one
currently being processed by the guest). A nested, unmasked NMI should
get delivered immediately, however.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25382:6dc80df50fa8
xen-unstable date: Tue May 22 14:30:11 UTC 2012
---


diff -r 201895ed11bc -r 520ab355fbb0 xen/arch/x86/x86_32/entry.S
--- a/xen/arch/x86/x86_32/entry.S	Tue Sep 04 14:42:16 2012 +0200
+++ b/xen/arch/x86/x86_32/entry.S	Tue Sep 04 14:43:57 2012 +0200
@@ -215,6 +215,7 @@ test_all_events:
         jnz  process_softirqs
         testb $1,VCPU_mce_pending(%ebx)
         jnz  process_mce
+.Ltest_guest_nmi:
         testb $1,VCPU_nmi_pending(%ebx)
         jnz  process_nmi
 test_guest_events:
@@ -244,7 +245,7 @@ process_softirqs:
 /* %ebx: struct vcpu */
 process_mce:
         testb $1 << VCPU_TRAP_MCE,VCPU_async_exception_mask(%ebx)
-        jnz  test_guest_events
+        jnz  .Ltest_guest_nmi
         sti
         movb $0,VCPU_mce_pending(%ebx)
         call set_guest_machinecheck_trapbounce
diff -r 201895ed11bc -r 520ab355fbb0 xen/arch/x86/x86_64/compat/entry.S
--- a/xen/arch/x86/x86_64/compat/entry.S	Tue Sep 04 14:42:16 2012 +0200
+++ b/xen/arch/x86/x86_64/compat/entry.S	Tue Sep 04 14:43:57 2012 +0200
@@ -104,6 +104,7 @@ ENTRY(compat_test_all_events)
         jnz   compat_process_softirqs
         testb $1,VCPU_mce_pending(%rbx)
         jnz   compat_process_mce
+.Lcompat_test_guest_nmi:
         testb $1,VCPU_nmi_pending(%rbx)
         jnz   compat_process_nmi
 compat_test_guest_events:
@@ -134,7 +135,7 @@ compat_process_softirqs:
 /* %rbx: struct vcpu */
 compat_process_mce:
         testb $1 << VCPU_TRAP_MCE,VCPU_async_exception_mask(%rbx)
-        jnz  compat_test_guest_events
+        jnz   .Lcompat_test_guest_nmi
         sti
         movb $0,VCPU_mce_pending(%rbx)
         call set_guest_machinecheck_trapbounce
diff -r 201895ed11bc -r 520ab355fbb0 xen/arch/x86/x86_64/entry.S
--- a/xen/arch/x86/x86_64/entry.S	Tue Sep 04 14:42:16 2012 +0200
+++ b/xen/arch/x86/x86_64/entry.S	Tue Sep 04 14:43:57 2012 +0200
@@ -204,6 +204,7 @@ test_all_events:
         jnz   process_softirqs
         testb $1,VCPU_mce_pending(%rbx)
         jnz   process_mce
+.Ltest_guest_nmi:
         testb $1,VCPU_nmi_pending(%rbx)
         jnz   process_nmi
 test_guest_events:
@@ -232,7 +233,7 @@ process_softirqs:
 /* %rbx: struct vcpu */
 process_mce:
         testb $1 << VCPU_TRAP_MCE,VCPU_async_exception_mask(%rbx)
-        jnz  test_guest_events
+        jnz  .Ltest_guest_nmi
         sti
         movb $0,VCPU_mce_pending(%rbx)
         call set_guest_machinecheck_trapbounce

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

From xen-changelog-bounces@lists.xen.org Wed Sep 05 01:01:46 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Sep 2012 01:01:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9400-0002FL-Ey; Wed, 05 Sep 2012 01:01:44 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T93zy-0001ic-Fe
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:42 +0000
Received: from [85.158.143.35:27129] by server-1.bemta-4.messagelabs.com id
	CE/9A-12504-674A6405; Wed, 05 Sep 2012 01:01:42 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-21.messagelabs.com!1346806899!13313148!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24051 invoked from network); 5 Sep 2012 01:01:40 -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;
	5 Sep 2012 01:01: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 1T93zu-0008NI-Tj
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T93zu-0007CY-SA
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:38 +0000
Message-Id: <E1T93zu-0007CY-SA@xenbits.xen.org>
Date: Wed, 05 Sep 2012 01:01:38 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86-64: don't allow non-canonical
	addresses to be set for any callback
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1346763289 -7200
# Node ID 52f3ddacd148cf6b1cc4567fadc28bcdf161cd6e
# Parent  f4cadbe5ce4bc3e05138c541e17f9601bfc35f1b
x86-64: don't allow non-canonical addresses to be set for any callback

Rather than deferring the detection of these to the point where they
get actually used (the fix for XSA-7, 25480:76eaf5966c05, causing a #GP
to be raised by IRET, which invokes the guest's [fragile] fail-safe
callback), don't even allow such to be set.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25485:5b6a857411ba
xen-unstable date: Mon Jun 18 15:02:01 UTC 2012
---


diff -r f4cadbe5ce4b -r 52f3ddacd148 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c	Tue Sep 04 14:46:12 2012 +0200
+++ b/xen/arch/x86/domain.c	Tue Sep 04 14:54:49 2012 +0200
@@ -681,6 +681,14 @@ int arch_set_info_guest(
     {
         if ( !compat )
         {
+#ifdef __x86_64__
+            if ( !is_canonical_address(c.nat->user_regs.eip) ||
+                 !is_canonical_address(c.nat->event_callback_eip) ||
+                 !is_canonical_address(c.nat->syscall_callback_eip) ||
+                 !is_canonical_address(c.nat->failsafe_callback_eip) )
+                return -EINVAL;
+#endif
+
             fixup_guest_stack_selector(d, c.nat->user_regs.ss);
             fixup_guest_stack_selector(d, c.nat->kernel_ss);
             fixup_guest_code_selector(d, c.nat->user_regs.cs);
@@ -690,7 +698,11 @@ int arch_set_info_guest(
 #endif
 
             for ( i = 0; i < 256; i++ )
+            {
+                if ( !is_canonical_address(c.nat->trap_ctxt[i].address) )
+                    return -EINVAL;
                 fixup_guest_code_selector(d, c.nat->trap_ctxt[i].cs);
+            }
 
             /* LDT safety checks. */
             if ( ((c.nat->ldt_base & (PAGE_SIZE-1)) != 0) ||
diff -r f4cadbe5ce4b -r 52f3ddacd148 xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Tue Sep 04 14:46:12 2012 +0200
+++ b/xen/arch/x86/domctl.c	Tue Sep 04 14:54:49 2012 +0200
@@ -1147,6 +1147,9 @@ long arch_do_domctl(
             if ( evc->size != sizeof(*evc) )
                 goto ext_vcpucontext_out;
 #ifdef __x86_64__
+            if ( !is_canonical_address(evc->sysenter_callback_eip) ||
+                 !is_canonical_address(evc->syscall32_callback_eip) )
+                goto ext_vcpucontext_out;
             fixup_guest_code_selector(d, evc->sysenter_callback_cs);
             v->arch.sysenter_callback_cs      = evc->sysenter_callback_cs;
             v->arch.sysenter_callback_eip     = evc->sysenter_callback_eip;
diff -r f4cadbe5ce4b -r 52f3ddacd148 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c	Tue Sep 04 14:46:12 2012 +0200
+++ b/xen/arch/x86/traps.c	Tue Sep 04 14:54:49 2012 +0200
@@ -3516,6 +3516,9 @@ long register_guest_nmi_callback(unsigne
     struct domain *d = v->domain;
     struct trap_info *t = &v->arch.guest_context.trap_ctxt[TRAP_nmi];
 
+    if ( !is_canonical_address(address) )
+        return -EINVAL;
+
     t->vector  = TRAP_nmi;
     t->flags   = 0;
     t->cs      = (is_pv_32on64_domain(d) ?
@@ -3643,6 +3646,9 @@ long do_set_trap_table(XEN_GUEST_HANDLE(
         if ( cur.address == 0 )
             break;
 
+        if ( !is_canonical_address(cur.address) )
+            return -EINVAL;
+
         fixup_guest_code_selector(curr->domain, cur.cs);
 
         memcpy(&dst[cur.vector], &cur, sizeof(cur));

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

From xen-changelog-bounces@lists.xen.org Wed Sep 05 01:01:46 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Sep 2012 01:01:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9400-0002FL-Ey; Wed, 05 Sep 2012 01:01:44 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T93zy-0001ic-Fe
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:42 +0000
Received: from [85.158.143.35:27129] by server-1.bemta-4.messagelabs.com id
	CE/9A-12504-674A6405; Wed, 05 Sep 2012 01:01:42 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-21.messagelabs.com!1346806899!13313148!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24051 invoked from network); 5 Sep 2012 01:01:40 -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;
	5 Sep 2012 01:01: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 1T93zu-0008NI-Tj
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T93zu-0007CY-SA
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:38 +0000
Message-Id: <E1T93zu-0007CY-SA@xenbits.xen.org>
Date: Wed, 05 Sep 2012 01:01:38 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86-64: don't allow non-canonical
	addresses to be set for any callback
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1346763289 -7200
# Node ID 52f3ddacd148cf6b1cc4567fadc28bcdf161cd6e
# Parent  f4cadbe5ce4bc3e05138c541e17f9601bfc35f1b
x86-64: don't allow non-canonical addresses to be set for any callback

Rather than deferring the detection of these to the point where they
get actually used (the fix for XSA-7, 25480:76eaf5966c05, causing a #GP
to be raised by IRET, which invokes the guest's [fragile] fail-safe
callback), don't even allow such to be set.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25485:5b6a857411ba
xen-unstable date: Mon Jun 18 15:02:01 UTC 2012
---


diff -r f4cadbe5ce4b -r 52f3ddacd148 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c	Tue Sep 04 14:46:12 2012 +0200
+++ b/xen/arch/x86/domain.c	Tue Sep 04 14:54:49 2012 +0200
@@ -681,6 +681,14 @@ int arch_set_info_guest(
     {
         if ( !compat )
         {
+#ifdef __x86_64__
+            if ( !is_canonical_address(c.nat->user_regs.eip) ||
+                 !is_canonical_address(c.nat->event_callback_eip) ||
+                 !is_canonical_address(c.nat->syscall_callback_eip) ||
+                 !is_canonical_address(c.nat->failsafe_callback_eip) )
+                return -EINVAL;
+#endif
+
             fixup_guest_stack_selector(d, c.nat->user_regs.ss);
             fixup_guest_stack_selector(d, c.nat->kernel_ss);
             fixup_guest_code_selector(d, c.nat->user_regs.cs);
@@ -690,7 +698,11 @@ int arch_set_info_guest(
 #endif
 
             for ( i = 0; i < 256; i++ )
+            {
+                if ( !is_canonical_address(c.nat->trap_ctxt[i].address) )
+                    return -EINVAL;
                 fixup_guest_code_selector(d, c.nat->trap_ctxt[i].cs);
+            }
 
             /* LDT safety checks. */
             if ( ((c.nat->ldt_base & (PAGE_SIZE-1)) != 0) ||
diff -r f4cadbe5ce4b -r 52f3ddacd148 xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Tue Sep 04 14:46:12 2012 +0200
+++ b/xen/arch/x86/domctl.c	Tue Sep 04 14:54:49 2012 +0200
@@ -1147,6 +1147,9 @@ long arch_do_domctl(
             if ( evc->size != sizeof(*evc) )
                 goto ext_vcpucontext_out;
 #ifdef __x86_64__
+            if ( !is_canonical_address(evc->sysenter_callback_eip) ||
+                 !is_canonical_address(evc->syscall32_callback_eip) )
+                goto ext_vcpucontext_out;
             fixup_guest_code_selector(d, evc->sysenter_callback_cs);
             v->arch.sysenter_callback_cs      = evc->sysenter_callback_cs;
             v->arch.sysenter_callback_eip     = evc->sysenter_callback_eip;
diff -r f4cadbe5ce4b -r 52f3ddacd148 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c	Tue Sep 04 14:46:12 2012 +0200
+++ b/xen/arch/x86/traps.c	Tue Sep 04 14:54:49 2012 +0200
@@ -3516,6 +3516,9 @@ long register_guest_nmi_callback(unsigne
     struct domain *d = v->domain;
     struct trap_info *t = &v->arch.guest_context.trap_ctxt[TRAP_nmi];
 
+    if ( !is_canonical_address(address) )
+        return -EINVAL;
+
     t->vector  = TRAP_nmi;
     t->flags   = 0;
     t->cs      = (is_pv_32on64_domain(d) ?
@@ -3643,6 +3646,9 @@ long do_set_trap_table(XEN_GUEST_HANDLE(
         if ( cur.address == 0 )
             break;
 
+        if ( !is_canonical_address(cur.address) )
+            return -EINVAL;
+
         fixup_guest_code_selector(curr->domain, cur.cs);
 
         memcpy(&dst[cur.vector], &cur, sizeof(cur));

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

From xen-changelog-bounces@lists.xen.org Wed Sep 05 01:01:46 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Sep 2012 01:01:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9401-0002PJ-In; Wed, 05 Sep 2012 01:01:45 +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 1T93zz-00022f-O5
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:44 +0000
Received: from [85.158.138.51:40881] by server-10.bemta-3.messagelabs.com id
	7D/DB-10411-674A6405; Wed, 05 Sep 2012 01:01:42 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-174.messagelabs.com!1346806899!28612447!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22197 invoked from network); 5 Sep 2012 01:01:40 -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 Sep 2012 01:01: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 1T93zv-0008Tn-H6
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T93zv-0007Co-FD
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:39 +0000
Message-Id: <E1T93zv-0007Co-FD@xenbits.xen.org>
Date: Wed, 05 Sep 2012 01:01:38 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] make all (native) hypercalls
	consistently have "long" return type
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1346763408 -7200
# Node ID d28a9ba889c02f835df05bc007c2b4828d86cff2
# Parent  52f3ddacd148cf6b1cc4567fadc28bcdf161cd6e
make all (native) hypercalls consistently have "long" return type

for common and x86 ones at least, to address the problem of storing
zero-extended values into the multicall result field otherwise.

Reported-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25744:47080c965937
xen-unstable date: Fri Aug 10 07:51:01 UTC 2012
---


diff -r 52f3ddacd148 -r d28a9ba889c0 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Tue Sep 04 14:54:49 2012 +0200
+++ b/xen/arch/x86/mm.c	Tue Sep 04 14:56:48 2012 +0200
@@ -2893,7 +2893,7 @@ static inline void fixunmap_domain_page(
 #define fixunmap_domain_page(ptr) ((void)(ptr))
 #endif
 
-int do_mmuext_op(
+long do_mmuext_op(
     XEN_GUEST_HANDLE(mmuext_op_t) uops,
     unsigned int count,
     XEN_GUEST_HANDLE(uint) pdone,
@@ -3346,7 +3346,7 @@ int do_mmuext_op(
     return rc;
 }
 
-int do_mmu_update(
+long do_mmu_update(
     XEN_GUEST_HANDLE(mmu_update_t) ureqs,
     unsigned int count,
     XEN_GUEST_HANDLE(uint) pdone,
@@ -4344,15 +4344,15 @@ static int __do_update_va_mapping(
     return rc;
 }
 
-int do_update_va_mapping(unsigned long va, u64 val64,
-                         unsigned long flags)
+long do_update_va_mapping(unsigned long va, u64 val64,
+                          unsigned long flags)
 {
     return __do_update_va_mapping(va, val64, flags, current->domain);
 }
 
-int do_update_va_mapping_otherdomain(unsigned long va, u64 val64,
-                                     unsigned long flags,
-                                     domid_t domid)
+long do_update_va_mapping_otherdomain(unsigned long va, u64 val64,
+                                      unsigned long flags,
+                                      domid_t domid)
 {
     struct domain *pg_owner;
     int rc;
diff -r 52f3ddacd148 -r d28a9ba889c0 xen/common/compat/xenoprof.c
--- a/xen/common/compat/xenoprof.c	Tue Sep 04 14:54:49 2012 +0200
+++ b/xen/common/compat/xenoprof.c	Tue Sep 04 14:56:48 2012 +0200
@@ -5,6 +5,7 @@
 #include <compat/xenoprof.h>
 
 #define COMPAT
+#define ret_t int
 
 #define do_xenoprof_op compat_xenoprof_op
 
diff -r 52f3ddacd148 -r d28a9ba889c0 xen/common/kexec.c
--- a/xen/common/kexec.c	Tue Sep 04 14:54:49 2012 +0200
+++ b/xen/common/kexec.c	Tue Sep 04 14:56:48 2012 +0200
@@ -601,8 +601,8 @@ static int kexec_exec(XEN_GUEST_HANDLE(v
     return -EINVAL; /* never reached */
 }
 
-int do_kexec_op_internal(unsigned long op, XEN_GUEST_HANDLE(void) uarg,
-                           int compat)
+static int do_kexec_op_internal(unsigned long op, XEN_GUEST_HANDLE(void) uarg,
+                                bool_t compat)
 {
     unsigned long flags;
     int ret = -EINVAL;
diff -r 52f3ddacd148 -r d28a9ba889c0 xen/common/xenoprof.c
--- a/xen/common/xenoprof.c	Tue Sep 04 14:54:49 2012 +0200
+++ b/xen/common/xenoprof.c	Tue Sep 04 14:56:48 2012 +0200
@@ -612,6 +612,8 @@ static int xenoprof_op_init(XEN_GUEST_HA
     return (copy_to_guest(arg, &xenoprof_init, 1) ? -EFAULT : 0);
 }
 
+#define ret_t long
+
 #endif /* !COMPAT */
 
 static int xenoprof_op_get_buffer(XEN_GUEST_HANDLE(void) arg)
@@ -665,7 +667,7 @@ static int xenoprof_op_get_buffer(XEN_GU
                       || (op == XENOPROF_disable_virq)  \
                       || (op == XENOPROF_get_buffer))
  
-int do_xenoprof_op(int op, XEN_GUEST_HANDLE(void) arg)
+ret_t do_xenoprof_op(int op, XEN_GUEST_HANDLE(void) arg)
 {
     int ret = 0;
     
@@ -909,6 +911,7 @@ int do_xenoprof_op(int op, XEN_GUEST_HAN
 }
 
 #if defined(CONFIG_COMPAT) && !defined(COMPAT)
+#undef ret_t
 #include "compat/xenoprof.c"
 #endif
 
diff -r 52f3ddacd148 -r d28a9ba889c0 xen/include/asm-x86/hypercall.h
--- a/xen/include/asm-x86/hypercall.h	Tue Sep 04 14:54:49 2012 +0200
+++ b/xen/include/asm-x86/hypercall.h	Tue Sep 04 14:56:48 2012 +0200
@@ -25,7 +25,7 @@ extern long
 do_set_trap_table(
     XEN_GUEST_HANDLE(const_trap_info_t) traps);
 
-extern int
+extern long
 do_mmu_update(
     XEN_GUEST_HANDLE(mmu_update_t) ureqs,
     unsigned int count,
@@ -63,7 +63,7 @@ do_update_descriptor(
 extern long
 do_mca(XEN_GUEST_HANDLE(xen_mc_t) u_xen_mc);
 
-extern int
+extern long
 do_update_va_mapping(
     unsigned long va,
     u64 val64,
@@ -73,14 +73,14 @@ extern long
 do_physdev_op(
     int cmd, XEN_GUEST_HANDLE(void) arg);
 
-extern int
+extern long
 do_update_va_mapping_otherdomain(
     unsigned long va,
     u64 val64,
     unsigned long flags,
     domid_t domid);
 
-extern int
+extern long
 do_mmuext_op(
     XEN_GUEST_HANDLE(mmuext_op_t) uops,
     unsigned int count,
@@ -101,10 +101,6 @@ arch_do_domctl(
     struct xen_domctl *domctl,
     XEN_GUEST_HANDLE(xen_domctl_t) u_domctl);
 
-extern int
-do_kexec(
-    unsigned long op, unsigned arg1, XEN_GUEST_HANDLE(void) uarg);
-
 #ifdef __x86_64__
 
 extern long
diff -r 52f3ddacd148 -r d28a9ba889c0 xen/include/xen/hypercall.h
--- a/xen/include/xen/hypercall.h	Tue Sep 04 14:54:49 2012 +0200
+++ b/xen/include/xen/hypercall.h	Tue Sep 04 14:56:48 2012 +0200
@@ -121,7 +121,7 @@ extern long
 do_tmem_op(
     XEN_GUEST_HANDLE(tmem_op_t) uops);
 
-extern int
+extern long
 do_xenoprof_op(int op, XEN_GUEST_HANDLE(void) arg);
 
 #ifdef CONFIG_COMPAT

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

From xen-changelog-bounces@lists.xen.org Wed Sep 05 01:01:46 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Sep 2012 01:01:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9401-0002PJ-In; Wed, 05 Sep 2012 01:01:45 +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 1T93zz-00022f-O5
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:44 +0000
Received: from [85.158.138.51:40881] by server-10.bemta-3.messagelabs.com id
	7D/DB-10411-674A6405; Wed, 05 Sep 2012 01:01:42 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-174.messagelabs.com!1346806899!28612447!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22197 invoked from network); 5 Sep 2012 01:01:40 -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 Sep 2012 01:01: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 1T93zv-0008Tn-H6
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T93zv-0007Co-FD
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:39 +0000
Message-Id: <E1T93zv-0007Co-FD@xenbits.xen.org>
Date: Wed, 05 Sep 2012 01:01:38 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] make all (native) hypercalls
	consistently have "long" return type
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1346763408 -7200
# Node ID d28a9ba889c02f835df05bc007c2b4828d86cff2
# Parent  52f3ddacd148cf6b1cc4567fadc28bcdf161cd6e
make all (native) hypercalls consistently have "long" return type

for common and x86 ones at least, to address the problem of storing
zero-extended values into the multicall result field otherwise.

Reported-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25744:47080c965937
xen-unstable date: Fri Aug 10 07:51:01 UTC 2012
---


diff -r 52f3ddacd148 -r d28a9ba889c0 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Tue Sep 04 14:54:49 2012 +0200
+++ b/xen/arch/x86/mm.c	Tue Sep 04 14:56:48 2012 +0200
@@ -2893,7 +2893,7 @@ static inline void fixunmap_domain_page(
 #define fixunmap_domain_page(ptr) ((void)(ptr))
 #endif
 
-int do_mmuext_op(
+long do_mmuext_op(
     XEN_GUEST_HANDLE(mmuext_op_t) uops,
     unsigned int count,
     XEN_GUEST_HANDLE(uint) pdone,
@@ -3346,7 +3346,7 @@ int do_mmuext_op(
     return rc;
 }
 
-int do_mmu_update(
+long do_mmu_update(
     XEN_GUEST_HANDLE(mmu_update_t) ureqs,
     unsigned int count,
     XEN_GUEST_HANDLE(uint) pdone,
@@ -4344,15 +4344,15 @@ static int __do_update_va_mapping(
     return rc;
 }
 
-int do_update_va_mapping(unsigned long va, u64 val64,
-                         unsigned long flags)
+long do_update_va_mapping(unsigned long va, u64 val64,
+                          unsigned long flags)
 {
     return __do_update_va_mapping(va, val64, flags, current->domain);
 }
 
-int do_update_va_mapping_otherdomain(unsigned long va, u64 val64,
-                                     unsigned long flags,
-                                     domid_t domid)
+long do_update_va_mapping_otherdomain(unsigned long va, u64 val64,
+                                      unsigned long flags,
+                                      domid_t domid)
 {
     struct domain *pg_owner;
     int rc;
diff -r 52f3ddacd148 -r d28a9ba889c0 xen/common/compat/xenoprof.c
--- a/xen/common/compat/xenoprof.c	Tue Sep 04 14:54:49 2012 +0200
+++ b/xen/common/compat/xenoprof.c	Tue Sep 04 14:56:48 2012 +0200
@@ -5,6 +5,7 @@
 #include <compat/xenoprof.h>
 
 #define COMPAT
+#define ret_t int
 
 #define do_xenoprof_op compat_xenoprof_op
 
diff -r 52f3ddacd148 -r d28a9ba889c0 xen/common/kexec.c
--- a/xen/common/kexec.c	Tue Sep 04 14:54:49 2012 +0200
+++ b/xen/common/kexec.c	Tue Sep 04 14:56:48 2012 +0200
@@ -601,8 +601,8 @@ static int kexec_exec(XEN_GUEST_HANDLE(v
     return -EINVAL; /* never reached */
 }
 
-int do_kexec_op_internal(unsigned long op, XEN_GUEST_HANDLE(void) uarg,
-                           int compat)
+static int do_kexec_op_internal(unsigned long op, XEN_GUEST_HANDLE(void) uarg,
+                                bool_t compat)
 {
     unsigned long flags;
     int ret = -EINVAL;
diff -r 52f3ddacd148 -r d28a9ba889c0 xen/common/xenoprof.c
--- a/xen/common/xenoprof.c	Tue Sep 04 14:54:49 2012 +0200
+++ b/xen/common/xenoprof.c	Tue Sep 04 14:56:48 2012 +0200
@@ -612,6 +612,8 @@ static int xenoprof_op_init(XEN_GUEST_HA
     return (copy_to_guest(arg, &xenoprof_init, 1) ? -EFAULT : 0);
 }
 
+#define ret_t long
+
 #endif /* !COMPAT */
 
 static int xenoprof_op_get_buffer(XEN_GUEST_HANDLE(void) arg)
@@ -665,7 +667,7 @@ static int xenoprof_op_get_buffer(XEN_GU
                       || (op == XENOPROF_disable_virq)  \
                       || (op == XENOPROF_get_buffer))
  
-int do_xenoprof_op(int op, XEN_GUEST_HANDLE(void) arg)
+ret_t do_xenoprof_op(int op, XEN_GUEST_HANDLE(void) arg)
 {
     int ret = 0;
     
@@ -909,6 +911,7 @@ int do_xenoprof_op(int op, XEN_GUEST_HAN
 }
 
 #if defined(CONFIG_COMPAT) && !defined(COMPAT)
+#undef ret_t
 #include "compat/xenoprof.c"
 #endif
 
diff -r 52f3ddacd148 -r d28a9ba889c0 xen/include/asm-x86/hypercall.h
--- a/xen/include/asm-x86/hypercall.h	Tue Sep 04 14:54:49 2012 +0200
+++ b/xen/include/asm-x86/hypercall.h	Tue Sep 04 14:56:48 2012 +0200
@@ -25,7 +25,7 @@ extern long
 do_set_trap_table(
     XEN_GUEST_HANDLE(const_trap_info_t) traps);
 
-extern int
+extern long
 do_mmu_update(
     XEN_GUEST_HANDLE(mmu_update_t) ureqs,
     unsigned int count,
@@ -63,7 +63,7 @@ do_update_descriptor(
 extern long
 do_mca(XEN_GUEST_HANDLE(xen_mc_t) u_xen_mc);
 
-extern int
+extern long
 do_update_va_mapping(
     unsigned long va,
     u64 val64,
@@ -73,14 +73,14 @@ extern long
 do_physdev_op(
     int cmd, XEN_GUEST_HANDLE(void) arg);
 
-extern int
+extern long
 do_update_va_mapping_otherdomain(
     unsigned long va,
     u64 val64,
     unsigned long flags,
     domid_t domid);
 
-extern int
+extern long
 do_mmuext_op(
     XEN_GUEST_HANDLE(mmuext_op_t) uops,
     unsigned int count,
@@ -101,10 +101,6 @@ arch_do_domctl(
     struct xen_domctl *domctl,
     XEN_GUEST_HANDLE(xen_domctl_t) u_domctl);
 
-extern int
-do_kexec(
-    unsigned long op, unsigned arg1, XEN_GUEST_HANDLE(void) uarg);
-
 #ifdef __x86_64__
 
 extern long
diff -r 52f3ddacd148 -r d28a9ba889c0 xen/include/xen/hypercall.h
--- a/xen/include/xen/hypercall.h	Tue Sep 04 14:54:49 2012 +0200
+++ b/xen/include/xen/hypercall.h	Tue Sep 04 14:56:48 2012 +0200
@@ -121,7 +121,7 @@ extern long
 do_tmem_op(
     XEN_GUEST_HANDLE(tmem_op_t) uops);
 
-extern int
+extern long
 do_xenoprof_op(int op, XEN_GUEST_HANDLE(void) arg);
 
 #ifdef CONFIG_COMPAT

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

From xen-changelog-bounces@lists.xen.org Wed Sep 05 01:01:47 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Sep 2012 01:01:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T93zy-0001wS-CC; Wed, 05 Sep 2012 01:01:42 +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 1T93zx-00010X-4F
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:41 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-27.messagelabs.com!1346806893!8774487!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14602 invoked from network); 5 Sep 2012 01:01:34 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Sep 2012 01:01: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 1T93zo-0007Iv-OW
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T93zo-0007AI-9T
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:32 +0000
Message-Id: <E1T93zo-0007AI-9T@xenbits.xen.org>
Date: Wed, 05 Sep 2012 01:01:31 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86-64/MMCFG: correct base
	address computation for regions not starting at bus 0
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@novell.com>
# Date 1346761398 -7200
# Node ID fc9fe622e5e03c6ffc21bec264969f0ca79dc456
# Parent  58d3c21ee4bde73269d6c1cb063b51cebb21ce99
x86-64/MMCFG: correct base address computation for regions not starting at bus 0

As per the specification, the base address reported by ACPI is the one
that would be used if the region started at bus 0. Hence the
start_bus_number offset needs to be added not only to the virtual
address, but also the physical one when establishing the mapping, and
it then needs to be subtracted when obtaining the virtual address for
doing accesses.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen-unstable changeset: 23747:b07b6fa76656
xen-unstable date: Mon Jul 25 15:42:19 UTC 2011
---


diff -r 58d3c21ee4bd -r fc9fe622e5e0 xen/arch/x86/x86_64/mmconfig_64.c
--- a/xen/arch/x86/x86_64/mmconfig_64.c	Tue Sep 04 12:03:35 2012 +0200
+++ b/xen/arch/x86/x86_64/mmconfig_64.c	Tue Sep 04 14:23:18 2012 +0200
@@ -25,7 +25,7 @@ struct mmcfg_virt {
 static struct mmcfg_virt *pci_mmcfg_virt;
 static int __initdata mmcfg_pci_segment_shift;
 
-static char __iomem *get_virt(unsigned int seg, unsigned bus)
+static char __iomem *get_virt(unsigned int seg, unsigned int *bus)
 {
     struct acpi_mcfg_allocation *cfg;
     int cfg_num;
@@ -33,9 +33,11 @@ static char __iomem *get_virt(unsigned i
     for (cfg_num = 0; cfg_num < pci_mmcfg_config_num; cfg_num++) {
         cfg = pci_mmcfg_virt[cfg_num].cfg;
         if (cfg->pci_segment == seg &&
-            (cfg->start_bus_number <= bus) &&
-            (cfg->end_bus_number >= bus))
+            (cfg->start_bus_number <= *bus) &&
+            (cfg->end_bus_number >= *bus)) {
+            *bus -= cfg->start_bus_number;
             return pci_mmcfg_virt[cfg_num].virt;
+        }
     }
 
     /* Fall back to type 0 */
@@ -46,7 +48,7 @@ static char __iomem *pci_dev_base(unsign
 {
     char __iomem *addr;
 
-    addr = get_virt(seg, bus);
+    addr = get_virt(seg, &bus);
     if (!addr)
         return NULL;
      return addr + ((bus << 20) | (devfn << 12));
@@ -121,8 +123,11 @@ static void __iomem * __init mcfg_iorema
     if (virt + size < virt || virt + size > PCI_MCFG_VIRT_END)
         return NULL;
 
-    map_pages_to_xen(virt, cfg->address >> PAGE_SHIFT,
-                     size >> PAGE_SHIFT, PAGE_HYPERVISOR_NOCACHE);
+    if (map_pages_to_xen(virt,
+                         (cfg->address >> PAGE_SHIFT) +
+                         (cfg->start_bus_number << (20 - PAGE_SHIFT)),
+                         size >> PAGE_SHIFT, PAGE_HYPERVISOR_NOCACHE))
+        return NULL;
 
     return (void __iomem *) virt;
 }

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

From xen-changelog-bounces@lists.xen.org Wed Sep 05 01:01:47 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Sep 2012 01:01:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T93zy-0001wS-CC; Wed, 05 Sep 2012 01:01:42 +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 1T93zx-00010X-4F
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:41 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-27.messagelabs.com!1346806893!8774487!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14602 invoked from network); 5 Sep 2012 01:01:34 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Sep 2012 01:01: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 1T93zo-0007Iv-OW
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T93zo-0007AI-9T
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:32 +0000
Message-Id: <E1T93zo-0007AI-9T@xenbits.xen.org>
Date: Wed, 05 Sep 2012 01:01:31 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86-64/MMCFG: correct base
	address computation for regions not starting at bus 0
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@novell.com>
# Date 1346761398 -7200
# Node ID fc9fe622e5e03c6ffc21bec264969f0ca79dc456
# Parent  58d3c21ee4bde73269d6c1cb063b51cebb21ce99
x86-64/MMCFG: correct base address computation for regions not starting at bus 0

As per the specification, the base address reported by ACPI is the one
that would be used if the region started at bus 0. Hence the
start_bus_number offset needs to be added not only to the virtual
address, but also the physical one when establishing the mapping, and
it then needs to be subtracted when obtaining the virtual address for
doing accesses.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen-unstable changeset: 23747:b07b6fa76656
xen-unstable date: Mon Jul 25 15:42:19 UTC 2011
---


diff -r 58d3c21ee4bd -r fc9fe622e5e0 xen/arch/x86/x86_64/mmconfig_64.c
--- a/xen/arch/x86/x86_64/mmconfig_64.c	Tue Sep 04 12:03:35 2012 +0200
+++ b/xen/arch/x86/x86_64/mmconfig_64.c	Tue Sep 04 14:23:18 2012 +0200
@@ -25,7 +25,7 @@ struct mmcfg_virt {
 static struct mmcfg_virt *pci_mmcfg_virt;
 static int __initdata mmcfg_pci_segment_shift;
 
-static char __iomem *get_virt(unsigned int seg, unsigned bus)
+static char __iomem *get_virt(unsigned int seg, unsigned int *bus)
 {
     struct acpi_mcfg_allocation *cfg;
     int cfg_num;
@@ -33,9 +33,11 @@ static char __iomem *get_virt(unsigned i
     for (cfg_num = 0; cfg_num < pci_mmcfg_config_num; cfg_num++) {
         cfg = pci_mmcfg_virt[cfg_num].cfg;
         if (cfg->pci_segment == seg &&
-            (cfg->start_bus_number <= bus) &&
-            (cfg->end_bus_number >= bus))
+            (cfg->start_bus_number <= *bus) &&
+            (cfg->end_bus_number >= *bus)) {
+            *bus -= cfg->start_bus_number;
             return pci_mmcfg_virt[cfg_num].virt;
+        }
     }
 
     /* Fall back to type 0 */
@@ -46,7 +48,7 @@ static char __iomem *pci_dev_base(unsign
 {
     char __iomem *addr;
 
-    addr = get_virt(seg, bus);
+    addr = get_virt(seg, &bus);
     if (!addr)
         return NULL;
      return addr + ((bus << 20) | (devfn << 12));
@@ -121,8 +123,11 @@ static void __iomem * __init mcfg_iorema
     if (virt + size < virt || virt + size > PCI_MCFG_VIRT_END)
         return NULL;
 
-    map_pages_to_xen(virt, cfg->address >> PAGE_SHIFT,
-                     size >> PAGE_SHIFT, PAGE_HYPERVISOR_NOCACHE);
+    if (map_pages_to_xen(virt,
+                         (cfg->address >> PAGE_SHIFT) +
+                         (cfg->start_bus_number << (20 - PAGE_SHIFT)),
+                         size >> PAGE_SHIFT, PAGE_HYPERVISOR_NOCACHE))
+        return NULL;
 
     return (void __iomem *) virt;
 }

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

From xen-changelog-bounces@lists.xen.org Wed Sep 05 01:01:47 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Sep 2012 01:01:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T93zt-0001Hd-Mw; Wed, 05 Sep 2012 01:01:37 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T93zs-000142-Kc
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:36 +0000
Received: from [85.158.139.83:23284] by server-6.bemta-5.messagelabs.com id
	7E/90-21336-F64A6405; Wed, 05 Sep 2012 01:01:35 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1346806894!27912171!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24886 invoked from network); 5 Sep 2012 01:01:35 -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;
	5 Sep 2012 01:01: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 1T93zp-0007VG-UC
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T93zp-0007Ap-Fw
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:33 +0000
Message-Id: <E1T93zp-0007Ap-Fw@xenbits.xen.org>
Date: Wed, 05 Sep 2012 01:01:32 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] X86: Disable PCID/INVPCID for dom0
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Liu, Jinsong <jinsong.liu@intel.com>
# Date 1346761925 -7200
# Node ID 2527617fd58c97133d4fa2b27189cc7566a77bd3
# Parent  cde6c55bbc0777205679216aafb36d3cd02008be
X86: Disable PCID/INVPCID for dom0

PCID (Process-context identifier) is a facility by which a logical
processor may cache information for multiple linear-address spaces.
INVPCID is an new instruction to invalidate TLB. Refer latest Intel SDM
http://www.intel.com/content/www/us/en/processors/architectures-software-developer-manuals.html

We disable PCID/INVPCID for dom0 and pv. Exposing them into dom0 and pv
may result in performance regression, and it would trigger GP or UD
depending on whether platform suppport INVPCID or not.

This patch disables PCID/INVPCID for dom0.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
xen-unstable changeset: 24278:d9cb04ed5539
xen-unstable date: Thu Dec  1 11:22:43 UTC 2011
---


diff -r cde6c55bbc07 -r 2527617fd58c xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c	Tue Sep 04 14:27:58 2012 +0200
+++ b/xen/arch/x86/traps.c	Tue Sep 04 14:32:05 2012 +0200
@@ -834,6 +834,7 @@ static void pv_cpuid(struct cpu_user_reg
             __clear_bit(X86_FEATURE_CX16 % 32, &c);
         __clear_bit(X86_FEATURE_XTPR % 32, &c);
         __clear_bit(X86_FEATURE_PDCM % 32, &c);
+        __clear_bit(X86_FEATURE_PCID % 32, &c);
         __clear_bit(X86_FEATURE_DCA % 32, &c);
         if ( !xsave_enabled(current) )
         {
diff -r cde6c55bbc07 -r 2527617fd58c xen/include/asm-x86/cpufeature.h
--- a/xen/include/asm-x86/cpufeature.h	Tue Sep 04 14:27:58 2012 +0200
+++ b/xen/include/asm-x86/cpufeature.h	Tue Sep 04 14:32:05 2012 +0200
@@ -96,6 +96,7 @@
 #define X86_FEATURE_CX16        (4*32+13) /* CMPXCHG16B */
 #define X86_FEATURE_XTPR	(4*32+14) /* Send Task Priority Messages */
 #define X86_FEATURE_PDCM	(4*32+15) /* Perf/Debug Capability MSR */
+#define X86_FEATURE_PCID	(4*32+17) /* Process Context ID */
 #define X86_FEATURE_DCA		(4*32+18) /* Direct Cache Access */
 #define X86_FEATURE_SSE4_1	(4*32+19) /* Streaming SIMD Extensions 4.1 */
 #define X86_FEATURE_SSE4_2	(4*32+20) /* Streaming SIMD Extensions 4.2 */
@@ -146,6 +147,7 @@
 #define X86_FEATURE_FSGSBASE	(7*32+ 0) /* {RD,WR}{FS,GS}BASE instructions */
 #define X86_FEATURE_SMEP	(7*32+ 7) /* Supervisor Mode Execution Protection */
 #define X86_FEATURE_ERMS	(7*32+ 9) /* Enhanced REP MOVSB/STOSB */
+#define X86_FEATURE_INVPCID	(7*32+10) /* Invalidate Process Context ID */
 
 #define cpu_has(c, bit)		test_bit(bit, (c)->x86_capability)
 #define boot_cpu_has(bit)	test_bit(bit, boot_cpu_data.x86_capability)

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

From xen-changelog-bounces@lists.xen.org Wed Sep 05 01:01:47 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Sep 2012 01:01:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T93zt-0001Hd-Mw; Wed, 05 Sep 2012 01:01:37 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T93zs-000142-Kc
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:36 +0000
Received: from [85.158.139.83:23284] by server-6.bemta-5.messagelabs.com id
	7E/90-21336-F64A6405; Wed, 05 Sep 2012 01:01:35 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1346806894!27912171!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24886 invoked from network); 5 Sep 2012 01:01:35 -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;
	5 Sep 2012 01:01: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 1T93zp-0007VG-UC
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T93zp-0007Ap-Fw
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:33 +0000
Message-Id: <E1T93zp-0007Ap-Fw@xenbits.xen.org>
Date: Wed, 05 Sep 2012 01:01:32 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] X86: Disable PCID/INVPCID for dom0
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Liu, Jinsong <jinsong.liu@intel.com>
# Date 1346761925 -7200
# Node ID 2527617fd58c97133d4fa2b27189cc7566a77bd3
# Parent  cde6c55bbc0777205679216aafb36d3cd02008be
X86: Disable PCID/INVPCID for dom0

PCID (Process-context identifier) is a facility by which a logical
processor may cache information for multiple linear-address spaces.
INVPCID is an new instruction to invalidate TLB. Refer latest Intel SDM
http://www.intel.com/content/www/us/en/processors/architectures-software-developer-manuals.html

We disable PCID/INVPCID for dom0 and pv. Exposing them into dom0 and pv
may result in performance regression, and it would trigger GP or UD
depending on whether platform suppport INVPCID or not.

This patch disables PCID/INVPCID for dom0.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
xen-unstable changeset: 24278:d9cb04ed5539
xen-unstable date: Thu Dec  1 11:22:43 UTC 2011
---


diff -r cde6c55bbc07 -r 2527617fd58c xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c	Tue Sep 04 14:27:58 2012 +0200
+++ b/xen/arch/x86/traps.c	Tue Sep 04 14:32:05 2012 +0200
@@ -834,6 +834,7 @@ static void pv_cpuid(struct cpu_user_reg
             __clear_bit(X86_FEATURE_CX16 % 32, &c);
         __clear_bit(X86_FEATURE_XTPR % 32, &c);
         __clear_bit(X86_FEATURE_PDCM % 32, &c);
+        __clear_bit(X86_FEATURE_PCID % 32, &c);
         __clear_bit(X86_FEATURE_DCA % 32, &c);
         if ( !xsave_enabled(current) )
         {
diff -r cde6c55bbc07 -r 2527617fd58c xen/include/asm-x86/cpufeature.h
--- a/xen/include/asm-x86/cpufeature.h	Tue Sep 04 14:27:58 2012 +0200
+++ b/xen/include/asm-x86/cpufeature.h	Tue Sep 04 14:32:05 2012 +0200
@@ -96,6 +96,7 @@
 #define X86_FEATURE_CX16        (4*32+13) /* CMPXCHG16B */
 #define X86_FEATURE_XTPR	(4*32+14) /* Send Task Priority Messages */
 #define X86_FEATURE_PDCM	(4*32+15) /* Perf/Debug Capability MSR */
+#define X86_FEATURE_PCID	(4*32+17) /* Process Context ID */
 #define X86_FEATURE_DCA		(4*32+18) /* Direct Cache Access */
 #define X86_FEATURE_SSE4_1	(4*32+19) /* Streaming SIMD Extensions 4.1 */
 #define X86_FEATURE_SSE4_2	(4*32+20) /* Streaming SIMD Extensions 4.2 */
@@ -146,6 +147,7 @@
 #define X86_FEATURE_FSGSBASE	(7*32+ 0) /* {RD,WR}{FS,GS}BASE instructions */
 #define X86_FEATURE_SMEP	(7*32+ 7) /* Supervisor Mode Execution Protection */
 #define X86_FEATURE_ERMS	(7*32+ 9) /* Enhanced REP MOVSB/STOSB */
+#define X86_FEATURE_INVPCID	(7*32+10) /* Invalidate Process Context ID */
 
 #define cpu_has(c, bit)		test_bit(bit, (c)->x86_capability)
 #define boot_cpu_has(bit)	test_bit(bit, boot_cpu_data.x86_capability)

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

From xen-changelog-bounces@lists.xen.org Wed Sep 05 01:01:47 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Sep 2012 01:01:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T93zt-0001IO-PO; Wed, 05 Sep 2012 01:01:37 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T93zs-000141-Nu
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:36 +0000
Received: from [85.158.139.83:23283] by server-7.bemta-5.messagelabs.com id
	31/81-19703-F64A6405; Wed, 05 Sep 2012 01:01:35 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-182.messagelabs.com!1346806894!21245419!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22773 invoked from network); 5 Sep 2012 01:01:35 -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;
	5 Sep 2012 01:01: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 1T93zq-0007ZM-3v
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T93zp-0007B4-VW
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:33 +0000
Message-Id: <E1T93zp-0007B4-VW@xenbits.xen.org>
Date: Wed, 05 Sep 2012 01:01:33 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] X86: Disable PCID/INVPCID for pv
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Liu, Jinsong <jinsong.liu@intel.com>
# Date 1346762453 -7200
# Node ID e72c098aa73c2689f74167ff853371a184d30058
# Parent  2527617fd58c97133d4fa2b27189cc7566a77bd3
X86: Disable PCID/INVPCID for pv

This patch disable PCID/INVPCID for pv.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
xen-unstable changeset: 24360:d313582d4fa2
xen-unstable date: Tue Dec  6 11:28:04 UTC 2011
---


diff -r 2527617fd58c -r e72c098aa73c tools/libxc/xc_cpufeature.h
--- a/tools/libxc/xc_cpufeature.h	Tue Sep 04 14:32:05 2012 +0200
+++ b/tools/libxc/xc_cpufeature.h	Tue Sep 04 14:40:53 2012 +0200
@@ -96,6 +96,7 @@
 #define X86_FEATURE_CX16        (4*32+13) /* CMPXCHG16B */
 #define X86_FEATURE_XTPR	(4*32+14) /* Send Task Priority Messages */
 #define X86_FEATURE_PDCM	(4*32+15) /* Perf/Debug Capability MSR */
+#define X86_FEATURE_PCID	(4*32+17) /* Process Context ID */
 #define X86_FEATURE_DCA		(4*32+18) /* Direct Cache Access */
 #define X86_FEATURE_SSE4_1	(4*32+19) /* Streaming SIMD Extensions 4.1 */
 #define X86_FEATURE_SSE4_2	(4*32+20) /* Streaming SIMD Extensions 4.2 */
@@ -146,5 +147,6 @@
 #define X86_FEATURE_FSGSBASE	(7*32+ 0) /* {RD,WR}{FS,GS}BASE instructions */
 #define X86_FEATURE_SMEP        (7*32+ 7) /* Supervisor Mode Execution Protection */
 #define X86_FEATURE_ERMS        (7*32+ 9) /* Enhanced REP MOVSB/STOSB */
+#define X86_FEATURE_INVPCID     (7*32+10) /* Invalidate Process Context ID */
 
 #endif /* __LIBXC_CPUFEATURE_H */
diff -r 2527617fd58c -r e72c098aa73c tools/libxc/xc_cpuid_x86.c
--- a/tools/libxc/xc_cpuid_x86.c	Tue Sep 04 14:32:05 2012 +0200
+++ b/tools/libxc/xc_cpuid_x86.c	Tue Sep 04 14:40:53 2012 +0200
@@ -421,6 +421,7 @@ static void xc_cpuid_pv_policy(
         }
         clear_bit(X86_FEATURE_XTPR, regs[2]);
         clear_bit(X86_FEATURE_PDCM, regs[2]);
+        clear_bit(X86_FEATURE_PCID, regs[2]);
         clear_bit(X86_FEATURE_DCA, regs[2]);
         set_bit(X86_FEATURE_HYPERVISOR, regs[2]);
         break;

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

From xen-changelog-bounces@lists.xen.org Wed Sep 05 01:01:47 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Sep 2012 01:01:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T93zt-0001IO-PO; Wed, 05 Sep 2012 01:01:37 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T93zs-000141-Nu
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:36 +0000
Received: from [85.158.139.83:23283] by server-7.bemta-5.messagelabs.com id
	31/81-19703-F64A6405; Wed, 05 Sep 2012 01:01:35 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-182.messagelabs.com!1346806894!21245419!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22773 invoked from network); 5 Sep 2012 01:01:35 -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;
	5 Sep 2012 01:01: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 1T93zq-0007ZM-3v
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T93zp-0007B4-VW
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:33 +0000
Message-Id: <E1T93zp-0007B4-VW@xenbits.xen.org>
Date: Wed, 05 Sep 2012 01:01:33 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] X86: Disable PCID/INVPCID for pv
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Liu, Jinsong <jinsong.liu@intel.com>
# Date 1346762453 -7200
# Node ID e72c098aa73c2689f74167ff853371a184d30058
# Parent  2527617fd58c97133d4fa2b27189cc7566a77bd3
X86: Disable PCID/INVPCID for pv

This patch disable PCID/INVPCID for pv.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
xen-unstable changeset: 24360:d313582d4fa2
xen-unstable date: Tue Dec  6 11:28:04 UTC 2011
---


diff -r 2527617fd58c -r e72c098aa73c tools/libxc/xc_cpufeature.h
--- a/tools/libxc/xc_cpufeature.h	Tue Sep 04 14:32:05 2012 +0200
+++ b/tools/libxc/xc_cpufeature.h	Tue Sep 04 14:40:53 2012 +0200
@@ -96,6 +96,7 @@
 #define X86_FEATURE_CX16        (4*32+13) /* CMPXCHG16B */
 #define X86_FEATURE_XTPR	(4*32+14) /* Send Task Priority Messages */
 #define X86_FEATURE_PDCM	(4*32+15) /* Perf/Debug Capability MSR */
+#define X86_FEATURE_PCID	(4*32+17) /* Process Context ID */
 #define X86_FEATURE_DCA		(4*32+18) /* Direct Cache Access */
 #define X86_FEATURE_SSE4_1	(4*32+19) /* Streaming SIMD Extensions 4.1 */
 #define X86_FEATURE_SSE4_2	(4*32+20) /* Streaming SIMD Extensions 4.2 */
@@ -146,5 +147,6 @@
 #define X86_FEATURE_FSGSBASE	(7*32+ 0) /* {RD,WR}{FS,GS}BASE instructions */
 #define X86_FEATURE_SMEP        (7*32+ 7) /* Supervisor Mode Execution Protection */
 #define X86_FEATURE_ERMS        (7*32+ 9) /* Enhanced REP MOVSB/STOSB */
+#define X86_FEATURE_INVPCID     (7*32+10) /* Invalidate Process Context ID */
 
 #endif /* __LIBXC_CPUFEATURE_H */
diff -r 2527617fd58c -r e72c098aa73c tools/libxc/xc_cpuid_x86.c
--- a/tools/libxc/xc_cpuid_x86.c	Tue Sep 04 14:32:05 2012 +0200
+++ b/tools/libxc/xc_cpuid_x86.c	Tue Sep 04 14:40:53 2012 +0200
@@ -421,6 +421,7 @@ static void xc_cpuid_pv_policy(
         }
         clear_bit(X86_FEATURE_XTPR, regs[2]);
         clear_bit(X86_FEATURE_PDCM, regs[2]);
+        clear_bit(X86_FEATURE_PCID, regs[2]);
         clear_bit(X86_FEATURE_DCA, regs[2]);
         set_bit(X86_FEATURE_HYPERVISOR, regs[2]);
         break;

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

From xen-changelog-bounces@lists.xen.org Wed Sep 05 01:01:47 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Sep 2012 01:01:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T93zx-0001lJ-03; Wed, 05 Sep 2012 01:01:41 +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 1T93zv-0001VE-HH
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:39 +0000
Received: from [85.158.138.51:9793] by server-3.bemta-3.messagelabs.com id
	3A/41-21322-274A6405; Wed, 05 Sep 2012 01:01:38 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1346806896!28564649!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1457 invoked from network); 5 Sep 2012 01:01:37 -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;
	5 Sep 2012 01:01: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 1T93zs-0007wh-B9
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T93zq-0007BJ-GQ
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:35 +0000
Message-Id: <E1T93zq-0007BJ-GQ@xenbits.xen.org>
Date: Wed, 05 Sep 2012 01:01:34 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] Fix save/restore of guest PAT
	table in HAP paging mode.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Gianluca Guida <gianluca.guida@citrix.com>
# Date 1346762536 -7200
# Node ID 201895ed11bcad4c74a2bb953f93e222c8f50abe
# Parent  e72c098aa73c2689f74167ff853371a184d30058
Fix save/restore of guest PAT table in HAP paging mode.

HAP paging mode guests use direct MSR read/write into the VMCS/VMCB
for the guest PAT table, while the current save/restore code was
accessing only the pat_cr field in hvm_vcpu, used when intercepting
the MSR mostly in shadow mode (the Intel scenario is a bit more
complicated).  This patch fixes this issue creating a new couple of
hvm_funcs, get/set_guest_pat, that access the right PAT table based on
the paging mode and guest configuration.

Signed-off-by: Gianluca Guida <gianluca.guida@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
xen-unstable changeset: 25196:375fa55c7a6c
xen-unstable date: Tue Apr 17 07:29:26 UTC 2012
---


diff -r e72c098aa73c -r 201895ed11bc xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Tue Sep 04 14:40:53 2012 +0200
+++ b/xen/arch/x86/hvm/hvm.c	Tue Sep 04 14:42:16 2012 +0200
@@ -217,6 +217,31 @@ void hvm_set_rdtsc_exiting(struct domain
         hvm_funcs.set_rdtsc_exiting(v, enable);
 }
 
+void hvm_get_guest_pat(struct vcpu *v, u64 *guest_pat)
+{
+    if ( !hvm_funcs.get_guest_pat(v, guest_pat) )
+        *guest_pat = v->arch.hvm_vcpu.pat_cr;
+}
+
+int hvm_set_guest_pat(struct vcpu *v, u64 guest_pat)
+{
+    int i;
+    uint8_t *value = (uint8_t *)&guest_pat;
+
+    for ( i = 0; i < 8; i++ )
+        if ( unlikely(!(value[i] == 0 || value[i] == 1 ||
+                        value[i] == 4 || value[i] == 5 ||
+                        value[i] == 6 || value[i] == 7)) ) {
+            HVM_DBG_LOG(DBG_LEVEL_MSR, "invalid guest PAT: %"PRIx64"\n",
+                        guest_pat);
+            return 0;
+        }
+
+    if ( !hvm_funcs.set_guest_pat(v, guest_pat) )
+        v->arch.hvm_vcpu.pat_cr = guest_pat;
+    return 1;
+}
+
 void hvm_set_guest_tsc(struct vcpu *v, u64 guest_tsc)
 {
     uint64_t tsc;
@@ -2394,7 +2419,7 @@ int hvm_msr_read_intercept(unsigned int 
         break;
 
     case MSR_IA32_CR_PAT:
-        *msr_content = v->arch.hvm_vcpu.pat_cr;
+        hvm_get_guest_pat(v, msr_content);
         break;
 
     case MSR_MTRRcap:
@@ -2510,7 +2535,7 @@ int hvm_msr_write_intercept(unsigned int
         break;
 
     case MSR_IA32_CR_PAT:
-        if ( !pat_msr_set(&v->arch.hvm_vcpu.pat_cr, msr_content) )
+        if ( !hvm_set_guest_pat(v, msr_content) )
            goto gp_fault;
         break;
 
diff -r e72c098aa73c -r 201895ed11bc xen/arch/x86/hvm/mtrr.c
--- a/xen/arch/x86/hvm/mtrr.c	Tue Sep 04 14:40:53 2012 +0200
+++ b/xen/arch/x86/hvm/mtrr.c	Tue Sep 04 14:42:16 2012 +0200
@@ -406,26 +406,6 @@ uint32_t get_pat_flags(struct vcpu *v,
     return pat_type_2_pte_flags(pat_entry_value);
 }
 
-/* Helper funtions for seting mtrr/pat */
-bool_t pat_msr_set(uint64_t *pat, uint64_t msr_content)
-{
-    uint8_t *value = (uint8_t*)&msr_content;
-    int32_t i;
-
-    if ( *pat != msr_content )
-    {
-        for ( i = 0; i < 8; i++ )
-            if ( unlikely(!(value[i] == 0 || value[i] == 1 ||
-                            value[i] == 4 || value[i] == 5 ||
-                            value[i] == 6 || value[i] == 7)) )
-                return 0;
-
-        *pat = msr_content;
-    }
-
-    return 1;
-}
-
 bool_t mtrr_def_type_msr_set(struct mtrr_state *m, uint64_t msr_content)
 {
     uint8_t def_type = msr_content & 0xff;
@@ -636,7 +616,7 @@ static int hvm_save_mtrr_msr(struct doma
     {
         mtrr_state = &v->arch.hvm_vcpu.mtrr;
 
-        hw_mtrr.msr_pat_cr = v->arch.hvm_vcpu.pat_cr;
+        hvm_get_guest_pat(v, &hw_mtrr.msr_pat_cr);
 
         hw_mtrr.msr_mtrr_def_type = mtrr_state->def_type
                                 | (mtrr_state->enabled << 10);
@@ -681,7 +661,7 @@ static int hvm_load_mtrr_msr(struct doma
 
     mtrr_state = &v->arch.hvm_vcpu.mtrr;
 
-    pat_msr_set(&v->arch.hvm_vcpu.pat_cr, hw_mtrr.msr_pat_cr);
+    hvm_set_guest_pat(v, hw_mtrr.msr_pat_cr);
 
     mtrr_state->mtrr_cap = hw_mtrr.msr_mtrr_cap;
 
diff -r e72c098aa73c -r 201895ed11bc xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c	Tue Sep 04 14:40:53 2012 +0200
+++ b/xen/arch/x86/hvm/svm/svm.c	Tue Sep 04 14:42:16 2012 +0200
@@ -585,6 +585,28 @@ static void svm_set_segment_register(str
         svm_vmload(vmcb);
 }
 
+static int svm_set_guest_pat(struct vcpu *v, u64 gpat)
+{
+    struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb;
+
+    if ( !paging_mode_hap(v->domain) )
+        return 0;
+
+    vmcb_set_g_pat(vmcb, gpat);
+    return 1;
+}
+
+static int svm_get_guest_pat(struct vcpu *v, u64 *gpat)
+{
+    struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb;
+
+    if ( !paging_mode_hap(v->domain) )
+        return 0;
+
+    *gpat = vmcb_get_g_pat(vmcb);
+    return 1;
+}
+
 static void svm_set_tsc_offset(struct vcpu *v, u64 offset)
 {
     struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb;
@@ -1519,6 +1541,8 @@ static struct hvm_function_table __read_
     .update_host_cr3      = svm_update_host_cr3,
     .update_guest_cr      = svm_update_guest_cr,
     .update_guest_efer    = svm_update_guest_efer,
+    .set_guest_pat        = svm_set_guest_pat,
+    .get_guest_pat        = svm_get_guest_pat,
     .set_tsc_offset       = svm_set_tsc_offset,
     .inject_exception     = svm_inject_exception,
     .init_hypercall_page  = svm_init_hypercall_page,
diff -r e72c098aa73c -r 201895ed11bc xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Tue Sep 04 14:40:53 2012 +0200
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Tue Sep 04 14:42:16 2012 +0200
@@ -921,6 +921,34 @@ static void vmx_set_segment_register(str
     vmx_vmcs_exit(v);
 }
 
+static int vmx_set_guest_pat(struct vcpu *v, u64 gpat)
+{
+    if ( !cpu_has_vmx_pat || !paging_mode_hap(v->domain) )
+        return 0;
+
+    vmx_vmcs_enter(v);
+    __vmwrite(GUEST_PAT, gpat);
+#ifdef __i386__
+    __vmwrite(GUEST_PAT_HIGH, gpat >> 32);
+#endif
+    vmx_vmcs_exit(v);
+    return 1;
+}
+
+static int vmx_get_guest_pat(struct vcpu *v, u64 *gpat)
+{
+    if ( !cpu_has_vmx_pat || !paging_mode_hap(v->domain) )
+        return 0;
+
+    vmx_vmcs_enter(v);
+    *gpat = __vmread(GUEST_PAT);
+#ifdef __i386__
+    *gpat |= (u64)__vmread(GUEST_PAT_HIGH) << 32;
+#endif
+    vmx_vmcs_exit(v);
+    return 1;
+}
+
 static void vmx_set_tsc_offset(struct vcpu *v, u64 offset)
 {
     vmx_vmcs_enter(v);
@@ -1384,6 +1412,8 @@ static struct hvm_function_table __read_
     .update_host_cr3      = vmx_update_host_cr3,
     .update_guest_cr      = vmx_update_guest_cr,
     .update_guest_efer    = vmx_update_guest_efer,
+    .set_guest_pat        = vmx_set_guest_pat,
+    .get_guest_pat        = vmx_get_guest_pat,
     .set_tsc_offset       = vmx_set_tsc_offset,
     .inject_exception     = vmx_inject_exception,
     .init_hypercall_page  = vmx_init_hypercall_page,
diff -r e72c098aa73c -r 201895ed11bc xen/include/asm-x86/hvm/hvm.h
--- a/xen/include/asm-x86/hvm/hvm.h	Tue Sep 04 14:40:53 2012 +0200
+++ b/xen/include/asm-x86/hvm/hvm.h	Tue Sep 04 14:42:16 2012 +0200
@@ -116,6 +116,9 @@ struct hvm_function_table {
     void (*update_guest_cr)(struct vcpu *v, unsigned int cr);
     void (*update_guest_efer)(struct vcpu *v);
 
+    int  (*get_guest_pat)(struct vcpu *v, u64 *);
+    int  (*set_guest_pat)(struct vcpu *v, u64);
+
     void (*set_tsc_offset)(struct vcpu *v, u64 offset);
 
     void (*inject_exception)(unsigned int trapnr, int errcode,
@@ -166,6 +169,9 @@ void hvm_vcpu_reset_state(struct vcpu *v
 
 bool_t hvm_send_assist_req(struct vcpu *v);
 
+void hvm_get_guest_pat(struct vcpu *v, u64 *guest_pat);
+int hvm_set_guest_pat(struct vcpu *v, u64 guest_pat);
+
 void hvm_set_guest_tsc(struct vcpu *v, u64 guest_tsc);
 u64 hvm_get_guest_tsc(struct vcpu *v);
 

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

From xen-changelog-bounces@lists.xen.org Wed Sep 05 01:01:47 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Sep 2012 01:01:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T93zx-0001lJ-03; Wed, 05 Sep 2012 01:01:41 +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 1T93zv-0001VE-HH
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:39 +0000
Received: from [85.158.138.51:9793] by server-3.bemta-3.messagelabs.com id
	3A/41-21322-274A6405; Wed, 05 Sep 2012 01:01:38 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1346806896!28564649!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1457 invoked from network); 5 Sep 2012 01:01:37 -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;
	5 Sep 2012 01:01: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 1T93zs-0007wh-B9
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T93zq-0007BJ-GQ
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:35 +0000
Message-Id: <E1T93zq-0007BJ-GQ@xenbits.xen.org>
Date: Wed, 05 Sep 2012 01:01:34 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] Fix save/restore of guest PAT
	table in HAP paging mode.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Gianluca Guida <gianluca.guida@citrix.com>
# Date 1346762536 -7200
# Node ID 201895ed11bcad4c74a2bb953f93e222c8f50abe
# Parent  e72c098aa73c2689f74167ff853371a184d30058
Fix save/restore of guest PAT table in HAP paging mode.

HAP paging mode guests use direct MSR read/write into the VMCS/VMCB
for the guest PAT table, while the current save/restore code was
accessing only the pat_cr field in hvm_vcpu, used when intercepting
the MSR mostly in shadow mode (the Intel scenario is a bit more
complicated).  This patch fixes this issue creating a new couple of
hvm_funcs, get/set_guest_pat, that access the right PAT table based on
the paging mode and guest configuration.

Signed-off-by: Gianluca Guida <gianluca.guida@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
xen-unstable changeset: 25196:375fa55c7a6c
xen-unstable date: Tue Apr 17 07:29:26 UTC 2012
---


diff -r e72c098aa73c -r 201895ed11bc xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Tue Sep 04 14:40:53 2012 +0200
+++ b/xen/arch/x86/hvm/hvm.c	Tue Sep 04 14:42:16 2012 +0200
@@ -217,6 +217,31 @@ void hvm_set_rdtsc_exiting(struct domain
         hvm_funcs.set_rdtsc_exiting(v, enable);
 }
 
+void hvm_get_guest_pat(struct vcpu *v, u64 *guest_pat)
+{
+    if ( !hvm_funcs.get_guest_pat(v, guest_pat) )
+        *guest_pat = v->arch.hvm_vcpu.pat_cr;
+}
+
+int hvm_set_guest_pat(struct vcpu *v, u64 guest_pat)
+{
+    int i;
+    uint8_t *value = (uint8_t *)&guest_pat;
+
+    for ( i = 0; i < 8; i++ )
+        if ( unlikely(!(value[i] == 0 || value[i] == 1 ||
+                        value[i] == 4 || value[i] == 5 ||
+                        value[i] == 6 || value[i] == 7)) ) {
+            HVM_DBG_LOG(DBG_LEVEL_MSR, "invalid guest PAT: %"PRIx64"\n",
+                        guest_pat);
+            return 0;
+        }
+
+    if ( !hvm_funcs.set_guest_pat(v, guest_pat) )
+        v->arch.hvm_vcpu.pat_cr = guest_pat;
+    return 1;
+}
+
 void hvm_set_guest_tsc(struct vcpu *v, u64 guest_tsc)
 {
     uint64_t tsc;
@@ -2394,7 +2419,7 @@ int hvm_msr_read_intercept(unsigned int 
         break;
 
     case MSR_IA32_CR_PAT:
-        *msr_content = v->arch.hvm_vcpu.pat_cr;
+        hvm_get_guest_pat(v, msr_content);
         break;
 
     case MSR_MTRRcap:
@@ -2510,7 +2535,7 @@ int hvm_msr_write_intercept(unsigned int
         break;
 
     case MSR_IA32_CR_PAT:
-        if ( !pat_msr_set(&v->arch.hvm_vcpu.pat_cr, msr_content) )
+        if ( !hvm_set_guest_pat(v, msr_content) )
            goto gp_fault;
         break;
 
diff -r e72c098aa73c -r 201895ed11bc xen/arch/x86/hvm/mtrr.c
--- a/xen/arch/x86/hvm/mtrr.c	Tue Sep 04 14:40:53 2012 +0200
+++ b/xen/arch/x86/hvm/mtrr.c	Tue Sep 04 14:42:16 2012 +0200
@@ -406,26 +406,6 @@ uint32_t get_pat_flags(struct vcpu *v,
     return pat_type_2_pte_flags(pat_entry_value);
 }
 
-/* Helper funtions for seting mtrr/pat */
-bool_t pat_msr_set(uint64_t *pat, uint64_t msr_content)
-{
-    uint8_t *value = (uint8_t*)&msr_content;
-    int32_t i;
-
-    if ( *pat != msr_content )
-    {
-        for ( i = 0; i < 8; i++ )
-            if ( unlikely(!(value[i] == 0 || value[i] == 1 ||
-                            value[i] == 4 || value[i] == 5 ||
-                            value[i] == 6 || value[i] == 7)) )
-                return 0;
-
-        *pat = msr_content;
-    }
-
-    return 1;
-}
-
 bool_t mtrr_def_type_msr_set(struct mtrr_state *m, uint64_t msr_content)
 {
     uint8_t def_type = msr_content & 0xff;
@@ -636,7 +616,7 @@ static int hvm_save_mtrr_msr(struct doma
     {
         mtrr_state = &v->arch.hvm_vcpu.mtrr;
 
-        hw_mtrr.msr_pat_cr = v->arch.hvm_vcpu.pat_cr;
+        hvm_get_guest_pat(v, &hw_mtrr.msr_pat_cr);
 
         hw_mtrr.msr_mtrr_def_type = mtrr_state->def_type
                                 | (mtrr_state->enabled << 10);
@@ -681,7 +661,7 @@ static int hvm_load_mtrr_msr(struct doma
 
     mtrr_state = &v->arch.hvm_vcpu.mtrr;
 
-    pat_msr_set(&v->arch.hvm_vcpu.pat_cr, hw_mtrr.msr_pat_cr);
+    hvm_set_guest_pat(v, hw_mtrr.msr_pat_cr);
 
     mtrr_state->mtrr_cap = hw_mtrr.msr_mtrr_cap;
 
diff -r e72c098aa73c -r 201895ed11bc xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c	Tue Sep 04 14:40:53 2012 +0200
+++ b/xen/arch/x86/hvm/svm/svm.c	Tue Sep 04 14:42:16 2012 +0200
@@ -585,6 +585,28 @@ static void svm_set_segment_register(str
         svm_vmload(vmcb);
 }
 
+static int svm_set_guest_pat(struct vcpu *v, u64 gpat)
+{
+    struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb;
+
+    if ( !paging_mode_hap(v->domain) )
+        return 0;
+
+    vmcb_set_g_pat(vmcb, gpat);
+    return 1;
+}
+
+static int svm_get_guest_pat(struct vcpu *v, u64 *gpat)
+{
+    struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb;
+
+    if ( !paging_mode_hap(v->domain) )
+        return 0;
+
+    *gpat = vmcb_get_g_pat(vmcb);
+    return 1;
+}
+
 static void svm_set_tsc_offset(struct vcpu *v, u64 offset)
 {
     struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb;
@@ -1519,6 +1541,8 @@ static struct hvm_function_table __read_
     .update_host_cr3      = svm_update_host_cr3,
     .update_guest_cr      = svm_update_guest_cr,
     .update_guest_efer    = svm_update_guest_efer,
+    .set_guest_pat        = svm_set_guest_pat,
+    .get_guest_pat        = svm_get_guest_pat,
     .set_tsc_offset       = svm_set_tsc_offset,
     .inject_exception     = svm_inject_exception,
     .init_hypercall_page  = svm_init_hypercall_page,
diff -r e72c098aa73c -r 201895ed11bc xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Tue Sep 04 14:40:53 2012 +0200
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Tue Sep 04 14:42:16 2012 +0200
@@ -921,6 +921,34 @@ static void vmx_set_segment_register(str
     vmx_vmcs_exit(v);
 }
 
+static int vmx_set_guest_pat(struct vcpu *v, u64 gpat)
+{
+    if ( !cpu_has_vmx_pat || !paging_mode_hap(v->domain) )
+        return 0;
+
+    vmx_vmcs_enter(v);
+    __vmwrite(GUEST_PAT, gpat);
+#ifdef __i386__
+    __vmwrite(GUEST_PAT_HIGH, gpat >> 32);
+#endif
+    vmx_vmcs_exit(v);
+    return 1;
+}
+
+static int vmx_get_guest_pat(struct vcpu *v, u64 *gpat)
+{
+    if ( !cpu_has_vmx_pat || !paging_mode_hap(v->domain) )
+        return 0;
+
+    vmx_vmcs_enter(v);
+    *gpat = __vmread(GUEST_PAT);
+#ifdef __i386__
+    *gpat |= (u64)__vmread(GUEST_PAT_HIGH) << 32;
+#endif
+    vmx_vmcs_exit(v);
+    return 1;
+}
+
 static void vmx_set_tsc_offset(struct vcpu *v, u64 offset)
 {
     vmx_vmcs_enter(v);
@@ -1384,6 +1412,8 @@ static struct hvm_function_table __read_
     .update_host_cr3      = vmx_update_host_cr3,
     .update_guest_cr      = vmx_update_guest_cr,
     .update_guest_efer    = vmx_update_guest_efer,
+    .set_guest_pat        = vmx_set_guest_pat,
+    .get_guest_pat        = vmx_get_guest_pat,
     .set_tsc_offset       = vmx_set_tsc_offset,
     .inject_exception     = vmx_inject_exception,
     .init_hypercall_page  = vmx_init_hypercall_page,
diff -r e72c098aa73c -r 201895ed11bc xen/include/asm-x86/hvm/hvm.h
--- a/xen/include/asm-x86/hvm/hvm.h	Tue Sep 04 14:40:53 2012 +0200
+++ b/xen/include/asm-x86/hvm/hvm.h	Tue Sep 04 14:42:16 2012 +0200
@@ -116,6 +116,9 @@ struct hvm_function_table {
     void (*update_guest_cr)(struct vcpu *v, unsigned int cr);
     void (*update_guest_efer)(struct vcpu *v);
 
+    int  (*get_guest_pat)(struct vcpu *v, u64 *);
+    int  (*set_guest_pat)(struct vcpu *v, u64);
+
     void (*set_tsc_offset)(struct vcpu *v, u64 offset);
 
     void (*inject_exception)(unsigned int trapnr, int errcode,
@@ -166,6 +169,9 @@ void hvm_vcpu_reset_state(struct vcpu *v
 
 bool_t hvm_send_assist_req(struct vcpu *v);
 
+void hvm_get_guest_pat(struct vcpu *v, u64 *guest_pat);
+int hvm_set_guest_pat(struct vcpu *v, u64 guest_pat);
+
 void hvm_set_guest_tsc(struct vcpu *v, u64 guest_tsc);
 u64 hvm_get_guest_tsc(struct vcpu *v);
 

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

From xen-changelog-bounces@lists.xen.org Wed Sep 05 01:01:47 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Sep 2012 01:01:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T93zs-00015T-GP; Wed, 05 Sep 2012 01:01:36 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T93zq-0000nh-Te
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:35 +0000
Received: from [85.158.143.99:6673] by server-2.bemta-4.messagelabs.com id
	38/8B-21239-E64A6405; Wed, 05 Sep 2012 01:01:34 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-216.messagelabs.com!1346806892!28217098!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16404 invoked from network); 5 Sep 2012 01:01:33 -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;
	5 Sep 2012 01:01: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 1T93zo-0007Ey-95
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T93yj-00078D-Jg
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:10 +0000
Message-Id: <E1T93yj-00078D-Jg@xenbits.xen.org>
Date: Wed, 05 Sep 2012 01: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] Update Xen version to 4.1.4-pre
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich
# Date 1346753015 -7200
# Node ID 58d3c21ee4bde73269d6c1cb063b51cebb21ce99
# Parent  1225aff05dd202dec7136543f04d475a45b78551
Update Xen version to 4.1.4-pre
---


diff -r 1225aff05dd2 -r 58d3c21ee4bd xen/Makefile
--- a/xen/Makefile	Thu Aug 09 16:48:07 2012 +0100
+++ b/xen/Makefile	Tue Sep 04 12:03:35 2012 +0200
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 1
-export XEN_EXTRAVERSION ?= .3$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .4-pre$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 

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

From xen-changelog-bounces@lists.xen.org Wed Sep 05 01:01:47 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Sep 2012 01:01:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T93zs-00015T-GP; Wed, 05 Sep 2012 01:01:36 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T93zq-0000nh-Te
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:35 +0000
Received: from [85.158.143.99:6673] by server-2.bemta-4.messagelabs.com id
	38/8B-21239-E64A6405; Wed, 05 Sep 2012 01:01:34 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-216.messagelabs.com!1346806892!28217098!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16404 invoked from network); 5 Sep 2012 01:01:33 -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;
	5 Sep 2012 01:01: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 1T93zo-0007Ey-95
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T93yj-00078D-Jg
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:10 +0000
Message-Id: <E1T93yj-00078D-Jg@xenbits.xen.org>
Date: Wed, 05 Sep 2012 01: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] Update Xen version to 4.1.4-pre
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich
# Date 1346753015 -7200
# Node ID 58d3c21ee4bde73269d6c1cb063b51cebb21ce99
# Parent  1225aff05dd202dec7136543f04d475a45b78551
Update Xen version to 4.1.4-pre
---


diff -r 1225aff05dd2 -r 58d3c21ee4bd xen/Makefile
--- a/xen/Makefile	Thu Aug 09 16:48:07 2012 +0100
+++ b/xen/Makefile	Tue Sep 04 12:03:35 2012 +0200
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 1
-export XEN_EXTRAVERSION ?= .3$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .4-pre$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 

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

From xen-changelog-bounces@lists.xen.org Wed Sep 05 01:01:51 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Sep 2012 01:01:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9404-0002mB-NQ; Wed, 05 Sep 2012 01:01:48 +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 1T9402-0001ma-JL
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:46 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1346806898!9031807!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1699 invoked from network); 5 Sep 2012 01:01:39 -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 Sep 2012 01:01: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 1T93zt-0008E9-V1
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T93zt-0007C2-PR
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:37 +0000
Message-Id: <E1T93zt-0007C2-PR@xenbits.xen.org>
Date: Wed, 05 Sep 2012 01:01:37 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86/EDD: check MBR for BIOS magic
	before considering signature valid
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <JBeulich@suse.com>
# Date 1346762742 -7200
# Node ID 3fe75068fa354d347029d20210d49c765babedac
# Parent  060fbf05ce532d86314bd9db96fe9510495abed3
x86/EDD: check MBR for BIOS magic before considering signature valid

Signed-off-by: Jan Beulich <JBeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25431:cdced279e792
xen-unstable date: Thu May 31 08:18:13 UTC 2012
---


diff -r 060fbf05ce53 -r 3fe75068fa35 xen/arch/x86/boot/edd.S
--- a/xen/arch/x86/boot/edd.S	Tue Sep 04 14:44:37 2012 +0200
+++ b/xen/arch/x86/boot/edd.S	Tue Sep 04 14:45:42 2012 +0200
@@ -61,12 +61,16 @@ edd_mbr_sig_read:
         jc      edd_mbr_sig_done                # on failure, we're done.
         cmpb    $0, %ah                         # some BIOSes do not set CF
         jne     edd_mbr_sig_done                # on failure, we're done.
+        cmpw    $0xaa55, bootsym(boot_edd_info)+0x1fe
+        jne     .Ledd_mbr_sig_next
         movl    bootsym(boot_edd_info)+EDD_MBR_SIG_OFFSET,%eax
         movb    %dl, (%bx)                      # store BIOS drive number
         movl    %eax, 4(%bx)                    # store signature from MBR
         incb    bootsym(boot_mbr_signature_nr)  # note that we stored something
+        addw    $8, %bx                         # increment sig buffer ptr
+.Ledd_mbr_sig_next:
         incb    %dl                             # increment to next device
-        addw    $8, %bx                         # increment sig buffer ptr
+        jz      edd_mbr_sig_done
         cmpb    $EDD_MBR_SIG_MAX,bootsym(boot_mbr_signature_nr)
         jb      edd_mbr_sig_read
 edd_mbr_sig_done:

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

From xen-changelog-bounces@lists.xen.org Wed Sep 05 01:01:51 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Sep 2012 01:01:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9404-0002mB-NQ; Wed, 05 Sep 2012 01:01:48 +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 1T9402-0001ma-JL
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:46 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1346806898!9031807!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1699 invoked from network); 5 Sep 2012 01:01:39 -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 Sep 2012 01:01: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 1T93zt-0008E9-V1
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T93zt-0007C2-PR
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 01:01:37 +0000
Message-Id: <E1T93zt-0007C2-PR@xenbits.xen.org>
Date: Wed, 05 Sep 2012 01:01:37 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86/EDD: check MBR for BIOS magic
	before considering signature valid
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <JBeulich@suse.com>
# Date 1346762742 -7200
# Node ID 3fe75068fa354d347029d20210d49c765babedac
# Parent  060fbf05ce532d86314bd9db96fe9510495abed3
x86/EDD: check MBR for BIOS magic before considering signature valid

Signed-off-by: Jan Beulich <JBeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25431:cdced279e792
xen-unstable date: Thu May 31 08:18:13 UTC 2012
---


diff -r 060fbf05ce53 -r 3fe75068fa35 xen/arch/x86/boot/edd.S
--- a/xen/arch/x86/boot/edd.S	Tue Sep 04 14:44:37 2012 +0200
+++ b/xen/arch/x86/boot/edd.S	Tue Sep 04 14:45:42 2012 +0200
@@ -61,12 +61,16 @@ edd_mbr_sig_read:
         jc      edd_mbr_sig_done                # on failure, we're done.
         cmpb    $0, %ah                         # some BIOSes do not set CF
         jne     edd_mbr_sig_done                # on failure, we're done.
+        cmpw    $0xaa55, bootsym(boot_edd_info)+0x1fe
+        jne     .Ledd_mbr_sig_next
         movl    bootsym(boot_edd_info)+EDD_MBR_SIG_OFFSET,%eax
         movb    %dl, (%bx)                      # store BIOS drive number
         movl    %eax, 4(%bx)                    # store signature from MBR
         incb    bootsym(boot_mbr_signature_nr)  # note that we stored something
+        addw    $8, %bx                         # increment sig buffer ptr
+.Ledd_mbr_sig_next:
         incb    %dl                             # increment to next device
-        addw    $8, %bx                         # increment sig buffer ptr
+        jz      edd_mbr_sig_done
         cmpb    $EDD_MBR_SIG_MAX,bootsym(boot_mbr_signature_nr)
         jb      edd_mbr_sig_read
 edd_mbr_sig_done:

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

From xen-changelog-bounces@lists.xen.org Wed Sep 05 11:44:14 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Sep 2012 11:44:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9E1h-0001Ol-1k; Wed, 05 Sep 2012 11:44:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1T9E1e-0001Of-Nq
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 11:44:06 +0000
Received: from [85.158.139.83:61762] by server-9.bemta-5.messagelabs.com id
	78/1A-20529-50B37405; Wed, 05 Sep 2012 11:44:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1346845444!28514993!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24340 invoked from network); 5 Sep 2012 11:44:05 -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 Sep 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 <ian.jackson@eu.citrix.com>) id 1T9E1b-0001ZZ-UU
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 11:44:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1T9E1b-0006H8-Mt
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 11:44:03 +0000
Date: Wed, 05 Sep 2012 11:44:03 +0000
Message-Id: <E1T9E1b-0006H8-Mt@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-4.0-testing] console: bounds check
	whenever changing the cursor due to an escape code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 091149d364e893e643a5da3175c3f84d2163cb3e
Author: Ian Campbell <ian.campbell@citrix.com>
Date:   Wed Sep 5 12:31:40 2012 +0100

    console: bounds check whenever changing the cursor due to an escape code
    
    This is XSA-17 / CVE-2012-3515
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit a56ae4b5069c7b23ee657b15f08443a9b14a8e7b)
---
 console.c |   57 ++++++++++++++++++++++++++++-----------------------------
 1 files changed, 28 insertions(+), 29 deletions(-)

diff --git a/console.c b/console.c
index 5e6e3d0..9984d6f 100644
--- a/console.c
+++ b/console.c
@@ -794,6 +794,26 @@ static void console_clear_xy(TextConsole *s, int x, int y)
     update_xy(s, x, y);
 }
 
+/* set cursor, checking bounds */
+static void set_cursor(TextConsole *s, int x, int y)
+{
+    if (x < 0) {
+        x = 0;
+    }
+    if (y < 0) {
+        y = 0;
+    }
+    if (y >= s->height) {
+        y = s->height - 1;
+    }
+    if (x >= s->width) {
+        x = s->width - 1;
+    }
+
+    s->x = x;
+    s->y = y;
+}
+
 static void console_putchar(TextConsole *s, int ch)
 {
     TextCell *c;
@@ -869,7 +889,8 @@ static void console_putchar(TextConsole *s, int ch)
                     s->esc_params[s->nb_esc_params] * 10 + ch - '0';
             }
         } else {
-            s->nb_esc_params++;
+            if (s->nb_esc_params < MAX_ESC_PARAMS)
+                s->nb_esc_params++;
             if (ch == ';')
                 break;
 #ifdef DEBUG_CONSOLE
@@ -883,59 +904,37 @@ static void console_putchar(TextConsole *s, int ch)
                 if (s->esc_params[0] == 0) {
                     s->esc_params[0] = 1;
                 }
-                s->y -= s->esc_params[0];
-                if (s->y < 0) {
-                    s->y = 0;
-                }
+                set_cursor(s, s->x, s->y - s->esc_params[0]);
                 break;
             case 'B':
                 /* move cursor down */
                 if (s->esc_params[0] == 0) {
                     s->esc_params[0] = 1;
                 }
-                s->y += s->esc_params[0];
-                if (s->y >= s->height) {
-                    s->y = s->height - 1;
-                }
+                set_cursor(s, s->x, s->y + s->esc_params[0]);
                 break;
             case 'C':
                 /* move cursor right */
                 if (s->esc_params[0] == 0) {
                     s->esc_params[0] = 1;
                 }
-                s->x += s->esc_params[0];
-                if (s->x >= s->width) {
-                    s->x = s->width - 1;
-                }
+                set_cursor(s, s->x + s->esc_params[0], s->y);
                 break;
             case 'D':
                 /* move cursor left */
                 if (s->esc_params[0] == 0) {
                     s->esc_params[0] = 1;
                 }
-                s->x -= s->esc_params[0];
-                if (s->x < 0) {
-                    s->x = 0;
-                }
+                set_cursor(s, s->x - s->esc_params[0], s->y);
                 break;
             case 'G':
                 /* move cursor to column */
-                s->x = s->esc_params[0] - 1;
-                if (s->x < 0) {
-                    s->x = 0;
-                }
+                set_cursor(s, s->esc_params[0] - 1, s->y);
                 break;
             case 'f':
             case 'H':
                 /* move cursor to row, column */
-                s->x = s->esc_params[1] - 1;
-                if (s->x < 0) {
-                    s->x = 0;
-                }
-                s->y = s->esc_params[0] - 1;
-                if (s->y < 0) {
-                    s->y = 0;
-                }
+                set_cursor(s, s->esc_params[1] - 1, s->esc_params[0] - 1);
                 break;
             case 'J':
                 switch (s->esc_params[0]) {
--
generated by git-patchbot for /home/xen/git/qemu-xen-4.0-testing.git

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

From xen-changelog-bounces@lists.xen.org Wed Sep 05 11:44:14 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Sep 2012 11:44:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9E1h-0001Ol-1k; Wed, 05 Sep 2012 11:44:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1T9E1e-0001Of-Nq
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 11:44:06 +0000
Received: from [85.158.139.83:61762] by server-9.bemta-5.messagelabs.com id
	78/1A-20529-50B37405; Wed, 05 Sep 2012 11:44:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1346845444!28514993!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24340 invoked from network); 5 Sep 2012 11:44:05 -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 Sep 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 <ian.jackson@eu.citrix.com>) id 1T9E1b-0001ZZ-UU
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 11:44:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1T9E1b-0006H8-Mt
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 11:44:03 +0000
Date: Wed, 05 Sep 2012 11:44:03 +0000
Message-Id: <E1T9E1b-0006H8-Mt@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-4.0-testing] console: bounds check
	whenever changing the cursor due to an escape code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 091149d364e893e643a5da3175c3f84d2163cb3e
Author: Ian Campbell <ian.campbell@citrix.com>
Date:   Wed Sep 5 12:31:40 2012 +0100

    console: bounds check whenever changing the cursor due to an escape code
    
    This is XSA-17 / CVE-2012-3515
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit a56ae4b5069c7b23ee657b15f08443a9b14a8e7b)
---
 console.c |   57 ++++++++++++++++++++++++++++-----------------------------
 1 files changed, 28 insertions(+), 29 deletions(-)

diff --git a/console.c b/console.c
index 5e6e3d0..9984d6f 100644
--- a/console.c
+++ b/console.c
@@ -794,6 +794,26 @@ static void console_clear_xy(TextConsole *s, int x, int y)
     update_xy(s, x, y);
 }
 
+/* set cursor, checking bounds */
+static void set_cursor(TextConsole *s, int x, int y)
+{
+    if (x < 0) {
+        x = 0;
+    }
+    if (y < 0) {
+        y = 0;
+    }
+    if (y >= s->height) {
+        y = s->height - 1;
+    }
+    if (x >= s->width) {
+        x = s->width - 1;
+    }
+
+    s->x = x;
+    s->y = y;
+}
+
 static void console_putchar(TextConsole *s, int ch)
 {
     TextCell *c;
@@ -869,7 +889,8 @@ static void console_putchar(TextConsole *s, int ch)
                     s->esc_params[s->nb_esc_params] * 10 + ch - '0';
             }
         } else {
-            s->nb_esc_params++;
+            if (s->nb_esc_params < MAX_ESC_PARAMS)
+                s->nb_esc_params++;
             if (ch == ';')
                 break;
 #ifdef DEBUG_CONSOLE
@@ -883,59 +904,37 @@ static void console_putchar(TextConsole *s, int ch)
                 if (s->esc_params[0] == 0) {
                     s->esc_params[0] = 1;
                 }
-                s->y -= s->esc_params[0];
-                if (s->y < 0) {
-                    s->y = 0;
-                }
+                set_cursor(s, s->x, s->y - s->esc_params[0]);
                 break;
             case 'B':
                 /* move cursor down */
                 if (s->esc_params[0] == 0) {
                     s->esc_params[0] = 1;
                 }
-                s->y += s->esc_params[0];
-                if (s->y >= s->height) {
-                    s->y = s->height - 1;
-                }
+                set_cursor(s, s->x, s->y + s->esc_params[0]);
                 break;
             case 'C':
                 /* move cursor right */
                 if (s->esc_params[0] == 0) {
                     s->esc_params[0] = 1;
                 }
-                s->x += s->esc_params[0];
-                if (s->x >= s->width) {
-                    s->x = s->width - 1;
-                }
+                set_cursor(s, s->x + s->esc_params[0], s->y);
                 break;
             case 'D':
                 /* move cursor left */
                 if (s->esc_params[0] == 0) {
                     s->esc_params[0] = 1;
                 }
-                s->x -= s->esc_params[0];
-                if (s->x < 0) {
-                    s->x = 0;
-                }
+                set_cursor(s, s->x - s->esc_params[0], s->y);
                 break;
             case 'G':
                 /* move cursor to column */
-                s->x = s->esc_params[0] - 1;
-                if (s->x < 0) {
-                    s->x = 0;
-                }
+                set_cursor(s, s->esc_params[0] - 1, s->y);
                 break;
             case 'f':
             case 'H':
                 /* move cursor to row, column */
-                s->x = s->esc_params[1] - 1;
-                if (s->x < 0) {
-                    s->x = 0;
-                }
-                s->y = s->esc_params[0] - 1;
-                if (s->y < 0) {
-                    s->y = 0;
-                }
+                set_cursor(s, s->esc_params[1] - 1, s->esc_params[0] - 1);
                 break;
             case 'J':
                 switch (s->esc_params[0]) {
--
generated by git-patchbot for /home/xen/git/qemu-xen-4.0-testing.git

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

From xen-changelog-bounces@lists.xen.org Wed Sep 05 11:46:39 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Sep 2012 11:46:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9E43-0001Wm-UG; Wed, 05 Sep 2012 11:46:35 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1T9E42-0001Wh-Eq
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 11:46:34 +0000
Received: from [85.158.143.35:15642] by server-3.bemta-4.messagelabs.com id
	91/55-08232-99B37405; Wed, 05 Sep 2012 11:46:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1346845463!11622149!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11071 invoked from network); 5 Sep 2012 11:44:24 -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 Sep 2012 11:44:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1T9E1v-0001Zm-1B
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 11:44:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1T9E1u-0006IO-U7
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 11:44:23 +0000
Date: Wed, 05 Sep 2012 11:44:22 +0000
Message-Id: <E1T9E1u-0006IO-U7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-4.1-testing] console: bounds check
	whenever changing the cursor due to an escape code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3220480734832a148d26f7a81f90af61c2ecfdd9
Author: Ian Campbell <ian.campbell@citrix.com>
Date:   Wed Sep 5 12:31:40 2012 +0100

    console: bounds check whenever changing the cursor due to an escape code
    
    This is XSA-17 / CVE-2012-3515
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit a56ae4b5069c7b23ee657b15f08443a9b14a8e7b)
---
 console.c |   57 ++++++++++++++++++++++++++++-----------------------------
 1 files changed, 28 insertions(+), 29 deletions(-)

diff --git a/console.c b/console.c
index 5e6e3d0..9984d6f 100644
--- a/console.c
+++ b/console.c
@@ -794,6 +794,26 @@ static void console_clear_xy(TextConsole *s, int x, int y)
     update_xy(s, x, y);
 }
 
+/* set cursor, checking bounds */
+static void set_cursor(TextConsole *s, int x, int y)
+{
+    if (x < 0) {
+        x = 0;
+    }
+    if (y < 0) {
+        y = 0;
+    }
+    if (y >= s->height) {
+        y = s->height - 1;
+    }
+    if (x >= s->width) {
+        x = s->width - 1;
+    }
+
+    s->x = x;
+    s->y = y;
+}
+
 static void console_putchar(TextConsole *s, int ch)
 {
     TextCell *c;
@@ -869,7 +889,8 @@ static void console_putchar(TextConsole *s, int ch)
                     s->esc_params[s->nb_esc_params] * 10 + ch - '0';
             }
         } else {
-            s->nb_esc_params++;
+            if (s->nb_esc_params < MAX_ESC_PARAMS)
+                s->nb_esc_params++;
             if (ch == ';')
                 break;
 #ifdef DEBUG_CONSOLE
@@ -883,59 +904,37 @@ static void console_putchar(TextConsole *s, int ch)
                 if (s->esc_params[0] == 0) {
                     s->esc_params[0] = 1;
                 }
-                s->y -= s->esc_params[0];
-                if (s->y < 0) {
-                    s->y = 0;
-                }
+                set_cursor(s, s->x, s->y - s->esc_params[0]);
                 break;
             case 'B':
                 /* move cursor down */
                 if (s->esc_params[0] == 0) {
                     s->esc_params[0] = 1;
                 }
-                s->y += s->esc_params[0];
-                if (s->y >= s->height) {
-                    s->y = s->height - 1;
-                }
+                set_cursor(s, s->x, s->y + s->esc_params[0]);
                 break;
             case 'C':
                 /* move cursor right */
                 if (s->esc_params[0] == 0) {
                     s->esc_params[0] = 1;
                 }
-                s->x += s->esc_params[0];
-                if (s->x >= s->width) {
-                    s->x = s->width - 1;
-                }
+                set_cursor(s, s->x + s->esc_params[0], s->y);
                 break;
             case 'D':
                 /* move cursor left */
                 if (s->esc_params[0] == 0) {
                     s->esc_params[0] = 1;
                 }
-                s->x -= s->esc_params[0];
-                if (s->x < 0) {
-                    s->x = 0;
-                }
+                set_cursor(s, s->x - s->esc_params[0], s->y);
                 break;
             case 'G':
                 /* move cursor to column */
-                s->x = s->esc_params[0] - 1;
-                if (s->x < 0) {
-                    s->x = 0;
-                }
+                set_cursor(s, s->esc_params[0] - 1, s->y);
                 break;
             case 'f':
             case 'H':
                 /* move cursor to row, column */
-                s->x = s->esc_params[1] - 1;
-                if (s->x < 0) {
-                    s->x = 0;
-                }
-                s->y = s->esc_params[0] - 1;
-                if (s->y < 0) {
-                    s->y = 0;
-                }
+                set_cursor(s, s->esc_params[1] - 1, s->esc_params[0] - 1);
                 break;
             case 'J':
                 switch (s->esc_params[0]) {
--
generated by git-patchbot for /home/xen/git/qemu-xen-4.1-testing.git

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

From xen-changelog-bounces@lists.xen.org Wed Sep 05 11:46:39 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Sep 2012 11:46:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9E43-0001Wm-UG; Wed, 05 Sep 2012 11:46:35 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1T9E42-0001Wh-Eq
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 11:46:34 +0000
Received: from [85.158.143.35:15642] by server-3.bemta-4.messagelabs.com id
	91/55-08232-99B37405; Wed, 05 Sep 2012 11:46:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1346845463!11622149!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11071 invoked from network); 5 Sep 2012 11:44:24 -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 Sep 2012 11:44:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1T9E1v-0001Zm-1B
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 11:44:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1T9E1u-0006IO-U7
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 11:44:23 +0000
Date: Wed, 05 Sep 2012 11:44:22 +0000
Message-Id: <E1T9E1u-0006IO-U7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-4.1-testing] console: bounds check
	whenever changing the cursor due to an escape code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3220480734832a148d26f7a81f90af61c2ecfdd9
Author: Ian Campbell <ian.campbell@citrix.com>
Date:   Wed Sep 5 12:31:40 2012 +0100

    console: bounds check whenever changing the cursor due to an escape code
    
    This is XSA-17 / CVE-2012-3515
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit a56ae4b5069c7b23ee657b15f08443a9b14a8e7b)
---
 console.c |   57 ++++++++++++++++++++++++++++-----------------------------
 1 files changed, 28 insertions(+), 29 deletions(-)

diff --git a/console.c b/console.c
index 5e6e3d0..9984d6f 100644
--- a/console.c
+++ b/console.c
@@ -794,6 +794,26 @@ static void console_clear_xy(TextConsole *s, int x, int y)
     update_xy(s, x, y);
 }
 
+/* set cursor, checking bounds */
+static void set_cursor(TextConsole *s, int x, int y)
+{
+    if (x < 0) {
+        x = 0;
+    }
+    if (y < 0) {
+        y = 0;
+    }
+    if (y >= s->height) {
+        y = s->height - 1;
+    }
+    if (x >= s->width) {
+        x = s->width - 1;
+    }
+
+    s->x = x;
+    s->y = y;
+}
+
 static void console_putchar(TextConsole *s, int ch)
 {
     TextCell *c;
@@ -869,7 +889,8 @@ static void console_putchar(TextConsole *s, int ch)
                     s->esc_params[s->nb_esc_params] * 10 + ch - '0';
             }
         } else {
-            s->nb_esc_params++;
+            if (s->nb_esc_params < MAX_ESC_PARAMS)
+                s->nb_esc_params++;
             if (ch == ';')
                 break;
 #ifdef DEBUG_CONSOLE
@@ -883,59 +904,37 @@ static void console_putchar(TextConsole *s, int ch)
                 if (s->esc_params[0] == 0) {
                     s->esc_params[0] = 1;
                 }
-                s->y -= s->esc_params[0];
-                if (s->y < 0) {
-                    s->y = 0;
-                }
+                set_cursor(s, s->x, s->y - s->esc_params[0]);
                 break;
             case 'B':
                 /* move cursor down */
                 if (s->esc_params[0] == 0) {
                     s->esc_params[0] = 1;
                 }
-                s->y += s->esc_params[0];
-                if (s->y >= s->height) {
-                    s->y = s->height - 1;
-                }
+                set_cursor(s, s->x, s->y + s->esc_params[0]);
                 break;
             case 'C':
                 /* move cursor right */
                 if (s->esc_params[0] == 0) {
                     s->esc_params[0] = 1;
                 }
-                s->x += s->esc_params[0];
-                if (s->x >= s->width) {
-                    s->x = s->width - 1;
-                }
+                set_cursor(s, s->x + s->esc_params[0], s->y);
                 break;
             case 'D':
                 /* move cursor left */
                 if (s->esc_params[0] == 0) {
                     s->esc_params[0] = 1;
                 }
-                s->x -= s->esc_params[0];
-                if (s->x < 0) {
-                    s->x = 0;
-                }
+                set_cursor(s, s->x - s->esc_params[0], s->y);
                 break;
             case 'G':
                 /* move cursor to column */
-                s->x = s->esc_params[0] - 1;
-                if (s->x < 0) {
-                    s->x = 0;
-                }
+                set_cursor(s, s->esc_params[0] - 1, s->y);
                 break;
             case 'f':
             case 'H':
                 /* move cursor to row, column */
-                s->x = s->esc_params[1] - 1;
-                if (s->x < 0) {
-                    s->x = 0;
-                }
-                s->y = s->esc_params[0] - 1;
-                if (s->y < 0) {
-                    s->y = 0;
-                }
+                set_cursor(s, s->esc_params[1] - 1, s->esc_params[0] - 1);
                 break;
             case 'J':
                 switch (s->esc_params[0]) {
--
generated by git-patchbot for /home/xen/git/qemu-xen-4.1-testing.git

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

From xen-changelog-bounces@lists.xen.org Wed Sep 05 11:55:12 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Sep 2012 11: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.xen.org>)
	id 1T9ECJ-0001dv-NK; Wed, 05 Sep 2012 11:55:07 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1T9ECI-0001dq-Sq
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 11:55:07 +0000
Received: from [85.158.139.83:32982] by server-8.bemta-5.messagelabs.com id
	7A/B8-17085-99D37405; Wed, 05 Sep 2012 11:55:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1346846104!25960928!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10490 invoked from network); 5 Sep 2012 11:55:05 -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;
	5 Sep 2012 11:55:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1T9ECF-0001iZ-Su
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 11:55:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1T9ECF-0006dp-HM
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 11:55:03 +0000
Date: Wed, 05 Sep 2012 11:55:03 +0000
Message-Id: <E1T9ECF-0006dp-HM@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] console: bounds check whenever
	changing the cursor due to an escape code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a56ae4b5069c7b23ee657b15f08443a9b14a8e7b
Author: Ian Campbell <ian.campbell@citrix.com>
Date:   Wed Sep 5 12:31:40 2012 +0100

    console: bounds check whenever changing the cursor due to an escape code
    
    This is XSA-17 / CVE-2012-3515
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 console.c |   57 ++++++++++++++++++++++++++++-----------------------------
 1 files changed, 28 insertions(+), 29 deletions(-)

diff --git a/console.c b/console.c
index 5e6e3d0..9984d6f 100644
--- a/console.c
+++ b/console.c
@@ -794,6 +794,26 @@ static void console_clear_xy(TextConsole *s, int x, int y)
     update_xy(s, x, y);
 }
 
+/* set cursor, checking bounds */
+static void set_cursor(TextConsole *s, int x, int y)
+{
+    if (x < 0) {
+        x = 0;
+    }
+    if (y < 0) {
+        y = 0;
+    }
+    if (y >= s->height) {
+        y = s->height - 1;
+    }
+    if (x >= s->width) {
+        x = s->width - 1;
+    }
+
+    s->x = x;
+    s->y = y;
+}
+
 static void console_putchar(TextConsole *s, int ch)
 {
     TextCell *c;
@@ -869,7 +889,8 @@ static void console_putchar(TextConsole *s, int ch)
                     s->esc_params[s->nb_esc_params] * 10 + ch - '0';
             }
         } else {
-            s->nb_esc_params++;
+            if (s->nb_esc_params < MAX_ESC_PARAMS)
+                s->nb_esc_params++;
             if (ch == ';')
                 break;
 #ifdef DEBUG_CONSOLE
@@ -883,59 +904,37 @@ static void console_putchar(TextConsole *s, int ch)
                 if (s->esc_params[0] == 0) {
                     s->esc_params[0] = 1;
                 }
-                s->y -= s->esc_params[0];
-                if (s->y < 0) {
-                    s->y = 0;
-                }
+                set_cursor(s, s->x, s->y - s->esc_params[0]);
                 break;
             case 'B':
                 /* move cursor down */
                 if (s->esc_params[0] == 0) {
                     s->esc_params[0] = 1;
                 }
-                s->y += s->esc_params[0];
-                if (s->y >= s->height) {
-                    s->y = s->height - 1;
-                }
+                set_cursor(s, s->x, s->y + s->esc_params[0]);
                 break;
             case 'C':
                 /* move cursor right */
                 if (s->esc_params[0] == 0) {
                     s->esc_params[0] = 1;
                 }
-                s->x += s->esc_params[0];
-                if (s->x >= s->width) {
-                    s->x = s->width - 1;
-                }
+                set_cursor(s, s->x + s->esc_params[0], s->y);
                 break;
             case 'D':
                 /* move cursor left */
                 if (s->esc_params[0] == 0) {
                     s->esc_params[0] = 1;
                 }
-                s->x -= s->esc_params[0];
-                if (s->x < 0) {
-                    s->x = 0;
-                }
+                set_cursor(s, s->x - s->esc_params[0], s->y);
                 break;
             case 'G':
                 /* move cursor to column */
-                s->x = s->esc_params[0] - 1;
-                if (s->x < 0) {
-                    s->x = 0;
-                }
+                set_cursor(s, s->esc_params[0] - 1, s->y);
                 break;
             case 'f':
             case 'H':
                 /* move cursor to row, column */
-                s->x = s->esc_params[1] - 1;
-                if (s->x < 0) {
-                    s->x = 0;
-                }
-                s->y = s->esc_params[0] - 1;
-                if (s->y < 0) {
-                    s->y = 0;
-                }
+                set_cursor(s, s->esc_params[1] - 1, s->esc_params[0] - 1);
                 break;
             case 'J':
                 switch (s->esc_params[0]) {
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Wed Sep 05 11:55:12 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Sep 2012 11: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.xen.org>)
	id 1T9ECJ-0001dv-NK; Wed, 05 Sep 2012 11:55:07 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1T9ECI-0001dq-Sq
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 11:55:07 +0000
Received: from [85.158.139.83:32982] by server-8.bemta-5.messagelabs.com id
	7A/B8-17085-99D37405; Wed, 05 Sep 2012 11:55:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1346846104!25960928!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10490 invoked from network); 5 Sep 2012 11:55:05 -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;
	5 Sep 2012 11:55:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1T9ECF-0001iZ-Su
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 11:55:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1T9ECF-0006dp-HM
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 11:55:03 +0000
Date: Wed, 05 Sep 2012 11:55:03 +0000
Message-Id: <E1T9ECF-0006dp-HM@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] console: bounds check whenever
	changing the cursor due to an escape code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a56ae4b5069c7b23ee657b15f08443a9b14a8e7b
Author: Ian Campbell <ian.campbell@citrix.com>
Date:   Wed Sep 5 12:31:40 2012 +0100

    console: bounds check whenever changing the cursor due to an escape code
    
    This is XSA-17 / CVE-2012-3515
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 console.c |   57 ++++++++++++++++++++++++++++-----------------------------
 1 files changed, 28 insertions(+), 29 deletions(-)

diff --git a/console.c b/console.c
index 5e6e3d0..9984d6f 100644
--- a/console.c
+++ b/console.c
@@ -794,6 +794,26 @@ static void console_clear_xy(TextConsole *s, int x, int y)
     update_xy(s, x, y);
 }
 
+/* set cursor, checking bounds */
+static void set_cursor(TextConsole *s, int x, int y)
+{
+    if (x < 0) {
+        x = 0;
+    }
+    if (y < 0) {
+        y = 0;
+    }
+    if (y >= s->height) {
+        y = s->height - 1;
+    }
+    if (x >= s->width) {
+        x = s->width - 1;
+    }
+
+    s->x = x;
+    s->y = y;
+}
+
 static void console_putchar(TextConsole *s, int ch)
 {
     TextCell *c;
@@ -869,7 +889,8 @@ static void console_putchar(TextConsole *s, int ch)
                     s->esc_params[s->nb_esc_params] * 10 + ch - '0';
             }
         } else {
-            s->nb_esc_params++;
+            if (s->nb_esc_params < MAX_ESC_PARAMS)
+                s->nb_esc_params++;
             if (ch == ';')
                 break;
 #ifdef DEBUG_CONSOLE
@@ -883,59 +904,37 @@ static void console_putchar(TextConsole *s, int ch)
                 if (s->esc_params[0] == 0) {
                     s->esc_params[0] = 1;
                 }
-                s->y -= s->esc_params[0];
-                if (s->y < 0) {
-                    s->y = 0;
-                }
+                set_cursor(s, s->x, s->y - s->esc_params[0]);
                 break;
             case 'B':
                 /* move cursor down */
                 if (s->esc_params[0] == 0) {
                     s->esc_params[0] = 1;
                 }
-                s->y += s->esc_params[0];
-                if (s->y >= s->height) {
-                    s->y = s->height - 1;
-                }
+                set_cursor(s, s->x, s->y + s->esc_params[0]);
                 break;
             case 'C':
                 /* move cursor right */
                 if (s->esc_params[0] == 0) {
                     s->esc_params[0] = 1;
                 }
-                s->x += s->esc_params[0];
-                if (s->x >= s->width) {
-                    s->x = s->width - 1;
-                }
+                set_cursor(s, s->x + s->esc_params[0], s->y);
                 break;
             case 'D':
                 /* move cursor left */
                 if (s->esc_params[0] == 0) {
                     s->esc_params[0] = 1;
                 }
-                s->x -= s->esc_params[0];
-                if (s->x < 0) {
-                    s->x = 0;
-                }
+                set_cursor(s, s->x - s->esc_params[0], s->y);
                 break;
             case 'G':
                 /* move cursor to column */
-                s->x = s->esc_params[0] - 1;
-                if (s->x < 0) {
-                    s->x = 0;
-                }
+                set_cursor(s, s->esc_params[0] - 1, s->y);
                 break;
             case 'f':
             case 'H':
                 /* move cursor to row, column */
-                s->x = s->esc_params[1] - 1;
-                if (s->x < 0) {
-                    s->x = 0;
-                }
-                s->y = s->esc_params[0] - 1;
-                if (s->y < 0) {
-                    s->y = 0;
-                }
+                set_cursor(s, s->esc_params[1] - 1, s->esc_params[0] - 1);
                 break;
             case 'J':
                 switch (s->esc_params[0]) {
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Wed Sep 05 21:11:15 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Sep 2012 21:11:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9MsR-0005wh-Rp; Wed, 05 Sep 2012 21:11:11 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9MsR-0005wX-CL
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 21:11:11 +0000
Received: from [85.158.143.99:21648] by server-3.bemta-4.messagelabs.com id
	2D/6E-08232-EEFB7405; Wed, 05 Sep 2012 21:11:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1346879469!23478527!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29007 invoked from network); 5 Sep 2012 21:11:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Sep 2012 21: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 1T9MsO-0000Fj-Q7
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 21:11:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9MsO-0003dz-CE
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 21:11:08 +0000
Message-Id: <E1T9MsO-0003dz-CE@xenbits.xen.org>
Date: Wed, 05 Sep 2012 21:11:07 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] xen: prevent a 64 bit guest
	setting reserved bits in DR7
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1346844478 -3600
# Node ID 92334c7f577e04ab121ee4ce1252ed7edb2a6892
# Parent  228e6f382d5d239d969c04448e045e2b74077f10
xen: prevent a 64 bit guest setting reserved bits in DR7

The upper 32 bits of this register are reserved and should be written as
zero.

This is XSA-12 / CVE-2012-3494

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


diff -r 228e6f382d5d -r 92334c7f577e xen/include/asm-x86/debugreg.h
--- a/xen/include/asm-x86/debugreg.h	Thu Aug 09 16:48:19 2012 +0100
+++ b/xen/include/asm-x86/debugreg.h	Wed Sep 05 12:27:58 2012 +0100
@@ -58,7 +58,7 @@
    We can slow the instruction pipeline for instructions coming via the
    gdt or the ldt if we want to.  I am not sure why this is an advantage */
 
-#define DR_CONTROL_RESERVED_ZERO (0x0000d800ul) /* Reserved, read as zero */
+#define DR_CONTROL_RESERVED_ZERO (~0xffff27fful) /* Reserved, read as zero */
 #define DR_CONTROL_RESERVED_ONE  (0x00000400ul) /* Reserved, read as one */
 #define DR_LOCAL_EXACT_ENABLE    (0x00000100ul) /* Local exact enable */
 #define DR_GLOBAL_EXACT_ENABLE   (0x00000200ul) /* Global exact enable */

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

From xen-changelog-bounces@lists.xen.org Wed Sep 05 21:11:15 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Sep 2012 21:11:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9MsR-0005wh-Rp; Wed, 05 Sep 2012 21:11:11 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9MsR-0005wX-CL
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 21:11:11 +0000
Received: from [85.158.143.99:21648] by server-3.bemta-4.messagelabs.com id
	2D/6E-08232-EEFB7405; Wed, 05 Sep 2012 21:11:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1346879469!23478527!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29007 invoked from network); 5 Sep 2012 21:11:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Sep 2012 21: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 1T9MsO-0000Fj-Q7
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 21:11:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9MsO-0003dz-CE
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 21:11:08 +0000
Message-Id: <E1T9MsO-0003dz-CE@xenbits.xen.org>
Date: Wed, 05 Sep 2012 21:11:07 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] xen: prevent a 64 bit guest
	setting reserved bits in DR7
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1346844478 -3600
# Node ID 92334c7f577e04ab121ee4ce1252ed7edb2a6892
# Parent  228e6f382d5d239d969c04448e045e2b74077f10
xen: prevent a 64 bit guest setting reserved bits in DR7

The upper 32 bits of this register are reserved and should be written as
zero.

This is XSA-12 / CVE-2012-3494

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


diff -r 228e6f382d5d -r 92334c7f577e xen/include/asm-x86/debugreg.h
--- a/xen/include/asm-x86/debugreg.h	Thu Aug 09 16:48:19 2012 +0100
+++ b/xen/include/asm-x86/debugreg.h	Wed Sep 05 12:27:58 2012 +0100
@@ -58,7 +58,7 @@
    We can slow the instruction pipeline for instructions coming via the
    gdt or the ldt if we want to.  I am not sure why this is an advantage */
 
-#define DR_CONTROL_RESERVED_ZERO (0x0000d800ul) /* Reserved, read as zero */
+#define DR_CONTROL_RESERVED_ZERO (~0xffff27fful) /* Reserved, read as zero */
 #define DR_CONTROL_RESERVED_ONE  (0x00000400ul) /* Reserved, read as one */
 #define DR_LOCAL_EXACT_ENABLE    (0x00000100ul) /* Local exact enable */
 #define DR_GLOBAL_EXACT_ENABLE   (0x00000200ul) /* Global exact enable */

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

From xen-changelog-bounces@lists.xen.org Wed Sep 05 21:11:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Sep 2012 21:11:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9MsU-0005x7-0T; Wed, 05 Sep 2012 21:11: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 1T9MsT-0005wn-2n
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 21:11:13 +0000
Received: from [85.158.138.51:21232] by server-9.bemta-3.messagelabs.com id
	B1/E7-15390-FEFB7405; Wed, 05 Sep 2012 21:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1346879469!28904966!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30473 invoked from network); 5 Sep 2012 21:11:10 -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;
	5 Sep 2012 21: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 1T9MsP-0000Fm-6w
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 21:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9MsO-0003eE-Tv
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 21:11:08 +0000
Message-Id: <E1T9MsO-0003eE-Tv@xenbits.xen.org>
Date: Wed, 05 Sep 2012 21:11:08 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] xen: Don't BUG_ON() PoD
	operations on a non-translated guest.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1346844545 -3600
# Node ID 96b08706a0ed4243289d998bfd11f5175f8bde1e
# Parent  92334c7f577e04ab121ee4ce1252ed7edb2a6892
xen: Don't BUG_ON() PoD operations on a non-translated guest.

This is XSA-14 / CVE-2012-3496

Signed-off-by: Tim Deegan <tim@xen.org>
Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
Tested-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 92334c7f577e -r 96b08706a0ed xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Wed Sep 05 12:27:58 2012 +0100
+++ b/xen/arch/x86/mm/p2m.c	Wed Sep 05 12:29:05 2012 +0100
@@ -2058,7 +2058,8 @@ guest_physmap_mark_populate_on_demand(st
     int pod_count = 0;
     int rc = 0;
 
-    BUG_ON(!paging_mode_translate(d));
+    if ( !paging_mode_translate(d) )
+        return -EINVAL;
 
     rc = gfn_check_limit(d, gfn, order);
     if ( rc != 0 )

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

From xen-changelog-bounces@lists.xen.org Wed Sep 05 21:11:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Sep 2012 21:11:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9MsU-0005x7-0T; Wed, 05 Sep 2012 21:11: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 1T9MsT-0005wn-2n
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 21:11:13 +0000
Received: from [85.158.138.51:21232] by server-9.bemta-3.messagelabs.com id
	B1/E7-15390-FEFB7405; Wed, 05 Sep 2012 21:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1346879469!28904966!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30473 invoked from network); 5 Sep 2012 21:11:10 -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;
	5 Sep 2012 21: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 1T9MsP-0000Fm-6w
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 21:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9MsO-0003eE-Tv
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 21:11:08 +0000
Message-Id: <E1T9MsO-0003eE-Tv@xenbits.xen.org>
Date: Wed, 05 Sep 2012 21:11:08 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] xen: Don't BUG_ON() PoD
	operations on a non-translated guest.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1346844545 -3600
# Node ID 96b08706a0ed4243289d998bfd11f5175f8bde1e
# Parent  92334c7f577e04ab121ee4ce1252ed7edb2a6892
xen: Don't BUG_ON() PoD operations on a non-translated guest.

This is XSA-14 / CVE-2012-3496

Signed-off-by: Tim Deegan <tim@xen.org>
Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
Tested-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 92334c7f577e -r 96b08706a0ed xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Wed Sep 05 12:27:58 2012 +0100
+++ b/xen/arch/x86/mm/p2m.c	Wed Sep 05 12:29:05 2012 +0100
@@ -2058,7 +2058,8 @@ guest_physmap_mark_populate_on_demand(st
     int pod_count = 0;
     int rc = 0;
 
-    BUG_ON(!paging_mode_translate(d));
+    if ( !paging_mode_translate(d) )
+        return -EINVAL;
 
     rc = gfn_check_limit(d, gfn, order);
     if ( rc != 0 )

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

From xen-changelog-bounces@lists.xen.org Wed Sep 05 21:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Sep 2012 21:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9MsT-0005x1-UB; Wed, 05 Sep 2012 21:11:13 +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 1T9MsS-0005wm-PN
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 21:11:12 +0000
Received: from [85.158.138.51:21228] by server-5.bemta-3.messagelabs.com id
	A0/1C-13133-FEFB7405; Wed, 05 Sep 2012 21:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-174.messagelabs.com!1346879469!28963022!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10461 invoked from network); 5 Sep 2012 21:11:10 -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;
	5 Sep 2012 21: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 1T9MsP-0000Fp-Ec
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 21:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9MsP-0003eT-CW
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 21:11:09 +0000
Message-Id: <E1T9MsP-0003eT-CW@xenbits.xen.org>
Date: Wed, 05 Sep 2012 21:11:08 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] QEMU_TAG update (XSA-17 /
	CVE-2012-3515)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1346845212 -3600
# Node ID 79444af3258c25576c0fe8b8e1683777e9d68b67
# Parent  96b08706a0ed4243289d998bfd11f5175f8bde1e
QEMU_TAG update (XSA-17 / CVE-2012-3515)
---


diff -r 96b08706a0ed -r 79444af3258c Config.mk
--- a/Config.mk	Wed Sep 05 12:29:05 2012 +0100
+++ b/Config.mk	Wed Sep 05 12:40:12 2012 +0100
@@ -178,9 +178,9 @@ endif
 # CONFIG_QEMU ?= ../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG := xen-4.0.4
-# Thu Feb 2 13:47:06 2012 +0000
-# e1000: bounds packet size against buffer size
+QEMU_TAG := 091149d364e893e643a5da3175c3f84d2163cb3e
+# Wed Sep 5 12:31:40 2012 +0100                                                
+# console: bounds check whenever changing the cursor due to an escape code     
 
 OCAML_XENSTORED_REPO=http://xenbits.xensource.com/ext/xen-ocaml-tools.hg
 

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

From xen-changelog-bounces@lists.xen.org Wed Sep 05 21:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Sep 2012 21:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9MsT-0005x1-UB; Wed, 05 Sep 2012 21:11:13 +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 1T9MsS-0005wm-PN
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 21:11:12 +0000
Received: from [85.158.138.51:21228] by server-5.bemta-3.messagelabs.com id
	A0/1C-13133-FEFB7405; Wed, 05 Sep 2012 21:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-174.messagelabs.com!1346879469!28963022!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10461 invoked from network); 5 Sep 2012 21:11:10 -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;
	5 Sep 2012 21: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 1T9MsP-0000Fp-Ec
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 21:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9MsP-0003eT-CW
	for xen-changelog@lists.xensource.com; Wed, 05 Sep 2012 21:11:09 +0000
Message-Id: <E1T9MsP-0003eT-CW@xenbits.xen.org>
Date: Wed, 05 Sep 2012 21:11:08 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] QEMU_TAG update (XSA-17 /
	CVE-2012-3515)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1346845212 -3600
# Node ID 79444af3258c25576c0fe8b8e1683777e9d68b67
# Parent  96b08706a0ed4243289d998bfd11f5175f8bde1e
QEMU_TAG update (XSA-17 / CVE-2012-3515)
---


diff -r 96b08706a0ed -r 79444af3258c Config.mk
--- a/Config.mk	Wed Sep 05 12:29:05 2012 +0100
+++ b/Config.mk	Wed Sep 05 12:40:12 2012 +0100
@@ -178,9 +178,9 @@ endif
 # CONFIG_QEMU ?= ../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG := xen-4.0.4
-# Thu Feb 2 13:47:06 2012 +0000
-# e1000: bounds packet size against buffer size
+QEMU_TAG := 091149d364e893e643a5da3175c3f84d2163cb3e
+# Wed Sep 5 12:31:40 2012 +0100                                                
+# console: bounds check whenever changing the cursor due to an escape code     
 
 OCAML_XENSTORED_REPO=http://xenbits.xensource.com/ext/xen-ocaml-tools.hg
 

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

From xen-changelog-bounces@lists.xen.org Thu Sep 06 02:33:15 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Sep 2012 02:33:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9Ru1-0005Uc-QB; Thu, 06 Sep 2012 02:33:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1T9Ru0-0005Ti-Cp
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 02:33:08 +0000
Received: from [85.158.138.51:31716] by server-8.bemta-3.messagelabs.com id
	59/02-24700-36B08405; Thu, 06 Sep 2012 02:33:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1346898785!20982516!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14985 invoked from network); 6 Sep 2012 02:33:06 -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;
	6 Sep 2012 02:33:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1T9Rtx-0004aN-9O
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 02:33:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1T9Rtw-0002kr-LB
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 02:33:04 +0000
Date: Thu, 06 Sep 2012 02:33:04 +0000
Message-Id: <E1T9Rtw-0002kr-LB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] console: bounds check
	whenever changing the cursor due to an escape code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 87650d262dea07c955a683dcac75db86477c7ee3
Author: Ian Campbell <ian.campbell@citrix.com>
Date:   Wed Sep 5 13:52:40 2012 +0100

    console: bounds check whenever changing the cursor due to an escape code
    
    This is XSA-17 / CVE-2012-3515
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 console.c |   57 ++++++++++++++++++++++++++++-----------------------------
 1 files changed, 28 insertions(+), 29 deletions(-)

diff --git a/console.c b/console.c
index ed6a653..bfad360 100644
--- a/console.c
+++ b/console.c
@@ -841,6 +841,26 @@ static void console_clear_xy(TextConsole *s, int x, int y)
     update_xy(s, x, y);
 }
 
+/* set cursor, checking bounds */
+static void set_cursor(TextConsole *s, int x, int y)
+{
+    if (x < 0) {
+        x = 0;
+    }
+    if (y < 0) {
+        y = 0;
+    }
+    if (y >= s->height) {
+        y = s->height - 1;
+    }
+    if (x >= s->width) {
+        x = s->width - 1;
+    }
+
+    s->x = x;
+    s->y = y;
+}
+
 static void console_putchar(TextConsole *s, int ch)
 {
     TextCell *c;
@@ -912,7 +932,8 @@ static void console_putchar(TextConsole *s, int ch)
                     s->esc_params[s->nb_esc_params] * 10 + ch - '0';
             }
         } else {
-            s->nb_esc_params++;
+            if (s->nb_esc_params < MAX_ESC_PARAMS)
+                s->nb_esc_params++;
             if (ch == ';')
                 break;
 #ifdef DEBUG_CONSOLE
@@ -926,59 +947,37 @@ static void console_putchar(TextConsole *s, int ch)
                 if (s->esc_params[0] == 0) {
                     s->esc_params[0] = 1;
                 }
-                s->y -= s->esc_params[0];
-                if (s->y < 0) {
-                    s->y = 0;
-                }
+                set_cursor(s, s->x, s->y - s->esc_params[0]);
                 break;
             case 'B':
                 /* move cursor down */
                 if (s->esc_params[0] == 0) {
                     s->esc_params[0] = 1;
                 }
-                s->y += s->esc_params[0];
-                if (s->y >= s->height) {
-                    s->y = s->height - 1;
-                }
+                set_cursor(s, s->x, s->y + s->esc_params[0]);
                 break;
             case 'C':
                 /* move cursor right */
                 if (s->esc_params[0] == 0) {
                     s->esc_params[0] = 1;
                 }
-                s->x += s->esc_params[0];
-                if (s->x >= s->width) {
-                    s->x = s->width - 1;
-                }
+                set_cursor(s, s->x + s->esc_params[0], s->y);
                 break;
             case 'D':
                 /* move cursor left */
                 if (s->esc_params[0] == 0) {
                     s->esc_params[0] = 1;
                 }
-                s->x -= s->esc_params[0];
-                if (s->x < 0) {
-                    s->x = 0;
-                }
+                set_cursor(s, s->x - s->esc_params[0], s->y);
                 break;
             case 'G':
                 /* move cursor to column */
-                s->x = s->esc_params[0] - 1;
-                if (s->x < 0) {
-                    s->x = 0;
-                }
+                set_cursor(s, s->esc_params[0] - 1, s->y);
                 break;
             case 'f':
             case 'H':
                 /* move cursor to row, column */
-                s->x = s->esc_params[1] - 1;
-                if (s->x < 0) {
-                    s->x = 0;
-                }
-                s->y = s->esc_params[0] - 1;
-                if (s->y < 0) {
-                    s->y = 0;
-                }
+                set_cursor(s, s->esc_params[1] - 1, s->esc_params[0] - 1);
                 break;
             case 'J':
                 switch (s->esc_params[0]) {
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

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

From xen-changelog-bounces@lists.xen.org Thu Sep 06 02:33:15 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Sep 2012 02:33:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9Ru1-0005Uc-QB; Thu, 06 Sep 2012 02:33:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1T9Ru0-0005Ti-Cp
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 02:33:08 +0000
Received: from [85.158.138.51:31716] by server-8.bemta-3.messagelabs.com id
	59/02-24700-36B08405; Thu, 06 Sep 2012 02:33:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1346898785!20982516!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14985 invoked from network); 6 Sep 2012 02:33:06 -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;
	6 Sep 2012 02:33:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1T9Rtx-0004aN-9O
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 02:33:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1T9Rtw-0002kr-LB
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 02:33:04 +0000
Date: Thu, 06 Sep 2012 02:33:04 +0000
Message-Id: <E1T9Rtw-0002kr-LB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] console: bounds check
	whenever changing the cursor due to an escape code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 87650d262dea07c955a683dcac75db86477c7ee3
Author: Ian Campbell <ian.campbell@citrix.com>
Date:   Wed Sep 5 13:52:40 2012 +0100

    console: bounds check whenever changing the cursor due to an escape code
    
    This is XSA-17 / CVE-2012-3515
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 console.c |   57 ++++++++++++++++++++++++++++-----------------------------
 1 files changed, 28 insertions(+), 29 deletions(-)

diff --git a/console.c b/console.c
index ed6a653..bfad360 100644
--- a/console.c
+++ b/console.c
@@ -841,6 +841,26 @@ static void console_clear_xy(TextConsole *s, int x, int y)
     update_xy(s, x, y);
 }
 
+/* set cursor, checking bounds */
+static void set_cursor(TextConsole *s, int x, int y)
+{
+    if (x < 0) {
+        x = 0;
+    }
+    if (y < 0) {
+        y = 0;
+    }
+    if (y >= s->height) {
+        y = s->height - 1;
+    }
+    if (x >= s->width) {
+        x = s->width - 1;
+    }
+
+    s->x = x;
+    s->y = y;
+}
+
 static void console_putchar(TextConsole *s, int ch)
 {
     TextCell *c;
@@ -912,7 +932,8 @@ static void console_putchar(TextConsole *s, int ch)
                     s->esc_params[s->nb_esc_params] * 10 + ch - '0';
             }
         } else {
-            s->nb_esc_params++;
+            if (s->nb_esc_params < MAX_ESC_PARAMS)
+                s->nb_esc_params++;
             if (ch == ';')
                 break;
 #ifdef DEBUG_CONSOLE
@@ -926,59 +947,37 @@ static void console_putchar(TextConsole *s, int ch)
                 if (s->esc_params[0] == 0) {
                     s->esc_params[0] = 1;
                 }
-                s->y -= s->esc_params[0];
-                if (s->y < 0) {
-                    s->y = 0;
-                }
+                set_cursor(s, s->x, s->y - s->esc_params[0]);
                 break;
             case 'B':
                 /* move cursor down */
                 if (s->esc_params[0] == 0) {
                     s->esc_params[0] = 1;
                 }
-                s->y += s->esc_params[0];
-                if (s->y >= s->height) {
-                    s->y = s->height - 1;
-                }
+                set_cursor(s, s->x, s->y + s->esc_params[0]);
                 break;
             case 'C':
                 /* move cursor right */
                 if (s->esc_params[0] == 0) {
                     s->esc_params[0] = 1;
                 }
-                s->x += s->esc_params[0];
-                if (s->x >= s->width) {
-                    s->x = s->width - 1;
-                }
+                set_cursor(s, s->x + s->esc_params[0], s->y);
                 break;
             case 'D':
                 /* move cursor left */
                 if (s->esc_params[0] == 0) {
                     s->esc_params[0] = 1;
                 }
-                s->x -= s->esc_params[0];
-                if (s->x < 0) {
-                    s->x = 0;
-                }
+                set_cursor(s, s->x - s->esc_params[0], s->y);
                 break;
             case 'G':
                 /* move cursor to column */
-                s->x = s->esc_params[0] - 1;
-                if (s->x < 0) {
-                    s->x = 0;
-                }
+                set_cursor(s, s->esc_params[0] - 1, s->y);
                 break;
             case 'f':
             case 'H':
                 /* move cursor to row, column */
-                s->x = s->esc_params[1] - 1;
-                if (s->x < 0) {
-                    s->x = 0;
-                }
-                s->y = s->esc_params[0] - 1;
-                if (s->y < 0) {
-                    s->y = 0;
-                }
+                set_cursor(s, s->esc_params[1] - 1, s->esc_params[0] - 1);
                 break;
             case 'J':
                 switch (s->esc_params[0]) {
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

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

From xen-changelog-bounces@lists.xen.org Thu Sep 06 14:11:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Sep 2012 14:11:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9cnZ-0006lI-GE; Thu, 06 Sep 2012 14:11:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9cnY-0006kb-FS
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 14:11:12 +0000
Received: from [85.158.143.99:62175] by server-3.bemta-4.messagelabs.com id
	B8/5E-08232-FFEA8405; Thu, 06 Sep 2012 14:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-216.messagelabs.com!1346940670!25558916!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4072 invoked from network); 6 Sep 2012 14:11: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;
	6 Sep 2012 14:11: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 1T9cnV-0004Tm-2U
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 14:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9cnU-0003Vc-HB
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 14:11:08 +0000
Message-Id: <E1T9cnU-0003Vc-HB@xenbits.xen.org>
Date: Thu, 06 Sep 2012 14:11:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: prevent a 64 bit guest setting
	reserved bits in DR7
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1346844445 -3600
# Node ID 4f1c696482016e7ba76f222c5875618c37680286
# Parent  9dc729b7559535af78209f325c76b16c767ef7bf
xen: prevent a 64 bit guest setting reserved bits in DR7

The upper 32 bits of this register are reserved and should be written as
zero.

This is XSA-12 / CVE-2012-3494

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


diff -r 9dc729b75595 -r 4f1c69648201 xen/include/asm-x86/debugreg.h
--- a/xen/include/asm-x86/debugreg.h	Mon Sep 03 11:22:02 2012 +0100
+++ b/xen/include/asm-x86/debugreg.h	Wed Sep 05 12:27:25 2012 +0100
@@ -58,7 +58,7 @@
    We can slow the instruction pipeline for instructions coming via the
    gdt or the ldt if we want to.  I am not sure why this is an advantage */
 
-#define DR_CONTROL_RESERVED_ZERO (0x0000d800ul) /* Reserved, read as zero */
+#define DR_CONTROL_RESERVED_ZERO (~0xffff27fful) /* Reserved, read as zero */
 #define DR_CONTROL_RESERVED_ONE  (0x00000400ul) /* Reserved, read as one */
 #define DR_LOCAL_EXACT_ENABLE    (0x00000100ul) /* Local exact enable */
 #define DR_GLOBAL_EXACT_ENABLE   (0x00000200ul) /* Global exact enable */

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

From xen-changelog-bounces@lists.xen.org Thu Sep 06 14:11:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Sep 2012 14:11:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9cnZ-0006lI-GE; Thu, 06 Sep 2012 14:11:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9cnY-0006kb-FS
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 14:11:12 +0000
Received: from [85.158.143.99:62175] by server-3.bemta-4.messagelabs.com id
	B8/5E-08232-FFEA8405; Thu, 06 Sep 2012 14:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-216.messagelabs.com!1346940670!25558916!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4072 invoked from network); 6 Sep 2012 14:11: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;
	6 Sep 2012 14:11: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 1T9cnV-0004Tm-2U
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 14:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9cnU-0003Vc-HB
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 14:11:08 +0000
Message-Id: <E1T9cnU-0003Vc-HB@xenbits.xen.org>
Date: Thu, 06 Sep 2012 14:11:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: prevent a 64 bit guest setting
	reserved bits in DR7
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1346844445 -3600
# Node ID 4f1c696482016e7ba76f222c5875618c37680286
# Parent  9dc729b7559535af78209f325c76b16c767ef7bf
xen: prevent a 64 bit guest setting reserved bits in DR7

The upper 32 bits of this register are reserved and should be written as
zero.

This is XSA-12 / CVE-2012-3494

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


diff -r 9dc729b75595 -r 4f1c69648201 xen/include/asm-x86/debugreg.h
--- a/xen/include/asm-x86/debugreg.h	Mon Sep 03 11:22:02 2012 +0100
+++ b/xen/include/asm-x86/debugreg.h	Wed Sep 05 12:27:25 2012 +0100
@@ -58,7 +58,7 @@
    We can slow the instruction pipeline for instructions coming via the
    gdt or the ldt if we want to.  I am not sure why this is an advantage */
 
-#define DR_CONTROL_RESERVED_ZERO (0x0000d800ul) /* Reserved, read as zero */
+#define DR_CONTROL_RESERVED_ZERO (~0xffff27fful) /* Reserved, read as zero */
 #define DR_CONTROL_RESERVED_ONE  (0x00000400ul) /* Reserved, read as one */
 #define DR_LOCAL_EXACT_ENABLE    (0x00000100ul) /* Local exact enable */
 #define DR_GLOBAL_EXACT_ENABLE   (0x00000200ul) /* Global exact enable */

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

From xen-changelog-bounces@lists.xen.org Thu Sep 06 14:11:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Sep 2012 14:11:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9cnZ-0006lC-Ck; Thu, 06 Sep 2012 14:11:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9cnY-0006kV-5C
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 14:11:12 +0000
Received: from [85.158.139.83:17911] by server-6.bemta-5.messagelabs.com id
	AC/D2-21336-FFEA8405; Thu, 06 Sep 2012 14:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-182.messagelabs.com!1346940669!21749957!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2423 invoked from network); 6 Sep 2012 14:11:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Sep 2012 14: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 1T9cnV-0004Tp-CH
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 14:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9cnV-0003Vr-6U
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 14:11:09 +0000
Message-Id: <E1T9cnV-0003Vr-6U@xenbits.xen.org>
Date: Thu, 06 Sep 2012 14:11:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: Don't BUG_ON() PoD operations
	on a non-translated guest.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1346844543 -3600
# Node ID bcf58ef63b7c844fe431eb9e394fc1ea5dd437c4
# Parent  4f1c696482016e7ba76f222c5875618c37680286
xen: Don't BUG_ON() PoD operations on a non-translated guest.

This is XSA-14 / CVE-2012-3496

Signed-off-by: Tim Deegan <tim@xen.org>
Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
Tested-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 4f1c69648201 -r bcf58ef63b7c xen/arch/x86/mm/p2m-pod.c
--- a/xen/arch/x86/mm/p2m-pod.c	Wed Sep 05 12:27:25 2012 +0100
+++ b/xen/arch/x86/mm/p2m-pod.c	Wed Sep 05 12:29:03 2012 +0100
@@ -1117,7 +1117,8 @@ guest_physmap_mark_populate_on_demand(st
     mfn_t omfn;
     int rc = 0;
 
-    BUG_ON(!paging_mode_translate(d));
+    if ( !paging_mode_translate(d) )
+        return -EINVAL;
 
     rc = p2m_gfn_check_limit(d, gfn, order);
     if ( rc != 0 )

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

From xen-changelog-bounces@lists.xen.org Thu Sep 06 14:11:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Sep 2012 14:11:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9cnZ-0006lC-Ck; Thu, 06 Sep 2012 14:11:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9cnY-0006kV-5C
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 14:11:12 +0000
Received: from [85.158.139.83:17911] by server-6.bemta-5.messagelabs.com id
	AC/D2-21336-FFEA8405; Thu, 06 Sep 2012 14:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-182.messagelabs.com!1346940669!21749957!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2423 invoked from network); 6 Sep 2012 14:11:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Sep 2012 14: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 1T9cnV-0004Tp-CH
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 14:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9cnV-0003Vr-6U
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 14:11:09 +0000
Message-Id: <E1T9cnV-0003Vr-6U@xenbits.xen.org>
Date: Thu, 06 Sep 2012 14:11:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: Don't BUG_ON() PoD operations
	on a non-translated guest.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1346844543 -3600
# Node ID bcf58ef63b7c844fe431eb9e394fc1ea5dd437c4
# Parent  4f1c696482016e7ba76f222c5875618c37680286
xen: Don't BUG_ON() PoD operations on a non-translated guest.

This is XSA-14 / CVE-2012-3496

Signed-off-by: Tim Deegan <tim@xen.org>
Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
Tested-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 4f1c69648201 -r bcf58ef63b7c xen/arch/x86/mm/p2m-pod.c
--- a/xen/arch/x86/mm/p2m-pod.c	Wed Sep 05 12:27:25 2012 +0100
+++ b/xen/arch/x86/mm/p2m-pod.c	Wed Sep 05 12:29:03 2012 +0100
@@ -1117,7 +1117,8 @@ guest_physmap_mark_populate_on_demand(st
     mfn_t omfn;
     int rc = 0;
 
-    BUG_ON(!paging_mode_translate(d));
+    if ( !paging_mode_translate(d) )
+        return -EINVAL;
 
     rc = p2m_gfn_check_limit(d, gfn, order);
     if ( rc != 0 )

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

From xen-changelog-bounces@lists.xen.org Thu Sep 06 14:11:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Sep 2012 14:11:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9cna-0006ll-Je; Thu, 06 Sep 2012 14:11:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9cnZ-0006ks-8g
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 14:11:13 +0000
Received: from [85.158.139.83:18109] by server-3.bemta-5.messagelabs.com id
	37/C2-21836-00FA8405; Thu, 06 Sep 2012 14:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-182.messagelabs.com!1346940670!26238336!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20149 invoked from network); 6 Sep 2012 14:11:11 -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;
	6 Sep 2012 14:11: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 1T9cnW-0004Tv-CF
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 14:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9cnW-0003WP-7v
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 14:11:10 +0000
Message-Id: <E1T9cnW-0003WP-7v@xenbits.xen.org>
Date: Thu, 06 Sep 2012 14:11:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen/gnttab: Validate input to
	GNTTABOP_swap_grant_ref
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1346844626 -3600
# Node ID 93e5a791d07628225d836af25bcb45f0197e3cac
# Parent  2750340a347da93fa694bbbf60d71b44fe3b0ca7
xen/gnttab: Validate input to GNTTABOP_swap_grant_ref

xen-unstable c/s 24548:d115844ebfbb introduces a new GNTTABOP to swap
grant refs.  However, it fails to validate the two refs passed from
the guest.

The result is that passing out-of-range refs can cause Xen to read
past the end of the grant_table->active[] array, and deference
whatever it finds.  Typically, this results in Xen trying to deference
a low pointer and fail with a page-fault.

As this hypercall can be issued by an unprivileged guest, this is a
Denial of Service against Xen.  This is XSA-18 / CVE-2012-3516.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Paul Durrant <paul.durrant@citrix.com>
---


diff -r 2750340a347d -r 93e5a791d076 xen/common/grant_table.c
--- a/xen/common/grant_table.c	Wed Sep 05 12:29:52 2012 +0100
+++ b/xen/common/grant_table.c	Wed Sep 05 12:30:26 2012 +0100
@@ -2339,6 +2339,12 @@ __gnttab_swap_grant_ref(grant_ref_t ref_
 
     spin_lock(&gt->lock);
 
+    /* Bounds check on the grant refs */
+    if ( unlikely(ref_a >= nr_grant_entries(d->grant_table)))
+        PIN_FAIL(out, GNTST_bad_gntref, "Bad ref-a (%d).\n", ref_a);
+    if ( unlikely(ref_b >= nr_grant_entries(d->grant_table)))
+        PIN_FAIL(out, GNTST_bad_gntref, "Bad ref-b (%d).\n", ref_b);
+
     act = &active_entry(gt, ref_a);
     if ( act->pin )
         PIN_FAIL(out, GNTST_eagain, "ref a %ld busy\n", (long)ref_a);

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

From xen-changelog-bounces@lists.xen.org Thu Sep 06 14:11:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Sep 2012 14:11:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9cna-0006ll-Je; Thu, 06 Sep 2012 14:11:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9cnZ-0006ks-8g
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 14:11:13 +0000
Received: from [85.158.139.83:18109] by server-3.bemta-5.messagelabs.com id
	37/C2-21836-00FA8405; Thu, 06 Sep 2012 14:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-182.messagelabs.com!1346940670!26238336!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20149 invoked from network); 6 Sep 2012 14:11:11 -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;
	6 Sep 2012 14:11: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 1T9cnW-0004Tv-CF
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 14:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9cnW-0003WP-7v
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 14:11:10 +0000
Message-Id: <E1T9cnW-0003WP-7v@xenbits.xen.org>
Date: Thu, 06 Sep 2012 14:11:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen/gnttab: Validate input to
	GNTTABOP_swap_grant_ref
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1346844626 -3600
# Node ID 93e5a791d07628225d836af25bcb45f0197e3cac
# Parent  2750340a347da93fa694bbbf60d71b44fe3b0ca7
xen/gnttab: Validate input to GNTTABOP_swap_grant_ref

xen-unstable c/s 24548:d115844ebfbb introduces a new GNTTABOP to swap
grant refs.  However, it fails to validate the two refs passed from
the guest.

The result is that passing out-of-range refs can cause Xen to read
past the end of the grant_table->active[] array, and deference
whatever it finds.  Typically, this results in Xen trying to deference
a low pointer and fail with a page-fault.

As this hypercall can be issued by an unprivileged guest, this is a
Denial of Service against Xen.  This is XSA-18 / CVE-2012-3516.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Paul Durrant <paul.durrant@citrix.com>
---


diff -r 2750340a347d -r 93e5a791d076 xen/common/grant_table.c
--- a/xen/common/grant_table.c	Wed Sep 05 12:29:52 2012 +0100
+++ b/xen/common/grant_table.c	Wed Sep 05 12:30:26 2012 +0100
@@ -2339,6 +2339,12 @@ __gnttab_swap_grant_ref(grant_ref_t ref_
 
     spin_lock(&gt->lock);
 
+    /* Bounds check on the grant refs */
+    if ( unlikely(ref_a >= nr_grant_entries(d->grant_table)))
+        PIN_FAIL(out, GNTST_bad_gntref, "Bad ref-a (%d).\n", ref_a);
+    if ( unlikely(ref_b >= nr_grant_entries(d->grant_table)))
+        PIN_FAIL(out, GNTST_bad_gntref, "Bad ref-b (%d).\n", ref_b);
+
     act = &active_entry(gt, ref_a);
     if ( act->pin )
         PIN_FAIL(out, GNTST_eagain, "ref a %ld busy\n", (long)ref_a);

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

From xen-changelog-bounces@lists.xen.org Thu Sep 06 14:11:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Sep 2012 14:11:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9cna-0006ls-Lp; Thu, 06 Sep 2012 14:11:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9cnZ-0006l6-Sl
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 14:11:13 +0000
Received: from [85.158.139.83:18150] by server-9.bemta-5.messagelabs.com id
	2D/51-20529-00FA8405; Thu, 06 Sep 2012 14:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1346940671!28801225!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16165 invoked from network); 6 Sep 2012 14:11:12 -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;
	6 Sep 2012 14:11: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 1T9cnW-0004Ty-Vo
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 14:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9cnW-0003Wf-OZ
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 14:11:10 +0000
Message-Id: <E1T9cnW-0003Wf-OZ@xenbits.xen.org>
Date: Thu, 06 Sep 2012 14:11:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] QEMU_TAG update (XSA-17 /
	CVE-2012-3515)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1346845120 -3600
# Node ID 50adc933faaf65f6e0c93f326f89fa8f979f6ce7
# Parent  93e5a791d07628225d836af25bcb45f0197e3cac
QEMU_TAG update (XSA-17 / CVE-2012-3515)
---


diff -r 93e5a791d076 -r 50adc933faaf Config.mk
--- a/Config.mk	Wed Sep 05 12:30:26 2012 +0100
+++ b/Config.mk	Wed Sep 05 12:38:40 2012 +0100
@@ -214,9 +214,9 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= xen-4.2.0-rc3
-# Tue Aug 14 15:57:49 2012 +0100
-# Revert "qemu-xen-traditional: use O_DIRECT to open disk images for IDE"
+QEMU_TAG ?= a56ae4b5069c7b23ee657b15f08443a9b14a8e7b
+# Wed Sep 5 12:31:40 2012 +0100
+# console: bounds check whenever changing the cursor due to an escape code
 
 # 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.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Sep 06 14:11:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Sep 2012 14:11:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9cna-0006ls-Lp; Thu, 06 Sep 2012 14:11:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9cnZ-0006l6-Sl
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 14:11:13 +0000
Received: from [85.158.139.83:18150] by server-9.bemta-5.messagelabs.com id
	2D/51-20529-00FA8405; Thu, 06 Sep 2012 14:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1346940671!28801225!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16165 invoked from network); 6 Sep 2012 14:11:12 -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;
	6 Sep 2012 14:11: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 1T9cnW-0004Ty-Vo
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 14:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9cnW-0003Wf-OZ
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 14:11:10 +0000
Message-Id: <E1T9cnW-0003Wf-OZ@xenbits.xen.org>
Date: Thu, 06 Sep 2012 14:11:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] QEMU_TAG update (XSA-17 /
	CVE-2012-3515)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1346845120 -3600
# Node ID 50adc933faaf65f6e0c93f326f89fa8f979f6ce7
# Parent  93e5a791d07628225d836af25bcb45f0197e3cac
QEMU_TAG update (XSA-17 / CVE-2012-3515)
---


diff -r 93e5a791d076 -r 50adc933faaf Config.mk
--- a/Config.mk	Wed Sep 05 12:30:26 2012 +0100
+++ b/Config.mk	Wed Sep 05 12:38:40 2012 +0100
@@ -214,9 +214,9 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= xen-4.2.0-rc3
-# Tue Aug 14 15:57:49 2012 +0100
-# Revert "qemu-xen-traditional: use O_DIRECT to open disk images for IDE"
+QEMU_TAG ?= a56ae4b5069c7b23ee657b15f08443a9b14a8e7b
+# Wed Sep 5 12:31:40 2012 +0100
+# console: bounds check whenever changing the cursor due to an escape code
 
 # 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.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Sep 06 14:11:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Sep 2012 14:11:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9cng-0006oT-Oj; Thu, 06 Sep 2012 14:11:20 +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 1T9cnf-0006np-5a
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 14:11:19 +0000
Received: from [85.158.138.51:45479] by server-8.bemta-3.messagelabs.com id
	BF/EA-24700-60FA8405; Thu, 06 Sep 2012 14:11:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-174.messagelabs.com!1346940670!27300691!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21150 invoked from network); 6 Sep 2012 14:11: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;
	6 Sep 2012 14:11: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 1T9cnW-0004Ts-33
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 14:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9cnV-0003W9-NC
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 14:11:09 +0000
Message-Id: <E1T9cnV-0003W9-NC@xenbits.xen.org>
Date: Thu, 06 Sep 2012 14:11:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/pvhvm: properly range-check
	PHYSDEVOP_map_pirq/MAP_PIRQ_TYPE_GSI
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1346844592 -3600
# Node ID 2750340a347da93fa694bbbf60d71b44fe3b0ca7
# Parent  bcf58ef63b7c844fe431eb9e394fc1ea5dd437c4
x86/pvhvm: properly range-check PHYSDEVOP_map_pirq/MAP_PIRQ_TYPE_GSI

This is being used as a array index, and hence must be validated before
use.

This is XSA-16 / CVE-2012-3498.

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


diff -r bcf58ef63b7c -r 2750340a347d xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c	Wed Sep 05 12:29:03 2012 +0100
+++ b/xen/arch/x86/physdev.c	Wed Sep 05 12:29:52 2012 +0100
@@ -42,11 +42,18 @@ static int physdev_hvm_map_pirq(
         struct hvm_girq_dpci_mapping *girq;
         uint32_t machine_gsi = 0;
 
+        if ( *index < 0 || *index >= NR_HVM_IRQS )
+        {
+            ret = -EINVAL;
+            break;
+        }
+
         /* find the machine gsi corresponding to the
          * emulated gsi */
         hvm_irq_dpci = domain_get_irq_dpci(d);
         if ( hvm_irq_dpci )
         {
+            BUILD_BUG_ON(ARRAY_SIZE(hvm_irq_dpci->girq) < NR_HVM_IRQS);
             list_for_each_entry ( girq,
                                   &hvm_irq_dpci->girq[*index],
                                   list )

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

From xen-changelog-bounces@lists.xen.org Thu Sep 06 14:11:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Sep 2012 14:11:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9cng-0006oT-Oj; Thu, 06 Sep 2012 14:11:20 +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 1T9cnf-0006np-5a
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 14:11:19 +0000
Received: from [85.158.138.51:45479] by server-8.bemta-3.messagelabs.com id
	BF/EA-24700-60FA8405; Thu, 06 Sep 2012 14:11:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-174.messagelabs.com!1346940670!27300691!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21150 invoked from network); 6 Sep 2012 14:11: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;
	6 Sep 2012 14:11: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 1T9cnW-0004Ts-33
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 14:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9cnV-0003W9-NC
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 14:11:09 +0000
Message-Id: <E1T9cnV-0003W9-NC@xenbits.xen.org>
Date: Thu, 06 Sep 2012 14:11:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/pvhvm: properly range-check
	PHYSDEVOP_map_pirq/MAP_PIRQ_TYPE_GSI
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1346844592 -3600
# Node ID 2750340a347da93fa694bbbf60d71b44fe3b0ca7
# Parent  bcf58ef63b7c844fe431eb9e394fc1ea5dd437c4
x86/pvhvm: properly range-check PHYSDEVOP_map_pirq/MAP_PIRQ_TYPE_GSI

This is being used as a array index, and hence must be validated before
use.

This is XSA-16 / CVE-2012-3498.

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


diff -r bcf58ef63b7c -r 2750340a347d xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c	Wed Sep 05 12:29:03 2012 +0100
+++ b/xen/arch/x86/physdev.c	Wed Sep 05 12:29:52 2012 +0100
@@ -42,11 +42,18 @@ static int physdev_hvm_map_pirq(
         struct hvm_girq_dpci_mapping *girq;
         uint32_t machine_gsi = 0;
 
+        if ( *index < 0 || *index >= NR_HVM_IRQS )
+        {
+            ret = -EINVAL;
+            break;
+        }
+
         /* find the machine gsi corresponding to the
          * emulated gsi */
         hvm_irq_dpci = domain_get_irq_dpci(d);
         if ( hvm_irq_dpci )
         {
+            BUILD_BUG_ON(ARRAY_SIZE(hvm_irq_dpci->girq) < NR_HVM_IRQS);
             list_for_each_entry ( girq,
                                   &hvm_irq_dpci->girq[*index],
                                   list )

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

From xen-changelog-bounces@lists.xen.org Thu Sep 06 14:11:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Sep 2012 14: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.xen.org>)
	id 1T9cnj-0006pr-RI; Thu, 06 Sep 2012 14:11:23 +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 1T9cni-0006or-3Z
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 14:11:22 +0000
Received: from [85.158.138.51:10317] by server-12.bemta-3.messagelabs.com id
	BA/41-10384-90FA8405; Thu, 06 Sep 2012 14:11:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-174.messagelabs.com!1346940672!20988511!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28666 invoked from network); 6 Sep 2012 14:11:13 -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;
	6 Sep 2012 14:11: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 1T9cnX-0004U4-Tp
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 14:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9cnX-0003XA-PO
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 14:11:11 +0000
Message-Id: <E1T9cnX-0003XA-PO@xenbits.xen.org>
Date: Thu, 06 Sep 2012 14:11:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: fix RCU locking in
	PHYSDEVOP_get_free_pirq
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1346850588 -7200
# Node ID cbc0c2368a6d1984c4d48a9d5554372be8c49e17
# Parent  aa69843f0b0296a684be4167fc1f0d03f0f74779
x86: fix RCU locking in PHYSDEVOP_get_free_pirq

Apart from properly pairing locks with unlocks, also reduce the lock
scope - no need to do the copy_{from,to}_guest()-s inside the protected
region.

I actually wonder whether the RCU locks are needed here at all.

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


diff -r aa69843f0b02 -r cbc0c2368a6d xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c	Wed Sep 05 15:07:42 2012 +0200
+++ b/xen/arch/x86/physdev.c	Wed Sep 05 15:09:48 2012 +0200
@@ -698,13 +698,13 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
         struct physdev_get_free_pirq out;
         struct domain *d;
 
-        d = rcu_lock_current_domain();
-        
         ret = -EFAULT;
         if ( copy_from_guest(&out, arg, 1) != 0 )
             break;
 
+        d = rcu_lock_current_domain();
         spin_lock(&d->event_lock);
+
         ret = get_free_pirq(d, out.type);
         if ( ret >= 0 )
         {
@@ -715,7 +715,9 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
             else
                 ret = -ENOMEM;
         }
+
         spin_unlock(&d->event_lock);
+        rcu_unlock_domain(d);
 
         if ( ret >= 0 )
         {
@@ -723,7 +725,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
             ret = copy_to_guest(arg, &out, 1) ? -EFAULT : 0;
         }
 
-        rcu_unlock_domain(d);
         break;
     }
     default:

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

From xen-changelog-bounces@lists.xen.org Thu Sep 06 14:11:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Sep 2012 14: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.xen.org>)
	id 1T9cnj-0006pr-RI; Thu, 06 Sep 2012 14:11:23 +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 1T9cni-0006or-3Z
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 14:11:22 +0000
Received: from [85.158.138.51:10317] by server-12.bemta-3.messagelabs.com id
	BA/41-10384-90FA8405; Thu, 06 Sep 2012 14:11:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-174.messagelabs.com!1346940672!20988511!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28666 invoked from network); 6 Sep 2012 14:11:13 -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;
	6 Sep 2012 14:11: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 1T9cnX-0004U4-Tp
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 14:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9cnX-0003XA-PO
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 14:11:11 +0000
Message-Id: <E1T9cnX-0003XA-PO@xenbits.xen.org>
Date: Thu, 06 Sep 2012 14:11:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: fix RCU locking in
	PHYSDEVOP_get_free_pirq
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1346850588 -7200
# Node ID cbc0c2368a6d1984c4d48a9d5554372be8c49e17
# Parent  aa69843f0b0296a684be4167fc1f0d03f0f74779
x86: fix RCU locking in PHYSDEVOP_get_free_pirq

Apart from properly pairing locks with unlocks, also reduce the lock
scope - no need to do the copy_{from,to}_guest()-s inside the protected
region.

I actually wonder whether the RCU locks are needed here at all.

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


diff -r aa69843f0b02 -r cbc0c2368a6d xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c	Wed Sep 05 15:07:42 2012 +0200
+++ b/xen/arch/x86/physdev.c	Wed Sep 05 15:09:48 2012 +0200
@@ -698,13 +698,13 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
         struct physdev_get_free_pirq out;
         struct domain *d;
 
-        d = rcu_lock_current_domain();
-        
         ret = -EFAULT;
         if ( copy_from_guest(&out, arg, 1) != 0 )
             break;
 
+        d = rcu_lock_current_domain();
         spin_lock(&d->event_lock);
+
         ret = get_free_pirq(d, out.type);
         if ( ret >= 0 )
         {
@@ -715,7 +715,9 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
             else
                 ret = -ENOMEM;
         }
+
         spin_unlock(&d->event_lock);
+        rcu_unlock_domain(d);
 
         if ( ret >= 0 )
         {
@@ -723,7 +725,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
             ret = copy_to_guest(arg, &out, 1) ? -EFAULT : 0;
         }
 
-        rcu_unlock_domain(d);
         break;
     }
     default:

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

From xen-changelog-bounces@lists.xen.org Thu Sep 06 14:11:37 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Sep 2012 14:11:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9cnw-0006vH-UU; Thu, 06 Sep 2012 14:11:36 +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 1T9cnv-0006sC-EN
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 14:11:35 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-27.messagelabs.com!1346940671!4714492!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24462 invoked from network); 6 Sep 2012 14:11:12 -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;
	6 Sep 2012 14:11: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 1T9cnX-0004U1-G8
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 14:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9cnX-0003Wv-8g
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 14:11:11 +0000
Message-Id: <E1T9cnX-0003Wv-8g@xenbits.xen.org>
Date: Thu, 06 Sep 2012 14:11:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: drop "index" parameter from
	get_free_pirq()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1346850462 -7200
# Node ID aa69843f0b0296a684be4167fc1f0d03f0f74779
# Parent  50adc933faaf65f6e0c93f326f89fa8f979f6ce7
x86: drop "index" parameter from get_free_pirq()

It's unused.

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


diff -r 50adc933faaf -r aa69843f0b02 xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c	Wed Sep 05 12:38:40 2012 +0100
+++ b/xen/arch/x86/irq.c	Wed Sep 05 15:07:42 2012 +0200
@@ -1816,7 +1816,7 @@ static inline bool_t is_free_pirq(const 
         pirq->arch.hvm.emuirq == IRQ_UNBOUND));
 }
 
-int get_free_pirq(struct domain *d, int type, int index)
+int get_free_pirq(struct domain *d, int type)
 {
     int i;
 
diff -r 50adc933faaf -r aa69843f0b02 xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c	Wed Sep 05 12:38:40 2012 +0100
+++ b/xen/arch/x86/physdev.c	Wed Sep 05 15:07:42 2012 +0200
@@ -71,7 +71,7 @@ static int physdev_hvm_map_pirq(
         else
         {
             if ( *pirq < 0 )
-                *pirq = get_free_pirq(d, type, *index);
+                *pirq = get_free_pirq(d, type);
             ret = map_domain_emuirq_pirq(d, *pirq, *index);
         }
         break;
@@ -187,7 +187,7 @@ int physdev_map_pirq(domid_t domid, int 
         }
         else
         {
-            pirq = get_free_pirq(d, type, *index);
+            pirq = get_free_pirq(d, type);
             if ( pirq < 0 )
             {
                 dprintk(XENLOG_G_ERR, "dom%d: no free pirq\n", d->domain_id);
@@ -705,7 +705,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
             break;
 
         spin_lock(&d->event_lock);
-        ret = get_free_pirq(d, out.type, 0);
+        ret = get_free_pirq(d, out.type);
         if ( ret >= 0 )
         {
             struct pirq *info = pirq_get_info(d, ret);
diff -r 50adc933faaf -r aa69843f0b02 xen/include/asm-x86/irq.h
--- a/xen/include/asm-x86/irq.h	Wed Sep 05 12:38:40 2012 +0100
+++ b/xen/include/asm-x86/irq.h	Wed Sep 05 15:07:42 2012 +0200
@@ -136,7 +136,7 @@ int pirq_shared(struct domain *d , int i
 int map_domain_pirq(struct domain *d, int pirq, int irq, int type,
                            void *data);
 int unmap_domain_pirq(struct domain *d, int pirq);
-int get_free_pirq(struct domain *d, int type, int index);
+int get_free_pirq(struct domain *d, int type);
 void free_domain_pirqs(struct domain *d);
 int map_domain_emuirq_pirq(struct domain *d, int pirq, int irq);
 int unmap_domain_pirq_emuirq(struct domain *d, int pirq);

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

From xen-changelog-bounces@lists.xen.org Thu Sep 06 14:11:37 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Sep 2012 14:11:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9cnw-0006vH-UU; Thu, 06 Sep 2012 14:11:36 +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 1T9cnv-0006sC-EN
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 14:11:35 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-27.messagelabs.com!1346940671!4714492!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24462 invoked from network); 6 Sep 2012 14:11:12 -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;
	6 Sep 2012 14:11: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 1T9cnX-0004U1-G8
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 14:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9cnX-0003Wv-8g
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 14:11:11 +0000
Message-Id: <E1T9cnX-0003Wv-8g@xenbits.xen.org>
Date: Thu, 06 Sep 2012 14:11:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: drop "index" parameter from
	get_free_pirq()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1346850462 -7200
# Node ID aa69843f0b0296a684be4167fc1f0d03f0f74779
# Parent  50adc933faaf65f6e0c93f326f89fa8f979f6ce7
x86: drop "index" parameter from get_free_pirq()

It's unused.

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


diff -r 50adc933faaf -r aa69843f0b02 xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c	Wed Sep 05 12:38:40 2012 +0100
+++ b/xen/arch/x86/irq.c	Wed Sep 05 15:07:42 2012 +0200
@@ -1816,7 +1816,7 @@ static inline bool_t is_free_pirq(const 
         pirq->arch.hvm.emuirq == IRQ_UNBOUND));
 }
 
-int get_free_pirq(struct domain *d, int type, int index)
+int get_free_pirq(struct domain *d, int type)
 {
     int i;
 
diff -r 50adc933faaf -r aa69843f0b02 xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c	Wed Sep 05 12:38:40 2012 +0100
+++ b/xen/arch/x86/physdev.c	Wed Sep 05 15:07:42 2012 +0200
@@ -71,7 +71,7 @@ static int physdev_hvm_map_pirq(
         else
         {
             if ( *pirq < 0 )
-                *pirq = get_free_pirq(d, type, *index);
+                *pirq = get_free_pirq(d, type);
             ret = map_domain_emuirq_pirq(d, *pirq, *index);
         }
         break;
@@ -187,7 +187,7 @@ int physdev_map_pirq(domid_t domid, int 
         }
         else
         {
-            pirq = get_free_pirq(d, type, *index);
+            pirq = get_free_pirq(d, type);
             if ( pirq < 0 )
             {
                 dprintk(XENLOG_G_ERR, "dom%d: no free pirq\n", d->domain_id);
@@ -705,7 +705,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
             break;
 
         spin_lock(&d->event_lock);
-        ret = get_free_pirq(d, out.type, 0);
+        ret = get_free_pirq(d, out.type);
         if ( ret >= 0 )
         {
             struct pirq *info = pirq_get_info(d, ret);
diff -r 50adc933faaf -r aa69843f0b02 xen/include/asm-x86/irq.h
--- a/xen/include/asm-x86/irq.h	Wed Sep 05 12:38:40 2012 +0100
+++ b/xen/include/asm-x86/irq.h	Wed Sep 05 15:07:42 2012 +0200
@@ -136,7 +136,7 @@ int pirq_shared(struct domain *d , int i
 int map_domain_pirq(struct domain *d, int pirq, int irq, int type,
                            void *data);
 int unmap_domain_pirq(struct domain *d, int pirq);
-int get_free_pirq(struct domain *d, int type, int index);
+int get_free_pirq(struct domain *d, int type);
 void free_domain_pirqs(struct domain *d);
 int map_domain_emuirq_pirq(struct domain *d, int pirq, int irq);
 int unmap_domain_pirq_emuirq(struct domain *d, int pirq);

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

From xen-changelog-bounces@lists.xen.org Thu Sep 06 16:11:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Sep 2012 16:11:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9efo-0004r4-Tv; Thu, 06 Sep 2012 16:11:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1T9efo-0004qz-E7
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 16:11:20 +0000
Received: from [85.158.139.83:59110] by server-11.bemta-5.messagelabs.com id
	3C/6F-24658-72BC8405; Thu, 06 Sep 2012 16:11:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1346947866!28465820!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27044 invoked from network); 6 Sep 2012 16:11:07 -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;
	6 Sep 2012 16:11:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1T9efZ-0006DT-Su
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 16:11:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1T9efZ-0006f1-35
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 16:11:05 +0000
Date: Thu, 06 Sep 2012 16:11:05 +0000
Message-Id: <E1T9efZ-0006f1-35@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-4.0-testing] Disable qemu monitor by
	default. The qemu monitor is an overly
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit eaa1bd612f50d2f253738ed19e14981e4ede98a5
Author: Ian Jackson <ian.jackson@eu.citrix.com>
Date:   Thu Sep 6 17:05:30 2012 +0100

    Disable qemu monitor by default.  The qemu monitor is an overly
    powerful feature which must be protected from untrusted (guest)
    administrators.
    
    Neither xl nor xend expect qemu to produce this monitor unless it is
    explicitly requested.
    
    This is a security problem, XSA-19.  Previously it was CVE-2007-0998
    in Red Hat but we haven't dealt with it in upstream.  We hope to have
    a new CVE for it here but we don't have one yet.
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit bacc0d302445c75f18f4c826750fb5853b60e7ca)
---
 vl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/vl.c b/vl.c
index a49bf08..c5b605f 100644
--- a/vl.c
+++ b/vl.c
@@ -4901,7 +4901,7 @@ int main(int argc, char **argv, char **envp)
     kernel_cmdline = "";
     cyls = heads = secs = 0;
     translation = BIOS_ATA_TRANSLATION_AUTO;
-    monitor_device = "vc:80Cx24C";
+    monitor_device = "null";
 
     serial_devices[0] = "vc:80Cx24C";
     for(i = 1; i < MAX_SERIAL_PORTS; i++)
--
generated by git-patchbot for /home/xen/git/qemu-xen-4.0-testing.git

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

From xen-changelog-bounces@lists.xen.org Thu Sep 06 16:11:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Sep 2012 16:11:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9efo-0004r4-Tv; Thu, 06 Sep 2012 16:11:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1T9efo-0004qz-E7
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 16:11:20 +0000
Received: from [85.158.139.83:59110] by server-11.bemta-5.messagelabs.com id
	3C/6F-24658-72BC8405; Thu, 06 Sep 2012 16:11:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1346947866!28465820!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27044 invoked from network); 6 Sep 2012 16:11:07 -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;
	6 Sep 2012 16:11:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1T9efZ-0006DT-Su
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 16:11:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1T9efZ-0006f1-35
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 16:11:05 +0000
Date: Thu, 06 Sep 2012 16:11:05 +0000
Message-Id: <E1T9efZ-0006f1-35@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-4.0-testing] Disable qemu monitor by
	default. The qemu monitor is an overly
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit eaa1bd612f50d2f253738ed19e14981e4ede98a5
Author: Ian Jackson <ian.jackson@eu.citrix.com>
Date:   Thu Sep 6 17:05:30 2012 +0100

    Disable qemu monitor by default.  The qemu monitor is an overly
    powerful feature which must be protected from untrusted (guest)
    administrators.
    
    Neither xl nor xend expect qemu to produce this monitor unless it is
    explicitly requested.
    
    This is a security problem, XSA-19.  Previously it was CVE-2007-0998
    in Red Hat but we haven't dealt with it in upstream.  We hope to have
    a new CVE for it here but we don't have one yet.
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit bacc0d302445c75f18f4c826750fb5853b60e7ca)
---
 vl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/vl.c b/vl.c
index a49bf08..c5b605f 100644
--- a/vl.c
+++ b/vl.c
@@ -4901,7 +4901,7 @@ int main(int argc, char **argv, char **envp)
     kernel_cmdline = "";
     cyls = heads = secs = 0;
     translation = BIOS_ATA_TRANSLATION_AUTO;
-    monitor_device = "vc:80Cx24C";
+    monitor_device = "null";
 
     serial_devices[0] = "vc:80Cx24C";
     for(i = 1; i < MAX_SERIAL_PORTS; i++)
--
generated by git-patchbot for /home/xen/git/qemu-xen-4.0-testing.git

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

From xen-changelog-bounces@lists.xen.org Thu Sep 06 16:11:41 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Sep 2012 16:11:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9eg0-0004rc-0Z; Thu, 06 Sep 2012 16:11:32 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1T9efz-0004rW-9f
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 16:11:31 +0000
Received: from [85.158.143.35:61322] by server-1.bemta-4.messagelabs.com id
	51/28-12504-23BC8405; Thu, 06 Sep 2012 16:11:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1346947888!17092709!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28264 invoked from network); 6 Sep 2012 16:11:29 -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;
	6 Sep 2012 16:11:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1T9efw-0006DW-3U
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 16:11:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1T9efv-0006gY-SZ
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 16:11:27 +0000
Date: Thu, 06 Sep 2012 16:11:27 +0000
Message-Id: <E1T9efv-0006gY-SZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-4.1-testing] Disable qemu monitor by
	default. The qemu monitor is an overly
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d7d453f51459b591faa96d1c123b5bfff7c5b6b6
Author: Ian Jackson <ian.jackson@eu.citrix.com>
Date:   Thu Sep 6 17:05:30 2012 +0100

    Disable qemu monitor by default.  The qemu monitor is an overly
    powerful feature which must be protected from untrusted (guest)
    administrators.
    
    Neither xl nor xend expect qemu to produce this monitor unless it is
    explicitly requested.
    
    This is a security problem, XSA-19.  Previously it was CVE-2007-0998
    in Red Hat but we haven't dealt with it in upstream.  We hope to have
    a new CVE for it here but we don't have one yet.
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit bacc0d302445c75f18f4c826750fb5853b60e7ca)
---
 vl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/vl.c b/vl.c
index f07a659..686a9bd 100644
--- a/vl.c
+++ b/vl.c
@@ -4910,7 +4910,7 @@ int main(int argc, char **argv, char **envp)
     kernel_cmdline = "";
     cyls = heads = secs = 0;
     translation = BIOS_ATA_TRANSLATION_AUTO;
-    monitor_device = "vc:80Cx24C";
+    monitor_device = "null";
 
     serial_devices[0] = "vc:80Cx24C";
     for(i = 1; i < MAX_SERIAL_PORTS; i++)
--
generated by git-patchbot for /home/xen/git/qemu-xen-4.1-testing.git

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

From xen-changelog-bounces@lists.xen.org Thu Sep 06 16:11:41 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Sep 2012 16:11:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9eg0-0004rc-0Z; Thu, 06 Sep 2012 16:11:32 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1T9efz-0004rW-9f
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 16:11:31 +0000
Received: from [85.158.143.35:61322] by server-1.bemta-4.messagelabs.com id
	51/28-12504-23BC8405; Thu, 06 Sep 2012 16:11:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1346947888!17092709!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28264 invoked from network); 6 Sep 2012 16:11:29 -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;
	6 Sep 2012 16:11:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1T9efw-0006DW-3U
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 16:11:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1T9efv-0006gY-SZ
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 16:11:27 +0000
Date: Thu, 06 Sep 2012 16:11:27 +0000
Message-Id: <E1T9efv-0006gY-SZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-4.1-testing] Disable qemu monitor by
	default. The qemu monitor is an overly
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d7d453f51459b591faa96d1c123b5bfff7c5b6b6
Author: Ian Jackson <ian.jackson@eu.citrix.com>
Date:   Thu Sep 6 17:05:30 2012 +0100

    Disable qemu monitor by default.  The qemu monitor is an overly
    powerful feature which must be protected from untrusted (guest)
    administrators.
    
    Neither xl nor xend expect qemu to produce this monitor unless it is
    explicitly requested.
    
    This is a security problem, XSA-19.  Previously it was CVE-2007-0998
    in Red Hat but we haven't dealt with it in upstream.  We hope to have
    a new CVE for it here but we don't have one yet.
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit bacc0d302445c75f18f4c826750fb5853b60e7ca)
---
 vl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/vl.c b/vl.c
index f07a659..686a9bd 100644
--- a/vl.c
+++ b/vl.c
@@ -4910,7 +4910,7 @@ int main(int argc, char **argv, char **envp)
     kernel_cmdline = "";
     cyls = heads = secs = 0;
     translation = BIOS_ATA_TRANSLATION_AUTO;
-    monitor_device = "vc:80Cx24C";
+    monitor_device = "null";
 
     serial_devices[0] = "vc:80Cx24C";
     for(i = 1; i < MAX_SERIAL_PORTS; i++)
--
generated by git-patchbot for /home/xen/git/qemu-xen-4.1-testing.git

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

From xen-changelog-bounces@lists.xen.org Thu Sep 06 16:22:11 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Sep 2012 16:22:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9eqF-0005vB-VN; Thu, 06 Sep 2012 16:22:07 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1T9eqE-0005uq-At
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 16:22:06 +0000
Received: from [85.158.139.83:5872] by server-4.bemta-5.messagelabs.com id
	CC/26-23042-DADC8405; Thu, 06 Sep 2012 16:22:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1346948523!28324602!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29656 invoked from network); 6 Sep 2012 16:22:04 -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;
	6 Sep 2012 16:22:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1T9eqB-0006M0-Fw
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 16:22:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1T9eqB-00071N-9Z
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 16:22:03 +0000
Date: Thu, 06 Sep 2012 16:22:03 +0000
Message-Id: <E1T9eqB-00071N-9Z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] Disable qemu monitor by
	default. The qemu monitor is an overly
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bacc0d302445c75f18f4c826750fb5853b60e7ca
Author: Ian Jackson <ian.jackson@eu.citrix.com>
Date:   Thu Sep 6 17:05:30 2012 +0100

    Disable qemu monitor by default.  The qemu monitor is an overly
    powerful feature which must be protected from untrusted (guest)
    administrators.
    
    Neither xl nor xend expect qemu to produce this monitor unless it is
    explicitly requested.
    
    This is a security problem, XSA-19.  Previously it was CVE-2007-0998
    in Red Hat but we haven't dealt with it in upstream.  We hope to have
    a new CVE for it here but we don't have one yet.
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 vl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/vl.c b/vl.c
index d30cb2c..d21c3aa 100644
--- a/vl.c
+++ b/vl.c
@@ -4920,7 +4920,7 @@ int main(int argc, char **argv, char **envp)
     kernel_cmdline = "";
     cyls = heads = secs = 0;
     translation = BIOS_ATA_TRANSLATION_AUTO;
-    monitor_device = "vc:80Cx24C";
+    monitor_device = "null";
 
     serial_devices[0] = "vc:80Cx24C";
     for(i = 1; i < MAX_SERIAL_PORTS; i++)
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Thu Sep 06 16:22:11 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Sep 2012 16:22:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9eqF-0005vB-VN; Thu, 06 Sep 2012 16:22:07 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1T9eqE-0005uq-At
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 16:22:06 +0000
Received: from [85.158.139.83:5872] by server-4.bemta-5.messagelabs.com id
	CC/26-23042-DADC8405; Thu, 06 Sep 2012 16:22:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1346948523!28324602!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29656 invoked from network); 6 Sep 2012 16:22:04 -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;
	6 Sep 2012 16:22:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1T9eqB-0006M0-Fw
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 16:22:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1T9eqB-00071N-9Z
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 16:22:03 +0000
Date: Thu, 06 Sep 2012 16:22:03 +0000
Message-Id: <E1T9eqB-00071N-9Z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] Disable qemu monitor by
	default. The qemu monitor is an overly
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bacc0d302445c75f18f4c826750fb5853b60e7ca
Author: Ian Jackson <ian.jackson@eu.citrix.com>
Date:   Thu Sep 6 17:05:30 2012 +0100

    Disable qemu monitor by default.  The qemu monitor is an overly
    powerful feature which must be protected from untrusted (guest)
    administrators.
    
    Neither xl nor xend expect qemu to produce this monitor unless it is
    explicitly requested.
    
    This is a security problem, XSA-19.  Previously it was CVE-2007-0998
    in Red Hat but we haven't dealt with it in upstream.  We hope to have
    a new CVE for it here but we don't have one yet.
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 vl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/vl.c b/vl.c
index d30cb2c..d21c3aa 100644
--- a/vl.c
+++ b/vl.c
@@ -4920,7 +4920,7 @@ int main(int argc, char **argv, char **envp)
     kernel_cmdline = "";
     cyls = heads = secs = 0;
     translation = BIOS_ATA_TRANSLATION_AUTO;
-    monitor_device = "vc:80Cx24C";
+    monitor_device = "null";
 
     serial_devices[0] = "vc:80Cx24C";
     for(i = 1; i < MAX_SERIAL_PORTS; i++)
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Thu Sep 06 18:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Sep 2012 18:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9gXr-0001dS-AX; Thu, 06 Sep 2012 18:11:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9gXp-0001dB-R8
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 18:11:13 +0000
Received: from [85.158.143.35:24230] by server-1.bemta-4.messagelabs.com id
	DC/C4-12504-147E8405; Thu, 06 Sep 2012 18:11:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-21.messagelabs.com!1346955071!15675194!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21495 invoked from network); 6 Sep 2012 18:11: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;
	6 Sep 2012 18:11: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 1T9gXm-0007cI-R5
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 18:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9gXm-0001Vy-Kx
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 18:11:10 +0000
Message-Id: <E1T9gXm-0001Vy-Kx@xenbits.xen.org>
Date: Thu, 06 Sep 2012 18:11: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/pvhvm: properly range-check
	PHYSDEVOP_map_pirq/MAP_PIRQ_TYPE_GSI
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1346844596 -3600
# Node ID 936f63ee4dadb832222c029e958ae7c7564ec0e8
# Parent  8ebda5388e4e83a69c73bdd7621e76e1de4fc995
x86/pvhvm: properly range-check PHYSDEVOP_map_pirq/MAP_PIRQ_TYPE_GSI

This is being used as a array index, and hence must be validated before
use.

This is XSA-16 / CVE-2012-3498.

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


diff -r 8ebda5388e4e -r 936f63ee4dad xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c	Wed Sep 05 12:29:05 2012 +0100
+++ b/xen/arch/x86/physdev.c	Wed Sep 05 12:29:56 2012 +0100
@@ -40,11 +40,18 @@ static int physdev_hvm_map_pirq(
         struct hvm_girq_dpci_mapping *girq;
         uint32_t machine_gsi = 0;
 
+        if ( map->index < 0 || map->index >= NR_HVM_IRQS )
+        {
+            ret = -EINVAL;
+            break;
+        }
+
         /* find the machine gsi corresponding to the
          * emulated gsi */
         hvm_irq_dpci = domain_get_irq_dpci(d);
         if ( hvm_irq_dpci )
         {
+            BUILD_BUG_ON(ARRAY_SIZE(hvm_irq_dpci->girq) < NR_HVM_IRQS);
             list_for_each_entry ( girq,
                                   &hvm_irq_dpci->girq[map->index],
                                   list )

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

From xen-changelog-bounces@lists.xen.org Thu Sep 06 18:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Sep 2012 18:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9gXr-0001dS-AX; Thu, 06 Sep 2012 18:11:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9gXp-0001dB-R8
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 18:11:13 +0000
Received: from [85.158.143.35:24230] by server-1.bemta-4.messagelabs.com id
	DC/C4-12504-147E8405; Thu, 06 Sep 2012 18:11:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-21.messagelabs.com!1346955071!15675194!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21495 invoked from network); 6 Sep 2012 18:11: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;
	6 Sep 2012 18:11: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 1T9gXm-0007cI-R5
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 18:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9gXm-0001Vy-Kx
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 18:11:10 +0000
Message-Id: <E1T9gXm-0001Vy-Kx@xenbits.xen.org>
Date: Thu, 06 Sep 2012 18:11: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/pvhvm: properly range-check
	PHYSDEVOP_map_pirq/MAP_PIRQ_TYPE_GSI
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1346844596 -3600
# Node ID 936f63ee4dadb832222c029e958ae7c7564ec0e8
# Parent  8ebda5388e4e83a69c73bdd7621e76e1de4fc995
x86/pvhvm: properly range-check PHYSDEVOP_map_pirq/MAP_PIRQ_TYPE_GSI

This is being used as a array index, and hence must be validated before
use.

This is XSA-16 / CVE-2012-3498.

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


diff -r 8ebda5388e4e -r 936f63ee4dad xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c	Wed Sep 05 12:29:05 2012 +0100
+++ b/xen/arch/x86/physdev.c	Wed Sep 05 12:29:56 2012 +0100
@@ -40,11 +40,18 @@ static int physdev_hvm_map_pirq(
         struct hvm_girq_dpci_mapping *girq;
         uint32_t machine_gsi = 0;
 
+        if ( map->index < 0 || map->index >= NR_HVM_IRQS )
+        {
+            ret = -EINVAL;
+            break;
+        }
+
         /* find the machine gsi corresponding to the
          * emulated gsi */
         hvm_irq_dpci = domain_get_irq_dpci(d);
         if ( hvm_irq_dpci )
         {
+            BUILD_BUG_ON(ARRAY_SIZE(hvm_irq_dpci->girq) < NR_HVM_IRQS);
             list_for_each_entry ( girq,
                                   &hvm_irq_dpci->girq[map->index],
                                   list )

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

From xen-changelog-bounces@lists.xen.org Thu Sep 06 18:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Sep 2012 18:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9gXq-0001dL-7j; Thu, 06 Sep 2012 18:11:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9gXp-0001ct-1y
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 18:11:13 +0000
Received: from [85.158.139.83:64795] by server-3.bemta-5.messagelabs.com id
	61/8C-21836-F37E8405; Thu, 06 Sep 2012 18:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-182.messagelabs.com!1346955070!28483676!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22655 invoked from network); 6 Sep 2012 18:11: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;
	6 Sep 2012 18:11: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 1T9gXm-0007cC-02
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 18:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9gXl-0001VU-Kb
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 18:11:09 +0000
Message-Id: <E1T9gXl-0001VU-Kb@xenbits.xen.org>
Date: Thu, 06 Sep 2012 18:11:09 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] xen: handle out-of-pirq condition
	correctly in PHYSDEVOP_get_free_pirq
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1346844497 -3600
# Node ID 6779ddca8593b766ccabcfec294ba10f17e68484
# Parent  bcc3402927311c64cc04e59d3680680b09459da6
xen: handle out-of-pirq condition correctly in PHYSDEVOP_get_free_pirq

This is XSA-13 / CVE-2012-3495

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Jan Beulich <JBeulich@suse.com>
---


diff -r bcc340292731 -r 6779ddca8593 xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c	Wed Sep 05 12:27:54 2012 +0100
+++ b/xen/arch/x86/physdev.c	Wed Sep 05 12:28:17 2012 +0100
@@ -587,11 +587,16 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
             break;
 
         spin_lock(&d->event_lock);
-        out.pirq = get_free_pirq(d, out.type, 0);
-        d->arch.pirq_irq[out.pirq] = PIRQ_ALLOCATED;
+        ret = get_free_pirq(d, out.type, 0);
+        if ( ret >= 0 )
+            d->arch.pirq_irq[ret] = PIRQ_ALLOCATED;
         spin_unlock(&d->event_lock);
 
-        ret = copy_to_guest(arg, &out, 1) ? -EFAULT : 0;
+        if ( ret >= 0 )
+        {
+            out.pirq = ret;
+            ret = copy_to_guest(arg, &out, 1) ? -EFAULT : 0;
+        }
 
         rcu_unlock_domain(d);
         break;

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

From xen-changelog-bounces@lists.xen.org Thu Sep 06 18:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Sep 2012 18:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9gXq-0001dL-7j; Thu, 06 Sep 2012 18:11:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9gXp-0001ct-1y
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 18:11:13 +0000
Received: from [85.158.139.83:64795] by server-3.bemta-5.messagelabs.com id
	61/8C-21836-F37E8405; Thu, 06 Sep 2012 18:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-182.messagelabs.com!1346955070!28483676!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22655 invoked from network); 6 Sep 2012 18:11: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;
	6 Sep 2012 18:11: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 1T9gXm-0007cC-02
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 18:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9gXl-0001VU-Kb
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 18:11:09 +0000
Message-Id: <E1T9gXl-0001VU-Kb@xenbits.xen.org>
Date: Thu, 06 Sep 2012 18:11:09 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] xen: handle out-of-pirq condition
	correctly in PHYSDEVOP_get_free_pirq
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1346844497 -3600
# Node ID 6779ddca8593b766ccabcfec294ba10f17e68484
# Parent  bcc3402927311c64cc04e59d3680680b09459da6
xen: handle out-of-pirq condition correctly in PHYSDEVOP_get_free_pirq

This is XSA-13 / CVE-2012-3495

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Jan Beulich <JBeulich@suse.com>
---


diff -r bcc340292731 -r 6779ddca8593 xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c	Wed Sep 05 12:27:54 2012 +0100
+++ b/xen/arch/x86/physdev.c	Wed Sep 05 12:28:17 2012 +0100
@@ -587,11 +587,16 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
             break;
 
         spin_lock(&d->event_lock);
-        out.pirq = get_free_pirq(d, out.type, 0);
-        d->arch.pirq_irq[out.pirq] = PIRQ_ALLOCATED;
+        ret = get_free_pirq(d, out.type, 0);
+        if ( ret >= 0 )
+            d->arch.pirq_irq[ret] = PIRQ_ALLOCATED;
         spin_unlock(&d->event_lock);
 
-        ret = copy_to_guest(arg, &out, 1) ? -EFAULT : 0;
+        if ( ret >= 0 )
+        {
+            out.pirq = ret;
+            ret = copy_to_guest(arg, &out, 1) ? -EFAULT : 0;
+        }
 
         rcu_unlock_domain(d);
         break;

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

From xen-changelog-bounces@lists.xen.org Thu Sep 06 18:11:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Sep 2012 18:11:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9gXp-0001d2-4z; Thu, 06 Sep 2012 18:11:13 +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 1T9gXo-0001cs-CC
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 18:11:12 +0000
Received: from [85.158.138.51:40809] by server-8.bemta-3.messagelabs.com id
	E7/A5-24700-F37E8405; Thu, 06 Sep 2012 18:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-174.messagelabs.com!1346955069!27347437!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12211 invoked from network); 6 Sep 2012 18:11:10 -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;
	6 Sep 2012 18: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 1T9gXl-0007c9-G5
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 18:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9gXl-0001VF-2Q
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 18:11:09 +0000
Message-Id: <E1T9gXl-0001VF-2Q@xenbits.xen.org>
Date: Thu, 06 Sep 2012 18:11: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: prevent a 64 bit guest
	setting reserved bits in DR7
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1346844474 -3600
# Node ID bcc3402927311c64cc04e59d3680680b09459da6
# Parent  d28a9ba889c02f835df05bc007c2b4828d86cff2
xen: prevent a 64 bit guest setting reserved bits in DR7

The upper 32 bits of this register are reserved and should be written as
zero.

This is XSA-12 / CVE-2012-3494

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


diff -r d28a9ba889c0 -r bcc340292731 xen/include/asm-x86/debugreg.h
--- a/xen/include/asm-x86/debugreg.h	Tue Sep 04 14:56:48 2012 +0200
+++ b/xen/include/asm-x86/debugreg.h	Wed Sep 05 12:27:54 2012 +0100
@@ -58,7 +58,7 @@
    We can slow the instruction pipeline for instructions coming via the
    gdt or the ldt if we want to.  I am not sure why this is an advantage */
 
-#define DR_CONTROL_RESERVED_ZERO (0x0000d800ul) /* Reserved, read as zero */
+#define DR_CONTROL_RESERVED_ZERO (~0xffff27fful) /* Reserved, read as zero */
 #define DR_CONTROL_RESERVED_ONE  (0x00000400ul) /* Reserved, read as one */
 #define DR_LOCAL_EXACT_ENABLE    (0x00000100ul) /* Local exact enable */
 #define DR_GLOBAL_EXACT_ENABLE   (0x00000200ul) /* Global exact enable */

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

From xen-changelog-bounces@lists.xen.org Thu Sep 06 18:11:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Sep 2012 18:11:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9gXp-0001d2-4z; Thu, 06 Sep 2012 18:11:13 +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 1T9gXo-0001cs-CC
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 18:11:12 +0000
Received: from [85.158.138.51:40809] by server-8.bemta-3.messagelabs.com id
	E7/A5-24700-F37E8405; Thu, 06 Sep 2012 18:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-174.messagelabs.com!1346955069!27347437!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12211 invoked from network); 6 Sep 2012 18:11:10 -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;
	6 Sep 2012 18: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 1T9gXl-0007c9-G5
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 18:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9gXl-0001VF-2Q
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 18:11:09 +0000
Message-Id: <E1T9gXl-0001VF-2Q@xenbits.xen.org>
Date: Thu, 06 Sep 2012 18:11: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: prevent a 64 bit guest
	setting reserved bits in DR7
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1346844474 -3600
# Node ID bcc3402927311c64cc04e59d3680680b09459da6
# Parent  d28a9ba889c02f835df05bc007c2b4828d86cff2
xen: prevent a 64 bit guest setting reserved bits in DR7

The upper 32 bits of this register are reserved and should be written as
zero.

This is XSA-12 / CVE-2012-3494

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


diff -r d28a9ba889c0 -r bcc340292731 xen/include/asm-x86/debugreg.h
--- a/xen/include/asm-x86/debugreg.h	Tue Sep 04 14:56:48 2012 +0200
+++ b/xen/include/asm-x86/debugreg.h	Wed Sep 05 12:27:54 2012 +0100
@@ -58,7 +58,7 @@
    We can slow the instruction pipeline for instructions coming via the
    gdt or the ldt if we want to.  I am not sure why this is an advantage */
 
-#define DR_CONTROL_RESERVED_ZERO (0x0000d800ul) /* Reserved, read as zero */
+#define DR_CONTROL_RESERVED_ZERO (~0xffff27fful) /* Reserved, read as zero */
 #define DR_CONTROL_RESERVED_ONE  (0x00000400ul) /* Reserved, read as one */
 #define DR_LOCAL_EXACT_ENABLE    (0x00000100ul) /* Local exact enable */
 #define DR_GLOBAL_EXACT_ENABLE   (0x00000200ul) /* Global exact enable */

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

From xen-changelog-bounces@lists.xen.org Thu Sep 06 18:11:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Sep 2012 18:11:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9gXr-0001dX-Cg; Thu, 06 Sep 2012 18:11:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9gXq-0001dC-1R
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 18:11:14 +0000
Received: from [85.158.139.83:64864] by server-10.bemta-5.messagelabs.com id
	25/5D-10969-147E8405; Thu, 06 Sep 2012 18:11:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-182.messagelabs.com!1346955071!25135744!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3907 invoked from network); 6 Sep 2012 18:11:12 -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;
	6 Sep 2012 18:11: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 1T9gXn-0007cL-6Z
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 18:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9gXn-0001WD-4b
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 18:11:11 +0000
Message-Id: <E1T9gXn-0001WD-4b@xenbits.xen.org>
Date: Thu, 06 Sep 2012 18:11:10 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] QEMU_TAG update (XSA-17 /
	CVE-2012-3515)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1346845210 -3600
# Node ID 3e4782f17f5cf9f4956a947e8235a1a2a46350f3
# Parent  936f63ee4dadb832222c029e958ae7c7564ec0e8
QEMU_TAG update (XSA-17 / CVE-2012-3515)
---


diff -r 936f63ee4dad -r 3e4782f17f5c Config.mk
--- a/Config.mk	Wed Sep 05 12:29:56 2012 +0100
+++ b/Config.mk	Wed Sep 05 12:40:10 2012 +0100
@@ -179,9 +179,9 @@ endif
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= xen-4.1.3
-# Mon Apr 2 17:55:05 2012 +0100
-# qemu-xen-traditional: QDISK fixes
+QEMU_TAG ?= 3220480734832a148d26f7a81f90af61c2ecfdd9
+# Wed Sep 5 12:31:40 2012 +0100                                                
+# console: bounds check whenever changing the cursor due to an escape code     
 
 # Optional components
 XENSTAT_XENTOP     ?= y

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

From xen-changelog-bounces@lists.xen.org Thu Sep 06 18:11:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Sep 2012 18:11:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9gXr-0001dX-Cg; Thu, 06 Sep 2012 18:11:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9gXq-0001dC-1R
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 18:11:14 +0000
Received: from [85.158.139.83:64864] by server-10.bemta-5.messagelabs.com id
	25/5D-10969-147E8405; Thu, 06 Sep 2012 18:11:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-182.messagelabs.com!1346955071!25135744!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3907 invoked from network); 6 Sep 2012 18:11:12 -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;
	6 Sep 2012 18:11: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 1T9gXn-0007cL-6Z
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 18:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9gXn-0001WD-4b
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 18:11:11 +0000
Message-Id: <E1T9gXn-0001WD-4b@xenbits.xen.org>
Date: Thu, 06 Sep 2012 18:11:10 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] QEMU_TAG update (XSA-17 /
	CVE-2012-3515)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1346845210 -3600
# Node ID 3e4782f17f5cf9f4956a947e8235a1a2a46350f3
# Parent  936f63ee4dadb832222c029e958ae7c7564ec0e8
QEMU_TAG update (XSA-17 / CVE-2012-3515)
---


diff -r 936f63ee4dad -r 3e4782f17f5c Config.mk
--- a/Config.mk	Wed Sep 05 12:29:56 2012 +0100
+++ b/Config.mk	Wed Sep 05 12:40:10 2012 +0100
@@ -179,9 +179,9 @@ endif
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= xen-4.1.3
-# Mon Apr 2 17:55:05 2012 +0100
-# qemu-xen-traditional: QDISK fixes
+QEMU_TAG ?= 3220480734832a148d26f7a81f90af61c2ecfdd9
+# Wed Sep 5 12:31:40 2012 +0100                                                
+# console: bounds check whenever changing the cursor due to an escape code     
 
 # Optional components
 XENSTAT_XENTOP     ?= y

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

From xen-changelog-bounces@lists.xen.org Thu Sep 06 18:11:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Sep 2012 18:11:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9gXv-0001eL-FB; Thu, 06 Sep 2012 18:11: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 1T9gXu-0001cy-1O
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 18:11:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-27.messagelabs.com!1346955070!6507338!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10594 invoked from network); 6 Sep 2012 18:11:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Sep 2012 18:11: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 1T9gXm-0007cF-6h
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 18:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9gXm-0001Vj-5C
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 18:11:10 +0000
Message-Id: <E1T9gXm-0001Vj-5C@xenbits.xen.org>
Date: Thu, 06 Sep 2012 18:11:09 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] xen: Don't BUG_ON() PoD
	operations on a non-translated guest.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1346844545 -3600
# Node ID 8ebda5388e4e83a69c73bdd7621e76e1de4fc995
# Parent  6779ddca8593b766ccabcfec294ba10f17e68484
xen: Don't BUG_ON() PoD operations on a non-translated guest.

This is XSA-14 / CVE-2012-3496

Signed-off-by: Tim Deegan <tim@xen.org>
Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
Tested-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 6779ddca8593 -r 8ebda5388e4e xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Wed Sep 05 12:28:17 2012 +0100
+++ b/xen/arch/x86/mm/p2m.c	Wed Sep 05 12:29:05 2012 +0100
@@ -2414,7 +2414,8 @@ guest_physmap_mark_populate_on_demand(st
     int pod_count = 0;
     int rc = 0;
 
-    BUG_ON(!paging_mode_translate(d));
+    if ( !paging_mode_translate(d) )
+        return -EINVAL;
 
     rc = gfn_check_limit(d, gfn, order);
     if ( rc != 0 )

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

From xen-changelog-bounces@lists.xen.org Thu Sep 06 18:11:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Sep 2012 18:11:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9gXv-0001eL-FB; Thu, 06 Sep 2012 18:11: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 1T9gXu-0001cy-1O
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 18:11:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-27.messagelabs.com!1346955070!6507338!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10594 invoked from network); 6 Sep 2012 18:11:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Sep 2012 18:11: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 1T9gXm-0007cF-6h
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 18:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9gXm-0001Vj-5C
	for xen-changelog@lists.xensource.com; Thu, 06 Sep 2012 18:11:10 +0000
Message-Id: <E1T9gXm-0001Vj-5C@xenbits.xen.org>
Date: Thu, 06 Sep 2012 18:11:09 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] xen: Don't BUG_ON() PoD
	operations on a non-translated guest.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1346844545 -3600
# Node ID 8ebda5388e4e83a69c73bdd7621e76e1de4fc995
# Parent  6779ddca8593b766ccabcfec294ba10f17e68484
xen: Don't BUG_ON() PoD operations on a non-translated guest.

This is XSA-14 / CVE-2012-3496

Signed-off-by: Tim Deegan <tim@xen.org>
Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
Tested-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 6779ddca8593 -r 8ebda5388e4e xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Wed Sep 05 12:28:17 2012 +0100
+++ b/xen/arch/x86/mm/p2m.c	Wed Sep 05 12:29:05 2012 +0100
@@ -2414,7 +2414,8 @@ guest_physmap_mark_populate_on_demand(st
     int pod_count = 0;
     int rc = 0;
 
-    BUG_ON(!paging_mode_translate(d));
+    if ( !paging_mode_translate(d) )
+        return -EINVAL;
 
     rc = gfn_check_limit(d, gfn, order);
     if ( rc != 0 )

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

From xen-changelog-bounces@lists.xen.org Fri Sep 07 05:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Sep 2012 05:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9r1A-0008RQ-D9; Fri, 07 Sep 2012 05:22:12 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9r19-0008RL-3p
	for xen-changelog@lists.xensource.com; Fri, 07 Sep 2012 05:22:11 +0000
Received: from [85.158.143.99:46321] by server-1.bemta-4.messagelabs.com id
	D5/0F-12504-28489405; Fri, 07 Sep 2012 05:22:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-216.messagelabs.com!1346995328!25662798!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1037 invoked from network); 7 Sep 2012 05:22: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;
	7 Sep 2012 05:22: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 1T9r16-0007gj-De
	for xen-changelog@lists.xensource.com; Fri, 07 Sep 2012 05:22:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9r16-0000vX-7T
	for xen-changelog@lists.xensource.com; Fri, 07 Sep 2012 05:22:08 +0000
Message-Id: <E1T9r16-0000vX-7T@xenbits.xen.org>
Date: Fri, 07 Sep 2012 05:22:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] QEMU_TAG update (security fix XSA-15)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1346947724 -3600
# Node ID ec23c2a11f6fa55bd0472377a7324d67cdf86248
# Parent  19d367bf07b7687b831c212a57a70e73ea14d3b7
QEMU_TAG update (security fix XSA-15)
---


diff -r 19d367bf07b7 -r ec23c2a11f6f Config.mk
--- a/Config.mk	Thu Sep 06 16:39:01 2012 +0200
+++ b/Config.mk	Thu Sep 06 17:08:44 2012 +0100
@@ -214,9 +214,9 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= a56ae4b5069c7b23ee657b15f08443a9b14a8e7b
-# Wed Sep 5 12:31:40 2012 +0100
-# console: bounds check whenever changing the cursor due to an escape code
+QEMU_TAG ?= bacc0d302445c75f18f4c826750fb5853b60e7ca
+# Thu Sep 6 17:05:30 2012 +0100
+# Disable qemu monitor by default.  The qemu monitor is an overly
 
 # 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.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Sep 07 05:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Sep 2012 05:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9r1A-0008RQ-D9; Fri, 07 Sep 2012 05:22:12 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9r19-0008RL-3p
	for xen-changelog@lists.xensource.com; Fri, 07 Sep 2012 05:22:11 +0000
Received: from [85.158.143.99:46321] by server-1.bemta-4.messagelabs.com id
	D5/0F-12504-28489405; Fri, 07 Sep 2012 05:22:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-216.messagelabs.com!1346995328!25662798!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1037 invoked from network); 7 Sep 2012 05:22: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;
	7 Sep 2012 05:22: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 1T9r16-0007gj-De
	for xen-changelog@lists.xensource.com; Fri, 07 Sep 2012 05:22:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9r16-0000vX-7T
	for xen-changelog@lists.xensource.com; Fri, 07 Sep 2012 05:22:08 +0000
Message-Id: <E1T9r16-0000vX-7T@xenbits.xen.org>
Date: Fri, 07 Sep 2012 05:22:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] QEMU_TAG update (security fix XSA-15)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1346947724 -3600
# Node ID ec23c2a11f6fa55bd0472377a7324d67cdf86248
# Parent  19d367bf07b7687b831c212a57a70e73ea14d3b7
QEMU_TAG update (security fix XSA-15)
---


diff -r 19d367bf07b7 -r ec23c2a11f6f Config.mk
--- a/Config.mk	Thu Sep 06 16:39:01 2012 +0200
+++ b/Config.mk	Thu Sep 06 17:08:44 2012 +0100
@@ -214,9 +214,9 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= a56ae4b5069c7b23ee657b15f08443a9b14a8e7b
-# Wed Sep 5 12:31:40 2012 +0100
-# console: bounds check whenever changing the cursor due to an escape code
+QEMU_TAG ?= bacc0d302445c75f18f4c826750fb5853b60e7ca
+# Thu Sep 6 17:05:30 2012 +0100
+# Disable qemu monitor by default.  The qemu monitor is an overly
 
 # 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.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Sep 07 05:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Sep 2012 05:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9r1C-0008Rc-Fx; Fri, 07 Sep 2012 05:22:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9r1B-0008RX-RK
	for xen-changelog@lists.xensource.com; Fri, 07 Sep 2012 05:22:13 +0000
Received: from [85.158.143.35:53536] by server-2.bemta-4.messagelabs.com id
	2D/AD-21239-58489405; Fri, 07 Sep 2012 05:22:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-21.messagelabs.com!1346995328!15310306!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29252 invoked from network); 7 Sep 2012 05:22:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	7 Sep 2012 05:22: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 1T9r16-0007gh-8C
	for xen-changelog@lists.xensource.com; Fri, 07 Sep 2012 05:22:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9r15-0000vI-Lv
	for xen-changelog@lists.xensource.com; Fri, 07 Sep 2012 05:22:07 +0000
Message-Id: <E1T9r15-0000vI-Lv@xenbits.xen.org>
Date: Fri, 07 Sep 2012 05:22:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] timer: remove stray
	local_irq_enable()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User David Vrabel <david.vrabel@citrix.com>
# Date 1346942341 -7200
# Node ID 19d367bf07b7687b831c212a57a70e73ea14d3b7
# Parent  cbc0c2368a6d1984c4d48a9d5554372be8c49e17
timer: remove stray local_irq_enable()

migrate_timers_from_cpu() has a stray local_irq_enable() that does
nothing (it's immediately after a spin_unlock_irq()) and has no
matching local_irq_disable().

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


diff -r cbc0c2368a6d -r 19d367bf07b7 xen/common/timer.c
--- a/xen/common/timer.c	Wed Sep 05 15:09:48 2012 +0200
+++ b/xen/common/timer.c	Thu Sep 06 16:39:01 2012 +0200
@@ -587,7 +587,6 @@ static void migrate_timers_from_cpu(unsi
 
     spin_unlock(&old_ts->lock);
     spin_unlock_irq(&new_ts->lock);
-    local_irq_enable();
 
     if ( notify )
         cpu_raise_softirq(new_cpu, TIMER_SOFTIRQ);

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

From xen-changelog-bounces@lists.xen.org Fri Sep 07 05:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Sep 2012 05:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1T9r1C-0008Rc-Fx; Fri, 07 Sep 2012 05:22:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9r1B-0008RX-RK
	for xen-changelog@lists.xensource.com; Fri, 07 Sep 2012 05:22:13 +0000
Received: from [85.158.143.35:53536] by server-2.bemta-4.messagelabs.com id
	2D/AD-21239-58489405; Fri, 07 Sep 2012 05:22:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-21.messagelabs.com!1346995328!15310306!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29252 invoked from network); 7 Sep 2012 05:22:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	7 Sep 2012 05:22: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 1T9r16-0007gh-8C
	for xen-changelog@lists.xensource.com; Fri, 07 Sep 2012 05:22:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1T9r15-0000vI-Lv
	for xen-changelog@lists.xensource.com; Fri, 07 Sep 2012 05:22:07 +0000
Message-Id: <E1T9r15-0000vI-Lv@xenbits.xen.org>
Date: Fri, 07 Sep 2012 05:22:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] timer: remove stray
	local_irq_enable()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User David Vrabel <david.vrabel@citrix.com>
# Date 1346942341 -7200
# Node ID 19d367bf07b7687b831c212a57a70e73ea14d3b7
# Parent  cbc0c2368a6d1984c4d48a9d5554372be8c49e17
timer: remove stray local_irq_enable()

migrate_timers_from_cpu() has a stray local_irq_enable() that does
nothing (it's immediately after a spin_unlock_irq()) and has no
matching local_irq_disable().

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


diff -r cbc0c2368a6d -r 19d367bf07b7 xen/common/timer.c
--- a/xen/common/timer.c	Wed Sep 05 15:09:48 2012 +0200
+++ b/xen/common/timer.c	Thu Sep 06 16:39:01 2012 +0200
@@ -587,7 +587,6 @@ static void migrate_timers_from_cpu(unsi
 
     spin_unlock(&old_ts->lock);
     spin_unlock_irq(&new_ts->lock);
-    local_irq_enable();
 
     if ( notify )
         cpu_raise_softirq(new_cpu, TIMER_SOFTIRQ);

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

From xen-changelog-bounces@lists.xen.org Fri Sep 07 17:11:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Sep 2012 17:11:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TA25J-0000AI-II; Fri, 07 Sep 2012 17:11:13 +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 1TA25I-0000A7-AF
	for xen-changelog@lists.xensource.com; Fri, 07 Sep 2012 17:11:12 +0000
Received: from [85.158.138.51:39895] by server-9.bemta-3.messagelabs.com id
	F2/E6-15390-FAA2A405; Fri, 07 Sep 2012 17:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-174.messagelabs.com!1347037869!27556253!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19743 invoked from network); 7 Sep 2012 17:11:10 -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;
	7 Sep 2012 17: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 1TA25F-0008Cy-4k
	for xen-changelog@lists.xensource.com; Fri, 07 Sep 2012 17:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TA25E-0002bn-U6
	for xen-changelog@lists.xensource.com; Fri, 07 Sep 2012 17:11:09 +0000
Message-Id: <E1TA25E-0002bn-U6@xenbits.xen.org>
Date: Fri, 07 Sep 2012 17:11:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Default to non-debug build.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347012586 -3600
# Node ID a64f4e1079510c4cfebb51a9a8e9d94f4d1258b0
# Parent  ec23c2a11f6fa55bd0472377a7324d67cdf86248
Default to non-debug build.

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r ec23c2a11f6f -r a64f4e107951 Config.mk
--- a/Config.mk	Thu Sep 06 17:08:44 2012 +0100
+++ b/Config.mk	Fri Sep 07 11:09:46 2012 +0100
@@ -10,7 +10,7 @@ realpath = $(wildcard $(foreach file,$(1
 -include $(XEN_ROOT)/.config
 
 # A debug build of Xen and tools?
-debug ?= y
+debug ?= n
 debug_symbols ?= $(debug)
 
 XEN_COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/ \

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

From xen-changelog-bounces@lists.xen.org Fri Sep 07 17:11:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Sep 2012 17:11:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TA25J-0000AI-II; Fri, 07 Sep 2012 17:11:13 +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 1TA25I-0000A7-AF
	for xen-changelog@lists.xensource.com; Fri, 07 Sep 2012 17:11:12 +0000
Received: from [85.158.138.51:39895] by server-9.bemta-3.messagelabs.com id
	F2/E6-15390-FAA2A405; Fri, 07 Sep 2012 17:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-174.messagelabs.com!1347037869!27556253!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19743 invoked from network); 7 Sep 2012 17:11:10 -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;
	7 Sep 2012 17: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 1TA25F-0008Cy-4k
	for xen-changelog@lists.xensource.com; Fri, 07 Sep 2012 17:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TA25E-0002bn-U6
	for xen-changelog@lists.xensource.com; Fri, 07 Sep 2012 17:11:09 +0000
Message-Id: <E1TA25E-0002bn-U6@xenbits.xen.org>
Date: Fri, 07 Sep 2012 17:11:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Default to non-debug build.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347012586 -3600
# Node ID a64f4e1079510c4cfebb51a9a8e9d94f4d1258b0
# Parent  ec23c2a11f6fa55bd0472377a7324d67cdf86248
Default to non-debug build.

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r ec23c2a11f6f -r a64f4e107951 Config.mk
--- a/Config.mk	Thu Sep 06 17:08:44 2012 +0100
+++ b/Config.mk	Fri Sep 07 11:09:46 2012 +0100
@@ -10,7 +10,7 @@ realpath = $(wildcard $(foreach file,$(1
 -include $(XEN_ROOT)/.config
 
 # A debug build of Xen and tools?
-debug ?= y
+debug ?= n
 debug_symbols ?= $(debug)
 
 XEN_COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/ \

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

From xen-changelog-bounces@lists.xen.org Mon Sep 10 21:11:15 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Sep 2012 21:11:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TBBGB-0000vr-Ve; Mon, 10 Sep 2012 21:11:11 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBBGB-0000vT-8t
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:11 +0000
Received: from [85.158.143.35:28970] by server-2.bemta-4.messagelabs.com id
	8D/A3-21239-E675E405; Mon, 10 Sep 2012 21:11:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-21.messagelabs.com!1347311468!12447674!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16078 invoked from network); 10 Sep 2012 21:11:09 -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;
	10 Sep 2012 21: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 1TBBG8-0004jt-KD
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBBG8-0007zL-Ia
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:08 +0000
Message-Id: <E1TBBG8-0007zL-Ia@xenbits.xen.org>
Date: Mon, 10 Sep 2012 21:11:08 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Update Xen version to 4.2.0-rc4
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347016090 -3600
# Node ID 68640a3c99cefa86ae70fc49871025864e5671f2
# Parent  a64f4e1079510c4cfebb51a9a8e9d94f4d1258b0
Update Xen version to 4.2.0-rc4
---


diff -r a64f4e107951 -r 68640a3c99ce Config.mk
--- a/Config.mk	Fri Sep 07 11:09:46 2012 +0100
+++ b/Config.mk	Fri Sep 07 12:08:10 2012 +0100
@@ -214,9 +214,7 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= bacc0d302445c75f18f4c826750fb5853b60e7ca
-# Thu Sep 6 17:05:30 2012 +0100
-# Disable qemu monitor by default.  The qemu monitor is an overly
+QEMU_TAG ?= xen-4.2.0-rc4
 
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.
diff -r a64f4e107951 -r 68640a3c99ce xen/Makefile
--- a/xen/Makefile	Fri Sep 07 11:09:46 2012 +0100
+++ b/xen/Makefile	Fri Sep 07 12:08:10 2012 +0100
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 2
-export XEN_EXTRAVERSION ?= .0-rc4-pre$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .0-rc4$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 

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

From xen-changelog-bounces@lists.xen.org Mon Sep 10 21:11:15 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Sep 2012 21:11:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TBBGB-0000vr-Ve; Mon, 10 Sep 2012 21:11:11 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBBGB-0000vT-8t
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:11 +0000
Received: from [85.158.143.35:28970] by server-2.bemta-4.messagelabs.com id
	8D/A3-21239-E675E405; Mon, 10 Sep 2012 21:11:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-21.messagelabs.com!1347311468!12447674!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16078 invoked from network); 10 Sep 2012 21:11:09 -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;
	10 Sep 2012 21: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 1TBBG8-0004jt-KD
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBBG8-0007zL-Ia
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:08 +0000
Message-Id: <E1TBBG8-0007zL-Ia@xenbits.xen.org>
Date: Mon, 10 Sep 2012 21:11:08 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Update Xen version to 4.2.0-rc4
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347016090 -3600
# Node ID 68640a3c99cefa86ae70fc49871025864e5671f2
# Parent  a64f4e1079510c4cfebb51a9a8e9d94f4d1258b0
Update Xen version to 4.2.0-rc4
---


diff -r a64f4e107951 -r 68640a3c99ce Config.mk
--- a/Config.mk	Fri Sep 07 11:09:46 2012 +0100
+++ b/Config.mk	Fri Sep 07 12:08:10 2012 +0100
@@ -214,9 +214,7 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= bacc0d302445c75f18f4c826750fb5853b60e7ca
-# Thu Sep 6 17:05:30 2012 +0100
-# Disable qemu monitor by default.  The qemu monitor is an overly
+QEMU_TAG ?= xen-4.2.0-rc4
 
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.
diff -r a64f4e107951 -r 68640a3c99ce xen/Makefile
--- a/xen/Makefile	Fri Sep 07 11:09:46 2012 +0100
+++ b/xen/Makefile	Fri Sep 07 12:08:10 2012 +0100
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 2
-export XEN_EXTRAVERSION ?= .0-rc4-pre$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .0-rc4$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 

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

From xen-changelog-bounces@lists.xen.org Mon Sep 10 21:11:15 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Sep 2012 21:11:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TBBGB-0000vm-TB; Mon, 10 Sep 2012 21:11:11 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBBGB-0000vR-8X
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:11 +0000
Received: from [85.158.139.83:57629] by server-9.bemta-5.messagelabs.com id
	06/6C-20529-E675E405; Mon, 10 Sep 2012 21:11:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-182.messagelabs.com!1347311468!29156866!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14940 invoked from network); 10 Sep 2012 21:11:09 -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;
	10 Sep 2012 21: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 1TBBG8-0004jq-E3
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBBG7-0007yv-Vf
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:08 +0000
Message-Id: <E1TBBG7-0007yv-Vf@xenbits.xen.org>
Date: Mon, 10 Sep 2012 21:11:07 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Default to non-debug build.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347012586 -3600
# Node ID a64f4e1079510c4cfebb51a9a8e9d94f4d1258b0
# Parent  ec23c2a11f6fa55bd0472377a7324d67cdf86248
Default to non-debug build.

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r ec23c2a11f6f -r a64f4e107951 Config.mk
--- a/Config.mk	Thu Sep 06 17:08:44 2012 +0100
+++ b/Config.mk	Fri Sep 07 11:09:46 2012 +0100
@@ -10,7 +10,7 @@ realpath = $(wildcard $(foreach file,$(1
 -include $(XEN_ROOT)/.config
 
 # A debug build of Xen and tools?
-debug ?= y
+debug ?= n
 debug_symbols ?= $(debug)
 
 XEN_COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/ \

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

From xen-changelog-bounces@lists.xen.org Mon Sep 10 21:11:15 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Sep 2012 21:11:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TBBGB-0000vm-TB; Mon, 10 Sep 2012 21:11:11 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBBGB-0000vR-8X
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:11 +0000
Received: from [85.158.139.83:57629] by server-9.bemta-5.messagelabs.com id
	06/6C-20529-E675E405; Mon, 10 Sep 2012 21:11:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-182.messagelabs.com!1347311468!29156866!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14940 invoked from network); 10 Sep 2012 21:11:09 -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;
	10 Sep 2012 21: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 1TBBG8-0004jq-E3
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBBG7-0007yv-Vf
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:08 +0000
Message-Id: <E1TBBG7-0007yv-Vf@xenbits.xen.org>
Date: Mon, 10 Sep 2012 21:11:07 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Default to non-debug build.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347012586 -3600
# Node ID a64f4e1079510c4cfebb51a9a8e9d94f4d1258b0
# Parent  ec23c2a11f6fa55bd0472377a7324d67cdf86248
Default to non-debug build.

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r ec23c2a11f6f -r a64f4e107951 Config.mk
--- a/Config.mk	Thu Sep 06 17:08:44 2012 +0100
+++ b/Config.mk	Fri Sep 07 11:09:46 2012 +0100
@@ -10,7 +10,7 @@ realpath = $(wildcard $(foreach file,$(1
 -include $(XEN_ROOT)/.config
 
 # A debug build of Xen and tools?
-debug ?= y
+debug ?= n
 debug_symbols ?= $(debug)
 
 XEN_COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/ \

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

From xen-changelog-bounces@lists.xen.org Mon Sep 10 21:11:15 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Sep 2012 21:11:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TBBGD-0000w6-1t; Mon, 10 Sep 2012 21:11:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBBGC-0000vT-7u
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:12 +0000
Received: from [85.158.143.35:29019] by server-2.bemta-4.messagelabs.com id
	21/B3-21239-0775E405; Mon, 10 Sep 2012 21:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-21.messagelabs.com!1347311470!11776426!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.3 required=7.0 tests=ML_MARKETING,
  UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7198 invoked from network); 10 Sep 2012 21:11:11 -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;
	10 Sep 2012 21:11: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 1TBBG9-0004jz-Sg
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBBG9-0007zv-LU
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:09 +0000
Message-Id: <E1TBBG9-0007zv-LU@xenbits.xen.org>
Date: Mon, 10 Sep 2012 21:11:09 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Added signature for changeset
	68640a3c99ce
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347016726 -3600
# Node ID 528f0708b6db392e10303b7ed2ab529bb8b512b7
# Parent  cee7440c39ae51822b03b1331845661f788e628a
Added signature for changeset 68640a3c99ce
---


diff -r cee7440c39ae -r 528f0708b6db .hgsigs
--- a/.hgsigs	Fri Sep 07 12:08:27 2012 +0100
+++ b/.hgsigs	Fri Sep 07 12:18:46 2012 +0100
@@ -8,3 +8,4 @@ 6241fa0ad1a939d2eba11bdec929564276f56a9e
 8e620dc570ce42564c1630de5798e23909ee809c 0 iQEcBAABAgAGBQJQFqUYAAoJEIP+FMlX6CvZDGEH/jxUFG29okRASHY6XwFrJ4AU7tLyC8Bt2vAH3ZaA/h1Tn2GWkQXf4tzBAvvwWNBrm1hdj73OaB7dD2l2kvL551AhoSd4/5z+pPtpC72ItwFFTr3Ep9GRZEvEHculuei5IUzw1lxZuNCPCScBxQl+KI+dZHIeP0YO46VZTtG+EeBlj0SJ7JojKN4REd382eIgSLvpEFHCM6vqeCWM9FtDyomiMXdSosDLcWdFauFmV7cdWybA5WPj6bkJenABwX0A1V9uf225S0DTdO0t/7ncZ8h+wXTzqiixywA+lqza+u+HzNyopWmwiFcseFZjuHbKx6M2v0EvKPBcyTgdRZF/+Kg=
 f4c47bcc01e13cb2e3b4b71fd588d86278875442 0 iQEcBAABAgAGBQJQIpupAAoJEIP+FMlX6CvZnBwH/3qlibrquTmD2p3rcdVi/JkWixaKK3KH4Ows/76sAJYCdx9YkmtkgC4zyz5aph4Rfy7dYnQIUhbwNNdZNBDd0XOVkjQm0ZX1wQjv3yA3Eq9NOUDmfFWldF+oosOG3h/+MLm/36CkB7gFku1ENQ8kagytXe4rN3QdOiJ9Rz84BAv6nJoT/1OX+m+MlBs948orC23aNEfWxrsrv2s92v5fJcAfSLW/AtER2JnASIxWECJ/TOkuHtrO2QPoBymSnifM2R624L+ySwRxSxo+Owfpooje5eekk0ekifvdYtaJ3pOfoOCv8yGEtb7mXv62WowVkasUZa/q+rGdVpHuK0UlBjI=
 d44f290e81df5f78f0e3545742e3c4ff5415b0a7 0 iQEcBAABAgAGBQJQNji7AAoJEIP+FMlX6CvZvBcIAJPiA6ydvolYCvZsfGgafqCpcpG3f+PbUOwQRWfUcaKHPWFKnwRkmx9MAP9tEjXFNZcbimktDrofmee6XfLb8NLnCcHWZT8trRXYTNw2lM6DpK+AROUpAcShF3gCHQEtCJC6+NArD75aUkUji3awbGlhplHbyWvgvSSULhga+2xfYszRC7eI/g+7/f4JNkvqeWllAtd9fwftXaGhQi2V4LT5IimpJI7PivlDi0wi+BtqXHcmZhlnw3zpR51NRujsMVTNZMqe733kGdt8Y8j3vvsfXBye4+YAkEKFrzW3jTYlA9ws71oNVvWmwmOjOHpx6ASfquP3hhAoiHvb2c6Wims=
+68640a3c99cefa86ae70fc49871025864e5671f2 0 iQEcBAABAgAGBQJQSdgUAAoJEIP+FMlX6CvZeWUH/1SeYnKXtkt7n+WuMyF2LvCzZQApmOo+hqVB7m0Pe4Yh9bEq1PAE+sJOAoQIBklCpY3WFsNGQN8yIbYyWRzbIM7oavknwoUoSn50zMk12HczqHigXvhL/eOghRKNsK9BrQnRV+byNHRjzSHPReNxpzueKBOTrCMlXtYMDb94swc+hatEDItT4TwZcaNPri3kiWND0DPmOk58Ke96ml9rpomS1ff976hYAZl+N1Q3Pt998SXiaglZ9EeL0Y8cY759XqZII4D4o6/oQW8MzWrQZr4woHHU7MfK3OWslelzP486esHyyjotEWeelhgl/RjIl0crNBbmCWU15BOAw7wSZh4=

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

From xen-changelog-bounces@lists.xen.org Mon Sep 10 21:11:15 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Sep 2012 21:11:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TBBGD-0000w6-1t; Mon, 10 Sep 2012 21:11:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBBGC-0000vT-7u
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:12 +0000
Received: from [85.158.143.35:29019] by server-2.bemta-4.messagelabs.com id
	21/B3-21239-0775E405; Mon, 10 Sep 2012 21:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-21.messagelabs.com!1347311470!11776426!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.3 required=7.0 tests=ML_MARKETING,
  UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7198 invoked from network); 10 Sep 2012 21:11:11 -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;
	10 Sep 2012 21:11: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 1TBBG9-0004jz-Sg
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBBG9-0007zv-LU
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:09 +0000
Message-Id: <E1TBBG9-0007zv-LU@xenbits.xen.org>
Date: Mon, 10 Sep 2012 21:11:09 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Added signature for changeset
	68640a3c99ce
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347016726 -3600
# Node ID 528f0708b6db392e10303b7ed2ab529bb8b512b7
# Parent  cee7440c39ae51822b03b1331845661f788e628a
Added signature for changeset 68640a3c99ce
---


diff -r cee7440c39ae -r 528f0708b6db .hgsigs
--- a/.hgsigs	Fri Sep 07 12:08:27 2012 +0100
+++ b/.hgsigs	Fri Sep 07 12:18:46 2012 +0100
@@ -8,3 +8,4 @@ 6241fa0ad1a939d2eba11bdec929564276f56a9e
 8e620dc570ce42564c1630de5798e23909ee809c 0 iQEcBAABAgAGBQJQFqUYAAoJEIP+FMlX6CvZDGEH/jxUFG29okRASHY6XwFrJ4AU7tLyC8Bt2vAH3ZaA/h1Tn2GWkQXf4tzBAvvwWNBrm1hdj73OaB7dD2l2kvL551AhoSd4/5z+pPtpC72ItwFFTr3Ep9GRZEvEHculuei5IUzw1lxZuNCPCScBxQl+KI+dZHIeP0YO46VZTtG+EeBlj0SJ7JojKN4REd382eIgSLvpEFHCM6vqeCWM9FtDyomiMXdSosDLcWdFauFmV7cdWybA5WPj6bkJenABwX0A1V9uf225S0DTdO0t/7ncZ8h+wXTzqiixywA+lqza+u+HzNyopWmwiFcseFZjuHbKx6M2v0EvKPBcyTgdRZF/+Kg=
 f4c47bcc01e13cb2e3b4b71fd588d86278875442 0 iQEcBAABAgAGBQJQIpupAAoJEIP+FMlX6CvZnBwH/3qlibrquTmD2p3rcdVi/JkWixaKK3KH4Ows/76sAJYCdx9YkmtkgC4zyz5aph4Rfy7dYnQIUhbwNNdZNBDd0XOVkjQm0ZX1wQjv3yA3Eq9NOUDmfFWldF+oosOG3h/+MLm/36CkB7gFku1ENQ8kagytXe4rN3QdOiJ9Rz84BAv6nJoT/1OX+m+MlBs948orC23aNEfWxrsrv2s92v5fJcAfSLW/AtER2JnASIxWECJ/TOkuHtrO2QPoBymSnifM2R624L+ySwRxSxo+Owfpooje5eekk0ekifvdYtaJ3pOfoOCv8yGEtb7mXv62WowVkasUZa/q+rGdVpHuK0UlBjI=
 d44f290e81df5f78f0e3545742e3c4ff5415b0a7 0 iQEcBAABAgAGBQJQNji7AAoJEIP+FMlX6CvZvBcIAJPiA6ydvolYCvZsfGgafqCpcpG3f+PbUOwQRWfUcaKHPWFKnwRkmx9MAP9tEjXFNZcbimktDrofmee6XfLb8NLnCcHWZT8trRXYTNw2lM6DpK+AROUpAcShF3gCHQEtCJC6+NArD75aUkUji3awbGlhplHbyWvgvSSULhga+2xfYszRC7eI/g+7/f4JNkvqeWllAtd9fwftXaGhQi2V4LT5IimpJI7PivlDi0wi+BtqXHcmZhlnw3zpR51NRujsMVTNZMqe733kGdt8Y8j3vvsfXBye4+YAkEKFrzW3jTYlA9ws71oNVvWmwmOjOHpx6ASfquP3hhAoiHvb2c6Wims=
+68640a3c99cefa86ae70fc49871025864e5671f2 0 iQEcBAABAgAGBQJQSdgUAAoJEIP+FMlX6CvZeWUH/1SeYnKXtkt7n+WuMyF2LvCzZQApmOo+hqVB7m0Pe4Yh9bEq1PAE+sJOAoQIBklCpY3WFsNGQN8yIbYyWRzbIM7oavknwoUoSn50zMk12HczqHigXvhL/eOghRKNsK9BrQnRV+byNHRjzSHPReNxpzueKBOTrCMlXtYMDb94swc+hatEDItT4TwZcaNPri3kiWND0DPmOk58Ke96ml9rpomS1ff976hYAZl+N1Q3Pt998SXiaglZ9EeL0Y8cY759XqZII4D4o6/oQW8MzWrQZr4woHHU7MfK3OWslelzP486esHyyjotEWeelhgl/RjIl0crNBbmCWU15BOAw7wSZh4=

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

From xen-changelog-bounces@lists.xen.org Mon Sep 10 21:11:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Sep 2012 21:11:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TBBGF-0000wy-6z; Mon, 10 Sep 2012 21:11:15 +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 1TBBGE-0000wL-60
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:14 +0000
Received: from [85.158.138.51:27276] by server-10.bemta-3.messagelabs.com id
	31/57-10411-1775E405; Mon, 10 Sep 2012 21:11:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1347311471!29681309!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9988 invoked from network); 10 Sep 2012 21:11:12 -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;
	10 Sep 2012 21:11: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 1TBBGB-0004k8-8M
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBBGB-00080h-79
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:11 +0000
Message-Id: <E1TBBGB-00080h-79@xenbits.xen.org>
Date: Mon, 10 Sep 2012 21:11:10 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Empty commit to force test run
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1347273165 -3600
# Node ID 459de989c6a1e8fb8b51493174df6fc96885af31
# Parent  9a656466884857e4115eee3e2298b3b9171beebd
Empty commit to force test run

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

From xen-changelog-bounces@lists.xen.org Mon Sep 10 21:11:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Sep 2012 21:11:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TBBGF-0000wy-6z; Mon, 10 Sep 2012 21:11:15 +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 1TBBGE-0000wL-60
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:14 +0000
Received: from [85.158.138.51:27276] by server-10.bemta-3.messagelabs.com id
	31/57-10411-1775E405; Mon, 10 Sep 2012 21:11:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1347311471!29681309!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9988 invoked from network); 10 Sep 2012 21:11:12 -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;
	10 Sep 2012 21:11: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 1TBBGB-0004k8-8M
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBBGB-00080h-79
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:11 +0000
Message-Id: <E1TBBGB-00080h-79@xenbits.xen.org>
Date: Mon, 10 Sep 2012 21:11:10 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Empty commit to force test run
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1347273165 -3600
# Node ID 459de989c6a1e8fb8b51493174df6fc96885af31
# Parent  9a656466884857e4115eee3e2298b3b9171beebd
Empty commit to force test run

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

From xen-changelog-bounces@lists.xen.org Mon Sep 10 21:11:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Sep 2012 21:11:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TBBGG-0000yF-CG; Mon, 10 Sep 2012 21:11:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBBGF-0000wg-6X
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:15 +0000
Received: from [85.158.139.83:57800] by server-2.bemta-5.messagelabs.com id
	13/42-11456-2775E405; Mon, 10 Sep 2012 21:11:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1347311472!29015927!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17352 invoked from network); 10 Sep 2012 21:11:13 -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;
	10 Sep 2012 21:11: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 1TBBGC-0004kE-8t
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBBGC-00081B-7f
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:12 +0000
Message-Id: <E1TBBGC-00081B-7f@xenbits.xen.org>
Date: Mon, 10 Sep 2012 21:11:11 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Force test run by pushing
	net-empty commit-pair
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1347273266 -3600
# Node ID c7c84f9e2fd87530bae9c8a4701e49f08eddadb6
# Parent  2a061d2f6cd78dff9ffecfb17620bad88aaddd0e
Force test run by pushing net-empty commit-pair

Remove file "dummy"

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

From xen-changelog-bounces@lists.xen.org Mon Sep 10 21:11:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Sep 2012 21:11:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TBBGG-0000yF-CG; Mon, 10 Sep 2012 21:11:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBBGF-0000wg-6X
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:15 +0000
Received: from [85.158.139.83:57800] by server-2.bemta-5.messagelabs.com id
	13/42-11456-2775E405; Mon, 10 Sep 2012 21:11:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1347311472!29015927!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17352 invoked from network); 10 Sep 2012 21:11:13 -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;
	10 Sep 2012 21:11: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 1TBBGC-0004kE-8t
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBBGC-00081B-7f
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:12 +0000
Message-Id: <E1TBBGC-00081B-7f@xenbits.xen.org>
Date: Mon, 10 Sep 2012 21:11:11 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Force test run by pushing
	net-empty commit-pair
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1347273266 -3600
# Node ID c7c84f9e2fd87530bae9c8a4701e49f08eddadb6
# Parent  2a061d2f6cd78dff9ffecfb17620bad88aaddd0e
Force test run by pushing net-empty commit-pair

Remove file "dummy"

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

From xen-changelog-bounces@lists.xen.org Mon Sep 10 21:11:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Sep 2012 21:11:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TBBGF-0000ws-4H; Mon, 10 Sep 2012 21:11:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBBGD-0000w7-HW
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:13 +0000
Received: from [85.158.143.99:9104] by server-3.bemta-4.messagelabs.com id
	78/67-08232-0775E405; Mon, 10 Sep 2012 21:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-216.messagelabs.com!1347311471!22071234!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3130 invoked from network); 10 Sep 2012 21:11:12 -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;
	10 Sep 2012 21:11: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 1TBBGA-0004k5-OO
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBBGA-00080Q-N4
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:10 +0000
Message-Id: <E1TBBGA-00080Q-N4@xenbits.xen.org>
Date: Mon, 10 Sep 2012 21:11:10 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] docs: remove WIP notice from
	command line docs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1347023227 -7200
# Node ID 9a656466884857e4115eee3e2298b3b9171beebd
# Parent  4edec34863d6cc8a6993b377f458b0129f5658df
docs: remove WIP notice from command line docs

I'm sure they aren't perfect but various people have done a pass over
them recently and they are much improved. I don't think we need to
continue to describe them so pessimistically.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
xen-unstable changeset: 25832:e3b51948114e
xen-unstable date: Fri Sep  7 12:44:21 UTC 2012
---


diff -r 4edec34863d6 -r 9a6564668848 docs/misc/xen-command-line.markdown
--- a/docs/misc/xen-command-line.markdown	Fri Sep 07 12:22:44 2012 +0100
+++ b/docs/misc/xen-command-line.markdown	Fri Sep 07 15:07:07 2012 +0200
@@ -1,10 +1,5 @@
 # Xen Hypervisor Command Line Options
 
-**This document is still a work in progress.  There are currently some
-  command line options listed twice, and they are defined in separate
-  arch trees, and some options are currently separate from their
-  legacy versions.  Please remove this notice when complete.**
-
 This document covers the command line options which the Xen
 Hypervisor.
 

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

From xen-changelog-bounces@lists.xen.org Mon Sep 10 21:11:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Sep 2012 21:11:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TBBGF-0000ws-4H; Mon, 10 Sep 2012 21:11:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBBGD-0000w7-HW
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:13 +0000
Received: from [85.158.143.99:9104] by server-3.bemta-4.messagelabs.com id
	78/67-08232-0775E405; Mon, 10 Sep 2012 21:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-216.messagelabs.com!1347311471!22071234!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3130 invoked from network); 10 Sep 2012 21:11:12 -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;
	10 Sep 2012 21:11: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 1TBBGA-0004k5-OO
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBBGA-00080Q-N4
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:10 +0000
Message-Id: <E1TBBGA-00080Q-N4@xenbits.xen.org>
Date: Mon, 10 Sep 2012 21:11:10 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] docs: remove WIP notice from
	command line docs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1347023227 -7200
# Node ID 9a656466884857e4115eee3e2298b3b9171beebd
# Parent  4edec34863d6cc8a6993b377f458b0129f5658df
docs: remove WIP notice from command line docs

I'm sure they aren't perfect but various people have done a pass over
them recently and they are much improved. I don't think we need to
continue to describe them so pessimistically.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
xen-unstable changeset: 25832:e3b51948114e
xen-unstable date: Fri Sep  7 12:44:21 UTC 2012
---


diff -r 4edec34863d6 -r 9a6564668848 docs/misc/xen-command-line.markdown
--- a/docs/misc/xen-command-line.markdown	Fri Sep 07 12:22:44 2012 +0100
+++ b/docs/misc/xen-command-line.markdown	Fri Sep 07 15:07:07 2012 +0200
@@ -1,10 +1,5 @@
 # Xen Hypervisor Command Line Options
 
-**This document is still a work in progress.  There are currently some
-  command line options listed twice, and they are defined in separate
-  arch trees, and some options are currently separate from their
-  legacy versions.  Please remove this notice when complete.**
-
 This document covers the command line options which the Xen
 Hypervisor.
 

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

From xen-changelog-bounces@lists.xen.org Mon Sep 10 21:11:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Sep 2012 21:11:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TBBGG-0000yA-9b; Mon, 10 Sep 2012 21:11:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBBGE-0000wU-Mo
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:14 +0000
Received: from [85.158.139.83:57777] by server-7.bemta-5.messagelabs.com id
	2E/79-19703-1775E405; Mon, 10 Sep 2012 21:11:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-182.messagelabs.com!1347311472!22465344!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14085 invoked from network); 10 Sep 2012 21:11:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Sep 2012 21:11: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 1TBBGB-0004kB-Ot
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBBGB-00080w-NX
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:11 +0000
Message-Id: <E1TBBGB-00080w-NX@xenbits.xen.org>
Date: Mon, 10 Sep 2012 21:11:11 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Force test run by pushing
	net-empty commit-pair
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1347273245 -3600
# Node ID 2a061d2f6cd78dff9ffecfb17620bad88aaddd0e
# Parent  459de989c6a1e8fb8b51493174df6fc96885af31
Force test run by pushing net-empty commit-pair

Add file "dummy"

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

From xen-changelog-bounces@lists.xen.org Mon Sep 10 21:11:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Sep 2012 21:11:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TBBGG-0000yA-9b; Mon, 10 Sep 2012 21:11:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBBGE-0000wU-Mo
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:14 +0000
Received: from [85.158.139.83:57777] by server-7.bemta-5.messagelabs.com id
	2E/79-19703-1775E405; Mon, 10 Sep 2012 21:11:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-182.messagelabs.com!1347311472!22465344!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14085 invoked from network); 10 Sep 2012 21:11:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Sep 2012 21:11: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 1TBBGB-0004kB-Ot
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBBGB-00080w-NX
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:11 +0000
Message-Id: <E1TBBGB-00080w-NX@xenbits.xen.org>
Date: Mon, 10 Sep 2012 21:11:11 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Force test run by pushing
	net-empty commit-pair
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1347273245 -3600
# Node ID 2a061d2f6cd78dff9ffecfb17620bad88aaddd0e
# Parent  459de989c6a1e8fb8b51493174df6fc96885af31
Force test run by pushing net-empty commit-pair

Add file "dummy"

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

From xen-changelog-bounces@lists.xen.org Mon Sep 10 21:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Sep 2012 21:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TBBGH-0000yq-Ee; Mon, 10 Sep 2012 21:11:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBBGG-0000vT-05
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:16 +0000
Received: from [85.158.143.99:19075] by server-2.bemta-4.messagelabs.com id
	D7/C3-21239-3775E405; Mon, 10 Sep 2012 21:11:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-216.messagelabs.com!1347311473!22581636!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=ML_RADAR_SPEW_LINKS_23,
	spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 698 invoked from network); 10 Sep 2012 21:11:14 -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;
	10 Sep 2012 21:11: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 1TBBGC-0004kH-Ub
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBBGC-00081Q-QW
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:12 +0000
Message-Id: <E1TBBGC-00081Q-QW@xenbits.xen.org>
Date: Mon, 10 Sep 2012 21:11:12 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Config.mk: Change qemu references
	to 4.2-testing trees
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1347282491 -3600
# Node ID 317c8a48d81ff4848f6e8991c44a978efc06df30
# Parent  c7c84f9e2fd87530bae9c8a4701e49f08eddadb6
Config.mk: Change qemu references to 4.2-testing trees

QEMU_REMOTE and QEMU_UPSTREAM_URL need to refer to
git://xenbits.xen.org/qemu-{xen,upstream}-4.2-testing.git
(or the corresponding http versions), not -unstable.git.

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


diff -r c7c84f9e2fd8 -r 317c8a48d81f Config.mk
--- a/Config.mk	Mon Sep 10 11:34:26 2012 +0100
+++ b/Config.mk	Mon Sep 10 14:08:11 2012 +0100
@@ -187,18 +187,18 @@ XEN_EXTFILES_URL=http://xenbits.xen.org/
 # near the place in the Xen Makefiles where the file is used.
 
 ifeq ($(GIT_HTTP),y)
-QEMU_REMOTE=http://xenbits.xen.org/git-http/qemu-xen-unstable.git
+QEMU_REMOTE=http://xenbits.xen.org/git-http/qemu-xen-4.2-testing.git
 else
-QEMU_REMOTE=git://xenbits.xen.org/qemu-xen-unstable.git
+QEMU_REMOTE=git://xenbits.xen.org/qemu-xen-4.2-testing.git
 endif
 
 ifeq ($(GIT_HTTP),y)
 OVMF_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/ovmf.git
-QEMU_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/qemu-upstream-unstable.git
+QEMU_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/qemu-upstream-4.2-testing.git
 SEABIOS_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/seabios.git
 else
 OVMF_UPSTREAM_URL ?= git://xenbits.xen.org/ovmf.git
-QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-unstable.git
+QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-4.2-testing.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 OVMF_UPSTREAM_REVISION ?= b0855f925c6e2e0b21fbb03fab4b5fb5b6876871

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

From xen-changelog-bounces@lists.xen.org Mon Sep 10 21:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Sep 2012 21:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TBBGH-0000yq-Ee; Mon, 10 Sep 2012 21:11:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBBGG-0000vT-05
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:16 +0000
Received: from [85.158.143.99:19075] by server-2.bemta-4.messagelabs.com id
	D7/C3-21239-3775E405; Mon, 10 Sep 2012 21:11:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-216.messagelabs.com!1347311473!22581636!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=ML_RADAR_SPEW_LINKS_23,
	spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 698 invoked from network); 10 Sep 2012 21:11:14 -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;
	10 Sep 2012 21:11: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 1TBBGC-0004kH-Ub
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBBGC-00081Q-QW
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:12 +0000
Message-Id: <E1TBBGC-00081Q-QW@xenbits.xen.org>
Date: Mon, 10 Sep 2012 21:11:12 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Config.mk: Change qemu references
	to 4.2-testing trees
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1347282491 -3600
# Node ID 317c8a48d81ff4848f6e8991c44a978efc06df30
# Parent  c7c84f9e2fd87530bae9c8a4701e49f08eddadb6
Config.mk: Change qemu references to 4.2-testing trees

QEMU_REMOTE and QEMU_UPSTREAM_URL need to refer to
git://xenbits.xen.org/qemu-{xen,upstream}-4.2-testing.git
(or the corresponding http versions), not -unstable.git.

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


diff -r c7c84f9e2fd8 -r 317c8a48d81f Config.mk
--- a/Config.mk	Mon Sep 10 11:34:26 2012 +0100
+++ b/Config.mk	Mon Sep 10 14:08:11 2012 +0100
@@ -187,18 +187,18 @@ XEN_EXTFILES_URL=http://xenbits.xen.org/
 # near the place in the Xen Makefiles where the file is used.
 
 ifeq ($(GIT_HTTP),y)
-QEMU_REMOTE=http://xenbits.xen.org/git-http/qemu-xen-unstable.git
+QEMU_REMOTE=http://xenbits.xen.org/git-http/qemu-xen-4.2-testing.git
 else
-QEMU_REMOTE=git://xenbits.xen.org/qemu-xen-unstable.git
+QEMU_REMOTE=git://xenbits.xen.org/qemu-xen-4.2-testing.git
 endif
 
 ifeq ($(GIT_HTTP),y)
 OVMF_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/ovmf.git
-QEMU_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/qemu-upstream-unstable.git
+QEMU_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/qemu-upstream-4.2-testing.git
 SEABIOS_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/seabios.git
 else
 OVMF_UPSTREAM_URL ?= git://xenbits.xen.org/ovmf.git
-QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-unstable.git
+QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-4.2-testing.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 OVMF_UPSTREAM_REVISION ?= b0855f925c6e2e0b21fbb03fab4b5fb5b6876871

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

From xen-changelog-bounces@lists.xen.org Mon Sep 10 21:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Sep 2012 21:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TBBGH-0000yv-Gv; Mon, 10 Sep 2012 21:11:17 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBBGG-0000xb-1o
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:16 +0000
Received: from [85.158.139.83:57842] by server-6.bemta-5.messagelabs.com id
	4B/C0-21336-3775E405; Mon, 10 Sep 2012 21:11:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-182.messagelabs.com!1347311469!25809237!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19750 invoked from network); 10 Sep 2012 21:11: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 Sep 2012 21: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 1TBBG9-0004jw-66
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBBG9-0007zc-34
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:09 +0000
Message-Id: <E1TBBG9-0007zc-34@xenbits.xen.org>
Date: Mon, 10 Sep 2012 21:11:08 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Added tag 4.2.0-rc4 for changeset
	68640a3c99ce
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347016107 -3600
# Node ID cee7440c39ae51822b03b1331845661f788e628a
# Parent  68640a3c99cefa86ae70fc49871025864e5671f2
Added tag 4.2.0-rc4 for changeset 68640a3c99ce
---


diff -r 68640a3c99ce -r cee7440c39ae .hgtags
--- a/.hgtags	Fri Sep 07 12:08:10 2012 +0100
+++ b/.hgtags	Fri Sep 07 12:08:27 2012 +0100
@@ -55,3 +55,4 @@ 6241fa0ad1a939d2eba11bdec929564276f56a9e
 8e620dc570ce42564c1630de5798e23909ee809c 4.2.0-rc1
 f4c47bcc01e13cb2e3b4b71fd588d86278875442 4.2.0-rc2
 d44f290e81df5f78f0e3545742e3c4ff5415b0a7 4.2.0-rc3
+68640a3c99cefa86ae70fc49871025864e5671f2 4.2.0-rc4

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

From xen-changelog-bounces@lists.xen.org Mon Sep 10 21:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Sep 2012 21:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TBBGH-0000yv-Gv; Mon, 10 Sep 2012 21:11:17 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBBGG-0000xb-1o
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:16 +0000
Received: from [85.158.139.83:57842] by server-6.bemta-5.messagelabs.com id
	4B/C0-21336-3775E405; Mon, 10 Sep 2012 21:11:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-182.messagelabs.com!1347311469!25809237!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19750 invoked from network); 10 Sep 2012 21:11: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 Sep 2012 21: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 1TBBG9-0004jw-66
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBBG9-0007zc-34
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:09 +0000
Message-Id: <E1TBBG9-0007zc-34@xenbits.xen.org>
Date: Mon, 10 Sep 2012 21:11:08 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Added tag 4.2.0-rc4 for changeset
	68640a3c99ce
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347016107 -3600
# Node ID cee7440c39ae51822b03b1331845661f788e628a
# Parent  68640a3c99cefa86ae70fc49871025864e5671f2
Added tag 4.2.0-rc4 for changeset 68640a3c99ce
---


diff -r 68640a3c99ce -r cee7440c39ae .hgtags
--- a/.hgtags	Fri Sep 07 12:08:10 2012 +0100
+++ b/.hgtags	Fri Sep 07 12:08:27 2012 +0100
@@ -55,3 +55,4 @@ 6241fa0ad1a939d2eba11bdec929564276f56a9e
 8e620dc570ce42564c1630de5798e23909ee809c 4.2.0-rc1
 f4c47bcc01e13cb2e3b4b71fd588d86278875442 4.2.0-rc2
 d44f290e81df5f78f0e3545742e3c4ff5415b0a7 4.2.0-rc3
+68640a3c99cefa86ae70fc49871025864e5671f2 4.2.0-rc4

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

From xen-changelog-bounces@lists.xen.org Mon Sep 10 21:11:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Sep 2012 21:11:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TBBGK-00011l-Jy; Mon, 10 Sep 2012 21:11: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 1TBBGJ-0000wQ-3f
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-27.messagelabs.com!1347311470!4847200!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29680 invoked from network); 10 Sep 2012 21:11:11 -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;
	10 Sep 2012 21:11: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 1TBBGA-0004k2-Dg
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBBGA-00080B-6S
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:10 +0000
Message-Id: <E1TBBGA-00080B-6S@xenbits.xen.org>
Date: Mon, 10 Sep 2012 21:11:09 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Added tag 4.2.0-branched for
	changeset 528f0708b6db
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347016964 -3600
# Node ID 4edec34863d6cc8a6993b377f458b0129f5658df
# Parent  528f0708b6db392e10303b7ed2ab529bb8b512b7
Added tag 4.2.0-branched for changeset 528f0708b6db
---


diff -r 528f0708b6db -r 4edec34863d6 .hgtags
--- a/.hgtags	Fri Sep 07 12:18:46 2012 +0100
+++ b/.hgtags	Fri Sep 07 12:22:44 2012 +0100
@@ -56,3 +56,4 @@ 8e620dc570ce42564c1630de5798e23909ee809c
 f4c47bcc01e13cb2e3b4b71fd588d86278875442 4.2.0-rc2
 d44f290e81df5f78f0e3545742e3c4ff5415b0a7 4.2.0-rc3
 68640a3c99cefa86ae70fc49871025864e5671f2 4.2.0-rc4
+528f0708b6db392e10303b7ed2ab529bb8b512b7 4.2.0-branched

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

From xen-changelog-bounces@lists.xen.org Mon Sep 10 21:11:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Sep 2012 21:11:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TBBGK-00011l-Jy; Mon, 10 Sep 2012 21:11: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 1TBBGJ-0000wQ-3f
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-27.messagelabs.com!1347311470!4847200!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29680 invoked from network); 10 Sep 2012 21:11:11 -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;
	10 Sep 2012 21:11: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 1TBBGA-0004k2-Dg
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBBGA-00080B-6S
	for xen-changelog@lists.xensource.com; Mon, 10 Sep 2012 21:11:10 +0000
Message-Id: <E1TBBGA-00080B-6S@xenbits.xen.org>
Date: Mon, 10 Sep 2012 21:11:09 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Added tag 4.2.0-branched for
	changeset 528f0708b6db
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347016964 -3600
# Node ID 4edec34863d6cc8a6993b377f458b0129f5658df
# Parent  528f0708b6db392e10303b7ed2ab529bb8b512b7
Added tag 4.2.0-branched for changeset 528f0708b6db
---


diff -r 528f0708b6db -r 4edec34863d6 .hgtags
--- a/.hgtags	Fri Sep 07 12:18:46 2012 +0100
+++ b/.hgtags	Fri Sep 07 12:22:44 2012 +0100
@@ -56,3 +56,4 @@ 8e620dc570ce42564c1630de5798e23909ee809c
 f4c47bcc01e13cb2e3b4b71fd588d86278875442 4.2.0-rc2
 d44f290e81df5f78f0e3545742e3c4ff5415b0a7 4.2.0-rc3
 68640a3c99cefa86ae70fc49871025864e5671f2 4.2.0-rc4
+528f0708b6db392e10303b7ed2ab529bb8b512b7 4.2.0-branched

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 03:33:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 03: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.xen.org>)
	id 1TBHDu-0001SJ-Ek; Tue, 11 Sep 2012 03:33:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDs-0001Rs-Lq
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:13 +0000
Received: from [85.158.143.35:49188] by server-3.bemta-4.messagelabs.com id
	CC/74-08232-7F0BE405; Tue, 11 Sep 2012 03:33:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-21.messagelabs.com!1347334390!15131926!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28943 invoked from network); 11 Sep 2012 03:33:11 -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;
	11 Sep 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 1TBHDp-0001GQ-V1
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDp-0000wk-L2
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:09 +0000
Message-Id: <E1TBHDp-0000wk-L2@xenbits.xen.org>
Date: Tue, 11 Sep 2012 03:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Added tag 4.2.0-branched for
	changeset 528f0708b6db
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347016964 -3600
# Node ID 4edec34863d6cc8a6993b377f458b0129f5658df
# Parent  528f0708b6db392e10303b7ed2ab529bb8b512b7
Added tag 4.2.0-branched for changeset 528f0708b6db
---


diff -r 528f0708b6db -r 4edec34863d6 .hgtags
--- a/.hgtags	Fri Sep 07 12:18:46 2012 +0100
+++ b/.hgtags	Fri Sep 07 12:22:44 2012 +0100
@@ -56,3 +56,4 @@ 8e620dc570ce42564c1630de5798e23909ee809c
 f4c47bcc01e13cb2e3b4b71fd588d86278875442 4.2.0-rc2
 d44f290e81df5f78f0e3545742e3c4ff5415b0a7 4.2.0-rc3
 68640a3c99cefa86ae70fc49871025864e5671f2 4.2.0-rc4
+528f0708b6db392e10303b7ed2ab529bb8b512b7 4.2.0-branched

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 03:33:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 03: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.xen.org>)
	id 1TBHDu-0001SJ-Ek; Tue, 11 Sep 2012 03:33:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDs-0001Rs-Lq
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:13 +0000
Received: from [85.158.143.35:49188] by server-3.bemta-4.messagelabs.com id
	CC/74-08232-7F0BE405; Tue, 11 Sep 2012 03:33:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-21.messagelabs.com!1347334390!15131926!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28943 invoked from network); 11 Sep 2012 03:33:11 -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;
	11 Sep 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 1TBHDp-0001GQ-V1
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDp-0000wk-L2
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:09 +0000
Message-Id: <E1TBHDp-0000wk-L2@xenbits.xen.org>
Date: Tue, 11 Sep 2012 03:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Added tag 4.2.0-branched for
	changeset 528f0708b6db
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347016964 -3600
# Node ID 4edec34863d6cc8a6993b377f458b0129f5658df
# Parent  528f0708b6db392e10303b7ed2ab529bb8b512b7
Added tag 4.2.0-branched for changeset 528f0708b6db
---


diff -r 528f0708b6db -r 4edec34863d6 .hgtags
--- a/.hgtags	Fri Sep 07 12:18:46 2012 +0100
+++ b/.hgtags	Fri Sep 07 12:22:44 2012 +0100
@@ -56,3 +56,4 @@ 8e620dc570ce42564c1630de5798e23909ee809c
 f4c47bcc01e13cb2e3b4b71fd588d86278875442 4.2.0-rc2
 d44f290e81df5f78f0e3545742e3c4ff5415b0a7 4.2.0-rc3
 68640a3c99cefa86ae70fc49871025864e5671f2 4.2.0-rc4
+528f0708b6db392e10303b7ed2ab529bb8b512b7 4.2.0-branched

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 03:33:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 03: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.xen.org>)
	id 1TBHDu-0001SO-Gu; Tue, 11 Sep 2012 03:33:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDt-0001Rx-MC
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:13 +0000
Received: from [85.158.139.83:57998] by server-5.bemta-5.messagelabs.com id
	F0/71-30514-8F0BE405; Tue, 11 Sep 2012 03:33:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1347334390!29552461!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8544 invoked from network); 11 Sep 2012 03:33:11 -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;
	11 Sep 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 1TBHDq-0001GT-CT
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDq-0000x0-5L
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:10 +0000
Message-Id: <E1TBHDq-0000x0-5L@xenbits.xen.org>
Date: Tue, 11 Sep 2012 03:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Default to debug builds.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347018862 -3600
# Node ID 127540bc938a8e19d2ebdc272b078d5975fb7cc5
# Parent  4edec34863d6cc8a6993b377f458b0129f5658df
Default to debug builds.
---


diff -r 4edec34863d6 -r 127540bc938a Config.mk
--- a/Config.mk	Fri Sep 07 12:22:44 2012 +0100
+++ b/Config.mk	Fri Sep 07 12:54:22 2012 +0100
@@ -10,7 +10,7 @@ realpath = $(wildcard $(foreach file,$(1
 -include $(XEN_ROOT)/.config
 
 # A debug build of Xen and tools?
-debug ?= n
+debug ?= y
 debug_symbols ?= $(debug)
 
 XEN_COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/ \

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 03:33:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 03: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.xen.org>)
	id 1TBHDu-0001SO-Gu; Tue, 11 Sep 2012 03:33:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDt-0001Rx-MC
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:13 +0000
Received: from [85.158.139.83:57998] by server-5.bemta-5.messagelabs.com id
	F0/71-30514-8F0BE405; Tue, 11 Sep 2012 03:33:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1347334390!29552461!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8544 invoked from network); 11 Sep 2012 03:33:11 -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;
	11 Sep 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 1TBHDq-0001GT-CT
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDq-0000x0-5L
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:10 +0000
Message-Id: <E1TBHDq-0000x0-5L@xenbits.xen.org>
Date: Tue, 11 Sep 2012 03:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Default to debug builds.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347018862 -3600
# Node ID 127540bc938a8e19d2ebdc272b078d5975fb7cc5
# Parent  4edec34863d6cc8a6993b377f458b0129f5658df
Default to debug builds.
---


diff -r 4edec34863d6 -r 127540bc938a Config.mk
--- a/Config.mk	Fri Sep 07 12:22:44 2012 +0100
+++ b/Config.mk	Fri Sep 07 12:54:22 2012 +0100
@@ -10,7 +10,7 @@ realpath = $(wildcard $(foreach file,$(1
 -include $(XEN_ROOT)/.config
 
 # A debug build of Xen and tools?
-debug ?= n
+debug ?= y
 debug_symbols ?= $(debug)
 
 XEN_COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/ \

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 03:33:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 03: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.xen.org>)
	id 1TBHDv-0001Sh-Jc; Tue, 11 Sep 2012 03:33:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDt-0001Ry-Q7
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:13 +0000
Received: from [85.158.139.83:58007] by server-1.bemta-5.messagelabs.com id
	DA/D7-32692-9F0BE405; Tue, 11 Sep 2012 03:33:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-182.messagelabs.com!1347334391!29705452!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3907 invoked from network); 11 Sep 2012 03:33:12 -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;
	11 Sep 2012 03: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 1TBHDq-0001GW-NK
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDq-0000xF-Ly
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:10 +0000
Message-Id: <E1TBHDq-0000xF-Ly@xenbits.xen.org>
Date: Tue, 11 Sep 2012 03:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Update Xen version to 4.3-unstable
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347018926 -3600
# Node ID 7544f1804f45c699d5f1bc61151f489f76578be1
# Parent  127540bc938a8e19d2ebdc272b078d5975fb7cc5
Update Xen version to 4.3-unstable
---


diff -r 127540bc938a -r 7544f1804f45 xen/Makefile
--- a/xen/Makefile	Fri Sep 07 12:54:22 2012 +0100
+++ b/xen/Makefile	Fri Sep 07 12:55:26 2012 +0100
@@ -1,8 +1,8 @@
 # This is the correct place to edit the build version.
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
-export XEN_SUBVERSION    = 2
-export XEN_EXTRAVERSION ?= .0-rc4$(XEN_VENDORVERSION)
+export XEN_SUBVERSION    = 3
+export XEN_EXTRAVERSION ?= -unstable$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 03:33:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 03: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.xen.org>)
	id 1TBHDt-0001Rz-Bz; Tue, 11 Sep 2012 03:33:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDs-0001Rr-By
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:12 +0000
Received: from [85.158.139.83:57939] by server-12.bemta-5.messagelabs.com id
	1C/BE-18300-7F0BE405; Tue, 11 Sep 2012 03:33:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-182.messagelabs.com!1347334389!25842253!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.3 required=7.0 tests=ML_MARKETING,
  UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10571 invoked from network); 11 Sep 2012 03:33: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;
	11 Sep 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 1TBHDp-0001GN-97
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDp-0000wV-4Z
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:09 +0000
Message-Id: <E1TBHDp-0000wV-4Z@xenbits.xen.org>
Date: Tue, 11 Sep 2012 03:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Added signature for changeset
	68640a3c99ce
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347016726 -3600
# Node ID 528f0708b6db392e10303b7ed2ab529bb8b512b7
# Parent  cee7440c39ae51822b03b1331845661f788e628a
Added signature for changeset 68640a3c99ce
---


diff -r cee7440c39ae -r 528f0708b6db .hgsigs
--- a/.hgsigs	Fri Sep 07 12:08:27 2012 +0100
+++ b/.hgsigs	Fri Sep 07 12:18:46 2012 +0100
@@ -8,3 +8,4 @@ 6241fa0ad1a939d2eba11bdec929564276f56a9e
 8e620dc570ce42564c1630de5798e23909ee809c 0 iQEcBAABAgAGBQJQFqUYAAoJEIP+FMlX6CvZDGEH/jxUFG29okRASHY6XwFrJ4AU7tLyC8Bt2vAH3ZaA/h1Tn2GWkQXf4tzBAvvwWNBrm1hdj73OaB7dD2l2kvL551AhoSd4/5z+pPtpC72ItwFFTr3Ep9GRZEvEHculuei5IUzw1lxZuNCPCScBxQl+KI+dZHIeP0YO46VZTtG+EeBlj0SJ7JojKN4REd382eIgSLvpEFHCM6vqeCWM9FtDyomiMXdSosDLcWdFauFmV7cdWybA5WPj6bkJenABwX0A1V9uf225S0DTdO0t/7ncZ8h+wXTzqiixywA+lqza+u+HzNyopWmwiFcseFZjuHbKx6M2v0EvKPBcyTgdRZF/+Kg=
 f4c47bcc01e13cb2e3b4b71fd588d86278875442 0 iQEcBAABAgAGBQJQIpupAAoJEIP+FMlX6CvZnBwH/3qlibrquTmD2p3rcdVi/JkWixaKK3KH4Ows/76sAJYCdx9YkmtkgC4zyz5aph4Rfy7dYnQIUhbwNNdZNBDd0XOVkjQm0ZX1wQjv3yA3Eq9NOUDmfFWldF+oosOG3h/+MLm/36CkB7gFku1ENQ8kagytXe4rN3QdOiJ9Rz84BAv6nJoT/1OX+m+MlBs948orC23aNEfWxrsrv2s92v5fJcAfSLW/AtER2JnASIxWECJ/TOkuHtrO2QPoBymSnifM2R624L+ySwRxSxo+Owfpooje5eekk0ekifvdYtaJ3pOfoOCv8yGEtb7mXv62WowVkasUZa/q+rGdVpHuK0UlBjI=
 d44f290e81df5f78f0e3545742e3c4ff5415b0a7 0 iQEcBAABAgAGBQJQNji7AAoJEIP+FMlX6CvZvBcIAJPiA6ydvolYCvZsfGgafqCpcpG3f+PbUOwQRWfUcaKHPWFKnwRkmx9MAP9tEjXFNZcbimktDrofmee6XfLb8NLnCcHWZT8trRXYTNw2lM6DpK+AROUpAcShF3gCHQEtCJC6+NArD75aUkUji3awbGlhplHbyWvgvSSULhga+2xfYszRC7eI/g+7/f4JNkvqeWllAtd9fwftXaGhQi2V4LT5IimpJI7PivlDi0wi+BtqXHcmZhlnw3zpR51NRujsMVTNZMqe733kGdt8Y8j3vvsfXBye4+YAkEKFrzW3jTYlA9ws71oNVvWmwmOjOHpx6ASfquP3hhAoiHvb2c6Wims=
+68640a3c99cefa86ae70fc49871025864e5671f2 0 iQEcBAABAgAGBQJQSdgUAAoJEIP+FMlX6CvZeWUH/1SeYnKXtkt7n+WuMyF2LvCzZQApmOo+hqVB7m0Pe4Yh9bEq1PAE+sJOAoQIBklCpY3WFsNGQN8yIbYyWRzbIM7oavknwoUoSn50zMk12HczqHigXvhL/eOghRKNsK9BrQnRV+byNHRjzSHPReNxpzueKBOTrCMlXtYMDb94swc+hatEDItT4TwZcaNPri3kiWND0DPmOk58Ke96ml9rpomS1ff976hYAZl+N1Q3Pt998SXiaglZ9EeL0Y8cY759XqZII4D4o6/oQW8MzWrQZr4woHHU7MfK3OWslelzP486esHyyjotEWeelhgl/RjIl0crNBbmCWU15BOAw7wSZh4=

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 03:33:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 03: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.xen.org>)
	id 1TBHDt-0001Rz-Bz; Tue, 11 Sep 2012 03:33:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDs-0001Rr-By
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:12 +0000
Received: from [85.158.139.83:57939] by server-12.bemta-5.messagelabs.com id
	1C/BE-18300-7F0BE405; Tue, 11 Sep 2012 03:33:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-182.messagelabs.com!1347334389!25842253!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.3 required=7.0 tests=ML_MARKETING,
  UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10571 invoked from network); 11 Sep 2012 03:33: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;
	11 Sep 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 1TBHDp-0001GN-97
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDp-0000wV-4Z
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:09 +0000
Message-Id: <E1TBHDp-0000wV-4Z@xenbits.xen.org>
Date: Tue, 11 Sep 2012 03:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Added signature for changeset
	68640a3c99ce
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347016726 -3600
# Node ID 528f0708b6db392e10303b7ed2ab529bb8b512b7
# Parent  cee7440c39ae51822b03b1331845661f788e628a
Added signature for changeset 68640a3c99ce
---


diff -r cee7440c39ae -r 528f0708b6db .hgsigs
--- a/.hgsigs	Fri Sep 07 12:08:27 2012 +0100
+++ b/.hgsigs	Fri Sep 07 12:18:46 2012 +0100
@@ -8,3 +8,4 @@ 6241fa0ad1a939d2eba11bdec929564276f56a9e
 8e620dc570ce42564c1630de5798e23909ee809c 0 iQEcBAABAgAGBQJQFqUYAAoJEIP+FMlX6CvZDGEH/jxUFG29okRASHY6XwFrJ4AU7tLyC8Bt2vAH3ZaA/h1Tn2GWkQXf4tzBAvvwWNBrm1hdj73OaB7dD2l2kvL551AhoSd4/5z+pPtpC72ItwFFTr3Ep9GRZEvEHculuei5IUzw1lxZuNCPCScBxQl+KI+dZHIeP0YO46VZTtG+EeBlj0SJ7JojKN4REd382eIgSLvpEFHCM6vqeCWM9FtDyomiMXdSosDLcWdFauFmV7cdWybA5WPj6bkJenABwX0A1V9uf225S0DTdO0t/7ncZ8h+wXTzqiixywA+lqza+u+HzNyopWmwiFcseFZjuHbKx6M2v0EvKPBcyTgdRZF/+Kg=
 f4c47bcc01e13cb2e3b4b71fd588d86278875442 0 iQEcBAABAgAGBQJQIpupAAoJEIP+FMlX6CvZnBwH/3qlibrquTmD2p3rcdVi/JkWixaKK3KH4Ows/76sAJYCdx9YkmtkgC4zyz5aph4Rfy7dYnQIUhbwNNdZNBDd0XOVkjQm0ZX1wQjv3yA3Eq9NOUDmfFWldF+oosOG3h/+MLm/36CkB7gFku1ENQ8kagytXe4rN3QdOiJ9Rz84BAv6nJoT/1OX+m+MlBs948orC23aNEfWxrsrv2s92v5fJcAfSLW/AtER2JnASIxWECJ/TOkuHtrO2QPoBymSnifM2R624L+ySwRxSxo+Owfpooje5eekk0ekifvdYtaJ3pOfoOCv8yGEtb7mXv62WowVkasUZa/q+rGdVpHuK0UlBjI=
 d44f290e81df5f78f0e3545742e3c4ff5415b0a7 0 iQEcBAABAgAGBQJQNji7AAoJEIP+FMlX6CvZvBcIAJPiA6ydvolYCvZsfGgafqCpcpG3f+PbUOwQRWfUcaKHPWFKnwRkmx9MAP9tEjXFNZcbimktDrofmee6XfLb8NLnCcHWZT8trRXYTNw2lM6DpK+AROUpAcShF3gCHQEtCJC6+NArD75aUkUji3awbGlhplHbyWvgvSSULhga+2xfYszRC7eI/g+7/f4JNkvqeWllAtd9fwftXaGhQi2V4LT5IimpJI7PivlDi0wi+BtqXHcmZhlnw3zpR51NRujsMVTNZMqe733kGdt8Y8j3vvsfXBye4+YAkEKFrzW3jTYlA9ws71oNVvWmwmOjOHpx6ASfquP3hhAoiHvb2c6Wims=
+68640a3c99cefa86ae70fc49871025864e5671f2 0 iQEcBAABAgAGBQJQSdgUAAoJEIP+FMlX6CvZeWUH/1SeYnKXtkt7n+WuMyF2LvCzZQApmOo+hqVB7m0Pe4Yh9bEq1PAE+sJOAoQIBklCpY3WFsNGQN8yIbYyWRzbIM7oavknwoUoSn50zMk12HczqHigXvhL/eOghRKNsK9BrQnRV+byNHRjzSHPReNxpzueKBOTrCMlXtYMDb94swc+hatEDItT4TwZcaNPri3kiWND0DPmOk58Ke96ml9rpomS1ff976hYAZl+N1Q3Pt998SXiaglZ9EeL0Y8cY759XqZII4D4o6/oQW8MzWrQZr4woHHU7MfK3OWslelzP486esHyyjotEWeelhgl/RjIl0crNBbmCWU15BOAw7wSZh4=

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 03:33:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 03: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.xen.org>)
	id 1TBHDv-0001Sh-Jc; Tue, 11 Sep 2012 03:33:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDt-0001Ry-Q7
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:13 +0000
Received: from [85.158.139.83:58007] by server-1.bemta-5.messagelabs.com id
	DA/D7-32692-9F0BE405; Tue, 11 Sep 2012 03:33:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-182.messagelabs.com!1347334391!29705452!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3907 invoked from network); 11 Sep 2012 03:33:12 -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;
	11 Sep 2012 03: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 1TBHDq-0001GW-NK
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDq-0000xF-Ly
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:10 +0000
Message-Id: <E1TBHDq-0000xF-Ly@xenbits.xen.org>
Date: Tue, 11 Sep 2012 03:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Update Xen version to 4.3-unstable
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347018926 -3600
# Node ID 7544f1804f45c699d5f1bc61151f489f76578be1
# Parent  127540bc938a8e19d2ebdc272b078d5975fb7cc5
Update Xen version to 4.3-unstable
---


diff -r 127540bc938a -r 7544f1804f45 xen/Makefile
--- a/xen/Makefile	Fri Sep 07 12:54:22 2012 +0100
+++ b/xen/Makefile	Fri Sep 07 12:55:26 2012 +0100
@@ -1,8 +1,8 @@
 # This is the correct place to edit the build version.
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
-export XEN_SUBVERSION    = 2
-export XEN_EXTRAVERSION ?= .0-rc4$(XEN_VENDORVERSION)
+export XEN_SUBVERSION    = 3
+export XEN_EXTRAVERSION ?= -unstable$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 03:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 03: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.xen.org>)
	id 1TBHDv-0001Sm-Lx; Tue, 11 Sep 2012 03:33:15 +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 1TBHDu-0001S4-D6
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:14 +0000
Received: from [85.158.138.51:15330] by server-8.bemta-3.messagelabs.com id
	B1/AE-24700-9F0BE405; Tue, 11 Sep 2012 03:33:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-174.messagelabs.com!1347334391!28117333!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25855 invoked from network); 11 Sep 2012 03:33:12 -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;
	11 Sep 2012 03: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 1TBHDr-0001GZ-E1
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDr-0000xU-6a
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:11 +0000
Message-Id: <E1TBHDr-0000xU-6a@xenbits.xen.org>
Date: Tue, 11 Sep 2012 03:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] amd iommu: dump flags of IO page
	faults
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1347020600 -7200
# Node ID 10e14cc12e2300ee1c4cdb081c8762cbe1311944
# Parent  7544f1804f45c699d5f1bc61151f489f76578be1
amd iommu: dump flags of IO page faults

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 7544f1804f45 -r 10e14cc12e23 xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c	Fri Sep 07 12:55:26 2012 +0100
+++ b/xen/drivers/passthrough/amd/iommu_init.c	Fri Sep 07 14:23:20 2012 +0200
@@ -564,7 +564,7 @@ static hw_irq_controller iommu_msi_type 
 
 static void parse_event_log_entry(struct amd_iommu *iommu, u32 entry[])
 {
-    u16 domain_id, device_id, bdf, cword;
+    u16 domain_id, device_id, bdf, cword, flags;
     u32 code;
     u64 *addr;
     int count = 0;
@@ -609,11 +609,14 @@ static void parse_event_log_entry(struct
         domain_id = get_field_from_reg_u32(entry[1],
                                            IOMMU_EVENT_DOMAIN_ID_MASK,
                                            IOMMU_EVENT_DOMAIN_ID_SHIFT);
+        flags = get_field_from_reg_u32(entry[1],
+                                       IOMMU_EVENT_FLAGS_MASK,
+                                       IOMMU_EVENT_FLAGS_SHIFT);
         addr= (u64*) (entry + 2);
         printk(XENLOG_ERR "AMD-Vi: "
                "%s: domain = %d, device id = 0x%04x, "
-               "fault address = 0x%"PRIx64"\n",
-               event_str[code-1], domain_id, device_id, *addr);
+               "fault address = 0x%"PRIx64", flags = 0x%03x\n",
+               event_str[code-1], domain_id, device_id, *addr, flags);
 
         /* Tell the device to stop DMAing; we can't rely on the guest to
          * control it for us. */
diff -r 7544f1804f45 -r 10e14cc12e23 xen/include/asm-x86/hvm/svm/amd-iommu-defs.h
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h	Fri Sep 07 12:55:26 2012 +0100
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h	Fri Sep 07 14:23:20 2012 +0200
@@ -283,6 +283,8 @@
 #define IOMMU_EVENT_DOMAIN_ID_SHIFT          0
 #define IOMMU_EVENT_DEVICE_ID_MASK           0x0000FFFF
 #define IOMMU_EVENT_DEVICE_ID_SHIFT          0
+#define IOMMU_EVENT_FLAGS_SHIFT              16
+#define IOMMU_EVENT_FLAGS_MASK               0x0FFF0000
 
 /* PPR Log */
 #define IOMMU_PPR_LOG_ENTRY_SIZE                        16

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 03:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 03: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.xen.org>)
	id 1TBHDv-0001Sm-Lx; Tue, 11 Sep 2012 03:33:15 +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 1TBHDu-0001S4-D6
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:14 +0000
Received: from [85.158.138.51:15330] by server-8.bemta-3.messagelabs.com id
	B1/AE-24700-9F0BE405; Tue, 11 Sep 2012 03:33:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-174.messagelabs.com!1347334391!28117333!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25855 invoked from network); 11 Sep 2012 03:33:12 -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;
	11 Sep 2012 03: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 1TBHDr-0001GZ-E1
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDr-0000xU-6a
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:11 +0000
Message-Id: <E1TBHDr-0000xU-6a@xenbits.xen.org>
Date: Tue, 11 Sep 2012 03:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] amd iommu: dump flags of IO page
	faults
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1347020600 -7200
# Node ID 10e14cc12e2300ee1c4cdb081c8762cbe1311944
# Parent  7544f1804f45c699d5f1bc61151f489f76578be1
amd iommu: dump flags of IO page faults

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 7544f1804f45 -r 10e14cc12e23 xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c	Fri Sep 07 12:55:26 2012 +0100
+++ b/xen/drivers/passthrough/amd/iommu_init.c	Fri Sep 07 14:23:20 2012 +0200
@@ -564,7 +564,7 @@ static hw_irq_controller iommu_msi_type 
 
 static void parse_event_log_entry(struct amd_iommu *iommu, u32 entry[])
 {
-    u16 domain_id, device_id, bdf, cword;
+    u16 domain_id, device_id, bdf, cword, flags;
     u32 code;
     u64 *addr;
     int count = 0;
@@ -609,11 +609,14 @@ static void parse_event_log_entry(struct
         domain_id = get_field_from_reg_u32(entry[1],
                                            IOMMU_EVENT_DOMAIN_ID_MASK,
                                            IOMMU_EVENT_DOMAIN_ID_SHIFT);
+        flags = get_field_from_reg_u32(entry[1],
+                                       IOMMU_EVENT_FLAGS_MASK,
+                                       IOMMU_EVENT_FLAGS_SHIFT);
         addr= (u64*) (entry + 2);
         printk(XENLOG_ERR "AMD-Vi: "
                "%s: domain = %d, device id = 0x%04x, "
-               "fault address = 0x%"PRIx64"\n",
-               event_str[code-1], domain_id, device_id, *addr);
+               "fault address = 0x%"PRIx64", flags = 0x%03x\n",
+               event_str[code-1], domain_id, device_id, *addr, flags);
 
         /* Tell the device to stop DMAing; we can't rely on the guest to
          * control it for us. */
diff -r 7544f1804f45 -r 10e14cc12e23 xen/include/asm-x86/hvm/svm/amd-iommu-defs.h
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h	Fri Sep 07 12:55:26 2012 +0100
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h	Fri Sep 07 14:23:20 2012 +0200
@@ -283,6 +283,8 @@
 #define IOMMU_EVENT_DOMAIN_ID_SHIFT          0
 #define IOMMU_EVENT_DEVICE_ID_MASK           0x0000FFFF
 #define IOMMU_EVENT_DEVICE_ID_SHIFT          0
+#define IOMMU_EVENT_FLAGS_SHIFT              16
+#define IOMMU_EVENT_FLAGS_MASK               0x0FFF0000
 
 /* PPR Log */
 #define IOMMU_PPR_LOG_ENTRY_SIZE                        16

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 03:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 03: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.xen.org>)
	id 1TBHE0-0001VK-4b; Tue, 11 Sep 2012 03:33:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDy-0001Ry-3K
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:18 +0000
Received: from [85.158.139.83:58179] by server-1.bemta-5.messagelabs.com id
	3A/E7-32692-DF0BE405; Tue, 11 Sep 2012 03:33:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1347334395!29552473!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8943 invoked from network); 11 Sep 2012 03:33:16 -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;
	11 Sep 2012 03:33: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 1TBHDv-0001Gx-GX
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDv-0000zS-Ey
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:15 +0000
Message-Id: <E1TBHDv-0000zS-Ey@xenbits.xen.org>
Date: Tue, 11 Sep 2012 03:33:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: fix error message in
	device_backend_callback
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Roger Pau Monne <roger.pau@citrix.com>
# Date 1347272033 -3600
# Node ID 2f418851f36dba10fbcc173ef1a3272679f6b907
# Parent  87cb4b6f53d374d3b1415cb77f7ee3d60c4d06c5
libxl: fix error message in device_backend_callback

device_backend_callback error path always says "unable to disconnect",
but this can also happen during the connection of a device. Fix the
error message using the information in aodev->action.

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


diff -r 87cb4b6f53d3 -r 2f418851f36d tools/libxl/libxl_device.c
--- a/tools/libxl/libxl_device.c	Mon Sep 10 10:54:13 2012 +0200
+++ b/tools/libxl/libxl_device.c	Mon Sep 10 11:13:53 2012 +0100
@@ -854,7 +854,8 @@ static void device_backend_callback(libx
     }
 
     if (rc) {
-        LOG(ERROR, "unable to disconnect device with path %s",
+        LOG(ERROR, "unable to %s device with path %s",
+                   aodev->action == DEVICE_CONNECT ? "connect" : "disconnect",
                    libxl__device_backend_path(gc, aodev->dev));
         goto out;
     }

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 03:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 03: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.xen.org>)
	id 1TBHE0-0001VK-4b; Tue, 11 Sep 2012 03:33:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDy-0001Ry-3K
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:18 +0000
Received: from [85.158.139.83:58179] by server-1.bemta-5.messagelabs.com id
	3A/E7-32692-DF0BE405; Tue, 11 Sep 2012 03:33:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1347334395!29552473!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8943 invoked from network); 11 Sep 2012 03:33:16 -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;
	11 Sep 2012 03:33: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 1TBHDv-0001Gx-GX
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDv-0000zS-Ey
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:15 +0000
Message-Id: <E1TBHDv-0000zS-Ey@xenbits.xen.org>
Date: Tue, 11 Sep 2012 03:33:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: fix error message in
	device_backend_callback
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Roger Pau Monne <roger.pau@citrix.com>
# Date 1347272033 -3600
# Node ID 2f418851f36dba10fbcc173ef1a3272679f6b907
# Parent  87cb4b6f53d374d3b1415cb77f7ee3d60c4d06c5
libxl: fix error message in device_backend_callback

device_backend_callback error path always says "unable to disconnect",
but this can also happen during the connection of a device. Fix the
error message using the information in aodev->action.

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


diff -r 87cb4b6f53d3 -r 2f418851f36d tools/libxl/libxl_device.c
--- a/tools/libxl/libxl_device.c	Mon Sep 10 10:54:13 2012 +0200
+++ b/tools/libxl/libxl_device.c	Mon Sep 10 11:13:53 2012 +0100
@@ -854,7 +854,8 @@ static void device_backend_callback(libx
     }
 
     if (rc) {
-        LOG(ERROR, "unable to disconnect device with path %s",
+        LOG(ERROR, "unable to %s device with path %s",
+                   aodev->action == DEVICE_CONNECT ? "connect" : "disconnect",
                    libxl__device_backend_path(gc, aodev->dev));
         goto out;
     }

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 03:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 03: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.xen.org>)
	id 1TBHDx-0001TK-Qw; Tue, 11 Sep 2012 03:33:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDw-0001Rs-FI
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:16 +0000
Received: from [85.158.143.99:16262] by server-3.bemta-4.messagelabs.com id
	78/84-08232-CF0BE405; Tue, 11 Sep 2012 03:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-216.messagelabs.com!1347334394!18410624!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17206 invoked from network); 11 Sep 2012 03: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;
	11 Sep 2012 03:33: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 1TBHDu-0001Gr-F4
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDu-0000yy-DD
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:14 +0000
Message-Id: <E1TBHDu-0000yy-DD@xenbits.xen.org>
Date: Tue, 11 Sep 2012 03:33:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] VT-d: split .ack and .disable
	DMA-MSI actors
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347263130 -7200
# Node ID 7d216f026f71022186196a75244e97cf3864f50b
# Parent  c70d70d85306b3e4a0538353be131100c5ee38d5
VT-d: split .ack and .disable DMA-MSI actors

Calling irq_complete_move() from .disable is wrong, breaking S3 resume.

Comparing with all other .ack actors, it was also missing a call to
move_{native,masked}_irq(). As the actor is masking its interrupt
anyway (albeit it's not immediately obvious why), the latter is the
better choice.

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


diff -r c70d70d85306 -r 7d216f026f71 xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c	Fri Sep 07 17:58:12 2012 +0200
+++ b/xen/drivers/passthrough/vtd/iommu.c	Mon Sep 10 09:45:30 2012 +0200
@@ -1040,8 +1040,6 @@ static void dma_msi_mask(struct irq_desc
     unsigned long flags;
     struct iommu *iommu = desc->action->dev_id;
 
-    irq_complete_move(desc);
-
     /* mask it */
     spin_lock_irqsave(&iommu->register_lock, flags);
     dmar_writel(iommu->reg, DMAR_FECTL_REG, DMA_FECTL_IM);
@@ -1054,6 +1052,13 @@ static unsigned int dma_msi_startup(stru
     return 0;
 }
 
+static void dma_msi_ack(struct irq_desc *desc)
+{
+    irq_complete_move(desc);
+    dma_msi_mask(desc);
+    move_masked_irq(desc);
+}
+
 static void dma_msi_end(struct irq_desc *desc, u8 vector)
 {
     dma_msi_unmask(desc);
@@ -1115,7 +1120,7 @@ static hw_irq_controller dma_msi_type = 
     .shutdown = dma_msi_mask,
     .enable = dma_msi_unmask,
     .disable = dma_msi_mask,
-    .ack = dma_msi_mask,
+    .ack = dma_msi_ack,
     .end = dma_msi_end,
     .set_affinity = dma_msi_set_affinity,
 };

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 03:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 03: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.xen.org>)
	id 1TBHDx-0001TK-Qw; Tue, 11 Sep 2012 03:33:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDw-0001Rs-FI
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:16 +0000
Received: from [85.158.143.99:16262] by server-3.bemta-4.messagelabs.com id
	78/84-08232-CF0BE405; Tue, 11 Sep 2012 03:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-216.messagelabs.com!1347334394!18410624!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17206 invoked from network); 11 Sep 2012 03: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;
	11 Sep 2012 03:33: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 1TBHDu-0001Gr-F4
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDu-0000yy-DD
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:14 +0000
Message-Id: <E1TBHDu-0000yy-DD@xenbits.xen.org>
Date: Tue, 11 Sep 2012 03:33:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] VT-d: split .ack and .disable
	DMA-MSI actors
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347263130 -7200
# Node ID 7d216f026f71022186196a75244e97cf3864f50b
# Parent  c70d70d85306b3e4a0538353be131100c5ee38d5
VT-d: split .ack and .disable DMA-MSI actors

Calling irq_complete_move() from .disable is wrong, breaking S3 resume.

Comparing with all other .ack actors, it was also missing a call to
move_{native,masked}_irq(). As the actor is masking its interrupt
anyway (albeit it's not immediately obvious why), the latter is the
better choice.

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


diff -r c70d70d85306 -r 7d216f026f71 xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c	Fri Sep 07 17:58:12 2012 +0200
+++ b/xen/drivers/passthrough/vtd/iommu.c	Mon Sep 10 09:45:30 2012 +0200
@@ -1040,8 +1040,6 @@ static void dma_msi_mask(struct irq_desc
     unsigned long flags;
     struct iommu *iommu = desc->action->dev_id;
 
-    irq_complete_move(desc);
-
     /* mask it */
     spin_lock_irqsave(&iommu->register_lock, flags);
     dmar_writel(iommu->reg, DMAR_FECTL_REG, DMA_FECTL_IM);
@@ -1054,6 +1052,13 @@ static unsigned int dma_msi_startup(stru
     return 0;
 }
 
+static void dma_msi_ack(struct irq_desc *desc)
+{
+    irq_complete_move(desc);
+    dma_msi_mask(desc);
+    move_masked_irq(desc);
+}
+
 static void dma_msi_end(struct irq_desc *desc, u8 vector)
 {
     dma_msi_unmask(desc);
@@ -1115,7 +1120,7 @@ static hw_irq_controller dma_msi_type = 
     .shutdown = dma_msi_mask,
     .enable = dma_msi_unmask,
     .disable = dma_msi_mask,
-    .ack = dma_msi_mask,
+    .ack = dma_msi_ack,
     .end = dma_msi_end,
     .set_affinity = dma_msi_set_affinity,
 };

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 03:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 03: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.xen.org>)
	id 1TBHDx-0001TQ-TP; Tue, 11 Sep 2012 03:33: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 1TBHDw-0001Rn-Ji
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-27.messagelabs.com!1347334389!3519019!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25940 invoked from network); 11 Sep 2012 03:33:10 -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;
	11 Sep 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 1TBHDo-0001GK-V4
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDo-0000wG-K7
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:08 +0000
Message-Id: <E1TBHDo-0000wG-K7@xenbits.xen.org>
Date: Tue, 11 Sep 2012 03:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Added tag 4.2.0-rc4 for changeset
	68640a3c99ce
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347016107 -3600
# Node ID cee7440c39ae51822b03b1331845661f788e628a
# Parent  68640a3c99cefa86ae70fc49871025864e5671f2
Added tag 4.2.0-rc4 for changeset 68640a3c99ce
---


diff -r 68640a3c99ce -r cee7440c39ae .hgtags
--- a/.hgtags	Fri Sep 07 12:08:10 2012 +0100
+++ b/.hgtags	Fri Sep 07 12:08:27 2012 +0100
@@ -55,3 +55,4 @@ 6241fa0ad1a939d2eba11bdec929564276f56a9e
 8e620dc570ce42564c1630de5798e23909ee809c 4.2.0-rc1
 f4c47bcc01e13cb2e3b4b71fd588d86278875442 4.2.0-rc2
 d44f290e81df5f78f0e3545742e3c4ff5415b0a7 4.2.0-rc3
+68640a3c99cefa86ae70fc49871025864e5671f2 4.2.0-rc4

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 03:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 03: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.xen.org>)
	id 1TBHDx-0001TQ-TP; Tue, 11 Sep 2012 03:33: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 1TBHDw-0001Rn-Ji
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-27.messagelabs.com!1347334389!3519019!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25940 invoked from network); 11 Sep 2012 03:33:10 -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;
	11 Sep 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 1TBHDo-0001GK-V4
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDo-0000wG-K7
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:08 +0000
Message-Id: <E1TBHDo-0000wG-K7@xenbits.xen.org>
Date: Tue, 11 Sep 2012 03:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Added tag 4.2.0-rc4 for changeset
	68640a3c99ce
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347016107 -3600
# Node ID cee7440c39ae51822b03b1331845661f788e628a
# Parent  68640a3c99cefa86ae70fc49871025864e5671f2
Added tag 4.2.0-rc4 for changeset 68640a3c99ce
---


diff -r 68640a3c99ce -r cee7440c39ae .hgtags
--- a/.hgtags	Fri Sep 07 12:08:10 2012 +0100
+++ b/.hgtags	Fri Sep 07 12:08:27 2012 +0100
@@ -55,3 +55,4 @@ 6241fa0ad1a939d2eba11bdec929564276f56a9e
 8e620dc570ce42564c1630de5798e23909ee809c 4.2.0-rc1
 f4c47bcc01e13cb2e3b4b71fd588d86278875442 4.2.0-rc2
 d44f290e81df5f78f0e3545742e3c4ff5415b0a7 4.2.0-rc3
+68640a3c99cefa86ae70fc49871025864e5671f2 4.2.0-rc4

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 03:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 03: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.xen.org>)
	id 1TBHE0-0001VT-7T; Tue, 11 Sep 2012 03:33:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDy-0001SI-II
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:18 +0000
Received: from [85.158.143.35:50006] by server-1.bemta-4.messagelabs.com id
	FB/41-12504-EF0BE405; Tue, 11 Sep 2012 03:33:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-21.messagelabs.com!1347334396!14365723!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23909 invoked from network); 11 Sep 2012 03:33:17 -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;
	11 Sep 2012 03:33: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 1TBHDw-0001H3-IF
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDw-0000zw-Gt
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:16 +0000
Message-Id: <E1TBHDw-0000zw-Gt@xenbits.xen.org>
Date: Tue, 11 Sep 2012 03:33:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: correct formatting errors in
	xmdomain.cfg
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Matt Wilson <msw@amazon.com>
# Date 1347272035 -3600
# Node ID c7e4b7e643035fe070a7cdf32e3773762e457e48
# Parent  2dfea3dff550f33aa3792b8b3c6b6fced5c66eda
docs: correct formatting errors in xmdomain.cfg

This patch corrects the following errors produced by pod2man:

Hey! The above document had some coding errors, which are explained
below:

Around line 301:
    You can't have =items (as at line 305) unless the first thing after
    the =over is an =item

Around line 311:
    '=item' outside of any '=over'

Signed-off-by: Matt Wilson <msw@amazon.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 2dfea3dff550 -r c7e4b7e64303 docs/man/xmdomain.cfg.pod.5
--- a/docs/man/xmdomain.cfg.pod.5	Mon Sep 10 11:13:54 2012 +0100
+++ b/docs/man/xmdomain.cfg.pod.5	Mon Sep 10 11:13:55 2012 +0100
@@ -298,16 +298,14 @@ it holds, so that the new one may take t
 
 =back
 
+Additionally, the "on_crash" event can also take:
+
 =over 4
 
-Additionally, the "on_crash" event can also take:
-
 =item B<coredump-destroy>
 
 Dump the crashed domain's core and then destroy it.
 
-=back
-
 =item B<coredump-restart>
 
 Dump the crashed domain's core and then restart it.

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 03:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 03: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.xen.org>)
	id 1TBHE0-0001Vd-BL; Tue, 11 Sep 2012 03:33:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDy-0001Tb-NF
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:18 +0000
Received: from [85.158.143.35:49326] by server-2.bemta-4.messagelabs.com id
	81/5E-21239-DF0BE405; Tue, 11 Sep 2012 03:33:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-21.messagelabs.com!1347334396!14365722!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23898 invoked from network); 11 Sep 2012 03:33:17 -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;
	11 Sep 2012 03:33: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 1TBHDw-0001H0-1Y
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDv-0000zh-WC
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:16 +0000
Message-Id: <E1TBHDv-0000zh-WC@xenbits.xen.org>
Date: Tue, 11 Sep 2012 03:33:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl.cfg: gfx_passthru documentation
	improvements
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============3467107663120069193=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============3467107663120069193==
Content-Type: text/plain

# HG changeset patch
# User Pasi Kärkkäinen <pasik@iki.fi>
# Date 1347272034 -3600
# Node ID 2dfea3dff550f33aa3792b8b3c6b6fced5c66eda
# Parent  2f418851f36dba10fbcc173ef1a3272679f6b907
xl.cfg: gfx_passthru documentation improvements

gfx_passthru: Document gfx_passthru makes the GPU become primary in the guest
and other generic info about gfx_passthru.

Signed-off-by: Pasi Kärkkäinen <pasik@iki.fi>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 2f418851f36d -r 2dfea3dff550 docs/man/xl.cfg.pod.5
--- a/docs/man/xl.cfg.pod.5	Mon Sep 10 11:13:53 2012 +0100
+++ b/docs/man/xl.cfg.pod.5	Mon Sep 10 11:13:54 2012 +0100
@@ -992,7 +992,44 @@ certainly belong in a more appropriate s
 
 =item B<gfx_passthru=BOOLEAN>
 
-Enable graphics device PCI passthrough. XXX which device is passed through ?
+Enable graphics device PCI passthrough. This option makes the passthru
+graphics card become primary graphics card in the VM, so the Qemu emulated
+graphics adapter is disabled, and the VNC console for the VM won't have
+any graphics output. All graphics output, including boot time Qemu BIOS
+messages from the VM, will go to the physical outputs of the passed thru
+physical graphics card.
+
+Graphics card PCI device to passthru is chosen with B<pci> option,
+exactly in the same way as normal Xen PCI device passthru/assignment is done.
+Note that gfx_passthru doesn't do any kind of sharing
+of the GPU, so you can only assign the GPU to one single VM at a time.
+
+gfx_passthru also enables various legacy VGA memory ranges, BARs, MMIOs,
+and ioports to be passed thru to the VM, since those are required
+for correct operation of things like VGA BIOS, text mode, VBE, etc.
+
+Enabling gfx_passthru option also copies the physical graphics card
+video BIOS to the guest memory, and executes the VBIOS in the guest
+to get the graphics card initialized.
+
+Most graphics adapters require vendor specific tweaks for properly
+working graphics passthru. See the XenVGAPassthroughTestedAdapters
+L<http://wiki.xen.org/wiki/XenVGAPassthroughTestedAdapters>
+wiki page for currently supported graphics cards for gfx_passthru.
+
+gfx_passthru is currently only supported with the qemu-xen-traditional
+device-model. Upstream qemu-xen device-model currently doesn't have
+support for gfx_passthru.
+
+Note that some graphics adapters (AMD/ATI cards, for example) don't
+necessarily require gfx_passthru option, so you can use the normal
+Xen PCI passthru to assign the graphics card as a secondary graphics card
+to the VM. Qemu emulated graphics card stays as the primary graphics card,
+and you get VNC output from the Qemu-emulated primary adapter.
+
+More information about Xen gfx_passthru feature is available
+on the XenVGAPassthrough L<http://wiki.xen.org/wiki/XenVGAPassthrough>
+wiki page.
 
 =item B<nomigrate=BOOLEAN>
 


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

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 03:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 03: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.xen.org>)
	id 1TBHE0-0001Vi-Dj; Tue, 11 Sep 2012 03:33:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDz-0001Tb-87
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:19 +0000
Received: from [85.158.143.99:20300] by server-2.bemta-4.messagelabs.com id
	A2/5E-21239-EF0BE405; Tue, 11 Sep 2012 03:33:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-216.messagelabs.com!1347334397!19860653!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12307 invoked from network); 11 Sep 2012 03:33:18 -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;
	11 Sep 2012 03:33: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 1TBHDx-0001H6-30
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDx-00010B-1n
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:17 +0000
Message-Id: <E1TBHDx-00010B-1n@xenbits.xen.org>
Date: Tue, 11 Sep 2012 03:33:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: document "ucode=" hypervisor
	command line option
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <JBeulich@suse.com>
# Date 1347272036 -3600
# Node ID 7d770de90b7f92bb197bd54d8ac0941e2e5ae96a
# Parent  c7e4b7e643035fe070a7cdf32e3773762e457e48
docs: document "ucode=" hypervisor command line option

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


diff -r c7e4b7e64303 -r 7d770de90b7f docs/misc/xen-command-line.markdown
--- a/docs/misc/xen-command-line.markdown	Mon Sep 10 11:13:55 2012 +0100
+++ b/docs/misc/xen-command-line.markdown	Mon Sep 10 11:13:56 2012 +0100
@@ -785,6 +785,19 @@ pages) must also be specified via the tb
 > `= unstable | skewed`
 
 ### ucode
+> `= <integer>`
+
+Specify the CPU microcode update blob module index. When positive, this
+specifies the n-th module (in the GrUB entry, zero based) to be used
+for updating CPU micrcode. When negative, counting starts at the end of
+the modules in the GrUB entry (so with the blob commonly being last,
+one could specify `ucode=-1`). Note that the value of zero is not valid
+here (entry zero, i.e. the first module, is always the Dom0 kernel
+image). Note further that use of this option has an unspecified effect
+when used with xen.efi (there the concept of modules doesn't exist, and
+the blob gets specified via the `ucode=<filename>` config file/section
+entry; see [EFI configuration file description](efi.html)).
+
 ### unrestricted\_guest
 > `= <boolean>`
 

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 03:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 03: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.xen.org>)
	id 1TBHE0-0001Vi-Dj; Tue, 11 Sep 2012 03:33:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDz-0001Tb-87
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:19 +0000
Received: from [85.158.143.99:20300] by server-2.bemta-4.messagelabs.com id
	A2/5E-21239-EF0BE405; Tue, 11 Sep 2012 03:33:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-216.messagelabs.com!1347334397!19860653!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12307 invoked from network); 11 Sep 2012 03:33:18 -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;
	11 Sep 2012 03:33: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 1TBHDx-0001H6-30
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDx-00010B-1n
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:17 +0000
Message-Id: <E1TBHDx-00010B-1n@xenbits.xen.org>
Date: Tue, 11 Sep 2012 03:33:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: document "ucode=" hypervisor
	command line option
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <JBeulich@suse.com>
# Date 1347272036 -3600
# Node ID 7d770de90b7f92bb197bd54d8ac0941e2e5ae96a
# Parent  c7e4b7e643035fe070a7cdf32e3773762e457e48
docs: document "ucode=" hypervisor command line option

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


diff -r c7e4b7e64303 -r 7d770de90b7f docs/misc/xen-command-line.markdown
--- a/docs/misc/xen-command-line.markdown	Mon Sep 10 11:13:55 2012 +0100
+++ b/docs/misc/xen-command-line.markdown	Mon Sep 10 11:13:56 2012 +0100
@@ -785,6 +785,19 @@ pages) must also be specified via the tb
 > `= unstable | skewed`
 
 ### ucode
+> `= <integer>`
+
+Specify the CPU microcode update blob module index. When positive, this
+specifies the n-th module (in the GrUB entry, zero based) to be used
+for updating CPU micrcode. When negative, counting starts at the end of
+the modules in the GrUB entry (so with the blob commonly being last,
+one could specify `ucode=-1`). Note that the value of zero is not valid
+here (entry zero, i.e. the first module, is always the Dom0 kernel
+image). Note further that use of this option has an unspecified effect
+when used with xen.efi (there the concept of modules doesn't exist, and
+the blob gets specified via the `ucode=<filename>` config file/section
+entry; see [EFI configuration file description](efi.html)).
+
 ### unrestricted\_guest
 > `= <boolean>`
 

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 03:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 03: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.xen.org>)
	id 1TBHE0-0001VT-7T; Tue, 11 Sep 2012 03:33:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDy-0001SI-II
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:18 +0000
Received: from [85.158.143.35:50006] by server-1.bemta-4.messagelabs.com id
	FB/41-12504-EF0BE405; Tue, 11 Sep 2012 03:33:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-21.messagelabs.com!1347334396!14365723!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23909 invoked from network); 11 Sep 2012 03:33:17 -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;
	11 Sep 2012 03:33: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 1TBHDw-0001H3-IF
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDw-0000zw-Gt
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:16 +0000
Message-Id: <E1TBHDw-0000zw-Gt@xenbits.xen.org>
Date: Tue, 11 Sep 2012 03:33:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: correct formatting errors in
	xmdomain.cfg
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Matt Wilson <msw@amazon.com>
# Date 1347272035 -3600
# Node ID c7e4b7e643035fe070a7cdf32e3773762e457e48
# Parent  2dfea3dff550f33aa3792b8b3c6b6fced5c66eda
docs: correct formatting errors in xmdomain.cfg

This patch corrects the following errors produced by pod2man:

Hey! The above document had some coding errors, which are explained
below:

Around line 301:
    You can't have =items (as at line 305) unless the first thing after
    the =over is an =item

Around line 311:
    '=item' outside of any '=over'

Signed-off-by: Matt Wilson <msw@amazon.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 2dfea3dff550 -r c7e4b7e64303 docs/man/xmdomain.cfg.pod.5
--- a/docs/man/xmdomain.cfg.pod.5	Mon Sep 10 11:13:54 2012 +0100
+++ b/docs/man/xmdomain.cfg.pod.5	Mon Sep 10 11:13:55 2012 +0100
@@ -298,16 +298,14 @@ it holds, so that the new one may take t
 
 =back
 
+Additionally, the "on_crash" event can also take:
+
 =over 4
 
-Additionally, the "on_crash" event can also take:
-
 =item B<coredump-destroy>
 
 Dump the crashed domain's core and then destroy it.
 
-=back
-
 =item B<coredump-restart>
 
 Dump the crashed domain's core and then restart it.

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 03:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 03: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.xen.org>)
	id 1TBHE0-0001Vd-BL; Tue, 11 Sep 2012 03:33:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDy-0001Tb-NF
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:18 +0000
Received: from [85.158.143.35:49326] by server-2.bemta-4.messagelabs.com id
	81/5E-21239-DF0BE405; Tue, 11 Sep 2012 03:33:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-21.messagelabs.com!1347334396!14365722!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23898 invoked from network); 11 Sep 2012 03:33:17 -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;
	11 Sep 2012 03:33: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 1TBHDw-0001H0-1Y
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDv-0000zh-WC
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:16 +0000
Message-Id: <E1TBHDv-0000zh-WC@xenbits.xen.org>
Date: Tue, 11 Sep 2012 03:33:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl.cfg: gfx_passthru documentation
	improvements
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============3467107663120069193=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============3467107663120069193==
Content-Type: text/plain

# HG changeset patch
# User Pasi Kärkkäinen <pasik@iki.fi>
# Date 1347272034 -3600
# Node ID 2dfea3dff550f33aa3792b8b3c6b6fced5c66eda
# Parent  2f418851f36dba10fbcc173ef1a3272679f6b907
xl.cfg: gfx_passthru documentation improvements

gfx_passthru: Document gfx_passthru makes the GPU become primary in the guest
and other generic info about gfx_passthru.

Signed-off-by: Pasi Kärkkäinen <pasik@iki.fi>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 2f418851f36d -r 2dfea3dff550 docs/man/xl.cfg.pod.5
--- a/docs/man/xl.cfg.pod.5	Mon Sep 10 11:13:53 2012 +0100
+++ b/docs/man/xl.cfg.pod.5	Mon Sep 10 11:13:54 2012 +0100
@@ -992,7 +992,44 @@ certainly belong in a more appropriate s
 
 =item B<gfx_passthru=BOOLEAN>
 
-Enable graphics device PCI passthrough. XXX which device is passed through ?
+Enable graphics device PCI passthrough. This option makes the passthru
+graphics card become primary graphics card in the VM, so the Qemu emulated
+graphics adapter is disabled, and the VNC console for the VM won't have
+any graphics output. All graphics output, including boot time Qemu BIOS
+messages from the VM, will go to the physical outputs of the passed thru
+physical graphics card.
+
+Graphics card PCI device to passthru is chosen with B<pci> option,
+exactly in the same way as normal Xen PCI device passthru/assignment is done.
+Note that gfx_passthru doesn't do any kind of sharing
+of the GPU, so you can only assign the GPU to one single VM at a time.
+
+gfx_passthru also enables various legacy VGA memory ranges, BARs, MMIOs,
+and ioports to be passed thru to the VM, since those are required
+for correct operation of things like VGA BIOS, text mode, VBE, etc.
+
+Enabling gfx_passthru option also copies the physical graphics card
+video BIOS to the guest memory, and executes the VBIOS in the guest
+to get the graphics card initialized.
+
+Most graphics adapters require vendor specific tweaks for properly
+working graphics passthru. See the XenVGAPassthroughTestedAdapters
+L<http://wiki.xen.org/wiki/XenVGAPassthroughTestedAdapters>
+wiki page for currently supported graphics cards for gfx_passthru.
+
+gfx_passthru is currently only supported with the qemu-xen-traditional
+device-model. Upstream qemu-xen device-model currently doesn't have
+support for gfx_passthru.
+
+Note that some graphics adapters (AMD/ATI cards, for example) don't
+necessarily require gfx_passthru option, so you can use the normal
+Xen PCI passthru to assign the graphics card as a secondary graphics card
+to the VM. Qemu emulated graphics card stays as the primary graphics card,
+and you get VNC output from the Qemu-emulated primary adapter.
+
+More information about Xen gfx_passthru feature is available
+on the XenVGAPassthrough L<http://wiki.xen.org/wiki/XenVGAPassthrough>
+wiki page.
 
 =item B<nomigrate=BOOLEAN>
 


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

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 03:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 03: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.xen.org>)
	id 1TBHDy-0001Tn-W5; Tue, 11 Sep 2012 03:33:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDx-0001SI-5S
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:17 +0000
Received: from [85.158.143.99:16284] by server-1.bemta-4.messagelabs.com id
	29/41-12504-CF0BE405; Tue, 11 Sep 2012 03:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-216.messagelabs.com!1347334395!20008128!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2128 invoked from network); 11 Sep 2012 03:33:16 -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;
	11 Sep 2012 03:33: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 1TBHDv-0001Gu-2P
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDu-0000zD-Tf
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:14 +0000
Message-Id: <E1TBHDu-0000zD-Tf@xenbits.xen.org>
Date: Tue, 11 Sep 2012 03:33:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] unmodified_drivers: handle
	IRQF_SAMPLE_RANDOM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1347267253 -7200
# Node ID 87cb4b6f53d374d3b1415cb77f7ee3d60c4d06c5
# Parent  7d216f026f71022186196a75244e97cf3864f50b
unmodified_drivers: handle IRQF_SAMPLE_RANDOM

The flag IRQF_SAMPLE_RANDOM was removed in 3.6-rc1. Add it only if it is
defined. An additional call to add_interrupt_randomness is appearently
not needed because its now called unconditionally in
handle_irq_event_percpu().

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


diff -r 7d216f026f71 -r 87cb4b6f53d3 unmodified_drivers/linux-2.6/platform-pci/evtchn.c
--- a/unmodified_drivers/linux-2.6/platform-pci/evtchn.c	Mon Sep 10 09:45:30 2012 +0200
+++ b/unmodified_drivers/linux-2.6/platform-pci/evtchn.c	Mon Sep 10 10:54:13 2012 +0200
@@ -350,7 +350,11 @@ int xen_irq_init(struct pci_dev *pdev)
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
 			   SA_SHIRQ | SA_SAMPLE_RANDOM | SA_INTERRUPT,
 #else
-			   IRQF_SHARED | IRQF_SAMPLE_RANDOM | IRQF_DISABLED,
+			   IRQF_SHARED |
+#ifdef IRQF_SAMPLE_RANDOM
+			   IRQF_SAMPLE_RANDOM |
+#endif
+			   IRQF_DISABLED,
 #endif
 			   "xen-platform-pci", pdev);
 }

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 03:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 03: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.xen.org>)
	id 1TBHDw-0001T1-ON; Tue, 11 Sep 2012 03:33:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDu-0001SI-Qt
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:14 +0000
Received: from [85.158.143.99:16179] by server-1.bemta-4.messagelabs.com id
	E0/41-12504-AF0BE405; Tue, 11 Sep 2012 03:33:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1347334392!24346948!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12273 invoked from network); 11 Sep 2012 03:33:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Sep 2012 03: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 1TBHDs-0001Gf-Ch
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDs-0000y0-8X
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:12 +0000
Message-Id: <E1TBHDs-0000y0-8X@xenbits.xen.org>
Date: Tue, 11 Sep 2012 03:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: remove WIP notice from command
	line docs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1347021861 -3600
# Node ID e3b51948114ec1e2b2eece415b32e26ff857acde
# Parent  b257b90fd9d01507055941a5f996200a448760be
docs: remove WIP notice from command line docs

I'm sure they aren't perfect but various people have done a pass over
them recently and they are much improved. I don't think we need to
continue to describe them so pessimistically.

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


diff -r b257b90fd9d0 -r e3b51948114e docs/misc/xen-command-line.markdown
--- a/docs/misc/xen-command-line.markdown	Fri Sep 07 14:23:45 2012 +0200
+++ b/docs/misc/xen-command-line.markdown	Fri Sep 07 13:44:21 2012 +0100
@@ -1,10 +1,5 @@
 # Xen Hypervisor Command Line Options
 
-**This document is still a work in progress.  There are currently some
-  command line options listed twice, and they are defined in separate
-  arch trees, and some options are currently separate from their
-  legacy versions.  Please remove this notice when complete.**
-
 This document covers the command line options which the Xen
 Hypervisor.
 

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 03:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 03: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.xen.org>)
	id 1TBHDw-0001T1-ON; Tue, 11 Sep 2012 03:33:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDu-0001SI-Qt
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:14 +0000
Received: from [85.158.143.99:16179] by server-1.bemta-4.messagelabs.com id
	E0/41-12504-AF0BE405; Tue, 11 Sep 2012 03:33:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1347334392!24346948!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12273 invoked from network); 11 Sep 2012 03:33:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Sep 2012 03: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 1TBHDs-0001Gf-Ch
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDs-0000y0-8X
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:12 +0000
Message-Id: <E1TBHDs-0000y0-8X@xenbits.xen.org>
Date: Tue, 11 Sep 2012 03:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: remove WIP notice from command
	line docs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1347021861 -3600
# Node ID e3b51948114ec1e2b2eece415b32e26ff857acde
# Parent  b257b90fd9d01507055941a5f996200a448760be
docs: remove WIP notice from command line docs

I'm sure they aren't perfect but various people have done a pass over
them recently and they are much improved. I don't think we need to
continue to describe them so pessimistically.

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


diff -r b257b90fd9d0 -r e3b51948114e docs/misc/xen-command-line.markdown
--- a/docs/misc/xen-command-line.markdown	Fri Sep 07 14:23:45 2012 +0200
+++ b/docs/misc/xen-command-line.markdown	Fri Sep 07 13:44:21 2012 +0100
@@ -1,10 +1,5 @@
 # Xen Hypervisor Command Line Options
 
-**This document is still a work in progress.  There are currently some
-  command line options listed twice, and they are defined in separate
-  arch trees, and some options are currently separate from their
-  legacy versions.  Please remove this notice when complete.**
-
 This document covers the command line options which the Xen
 Hypervisor.
 

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 03:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 03: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.xen.org>)
	id 1TBHDy-0001Tn-W5; Tue, 11 Sep 2012 03:33:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDx-0001SI-5S
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:17 +0000
Received: from [85.158.143.99:16284] by server-1.bemta-4.messagelabs.com id
	29/41-12504-CF0BE405; Tue, 11 Sep 2012 03:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-216.messagelabs.com!1347334395!20008128!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2128 invoked from network); 11 Sep 2012 03:33:16 -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;
	11 Sep 2012 03:33: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 1TBHDv-0001Gu-2P
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDu-0000zD-Tf
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:14 +0000
Message-Id: <E1TBHDu-0000zD-Tf@xenbits.xen.org>
Date: Tue, 11 Sep 2012 03:33:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] unmodified_drivers: handle
	IRQF_SAMPLE_RANDOM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1347267253 -7200
# Node ID 87cb4b6f53d374d3b1415cb77f7ee3d60c4d06c5
# Parent  7d216f026f71022186196a75244e97cf3864f50b
unmodified_drivers: handle IRQF_SAMPLE_RANDOM

The flag IRQF_SAMPLE_RANDOM was removed in 3.6-rc1. Add it only if it is
defined. An additional call to add_interrupt_randomness is appearently
not needed because its now called unconditionally in
handle_irq_event_percpu().

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


diff -r 7d216f026f71 -r 87cb4b6f53d3 unmodified_drivers/linux-2.6/platform-pci/evtchn.c
--- a/unmodified_drivers/linux-2.6/platform-pci/evtchn.c	Mon Sep 10 09:45:30 2012 +0200
+++ b/unmodified_drivers/linux-2.6/platform-pci/evtchn.c	Mon Sep 10 10:54:13 2012 +0200
@@ -350,7 +350,11 @@ int xen_irq_init(struct pci_dev *pdev)
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
 			   SA_SHIRQ | SA_SAMPLE_RANDOM | SA_INTERRUPT,
 #else
-			   IRQF_SHARED | IRQF_SAMPLE_RANDOM | IRQF_DISABLED,
+			   IRQF_SHARED |
+#ifdef IRQF_SAMPLE_RANDOM
+			   IRQF_SAMPLE_RANDOM |
+#endif
+			   IRQF_DISABLED,
 #endif
 			   "xen-platform-pci", pdev);
 }

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 03:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 03: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.xen.org>)
	id 1TBHE1-0001XB-Q5; Tue, 11 Sep 2012 03:33: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 1TBHE0-0001Sc-Pu
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-27.messagelabs.com!1347334393!3461152!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7845 invoked from network); 11 Sep 2012 03:33:14 -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;
	11 Sep 2012 03:33: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 1TBHDt-0001Gl-Ba
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDt-0000yU-AH
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:13 +0000
Message-Id: <E1TBHDt-0000yU-AH@xenbits.xen.org>
Date: Tue, 11 Sep 2012 03:33:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/MSI: fix 2nd S3 resume with
	interrupt remapping enabled
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347033430 -7200
# Node ID 0376c85caaf34fe3cc8c3327f7a1d9ecd6f070b4
# Parent  bb85bbccb1c9d802c92dd3fe00841368966ff623
x86/MSI: fix 2nd S3 resume with interrupt remapping enabled

The first resume from S3 was corrupting internal data structures (in
that pci_restore_msi_state() updated the globally stored MSI message
from traditional to interrupt remapped format, which would then be
translated a second time during the second resume, breaking interrupt
delivery).

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


diff -r bb85bbccb1c9 -r 0376c85caaf3 xen/arch/x86/msi.c
--- a/xen/arch/x86/msi.c	Fri Sep 07 15:01:39 2012 +0200
+++ b/xen/arch/x86/msi.c	Fri Sep 07 17:57:10 2012 +0200
@@ -210,7 +210,10 @@ static void write_msi_msg(struct msi_des
     entry->msg = *msg;
 
     if ( iommu_enabled )
+    {
+        ASSERT(msg != &entry->msg);
         iommu_update_ire_from_msi(entry, msg);
+    }
 
     switch ( entry->msi_attrib.type )
     {
@@ -996,6 +999,7 @@ int pci_restore_msi_state(struct pci_dev
     int ret;
     struct msi_desc *entry, *tmp;
     struct irq_desc *desc;
+    struct msi_msg msg;
 
     ASSERT(spin_is_locked(&pcidevs_lock));
 
@@ -1030,7 +1034,8 @@ int pci_restore_msi_state(struct pci_dev
         else if ( entry->msi_attrib.type == PCI_CAP_ID_MSIX )
             msix_set_enable(pdev, 0);
 
-        write_msi_msg(entry, &entry->msg);
+        msg = entry->msg;
+        write_msi_msg(entry, &msg);
 
         msi_set_mask_bit(desc, entry->msi_attrib.masked);
 

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 03:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 03: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.xen.org>)
	id 1TBHE1-0001XB-Q5; Tue, 11 Sep 2012 03:33: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 1TBHE0-0001Sc-Pu
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-27.messagelabs.com!1347334393!3461152!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7845 invoked from network); 11 Sep 2012 03:33:14 -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;
	11 Sep 2012 03:33: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 1TBHDt-0001Gl-Ba
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDt-0000yU-AH
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:13 +0000
Message-Id: <E1TBHDt-0000yU-AH@xenbits.xen.org>
Date: Tue, 11 Sep 2012 03:33:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/MSI: fix 2nd S3 resume with
	interrupt remapping enabled
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347033430 -7200
# Node ID 0376c85caaf34fe3cc8c3327f7a1d9ecd6f070b4
# Parent  bb85bbccb1c9d802c92dd3fe00841368966ff623
x86/MSI: fix 2nd S3 resume with interrupt remapping enabled

The first resume from S3 was corrupting internal data structures (in
that pci_restore_msi_state() updated the globally stored MSI message
from traditional to interrupt remapped format, which would then be
translated a second time during the second resume, breaking interrupt
delivery).

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


diff -r bb85bbccb1c9 -r 0376c85caaf3 xen/arch/x86/msi.c
--- a/xen/arch/x86/msi.c	Fri Sep 07 15:01:39 2012 +0200
+++ b/xen/arch/x86/msi.c	Fri Sep 07 17:57:10 2012 +0200
@@ -210,7 +210,10 @@ static void write_msi_msg(struct msi_des
     entry->msg = *msg;
 
     if ( iommu_enabled )
+    {
+        ASSERT(msg != &entry->msg);
         iommu_update_ire_from_msi(entry, msg);
+    }
 
     switch ( entry->msi_attrib.type )
     {
@@ -996,6 +999,7 @@ int pci_restore_msi_state(struct pci_dev
     int ret;
     struct msi_desc *entry, *tmp;
     struct irq_desc *desc;
+    struct msi_msg msg;
 
     ASSERT(spin_is_locked(&pcidevs_lock));
 
@@ -1030,7 +1034,8 @@ int pci_restore_msi_state(struct pci_dev
         else if ( entry->msi_attrib.type == PCI_CAP_ID_MSIX )
             msix_set_enable(pdev, 0);
 
-        write_msi_msg(entry, &entry->msg);
+        msg = entry->msg;
+        write_msi_msg(entry, &msg);
 
         msi_set_mask_bit(desc, entry->msi_attrib.masked);
 

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 03:33:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 03: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.xen.org>)
	id 1TBHE1-0001WO-Go; Tue, 11 Sep 2012 03:33: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 1TBHE0-0001SH-0M
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-27.messagelabs.com!1347334392!9657705!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4717 invoked from network); 11 Sep 2012 03:33: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;
	11 Sep 2012 03: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 1TBHDr-0001Gc-Ri
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDr-0000xl-NX
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:11 +0000
Message-Id: <E1TBHDr-0000xl-NX@xenbits.xen.org>
Date: Tue, 11 Sep 2012 03:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: clamp bitmaps to correct number
	of bits
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1347020625 -7200
# Node ID b257b90fd9d01507055941a5f996200a448760be
# Parent  10e14cc12e2300ee1c4cdb081c8762cbe1311944
xen: clamp bitmaps to correct number of bits

Valgrind running xl create reports:
 ==24777== Invalid read of size 4
 ==24777==    at 0x4072805: libxl__get_numa_candidate (libxl_numa.c:203)
 ==24777==    by 0x40680B6: libxl__build_pre (libxl_dom.c:166)
 ==24777==    by 0x405B82E: libxl__domain_build (libxl_create.c:323)
 ==24777==    by 0x405BB9C: domcreate_bootloader_done (libxl_create.c:747)
 ==24777==    by 0x407AD27: bootloader_local_detached_cb (libxl_bootloader.c:281)
 ==24777==    by 0x40508D8: local_device_detach_cb (libxl.c:2470)
 ==24777==    by 0x4052B10: libxl__device_disk_local_initiate_detach (libxl.c:2445)
 ==24777==    by 0x407AE9F: bootloader_callback (libxl_bootloader.c:265)
 ==24777==    by 0x407C69A: libxl__bootloader_run (libxl_bootloader.c:392)
 ==24777==    by 0x405CB24: do_domain_create (libxl_create.c:687)
 ==24777==    by 0x405CC5E: libxl_domain_create_new (libxl_create.c:1177)
 ==24777==    by 0x805BDE2: create_domain (xl_cmdimpl.c:1812)
 ==24777==  Address 0x42dbdd8 is 8 bytes after a block of size 48 alloc'd
 ==24777==    at 0x4023340: calloc (vg_replace_malloc.c:593)
 ==24777==    by 0x406D479: libxl__zalloc (libxl_internal.c:88)
 ==24777==    by 0x404EF38: libxl_get_cpu_topology (libxl.c:3707)
 ==24777==    by 0x4072232: libxl__get_numa_candidate (libxl_numa.c:314)
 ==24777==    by 0x40680B6: libxl__build_pre (libxl_dom.c:166)
 ==24777==    by 0x405B82E: libxl__domain_build (libxl_create.c:323)
 ==24777==    by 0x405BB9C: domcreate_bootloader_done (libxl_create.c:747)
 ==24777==    by 0x407AD27: bootloader_local_detached_cb (libxl_bootloader.c:281)
 ==24777==    by 0x40508D8: local_device_detach_cb (libxl.c:2470)
 ==24777==    by 0x4052B10: libxl__device_disk_local_initiate_detach (libxl.c:2445)
 ==24777==    by 0x407AE9F: bootloader_callback (libxl_bootloader.c:265)
 ==24777==    by 0x407C69A: libxl__bootloader_run (libxl_bootloader.c:392)

This is because with nr_cpus=4 the bitmask returned from Xen
contains 0xff rather than 0x0f bit our bitmap walking routines (e.g.
libxl_for_each_set_bit) round up to the next byte (so it iterates
e.g. 8 times not 4). This then causes us to access of the end of
whatever array we are walking through each set bit for.

The principal of least surprise suggests that these bits ought not to
be set and this is not a hot path so fix this at the hypervisor layer
by clamping the bits in the returned bitmap to the correct limit.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 10e14cc12e23 -r b257b90fd9d0 xen/common/bitmap.c
--- a/xen/common/bitmap.c	Fri Sep 07 14:23:20 2012 +0200
+++ b/xen/common/bitmap.c	Fri Sep 07 14:23:45 2012 +0200
@@ -38,6 +38,21 @@
  * for the best explanations of this ordering.
  */
 
+/*
+ * If a bitmap has a number of bits which is not a multiple of 8 then
+ * the last few bits of the last byte of the bitmap can be
+ * unexpectedly set which can confuse consumers (e.g. in the tools)
+ * who also round up their loops to 8 bits. Ensure we clear those left
+ * over bits so as to prevent surprises.
+ */
+static void clamp_last_byte(uint8_t *bp, unsigned int nbits)
+{
+	unsigned int remainder = nbits % 8;
+
+	if (remainder)
+		bp[nbits/8] &= (1U << remainder) - 1;
+}
+
 int __bitmap_empty(const unsigned long *bitmap, int bits)
 {
 	int k, lim = bits/BITS_PER_LONG;
@@ -485,6 +500,7 @@ void bitmap_long_to_byte(uint8_t *bp, co
 			nbits -= 8;
 		}
 	}
+	clamp_last_byte(bp, nbits);
 }
 
 void bitmap_byte_to_long(unsigned long *lp, const uint8_t *bp, int nbits)
@@ -507,6 +523,7 @@ void bitmap_byte_to_long(unsigned long *
 void bitmap_long_to_byte(uint8_t *bp, const unsigned long *lp, int nbits)
 {
 	memcpy(bp, lp, (nbits+7)/8);
+	clamp_last_byte(bp, nbits);
 }
 
 void bitmap_byte_to_long(unsigned long *lp, const uint8_t *bp, int nbits)

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 03:33:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 03: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.xen.org>)
	id 1TBHE1-0001WO-Go; Tue, 11 Sep 2012 03:33: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 1TBHE0-0001SH-0M
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-27.messagelabs.com!1347334392!9657705!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4717 invoked from network); 11 Sep 2012 03:33: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;
	11 Sep 2012 03: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 1TBHDr-0001Gc-Ri
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDr-0000xl-NX
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:11 +0000
Message-Id: <E1TBHDr-0000xl-NX@xenbits.xen.org>
Date: Tue, 11 Sep 2012 03:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: clamp bitmaps to correct number
	of bits
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1347020625 -7200
# Node ID b257b90fd9d01507055941a5f996200a448760be
# Parent  10e14cc12e2300ee1c4cdb081c8762cbe1311944
xen: clamp bitmaps to correct number of bits

Valgrind running xl create reports:
 ==24777== Invalid read of size 4
 ==24777==    at 0x4072805: libxl__get_numa_candidate (libxl_numa.c:203)
 ==24777==    by 0x40680B6: libxl__build_pre (libxl_dom.c:166)
 ==24777==    by 0x405B82E: libxl__domain_build (libxl_create.c:323)
 ==24777==    by 0x405BB9C: domcreate_bootloader_done (libxl_create.c:747)
 ==24777==    by 0x407AD27: bootloader_local_detached_cb (libxl_bootloader.c:281)
 ==24777==    by 0x40508D8: local_device_detach_cb (libxl.c:2470)
 ==24777==    by 0x4052B10: libxl__device_disk_local_initiate_detach (libxl.c:2445)
 ==24777==    by 0x407AE9F: bootloader_callback (libxl_bootloader.c:265)
 ==24777==    by 0x407C69A: libxl__bootloader_run (libxl_bootloader.c:392)
 ==24777==    by 0x405CB24: do_domain_create (libxl_create.c:687)
 ==24777==    by 0x405CC5E: libxl_domain_create_new (libxl_create.c:1177)
 ==24777==    by 0x805BDE2: create_domain (xl_cmdimpl.c:1812)
 ==24777==  Address 0x42dbdd8 is 8 bytes after a block of size 48 alloc'd
 ==24777==    at 0x4023340: calloc (vg_replace_malloc.c:593)
 ==24777==    by 0x406D479: libxl__zalloc (libxl_internal.c:88)
 ==24777==    by 0x404EF38: libxl_get_cpu_topology (libxl.c:3707)
 ==24777==    by 0x4072232: libxl__get_numa_candidate (libxl_numa.c:314)
 ==24777==    by 0x40680B6: libxl__build_pre (libxl_dom.c:166)
 ==24777==    by 0x405B82E: libxl__domain_build (libxl_create.c:323)
 ==24777==    by 0x405BB9C: domcreate_bootloader_done (libxl_create.c:747)
 ==24777==    by 0x407AD27: bootloader_local_detached_cb (libxl_bootloader.c:281)
 ==24777==    by 0x40508D8: local_device_detach_cb (libxl.c:2470)
 ==24777==    by 0x4052B10: libxl__device_disk_local_initiate_detach (libxl.c:2445)
 ==24777==    by 0x407AE9F: bootloader_callback (libxl_bootloader.c:265)
 ==24777==    by 0x407C69A: libxl__bootloader_run (libxl_bootloader.c:392)

This is because with nr_cpus=4 the bitmask returned from Xen
contains 0xff rather than 0x0f bit our bitmap walking routines (e.g.
libxl_for_each_set_bit) round up to the next byte (so it iterates
e.g. 8 times not 4). This then causes us to access of the end of
whatever array we are walking through each set bit for.

The principal of least surprise suggests that these bits ought not to
be set and this is not a hot path so fix this at the hypervisor layer
by clamping the bits in the returned bitmap to the correct limit.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 10e14cc12e23 -r b257b90fd9d0 xen/common/bitmap.c
--- a/xen/common/bitmap.c	Fri Sep 07 14:23:20 2012 +0200
+++ b/xen/common/bitmap.c	Fri Sep 07 14:23:45 2012 +0200
@@ -38,6 +38,21 @@
  * for the best explanations of this ordering.
  */
 
+/*
+ * If a bitmap has a number of bits which is not a multiple of 8 then
+ * the last few bits of the last byte of the bitmap can be
+ * unexpectedly set which can confuse consumers (e.g. in the tools)
+ * who also round up their loops to 8 bits. Ensure we clear those left
+ * over bits so as to prevent surprises.
+ */
+static void clamp_last_byte(uint8_t *bp, unsigned int nbits)
+{
+	unsigned int remainder = nbits % 8;
+
+	if (remainder)
+		bp[nbits/8] &= (1U << remainder) - 1;
+}
+
 int __bitmap_empty(const unsigned long *bitmap, int bits)
 {
 	int k, lim = bits/BITS_PER_LONG;
@@ -485,6 +500,7 @@ void bitmap_long_to_byte(uint8_t *bp, co
 			nbits -= 8;
 		}
 	}
+	clamp_last_byte(bp, nbits);
 }
 
 void bitmap_byte_to_long(unsigned long *lp, const uint8_t *bp, int nbits)
@@ -507,6 +523,7 @@ void bitmap_byte_to_long(unsigned long *
 void bitmap_long_to_byte(uint8_t *bp, const unsigned long *lp, int nbits)
 {
 	memcpy(bp, lp, (nbits+7)/8);
+	clamp_last_byte(bp, nbits);
 }
 
 void bitmap_byte_to_long(unsigned long *lp, const uint8_t *bp, int nbits)

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 03:33:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 03: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.xen.org>)
	id 1TBHE1-0001Wd-KQ; Tue, 11 Sep 2012 03:33: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 1TBHE0-0001Sb-FS
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-27.messagelabs.com!1347334393!2784846!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17533 invoked from network); 11 Sep 2012 03:33:14 -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;
	11 Sep 2012 03:33: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 1TBHDs-0001Gi-Tp
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDs-0000yF-Pa
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:12 +0000
Message-Id: <E1TBHDs-0000yF-Pa@xenbits.xen.org>
Date: Tue, 11 Sep 2012 03:33:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/32-on-64: adjust Dom0 initial
	page table layout
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347022899 -7200
# Node ID bb85bbccb1c9d802c92dd3fe00841368966ff623
# Parent  e3b51948114ec1e2b2eece415b32e26ff857acde
x86/32-on-64: adjust Dom0 initial page table layout

Drop the unnecessary reservation of the L4 page for 32on64 Dom0, and
allocate its L3 first (to match behavior when running identical bit-
width hypervisor and Dom0 kernel).

Reported-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r e3b51948114e -r bb85bbccb1c9 xen/arch/x86/domain_build.c
--- a/xen/arch/x86/domain_build.c	Fri Sep 07 13:44:21 2012 +0100
+++ b/xen/arch/x86/domain_build.c	Fri Sep 07 15:01:39 2012 +0200
@@ -510,7 +510,7 @@ int __init construct_dom0(
 #define NR(_l,_h,_s) \
     (((((_h) + ((1UL<<(_s))-1)) & ~((1UL<<(_s))-1)) - \
        ((_l) & ~((1UL<<(_s))-1))) >> (_s))
-        if ( (1 + /* # L4 */
+        if ( (!is_pv_32on64_domain(d) + /* # L4 */
               NR(v_start, v_end, L4_PAGETABLE_SHIFT) + /* # L3 */
               (!is_pv_32on64_domain(d) ?
                NR(v_start, v_end, L3_PAGETABLE_SHIFT) : /* # L2 */
@@ -756,6 +756,8 @@ int __init construct_dom0(
             panic("Not enough RAM for domain 0 PML4.\n");
         page->u.inuse.type_info = PGT_l4_page_table|PGT_validated|1;
         l4start = l4tab = page_to_virt(page);
+        maddr_to_page(mpt_alloc)->u.inuse.type_info = PGT_l3_page_table;
+        l3start = __va(mpt_alloc); mpt_alloc += PAGE_SIZE;
     }
     copy_page(l4tab, idle_pg_table);
     l4tab[0] = l4e_empty(); /* zap trampoline mapping */
@@ -787,9 +789,13 @@ int __init construct_dom0(
                     l2tab += l2_table_offset(v_start);
                 if ( !((unsigned long)l3tab & (PAGE_SIZE-1)) )
                 {
-                    maddr_to_page(mpt_alloc)->u.inuse.type_info =
-                        PGT_l3_page_table;
-                    l3start = l3tab = __va(mpt_alloc); mpt_alloc += PAGE_SIZE;
+                    if ( count || !l3start )
+                    {
+                        maddr_to_page(mpt_alloc)->u.inuse.type_info =
+                            PGT_l3_page_table;
+                        l3start = __va(mpt_alloc); mpt_alloc += PAGE_SIZE;
+                    }
+                    l3tab = l3start;
                     clear_page(l3tab);
                     if ( count == 0 )
                         l3tab += l3_table_offset(v_start);
@@ -938,7 +944,7 @@ int __init construct_dom0(
     if ( !vinitrd_start && initrd_len )
         si->flags   |= SIF_MOD_START_PFN;
     si->flags       |= (xen_processor_pmbits << 8) & SIF_PM_MASK;
-    si->pt_base      = vpt_start + 2 * PAGE_SIZE * !!is_pv_32on64_domain(d);
+    si->pt_base      = vpt_start;
     si->nr_pt_frames = nr_pt_pages;
     si->mfn_list     = vphysmap_start;
     snprintf(si->magic, sizeof(si->magic), "xen-3.0-x86_%d%s",

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 03:33:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 03: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.xen.org>)
	id 1TBHE1-0001Wd-KQ; Tue, 11 Sep 2012 03:33: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 1TBHE0-0001Sb-FS
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-27.messagelabs.com!1347334393!2784846!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17533 invoked from network); 11 Sep 2012 03:33:14 -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;
	11 Sep 2012 03:33: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 1TBHDs-0001Gi-Tp
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDs-0000yF-Pa
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:12 +0000
Message-Id: <E1TBHDs-0000yF-Pa@xenbits.xen.org>
Date: Tue, 11 Sep 2012 03:33:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/32-on-64: adjust Dom0 initial
	page table layout
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347022899 -7200
# Node ID bb85bbccb1c9d802c92dd3fe00841368966ff623
# Parent  e3b51948114ec1e2b2eece415b32e26ff857acde
x86/32-on-64: adjust Dom0 initial page table layout

Drop the unnecessary reservation of the L4 page for 32on64 Dom0, and
allocate its L3 first (to match behavior when running identical bit-
width hypervisor and Dom0 kernel).

Reported-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r e3b51948114e -r bb85bbccb1c9 xen/arch/x86/domain_build.c
--- a/xen/arch/x86/domain_build.c	Fri Sep 07 13:44:21 2012 +0100
+++ b/xen/arch/x86/domain_build.c	Fri Sep 07 15:01:39 2012 +0200
@@ -510,7 +510,7 @@ int __init construct_dom0(
 #define NR(_l,_h,_s) \
     (((((_h) + ((1UL<<(_s))-1)) & ~((1UL<<(_s))-1)) - \
        ((_l) & ~((1UL<<(_s))-1))) >> (_s))
-        if ( (1 + /* # L4 */
+        if ( (!is_pv_32on64_domain(d) + /* # L4 */
               NR(v_start, v_end, L4_PAGETABLE_SHIFT) + /* # L3 */
               (!is_pv_32on64_domain(d) ?
                NR(v_start, v_end, L3_PAGETABLE_SHIFT) : /* # L2 */
@@ -756,6 +756,8 @@ int __init construct_dom0(
             panic("Not enough RAM for domain 0 PML4.\n");
         page->u.inuse.type_info = PGT_l4_page_table|PGT_validated|1;
         l4start = l4tab = page_to_virt(page);
+        maddr_to_page(mpt_alloc)->u.inuse.type_info = PGT_l3_page_table;
+        l3start = __va(mpt_alloc); mpt_alloc += PAGE_SIZE;
     }
     copy_page(l4tab, idle_pg_table);
     l4tab[0] = l4e_empty(); /* zap trampoline mapping */
@@ -787,9 +789,13 @@ int __init construct_dom0(
                     l2tab += l2_table_offset(v_start);
                 if ( !((unsigned long)l3tab & (PAGE_SIZE-1)) )
                 {
-                    maddr_to_page(mpt_alloc)->u.inuse.type_info =
-                        PGT_l3_page_table;
-                    l3start = l3tab = __va(mpt_alloc); mpt_alloc += PAGE_SIZE;
+                    if ( count || !l3start )
+                    {
+                        maddr_to_page(mpt_alloc)->u.inuse.type_info =
+                            PGT_l3_page_table;
+                        l3start = __va(mpt_alloc); mpt_alloc += PAGE_SIZE;
+                    }
+                    l3tab = l3start;
                     clear_page(l3tab);
                     if ( count == 0 )
                         l3tab += l3_table_offset(v_start);
@@ -938,7 +944,7 @@ int __init construct_dom0(
     if ( !vinitrd_start && initrd_len )
         si->flags   |= SIF_MOD_START_PFN;
     si->flags       |= (xen_processor_pmbits << 8) & SIF_PM_MASK;
-    si->pt_base      = vpt_start + 2 * PAGE_SIZE * !!is_pv_32on64_domain(d);
+    si->pt_base      = vpt_start;
     si->nr_pt_frames = nr_pt_pages;
     si->mfn_list     = vphysmap_start;
     snprintf(si->magic, sizeof(si->magic), "xen-3.0-x86_%d%s",

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 03:33:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 03: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.xen.org>)
	id 1TBHE2-0001Z6-TQ; Tue, 11 Sep 2012 03:33:22 +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 1TBHE1-0001WK-T8
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:22 +0000
Received: from [85.158.138.51:7827] by server-10.bemta-3.messagelabs.com id
	85/D2-10411-001BE405; Tue, 11 Sep 2012 03:33:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-174.messagelabs.com!1347334388!11122413!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26188 invoked from network); 11 Sep 2012 03:33:09 -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;
	11 Sep 2012 03: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 1TBHDo-0001GH-Cf
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDn-0000w1-VX
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:08 +0000
Message-Id: <E1TBHDn-0000w1-VX@xenbits.xen.org>
Date: Tue, 11 Sep 2012 03:33:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Update Xen version to 4.2.0-rc4
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347016090 -3600
# Node ID 68640a3c99cefa86ae70fc49871025864e5671f2
# Parent  a64f4e1079510c4cfebb51a9a8e9d94f4d1258b0
Update Xen version to 4.2.0-rc4
---


diff -r a64f4e107951 -r 68640a3c99ce Config.mk
--- a/Config.mk	Fri Sep 07 11:09:46 2012 +0100
+++ b/Config.mk	Fri Sep 07 12:08:10 2012 +0100
@@ -214,9 +214,7 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= bacc0d302445c75f18f4c826750fb5853b60e7ca
-# Thu Sep 6 17:05:30 2012 +0100
-# Disable qemu monitor by default.  The qemu monitor is an overly
+QEMU_TAG ?= xen-4.2.0-rc4
 
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.
diff -r a64f4e107951 -r 68640a3c99ce xen/Makefile
--- a/xen/Makefile	Fri Sep 07 11:09:46 2012 +0100
+++ b/xen/Makefile	Fri Sep 07 12:08:10 2012 +0100
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 2
-export XEN_EXTRAVERSION ?= .0-rc4-pre$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .0-rc4$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 03:33:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 03: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.xen.org>)
	id 1TBHE2-0001Z6-TQ; Tue, 11 Sep 2012 03:33:22 +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 1TBHE1-0001WK-T8
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:22 +0000
Received: from [85.158.138.51:7827] by server-10.bemta-3.messagelabs.com id
	85/D2-10411-001BE405; Tue, 11 Sep 2012 03:33:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-174.messagelabs.com!1347334388!11122413!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26188 invoked from network); 11 Sep 2012 03:33:09 -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;
	11 Sep 2012 03: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 1TBHDo-0001GH-Cf
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDn-0000w1-VX
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:08 +0000
Message-Id: <E1TBHDn-0000w1-VX@xenbits.xen.org>
Date: Tue, 11 Sep 2012 03:33:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Update Xen version to 4.2.0-rc4
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347016090 -3600
# Node ID 68640a3c99cefa86ae70fc49871025864e5671f2
# Parent  a64f4e1079510c4cfebb51a9a8e9d94f4d1258b0
Update Xen version to 4.2.0-rc4
---


diff -r a64f4e107951 -r 68640a3c99ce Config.mk
--- a/Config.mk	Fri Sep 07 11:09:46 2012 +0100
+++ b/Config.mk	Fri Sep 07 12:08:10 2012 +0100
@@ -214,9 +214,7 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= bacc0d302445c75f18f4c826750fb5853b60e7ca
-# Thu Sep 6 17:05:30 2012 +0100
-# Disable qemu monitor by default.  The qemu monitor is an overly
+QEMU_TAG ?= xen-4.2.0-rc4
 
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.
diff -r a64f4e107951 -r 68640a3c99ce xen/Makefile
--- a/xen/Makefile	Fri Sep 07 11:09:46 2012 +0100
+++ b/xen/Makefile	Fri Sep 07 12:08:10 2012 +0100
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 2
-export XEN_EXTRAVERSION ?= .0-rc4-pre$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .0-rc4$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 03:33:33 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 03:33:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TBHEC-0001fC-3b; Tue, 11 Sep 2012 03:33:32 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHEA-0001eB-L9
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:30 +0000
Received: from [85.158.143.99:20565] by server-2.bemta-4.messagelabs.com id
	A0/7E-21239-901BE405; Tue, 11 Sep 2012 03:33:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1347334394!23232386!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18243 invoked from network); 11 Sep 2012 03:33: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;
	11 Sep 2012 03:33: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 1TBHDt-0001Go-Ti
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDt-0000yj-Re
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:13 +0000
Message-Id: <E1TBHDt-0000yj-Re@xenbits.xen.org>
Date: Tue, 11 Sep 2012 03:33:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] adjust a few RCU domain locking calls
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347033492 -7200
# Node ID c70d70d85306b3e4a0538353be131100c5ee38d5
# Parent  0376c85caaf34fe3cc8c3327f7a1d9ecd6f070b4
adjust a few RCU domain locking calls

x86's do_physdev_op() had a case where the locking was entirely
superfluous. Its physdev_map_pirq() further had a case where the lock
was being obtained too early, needlessly complicating early exit paths.

Grant table code had two open coded instances of
rcu_lock_target_domain_by_id(), and a third code section could be
consolidated by using the newly introduced helper function.

The memory hypercall code had two more instances of open coding
rcu_lock_target_domain_by_id(), but note that here this is not just
cleanup, but also fixes an error return path in memory_exchange() to
actually return an error.

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


diff -r 0376c85caaf3 -r c70d70d85306 xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c	Fri Sep 07 17:57:10 2012 +0200
+++ b/xen/arch/x86/physdev.c	Fri Sep 07 17:58:12 2012 +0200
@@ -90,14 +90,10 @@ static int physdev_hvm_map_pirq(
 int physdev_map_pirq(domid_t domid, int type, int *index, int *pirq_p,
                      struct msi_info *msi)
 {
-    struct domain *d;
+    struct domain *d = current->domain;
     int pirq, irq, ret = 0;
     void *map_data = NULL;
 
-    ret = rcu_lock_target_domain_by_id(domid, &d);
-    if ( ret )
-        return ret;
-
     if ( domid == DOMID_SELF && is_hvm_domain(d) )
     {
         /*
@@ -105,14 +101,15 @@ int physdev_map_pirq(domid_t domid, int 
          * 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, type, index, pirq_p);
-        goto free_domain;
+            return -EINVAL;
+
+        return physdev_hvm_map_pirq(d, type, index, pirq_p);
     }
 
+    ret = rcu_lock_target_domain_by_id(domid, &d);
+    if ( ret )
+        return ret;
+
     if ( !IS_PRIV_FOR(current->domain, d) )
     {
         ret = -EPERM;
@@ -696,13 +693,12 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
     }
     case PHYSDEVOP_get_free_pirq: {
         struct physdev_get_free_pirq out;
-        struct domain *d;
+        struct domain *d = v->domain;
 
         ret = -EFAULT;
         if ( copy_from_guest(&out, arg, 1) != 0 )
             break;
 
-        d = rcu_lock_current_domain();
         spin_lock(&d->event_lock);
 
         ret = get_free_pirq(d, out.type);
@@ -717,7 +713,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
         }
 
         spin_unlock(&d->event_lock);
-        rcu_unlock_domain(d);
 
         if ( ret >= 0 )
         {
diff -r 0376c85caaf3 -r c70d70d85306 xen/common/grant_table.c
--- a/xen/common/grant_table.c	Fri Sep 07 17:57:10 2012 +0200
+++ b/xen/common/grant_table.c	Fri Sep 07 17:58:12 2012 +0200
@@ -24,7 +24,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <xen/config.h>
+#include <xen/err.h>
 #include <xen/iocap.h>
 #include <xen/lib.h>
 #include <xen/sched.h>
@@ -195,6 +195,30 @@ double_gt_unlock(struct grant_table *lgt
         spin_unlock(&rgt->lock);
 }
 
+static struct domain *gt_lock_target_domain_by_id(domid_t dom)
+{
+    struct domain *d;
+    int rc = GNTST_general_error;
+
+    switch ( rcu_lock_target_domain_by_id(dom, &d) )
+    {
+    case 0:
+        return d;
+
+    case -ESRCH:
+        gdprintk(XENLOG_INFO, "Bad domid %d.\n", dom);
+        rc = GNTST_bad_domain;
+        break;
+
+    case -EPERM:
+        rc = GNTST_permission_denied;
+        break;
+    }
+
+    ASSERT(rc < 0 && -rc <= MAX_ERRNO);
+    return ERR_PTR(rc);
+}
+
 static inline int
 __get_maptrack_handle(
     struct grant_table *t)
@@ -1261,7 +1285,6 @@ gnttab_setup_table(
     struct grant_table *gt;
     int            i;
     unsigned long  gmfn;
-    domid_t        dom;
 
     if ( count != 1 )
         return -EINVAL;
@@ -1281,25 +1304,11 @@ gnttab_setup_table(
         goto out1;
     }
 
-    dom = op.dom;
-    if ( dom == DOMID_SELF )
+    d = gt_lock_target_domain_by_id(op.dom);
+    if ( IS_ERR(d) )
     {
-        d = rcu_lock_current_domain();
-    }
-    else
-    {
-        if ( unlikely((d = rcu_lock_domain_by_id(dom)) == NULL) )
-        {
-            gdprintk(XENLOG_INFO, "Bad domid %d.\n", dom);
-            op.status = GNTST_bad_domain;
-            goto out1;
-        }
-
-        if ( unlikely(!IS_PRIV_FOR(current->domain, d)) )
-        {
-            op.status = GNTST_permission_denied;
-            goto out2;
-        }
+        op.status = PTR_ERR(d);
+        goto out1;
     }
 
     if ( xsm_grant_setup(current->domain, d) )
@@ -1352,7 +1361,6 @@ gnttab_query_size(
 {
     struct gnttab_query_size op;
     struct domain *d;
-    domid_t        dom;
     int rc;
 
     if ( count != 1 )
@@ -1364,25 +1372,11 @@ gnttab_query_size(
         return -EFAULT;
     }
 
-    dom = op.dom;
-    if ( dom == DOMID_SELF )
+    d = gt_lock_target_domain_by_id(op.dom);
+    if ( IS_ERR(d) )
     {
-        d = rcu_lock_current_domain();
-    }
-    else
-    {
-        if ( unlikely((d = rcu_lock_domain_by_id(dom)) == NULL) )
-        {
-            gdprintk(XENLOG_INFO, "Bad domid %d.\n", dom);
-            op.status = GNTST_bad_domain;
-            goto query_out;
-        }
-
-        if ( unlikely(!IS_PRIV_FOR(current->domain, d)) )
-        {
-            op.status = GNTST_permission_denied;
-            goto query_out_unlock;
-        }
+        op.status = PTR_ERR(d);
+        goto query_out;
     }
 
     rc = xsm_grant_query_size(current->domain, d);
@@ -2251,15 +2245,10 @@ gnttab_get_status_frames(XEN_GUEST_HANDL
         return -EFAULT;
     }
 
-    rc = rcu_lock_target_domain_by_id(op.dom, &d);
-    if ( rc < 0 )
+    d = gt_lock_target_domain_by_id(op.dom);
+    if ( IS_ERR(d) )
     {
-        if ( rc == -ESRCH )
-            op.status = GNTST_bad_domain;
-        else if ( rc == -EPERM )
-            op.status = GNTST_permission_denied;
-        else
-            op.status = GNTST_general_error;
+        op.status = PTR_ERR(d);
         goto out1;
     }
     rc = xsm_grant_setup(current->domain, d);
diff -r 0376c85caaf3 -r c70d70d85306 xen/common/memory.c
--- a/xen/common/memory.c	Fri Sep 07 17:57:10 2012 +0200
+++ b/xen/common/memory.c	Fri Sep 07 17:58:12 2012 +0200
@@ -329,22 +329,9 @@ static long memory_exchange(XEN_GUEST_HA
         out_chunk_order = exch.in.extent_order - exch.out.extent_order;
     }
 
-    if ( likely(exch.in.domid == DOMID_SELF) )
-    {
-        d = rcu_lock_current_domain();
-    }
-    else
-    {
-        if ( (d = rcu_lock_domain_by_id(exch.in.domid)) == NULL )
-            goto fail_early;
-
-        if ( !IS_PRIV_FOR(current->domain, d) )
-        {
-            rcu_unlock_domain(d);
-            rc = -EPERM;
-            goto fail_early;
-        }
-    }
+    rc = rcu_lock_target_domain_by_id(exch.in.domid, &d);
+    if ( rc )
+        goto fail_early;
 
     memflags |= MEMF_bits(domain_clamp_alloc_bitsize(
         d,
@@ -583,20 +570,8 @@ long do_memory_op(unsigned long cmd, XEN
              && (reservation.mem_flags & XENMEMF_populate_on_demand) )
             args.memflags |= MEMF_populate_on_demand;
 
-        if ( likely(reservation.domid == DOMID_SELF) )
-        {
-            d = rcu_lock_current_domain();
-        }
-        else
-        {
-            if ( (d = rcu_lock_domain_by_id(reservation.domid)) == NULL )
-                return start_extent;
-            if ( !IS_PRIV_FOR(current->domain, d) )
-            {
-                rcu_unlock_domain(d);
-                return start_extent;
-            }
-        }
+        if ( unlikely(rcu_lock_target_domain_by_id(reservation.domid, &d)) )
+            return start_extent;
         args.domain = d;
 
         rc = xsm_memory_adjust_reservation(current->domain, d);

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 03:33:33 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 03:33:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TBHEC-0001fC-3b; Tue, 11 Sep 2012 03:33:32 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHEA-0001eB-L9
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:30 +0000
Received: from [85.158.143.99:20565] by server-2.bemta-4.messagelabs.com id
	A0/7E-21239-901BE405; Tue, 11 Sep 2012 03:33:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1347334394!23232386!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18243 invoked from network); 11 Sep 2012 03:33: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;
	11 Sep 2012 03:33: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 1TBHDt-0001Go-Ti
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBHDt-0000yj-Re
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 03:33:13 +0000
Message-Id: <E1TBHDt-0000yj-Re@xenbits.xen.org>
Date: Tue, 11 Sep 2012 03:33:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] adjust a few RCU domain locking calls
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347033492 -7200
# Node ID c70d70d85306b3e4a0538353be131100c5ee38d5
# Parent  0376c85caaf34fe3cc8c3327f7a1d9ecd6f070b4
adjust a few RCU domain locking calls

x86's do_physdev_op() had a case where the locking was entirely
superfluous. Its physdev_map_pirq() further had a case where the lock
was being obtained too early, needlessly complicating early exit paths.

Grant table code had two open coded instances of
rcu_lock_target_domain_by_id(), and a third code section could be
consolidated by using the newly introduced helper function.

The memory hypercall code had two more instances of open coding
rcu_lock_target_domain_by_id(), but note that here this is not just
cleanup, but also fixes an error return path in memory_exchange() to
actually return an error.

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


diff -r 0376c85caaf3 -r c70d70d85306 xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c	Fri Sep 07 17:57:10 2012 +0200
+++ b/xen/arch/x86/physdev.c	Fri Sep 07 17:58:12 2012 +0200
@@ -90,14 +90,10 @@ static int physdev_hvm_map_pirq(
 int physdev_map_pirq(domid_t domid, int type, int *index, int *pirq_p,
                      struct msi_info *msi)
 {
-    struct domain *d;
+    struct domain *d = current->domain;
     int pirq, irq, ret = 0;
     void *map_data = NULL;
 
-    ret = rcu_lock_target_domain_by_id(domid, &d);
-    if ( ret )
-        return ret;
-
     if ( domid == DOMID_SELF && is_hvm_domain(d) )
     {
         /*
@@ -105,14 +101,15 @@ int physdev_map_pirq(domid_t domid, int 
          * 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, type, index, pirq_p);
-        goto free_domain;
+            return -EINVAL;
+
+        return physdev_hvm_map_pirq(d, type, index, pirq_p);
     }
 
+    ret = rcu_lock_target_domain_by_id(domid, &d);
+    if ( ret )
+        return ret;
+
     if ( !IS_PRIV_FOR(current->domain, d) )
     {
         ret = -EPERM;
@@ -696,13 +693,12 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
     }
     case PHYSDEVOP_get_free_pirq: {
         struct physdev_get_free_pirq out;
-        struct domain *d;
+        struct domain *d = v->domain;
 
         ret = -EFAULT;
         if ( copy_from_guest(&out, arg, 1) != 0 )
             break;
 
-        d = rcu_lock_current_domain();
         spin_lock(&d->event_lock);
 
         ret = get_free_pirq(d, out.type);
@@ -717,7 +713,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
         }
 
         spin_unlock(&d->event_lock);
-        rcu_unlock_domain(d);
 
         if ( ret >= 0 )
         {
diff -r 0376c85caaf3 -r c70d70d85306 xen/common/grant_table.c
--- a/xen/common/grant_table.c	Fri Sep 07 17:57:10 2012 +0200
+++ b/xen/common/grant_table.c	Fri Sep 07 17:58:12 2012 +0200
@@ -24,7 +24,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <xen/config.h>
+#include <xen/err.h>
 #include <xen/iocap.h>
 #include <xen/lib.h>
 #include <xen/sched.h>
@@ -195,6 +195,30 @@ double_gt_unlock(struct grant_table *lgt
         spin_unlock(&rgt->lock);
 }
 
+static struct domain *gt_lock_target_domain_by_id(domid_t dom)
+{
+    struct domain *d;
+    int rc = GNTST_general_error;
+
+    switch ( rcu_lock_target_domain_by_id(dom, &d) )
+    {
+    case 0:
+        return d;
+
+    case -ESRCH:
+        gdprintk(XENLOG_INFO, "Bad domid %d.\n", dom);
+        rc = GNTST_bad_domain;
+        break;
+
+    case -EPERM:
+        rc = GNTST_permission_denied;
+        break;
+    }
+
+    ASSERT(rc < 0 && -rc <= MAX_ERRNO);
+    return ERR_PTR(rc);
+}
+
 static inline int
 __get_maptrack_handle(
     struct grant_table *t)
@@ -1261,7 +1285,6 @@ gnttab_setup_table(
     struct grant_table *gt;
     int            i;
     unsigned long  gmfn;
-    domid_t        dom;
 
     if ( count != 1 )
         return -EINVAL;
@@ -1281,25 +1304,11 @@ gnttab_setup_table(
         goto out1;
     }
 
-    dom = op.dom;
-    if ( dom == DOMID_SELF )
+    d = gt_lock_target_domain_by_id(op.dom);
+    if ( IS_ERR(d) )
     {
-        d = rcu_lock_current_domain();
-    }
-    else
-    {
-        if ( unlikely((d = rcu_lock_domain_by_id(dom)) == NULL) )
-        {
-            gdprintk(XENLOG_INFO, "Bad domid %d.\n", dom);
-            op.status = GNTST_bad_domain;
-            goto out1;
-        }
-
-        if ( unlikely(!IS_PRIV_FOR(current->domain, d)) )
-        {
-            op.status = GNTST_permission_denied;
-            goto out2;
-        }
+        op.status = PTR_ERR(d);
+        goto out1;
     }
 
     if ( xsm_grant_setup(current->domain, d) )
@@ -1352,7 +1361,6 @@ gnttab_query_size(
 {
     struct gnttab_query_size op;
     struct domain *d;
-    domid_t        dom;
     int rc;
 
     if ( count != 1 )
@@ -1364,25 +1372,11 @@ gnttab_query_size(
         return -EFAULT;
     }
 
-    dom = op.dom;
-    if ( dom == DOMID_SELF )
+    d = gt_lock_target_domain_by_id(op.dom);
+    if ( IS_ERR(d) )
     {
-        d = rcu_lock_current_domain();
-    }
-    else
-    {
-        if ( unlikely((d = rcu_lock_domain_by_id(dom)) == NULL) )
-        {
-            gdprintk(XENLOG_INFO, "Bad domid %d.\n", dom);
-            op.status = GNTST_bad_domain;
-            goto query_out;
-        }
-
-        if ( unlikely(!IS_PRIV_FOR(current->domain, d)) )
-        {
-            op.status = GNTST_permission_denied;
-            goto query_out_unlock;
-        }
+        op.status = PTR_ERR(d);
+        goto query_out;
     }
 
     rc = xsm_grant_query_size(current->domain, d);
@@ -2251,15 +2245,10 @@ gnttab_get_status_frames(XEN_GUEST_HANDL
         return -EFAULT;
     }
 
-    rc = rcu_lock_target_domain_by_id(op.dom, &d);
-    if ( rc < 0 )
+    d = gt_lock_target_domain_by_id(op.dom);
+    if ( IS_ERR(d) )
     {
-        if ( rc == -ESRCH )
-            op.status = GNTST_bad_domain;
-        else if ( rc == -EPERM )
-            op.status = GNTST_permission_denied;
-        else
-            op.status = GNTST_general_error;
+        op.status = PTR_ERR(d);
         goto out1;
     }
     rc = xsm_grant_setup(current->domain, d);
diff -r 0376c85caaf3 -r c70d70d85306 xen/common/memory.c
--- a/xen/common/memory.c	Fri Sep 07 17:57:10 2012 +0200
+++ b/xen/common/memory.c	Fri Sep 07 17:58:12 2012 +0200
@@ -329,22 +329,9 @@ static long memory_exchange(XEN_GUEST_HA
         out_chunk_order = exch.in.extent_order - exch.out.extent_order;
     }
 
-    if ( likely(exch.in.domid == DOMID_SELF) )
-    {
-        d = rcu_lock_current_domain();
-    }
-    else
-    {
-        if ( (d = rcu_lock_domain_by_id(exch.in.domid)) == NULL )
-            goto fail_early;
-
-        if ( !IS_PRIV_FOR(current->domain, d) )
-        {
-            rcu_unlock_domain(d);
-            rc = -EPERM;
-            goto fail_early;
-        }
-    }
+    rc = rcu_lock_target_domain_by_id(exch.in.domid, &d);
+    if ( rc )
+        goto fail_early;
 
     memflags |= MEMF_bits(domain_clamp_alloc_bitsize(
         d,
@@ -583,20 +570,8 @@ long do_memory_op(unsigned long cmd, XEN
              && (reservation.mem_flags & XENMEMF_populate_on_demand) )
             args.memflags |= MEMF_populate_on_demand;
 
-        if ( likely(reservation.domid == DOMID_SELF) )
-        {
-            d = rcu_lock_current_domain();
-        }
-        else
-        {
-            if ( (d = rcu_lock_domain_by_id(reservation.domid)) == NULL )
-                return start_extent;
-            if ( !IS_PRIV_FOR(current->domain, d) )
-            {
-                rcu_unlock_domain(d);
-                return start_extent;
-            }
-        }
+        if ( unlikely(rcu_lock_target_domain_by_id(reservation.domid, &d)) )
+            return start_extent;
         args.domain = d;
 
         rc = xsm_memory_adjust_reservation(current->domain, d);

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 07:00:38 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 07:00:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TBKSU-0003Sh-4f; Tue, 11 Sep 2012 07:00:30 +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 1TBKSS-0003SH-FF
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 07:00:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1347346820!9678329!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 380 invoked from network); 11 Sep 2012 07:00: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;
	11 Sep 2012 07:00:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TBKSK-0003lA-81
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 07:00:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TBKS9-0006Sl-Dj
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 07:00:12 +0000
Date: Tue, 11 Sep 2012 07:00:09 +0000
Message-Id: <E1TBKS9-0006Sl-Dj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] xen-all.c: fix multiply
	issue for int and uint types
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9e63a82dd13cdfc80c1f401cc99a682ab4b81542
Author: Dongxiao Xu <dongxiao.xu@intel.com>
Date:   Mon Sep 10 15:29:29 2012 +0000

    xen-all.c: fix multiply issue for int and uint types
    
    If the two multiply operands are int and uint types separately,
    the int type will be transformed to uint firstly, which is not the
    intent in our code piece. The fix is to add (int64_t) transform
    for the uint type before the multiply.
    
    upstream-commit: 14d40183725361e6350166099556c7661063921b
    
    Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen-all.c |   24 ++++++++++++++++--------
 1 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/xen-all.c b/xen-all.c
index 789e79b..3256509 100644
--- a/xen-all.c
+++ b/xen-all.c
@@ -648,7 +648,8 @@ static void cpu_ioreq_pio(ioreq_t *req)
 
             for (i = 0; i < req->count; i++) {
                 tmp = do_inp(req->addr, req->size);
-                cpu_physical_memory_write(req->data + (sign * i * req->size),
+                cpu_physical_memory_write(
+                        req->data + (sign * i * (int64_t)req->size),
                         (uint8_t *) &tmp, req->size);
             }
         }
@@ -659,7 +660,8 @@ static void cpu_ioreq_pio(ioreq_t *req)
             for (i = 0; i < req->count; i++) {
                 uint32_t tmp = 0;
 
-                cpu_physical_memory_read(req->data + (sign * i * req->size),
+                cpu_physical_memory_read(
+                        req->data + (sign * i * (int64_t)req->size),
                         (uint8_t*) &tmp, req->size);
                 do_outp(req->addr, req->size, tmp);
             }
@@ -676,12 +678,14 @@ static void cpu_ioreq_move(ioreq_t *req)
     if (!req->data_is_ptr) {
         if (req->dir == IOREQ_READ) {
             for (i = 0; i < req->count; i++) {
-                cpu_physical_memory_read(req->addr + (sign * i * req->size),
+                cpu_physical_memory_read(
+                        req->addr + (sign * i * (int64_t)req->size),
                         (uint8_t *) &req->data, req->size);
             }
         } else if (req->dir == IOREQ_WRITE) {
             for (i = 0; i < req->count; i++) {
-                cpu_physical_memory_write(req->addr + (sign * i * req->size),
+                cpu_physical_memory_write(
+                        req->addr + (sign * i * (int64_t)req->size),
                         (uint8_t *) &req->data, req->size);
             }
         }
@@ -690,16 +694,20 @@ static void cpu_ioreq_move(ioreq_t *req)
 
         if (req->dir == IOREQ_READ) {
             for (i = 0; i < req->count; i++) {
-                cpu_physical_memory_read(req->addr + (sign * i * req->size),
+                cpu_physical_memory_read(
+                        req->addr + (sign * i * (int64_t)req->size),
                         (uint8_t*) &tmp, req->size);
-                cpu_physical_memory_write(req->data + (sign * i * req->size),
+                cpu_physical_memory_write(
+                        req->data + (sign * i * (int64_t)req->size),
                         (uint8_t*) &tmp, req->size);
             }
         } else if (req->dir == IOREQ_WRITE) {
             for (i = 0; i < req->count; i++) {
-                cpu_physical_memory_read(req->data + (sign * i * req->size),
+                cpu_physical_memory_read(
+                        req->data + (sign * i * (int64_t)req->size),
                         (uint8_t*) &tmp, req->size);
-                cpu_physical_memory_write(req->addr + (sign * i * req->size),
+                cpu_physical_memory_write(
+                        req->addr + (sign * i * (int64_t)req->size),
                         (uint8_t*) &tmp, req->size);
             }
         }
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 07:00:38 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 07:00:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TBKSU-0003Sh-4f; Tue, 11 Sep 2012 07:00:30 +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 1TBKSS-0003SH-FF
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 07:00:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1347346820!9678329!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 380 invoked from network); 11 Sep 2012 07:00: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;
	11 Sep 2012 07:00:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TBKSK-0003lA-81
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 07:00:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TBKS9-0006Sl-Dj
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 07:00:12 +0000
Date: Tue, 11 Sep 2012 07:00:09 +0000
Message-Id: <E1TBKS9-0006Sl-Dj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] xen-all.c: fix multiply
	issue for int and uint types
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9e63a82dd13cdfc80c1f401cc99a682ab4b81542
Author: Dongxiao Xu <dongxiao.xu@intel.com>
Date:   Mon Sep 10 15:29:29 2012 +0000

    xen-all.c: fix multiply issue for int and uint types
    
    If the two multiply operands are int and uint types separately,
    the int type will be transformed to uint firstly, which is not the
    intent in our code piece. The fix is to add (int64_t) transform
    for the uint type before the multiply.
    
    upstream-commit: 14d40183725361e6350166099556c7661063921b
    
    Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen-all.c |   24 ++++++++++++++++--------
 1 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/xen-all.c b/xen-all.c
index 789e79b..3256509 100644
--- a/xen-all.c
+++ b/xen-all.c
@@ -648,7 +648,8 @@ static void cpu_ioreq_pio(ioreq_t *req)
 
             for (i = 0; i < req->count; i++) {
                 tmp = do_inp(req->addr, req->size);
-                cpu_physical_memory_write(req->data + (sign * i * req->size),
+                cpu_physical_memory_write(
+                        req->data + (sign * i * (int64_t)req->size),
                         (uint8_t *) &tmp, req->size);
             }
         }
@@ -659,7 +660,8 @@ static void cpu_ioreq_pio(ioreq_t *req)
             for (i = 0; i < req->count; i++) {
                 uint32_t tmp = 0;
 
-                cpu_physical_memory_read(req->data + (sign * i * req->size),
+                cpu_physical_memory_read(
+                        req->data + (sign * i * (int64_t)req->size),
                         (uint8_t*) &tmp, req->size);
                 do_outp(req->addr, req->size, tmp);
             }
@@ -676,12 +678,14 @@ static void cpu_ioreq_move(ioreq_t *req)
     if (!req->data_is_ptr) {
         if (req->dir == IOREQ_READ) {
             for (i = 0; i < req->count; i++) {
-                cpu_physical_memory_read(req->addr + (sign * i * req->size),
+                cpu_physical_memory_read(
+                        req->addr + (sign * i * (int64_t)req->size),
                         (uint8_t *) &req->data, req->size);
             }
         } else if (req->dir == IOREQ_WRITE) {
             for (i = 0; i < req->count; i++) {
-                cpu_physical_memory_write(req->addr + (sign * i * req->size),
+                cpu_physical_memory_write(
+                        req->addr + (sign * i * (int64_t)req->size),
                         (uint8_t *) &req->data, req->size);
             }
         }
@@ -690,16 +694,20 @@ static void cpu_ioreq_move(ioreq_t *req)
 
         if (req->dir == IOREQ_READ) {
             for (i = 0; i < req->count; i++) {
-                cpu_physical_memory_read(req->addr + (sign * i * req->size),
+                cpu_physical_memory_read(
+                        req->addr + (sign * i * (int64_t)req->size),
                         (uint8_t*) &tmp, req->size);
-                cpu_physical_memory_write(req->data + (sign * i * req->size),
+                cpu_physical_memory_write(
+                        req->data + (sign * i * (int64_t)req->size),
                         (uint8_t*) &tmp, req->size);
             }
         } else if (req->dir == IOREQ_WRITE) {
             for (i = 0; i < req->count; i++) {
-                cpu_physical_memory_read(req->data + (sign * i * req->size),
+                cpu_physical_memory_read(
+                        req->data + (sign * i * (int64_t)req->size),
                         (uint8_t*) &tmp, req->size);
-                cpu_physical_memory_write(req->addr + (sign * i * req->size),
+                cpu_physical_memory_write(
+                        req->addr + (sign * i * (int64_t)req->size),
                         (uint8_t*) &tmp, req->size);
             }
         }
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 13:55:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 13:55:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TBQvp-0005DG-GD; Tue, 11 Sep 2012 13:55:13 +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 1TBQvn-0005Cy-Ri
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 13:55:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1347371704!3625892!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1993 invoked from network); 11 Sep 2012 13:55:05 -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;
	11 Sep 2012 13:55:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TBQvg-0000Nv-9p
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 13:55:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TBQvf-0000io-T3
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 13:55:04 +0000
Date: Tue, 11 Sep 2012 13:55:03 +0000
Message-Id: <E1TBQvf-0000io-T3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Fix invalidate if memory
	requested was not bucket aligned
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cdf4d2bb4006805f209712fbb8ed1f83127e9984
Author: Frediano Ziglio <frediano.ziglio@citrix.com>
Date:   Mon Sep 10 18:10:52 2012 +0000

    Fix invalidate if memory requested was not bucket aligned
    
    When memory is mapped in qemu_map_cache with lock != 0 a reverse mapping
    is created pointing to the virtual address of location requested.
    The cached mapped entry is saved in last_address_vaddr with the memory
    location of the base virtual address (without bucket offset).
    However when this entry is invalidated the virtual address saved in the
    reverse mapping is used. This cause that the mapping is freed but the
    last_address_vaddr is not reset.
    
    upstream-commit: 27b7652ef515bb4c694f79d657d2052c72b19536
    
    Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen-mapcache.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen-mapcache.c b/xen-mapcache.c
index 16b7a86..5fb3f18 100644
--- a/xen-mapcache.c
+++ b/xen-mapcache.c
@@ -318,10 +318,6 @@ void xen_invalidate_map_cache_entry(uint8_t *buffer)
     target_phys_addr_t size;
     int found = 0;
 
-    if (mapcache->last_address_vaddr == buffer) {
-        mapcache->last_address_index = -1;
-    }
-
     QTAILQ_FOREACH(reventry, &mapcache->locked_entries, next) {
         if (reventry->vaddr_req == buffer) {
             paddr_index = reventry->paddr_index;
@@ -340,6 +336,11 @@ void xen_invalidate_map_cache_entry(uint8_t *buffer)
     QTAILQ_REMOVE(&mapcache->locked_entries, reventry, next);
     g_free(reventry);
 
+    if (mapcache->last_address_index == paddr_index) {
+        mapcache->last_address_index = -1;
+        mapcache->last_address_vaddr = NULL;
+    }
+
     entry = &mapcache->entry[paddr_index % mapcache->nr_buckets];
     while (entry && (entry->paddr_index != paddr_index || entry->size != size)) {
         pentry = entry;
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 13:55:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 13:55:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TBQvp-0005DG-GD; Tue, 11 Sep 2012 13:55:13 +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 1TBQvn-0005Cy-Ri
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 13:55:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1347371704!3625892!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1993 invoked from network); 11 Sep 2012 13:55:05 -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;
	11 Sep 2012 13:55:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TBQvg-0000Nv-9p
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 13:55:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TBQvf-0000io-T3
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 13:55:04 +0000
Date: Tue, 11 Sep 2012 13:55:03 +0000
Message-Id: <E1TBQvf-0000io-T3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Fix invalidate if memory
	requested was not bucket aligned
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cdf4d2bb4006805f209712fbb8ed1f83127e9984
Author: Frediano Ziglio <frediano.ziglio@citrix.com>
Date:   Mon Sep 10 18:10:52 2012 +0000

    Fix invalidate if memory requested was not bucket aligned
    
    When memory is mapped in qemu_map_cache with lock != 0 a reverse mapping
    is created pointing to the virtual address of location requested.
    The cached mapped entry is saved in last_address_vaddr with the memory
    location of the base virtual address (without bucket offset).
    However when this entry is invalidated the virtual address saved in the
    reverse mapping is used. This cause that the mapping is freed but the
    last_address_vaddr is not reset.
    
    upstream-commit: 27b7652ef515bb4c694f79d657d2052c72b19536
    
    Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen-mapcache.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen-mapcache.c b/xen-mapcache.c
index 16b7a86..5fb3f18 100644
--- a/xen-mapcache.c
+++ b/xen-mapcache.c
@@ -318,10 +318,6 @@ void xen_invalidate_map_cache_entry(uint8_t *buffer)
     target_phys_addr_t size;
     int found = 0;
 
-    if (mapcache->last_address_vaddr == buffer) {
-        mapcache->last_address_index = -1;
-    }
-
     QTAILQ_FOREACH(reventry, &mapcache->locked_entries, next) {
         if (reventry->vaddr_req == buffer) {
             paddr_index = reventry->paddr_index;
@@ -340,6 +336,11 @@ void xen_invalidate_map_cache_entry(uint8_t *buffer)
     QTAILQ_REMOVE(&mapcache->locked_entries, reventry, next);
     g_free(reventry);
 
+    if (mapcache->last_address_index == paddr_index) {
+        mapcache->last_address_index = -1;
+        mapcache->last_address_vaddr = NULL;
+    }
+
     entry = &mapcache->entry[paddr_index % mapcache->nr_buckets];
     while (entry && (entry->paddr_index != paddr_index || entry->size != size)) {
         pentry = entry;
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 18:55:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 18: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.xen.org>)
	id 1TBVcF-0003vZ-2m; Tue, 11 Sep 2012 18:55:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBVcD-0003v4-9f
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 18:55:17 +0000
Received: from [85.158.139.83:26352] by server-4.bemta-5.messagelabs.com id
	BD/13-23042-4198F405; Tue, 11 Sep 2012 18:55:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1347389714!25970575!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10326 invoked from network); 11 Sep 2012 18:55:15 -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;
	11 Sep 2012 18: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 1TBVcA-00049u-3X
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 18:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBVc9-0000dD-Rf
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 18:55:13 +0000
Message-Id: <E1TBVc9-0000dD-Rf@xenbits.xen.org>
Date: Tue, 11 Sep 2012 18:55:13 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] docs: document "ucode="
	hypervisor command line option
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347359647 -7200
# Node ID 8c67e5358efa8c7f4cb25f9dc1eb8c83c9dc5889
# Parent  5103702932b772a264ecd6c312b64aeb8fb55c92
docs: document "ucode=" hypervisor command line option

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen-unstable changeset: 25841:7d770de90b7f
xen-unstable date: Mon Sep 10 10:13:56 UTC 2012
---


diff -r 5103702932b7 -r 8c67e5358efa docs/misc/xen-command-line.markdown
--- a/docs/misc/xen-command-line.markdown	Tue Sep 11 12:33:31 2012 +0200
+++ b/docs/misc/xen-command-line.markdown	Tue Sep 11 12:34:07 2012 +0200
@@ -785,6 +785,19 @@ pages) must also be specified via the tb
 > `= unstable | skewed`
 
 ### ucode
+> `= <integer>`
+
+Specify the CPU microcode update blob module index. When positive, this
+specifies the n-th module (in the GrUB entry, zero based) to be used
+for updating CPU micrcode. When negative, counting starts at the end of
+the modules in the GrUB entry (so with the blob commonly being last,
+one could specify `ucode=-1`). Note that the value of zero is not valid
+here (entry zero, i.e. the first module, is always the Dom0 kernel
+image). Note further that use of this option has an unspecified effect
+when used with xen.efi (there the concept of modules doesn't exist, and
+the blob gets specified via the `ucode=<filename>` config file/section
+entry; see [EFI configuration file description](efi.html)).
+
 ### unrestricted\_guest
 > `= <boolean>`
 

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 18:55:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 18: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.xen.org>)
	id 1TBVcF-0003vZ-2m; Tue, 11 Sep 2012 18:55:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBVcD-0003v4-9f
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 18:55:17 +0000
Received: from [85.158.139.83:26352] by server-4.bemta-5.messagelabs.com id
	BD/13-23042-4198F405; Tue, 11 Sep 2012 18:55:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1347389714!25970575!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10326 invoked from network); 11 Sep 2012 18:55:15 -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;
	11 Sep 2012 18: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 1TBVcA-00049u-3X
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 18:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBVc9-0000dD-Rf
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 18:55:13 +0000
Message-Id: <E1TBVc9-0000dD-Rf@xenbits.xen.org>
Date: Tue, 11 Sep 2012 18:55:13 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] docs: document "ucode="
	hypervisor command line option
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347359647 -7200
# Node ID 8c67e5358efa8c7f4cb25f9dc1eb8c83c9dc5889
# Parent  5103702932b772a264ecd6c312b64aeb8fb55c92
docs: document "ucode=" hypervisor command line option

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen-unstable changeset: 25841:7d770de90b7f
xen-unstable date: Mon Sep 10 10:13:56 UTC 2012
---


diff -r 5103702932b7 -r 8c67e5358efa docs/misc/xen-command-line.markdown
--- a/docs/misc/xen-command-line.markdown	Tue Sep 11 12:33:31 2012 +0200
+++ b/docs/misc/xen-command-line.markdown	Tue Sep 11 12:34:07 2012 +0200
@@ -785,6 +785,19 @@ pages) must also be specified via the tb
 > `= unstable | skewed`
 
 ### ucode
+> `= <integer>`
+
+Specify the CPU microcode update blob module index. When positive, this
+specifies the n-th module (in the GrUB entry, zero based) to be used
+for updating CPU micrcode. When negative, counting starts at the end of
+the modules in the GrUB entry (so with the blob commonly being last,
+one could specify `ucode=-1`). Note that the value of zero is not valid
+here (entry zero, i.e. the first module, is always the Dom0 kernel
+image). Note further that use of this option has an unspecified effect
+when used with xen.efi (there the concept of modules doesn't exist, and
+the blob gets specified via the `ucode=<filename>` config file/section
+entry; see [EFI configuration file description](efi.html)).
+
 ### unrestricted\_guest
 > `= <boolean>`
 

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 18:55:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 18:55:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TBVcE-0003vE-0D; Tue, 11 Sep 2012 18:55:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBVcC-0003ux-CW
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 18:55:16 +0000
Received: from [85.158.143.35:29069] by server-2.bemta-4.messagelabs.com id
	FF/C2-21239-3198F405; Tue, 11 Sep 2012 18:55:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-21.messagelabs.com!1347389713!11966794!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28558 invoked from network); 11 Sep 2012 18:55:14 -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;
	11 Sep 2012 18: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 1TBVc9-00049r-Cq
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 18:55:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBVc8-0000cw-L5
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 18:55:13 +0000
Message-Id: <E1TBVc8-0000cw-L5@xenbits.xen.org>
Date: Tue, 11 Sep 2012 18:55:10 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] x86/MSI: fix 2nd S3 resume with
	interrupt remapping enabled
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347359611 -7200
# Node ID 5103702932b772a264ecd6c312b64aeb8fb55c92
# Parent  317c8a48d81ff4848f6e8991c44a978efc06df30
x86/MSI: fix 2nd S3 resume with interrupt remapping enabled

The first resume from S3 was corrupting internal data structures (in
that pci_restore_msi_state() updated the globally stored MSI message
from traditional to interrupt remapped format, which would then be
translated a second time during the second resume, breaking interrupt
delivery).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25834:0376c85caaf3
xen-unstable date: Fri Sep  7 15:57:10 UTC 2012
---


diff -r 317c8a48d81f -r 5103702932b7 xen/arch/x86/msi.c
--- a/xen/arch/x86/msi.c	Mon Sep 10 14:08:11 2012 +0100
+++ b/xen/arch/x86/msi.c	Tue Sep 11 12:33:31 2012 +0200
@@ -210,7 +210,10 @@ static void write_msi_msg(struct msi_des
     entry->msg = *msg;
 
     if ( iommu_enabled )
+    {
+        ASSERT(msg != &entry->msg);
         iommu_update_ire_from_msi(entry, msg);
+    }
 
     switch ( entry->msi_attrib.type )
     {
@@ -996,6 +999,7 @@ int pci_restore_msi_state(struct pci_dev
     int ret;
     struct msi_desc *entry, *tmp;
     struct irq_desc *desc;
+    struct msi_msg msg;
 
     ASSERT(spin_is_locked(&pcidevs_lock));
 
@@ -1030,7 +1034,8 @@ int pci_restore_msi_state(struct pci_dev
         else if ( entry->msi_attrib.type == PCI_CAP_ID_MSIX )
             msix_set_enable(pdev, 0);
 
-        write_msi_msg(entry, &entry->msg);
+        msg = entry->msg;
+        write_msi_msg(entry, &msg);
 
         msi_set_mask_bit(desc, entry->msi_attrib.masked);
 

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

From xen-changelog-bounces@lists.xen.org Tue Sep 11 18:55:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Sep 2012 18:55:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TBVcE-0003vE-0D; Tue, 11 Sep 2012 18:55:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBVcC-0003ux-CW
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 18:55:16 +0000
Received: from [85.158.143.35:29069] by server-2.bemta-4.messagelabs.com id
	FF/C2-21239-3198F405; Tue, 11 Sep 2012 18:55:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-21.messagelabs.com!1347389713!11966794!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28558 invoked from network); 11 Sep 2012 18:55:14 -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;
	11 Sep 2012 18: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 1TBVc9-00049r-Cq
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 18:55:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TBVc8-0000cw-L5
	for xen-changelog@lists.xensource.com; Tue, 11 Sep 2012 18:55:13 +0000
Message-Id: <E1TBVc8-0000cw-L5@xenbits.xen.org>
Date: Tue, 11 Sep 2012 18:55:10 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] x86/MSI: fix 2nd S3 resume with
	interrupt remapping enabled
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347359611 -7200
# Node ID 5103702932b772a264ecd6c312b64aeb8fb55c92
# Parent  317c8a48d81ff4848f6e8991c44a978efc06df30
x86/MSI: fix 2nd S3 resume with interrupt remapping enabled

The first resume from S3 was corrupting internal data structures (in
that pci_restore_msi_state() updated the globally stored MSI message
from traditional to interrupt remapped format, which would then be
translated a second time during the second resume, breaking interrupt
delivery).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25834:0376c85caaf3
xen-unstable date: Fri Sep  7 15:57:10 UTC 2012
---


diff -r 317c8a48d81f -r 5103702932b7 xen/arch/x86/msi.c
--- a/xen/arch/x86/msi.c	Mon Sep 10 14:08:11 2012 +0100
+++ b/xen/arch/x86/msi.c	Tue Sep 11 12:33:31 2012 +0200
@@ -210,7 +210,10 @@ static void write_msi_msg(struct msi_des
     entry->msg = *msg;
 
     if ( iommu_enabled )
+    {
+        ASSERT(msg != &entry->msg);
         iommu_update_ire_from_msi(entry, msg);
+    }
 
     switch ( entry->msi_attrib.type )
     {
@@ -996,6 +999,7 @@ int pci_restore_msi_state(struct pci_dev
     int ret;
     struct msi_desc *entry, *tmp;
     struct irq_desc *desc;
+    struct msi_msg msg;
 
     ASSERT(spin_is_locked(&pcidevs_lock));
 
@@ -1030,7 +1034,8 @@ int pci_restore_msi_state(struct pci_dev
         else if ( entry->msi_attrib.type == PCI_CAP_ID_MSIX )
             msix_set_enable(pdev, 0);
 
-        write_msi_msg(entry, &entry->msg);
+        msg = entry->msg;
+        write_msi_msg(entry, &msg);
 
         msi_set_mask_bit(desc, entry->msi_attrib.masked);
 

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

From xen-changelog-bounces@lists.xen.org Thu Sep 13 07:44:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Sep 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.xen.org>)
	id 1TC45t-0006xH-IW; Thu, 13 Sep 2012 07:44:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TC45r-0006x5-Mk
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 07:44:11 +0000
Received: from [85.158.143.99:64419] by server-1.bemta-4.messagelabs.com id
	B9/9A-12504-BCE81505; Thu, 13 Sep 2012 07:44:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-216.messagelabs.com!1347522249!29514727!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18252 invoked from network); 13 Sep 2012 07:44: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;
	13 Sep 2012 07: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 1TC45p-000670-4h
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 07:44:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TC45o-00085W-NR
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 07:44:08 +0000
Message-Id: <E1TC45o-00085W-NR@xenbits.xen.org>
Date: Thu, 13 Sep 2012 07:44:08 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] unmodified_drivers: handle
	IRQF_SAMPLE_RANDOM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1347457684 -3600
# Node ID 7f993b289dc41b23c8946e0f54a80fbfb8105b43
# Parent  8c67e5358efa8c7f4cb25f9dc1eb8c83c9dc5889
unmodified_drivers: handle IRQF_SAMPLE_RANDOM

The flag IRQF_SAMPLE_RANDOM was removed in 3.6-rc1. Add it only if it
is
defined. An additional call to add_interrupt_randomness is appearently
not needed because its now called unconditionally in
handle_irq_event_percpu().

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset:   25837:87cb4b6f53d3
xen-unstable date:        Mon Sep 10 10:54:13 2012 +0200
---


diff -r 8c67e5358efa -r 7f993b289dc4 unmodified_drivers/linux-2.6/platform-pci/evtchn.c
--- a/unmodified_drivers/linux-2.6/platform-pci/evtchn.c	Tue Sep 11 12:34:07 2012 +0200
+++ b/unmodified_drivers/linux-2.6/platform-pci/evtchn.c	Wed Sep 12 14:48:04 2012 +0100
@@ -350,7 +350,11 @@ int xen_irq_init(struct pci_dev *pdev)
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
 			   SA_SHIRQ | SA_SAMPLE_RANDOM | SA_INTERRUPT,
 #else
-			   IRQF_SHARED | IRQF_SAMPLE_RANDOM | IRQF_DISABLED,
+			   IRQF_SHARED |
+#ifdef IRQF_SAMPLE_RANDOM
+			   IRQF_SAMPLE_RANDOM |
+#endif
+			   IRQF_DISABLED,
 #endif
 			   "xen-platform-pci", pdev);
 }

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

From xen-changelog-bounces@lists.xen.org Thu Sep 13 07:44:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Sep 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.xen.org>)
	id 1TC45t-0006xH-IW; Thu, 13 Sep 2012 07:44:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TC45r-0006x5-Mk
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 07:44:11 +0000
Received: from [85.158.143.99:64419] by server-1.bemta-4.messagelabs.com id
	B9/9A-12504-BCE81505; Thu, 13 Sep 2012 07:44:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-216.messagelabs.com!1347522249!29514727!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18252 invoked from network); 13 Sep 2012 07:44: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;
	13 Sep 2012 07: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 1TC45p-000670-4h
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 07:44:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TC45o-00085W-NR
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 07:44:08 +0000
Message-Id: <E1TC45o-00085W-NR@xenbits.xen.org>
Date: Thu, 13 Sep 2012 07:44:08 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] unmodified_drivers: handle
	IRQF_SAMPLE_RANDOM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1347457684 -3600
# Node ID 7f993b289dc41b23c8946e0f54a80fbfb8105b43
# Parent  8c67e5358efa8c7f4cb25f9dc1eb8c83c9dc5889
unmodified_drivers: handle IRQF_SAMPLE_RANDOM

The flag IRQF_SAMPLE_RANDOM was removed in 3.6-rc1. Add it only if it
is
defined. An additional call to add_interrupt_randomness is appearently
not needed because its now called unconditionally in
handle_irq_event_percpu().

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset:   25837:87cb4b6f53d3
xen-unstable date:        Mon Sep 10 10:54:13 2012 +0200
---


diff -r 8c67e5358efa -r 7f993b289dc4 unmodified_drivers/linux-2.6/platform-pci/evtchn.c
--- a/unmodified_drivers/linux-2.6/platform-pci/evtchn.c	Tue Sep 11 12:34:07 2012 +0200
+++ b/unmodified_drivers/linux-2.6/platform-pci/evtchn.c	Wed Sep 12 14:48:04 2012 +0100
@@ -350,7 +350,11 @@ int xen_irq_init(struct pci_dev *pdev)
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
 			   SA_SHIRQ | SA_SAMPLE_RANDOM | SA_INTERRUPT,
 #else
-			   IRQF_SHARED | IRQF_SAMPLE_RANDOM | IRQF_DISABLED,
+			   IRQF_SHARED |
+#ifdef IRQF_SAMPLE_RANDOM
+			   IRQF_SAMPLE_RANDOM |
+#endif
+			   IRQF_DISABLED,
 #endif
 			   "xen-platform-pci", pdev);
 }

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

From xen-changelog-bounces@lists.xen.org Thu Sep 13 14:01:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Sep 2012 14:01:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TC9yl-0000Pd-28; Thu, 13 Sep 2012 14:01:15 +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 1TC9yj-0000PK-7U
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 14:01:13 +0000
Received: from [85.158.138.51:17600] by server-7.bemta-3.messagelabs.com id
	6D/B7-32000-827E1505; Thu, 13 Sep 2012 14:01:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-174.messagelabs.com!1347544870!11715476!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18837 invoked from network); 13 Sep 2012 14:01:11 -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;
	13 Sep 2012 14:01: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 1TC9yg-0002Iq-BE
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 14:01:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TC9xo-0001ZX-4d
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 14:00:16 +0000
Message-Id: <E1TC9xo-0001ZX-4d@xenbits.xen.org>
Date: Thu, 13 Sep 2012 14:00:15 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] QEMU_TAG update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1347370526 -3600
# Node ID 512168f88df9ab6f631a6c5d8f586fe105de04fc
# Parent  79444af3258c25576c0fe8b8e1683777e9d68b67
QEMU_TAG update
---


diff -r 79444af3258c -r 512168f88df9 Config.mk
--- a/Config.mk	Wed Sep 05 12:40:12 2012 +0100
+++ b/Config.mk	Tue Sep 11 14:35:26 2012 +0100
@@ -178,9 +178,9 @@ endif
 # CONFIG_QEMU ?= ../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG := 091149d364e893e643a5da3175c3f84d2163cb3e
-# Wed Sep 5 12:31:40 2012 +0100                                                
-# console: bounds check whenever changing the cursor due to an escape code     
+QEMU_TAG ?= d7d453f51459b591faa96d1c123b5bfff7c5b6b6
+# Thu Sep 6 17:05:30 2012 +0100
+# Disable qemu monitor by default.  The qemu monitor is an overly
 
 OCAML_XENSTORED_REPO=http://xenbits.xensource.com/ext/xen-ocaml-tools.hg
 

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

From xen-changelog-bounces@lists.xen.org Thu Sep 13 14:01:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Sep 2012 14:01:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TC9yl-0000Pd-28; Thu, 13 Sep 2012 14:01:15 +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 1TC9yj-0000PK-7U
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 14:01:13 +0000
Received: from [85.158.138.51:17600] by server-7.bemta-3.messagelabs.com id
	6D/B7-32000-827E1505; Thu, 13 Sep 2012 14:01:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-174.messagelabs.com!1347544870!11715476!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18837 invoked from network); 13 Sep 2012 14:01:11 -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;
	13 Sep 2012 14:01: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 1TC9yg-0002Iq-BE
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 14:01:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TC9xo-0001ZX-4d
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 14:00:16 +0000
Message-Id: <E1TC9xo-0001ZX-4d@xenbits.xen.org>
Date: Thu, 13 Sep 2012 14:00:15 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] QEMU_TAG update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1347370526 -3600
# Node ID 512168f88df9ab6f631a6c5d8f586fe105de04fc
# Parent  79444af3258c25576c0fe8b8e1683777e9d68b67
QEMU_TAG update
---


diff -r 79444af3258c -r 512168f88df9 Config.mk
--- a/Config.mk	Wed Sep 05 12:40:12 2012 +0100
+++ b/Config.mk	Tue Sep 11 14:35:26 2012 +0100
@@ -178,9 +178,9 @@ endif
 # CONFIG_QEMU ?= ../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG := 091149d364e893e643a5da3175c3f84d2163cb3e
-# Wed Sep 5 12:31:40 2012 +0100                                                
-# console: bounds check whenever changing the cursor due to an escape code     
+QEMU_TAG ?= d7d453f51459b591faa96d1c123b5bfff7c5b6b6
+# Thu Sep 6 17:05:30 2012 +0100
+# Disable qemu monitor by default.  The qemu monitor is an overly
 
 OCAML_XENSTORED_REPO=http://xenbits.xensource.com/ext/xen-ocaml-tools.hg
 

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

From xen-changelog-bounces@lists.xen.org Thu Sep 13 14:01:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Sep 2012 14:01:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TC9yu-0000Qt-5C; Thu, 13 Sep 2012 14:01:24 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TC9ys-0000Qc-4U
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 14:01:22 +0000
Received: from [85.158.143.35:55397] by server-3.bemta-4.messagelabs.com id
	56/90-08232-137E1505; Thu, 13 Sep 2012 14:01:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-21.messagelabs.com!1347544871!10413540!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19707 invoked from network); 13 Sep 2012 14:01:12 -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;
	13 Sep 2012 14:01: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 1TC9yh-0002It-AY
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 14:01:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TC9yh-0001bI-0I
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 14:01:11 +0000
Message-Id: <E1TC9yh-0001bI-0I@xenbits.xen.org>
Date: Thu, 13 Sep 2012 14:01:10 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] QEMU_TAG fix to refer to correct
	tree
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1347445083 -3600
# Node ID 1d1538beeadadebc0665bae56cfce6d58c51dc09
# Parent  512168f88df9ab6f631a6c5d8f586fe105de04fc
QEMU_TAG fix to refer to correct tree
---


diff -r 512168f88df9 -r 1d1538beeada Config.mk
--- a/Config.mk	Tue Sep 11 14:35:26 2012 +0100
+++ b/Config.mk	Wed Sep 12 11:18:03 2012 +0100
@@ -178,7 +178,7 @@ endif
 # CONFIG_QEMU ?= ../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= d7d453f51459b591faa96d1c123b5bfff7c5b6b6
+QEMU_TAG ?= eaa1bd612f50d2f253738ed19e14981e4ede98a5
 # Thu Sep 6 17:05:30 2012 +0100
 # Disable qemu monitor by default.  The qemu monitor is an overly
 

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

From xen-changelog-bounces@lists.xen.org Thu Sep 13 14:01:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Sep 2012 14:01:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TC9yu-0000Qt-5C; Thu, 13 Sep 2012 14:01:24 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TC9ys-0000Qc-4U
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 14:01:22 +0000
Received: from [85.158.143.35:55397] by server-3.bemta-4.messagelabs.com id
	56/90-08232-137E1505; Thu, 13 Sep 2012 14:01:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-21.messagelabs.com!1347544871!10413540!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19707 invoked from network); 13 Sep 2012 14:01:12 -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;
	13 Sep 2012 14:01: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 1TC9yh-0002It-AY
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 14:01:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TC9yh-0001bI-0I
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 14:01:11 +0000
Message-Id: <E1TC9yh-0001bI-0I@xenbits.xen.org>
Date: Thu, 13 Sep 2012 14:01:10 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] QEMU_TAG fix to refer to correct
	tree
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1347445083 -3600
# Node ID 1d1538beeadadebc0665bae56cfce6d58c51dc09
# Parent  512168f88df9ab6f631a6c5d8f586fe105de04fc
QEMU_TAG fix to refer to correct tree
---


diff -r 512168f88df9 -r 1d1538beeada Config.mk
--- a/Config.mk	Tue Sep 11 14:35:26 2012 +0100
+++ b/Config.mk	Wed Sep 12 11:18:03 2012 +0100
@@ -178,7 +178,7 @@ endif
 # CONFIG_QEMU ?= ../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= d7d453f51459b591faa96d1c123b5bfff7c5b6b6
+QEMU_TAG ?= eaa1bd612f50d2f253738ed19e14981e4ede98a5
 # Thu Sep 6 17:05:30 2012 +0100
 # Disable qemu monitor by default.  The qemu monitor is an overly
 

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

From xen-changelog-bounces@lists.xen.org Thu Sep 13 17:33:15 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Sep 2012 17:33:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCDHs-0002Fn-8t; Thu, 13 Sep 2012 17:33:12 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCDHr-0002FY-LC
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 17:33:11 +0000
Received: from [85.158.143.35:44223] by server-1.bemta-4.messagelabs.com id
	FD/2E-12504-7D812505; Thu, 13 Sep 2012 17:33:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-21.messagelabs.com!1347557589!18145184!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14267 invoked from network); 13 Sep 2012 17:33:10 -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;
	13 Sep 2012 17: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 1TCDHp-00053u-4a
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 17:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCDHo-00079v-WF
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 17:33:09 +0000
Message-Id: <E1TCDHo-00079v-WF@xenbits.xen.org>
Date: Thu, 13 Sep 2012 17: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] x86/passthrough: Fix corruption
	caused by race conditions between
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Andrew Cooper <andrew.cooper3@citrix.com>
# Date 1347474907 -3600
# Node ID c52e7afc96a91fca96364e5fda72626099161a54
# Parent  9be1175d2ac33bf9de241e6b3105f8fd029e9b4c
x86/passthrough: Fix corruption caused by race conditions between
device allocation and deallocation to a domain.

A toolstack, when dealing with a domain using PCIPassthrough, could
reasonably be expected to issue DOMCTL_deassign_device hypercalls to
remove all passed through devices before issuing a
DOMCTL_destroydomain hypercall to kill the domain.  In the case where
a toolstack is perhaps less sensible in this regard, the hypervisor
should not fall over.

In domain_kill(), pci_release_devices() searches the alldevs_list list
looking for PCI devices still assigned to the domain.  If the
toolstack has correctly deassigned all devices before killing the
domain, this loop does nothing.

However, if there are still devices attached to the domain, the loop
will call pci_cleanup_msi() without unbinding the pirq from the
domain.  This eventually calls destroy_irq() which xfree()'s the
action.

However, as the irq_desc->action pointer is abused in an unsafe
matter, without unbinding first (which at least correctly cleans up),
the action is actually an irq_guest_action_t* rather than an
irqaction*, meaning that the cpu_eoi_map is leaked, and eoi_timer is
free()'d while still being on a pcpu's inactive_timer list.  As a
result, when this free()'d memory gets reused, the inactive_timer list
becomes corrupt, and list_*** operations will corrupt hypervisor
memory.

If the above were not bad enough, the loop in pci_release_devices()
still leaves references to the irq it destroyed in
domain->arch.pirq_irq and irq_pirq, meaning that a later loop,
free_domain_pirqs(), which happens as a result of
complete_domain_destroy() will unbind and destroy all irqs which were
still bound to the domain, resulting in a double destroy of any irq
which was still bound to the domain at the point at which the
DOMCTL_destroydomain hypercall happened.

Because of the allocation of irqs from find_unassigned_irq(), the
lowest free irq number is going to be handed back from create_irq().

There is a further race condition between the original (incorrect)
call to destroy_irq() from pci_release_devices(), and the later call
to free_domain_pirqs() (which happens in a softirq context at some
point after the domain has officially died) during which the same irq
number (which is still referenced in a stale way in
domain->arch.pirq_irq and irq_pirq) has been allocated to a new domain
via a PHYSDEVOP_map_pirq hypercall (Say perhaps in the case of
rebooting a domain).

In this case, the cleanup for the dead domain will free the recently
bound irq under the feet of the new domain.  Furthermore, after the
irq has been incorrectly destroyed, the same domain with another
PHYSDEVOP_map_pirq hypercall can be allocated the same irq number as
before, leading to an error along the lines of:

../physdev.c:188: dom54: -1:-1 already mapped to 74

In this case, the pirq_irq and irq_pirq mappings get updated to the
new PCI device from the latter PHYSDEVOP_map_pirq hypercall, and the
IOMMU interrupt remapping registers get updated, leading to IOMMU
Primary Pending Fault due to source-id verification failure for
incoming interrupts from the passed through device.

The easy fix is to simply deassign the device in pci_release_devices()
and leave all the real cleanup to the free_domain_pirqs() which
correctly unbinds and destroys the irq without leaving stale
references around.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   25883:4fdaebea82d7
xen-unstable date:        Wed Sep 12 19:31:16 2012 +0100
---


diff -r 9be1175d2ac3 -r c52e7afc96a9 xen/drivers/passthrough/pci.c
--- a/xen/drivers/passthrough/pci.c	Tue Sep 11 14:31:12 2012 +0100
+++ b/xen/drivers/passthrough/pci.c	Wed Sep 12 19:35:07 2012 +0100
@@ -332,7 +332,6 @@ void pci_release_devices(struct domain *
     pci_clean_dpci_irqs(d);
     while ( (pdev = pci_get_pdev_by_domain(d, -1, -1)) )
     {
-        pci_cleanup_msi(pdev);
         bus = pdev->bus; devfn = pdev->devfn;
         if ( deassign_device(d, bus, devfn) )
             printk("domain %d: deassign device (%02x:%02x.%x) failed!\n",

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

From xen-changelog-bounces@lists.xen.org Thu Sep 13 17:33:15 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Sep 2012 17:33:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCDHs-0002Fn-8t; Thu, 13 Sep 2012 17:33:12 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCDHr-0002FY-LC
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 17:33:11 +0000
Received: from [85.158.143.35:44223] by server-1.bemta-4.messagelabs.com id
	FD/2E-12504-7D812505; Thu, 13 Sep 2012 17:33:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-21.messagelabs.com!1347557589!18145184!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14267 invoked from network); 13 Sep 2012 17:33:10 -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;
	13 Sep 2012 17: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 1TCDHp-00053u-4a
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 17:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCDHo-00079v-WF
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 17:33:09 +0000
Message-Id: <E1TCDHo-00079v-WF@xenbits.xen.org>
Date: Thu, 13 Sep 2012 17: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] x86/passthrough: Fix corruption
	caused by race conditions between
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Andrew Cooper <andrew.cooper3@citrix.com>
# Date 1347474907 -3600
# Node ID c52e7afc96a91fca96364e5fda72626099161a54
# Parent  9be1175d2ac33bf9de241e6b3105f8fd029e9b4c
x86/passthrough: Fix corruption caused by race conditions between
device allocation and deallocation to a domain.

A toolstack, when dealing with a domain using PCIPassthrough, could
reasonably be expected to issue DOMCTL_deassign_device hypercalls to
remove all passed through devices before issuing a
DOMCTL_destroydomain hypercall to kill the domain.  In the case where
a toolstack is perhaps less sensible in this regard, the hypervisor
should not fall over.

In domain_kill(), pci_release_devices() searches the alldevs_list list
looking for PCI devices still assigned to the domain.  If the
toolstack has correctly deassigned all devices before killing the
domain, this loop does nothing.

However, if there are still devices attached to the domain, the loop
will call pci_cleanup_msi() without unbinding the pirq from the
domain.  This eventually calls destroy_irq() which xfree()'s the
action.

However, as the irq_desc->action pointer is abused in an unsafe
matter, without unbinding first (which at least correctly cleans up),
the action is actually an irq_guest_action_t* rather than an
irqaction*, meaning that the cpu_eoi_map is leaked, and eoi_timer is
free()'d while still being on a pcpu's inactive_timer list.  As a
result, when this free()'d memory gets reused, the inactive_timer list
becomes corrupt, and list_*** operations will corrupt hypervisor
memory.

If the above were not bad enough, the loop in pci_release_devices()
still leaves references to the irq it destroyed in
domain->arch.pirq_irq and irq_pirq, meaning that a later loop,
free_domain_pirqs(), which happens as a result of
complete_domain_destroy() will unbind and destroy all irqs which were
still bound to the domain, resulting in a double destroy of any irq
which was still bound to the domain at the point at which the
DOMCTL_destroydomain hypercall happened.

Because of the allocation of irqs from find_unassigned_irq(), the
lowest free irq number is going to be handed back from create_irq().

There is a further race condition between the original (incorrect)
call to destroy_irq() from pci_release_devices(), and the later call
to free_domain_pirqs() (which happens in a softirq context at some
point after the domain has officially died) during which the same irq
number (which is still referenced in a stale way in
domain->arch.pirq_irq and irq_pirq) has been allocated to a new domain
via a PHYSDEVOP_map_pirq hypercall (Say perhaps in the case of
rebooting a domain).

In this case, the cleanup for the dead domain will free the recently
bound irq under the feet of the new domain.  Furthermore, after the
irq has been incorrectly destroyed, the same domain with another
PHYSDEVOP_map_pirq hypercall can be allocated the same irq number as
before, leading to an error along the lines of:

../physdev.c:188: dom54: -1:-1 already mapped to 74

In this case, the pirq_irq and irq_pirq mappings get updated to the
new PCI device from the latter PHYSDEVOP_map_pirq hypercall, and the
IOMMU interrupt remapping registers get updated, leading to IOMMU
Primary Pending Fault due to source-id verification failure for
incoming interrupts from the passed through device.

The easy fix is to simply deassign the device in pci_release_devices()
and leave all the real cleanup to the free_domain_pirqs() which
correctly unbinds and destroys the irq without leaving stale
references around.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   25883:4fdaebea82d7
xen-unstable date:        Wed Sep 12 19:31:16 2012 +0100
---


diff -r 9be1175d2ac3 -r c52e7afc96a9 xen/drivers/passthrough/pci.c
--- a/xen/drivers/passthrough/pci.c	Tue Sep 11 14:31:12 2012 +0100
+++ b/xen/drivers/passthrough/pci.c	Wed Sep 12 19:35:07 2012 +0100
@@ -332,7 +332,6 @@ void pci_release_devices(struct domain *
     pci_clean_dpci_irqs(d);
     while ( (pdev = pci_get_pdev_by_domain(d, -1, -1)) )
     {
-        pci_cleanup_msi(pdev);
         bus = pdev->bus; devfn = pdev->devfn;
         if ( deassign_device(d, bus, devfn) )
             printk("domain %d: deassign device (%02x:%02x.%x) failed!\n",

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

From xen-changelog-bounces@lists.xen.org Thu Sep 13 17:33:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Sep 2012 17:33:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCDHs-0002Fi-6Z; Thu, 13 Sep 2012 17:33:12 +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 1TCDHr-0002FV-K9
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 17:33:11 +0000
Received: from [85.158.138.51:21496] by server-8.bemta-3.messagelabs.com id
	CC/CD-24700-6D812505; Thu, 13 Sep 2012 17:33:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1347557589!30407308!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23310 invoked from network); 13 Sep 2012 17:33:10 -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;
	13 Sep 2012 17: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 1TCDHo-00053r-Na
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 17:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCDHo-00079g-Bw
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 17:33:08 +0000
Message-Id: <E1TCDHo-00079g-Bw@xenbits.xen.org>
Date: Thu, 13 Sep 2012 17: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] QEMU_TAG update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1347370272 -3600
# Node ID 9be1175d2ac33bf9de241e6b3105f8fd029e9b4c
# Parent  3e4782f17f5cf9f4956a947e8235a1a2a46350f3
QEMU_TAG update
---


diff -r 3e4782f17f5c -r 9be1175d2ac3 Config.mk
--- a/Config.mk	Wed Sep 05 12:40:10 2012 +0100
+++ b/Config.mk	Tue Sep 11 14:31:12 2012 +0100
@@ -179,9 +179,9 @@ endif
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= 3220480734832a148d26f7a81f90af61c2ecfdd9
-# Wed Sep 5 12:31:40 2012 +0100                                                
-# console: bounds check whenever changing the cursor due to an escape code     
+QEMU_TAG ?= d7d453f51459b591faa96d1c123b5bfff7c5b6b6
+# Thu Sep 6 17:05:30 2012 +0100
+# Disable qemu monitor by default.  The qemu monitor is an overly
 
 # Optional components
 XENSTAT_XENTOP     ?= y

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

From xen-changelog-bounces@lists.xen.org Thu Sep 13 17:33:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Sep 2012 17:33:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCDHs-0002Fi-6Z; Thu, 13 Sep 2012 17:33:12 +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 1TCDHr-0002FV-K9
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 17:33:11 +0000
Received: from [85.158.138.51:21496] by server-8.bemta-3.messagelabs.com id
	CC/CD-24700-6D812505; Thu, 13 Sep 2012 17:33:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1347557589!30407308!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23310 invoked from network); 13 Sep 2012 17:33:10 -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;
	13 Sep 2012 17: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 1TCDHo-00053r-Na
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 17:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCDHo-00079g-Bw
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 17:33:08 +0000
Message-Id: <E1TCDHo-00079g-Bw@xenbits.xen.org>
Date: Thu, 13 Sep 2012 17: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] QEMU_TAG update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1347370272 -3600
# Node ID 9be1175d2ac33bf9de241e6b3105f8fd029e9b4c
# Parent  3e4782f17f5cf9f4956a947e8235a1a2a46350f3
QEMU_TAG update
---


diff -r 3e4782f17f5c -r 9be1175d2ac3 Config.mk
--- a/Config.mk	Wed Sep 05 12:40:10 2012 +0100
+++ b/Config.mk	Tue Sep 11 14:31:12 2012 +0100
@@ -179,9 +179,9 @@ endif
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= 3220480734832a148d26f7a81f90af61c2ecfdd9
-# Wed Sep 5 12:31:40 2012 +0100                                                
-# console: bounds check whenever changing the cursor due to an escape code     
+QEMU_TAG ?= d7d453f51459b591faa96d1c123b5bfff7c5b6b6
+# Thu Sep 6 17:05:30 2012 +0100
+# Disable qemu monitor by default.  The qemu monitor is an overly
 
 # Optional components
 XENSTAT_XENTOP     ?= y

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

From xen-changelog-bounces@lists.xen.org Thu Sep 13 23:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Sep 2012 23:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCIjf-0007BH-PH; Thu, 13 Sep 2012 23:22:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCIje-0007Al-NG
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 23:22:14 +0000
Received: from [85.158.139.83:49382] by server-11.bemta-5.messagelabs.com id
	3F/9E-24658-5AA62505; Thu, 13 Sep 2012 23:22:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-182.messagelabs.com!1347578530!25876035!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8184 invoked from network); 13 Sep 2012 23:22:11 -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;
	13 Sep 2012 23: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 1TCIja-0000ZC-Ht
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 23:22:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCIja-0007xH-6w
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 23:22:10 +0000
Message-Id: <E1TCIja-0007xH-6w@xenbits.xen.org>
Date: Thu, 13 Sep 2012 23:22:09 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Update Xen version to 4.2.0-rc5
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347535237 -3600
# Node ID 14164c5f22c88a9dc1cfd7178f84a7fab2b82aa8
# Parent  6171dc588d2ebcaf49c630c5ea3ab8a2ffd1698f
Update Xen version to 4.2.0-rc5
---


diff -r 6171dc588d2e -r 14164c5f22c8 xen/Makefile
--- a/xen/Makefile	Thu Sep 13 12:13:21 2012 +0100
+++ b/xen/Makefile	Thu Sep 13 12:20:37 2012 +0100
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 2
-export XEN_EXTRAVERSION ?= .0-rc4$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .0-rc5$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 

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

From xen-changelog-bounces@lists.xen.org Thu Sep 13 23:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Sep 2012 23:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCIjd-0007AV-Bi; Thu, 13 Sep 2012 23:22:13 +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 1TCIjb-0007AG-OA
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 23:22:11 +0000
Received: from [85.158.138.51:18653] by server-9.bemta-3.messagelabs.com id
	18/02-15390-2AA62505; Thu, 13 Sep 2012 23:22:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-174.messagelabs.com!1347578529!24118448!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15677 invoked from network); 13 Sep 2012 23:22:10 -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;
	13 Sep 2012 23: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 1TCIjY-0000Z3-QU
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 23:22:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCIjY-0007wY-D0
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 23:22:08 +0000
Message-Id: <E1TCIjY-0007wY-D0@xenbits.xen.org>
Date: Thu, 13 Sep 2012 23:22:07 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] xl.cfg: gfx_passthru
	documentation improvements
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============8775854384417869545=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============8775854384417869545==
Content-Type: text/plain

# HG changeset patch
# User Pasi Kärkkäinen <pasik@iki.fi>
# Date 1347473030 -3600
# Node ID 7550c9b55af27e7d046fcb643062827c576490a1
# Parent  7f993b289dc41b23c8946e0f54a80fbfb8105b43
xl.cfg: gfx_passthru documentation improvements

gfx_passthru: Document gfx_passthru makes the GPU become primary in
the guest
and other generic info about gfx_passthru.

Signed-off-by: Pasi Kärkkäinen <pasik@iki.fi>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
xen-unstable changeset:   25839:2dfea3dff550
xen-unstable date:        Mon Sep 10 11:13:54 2012 +0100
---


diff -r 7f993b289dc4 -r 7550c9b55af2 docs/man/xl.cfg.pod.5
--- a/docs/man/xl.cfg.pod.5	Wed Sep 12 14:48:04 2012 +0100
+++ b/docs/man/xl.cfg.pod.5	Wed Sep 12 19:03:50 2012 +0100
@@ -992,7 +992,44 @@ certainly belong in a more appropriate s
 
 =item B<gfx_passthru=BOOLEAN>
 
-Enable graphics device PCI passthrough. XXX which device is passed through ?
+Enable graphics device PCI passthrough. This option makes the passthru
+graphics card become primary graphics card in the VM, so the Qemu emulated
+graphics adapter is disabled, and the VNC console for the VM won't have
+any graphics output. All graphics output, including boot time Qemu BIOS
+messages from the VM, will go to the physical outputs of the passed thru
+physical graphics card.
+
+Graphics card PCI device to passthru is chosen with B<pci> option,
+exactly in the same way as normal Xen PCI device passthru/assignment is done.
+Note that gfx_passthru doesn't do any kind of sharing
+of the GPU, so you can only assign the GPU to one single VM at a time.
+
+gfx_passthru also enables various legacy VGA memory ranges, BARs, MMIOs,
+and ioports to be passed thru to the VM, since those are required
+for correct operation of things like VGA BIOS, text mode, VBE, etc.
+
+Enabling gfx_passthru option also copies the physical graphics card
+video BIOS to the guest memory, and executes the VBIOS in the guest
+to get the graphics card initialized.
+
+Most graphics adapters require vendor specific tweaks for properly
+working graphics passthru. See the XenVGAPassthroughTestedAdapters
+L<http://wiki.xen.org/wiki/XenVGAPassthroughTestedAdapters>
+wiki page for currently supported graphics cards for gfx_passthru.
+
+gfx_passthru is currently only supported with the qemu-xen-traditional
+device-model. Upstream qemu-xen device-model currently doesn't have
+support for gfx_passthru.
+
+Note that some graphics adapters (AMD/ATI cards, for example) don't
+necessarily require gfx_passthru option, so you can use the normal
+Xen PCI passthru to assign the graphics card as a secondary graphics card
+to the VM. Qemu emulated graphics card stays as the primary graphics card,
+and you get VNC output from the Qemu-emulated primary adapter.
+
+More information about Xen gfx_passthru feature is available
+on the XenVGAPassthrough L<http://wiki.xen.org/wiki/XenVGAPassthrough>
+wiki page.
 
 =item B<nomigrate=BOOLEAN>
 


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

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

From xen-changelog-bounces@lists.xen.org Thu Sep 13 23:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Sep 2012 23:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCIjf-0007BH-PH; Thu, 13 Sep 2012 23:22:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCIje-0007Al-NG
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 23:22:14 +0000
Received: from [85.158.139.83:49382] by server-11.bemta-5.messagelabs.com id
	3F/9E-24658-5AA62505; Thu, 13 Sep 2012 23:22:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-182.messagelabs.com!1347578530!25876035!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8184 invoked from network); 13 Sep 2012 23:22:11 -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;
	13 Sep 2012 23: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 1TCIja-0000ZC-Ht
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 23:22:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCIja-0007xH-6w
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 23:22:10 +0000
Message-Id: <E1TCIja-0007xH-6w@xenbits.xen.org>
Date: Thu, 13 Sep 2012 23:22:09 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Update Xen version to 4.2.0-rc5
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347535237 -3600
# Node ID 14164c5f22c88a9dc1cfd7178f84a7fab2b82aa8
# Parent  6171dc588d2ebcaf49c630c5ea3ab8a2ffd1698f
Update Xen version to 4.2.0-rc5
---


diff -r 6171dc588d2e -r 14164c5f22c8 xen/Makefile
--- a/xen/Makefile	Thu Sep 13 12:13:21 2012 +0100
+++ b/xen/Makefile	Thu Sep 13 12:20:37 2012 +0100
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 2
-export XEN_EXTRAVERSION ?= .0-rc4$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .0-rc5$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 

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

From xen-changelog-bounces@lists.xen.org Thu Sep 13 23:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Sep 2012 23:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCIjd-0007AV-Bi; Thu, 13 Sep 2012 23:22:13 +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 1TCIjb-0007AG-OA
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 23:22:11 +0000
Received: from [85.158.138.51:18653] by server-9.bemta-3.messagelabs.com id
	18/02-15390-2AA62505; Thu, 13 Sep 2012 23:22:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-174.messagelabs.com!1347578529!24118448!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15677 invoked from network); 13 Sep 2012 23:22:10 -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;
	13 Sep 2012 23: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 1TCIjY-0000Z3-QU
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 23:22:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCIjY-0007wY-D0
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 23:22:08 +0000
Message-Id: <E1TCIjY-0007wY-D0@xenbits.xen.org>
Date: Thu, 13 Sep 2012 23:22:07 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] xl.cfg: gfx_passthru
	documentation improvements
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============8775854384417869545=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============8775854384417869545==
Content-Type: text/plain

# HG changeset patch
# User Pasi Kärkkäinen <pasik@iki.fi>
# Date 1347473030 -3600
# Node ID 7550c9b55af27e7d046fcb643062827c576490a1
# Parent  7f993b289dc41b23c8946e0f54a80fbfb8105b43
xl.cfg: gfx_passthru documentation improvements

gfx_passthru: Document gfx_passthru makes the GPU become primary in
the guest
and other generic info about gfx_passthru.

Signed-off-by: Pasi Kärkkäinen <pasik@iki.fi>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
xen-unstable changeset:   25839:2dfea3dff550
xen-unstable date:        Mon Sep 10 11:13:54 2012 +0100
---


diff -r 7f993b289dc4 -r 7550c9b55af2 docs/man/xl.cfg.pod.5
--- a/docs/man/xl.cfg.pod.5	Wed Sep 12 14:48:04 2012 +0100
+++ b/docs/man/xl.cfg.pod.5	Wed Sep 12 19:03:50 2012 +0100
@@ -992,7 +992,44 @@ certainly belong in a more appropriate s
 
 =item B<gfx_passthru=BOOLEAN>
 
-Enable graphics device PCI passthrough. XXX which device is passed through ?
+Enable graphics device PCI passthrough. This option makes the passthru
+graphics card become primary graphics card in the VM, so the Qemu emulated
+graphics adapter is disabled, and the VNC console for the VM won't have
+any graphics output. All graphics output, including boot time Qemu BIOS
+messages from the VM, will go to the physical outputs of the passed thru
+physical graphics card.
+
+Graphics card PCI device to passthru is chosen with B<pci> option,
+exactly in the same way as normal Xen PCI device passthru/assignment is done.
+Note that gfx_passthru doesn't do any kind of sharing
+of the GPU, so you can only assign the GPU to one single VM at a time.
+
+gfx_passthru also enables various legacy VGA memory ranges, BARs, MMIOs,
+and ioports to be passed thru to the VM, since those are required
+for correct operation of things like VGA BIOS, text mode, VBE, etc.
+
+Enabling gfx_passthru option also copies the physical graphics card
+video BIOS to the guest memory, and executes the VBIOS in the guest
+to get the graphics card initialized.
+
+Most graphics adapters require vendor specific tweaks for properly
+working graphics passthru. See the XenVGAPassthroughTestedAdapters
+L<http://wiki.xen.org/wiki/XenVGAPassthroughTestedAdapters>
+wiki page for currently supported graphics cards for gfx_passthru.
+
+gfx_passthru is currently only supported with the qemu-xen-traditional
+device-model. Upstream qemu-xen device-model currently doesn't have
+support for gfx_passthru.
+
+Note that some graphics adapters (AMD/ATI cards, for example) don't
+necessarily require gfx_passthru option, so you can use the normal
+Xen PCI passthru to assign the graphics card as a secondary graphics card
+to the VM. Qemu emulated graphics card stays as the primary graphics card,
+and you get VNC output from the Qemu-emulated primary adapter.
+
+More information about Xen gfx_passthru feature is available
+on the XenVGAPassthrough L<http://wiki.xen.org/wiki/XenVGAPassthrough>
+wiki page.
 
 =item B<nomigrate=BOOLEAN>
 


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

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

From xen-changelog-bounces@lists.xen.org Thu Sep 13 23:22:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Sep 2012 23:22:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCIjd-0007Aa-Eb; Thu, 13 Sep 2012 23:22:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCIjc-0007AO-Iy
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 23:22:12 +0000
Received: from [85.158.143.99:29286] by server-2.bemta-4.messagelabs.com id
	55/A1-21239-3AA62505; Thu, 13 Sep 2012 23:22:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1347578530!23844740!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20842 invoked from network); 13 Sep 2012 23:22: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;
	13 Sep 2012 23: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 1TCIjZ-0000Z9-SU
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 23:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCIjZ-0007x2-Ks
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 23:22:09 +0000
Message-Id: <E1TCIjZ-0007x2-Ks@xenbits.xen.org>
Date: Thu, 13 Sep 2012 23:22:09 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] QEMU_TAG and
	QEMU_UPSTREAM_REVISION update for xen-4.2.0-rc5
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1347534801 -3600
# Node ID 6171dc588d2ebcaf49c630c5ea3ab8a2ffd1698f
# Parent  9cec8d14a1ea8a168f02aac8bbf8379e93f5b5fa
QEMU_TAG and QEMU_UPSTREAM_REVISION update for xen-4.2.0-rc5
---


diff -r 9cec8d14a1ea -r 6171dc588d2e Config.mk
--- a/Config.mk	Wed Sep 12 19:33:18 2012 +0100
+++ b/Config.mk	Thu Sep 13 12:13:21 2012 +0100
@@ -202,7 +202,7 @@ QEMU_UPSTREAM_URL ?= git://xenbits.xen.o
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 OVMF_UPSTREAM_REVISION ?= b0855f925c6e2e0b21fbb03fab4b5fb5b6876871
-QEMU_UPSTREAM_REVISION ?= master
+QEMU_UPSTREAM_REVISION ?= qemu-xen-4.2.0-rc5
 SEABIOS_UPSTREAM_TAG ?= rel-1.6.3.2
 # Sun Mar 11 09:27:07 2012 -0400
 # Update version to 1.6.3.2
@@ -214,7 +214,7 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= xen-4.2.0-rc4
+QEMU_TAG ?= xen-4.2.0-rc5
 
 # 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.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Sep 13 23:22:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Sep 2012 23:22:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCIjd-0007Aa-Eb; Thu, 13 Sep 2012 23:22:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCIjc-0007AO-Iy
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 23:22:12 +0000
Received: from [85.158.143.99:29286] by server-2.bemta-4.messagelabs.com id
	55/A1-21239-3AA62505; Thu, 13 Sep 2012 23:22:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1347578530!23844740!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20842 invoked from network); 13 Sep 2012 23:22: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;
	13 Sep 2012 23: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 1TCIjZ-0000Z9-SU
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 23:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCIjZ-0007x2-Ks
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 23:22:09 +0000
Message-Id: <E1TCIjZ-0007x2-Ks@xenbits.xen.org>
Date: Thu, 13 Sep 2012 23:22:09 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] QEMU_TAG and
	QEMU_UPSTREAM_REVISION update for xen-4.2.0-rc5
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1347534801 -3600
# Node ID 6171dc588d2ebcaf49c630c5ea3ab8a2ffd1698f
# Parent  9cec8d14a1ea8a168f02aac8bbf8379e93f5b5fa
QEMU_TAG and QEMU_UPSTREAM_REVISION update for xen-4.2.0-rc5
---


diff -r 9cec8d14a1ea -r 6171dc588d2e Config.mk
--- a/Config.mk	Wed Sep 12 19:33:18 2012 +0100
+++ b/Config.mk	Thu Sep 13 12:13:21 2012 +0100
@@ -202,7 +202,7 @@ QEMU_UPSTREAM_URL ?= git://xenbits.xen.o
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 OVMF_UPSTREAM_REVISION ?= b0855f925c6e2e0b21fbb03fab4b5fb5b6876871
-QEMU_UPSTREAM_REVISION ?= master
+QEMU_UPSTREAM_REVISION ?= qemu-xen-4.2.0-rc5
 SEABIOS_UPSTREAM_TAG ?= rel-1.6.3.2
 # Sun Mar 11 09:27:07 2012 -0400
 # Update version to 1.6.3.2
@@ -214,7 +214,7 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= xen-4.2.0-rc4
+QEMU_TAG ?= xen-4.2.0-rc5
 
 # 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.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Sep 13 23:22:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Sep 2012 23:22:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCIje-0007At-HG; Thu, 13 Sep 2012 23:22:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCIjd-0007AU-Ad
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 23:22:13 +0000
Received: from [85.158.143.35:52723] by server-3.bemta-4.messagelabs.com id
	5F/08-08232-4AA62505; Thu, 13 Sep 2012 23:22:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-21.messagelabs.com!1347578529!14922638!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25032 invoked from network); 13 Sep 2012 23:22:10 -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;
	13 Sep 2012 23: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 1TCIjZ-0000Z6-8p
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 23:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCIjZ-0007wn-3b
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 23:22:09 +0000
Message-Id: <E1TCIjZ-0007wn-3b@xenbits.xen.org>
Date: Thu, 13 Sep 2012 23:22:08 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] x86/passthrough: Fix corruption
	caused by race conditions between
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Andrew Cooper <andrew.cooper3@citrix.com>
# Date 1347474798 -3600
# Node ID 9cec8d14a1ea8a168f02aac8bbf8379e93f5b5fa
# Parent  7550c9b55af27e7d046fcb643062827c576490a1
x86/passthrough: Fix corruption caused by race conditions between
device allocation and deallocation to a domain.

A toolstack, when dealing with a domain using PCIPassthrough, could
reasonably be expected to issue DOMCTL_deassign_device hypercalls to
remove all passed through devices before issuing a
DOMCTL_destroydomain hypercall to kill the domain.  In the case where
a toolstack is perhaps less sensible in this regard, the hypervisor
should not fall over.

In domain_kill(), pci_release_devices() searches the alldevs_list list
looking for PCI devices still assigned to the domain.  If the
toolstack has correctly deassigned all devices before killing the
domain, this loop does nothing.

However, if there are still devices attached to the domain, the loop
will call pci_cleanup_msi() without unbinding the pirq from the
domain.  This eventually calls destroy_irq() which xfree()'s the
action.

However, as the irq_desc->action pointer is abused in an unsafe
matter, without unbinding first (which at least correctly cleans up),
the action is actually an irq_guest_action_t* rather than an
irqaction*, meaning that the cpu_eoi_map is leaked, and eoi_timer is
free()'d while still being on a pcpu's inactive_timer list.  As a
result, when this free()'d memory gets reused, the inactive_timer list
becomes corrupt, and list_*** operations will corrupt hypervisor
memory.

If the above were not bad enough, the loop in pci_release_devices()
still leaves references to the irq it destroyed in
domain->arch.pirq_irq and irq_pirq, meaning that a later loop,
free_domain_pirqs(), which happens as a result of
complete_domain_destroy() will unbind and destroy all irqs which were
still bound to the domain, resulting in a double destroy of any irq
which was still bound to the domain at the point at which the
DOMCTL_destroydomain hypercall happened.

Because of the allocation of irqs from find_unassigned_irq(), the
lowest free irq number is going to be handed back from create_irq().

There is a further race condition between the original (incorrect)
call to destroy_irq() from pci_release_devices(), and the later call
to free_domain_pirqs() (which happens in a softirq context at some
point after the domain has officially died) during which the same irq
number (which is still referenced in a stale way in
domain->arch.pirq_irq and irq_pirq) has been allocated to a new domain
via a PHYSDEVOP_map_pirq hypercall (Say perhaps in the case of
rebooting a domain).

In this case, the cleanup for the dead domain will free the recently
bound irq under the feet of the new domain.  Furthermore, after the
irq has been incorrectly destroyed, the same domain with another
PHYSDEVOP_map_pirq hypercall can be allocated the same irq number as
before, leading to an error along the lines of:

../physdev.c:188: dom54: -1:-1 already mapped to 74

In this case, the pirq_irq and irq_pirq mappings get updated to the
new PCI device from the latter PHYSDEVOP_map_pirq hypercall, and the
IOMMU interrupt remapping registers get updated, leading to IOMMU
Primary Pending Fault due to source-id verification failure for
incoming interrupts from the passed through device.

The easy fix is to simply deassign the device in pci_release_devices()
and leave all the real cleanup to the free_domain_pirqs() which
correctly unbinds and destroys the irq without leaving stale
references around.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   25883:4fdaebea82d7
xen-unstable date:        Wed Sep 12 19:31:16 2012 +0100
---


diff -r 7550c9b55af2 -r 9cec8d14a1ea xen/drivers/passthrough/pci.c
--- a/xen/drivers/passthrough/pci.c	Wed Sep 12 19:03:50 2012 +0100
+++ b/xen/drivers/passthrough/pci.c	Wed Sep 12 19:33:18 2012 +0100
@@ -551,7 +551,6 @@ void pci_release_devices(struct domain *
     pci_clean_dpci_irqs(d);
     while ( (pdev = pci_get_pdev_by_domain(d, -1, -1, -1)) )
     {
-        pci_cleanup_msi(pdev);
         bus = pdev->bus;
         devfn = pdev->devfn;
         if ( deassign_device(d, pdev->seg, bus, devfn) )

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

From xen-changelog-bounces@lists.xen.org Thu Sep 13 23:22:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Sep 2012 23:22:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCIje-0007At-HG; Thu, 13 Sep 2012 23:22:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCIjd-0007AU-Ad
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 23:22:13 +0000
Received: from [85.158.143.35:52723] by server-3.bemta-4.messagelabs.com id
	5F/08-08232-4AA62505; Thu, 13 Sep 2012 23:22:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-21.messagelabs.com!1347578529!14922638!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25032 invoked from network); 13 Sep 2012 23:22:10 -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;
	13 Sep 2012 23: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 1TCIjZ-0000Z6-8p
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 23:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCIjZ-0007wn-3b
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 23:22:09 +0000
Message-Id: <E1TCIjZ-0007wn-3b@xenbits.xen.org>
Date: Thu, 13 Sep 2012 23:22:08 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] x86/passthrough: Fix corruption
	caused by race conditions between
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Andrew Cooper <andrew.cooper3@citrix.com>
# Date 1347474798 -3600
# Node ID 9cec8d14a1ea8a168f02aac8bbf8379e93f5b5fa
# Parent  7550c9b55af27e7d046fcb643062827c576490a1
x86/passthrough: Fix corruption caused by race conditions between
device allocation and deallocation to a domain.

A toolstack, when dealing with a domain using PCIPassthrough, could
reasonably be expected to issue DOMCTL_deassign_device hypercalls to
remove all passed through devices before issuing a
DOMCTL_destroydomain hypercall to kill the domain.  In the case where
a toolstack is perhaps less sensible in this regard, the hypervisor
should not fall over.

In domain_kill(), pci_release_devices() searches the alldevs_list list
looking for PCI devices still assigned to the domain.  If the
toolstack has correctly deassigned all devices before killing the
domain, this loop does nothing.

However, if there are still devices attached to the domain, the loop
will call pci_cleanup_msi() without unbinding the pirq from the
domain.  This eventually calls destroy_irq() which xfree()'s the
action.

However, as the irq_desc->action pointer is abused in an unsafe
matter, without unbinding first (which at least correctly cleans up),
the action is actually an irq_guest_action_t* rather than an
irqaction*, meaning that the cpu_eoi_map is leaked, and eoi_timer is
free()'d while still being on a pcpu's inactive_timer list.  As a
result, when this free()'d memory gets reused, the inactive_timer list
becomes corrupt, and list_*** operations will corrupt hypervisor
memory.

If the above were not bad enough, the loop in pci_release_devices()
still leaves references to the irq it destroyed in
domain->arch.pirq_irq and irq_pirq, meaning that a later loop,
free_domain_pirqs(), which happens as a result of
complete_domain_destroy() will unbind and destroy all irqs which were
still bound to the domain, resulting in a double destroy of any irq
which was still bound to the domain at the point at which the
DOMCTL_destroydomain hypercall happened.

Because of the allocation of irqs from find_unassigned_irq(), the
lowest free irq number is going to be handed back from create_irq().

There is a further race condition between the original (incorrect)
call to destroy_irq() from pci_release_devices(), and the later call
to free_domain_pirqs() (which happens in a softirq context at some
point after the domain has officially died) during which the same irq
number (which is still referenced in a stale way in
domain->arch.pirq_irq and irq_pirq) has been allocated to a new domain
via a PHYSDEVOP_map_pirq hypercall (Say perhaps in the case of
rebooting a domain).

In this case, the cleanup for the dead domain will free the recently
bound irq under the feet of the new domain.  Furthermore, after the
irq has been incorrectly destroyed, the same domain with another
PHYSDEVOP_map_pirq hypercall can be allocated the same irq number as
before, leading to an error along the lines of:

../physdev.c:188: dom54: -1:-1 already mapped to 74

In this case, the pirq_irq and irq_pirq mappings get updated to the
new PCI device from the latter PHYSDEVOP_map_pirq hypercall, and the
IOMMU interrupt remapping registers get updated, leading to IOMMU
Primary Pending Fault due to source-id verification failure for
incoming interrupts from the passed through device.

The easy fix is to simply deassign the device in pci_release_devices()
and leave all the real cleanup to the free_domain_pirqs() which
correctly unbinds and destroys the irq without leaving stale
references around.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   25883:4fdaebea82d7
xen-unstable date:        Wed Sep 12 19:31:16 2012 +0100
---


diff -r 7550c9b55af2 -r 9cec8d14a1ea xen/drivers/passthrough/pci.c
--- a/xen/drivers/passthrough/pci.c	Wed Sep 12 19:03:50 2012 +0100
+++ b/xen/drivers/passthrough/pci.c	Wed Sep 12 19:33:18 2012 +0100
@@ -551,7 +551,6 @@ void pci_release_devices(struct domain *
     pci_clean_dpci_irqs(d);
     while ( (pdev = pci_get_pdev_by_domain(d, -1, -1, -1)) )
     {
-        pci_cleanup_msi(pdev);
         bus = pdev->bus;
         devfn = pdev->devfn;
         if ( deassign_device(d, pdev->seg, bus, devfn) )

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

From xen-changelog-bounces@lists.xen.org Thu Sep 13 23:22:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Sep 2012 23:22:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCIjg-0007BU-Rv; Thu, 13 Sep 2012 23:22:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCIjf-0007Ak-PO
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 23:22:15 +0000
Received: from [85.158.139.83:51103] by server-6.bemta-5.messagelabs.com id
	0F/BA-21336-5AA62505; Thu, 13 Sep 2012 23:22:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1347578531!30239972!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12311 invoked from network); 13 Sep 2012 23:22:12 -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;
	13 Sep 2012 23: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 1TCIjb-0000ZF-1K
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 23:22:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCIja-0007xX-Nx
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 23:22:10 +0000
Message-Id: <E1TCIja-0007xX-Nx@xenbits.xen.org>
Date: Thu, 13 Sep 2012 23:22:10 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Added tag 4.2.0-rc5 for changeset
	14164c5f22c8
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347535260 -3600
# Node ID 943fe729868fbf9a14af9919caf70127c528c3b3
# Parent  14164c5f22c88a9dc1cfd7178f84a7fab2b82aa8
Added tag 4.2.0-rc5 for changeset 14164c5f22c8
---


diff -r 14164c5f22c8 -r 943fe729868f .hgtags
--- a/.hgtags	Thu Sep 13 12:20:37 2012 +0100
+++ b/.hgtags	Thu Sep 13 12:21:00 2012 +0100
@@ -57,3 +57,4 @@ f4c47bcc01e13cb2e3b4b71fd588d86278875442
 d44f290e81df5f78f0e3545742e3c4ff5415b0a7 4.2.0-rc3
 68640a3c99cefa86ae70fc49871025864e5671f2 4.2.0-rc4
 528f0708b6db392e10303b7ed2ab529bb8b512b7 4.2.0-branched
+14164c5f22c88a9dc1cfd7178f84a7fab2b82aa8 4.2.0-rc5

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

From xen-changelog-bounces@lists.xen.org Thu Sep 13 23:22:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Sep 2012 23:22:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCIjg-0007BU-Rv; Thu, 13 Sep 2012 23:22:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCIjf-0007Ak-PO
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 23:22:15 +0000
Received: from [85.158.139.83:51103] by server-6.bemta-5.messagelabs.com id
	0F/BA-21336-5AA62505; Thu, 13 Sep 2012 23:22:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1347578531!30239972!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12311 invoked from network); 13 Sep 2012 23:22:12 -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;
	13 Sep 2012 23: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 1TCIjb-0000ZF-1K
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 23:22:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCIja-0007xX-Nx
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 23:22:10 +0000
Message-Id: <E1TCIja-0007xX-Nx@xenbits.xen.org>
Date: Thu, 13 Sep 2012 23:22:10 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Added tag 4.2.0-rc5 for changeset
	14164c5f22c8
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347535260 -3600
# Node ID 943fe729868fbf9a14af9919caf70127c528c3b3
# Parent  14164c5f22c88a9dc1cfd7178f84a7fab2b82aa8
Added tag 4.2.0-rc5 for changeset 14164c5f22c8
---


diff -r 14164c5f22c8 -r 943fe729868f .hgtags
--- a/.hgtags	Thu Sep 13 12:20:37 2012 +0100
+++ b/.hgtags	Thu Sep 13 12:21:00 2012 +0100
@@ -57,3 +57,4 @@ f4c47bcc01e13cb2e3b4b71fd588d86278875442
 d44f290e81df5f78f0e3545742e3c4ff5415b0a7 4.2.0-rc3
 68640a3c99cefa86ae70fc49871025864e5671f2 4.2.0-rc4
 528f0708b6db392e10303b7ed2ab529bb8b512b7 4.2.0-branched
+14164c5f22c88a9dc1cfd7178f84a7fab2b82aa8 4.2.0-rc5

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

From xen-changelog-bounces@lists.xen.org Thu Sep 13 23:22:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Sep 2012 23:22:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCIjf-0007BC-Mh; Thu, 13 Sep 2012 23:22:15 +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 1TCIje-0007Aj-8W
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 23:22:14 +0000
Received: from [85.158.138.51:18702] by server-12.bemta-3.messagelabs.com id
	12/4E-10384-5AA62505; Thu, 13 Sep 2012 23:22:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-174.messagelabs.com!1347578531!24118451!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.3 required=7.0 tests=ML_MARKETING,
  UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16004 invoked from network); 13 Sep 2012 23:22:12 -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;
	13 Sep 2012 23: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 1TCIjb-0000ZI-DX
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 23:22:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCIjb-0007xm-8y
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 23:22:11 +0000
Message-Id: <E1TCIjb-0007xm-8y@xenbits.xen.org>
Date: Thu, 13 Sep 2012 23:22:10 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Added signature for changeset
	14164c5f22c8
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347535269 -3600
# Node ID 4027d31caeb0955cf72e8df85e5dc89777761939
# Parent  943fe729868fbf9a14af9919caf70127c528c3b3
Added signature for changeset 14164c5f22c8
---


diff -r 943fe729868f -r 4027d31caeb0 .hgsigs
--- a/.hgsigs	Thu Sep 13 12:21:00 2012 +0100
+++ b/.hgsigs	Thu Sep 13 12:21:09 2012 +0100
@@ -9,3 +9,4 @@ 8e620dc570ce42564c1630de5798e23909ee809c
 f4c47bcc01e13cb2e3b4b71fd588d86278875442 0 iQEcBAABAgAGBQJQIpupAAoJEIP+FMlX6CvZnBwH/3qlibrquTmD2p3rcdVi/JkWixaKK3KH4Ows/76sAJYCdx9YkmtkgC4zyz5aph4Rfy7dYnQIUhbwNNdZNBDd0XOVkjQm0ZX1wQjv3yA3Eq9NOUDmfFWldF+oosOG3h/+MLm/36CkB7gFku1ENQ8kagytXe4rN3QdOiJ9Rz84BAv6nJoT/1OX+m+MlBs948orC23aNEfWxrsrv2s92v5fJcAfSLW/AtER2JnASIxWECJ/TOkuHtrO2QPoBymSnifM2R624L+ySwRxSxo+Owfpooje5eekk0ekifvdYtaJ3pOfoOCv8yGEtb7mXv62WowVkasUZa/q+rGdVpHuK0UlBjI=
 d44f290e81df5f78f0e3545742e3c4ff5415b0a7 0 iQEcBAABAgAGBQJQNji7AAoJEIP+FMlX6CvZvBcIAJPiA6ydvolYCvZsfGgafqCpcpG3f+PbUOwQRWfUcaKHPWFKnwRkmx9MAP9tEjXFNZcbimktDrofmee6XfLb8NLnCcHWZT8trRXYTNw2lM6DpK+AROUpAcShF3gCHQEtCJC6+NArD75aUkUji3awbGlhplHbyWvgvSSULhga+2xfYszRC7eI/g+7/f4JNkvqeWllAtd9fwftXaGhQi2V4LT5IimpJI7PivlDi0wi+BtqXHcmZhlnw3zpR51NRujsMVTNZMqe733kGdt8Y8j3vvsfXBye4+YAkEKFrzW3jTYlA9ws71oNVvWmwmOjOHpx6ASfquP3hhAoiHvb2c6Wims=
 68640a3c99cefa86ae70fc49871025864e5671f2 0 iQEcBAABAgAGBQJQSdgUAAoJEIP+FMlX6CvZeWUH/1SeYnKXtkt7n+WuMyF2LvCzZQApmOo+hqVB7m0Pe4Yh9bEq1PAE+sJOAoQIBklCpY3WFsNGQN8yIbYyWRzbIM7oavknwoUoSn50zMk12HczqHigXvhL/eOghRKNsK9BrQnRV+byNHRjzSHPReNxpzueKBOTrCMlXtYMDb94swc+hatEDItT4TwZcaNPri3kiWND0DPmOk58Ke96ml9rpomS1ff976hYAZl+N1Q3Pt998SXiaglZ9EeL0Y8cY759XqZII4D4o6/oQW8MzWrQZr4woHHU7MfK3OWslelzP486esHyyjotEWeelhgl/RjIl0crNBbmCWU15BOAw7wSZh4=
+14164c5f22c88a9dc1cfd7178f84a7fab2b82aa8 0 iQEcBAABAgAGBQJQUcGjAAoJEIP+FMlX6CvZvX4H/1QV1VSW//dsv8IVCHPnHO4njlqYNUgIRycS4EuCJ8SrFLgfR77y3DwJg1D+JrYIT80QfzNeU3g/bcqz+0koD/P7joV4ONFkrB7pHSfACmMY7nfQ1Z2qHePAfBQ+cVdx6rXEYkFAbPjOz6kAP3LmpRLPasU46H+oG1zKHRgc0uhNN3Vit7eIhx/hDvY2YZDjuIWCQpmJylRlJsvMbpk2CjLiy4nXMNTKd1nlTNPTuRISsVBLx/ToquWtiO2a2EVRE4E+JhRGHNdFwXBRfV1XDDVNNRj+SvDvyWs29WKEOfVyGpgAKd29j/5YPzuHqmCcCfNxuN6lDHL6NxtwjZdDJao=

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

From xen-changelog-bounces@lists.xen.org Thu Sep 13 23:22:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Sep 2012 23:22:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCIjf-0007BC-Mh; Thu, 13 Sep 2012 23:22:15 +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 1TCIje-0007Aj-8W
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 23:22:14 +0000
Received: from [85.158.138.51:18702] by server-12.bemta-3.messagelabs.com id
	12/4E-10384-5AA62505; Thu, 13 Sep 2012 23:22:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-174.messagelabs.com!1347578531!24118451!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.3 required=7.0 tests=ML_MARKETING,
  UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16004 invoked from network); 13 Sep 2012 23:22:12 -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;
	13 Sep 2012 23: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 1TCIjb-0000ZI-DX
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 23:22:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCIjb-0007xm-8y
	for xen-changelog@lists.xensource.com; Thu, 13 Sep 2012 23:22:11 +0000
Message-Id: <E1TCIjb-0007xm-8y@xenbits.xen.org>
Date: Thu, 13 Sep 2012 23:22:10 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Added signature for changeset
	14164c5f22c8
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347535269 -3600
# Node ID 4027d31caeb0955cf72e8df85e5dc89777761939
# Parent  943fe729868fbf9a14af9919caf70127c528c3b3
Added signature for changeset 14164c5f22c8
---


diff -r 943fe729868f -r 4027d31caeb0 .hgsigs
--- a/.hgsigs	Thu Sep 13 12:21:00 2012 +0100
+++ b/.hgsigs	Thu Sep 13 12:21:09 2012 +0100
@@ -9,3 +9,4 @@ 8e620dc570ce42564c1630de5798e23909ee809c
 f4c47bcc01e13cb2e3b4b71fd588d86278875442 0 iQEcBAABAgAGBQJQIpupAAoJEIP+FMlX6CvZnBwH/3qlibrquTmD2p3rcdVi/JkWixaKK3KH4Ows/76sAJYCdx9YkmtkgC4zyz5aph4Rfy7dYnQIUhbwNNdZNBDd0XOVkjQm0ZX1wQjv3yA3Eq9NOUDmfFWldF+oosOG3h/+MLm/36CkB7gFku1ENQ8kagytXe4rN3QdOiJ9Rz84BAv6nJoT/1OX+m+MlBs948orC23aNEfWxrsrv2s92v5fJcAfSLW/AtER2JnASIxWECJ/TOkuHtrO2QPoBymSnifM2R624L+ySwRxSxo+Owfpooje5eekk0ekifvdYtaJ3pOfoOCv8yGEtb7mXv62WowVkasUZa/q+rGdVpHuK0UlBjI=
 d44f290e81df5f78f0e3545742e3c4ff5415b0a7 0 iQEcBAABAgAGBQJQNji7AAoJEIP+FMlX6CvZvBcIAJPiA6ydvolYCvZsfGgafqCpcpG3f+PbUOwQRWfUcaKHPWFKnwRkmx9MAP9tEjXFNZcbimktDrofmee6XfLb8NLnCcHWZT8trRXYTNw2lM6DpK+AROUpAcShF3gCHQEtCJC6+NArD75aUkUji3awbGlhplHbyWvgvSSULhga+2xfYszRC7eI/g+7/f4JNkvqeWllAtd9fwftXaGhQi2V4LT5IimpJI7PivlDi0wi+BtqXHcmZhlnw3zpR51NRujsMVTNZMqe733kGdt8Y8j3vvsfXBye4+YAkEKFrzW3jTYlA9ws71oNVvWmwmOjOHpx6ASfquP3hhAoiHvb2c6Wims=
 68640a3c99cefa86ae70fc49871025864e5671f2 0 iQEcBAABAgAGBQJQSdgUAAoJEIP+FMlX6CvZeWUH/1SeYnKXtkt7n+WuMyF2LvCzZQApmOo+hqVB7m0Pe4Yh9bEq1PAE+sJOAoQIBklCpY3WFsNGQN8yIbYyWRzbIM7oavknwoUoSn50zMk12HczqHigXvhL/eOghRKNsK9BrQnRV+byNHRjzSHPReNxpzueKBOTrCMlXtYMDb94swc+hatEDItT4TwZcaNPri3kiWND0DPmOk58Ke96ml9rpomS1ff976hYAZl+N1Q3Pt998SXiaglZ9EeL0Y8cY759XqZII4D4o6/oQW8MzWrQZr4woHHU7MfK3OWslelzP486esHyyjotEWeelhgl/RjIl0crNBbmCWU15BOAw7wSZh4=
+14164c5f22c88a9dc1cfd7178f84a7fab2b82aa8 0 iQEcBAABAgAGBQJQUcGjAAoJEIP+FMlX6CvZvX4H/1QV1VSW//dsv8IVCHPnHO4njlqYNUgIRycS4EuCJ8SrFLgfR77y3DwJg1D+JrYIT80QfzNeU3g/bcqz+0koD/P7joV4ONFkrB7pHSfACmMY7nfQ1Z2qHePAfBQ+cVdx6rXEYkFAbPjOz6kAP3LmpRLPasU46H+oG1zKHRgc0uhNN3Vit7eIhx/hDvY2YZDjuIWCQpmJylRlJsvMbpk2CjLiy4nXMNTKd1nlTNPTuRISsVBLx/ToquWtiO2a2EVRE4E+JhRGHNdFwXBRfV1XDDVNNRj+SvDvyWs29WKEOfVyGpgAKd29j/5YPzuHqmCcCfNxuN6lDHL6NxtwjZdDJao=

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYI-0003Fh-C8; Fri, 14 Sep 2012 10:55:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYH-0003Fc-DW
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:13 +0000
Received: from [85.158.139.83:63015] by server-10.bemta-5.messagelabs.com id
	FB/CC-10969-01D03505; Fri, 14 Sep 2012 10:55:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1347620110!26540811!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19270 invoked from network); 14 Sep 2012 10:55:11 -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;
	14 Sep 2012 10: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 1TCTYE-00012p-J0
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYE-0000fO-25
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:10 +0000
Message-Id: <E1TCTYE-0000fO-25@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/hvm: don't give vector callback
	higher priority than NMI/MCE
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347288451 -7200
# Node ID a1f73e989c249d9d4357d2e6cdf983a83536a0ab
# Parent  7d770de90b7f92bb197bd54d8ac0941e2e5ae96a
x86/hvm: don't give vector callback higher priority than NMI/MCE

Those two should always be delivered first imo.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---


diff -r 7d770de90b7f -r a1f73e989c24 xen/arch/x86/hvm/irq.c
--- a/xen/arch/x86/hvm/irq.c	Mon Sep 10 11:13:56 2012 +0100
+++ b/xen/arch/x86/hvm/irq.c	Mon Sep 10 16:47:31 2012 +0200
@@ -395,16 +395,16 @@ struct hvm_intack hvm_vcpu_has_pending_i
     struct hvm_domain *plat = &v->domain->arch.hvm_domain;
     int vector;
 
-    if ( (plat->irq.callback_via_type == HVMIRQ_callback_vector)
-         && vcpu_info(v, evtchn_upcall_pending) )
-        return hvm_intack_vector(plat->irq.callback_via.vector);
-
     if ( unlikely(v->nmi_pending) )
         return hvm_intack_nmi;
 
     if ( unlikely(v->mce_pending) )
         return hvm_intack_mce;
 
+    if ( (plat->irq.callback_via_type == HVMIRQ_callback_vector)
+         && vcpu_info(v, evtchn_upcall_pending) )
+        return hvm_intack_vector(plat->irq.callback_via.vector);
+
     if ( vlapic_accept_pic_intr(v) && plat->vpic[0].int_output )
         return hvm_intack_pic(0);
 

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYI-0003Fh-C8; Fri, 14 Sep 2012 10:55:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYH-0003Fc-DW
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:13 +0000
Received: from [85.158.139.83:63015] by server-10.bemta-5.messagelabs.com id
	FB/CC-10969-01D03505; Fri, 14 Sep 2012 10:55:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1347620110!26540811!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19270 invoked from network); 14 Sep 2012 10:55:11 -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;
	14 Sep 2012 10: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 1TCTYE-00012p-J0
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYE-0000fO-25
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:10 +0000
Message-Id: <E1TCTYE-0000fO-25@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/hvm: don't give vector callback
	higher priority than NMI/MCE
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347288451 -7200
# Node ID a1f73e989c249d9d4357d2e6cdf983a83536a0ab
# Parent  7d770de90b7f92bb197bd54d8ac0941e2e5ae96a
x86/hvm: don't give vector callback higher priority than NMI/MCE

Those two should always be delivered first imo.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---


diff -r 7d770de90b7f -r a1f73e989c24 xen/arch/x86/hvm/irq.c
--- a/xen/arch/x86/hvm/irq.c	Mon Sep 10 11:13:56 2012 +0100
+++ b/xen/arch/x86/hvm/irq.c	Mon Sep 10 16:47:31 2012 +0200
@@ -395,16 +395,16 @@ struct hvm_intack hvm_vcpu_has_pending_i
     struct hvm_domain *plat = &v->domain->arch.hvm_domain;
     int vector;
 
-    if ( (plat->irq.callback_via_type == HVMIRQ_callback_vector)
-         && vcpu_info(v, evtchn_upcall_pending) )
-        return hvm_intack_vector(plat->irq.callback_via.vector);
-
     if ( unlikely(v->nmi_pending) )
         return hvm_intack_nmi;
 
     if ( unlikely(v->mce_pending) )
         return hvm_intack_mce;
 
+    if ( (plat->irq.callback_via_type == HVMIRQ_callback_vector)
+         && vcpu_info(v, evtchn_upcall_pending) )
+        return hvm_intack_vector(plat->irq.callback_via.vector);
+
     if ( vlapic_accept_pic_intr(v) && plat->vpic[0].int_output )
         return hvm_intack_pic(0);
 

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYK-0003Ft-F1; Fri, 14 Sep 2012 10:55:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYJ-0003Fm-2V
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:15 +0000
Received: from [85.158.139.83:47895] by server-9.bemta-5.messagelabs.com id
	8E/AF-20529-21D03505; Fri, 14 Sep 2012 10:55:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-182.messagelabs.com!1347620112!25961628!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27154 invoked from network); 14 Sep 2012 10:55:13 -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;
	14 Sep 2012 10: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 1TCTYG-00012v-37
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYF-0000fu-N2
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:11 +0000
Message-Id: <E1TCTYF-0000fu-N2@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] powernow: Update P-state directly
	when _PSD's CoordType is DOMAIN_COORD_TYPE_HW_ALL
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Boris Ostrovsky <boris.ostrovsky@amd.com>
# Date 1347353856 -7200
# Node ID 0a9a4549e6b91dc030c6a3cfdc0963f7959f5692
# Parent  51090fe1ab9737c13c54c925a961db288581c4fd
powernow: Update P-state directly when _PSD's CoordType is DOMAIN_COORD_TYPE_HW_ALL

When _PSD's CoordType is DOMAIN_COORD_TYPE_HW_ALL (i.e. shared_type is
CPUFREQ_SHARED_TYPE_HW) which most often is the case on servers, there
is no reason to go into on_selected_cpus() code, we call call
transition_pstate() directly.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 51090fe1ab97 -r 0a9a4549e6b9 xen/arch/x86/acpi/cpufreq/powernow.c
--- a/xen/arch/x86/acpi/cpufreq/powernow.c	Tue Sep 11 10:00:06 2012 +0200
+++ b/xen/arch/x86/acpi/cpufreq/powernow.c	Tue Sep 11 10:57:36 2012 +0200
@@ -56,20 +56,9 @@
 
 static struct cpufreq_driver powernow_cpufreq_driver;
 
-struct drv_cmd {
-    unsigned int type;
-    const cpumask_t *mask;
-    u32 val;
-    int turbo;
-};
-
-static void transition_pstate(void *drvcmd)
+static void transition_pstate(void *pstate)
 {
-    struct drv_cmd *cmd;
-    cmd = (struct drv_cmd *) drvcmd;
-
-
-    wrmsrl(MSR_PSTATE_CTRL, cmd->val);
+    wrmsrl(MSR_PSTATE_CTRL, *(unsigned int *)pstate);
 }
 
 static void update_cpb(void *data)
@@ -106,13 +95,9 @@ static int powernow_cpufreq_target(struc
 {
     struct acpi_cpufreq_data *data = cpufreq_drv_data[policy->cpu];
     struct processor_performance *perf;
-    struct cpufreq_freqs freqs;
-    cpumask_t online_policy_cpus;
-    struct drv_cmd cmd;
-    unsigned int next_state = 0; /* Index into freq_table */
-    unsigned int next_perf_state = 0; /* Index into perf table */
-    int result = 0;
-    int j = 0;
+    unsigned int next_state; /* Index into freq_table */
+    unsigned int next_perf_state; /* Index into perf table */
+    int result;
 
     if (unlikely(data == NULL ||
         data->acpi_data == NULL || data->freq_table == NULL)) {
@@ -125,9 +110,7 @@ static int powernow_cpufreq_target(struc
                                             target_freq,
                                             relation, &next_state);
     if (unlikely(result))
-        return -ENODEV;
-
-    cpumask_and(&online_policy_cpus, policy->cpus, &cpu_online_map);
+        return result;
 
     next_perf_state = data->freq_table[next_state].index;
     if (perf->state == next_perf_state) {
@@ -137,26 +120,31 @@ static int powernow_cpufreq_target(struc
             return 0;
     }
 
-    if (policy->shared_type != CPUFREQ_SHARED_TYPE_ANY)
-        cmd.mask = &online_policy_cpus;
-    else
-        cmd.mask = cpumask_of(policy->cpu);
+    if (policy->shared_type == CPUFREQ_SHARED_TYPE_HW &&
+        likely(policy->cpu == smp_processor_id())) {
+        transition_pstate(&next_perf_state);
+        cpufreq_statistic_update(policy->cpu, perf->state, next_perf_state);
+    } else {
+        cpumask_t online_policy_cpus;
+        unsigned int cpu;
 
-    freqs.old = perf->states[perf->state].core_frequency * 1000;
-    freqs.new = data->freq_table[next_state].frequency;
+        cpumask_and(&online_policy_cpus, policy->cpus, &cpu_online_map);
 
-    cmd.val = next_perf_state;
-    cmd.turbo = policy->turbo;
+        if (policy->shared_type == CPUFREQ_SHARED_TYPE_ALL ||
+            unlikely(policy->cpu != smp_processor_id()))
+            on_selected_cpus(&online_policy_cpus, transition_pstate,
+                             &next_perf_state, 1);
+        else
+            transition_pstate(&next_perf_state);
 
-    on_selected_cpus(cmd.mask, transition_pstate, &cmd, 1);
-
-    for_each_cpu(j, &online_policy_cpus)
-        cpufreq_statistic_update(j, perf->state, next_perf_state);
+        for_each_cpu(cpu, &online_policy_cpus)
+            cpufreq_statistic_update(cpu, perf->state, next_perf_state);
+    }
 
     perf->state = next_perf_state;
-    policy->cur = freqs.new;
+    policy->cur = data->freq_table[next_state].frequency;
 
-    return result;
+    return 0;
 }
 
 static int powernow_cpufreq_verify(struct cpufreq_policy *policy)

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYK-0003Ft-F1; Fri, 14 Sep 2012 10:55:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYJ-0003Fm-2V
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:15 +0000
Received: from [85.158.139.83:47895] by server-9.bemta-5.messagelabs.com id
	8E/AF-20529-21D03505; Fri, 14 Sep 2012 10:55:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-182.messagelabs.com!1347620112!25961628!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27154 invoked from network); 14 Sep 2012 10:55:13 -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;
	14 Sep 2012 10: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 1TCTYG-00012v-37
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYF-0000fu-N2
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:11 +0000
Message-Id: <E1TCTYF-0000fu-N2@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] powernow: Update P-state directly
	when _PSD's CoordType is DOMAIN_COORD_TYPE_HW_ALL
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Boris Ostrovsky <boris.ostrovsky@amd.com>
# Date 1347353856 -7200
# Node ID 0a9a4549e6b91dc030c6a3cfdc0963f7959f5692
# Parent  51090fe1ab9737c13c54c925a961db288581c4fd
powernow: Update P-state directly when _PSD's CoordType is DOMAIN_COORD_TYPE_HW_ALL

When _PSD's CoordType is DOMAIN_COORD_TYPE_HW_ALL (i.e. shared_type is
CPUFREQ_SHARED_TYPE_HW) which most often is the case on servers, there
is no reason to go into on_selected_cpus() code, we call call
transition_pstate() directly.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 51090fe1ab97 -r 0a9a4549e6b9 xen/arch/x86/acpi/cpufreq/powernow.c
--- a/xen/arch/x86/acpi/cpufreq/powernow.c	Tue Sep 11 10:00:06 2012 +0200
+++ b/xen/arch/x86/acpi/cpufreq/powernow.c	Tue Sep 11 10:57:36 2012 +0200
@@ -56,20 +56,9 @@
 
 static struct cpufreq_driver powernow_cpufreq_driver;
 
-struct drv_cmd {
-    unsigned int type;
-    const cpumask_t *mask;
-    u32 val;
-    int turbo;
-};
-
-static void transition_pstate(void *drvcmd)
+static void transition_pstate(void *pstate)
 {
-    struct drv_cmd *cmd;
-    cmd = (struct drv_cmd *) drvcmd;
-
-
-    wrmsrl(MSR_PSTATE_CTRL, cmd->val);
+    wrmsrl(MSR_PSTATE_CTRL, *(unsigned int *)pstate);
 }
 
 static void update_cpb(void *data)
@@ -106,13 +95,9 @@ static int powernow_cpufreq_target(struc
 {
     struct acpi_cpufreq_data *data = cpufreq_drv_data[policy->cpu];
     struct processor_performance *perf;
-    struct cpufreq_freqs freqs;
-    cpumask_t online_policy_cpus;
-    struct drv_cmd cmd;
-    unsigned int next_state = 0; /* Index into freq_table */
-    unsigned int next_perf_state = 0; /* Index into perf table */
-    int result = 0;
-    int j = 0;
+    unsigned int next_state; /* Index into freq_table */
+    unsigned int next_perf_state; /* Index into perf table */
+    int result;
 
     if (unlikely(data == NULL ||
         data->acpi_data == NULL || data->freq_table == NULL)) {
@@ -125,9 +110,7 @@ static int powernow_cpufreq_target(struc
                                             target_freq,
                                             relation, &next_state);
     if (unlikely(result))
-        return -ENODEV;
-
-    cpumask_and(&online_policy_cpus, policy->cpus, &cpu_online_map);
+        return result;
 
     next_perf_state = data->freq_table[next_state].index;
     if (perf->state == next_perf_state) {
@@ -137,26 +120,31 @@ static int powernow_cpufreq_target(struc
             return 0;
     }
 
-    if (policy->shared_type != CPUFREQ_SHARED_TYPE_ANY)
-        cmd.mask = &online_policy_cpus;
-    else
-        cmd.mask = cpumask_of(policy->cpu);
+    if (policy->shared_type == CPUFREQ_SHARED_TYPE_HW &&
+        likely(policy->cpu == smp_processor_id())) {
+        transition_pstate(&next_perf_state);
+        cpufreq_statistic_update(policy->cpu, perf->state, next_perf_state);
+    } else {
+        cpumask_t online_policy_cpus;
+        unsigned int cpu;
 
-    freqs.old = perf->states[perf->state].core_frequency * 1000;
-    freqs.new = data->freq_table[next_state].frequency;
+        cpumask_and(&online_policy_cpus, policy->cpus, &cpu_online_map);
 
-    cmd.val = next_perf_state;
-    cmd.turbo = policy->turbo;
+        if (policy->shared_type == CPUFREQ_SHARED_TYPE_ALL ||
+            unlikely(policy->cpu != smp_processor_id()))
+            on_selected_cpus(&online_policy_cpus, transition_pstate,
+                             &next_perf_state, 1);
+        else
+            transition_pstate(&next_perf_state);
 
-    on_selected_cpus(cmd.mask, transition_pstate, &cmd, 1);
-
-    for_each_cpu(j, &online_policy_cpus)
-        cpufreq_statistic_update(j, perf->state, next_perf_state);
+        for_each_cpu(cpu, &online_policy_cpus)
+            cpufreq_statistic_update(cpu, perf->state, next_perf_state);
+    }
 
     perf->state = next_perf_state;
-    policy->cur = freqs.new;
+    policy->cur = data->freq_table[next_state].frequency;
 
-    return result;
+    return 0;
 }
 
 static int powernow_cpufreq_verify(struct cpufreq_policy *policy)

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYN-0003GV-HX; Fri, 14 Sep 2012 10:55:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYL-0003Fx-Dh
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:17 +0000
Received: from [85.158.139.83:48077] by server-2.bemta-5.messagelabs.com id
	4C/11-11456-41D03505; Fri, 14 Sep 2012 10:55:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1347620113!30329084!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21042 invoked from network); 14 Sep 2012 10:55:15 -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;
	14 Sep 2012 10: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 1TCTYH-000131-OE
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYH-0000gO-JU
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:13 +0000
Message-Id: <E1TCTYH-0000gO-JU@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: refactor mce code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Christoph Egger <Christoph.Egger@amd.com>
# Date 1347359312 -7200
# Node ID fc24482c07d2e69049ad729ca80ec6bdf1a0fa16
# Parent  d9d4c7ed2fd2683d1928b36a2a07c6a519273d13
x86: refactor mce code

Factor common mc code out of intel specific code and move it into
common files. No functional changes.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r d9d4c7ed2fd2 -r fc24482c07d2 xen/arch/x86/cpu/mcheck/Makefile
--- a/xen/arch/x86/cpu/mcheck/Makefile	Tue Sep 11 12:26:25 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/Makefile	Tue Sep 11 12:28:32 2012 +0200
@@ -2,10 +2,12 @@ obj-y += amd_nonfatal.o
 obj-y += k7.o
 obj-y += amd_k8.o
 obj-y += amd_f10.o
+obj-y += barrier.o
 obj-y += mctelem.o
 obj-y += mce.o
 obj-y += mce-apei.o
 obj-y += mce_intel.o
 obj-y += mce_amd_quirks.o
 obj-y += non-fatal.o
+obj-y += util.o
 obj-y += vmce.o
diff -r d9d4c7ed2fd2 -r fc24482c07d2 xen/arch/x86/cpu/mcheck/barrier.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/x86/cpu/mcheck/barrier.c	Tue Sep 11 12:28:32 2012 +0200
@@ -0,0 +1,59 @@
+#include "barrier.h"
+#include "util.h"
+#include "mce.h"
+
+void mce_barrier_init(struct mce_softirq_barrier *bar)
+{
+    atomic_set(&bar->val, 0);
+    atomic_set(&bar->ingen, 0);
+    atomic_set(&bar->outgen, 0);
+}
+
+void mce_barrier_dec(struct mce_softirq_barrier *bar)
+{
+    atomic_inc(&bar->outgen);
+    wmb();
+    atomic_dec(&bar->val);
+}
+
+void mce_barrier_enter(struct mce_softirq_barrier *bar)
+{
+    int gen;
+
+    if (!mce_broadcast)
+        return;
+    atomic_inc(&bar->ingen);
+    gen = atomic_read(&bar->outgen);
+    mb();
+    atomic_inc(&bar->val);
+    while ( atomic_read(&bar->val) != num_online_cpus() &&
+            atomic_read(&bar->outgen) == gen )
+    {
+            mb();
+            mce_panic_check();
+    }
+}
+
+void mce_barrier_exit(struct mce_softirq_barrier *bar)
+{
+    int gen;
+
+    if ( !mce_broadcast )
+        return;
+    atomic_inc(&bar->outgen);
+    gen = atomic_read(&bar->ingen);
+    mb();
+    atomic_dec(&bar->val);
+    while ( atomic_read(&bar->val) != 0 &&
+            atomic_read(&bar->ingen) == gen )
+    {
+            mb();
+            mce_panic_check();
+    }
+}
+
+void mce_barrier(struct mce_softirq_barrier *bar)
+{
+    mce_barrier_enter(bar);
+    mce_barrier_exit(bar);
+}
diff -r d9d4c7ed2fd2 -r fc24482c07d2 xen/arch/x86/cpu/mcheck/barrier.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/x86/cpu/mcheck/barrier.h	Tue Sep 11 12:28:32 2012 +0200
@@ -0,0 +1,44 @@
+#ifndef _MCHECK_BARRIER_H
+#define _MCHECK_BARRIER_H
+
+#include <asm/atomic.h>
+
+/* MCE handling */
+struct mce_softirq_barrier {
+    atomic_t val;
+    atomic_t ingen;
+    atomic_t outgen;
+};
+
+/*
+ * Initialize a barrier. Just set it to 0.
+ */
+void mce_barrier_init(struct mce_softirq_barrier *);
+
+/*
+ * This function will need to be used when offlining a CPU in the
+ * recovery actions.
+ *
+ * Decrement a barrier only. Needed for cases where the CPU
+ * in question can't do it itself (e.g. it is being offlined).
+ */
+void mce_barrier_dec(struct mce_softirq_barrier *);
+
+/*
+ * Increment the generation number and the value. The generation number
+ * is incremented when entering a barrier. This way, it can be checked
+ * on exit if a CPU is trying to re-enter the barrier. This can happen
+ * if the first CPU to make it out immediately exits or re-enters, while
+ * another CPU that is still in the loop becomes otherwise occupied
+ * (e.g. it needs to service an interrupt, etc), missing the value
+ * it's waiting for.
+ *
+ * These barrier functions should always be paired, so that the
+ * counter value will reach 0 again after all CPUs have exited.
+ */
+void mce_barrier_enter(struct mce_softirq_barrier *);
+void mce_barrier_exit(struct mce_softirq_barrier *);
+
+void mce_barrier(struct mce_softirq_barrier *);
+
+#endif /* _MCHECK_BARRIER_H */
diff -r d9d4c7ed2fd2 -r fc24482c07d2 xen/arch/x86/cpu/mcheck/mce_intel.c
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c	Tue Sep 11 12:26:25 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c	Tue Sep 11 12:28:32 2012 +0200
@@ -16,6 +16,8 @@
 #include <asm/apic.h>
 #include "mce.h"
 #include "x86_mca.h"
+#include "barrier.h"
+#include "util.h"
 
 DEFINE_PER_CPU(struct mca_banks *, mce_banks_owned);
 DEFINE_PER_CPU(struct mca_banks *, no_cmci_banks);
@@ -164,13 +166,6 @@ static void intel_init_thermal(struct cp
 }
 #endif /* CONFIG_X86_MCE_THERMAL */
 
-/* MCE handling */
-struct mce_softirq_barrier {
-	atomic_t val;
-	atomic_t ingen;
-	atomic_t outgen;
-};
-
 static struct mce_softirq_barrier mce_inside_bar, mce_severity_bar;
 static struct mce_softirq_barrier mce_trap_bar;
 
@@ -186,9 +181,6 @@ static atomic_t severity_cpu = ATOMIC_IN
 static atomic_t found_error = ATOMIC_INIT(0);
 static cpumask_t mce_fatal_cpus;
 
-static void mce_barrier_enter(struct mce_softirq_barrier *);
-static void mce_barrier_exit(struct mce_softirq_barrier *);
-
 static const struct mca_error_handler *__read_mostly mce_dhandlers;
 static const struct mca_error_handler *__read_mostly mce_uhandlers;
 static unsigned int __read_mostly mce_dhandler_num;
@@ -385,25 +377,6 @@ static int mce_urgent_action(struct cpu_
  * Round2: Do all MCE processing logic as normal.
  */
 
-static void mce_panic_check(void)
-{
-      if (is_mc_panic) {
-              local_irq_enable();
-              for ( ; ; )
-                      halt();
-      }
-}
-
-/*
- * Initialize a barrier. Just set it to 0.
- */
-static void mce_barrier_init(struct mce_softirq_barrier *bar)
-{
-      atomic_set(&bar->val, 0);
-      atomic_set(&bar->ingen, 0);
-      atomic_set(&bar->outgen, 0);
-}
-
 static void mce_handler_init(void)
 {
     if (smp_processor_id() != 0)
@@ -417,21 +390,6 @@ static void mce_handler_init(void)
     spin_lock_init(&mce_logout_lock);
     open_softirq(MACHINE_CHECK_SOFTIRQ, mce_softirq);
 }
-#if 0
-/*
- * This function will need to be used when offlining a CPU in the
- * recovery actions.
- *
- * Decrement a barrier only. Needed for cases where the CPU
- * in question can't do it itself (e.g. it is being offlined).
- */
-static void mce_barrier_dec(struct mce_softirq_barrier *bar)
-{
-      atomic_inc(&bar->outgen);
-      wmb();
-      atomic_dec(&bar->val);
-}
-#endif
 
 static void mce_spin_lock(spinlock_t *lk)
 {
@@ -446,60 +404,6 @@ static void mce_spin_unlock(spinlock_t *
       spin_unlock(lk);
 }
 
-/*
- * Increment the generation number and the value. The generation number
- * is incremented when entering a barrier. This way, it can be checked
- * on exit if a CPU is trying to re-enter the barrier. This can happen
- * if the first CPU to make it out immediately exits or re-enters, while
- * another CPU that is still in the loop becomes otherwise occupied
- * (e.g. it needs to service an interrupt, etc), missing the value
- * it's waiting for.
- *
- * These barrier functions should always be paired, so that the
- * counter value will reach 0 again after all CPUs have exited.
- */
-static void mce_barrier_enter(struct mce_softirq_barrier *bar)
-{
-      int gen;
-
-      if (!mce_broadcast)
-          return;
-      atomic_inc(&bar->ingen);
-      gen = atomic_read(&bar->outgen);
-      mb();
-      atomic_inc(&bar->val);
-      while ( atomic_read(&bar->val) != num_online_cpus() &&
-          atomic_read(&bar->outgen) == gen) {
-              mb();
-              mce_panic_check();
-      }
-}
-
-static void mce_barrier_exit(struct mce_softirq_barrier *bar)
-{
-      int gen;
-
-      if (!mce_broadcast)
-          return;
-      atomic_inc(&bar->outgen);
-      gen = atomic_read(&bar->ingen);
-      mb();
-      atomic_dec(&bar->val);
-      while ( atomic_read(&bar->val) != 0 &&
-          atomic_read(&bar->ingen) == gen ) {
-              mb();
-              mce_panic_check();
-      }
-}
-
-#if 0
-static void mce_barrier(struct mce_softirq_barrier *bar)
-{
-      mce_barrier_enter(bar);
-      mce_barrier_exit(bar);
-}
-#endif
-
 /* Intel MCE handler */
 static inline void intel_get_extended_msr(struct mcinfo_extended *ext, u32 msr)
 {
diff -r d9d4c7ed2fd2 -r fc24482c07d2 xen/arch/x86/cpu/mcheck/util.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/x86/cpu/mcheck/util.c	Tue Sep 11 12:28:32 2012 +0200
@@ -0,0 +1,14 @@
+
+#include <asm/system.h>
+#include "util.h"
+#include "mce.h"
+
+void mce_panic_check(void)
+{
+    if ( is_mc_panic )
+    {
+        local_irq_enable();
+        for ( ; ; )
+            halt();
+    }
+}
diff -r d9d4c7ed2fd2 -r fc24482c07d2 xen/arch/x86/cpu/mcheck/util.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/x86/cpu/mcheck/util.h	Tue Sep 11 12:28:32 2012 +0200
@@ -0,0 +1,6 @@
+#ifndef _MCHECK_UTIL_H
+#define _MCHECK_UTIL_H
+
+void mce_panic_check(void);
+
+#endif

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYN-0003GV-HX; Fri, 14 Sep 2012 10:55:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYL-0003Fx-Dh
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:17 +0000
Received: from [85.158.139.83:48077] by server-2.bemta-5.messagelabs.com id
	4C/11-11456-41D03505; Fri, 14 Sep 2012 10:55:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1347620113!30329084!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21042 invoked from network); 14 Sep 2012 10:55:15 -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;
	14 Sep 2012 10: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 1TCTYH-000131-OE
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYH-0000gO-JU
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:13 +0000
Message-Id: <E1TCTYH-0000gO-JU@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: refactor mce code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Christoph Egger <Christoph.Egger@amd.com>
# Date 1347359312 -7200
# Node ID fc24482c07d2e69049ad729ca80ec6bdf1a0fa16
# Parent  d9d4c7ed2fd2683d1928b36a2a07c6a519273d13
x86: refactor mce code

Factor common mc code out of intel specific code and move it into
common files. No functional changes.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r d9d4c7ed2fd2 -r fc24482c07d2 xen/arch/x86/cpu/mcheck/Makefile
--- a/xen/arch/x86/cpu/mcheck/Makefile	Tue Sep 11 12:26:25 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/Makefile	Tue Sep 11 12:28:32 2012 +0200
@@ -2,10 +2,12 @@ obj-y += amd_nonfatal.o
 obj-y += k7.o
 obj-y += amd_k8.o
 obj-y += amd_f10.o
+obj-y += barrier.o
 obj-y += mctelem.o
 obj-y += mce.o
 obj-y += mce-apei.o
 obj-y += mce_intel.o
 obj-y += mce_amd_quirks.o
 obj-y += non-fatal.o
+obj-y += util.o
 obj-y += vmce.o
diff -r d9d4c7ed2fd2 -r fc24482c07d2 xen/arch/x86/cpu/mcheck/barrier.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/x86/cpu/mcheck/barrier.c	Tue Sep 11 12:28:32 2012 +0200
@@ -0,0 +1,59 @@
+#include "barrier.h"
+#include "util.h"
+#include "mce.h"
+
+void mce_barrier_init(struct mce_softirq_barrier *bar)
+{
+    atomic_set(&bar->val, 0);
+    atomic_set(&bar->ingen, 0);
+    atomic_set(&bar->outgen, 0);
+}
+
+void mce_barrier_dec(struct mce_softirq_barrier *bar)
+{
+    atomic_inc(&bar->outgen);
+    wmb();
+    atomic_dec(&bar->val);
+}
+
+void mce_barrier_enter(struct mce_softirq_barrier *bar)
+{
+    int gen;
+
+    if (!mce_broadcast)
+        return;
+    atomic_inc(&bar->ingen);
+    gen = atomic_read(&bar->outgen);
+    mb();
+    atomic_inc(&bar->val);
+    while ( atomic_read(&bar->val) != num_online_cpus() &&
+            atomic_read(&bar->outgen) == gen )
+    {
+            mb();
+            mce_panic_check();
+    }
+}
+
+void mce_barrier_exit(struct mce_softirq_barrier *bar)
+{
+    int gen;
+
+    if ( !mce_broadcast )
+        return;
+    atomic_inc(&bar->outgen);
+    gen = atomic_read(&bar->ingen);
+    mb();
+    atomic_dec(&bar->val);
+    while ( atomic_read(&bar->val) != 0 &&
+            atomic_read(&bar->ingen) == gen )
+    {
+            mb();
+            mce_panic_check();
+    }
+}
+
+void mce_barrier(struct mce_softirq_barrier *bar)
+{
+    mce_barrier_enter(bar);
+    mce_barrier_exit(bar);
+}
diff -r d9d4c7ed2fd2 -r fc24482c07d2 xen/arch/x86/cpu/mcheck/barrier.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/x86/cpu/mcheck/barrier.h	Tue Sep 11 12:28:32 2012 +0200
@@ -0,0 +1,44 @@
+#ifndef _MCHECK_BARRIER_H
+#define _MCHECK_BARRIER_H
+
+#include <asm/atomic.h>
+
+/* MCE handling */
+struct mce_softirq_barrier {
+    atomic_t val;
+    atomic_t ingen;
+    atomic_t outgen;
+};
+
+/*
+ * Initialize a barrier. Just set it to 0.
+ */
+void mce_barrier_init(struct mce_softirq_barrier *);
+
+/*
+ * This function will need to be used when offlining a CPU in the
+ * recovery actions.
+ *
+ * Decrement a barrier only. Needed for cases where the CPU
+ * in question can't do it itself (e.g. it is being offlined).
+ */
+void mce_barrier_dec(struct mce_softirq_barrier *);
+
+/*
+ * Increment the generation number and the value. The generation number
+ * is incremented when entering a barrier. This way, it can be checked
+ * on exit if a CPU is trying to re-enter the barrier. This can happen
+ * if the first CPU to make it out immediately exits or re-enters, while
+ * another CPU that is still in the loop becomes otherwise occupied
+ * (e.g. it needs to service an interrupt, etc), missing the value
+ * it's waiting for.
+ *
+ * These barrier functions should always be paired, so that the
+ * counter value will reach 0 again after all CPUs have exited.
+ */
+void mce_barrier_enter(struct mce_softirq_barrier *);
+void mce_barrier_exit(struct mce_softirq_barrier *);
+
+void mce_barrier(struct mce_softirq_barrier *);
+
+#endif /* _MCHECK_BARRIER_H */
diff -r d9d4c7ed2fd2 -r fc24482c07d2 xen/arch/x86/cpu/mcheck/mce_intel.c
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c	Tue Sep 11 12:26:25 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c	Tue Sep 11 12:28:32 2012 +0200
@@ -16,6 +16,8 @@
 #include <asm/apic.h>
 #include "mce.h"
 #include "x86_mca.h"
+#include "barrier.h"
+#include "util.h"
 
 DEFINE_PER_CPU(struct mca_banks *, mce_banks_owned);
 DEFINE_PER_CPU(struct mca_banks *, no_cmci_banks);
@@ -164,13 +166,6 @@ static void intel_init_thermal(struct cp
 }
 #endif /* CONFIG_X86_MCE_THERMAL */
 
-/* MCE handling */
-struct mce_softirq_barrier {
-	atomic_t val;
-	atomic_t ingen;
-	atomic_t outgen;
-};
-
 static struct mce_softirq_barrier mce_inside_bar, mce_severity_bar;
 static struct mce_softirq_barrier mce_trap_bar;
 
@@ -186,9 +181,6 @@ static atomic_t severity_cpu = ATOMIC_IN
 static atomic_t found_error = ATOMIC_INIT(0);
 static cpumask_t mce_fatal_cpus;
 
-static void mce_barrier_enter(struct mce_softirq_barrier *);
-static void mce_barrier_exit(struct mce_softirq_barrier *);
-
 static const struct mca_error_handler *__read_mostly mce_dhandlers;
 static const struct mca_error_handler *__read_mostly mce_uhandlers;
 static unsigned int __read_mostly mce_dhandler_num;
@@ -385,25 +377,6 @@ static int mce_urgent_action(struct cpu_
  * Round2: Do all MCE processing logic as normal.
  */
 
-static void mce_panic_check(void)
-{
-      if (is_mc_panic) {
-              local_irq_enable();
-              for ( ; ; )
-                      halt();
-      }
-}
-
-/*
- * Initialize a barrier. Just set it to 0.
- */
-static void mce_barrier_init(struct mce_softirq_barrier *bar)
-{
-      atomic_set(&bar->val, 0);
-      atomic_set(&bar->ingen, 0);
-      atomic_set(&bar->outgen, 0);
-}
-
 static void mce_handler_init(void)
 {
     if (smp_processor_id() != 0)
@@ -417,21 +390,6 @@ static void mce_handler_init(void)
     spin_lock_init(&mce_logout_lock);
     open_softirq(MACHINE_CHECK_SOFTIRQ, mce_softirq);
 }
-#if 0
-/*
- * This function will need to be used when offlining a CPU in the
- * recovery actions.
- *
- * Decrement a barrier only. Needed for cases where the CPU
- * in question can't do it itself (e.g. it is being offlined).
- */
-static void mce_barrier_dec(struct mce_softirq_barrier *bar)
-{
-      atomic_inc(&bar->outgen);
-      wmb();
-      atomic_dec(&bar->val);
-}
-#endif
 
 static void mce_spin_lock(spinlock_t *lk)
 {
@@ -446,60 +404,6 @@ static void mce_spin_unlock(spinlock_t *
       spin_unlock(lk);
 }
 
-/*
- * Increment the generation number and the value. The generation number
- * is incremented when entering a barrier. This way, it can be checked
- * on exit if a CPU is trying to re-enter the barrier. This can happen
- * if the first CPU to make it out immediately exits or re-enters, while
- * another CPU that is still in the loop becomes otherwise occupied
- * (e.g. it needs to service an interrupt, etc), missing the value
- * it's waiting for.
- *
- * These barrier functions should always be paired, so that the
- * counter value will reach 0 again after all CPUs have exited.
- */
-static void mce_barrier_enter(struct mce_softirq_barrier *bar)
-{
-      int gen;
-
-      if (!mce_broadcast)
-          return;
-      atomic_inc(&bar->ingen);
-      gen = atomic_read(&bar->outgen);
-      mb();
-      atomic_inc(&bar->val);
-      while ( atomic_read(&bar->val) != num_online_cpus() &&
-          atomic_read(&bar->outgen) == gen) {
-              mb();
-              mce_panic_check();
-      }
-}
-
-static void mce_barrier_exit(struct mce_softirq_barrier *bar)
-{
-      int gen;
-
-      if (!mce_broadcast)
-          return;
-      atomic_inc(&bar->outgen);
-      gen = atomic_read(&bar->ingen);
-      mb();
-      atomic_dec(&bar->val);
-      while ( atomic_read(&bar->val) != 0 &&
-          atomic_read(&bar->ingen) == gen ) {
-              mb();
-              mce_panic_check();
-      }
-}
-
-#if 0
-static void mce_barrier(struct mce_softirq_barrier *bar)
-{
-      mce_barrier_enter(bar);
-      mce_barrier_exit(bar);
-}
-#endif
-
 /* Intel MCE handler */
 static inline void intel_get_extended_msr(struct mcinfo_extended *ext, u32 msr)
 {
diff -r d9d4c7ed2fd2 -r fc24482c07d2 xen/arch/x86/cpu/mcheck/util.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/x86/cpu/mcheck/util.c	Tue Sep 11 12:28:32 2012 +0200
@@ -0,0 +1,14 @@
+
+#include <asm/system.h>
+#include "util.h"
+#include "mce.h"
+
+void mce_panic_check(void)
+{
+    if ( is_mc_panic )
+    {
+        local_irq_enable();
+        for ( ; ; )
+            halt();
+    }
+}
diff -r d9d4c7ed2fd2 -r fc24482c07d2 xen/arch/x86/cpu/mcheck/util.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/x86/cpu/mcheck/util.h	Tue Sep 11 12:28:32 2012 +0200
@@ -0,0 +1,6 @@
+#ifndef _MCHECK_UTIL_H
+#define _MCHECK_UTIL_H
+
+void mce_panic_check(void);
+
+#endif

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYN-0003Gf-NQ; Fri, 14 Sep 2012 10:55:19 +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 1TCTYL-0003G1-Mh
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:17 +0000
Received: from [85.158.138.51:51367] by server-2.bemta-3.messagelabs.com id
	61/C8-04862-41D03505; Fri, 14 Sep 2012 10:55:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-174.messagelabs.com!1347620114!22503843!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23071 invoked from network); 14 Sep 2012 10:55:15 -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;
	14 Sep 2012 10: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 1TCTYI-000134-Bz
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYI-0000gd-AL
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:14 +0000
Message-Id: <E1TCTYI-0000gd-AL@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] amd iommu: add 2 helper functions:
	iommu_is_pte_present and iommu_next_level
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1347364804 -7200
# Node ID 0baddae93c5cf9320dbf59695a4476cc31f1fb60
# Parent  fc24482c07d2e69049ad729ca80ec6bdf1a0fa16
amd iommu: add 2 helper functions: iommu_is_pte_present and iommu_next_level

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r fc24482c07d2 -r 0baddae93c5c xen/drivers/passthrough/amd/iommu_map.c
--- a/xen/drivers/passthrough/amd/iommu_map.c	Tue Sep 11 12:28:32 2012 +0200
+++ b/xen/drivers/passthrough/amd/iommu_map.c	Tue Sep 11 14:00:04 2012 +0200
@@ -306,20 +306,6 @@ u64 amd_iommu_get_next_table_from_pte(u3
     return ptr;
 }
 
-static unsigned int iommu_next_level(u32 *entry)
-{
-    return get_field_from_reg_u32(entry[0],
-                                  IOMMU_PDE_NEXT_LEVEL_MASK,
-                                  IOMMU_PDE_NEXT_LEVEL_SHIFT);
-}
-
-static int amd_iommu_is_pte_present(u32 *entry)
-{
-    return get_field_from_reg_u32(entry[0],
-                                  IOMMU_PDE_PRESENT_MASK,
-                                  IOMMU_PDE_PRESENT_SHIFT);
-}
-
 /* For each pde, We use ignored bits (bit 1 - bit 8 and bit 63)
  * to save pde count, pde count = 511 is a candidate of page coalescing.
  */
@@ -489,7 +475,7 @@ static int iommu_pde_from_gfn(struct dom
                          >> PAGE_SHIFT;
 
         /* Split super page frame into smaller pieces.*/
-        if ( amd_iommu_is_pte_present((u32*)pde) &&
+        if ( iommu_is_pte_present((u32*)pde) &&
              (iommu_next_level((u32*)pde) == 0) &&
              next_table_mfn != 0 )
         {
@@ -526,7 +512,7 @@ static int iommu_pde_from_gfn(struct dom
         }
 
         /* Install lower level page table for non-present entries */
-        else if ( !amd_iommu_is_pte_present((u32*)pde) )
+        else if ( !iommu_is_pte_present((u32*)pde) )
         {
             if ( next_table_mfn == 0 )
             {
diff -r fc24482c07d2 -r 0baddae93c5c xen/drivers/passthrough/amd/pci_amd_iommu.c
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c	Tue Sep 11 12:28:32 2012 +0200
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c	Tue Sep 11 14:00:04 2012 +0200
@@ -393,8 +393,7 @@ static void deallocate_next_page_table(s
 {
     void *table_vaddr, *pde;
     u64 next_table_maddr;
-    int index, next_level, present;
-    u32 *entry;
+    int index, next_level;
 
     table_vaddr = __map_domain_page(pg);
 
@@ -404,18 +403,11 @@ static void deallocate_next_page_table(s
         {
             pde = table_vaddr + (index * IOMMU_PAGE_TABLE_ENTRY_SIZE);
             next_table_maddr = amd_iommu_get_next_table_from_pte(pde);
-            entry = (u32*)pde;
 
-            next_level = get_field_from_reg_u32(entry[0],
-                                                IOMMU_PDE_NEXT_LEVEL_MASK,
-                                                IOMMU_PDE_NEXT_LEVEL_SHIFT);
-
-            present = get_field_from_reg_u32(entry[0],
-                                             IOMMU_PDE_PRESENT_MASK,
-                                             IOMMU_PDE_PRESENT_SHIFT);
+            next_level = iommu_next_level((u32*)pde);
 
             if ( (next_table_maddr != 0) && (next_level != 0)
-                && present )
+                && iommu_is_pte_present((u32*)pde) )
             {
                 deallocate_next_page_table(
                     maddr_to_page(next_table_maddr), level - 1);
diff -r fc24482c07d2 -r 0baddae93c5c xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h	Tue Sep 11 12:28:32 2012 +0200
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h	Tue Sep 11 14:00:04 2012 +0200
@@ -257,4 +257,18 @@ static inline void iommu_set_addr_hi_to_
                          IOMMU_REG_BASE_ADDR_HIGH_SHIFT, reg);
 }
 
+static inline int iommu_is_pte_present(const u32 *entry)
+{
+    return get_field_from_reg_u32(entry[0],
+                                  IOMMU_PDE_PRESENT_MASK,
+                                  IOMMU_PDE_PRESENT_SHIFT);
+}
+
+static inline unsigned int iommu_next_level(const u32 *entry)
+{
+    return get_field_from_reg_u32(entry[0],
+                                  IOMMU_PDE_NEXT_LEVEL_MASK,
+                                  IOMMU_PDE_NEXT_LEVEL_SHIFT);
+}
+
 #endif /* _ASM_X86_64_AMD_IOMMU_PROTO_H */

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYN-0003Gf-NQ; Fri, 14 Sep 2012 10:55:19 +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 1TCTYL-0003G1-Mh
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:17 +0000
Received: from [85.158.138.51:51367] by server-2.bemta-3.messagelabs.com id
	61/C8-04862-41D03505; Fri, 14 Sep 2012 10:55:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-174.messagelabs.com!1347620114!22503843!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23071 invoked from network); 14 Sep 2012 10:55:15 -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;
	14 Sep 2012 10: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 1TCTYI-000134-Bz
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYI-0000gd-AL
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:14 +0000
Message-Id: <E1TCTYI-0000gd-AL@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] amd iommu: add 2 helper functions:
	iommu_is_pte_present and iommu_next_level
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1347364804 -7200
# Node ID 0baddae93c5cf9320dbf59695a4476cc31f1fb60
# Parent  fc24482c07d2e69049ad729ca80ec6bdf1a0fa16
amd iommu: add 2 helper functions: iommu_is_pte_present and iommu_next_level

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r fc24482c07d2 -r 0baddae93c5c xen/drivers/passthrough/amd/iommu_map.c
--- a/xen/drivers/passthrough/amd/iommu_map.c	Tue Sep 11 12:28:32 2012 +0200
+++ b/xen/drivers/passthrough/amd/iommu_map.c	Tue Sep 11 14:00:04 2012 +0200
@@ -306,20 +306,6 @@ u64 amd_iommu_get_next_table_from_pte(u3
     return ptr;
 }
 
-static unsigned int iommu_next_level(u32 *entry)
-{
-    return get_field_from_reg_u32(entry[0],
-                                  IOMMU_PDE_NEXT_LEVEL_MASK,
-                                  IOMMU_PDE_NEXT_LEVEL_SHIFT);
-}
-
-static int amd_iommu_is_pte_present(u32 *entry)
-{
-    return get_field_from_reg_u32(entry[0],
-                                  IOMMU_PDE_PRESENT_MASK,
-                                  IOMMU_PDE_PRESENT_SHIFT);
-}
-
 /* For each pde, We use ignored bits (bit 1 - bit 8 and bit 63)
  * to save pde count, pde count = 511 is a candidate of page coalescing.
  */
@@ -489,7 +475,7 @@ static int iommu_pde_from_gfn(struct dom
                          >> PAGE_SHIFT;
 
         /* Split super page frame into smaller pieces.*/
-        if ( amd_iommu_is_pte_present((u32*)pde) &&
+        if ( iommu_is_pte_present((u32*)pde) &&
              (iommu_next_level((u32*)pde) == 0) &&
              next_table_mfn != 0 )
         {
@@ -526,7 +512,7 @@ static int iommu_pde_from_gfn(struct dom
         }
 
         /* Install lower level page table for non-present entries */
-        else if ( !amd_iommu_is_pte_present((u32*)pde) )
+        else if ( !iommu_is_pte_present((u32*)pde) )
         {
             if ( next_table_mfn == 0 )
             {
diff -r fc24482c07d2 -r 0baddae93c5c xen/drivers/passthrough/amd/pci_amd_iommu.c
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c	Tue Sep 11 12:28:32 2012 +0200
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c	Tue Sep 11 14:00:04 2012 +0200
@@ -393,8 +393,7 @@ static void deallocate_next_page_table(s
 {
     void *table_vaddr, *pde;
     u64 next_table_maddr;
-    int index, next_level, present;
-    u32 *entry;
+    int index, next_level;
 
     table_vaddr = __map_domain_page(pg);
 
@@ -404,18 +403,11 @@ static void deallocate_next_page_table(s
         {
             pde = table_vaddr + (index * IOMMU_PAGE_TABLE_ENTRY_SIZE);
             next_table_maddr = amd_iommu_get_next_table_from_pte(pde);
-            entry = (u32*)pde;
 
-            next_level = get_field_from_reg_u32(entry[0],
-                                                IOMMU_PDE_NEXT_LEVEL_MASK,
-                                                IOMMU_PDE_NEXT_LEVEL_SHIFT);
-
-            present = get_field_from_reg_u32(entry[0],
-                                             IOMMU_PDE_PRESENT_MASK,
-                                             IOMMU_PDE_PRESENT_SHIFT);
+            next_level = iommu_next_level((u32*)pde);
 
             if ( (next_table_maddr != 0) && (next_level != 0)
-                && present )
+                && iommu_is_pte_present((u32*)pde) )
             {
                 deallocate_next_page_table(
                     maddr_to_page(next_table_maddr), level - 1);
diff -r fc24482c07d2 -r 0baddae93c5c xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h	Tue Sep 11 12:28:32 2012 +0200
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h	Tue Sep 11 14:00:04 2012 +0200
@@ -257,4 +257,18 @@ static inline void iommu_set_addr_hi_to_
                          IOMMU_REG_BASE_ADDR_HIGH_SHIFT, reg);
 }
 
+static inline int iommu_is_pte_present(const u32 *entry)
+{
+    return get_field_from_reg_u32(entry[0],
+                                  IOMMU_PDE_PRESENT_MASK,
+                                  IOMMU_PDE_PRESENT_SHIFT);
+}
+
+static inline unsigned int iommu_next_level(const u32 *entry)
+{
+    return get_field_from_reg_u32(entry[0],
+                                  IOMMU_PDE_NEXT_LEVEL_MASK,
+                                  IOMMU_PDE_NEXT_LEVEL_SHIFT);
+}
+
 #endif /* _ASM_X86_64_AMD_IOMMU_PROTO_H */

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYO-0003HV-3a; Fri, 14 Sep 2012 10:55:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYN-0003Fx-3n
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:19 +0000
Received: from [85.158.139.83:48302] by server-2.bemta-5.messagelabs.com id
	93/31-11456-61D03505; Fri, 14 Sep 2012 10:55:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-182.messagelabs.com!1347620115!23275221!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17899 invoked from network); 14 Sep 2012 10:55:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Sep 2012 10: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 1TCTYJ-00013A-MJ
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYJ-0000h7-Hs
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:15 +0000
Message-Id: <E1TCTYJ-0000h7-Hs@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] amd iommu: remove unnecessary
	map/unmap for l1 page tables
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1347364992 -7200
# Node ID 90533f3b6babfda56edbbefda47c46b391204132
# Parent  ae59ecd8a52f3016ef5444446bfd77b780dafc87
amd iommu: remove unnecessary map/unmap for l1 page tables

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r ae59ecd8a52f -r 90533f3b6bab xen/drivers/passthrough/amd/pci_amd_iommu.c
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c	Tue Sep 11 14:01:52 2012 +0200
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c	Tue Sep 11 14:03:12 2012 +0200
@@ -395,25 +395,27 @@ static void deallocate_next_page_table(s
     u64 next_table_maddr;
     int index, next_level;
 
+    if ( level <= 1 )
+    {
+        free_amd_iommu_pgtable(pg);
+        return;
+    }
+
     table_vaddr = __map_domain_page(pg);
 
-    if ( level > 1 )
+    for ( index = 0; index < PTE_PER_TABLE_SIZE; index++ )
     {
-        for ( index = 0; index < PTE_PER_TABLE_SIZE; index++ )
+        pde = table_vaddr + (index * IOMMU_PAGE_TABLE_ENTRY_SIZE);
+        next_table_maddr = amd_iommu_get_next_table_from_pte(pde);
+        next_level = iommu_next_level((u32*)pde);
+
+        if ( (next_table_maddr != 0) && (next_level != 0) &&
+             iommu_is_pte_present((u32*)pde) )
         {
-            pde = table_vaddr + (index * IOMMU_PAGE_TABLE_ENTRY_SIZE);
-            next_table_maddr = amd_iommu_get_next_table_from_pte(pde);
-
-            next_level = iommu_next_level((u32*)pde);
-
-            if ( (next_table_maddr != 0) && (next_level != 0)
-                && iommu_is_pte_present((u32*)pde) )
-            {
-                /* We do not support skip level yet */
-                ASSERT(next_level == level - 1);
-                deallocate_next_page_table(
-                    maddr_to_page(next_table_maddr), next_level);
-            }
+            /* We do not support skip levels yet */
+            ASSERT(next_level == level - 1);
+            deallocate_next_page_table(maddr_to_page(next_table_maddr), 
+                                       next_level);
         }
     }
 

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYO-0003HV-3a; Fri, 14 Sep 2012 10:55:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYN-0003Fx-3n
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:19 +0000
Received: from [85.158.139.83:48302] by server-2.bemta-5.messagelabs.com id
	93/31-11456-61D03505; Fri, 14 Sep 2012 10:55:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-182.messagelabs.com!1347620115!23275221!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17899 invoked from network); 14 Sep 2012 10:55:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Sep 2012 10: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 1TCTYJ-00013A-MJ
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYJ-0000h7-Hs
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:15 +0000
Message-Id: <E1TCTYJ-0000h7-Hs@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] amd iommu: remove unnecessary
	map/unmap for l1 page tables
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1347364992 -7200
# Node ID 90533f3b6babfda56edbbefda47c46b391204132
# Parent  ae59ecd8a52f3016ef5444446bfd77b780dafc87
amd iommu: remove unnecessary map/unmap for l1 page tables

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r ae59ecd8a52f -r 90533f3b6bab xen/drivers/passthrough/amd/pci_amd_iommu.c
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c	Tue Sep 11 14:01:52 2012 +0200
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c	Tue Sep 11 14:03:12 2012 +0200
@@ -395,25 +395,27 @@ static void deallocate_next_page_table(s
     u64 next_table_maddr;
     int index, next_level;
 
+    if ( level <= 1 )
+    {
+        free_amd_iommu_pgtable(pg);
+        return;
+    }
+
     table_vaddr = __map_domain_page(pg);
 
-    if ( level > 1 )
+    for ( index = 0; index < PTE_PER_TABLE_SIZE; index++ )
     {
-        for ( index = 0; index < PTE_PER_TABLE_SIZE; index++ )
+        pde = table_vaddr + (index * IOMMU_PAGE_TABLE_ENTRY_SIZE);
+        next_table_maddr = amd_iommu_get_next_table_from_pte(pde);
+        next_level = iommu_next_level((u32*)pde);
+
+        if ( (next_table_maddr != 0) && (next_level != 0) &&
+             iommu_is_pte_present((u32*)pde) )
         {
-            pde = table_vaddr + (index * IOMMU_PAGE_TABLE_ENTRY_SIZE);
-            next_table_maddr = amd_iommu_get_next_table_from_pte(pde);
-
-            next_level = iommu_next_level((u32*)pde);
-
-            if ( (next_table_maddr != 0) && (next_level != 0)
-                && iommu_is_pte_present((u32*)pde) )
-            {
-                /* We do not support skip level yet */
-                ASSERT(next_level == level - 1);
-                deallocate_next_page_table(
-                    maddr_to_page(next_table_maddr), next_level);
-            }
+            /* We do not support skip levels yet */
+            ASSERT(next_level == level - 1);
+            deallocate_next_page_table(maddr_to_page(next_table_maddr), 
+                                       next_level);
         }
     }
 

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYN-0003Ga-KO; Fri, 14 Sep 2012 10:55:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYL-0003G2-Mc
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:17 +0000
Received: from [85.158.139.83:48062] by server-1.bemta-5.messagelabs.com id
	E3/28-32692-51D03505; Fri, 14 Sep 2012 10:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-182.messagelabs.com!1347620113!25961631!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27216 invoked from network); 14 Sep 2012 10:55:14 -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;
	14 Sep 2012 10: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 1TCTYG-00012y-Sa
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYG-0000g9-QP
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:12 +0000
Message-Id: <E1TCTYG-0000g9-QP@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: make the dom0_max_vcpus option
	more flexible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User David Vrabel <david.vrabel@citrix.com>
# Date 1347359185 -7200
# Node ID d9d4c7ed2fd2683d1928b36a2a07c6a519273d13
# Parent  0a9a4549e6b91dc030c6a3cfdc0963f7959f5692
x86: make the dom0_max_vcpus option more flexible

The dom0_max_vcpus command line option only allows the exact number of
VCPUs for dom0 to be set.  It is not possible to say "up to N VCPUs
but no more than the number physically present."

Allow a range for the option to set a minimum number of VCPUs, and a
maximum which does not exceed the number of PCPUs.

For example, with "dom0_max_vcpus=4-8":

    PCPUs  Dom0 VCPUs
     2      4
     4      4
     6      6
     8      8
    10      8

Existing command lines with "dom0_max_vcpus=N" still work as before
(and are equivalent to dom0_max_vcpus=N-N).

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 0a9a4549e6b9 -r d9d4c7ed2fd2 docs/misc/xen-command-line.markdown
--- a/docs/misc/xen-command-line.markdown	Tue Sep 11 10:57:36 2012 +0200
+++ b/docs/misc/xen-command-line.markdown	Tue Sep 11 12:26:25 2012 +0200
@@ -378,10 +378,33 @@ Specify the bit width of the DMA heap.
 Specify a list of IO ports to be excluded from dom0 access.
 
 ### dom0\_max\_vcpus
-> `= <integer>`
 
-Specify the maximum number of vcpus to give to dom0.  This defaults
-to the number of pcpus on the host.
+Either:
+
+> `= <integer>`.
+
+The number of VCPUs to give to dom0.  This number of VCPUs can be more
+than the number of PCPUs on the host.  The default is the number of
+PCPUs.
+
+Or:
+
+> `= <min>-<max>` where `<min>` and `<max>` are integers.
+
+Gives dom0 a number of VCPUs equal to the number of PCPUs, but always
+at least `<min>` and no more than `<max>`.  Using `<min>` may give
+more VCPUs than PCPUs.  `<min>` or `<max>` may be omitted and the
+defaults of 1 and unlimited respectively are used instead.
+
+For example, with `dom0_max_vcpus=4-8`:
+
+     Number of
+  PCPUs | Dom0 VCPUs
+   2    |  4
+   4    |  4
+   6    |  6
+   8    |  8
+  10    |  8
 
 ### dom0\_mem
 > `= List of ( min:<size> | max:<size> | <size> )`
diff -r 0a9a4549e6b9 -r d9d4c7ed2fd2 xen/arch/x86/domain_build.c
--- a/xen/arch/x86/domain_build.c	Tue Sep 11 10:57:36 2012 +0200
+++ b/xen/arch/x86/domain_build.c	Tue Sep 11 12:26:25 2012 +0200
@@ -82,20 +82,40 @@ static void __init parse_dom0_mem(const 
 }
 custom_param("dom0_mem", parse_dom0_mem);
 
-static unsigned int __initdata opt_dom0_max_vcpus;
-integer_param("dom0_max_vcpus", opt_dom0_max_vcpus);
+static unsigned int __initdata opt_dom0_max_vcpus_min = 1;
+static unsigned int __initdata opt_dom0_max_vcpus_max = UINT_MAX;
+
+static void __init parse_dom0_max_vcpus(const char *s)
+{
+    if (*s == '-')              /* -M */
+        opt_dom0_max_vcpus_max = simple_strtoul(s + 1, &s, 0);
+    else                        /* N, N-, or N-M */
+    {
+        opt_dom0_max_vcpus_min = simple_strtoul(s, &s, 0);
+        if (*s++ == '\0')       /* N */
+            opt_dom0_max_vcpus_max = opt_dom0_max_vcpus_min;
+        else if (*s != '\0')    /* N-M */
+            opt_dom0_max_vcpus_max = simple_strtoul(s, &s, 0);
+    }
+}
+custom_param("dom0_max_vcpus", parse_dom0_max_vcpus);
 
 struct vcpu *__init alloc_dom0_vcpu0(void)
 {
-    if ( opt_dom0_max_vcpus == 0 )
-        opt_dom0_max_vcpus = num_cpupool_cpus(cpupool0);
-    if ( opt_dom0_max_vcpus > MAX_VIRT_CPUS )
-        opt_dom0_max_vcpus = MAX_VIRT_CPUS;
+    unsigned max_vcpus;
 
-    dom0->vcpu = xzalloc_array(struct vcpu *, opt_dom0_max_vcpus);
+    max_vcpus = num_cpupool_cpus(cpupool0);
+    if ( opt_dom0_max_vcpus_min > max_vcpus )
+        max_vcpus = opt_dom0_max_vcpus_min;
+    if ( opt_dom0_max_vcpus_max < max_vcpus )
+        max_vcpus = opt_dom0_max_vcpus_max;
+    if ( max_vcpus > MAX_VIRT_CPUS )
+        max_vcpus = MAX_VIRT_CPUS;
+
+    dom0->vcpu = xzalloc_array(struct vcpu *, max_vcpus);
     if ( !dom0->vcpu )
         return NULL;
-    dom0->max_vcpus = opt_dom0_max_vcpus;
+    dom0->max_vcpus = max_vcpus;
 
     return alloc_vcpu(dom0, 0, 0);
 }
@@ -185,11 +205,11 @@ static unsigned long __init compute_dom0
     unsigned long max_pages = dom0_max_nrpages;
 
     /* Reserve memory for further dom0 vcpu-struct allocations... */
-    avail -= (opt_dom0_max_vcpus - 1UL)
+    avail -= (d->max_vcpus - 1UL)
              << get_order_from_bytes(sizeof(struct vcpu));
     /* ...and compat_l4's, if needed. */
     if ( is_pv_32on64_domain(d) )
-        avail -= opt_dom0_max_vcpus - 1;
+        avail -= d->max_vcpus - 1;
 
     /* Reserve memory for iommu_dom0_init() (rough estimate). */
     if ( iommu_enabled )
@@ -889,10 +909,10 @@ int __init construct_dom0(
     for ( i = 0; i < XEN_LEGACY_MAX_VCPUS; i++ )
         shared_info(d, vcpu_info[i].evtchn_upcall_mask) = 1;
 
-    printk("Dom0 has maximum %u VCPUs\n", opt_dom0_max_vcpus);
+    printk("Dom0 has maximum %u VCPUs\n", d->max_vcpus);
 
     cpu = cpumask_first(cpupool0->cpu_valid);
-    for ( i = 1; i < opt_dom0_max_vcpus; i++ )
+    for ( i = 1; i < d->max_vcpus; i++ )
     {
         cpu = cpumask_cycle(cpu, cpupool0->cpu_valid);
         (void)alloc_vcpu(d, i, cpu);

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYN-0003Ga-KO; Fri, 14 Sep 2012 10:55:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYL-0003G2-Mc
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:17 +0000
Received: from [85.158.139.83:48062] by server-1.bemta-5.messagelabs.com id
	E3/28-32692-51D03505; Fri, 14 Sep 2012 10:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-182.messagelabs.com!1347620113!25961631!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27216 invoked from network); 14 Sep 2012 10:55:14 -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;
	14 Sep 2012 10: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 1TCTYG-00012y-Sa
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYG-0000g9-QP
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:12 +0000
Message-Id: <E1TCTYG-0000g9-QP@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: make the dom0_max_vcpus option
	more flexible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User David Vrabel <david.vrabel@citrix.com>
# Date 1347359185 -7200
# Node ID d9d4c7ed2fd2683d1928b36a2a07c6a519273d13
# Parent  0a9a4549e6b91dc030c6a3cfdc0963f7959f5692
x86: make the dom0_max_vcpus option more flexible

The dom0_max_vcpus command line option only allows the exact number of
VCPUs for dom0 to be set.  It is not possible to say "up to N VCPUs
but no more than the number physically present."

Allow a range for the option to set a minimum number of VCPUs, and a
maximum which does not exceed the number of PCPUs.

For example, with "dom0_max_vcpus=4-8":

    PCPUs  Dom0 VCPUs
     2      4
     4      4
     6      6
     8      8
    10      8

Existing command lines with "dom0_max_vcpus=N" still work as before
(and are equivalent to dom0_max_vcpus=N-N).

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 0a9a4549e6b9 -r d9d4c7ed2fd2 docs/misc/xen-command-line.markdown
--- a/docs/misc/xen-command-line.markdown	Tue Sep 11 10:57:36 2012 +0200
+++ b/docs/misc/xen-command-line.markdown	Tue Sep 11 12:26:25 2012 +0200
@@ -378,10 +378,33 @@ Specify the bit width of the DMA heap.
 Specify a list of IO ports to be excluded from dom0 access.
 
 ### dom0\_max\_vcpus
-> `= <integer>`
 
-Specify the maximum number of vcpus to give to dom0.  This defaults
-to the number of pcpus on the host.
+Either:
+
+> `= <integer>`.
+
+The number of VCPUs to give to dom0.  This number of VCPUs can be more
+than the number of PCPUs on the host.  The default is the number of
+PCPUs.
+
+Or:
+
+> `= <min>-<max>` where `<min>` and `<max>` are integers.
+
+Gives dom0 a number of VCPUs equal to the number of PCPUs, but always
+at least `<min>` and no more than `<max>`.  Using `<min>` may give
+more VCPUs than PCPUs.  `<min>` or `<max>` may be omitted and the
+defaults of 1 and unlimited respectively are used instead.
+
+For example, with `dom0_max_vcpus=4-8`:
+
+     Number of
+  PCPUs | Dom0 VCPUs
+   2    |  4
+   4    |  4
+   6    |  6
+   8    |  8
+  10    |  8
 
 ### dom0\_mem
 > `= List of ( min:<size> | max:<size> | <size> )`
diff -r 0a9a4549e6b9 -r d9d4c7ed2fd2 xen/arch/x86/domain_build.c
--- a/xen/arch/x86/domain_build.c	Tue Sep 11 10:57:36 2012 +0200
+++ b/xen/arch/x86/domain_build.c	Tue Sep 11 12:26:25 2012 +0200
@@ -82,20 +82,40 @@ static void __init parse_dom0_mem(const 
 }
 custom_param("dom0_mem", parse_dom0_mem);
 
-static unsigned int __initdata opt_dom0_max_vcpus;
-integer_param("dom0_max_vcpus", opt_dom0_max_vcpus);
+static unsigned int __initdata opt_dom0_max_vcpus_min = 1;
+static unsigned int __initdata opt_dom0_max_vcpus_max = UINT_MAX;
+
+static void __init parse_dom0_max_vcpus(const char *s)
+{
+    if (*s == '-')              /* -M */
+        opt_dom0_max_vcpus_max = simple_strtoul(s + 1, &s, 0);
+    else                        /* N, N-, or N-M */
+    {
+        opt_dom0_max_vcpus_min = simple_strtoul(s, &s, 0);
+        if (*s++ == '\0')       /* N */
+            opt_dom0_max_vcpus_max = opt_dom0_max_vcpus_min;
+        else if (*s != '\0')    /* N-M */
+            opt_dom0_max_vcpus_max = simple_strtoul(s, &s, 0);
+    }
+}
+custom_param("dom0_max_vcpus", parse_dom0_max_vcpus);
 
 struct vcpu *__init alloc_dom0_vcpu0(void)
 {
-    if ( opt_dom0_max_vcpus == 0 )
-        opt_dom0_max_vcpus = num_cpupool_cpus(cpupool0);
-    if ( opt_dom0_max_vcpus > MAX_VIRT_CPUS )
-        opt_dom0_max_vcpus = MAX_VIRT_CPUS;
+    unsigned max_vcpus;
 
-    dom0->vcpu = xzalloc_array(struct vcpu *, opt_dom0_max_vcpus);
+    max_vcpus = num_cpupool_cpus(cpupool0);
+    if ( opt_dom0_max_vcpus_min > max_vcpus )
+        max_vcpus = opt_dom0_max_vcpus_min;
+    if ( opt_dom0_max_vcpus_max < max_vcpus )
+        max_vcpus = opt_dom0_max_vcpus_max;
+    if ( max_vcpus > MAX_VIRT_CPUS )
+        max_vcpus = MAX_VIRT_CPUS;
+
+    dom0->vcpu = xzalloc_array(struct vcpu *, max_vcpus);
     if ( !dom0->vcpu )
         return NULL;
-    dom0->max_vcpus = opt_dom0_max_vcpus;
+    dom0->max_vcpus = max_vcpus;
 
     return alloc_vcpu(dom0, 0, 0);
 }
@@ -185,11 +205,11 @@ static unsigned long __init compute_dom0
     unsigned long max_pages = dom0_max_nrpages;
 
     /* Reserve memory for further dom0 vcpu-struct allocations... */
-    avail -= (opt_dom0_max_vcpus - 1UL)
+    avail -= (d->max_vcpus - 1UL)
              << get_order_from_bytes(sizeof(struct vcpu));
     /* ...and compat_l4's, if needed. */
     if ( is_pv_32on64_domain(d) )
-        avail -= opt_dom0_max_vcpus - 1;
+        avail -= d->max_vcpus - 1;
 
     /* Reserve memory for iommu_dom0_init() (rough estimate). */
     if ( iommu_enabled )
@@ -889,10 +909,10 @@ int __init construct_dom0(
     for ( i = 0; i < XEN_LEGACY_MAX_VCPUS; i++ )
         shared_info(d, vcpu_info[i].evtchn_upcall_mask) = 1;
 
-    printk("Dom0 has maximum %u VCPUs\n", opt_dom0_max_vcpus);
+    printk("Dom0 has maximum %u VCPUs\n", d->max_vcpus);
 
     cpu = cpumask_first(cpupool0->cpu_valid);
-    for ( i = 1; i < opt_dom0_max_vcpus; i++ )
+    for ( i = 1; i < d->max_vcpus; i++ )
     {
         cpu = cpumask_cycle(cpu, cpupool0->cpu_valid);
         (void)alloc_vcpu(d, i, cpu);

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYN-0003Gk-Pw; Fri, 14 Sep 2012 10:55:19 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYM-0003GG-Gs
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:18 +0000
Received: from [85.158.143.99:29230] by server-1.bemta-4.messagelabs.com id
	EF/47-12504-51D03505; Fri, 14 Sep 2012 10:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-216.messagelabs.com!1347620115!29754216!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2415 invoked from network); 14 Sep 2012 10:55:16 -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;
	14 Sep 2012 10: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 1TCTYJ-000137-1S
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYI-0000gs-Vg
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:14 +0000
Message-Id: <E1TCTYI-0000gs-Vg@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] amd iommu: use next_level instead of
	recalculating it
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1347364912 -7200
# Node ID ae59ecd8a52f3016ef5444446bfd77b780dafc87
# Parent  0baddae93c5cf9320dbf59695a4476cc31f1fb60
amd iommu: use next_level instead of recalculating it

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 0baddae93c5c -r ae59ecd8a52f xen/drivers/passthrough/amd/pci_amd_iommu.c
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c	Tue Sep 11 14:00:04 2012 +0200
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c	Tue Sep 11 14:01:52 2012 +0200
@@ -409,8 +409,10 @@ static void deallocate_next_page_table(s
             if ( (next_table_maddr != 0) && (next_level != 0)
                 && iommu_is_pte_present((u32*)pde) )
             {
+                /* We do not support skip level yet */
+                ASSERT(next_level == level - 1);
                 deallocate_next_page_table(
-                    maddr_to_page(next_table_maddr), level - 1);
+                    maddr_to_page(next_table_maddr), next_level);
             }
         }
     }

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYN-0003Gk-Pw; Fri, 14 Sep 2012 10:55:19 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYM-0003GG-Gs
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:18 +0000
Received: from [85.158.143.99:29230] by server-1.bemta-4.messagelabs.com id
	EF/47-12504-51D03505; Fri, 14 Sep 2012 10:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-216.messagelabs.com!1347620115!29754216!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2415 invoked from network); 14 Sep 2012 10:55:16 -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;
	14 Sep 2012 10: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 1TCTYJ-000137-1S
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYI-0000gs-Vg
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:14 +0000
Message-Id: <E1TCTYI-0000gs-Vg@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] amd iommu: use next_level instead of
	recalculating it
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1347364912 -7200
# Node ID ae59ecd8a52f3016ef5444446bfd77b780dafc87
# Parent  0baddae93c5cf9320dbf59695a4476cc31f1fb60
amd iommu: use next_level instead of recalculating it

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 0baddae93c5c -r ae59ecd8a52f xen/drivers/passthrough/amd/pci_amd_iommu.c
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c	Tue Sep 11 14:00:04 2012 +0200
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c	Tue Sep 11 14:01:52 2012 +0200
@@ -409,8 +409,10 @@ static void deallocate_next_page_table(s
             if ( (next_table_maddr != 0) && (next_level != 0)
                 && iommu_is_pte_present((u32*)pde) )
             {
+                /* We do not support skip level yet */
+                ASSERT(next_level == level - 1);
                 deallocate_next_page_table(
-                    maddr_to_page(next_table_maddr), level - 1);
+                    maddr_to_page(next_table_maddr), next_level);
             }
         }
     }

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYP-0003Hu-9Y; Fri, 14 Sep 2012 10:55:21 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYN-0003GG-OQ
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:19 +0000
Received: from [85.158.143.99:29317] by server-1.bemta-4.messagelabs.com id
	DB/57-12504-71D03505; Fri, 14 Sep 2012 10:55:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-216.messagelabs.com!1347620116!29440074!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23117 invoked from network); 14 Sep 2012 10:55:17 -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;
	14 Sep 2012 10: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 1TCTYK-00013D-7X
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYK-0000hM-3O
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:16 +0000
Message-Id: <E1TCTYK-0000hM-3O@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tmem: only allow tmem control
	operations from privileged domains
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1347365190 -7200
# Node ID 0dba5a8886556f1b92e59eb19c570ad1704037f6
# Parent  90533f3b6babfda56edbbefda47c46b391204132
tmem: only allow tmem control operations from privileged domains

This is part of XSA-15 / CVE-2012-3497.

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


diff -r 90533f3b6bab -r 0dba5a888655 xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 11 14:03:12 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 11 14:06:30 2012 +0200
@@ -2541,10 +2541,8 @@ static NOINLINE int do_tmem_control(stru
     OID *oidp = (OID *)(&op->u.ctrl.oid[0]);
 
     if (!tmh_current_is_privileged())
-    {
-        /* don't fail... mystery: sometimes dom0 fails here */
-        /* return -EPERM; */
-    }
+        return -EPERM;
+
     switch(subop)
     {
     case TMEMC_THAW:

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYP-0003Hu-9Y; Fri, 14 Sep 2012 10:55:21 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYN-0003GG-OQ
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:19 +0000
Received: from [85.158.143.99:29317] by server-1.bemta-4.messagelabs.com id
	DB/57-12504-71D03505; Fri, 14 Sep 2012 10:55:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-216.messagelabs.com!1347620116!29440074!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23117 invoked from network); 14 Sep 2012 10:55:17 -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;
	14 Sep 2012 10: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 1TCTYK-00013D-7X
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYK-0000hM-3O
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:16 +0000
Message-Id: <E1TCTYK-0000hM-3O@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tmem: only allow tmem control
	operations from privileged domains
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1347365190 -7200
# Node ID 0dba5a8886556f1b92e59eb19c570ad1704037f6
# Parent  90533f3b6babfda56edbbefda47c46b391204132
tmem: only allow tmem control operations from privileged domains

This is part of XSA-15 / CVE-2012-3497.

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


diff -r 90533f3b6bab -r 0dba5a888655 xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 11 14:03:12 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 11 14:06:30 2012 +0200
@@ -2541,10 +2541,8 @@ static NOINLINE int do_tmem_control(stru
     OID *oidp = (OID *)(&op->u.ctrl.oid[0]);
 
     if (!tmh_current_is_privileged())
-    {
-        /* don't fail... mystery: sometimes dom0 fails here */
-        /* return -EPERM; */
-    }
+        return -EPERM;
+
     switch(subop)
     {
     case TMEMC_THAW:

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYQ-0003JA-Ek; Fri, 14 Sep 2012 10:55:22 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYO-0003Hg-Nf
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:20 +0000
Received: from [85.158.143.35:62328] by server-3.bemta-4.messagelabs.com id
	C2/06-08232-81D03505; Fri, 14 Sep 2012 10:55:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-21.messagelabs.com!1347620117!11471389!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18009 invoked from network); 14 Sep 2012 10:55:18 -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;
	14 Sep 2012 10: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 1TCTYL-00013J-Do
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYL-0000hq-BJ
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:17 +0000
Message-Id: <E1TCTYL-0000hq-BJ@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tmem: check the pool_id is valid
	when destroying a tmem pool
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1347365214 -7200
# Node ID d189d99ef00c1e197321593d13282e1b57eb4a38
# Parent  fcf567acc92ae57f4adfbe967b01a2ba0390c08f
tmem: check the pool_id is valid when destroying a tmem pool

This is part of XSA-15 / CVE-2012-3497.

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


diff -r fcf567acc92a -r d189d99ef00c xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 11 14:06:43 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 11 14:06:54 2012 +0200
@@ -1870,6 +1870,8 @@ static NOINLINE int do_tmem_destroy_pool
 
     if ( client->pools == NULL )
         return 0;
+    if ( pool_id >= MAX_POOLS_PER_DOMAIN )
+        return 0;
     if ( (pool = client->pools[pool_id]) == NULL )
         return 0;
     client->pools[pool_id] = NULL;

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYQ-0003JA-Ek; Fri, 14 Sep 2012 10:55:22 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYO-0003Hg-Nf
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:20 +0000
Received: from [85.158.143.35:62328] by server-3.bemta-4.messagelabs.com id
	C2/06-08232-81D03505; Fri, 14 Sep 2012 10:55:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-21.messagelabs.com!1347620117!11471389!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18009 invoked from network); 14 Sep 2012 10:55:18 -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;
	14 Sep 2012 10: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 1TCTYL-00013J-Do
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYL-0000hq-BJ
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:17 +0000
Message-Id: <E1TCTYL-0000hq-BJ@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tmem: check the pool_id is valid
	when destroying a tmem pool
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1347365214 -7200
# Node ID d189d99ef00c1e197321593d13282e1b57eb4a38
# Parent  fcf567acc92ae57f4adfbe967b01a2ba0390c08f
tmem: check the pool_id is valid when destroying a tmem pool

This is part of XSA-15 / CVE-2012-3497.

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


diff -r fcf567acc92a -r d189d99ef00c xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 11 14:06:43 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 11 14:06:54 2012 +0200
@@ -1870,6 +1870,8 @@ static NOINLINE int do_tmem_destroy_pool
 
     if ( client->pools == NULL )
         return 0;
+    if ( pool_id >= MAX_POOLS_PER_DOMAIN )
+        return 0;
     if ( (pool = client->pools[pool_id]) == NULL )
         return 0;
     client->pools[pool_id] = NULL;

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYQ-0003JH-HS; Fri, 14 Sep 2012 10:55:22 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYP-0003Ht-If
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:21 +0000
Received: from [85.158.143.35:40000] by server-2.bemta-4.messagelabs.com id
	DC/FD-21239-81D03505; Fri, 14 Sep 2012 10:55:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-21.messagelabs.com!1347620118!18244805!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21414 invoked from network); 14 Sep 2012 10: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;
	14 Sep 2012 10: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 1TCTYL-00013M-WD
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYL-0000i5-Uv
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:17 +0000
Message-Id: <E1TCTYL-0000i5-Uv@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tmem: check for a valid client
	("domain") in the save subops
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1347365847 -7200
# Node ID f53c5aadbba9d389f4a7d83f308499e22d1d1eda
# Parent  d189d99ef00c1e197321593d13282e1b57eb4a38
tmem: check for a valid client ("domain") in the save subops

This is part of XSA-15 / CVE-2012-3497.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r d189d99ef00c -r f53c5aadbba9 xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 11 14:06:54 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 11 14:17:27 2012 +0200
@@ -2379,12 +2379,18 @@ static NOINLINE int tmemc_save_subop(int
         rc = MAX_POOLS_PER_DOMAIN;
         break;
     case TMEMC_SAVE_GET_CLIENT_WEIGHT:
+        if ( client == NULL )
+            break;
         rc = client->weight == -1 ? -2 : client->weight;
         break;
     case TMEMC_SAVE_GET_CLIENT_CAP:
+        if ( client == NULL )
+            break;
         rc = client->cap == -1 ? -2 : client->cap;
         break;
     case TMEMC_SAVE_GET_CLIENT_FLAGS:
+        if ( client == NULL )
+            break;
         rc = (client->compress ? TMEM_CLIENT_COMPRESS : 0 ) |
              (client->was_frozen ? TMEM_CLIENT_FROZEN : 0 );
         break;
@@ -2408,6 +2414,8 @@ static NOINLINE int tmemc_save_subop(int
         *uuid = pool->uuid[1];
         rc = 0;
     case TMEMC_SAVE_END:
+        if ( client == NULL )
+            break;
         client->live_migrating = 0;
         if ( !list_empty(&client->persistent_invalidated_list) )
             list_for_each_entry_safe(pgp,pgp2,

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYQ-0003JH-HS; Fri, 14 Sep 2012 10:55:22 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYP-0003Ht-If
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:21 +0000
Received: from [85.158.143.35:40000] by server-2.bemta-4.messagelabs.com id
	DC/FD-21239-81D03505; Fri, 14 Sep 2012 10:55:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-21.messagelabs.com!1347620118!18244805!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21414 invoked from network); 14 Sep 2012 10: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;
	14 Sep 2012 10: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 1TCTYL-00013M-WD
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYL-0000i5-Uv
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:17 +0000
Message-Id: <E1TCTYL-0000i5-Uv@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tmem: check for a valid client
	("domain") in the save subops
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1347365847 -7200
# Node ID f53c5aadbba9d389f4a7d83f308499e22d1d1eda
# Parent  d189d99ef00c1e197321593d13282e1b57eb4a38
tmem: check for a valid client ("domain") in the save subops

This is part of XSA-15 / CVE-2012-3497.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r d189d99ef00c -r f53c5aadbba9 xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 11 14:06:54 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 11 14:17:27 2012 +0200
@@ -2379,12 +2379,18 @@ static NOINLINE int tmemc_save_subop(int
         rc = MAX_POOLS_PER_DOMAIN;
         break;
     case TMEMC_SAVE_GET_CLIENT_WEIGHT:
+        if ( client == NULL )
+            break;
         rc = client->weight == -1 ? -2 : client->weight;
         break;
     case TMEMC_SAVE_GET_CLIENT_CAP:
+        if ( client == NULL )
+            break;
         rc = client->cap == -1 ? -2 : client->cap;
         break;
     case TMEMC_SAVE_GET_CLIENT_FLAGS:
+        if ( client == NULL )
+            break;
         rc = (client->compress ? TMEM_CLIENT_COMPRESS : 0 ) |
              (client->was_frozen ? TMEM_CLIENT_FROZEN : 0 );
         break;
@@ -2408,6 +2414,8 @@ static NOINLINE int tmemc_save_subop(int
         *uuid = pool->uuid[1];
         rc = 0;
     case TMEMC_SAVE_END:
+        if ( client == NULL )
+            break;
         client->live_migrating = 0;
         if ( !list_empty(&client->persistent_invalidated_list) )
             list_for_each_entry_safe(pgp,pgp2,

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYP-0003I0-C2; Fri, 14 Sep 2012 10:55:21 +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 1TCTYO-0003H5-Cc
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:20 +0000
Received: from [85.158.137.99:57390] by server-8.bemta-3.messagelabs.com id
	BE/D2-24700-71D03505; Fri, 14 Sep 2012 10:55:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-217.messagelabs.com!1347620117!12866631!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11548 invoked from network); 14 Sep 2012 10:55:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Sep 2012 10: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 1TCTYK-00013G-Qq
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYK-0000hb-PO
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:16 +0000
Message-Id: <E1TCTYK-0000hb-PO@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tmem: consistently make pool_id a
	uint32_t
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1347365203 -7200
# Node ID fcf567acc92ae57f4adfbe967b01a2ba0390c08f
# Parent  0dba5a8886556f1b92e59eb19c570ad1704037f6
tmem: consistently make pool_id a uint32_t

Treating it as an int could allow a malicious guest to provide a
negative pool_Id, by passing the MAX_POOLS_PER_DOMAIN limit check and
allowing access to the negative offsets of the pool array.

This is part of XSA-15 / CVE-2012-3497.

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


diff -r 0dba5a888655 -r fcf567acc92a xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 11 14:06:30 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 11 14:06:43 2012 +0200
@@ -2417,7 +2417,7 @@ static NOINLINE int tmemc_save_subop(int
     return rc;
 }
 
-static NOINLINE int tmemc_save_get_next_page(int cli_id, int pool_id,
+static NOINLINE int tmemc_save_get_next_page(int cli_id, uint32_t pool_id,
                         tmem_cli_va_t buf, uint32_t bufsize)
 {
     client_t *client = tmh_client_from_cli_id(cli_id);
@@ -2509,7 +2509,7 @@ out:
     return ret;
 }
 
-static int tmemc_restore_put_page(int cli_id, int pool_id, OID *oidp,
+static int tmemc_restore_put_page(int cli_id, uint32_t pool_id, OID *oidp,
                       uint32_t index, tmem_cli_va_t buf, uint32_t bufsize)
 {
     client_t *client = tmh_client_from_cli_id(cli_id);
@@ -2521,7 +2521,7 @@ static int tmemc_restore_put_page(int cl
     return do_tmem_put(pool,oidp,index,0,0,0,bufsize,buf.p);
 }
 
-static int tmemc_restore_flush_page(int cli_id, int pool_id, OID *oidp,
+static int tmemc_restore_flush_page(int cli_id, uint32_t pool_id, OID *oidp,
                         uint32_t index)
 {
     client_t *client = tmh_client_from_cli_id(cli_id);

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYP-0003I0-C2; Fri, 14 Sep 2012 10:55:21 +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 1TCTYO-0003H5-Cc
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:20 +0000
Received: from [85.158.137.99:57390] by server-8.bemta-3.messagelabs.com id
	BE/D2-24700-71D03505; Fri, 14 Sep 2012 10:55:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-217.messagelabs.com!1347620117!12866631!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11548 invoked from network); 14 Sep 2012 10:55:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Sep 2012 10: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 1TCTYK-00013G-Qq
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYK-0000hb-PO
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:16 +0000
Message-Id: <E1TCTYK-0000hb-PO@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tmem: consistently make pool_id a
	uint32_t
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1347365203 -7200
# Node ID fcf567acc92ae57f4adfbe967b01a2ba0390c08f
# Parent  0dba5a8886556f1b92e59eb19c570ad1704037f6
tmem: consistently make pool_id a uint32_t

Treating it as an int could allow a malicious guest to provide a
negative pool_Id, by passing the MAX_POOLS_PER_DOMAIN limit check and
allowing access to the negative offsets of the pool array.

This is part of XSA-15 / CVE-2012-3497.

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


diff -r 0dba5a888655 -r fcf567acc92a xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 11 14:06:30 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 11 14:06:43 2012 +0200
@@ -2417,7 +2417,7 @@ static NOINLINE int tmemc_save_subop(int
     return rc;
 }
 
-static NOINLINE int tmemc_save_get_next_page(int cli_id, int pool_id,
+static NOINLINE int tmemc_save_get_next_page(int cli_id, uint32_t pool_id,
                         tmem_cli_va_t buf, uint32_t bufsize)
 {
     client_t *client = tmh_client_from_cli_id(cli_id);
@@ -2509,7 +2509,7 @@ out:
     return ret;
 }
 
-static int tmemc_restore_put_page(int cli_id, int pool_id, OID *oidp,
+static int tmemc_restore_put_page(int cli_id, uint32_t pool_id, OID *oidp,
                       uint32_t index, tmem_cli_va_t buf, uint32_t bufsize)
 {
     client_t *client = tmh_client_from_cli_id(cli_id);
@@ -2521,7 +2521,7 @@ static int tmemc_restore_put_page(int cl
     return do_tmem_put(pool,oidp,index,0,0,0,bufsize,buf.p);
 }
 
-static int tmemc_restore_flush_page(int cli_id, int pool_id, OID *oidp,
+static int tmemc_restore_flush_page(int cli_id, uint32_t pool_id, OID *oidp,
                         uint32_t index)
 {
     client_t *client = tmh_client_from_cli_id(cli_id);

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYR-0003Km-Lv; Fri, 14 Sep 2012 10:55:23 +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 1TCTYP-0003Hx-RT
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:22 +0000
Received: from [85.158.138.51:29724] by server-9.bemta-3.messagelabs.com id
	A9/49-15390-81D03505; Fri, 14 Sep 2012 10:55:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-174.messagelabs.com!1347620111!30040613!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21603 invoked from network); 14 Sep 2012 10:55:13 -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;
	14 Sep 2012 10: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 1TCTYF-00012s-7C
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYE-0000ff-SV
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:10 +0000
Message-Id: <E1TCTYE-0000ff-SV@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/HVM: assorted RTC emulation
	adjustments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347350406 -7200
# Node ID 51090fe1ab9737c13c54c925a961db288581c4fd
# Parent  a1f73e989c249d9d4357d2e6cdf983a83536a0ab
x86/HVM: assorted RTC emulation adjustments

- don't look at RTC_PIE in rtc_timer_update(), and hence don't call the
  function on REG_B writes at all
- only call alarm_timer_update() on REG_B writes when relevant bits
  change
- only call check_update_timer() on REG_B writes when SET changes
- instead properly handle AF and PF when the guest is not also setting
  AIE/PIE respectively (for UF this was already the case, only a
  comment was slightly inaccurate)
- raise the RTC IRQ not only when UIE gets set while UF was already
  set, but generalize this to cover AIE and PIE as well
- properly mask off bit 7 when retrieving the hour values in
  alarm_timer_update(), and properly use RTC_HOURS_ALARM's bit 7 when
  converting from 12- to 24-hour value
- also handle the two other possible clock bases
- use RTC_* names in a couple of places where literal numbers were used
  so far

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


diff -r a1f73e989c24 -r 51090fe1ab97 xen/arch/x86/hvm/rtc.c
--- a/xen/arch/x86/hvm/rtc.c	Mon Sep 10 16:47:31 2012 +0200
+++ b/xen/arch/x86/hvm/rtc.c	Tue Sep 11 10:00:06 2012 +0200
@@ -50,11 +50,24 @@ static void rtc_set_time(RTCState *s);
 static inline int from_bcd(RTCState *s, int a);
 static inline int convert_hour(RTCState *s, int hour);
 
-static void rtc_periodic_cb(struct vcpu *v, void *opaque)
+static void rtc_toggle_irq(RTCState *s)
+{
+    struct domain *d = vrtc_domain(s);
+
+    ASSERT(spin_is_locked(&s->lock));
+    s->hw.cmos_data[RTC_REG_C] |= RTC_IRQF;
+    hvm_isa_irq_deassert(d, RTC_IRQ);
+    hvm_isa_irq_assert(d, RTC_IRQ);
+}
+
+void rtc_periodic_interrupt(void *opaque)
 {
     RTCState *s = opaque;
+
     spin_lock(&s->lock);
-    s->hw.cmos_data[RTC_REG_C] |= 0xc0;
+    s->hw.cmos_data[RTC_REG_C] |= RTC_PF;
+    if ( s->hw.cmos_data[RTC_REG_B] & RTC_PIE )
+        rtc_toggle_irq(s);
     spin_unlock(&s->lock);
 }
 
@@ -68,19 +81,25 @@ static void rtc_timer_update(RTCState *s
     ASSERT(spin_is_locked(&s->lock));
 
     period_code = s->hw.cmos_data[RTC_REG_A] & RTC_RATE_SELECT;
-    if ( (period_code != 0) && (s->hw.cmos_data[RTC_REG_B] & RTC_PIE) )
+    switch ( s->hw.cmos_data[RTC_REG_A] & RTC_DIV_CTL )
     {
-        if ( period_code <= 2 )
+    case RTC_REF_CLCK_32KHZ:
+        if ( (period_code != 0) && (period_code <= 2) )
             period_code += 7;
-
-        period = 1 << (period_code - 1); /* period in 32 Khz cycles */
-        period = DIV_ROUND((period * 1000000000ULL), 32768); /* period in ns */
-        create_periodic_time(v, &s->pt, period, period, RTC_IRQ,
-                             rtc_periodic_cb, s);
-    }
-    else
-    {
+        /* fall through */
+    case RTC_REF_CLCK_1MHZ:
+    case RTC_REF_CLCK_4MHZ:
+        if ( period_code != 0 )
+        {
+            period = 1 << (period_code - 1); /* period in 32 Khz cycles */
+            period = DIV_ROUND(period * 1000000000ULL, 32768); /* in ns */
+            create_periodic_time(v, &s->pt, period, period, RTC_IRQ, NULL, s);
+            break;
+        }
+        /* fall through */
+    default:
         destroy_periodic_time(&s->pt);
+        break;
     }
 }
 
@@ -102,7 +121,7 @@ static void check_update_timer(RTCState 
         guest_usec = get_localtime_us(d) % USEC_PER_SEC;
         if (guest_usec >= (USEC_PER_SEC - 244))
         {
-            /* RTC is in update cycle when enabling UIE */
+            /* RTC is in update cycle */
             s->hw.cmos_data[RTC_REG_A] |= RTC_UIP;
             next_update_time = (USEC_PER_SEC - guest_usec) * NS_PER_USEC;
             expire_time = NOW() + next_update_time;
@@ -144,7 +163,6 @@ static void rtc_update_timer(void *opaqu
 static void rtc_update_timer2(void *opaque)
 {
     RTCState *s = opaque;
-    struct domain *d = vrtc_domain(s);
 
     spin_lock(&s->lock);
     if (!(s->hw.cmos_data[RTC_REG_B] & RTC_SET))
@@ -152,11 +170,7 @@ static void rtc_update_timer2(void *opaq
         s->hw.cmos_data[RTC_REG_C] |= RTC_UF;
         s->hw.cmos_data[RTC_REG_A] &= ~RTC_UIP;
         if ((s->hw.cmos_data[RTC_REG_B] & RTC_UIE))
-        {
-            s->hw.cmos_data[RTC_REG_C] |= RTC_IRQF;
-            hvm_isa_irq_deassert(d, RTC_IRQ);
-            hvm_isa_irq_assert(d, RTC_IRQ);
-        }
+            rtc_toggle_irq(s);
         check_update_timer(s);
     }
     spin_unlock(&s->lock);
@@ -175,21 +189,18 @@ static void alarm_timer_update(RTCState 
 
     stop_timer(&s->alarm_timer);
 
-    if ((s->hw.cmos_data[RTC_REG_B] & RTC_AIE) &&
-            !(s->hw.cmos_data[RTC_REG_B] & RTC_SET))
+    if ( !(s->hw.cmos_data[RTC_REG_B] & RTC_SET) )
     {
         s->current_tm = gmtime(get_localtime(d));
         rtc_copy_date(s);
 
         alarm_sec = from_bcd(s, s->hw.cmos_data[RTC_SECONDS_ALARM]);
         alarm_min = from_bcd(s, s->hw.cmos_data[RTC_MINUTES_ALARM]);
-        alarm_hour = from_bcd(s, s->hw.cmos_data[RTC_HOURS_ALARM]);
-        alarm_hour = convert_hour(s, alarm_hour);
+        alarm_hour = convert_hour(s, s->hw.cmos_data[RTC_HOURS_ALARM]);
 
         cur_sec = from_bcd(s, s->hw.cmos_data[RTC_SECONDS]);
         cur_min = from_bcd(s, s->hw.cmos_data[RTC_MINUTES]);
-        cur_hour = from_bcd(s, s->hw.cmos_data[RTC_HOURS]);
-        cur_hour = convert_hour(s, cur_hour);
+        cur_hour = convert_hour(s, s->hw.cmos_data[RTC_HOURS]);
 
         next_update_time = USEC_PER_SEC - (get_localtime_us(d) % USEC_PER_SEC);
         next_update_time = next_update_time * NS_PER_USEC + NOW();
@@ -343,7 +354,6 @@ static void alarm_timer_update(RTCState 
 static void rtc_alarm_cb(void *opaque)
 {
     RTCState *s = opaque;
-    struct domain *d = vrtc_domain(s);
 
     spin_lock(&s->lock);
     if (!(s->hw.cmos_data[RTC_REG_B] & RTC_SET))
@@ -351,11 +361,7 @@ static void rtc_alarm_cb(void *opaque)
         s->hw.cmos_data[RTC_REG_C] |= RTC_AF;
         /* alarm interrupt */
         if (s->hw.cmos_data[RTC_REG_B] & RTC_AIE)
-        {
-            s->hw.cmos_data[RTC_REG_C] |= RTC_IRQF;
-            hvm_isa_irq_deassert(d, RTC_IRQ);
-            hvm_isa_irq_assert(d, RTC_IRQ);
-        }
+            rtc_toggle_irq(s);
         alarm_timer_update(s);
     }
     spin_unlock(&s->lock);
@@ -365,7 +371,7 @@ static int rtc_ioport_write(void *opaque
 {
     RTCState *s = opaque;
     struct domain *d = vrtc_domain(s);
-    uint32_t orig;
+    uint32_t orig, mask;
 
     spin_lock(&s->lock);
 
@@ -417,7 +423,7 @@ static int rtc_ioport_write(void *opaque
             /* set mode: reset UIP mode */
             s->hw.cmos_data[RTC_REG_A] &= ~RTC_UIP;
             /* adjust cmos before stopping */
-            if (!(s->hw.cmos_data[RTC_REG_B] & RTC_SET))
+            if (!(orig & RTC_SET))
             {
                 s->current_tm = gmtime(get_localtime(d));
                 rtc_copy_date(s);
@@ -426,22 +432,26 @@ static int rtc_ioport_write(void *opaque
         else
         {
             /* if disabling set mode, update the time */
-            if ( s->hw.cmos_data[RTC_REG_B] & RTC_SET )
+            if ( orig & RTC_SET )
                 rtc_set_time(s);
         }
-        /* if the interrupt is already set when the interrupt become
-         * enabled, raise an interrupt immediately*/
-        if ((data & RTC_UIE) && !(s->hw.cmos_data[RTC_REG_B] & RTC_UIE))
-            if (s->hw.cmos_data[RTC_REG_C] & RTC_UF)
+        /*
+         * If the interrupt is already set when the interrupt becomes
+         * enabled, raise an interrupt immediately.
+         * NB: RTC_{A,P,U}IE == RTC_{A,P,U}F respectively.
+         */
+        for ( mask = RTC_UIE; mask <= RTC_PIE; mask <<= 1 )
+            if ( (data & mask) && !(orig & mask) &&
+                 (s->hw.cmos_data[RTC_REG_C] & mask) )
             {
-                hvm_isa_irq_deassert(d, RTC_IRQ);
-                hvm_isa_irq_assert(d, RTC_IRQ);
+                rtc_toggle_irq(s);
+                break;
             }
         s->hw.cmos_data[RTC_REG_B] = data;
-        if ( (data ^ orig) & RTC_PIE )
-            rtc_timer_update(s);
-        check_update_timer(s);
-        alarm_timer_update(s);
+        if ( (data ^ orig) & RTC_SET )
+            check_update_timer(s);
+        if ( (data ^ orig) & (RTC_24H | RTC_DM_BINARY | RTC_SET) )
+            alarm_timer_update(s);
         break;
     case RTC_REG_C:
     case RTC_REG_D:
@@ -456,7 +466,7 @@ static int rtc_ioport_write(void *opaque
 
 static inline int to_bcd(RTCState *s, int a)
 {
-    if ( s->hw.cmos_data[RTC_REG_B] & 0x04 )
+    if ( s->hw.cmos_data[RTC_REG_B] & RTC_DM_BINARY )
         return a;
     else
         return ((a / 10) << 4) | (a % 10);
@@ -464,7 +474,7 @@ static inline int to_bcd(RTCState *s, in
 
 static inline int from_bcd(RTCState *s, int a)
 {
-    if ( s->hw.cmos_data[RTC_REG_B] & 0x04 )
+    if ( s->hw.cmos_data[RTC_REG_B] & RTC_DM_BINARY )
         return a;
     else
         return ((a >> 4) * 10) + (a & 0x0f);
@@ -472,12 +482,14 @@ static inline int from_bcd(RTCState *s, 
 
 /* Hours in 12 hour mode are in 1-12 range, not 0-11.
  * So we need convert it before using it*/
-static inline int convert_hour(RTCState *s, int hour)
+static inline int convert_hour(RTCState *s, int raw)
 {
+    int hour = from_bcd(s, raw & 0x7f);
+
     if (!(s->hw.cmos_data[RTC_REG_B] & RTC_24H))
     {
         hour %= 12;
-        if (s->hw.cmos_data[RTC_HOURS] & 0x80)
+        if (raw & 0x80)
             hour += 12;
     }
     return hour;
@@ -496,8 +508,7 @@ static void rtc_set_time(RTCState *s)
     
     tm->tm_sec = from_bcd(s, s->hw.cmos_data[RTC_SECONDS]);
     tm->tm_min = from_bcd(s, s->hw.cmos_data[RTC_MINUTES]);
-    tm->tm_hour = from_bcd(s, s->hw.cmos_data[RTC_HOURS] & 0x7f);
-    tm->tm_hour = convert_hour(s, tm->tm_hour);
+    tm->tm_hour = convert_hour(s, s->hw.cmos_data[RTC_HOURS]);
     tm->tm_wday = from_bcd(s, s->hw.cmos_data[RTC_DAY_OF_WEEK]);
     tm->tm_mday = from_bcd(s, s->hw.cmos_data[RTC_DAY_OF_MONTH]);
     tm->tm_mon = from_bcd(s, s->hw.cmos_data[RTC_MONTH]) - 1;
diff -r a1f73e989c24 -r 51090fe1ab97 xen/arch/x86/hvm/vpt.c
--- a/xen/arch/x86/hvm/vpt.c	Mon Sep 10 16:47:31 2012 +0200
+++ b/xen/arch/x86/hvm/vpt.c	Tue Sep 11 10:00:06 2012 +0200
@@ -22,6 +22,7 @@
 #include <asm/hvm/vpt.h>
 #include <asm/event.h>
 #include <asm/apic.h>
+#include <asm/mc146818rtc.h>
 
 #define mode_is(d, name) \
     ((d)->arch.hvm_domain.params[HVM_PARAM_TIMER_MODE] == HVMPTM_##name)
@@ -218,6 +219,7 @@ void pt_update_irq(struct vcpu *v)
     struct periodic_time *pt, *temp, *earliest_pt = NULL;
     uint64_t max_lag = -1ULL;
     int irq, is_lapic;
+    void *pt_priv;
 
     spin_lock(&v->arch.hvm_vcpu.tm_lock);
 
@@ -251,13 +253,14 @@ void pt_update_irq(struct vcpu *v)
     earliest_pt->irq_issued = 1;
     irq = earliest_pt->irq;
     is_lapic = (earliest_pt->source == PTSRC_lapic);
+    pt_priv = earliest_pt->priv;
 
     spin_unlock(&v->arch.hvm_vcpu.tm_lock);
 
     if ( is_lapic )
-    {
         vlapic_set_irq(vcpu_vlapic(v), irq, 0);
-    }
+    else if ( irq == RTC_IRQ && pt_priv )
+        rtc_periodic_interrupt(pt_priv);
     else
     {
         hvm_isa_irq_deassert(v->domain, irq);
diff -r a1f73e989c24 -r 51090fe1ab97 xen/include/asm-x86/hvm/vpt.h
--- a/xen/include/asm-x86/hvm/vpt.h	Mon Sep 10 16:47:31 2012 +0200
+++ b/xen/include/asm-x86/hvm/vpt.h	Tue Sep 11 10:00:06 2012 +0200
@@ -181,6 +181,7 @@ void rtc_migrate_timers(struct vcpu *v);
 void rtc_deinit(struct domain *d);
 void rtc_reset(struct domain *d);
 void rtc_update_clock(struct domain *d);
+void rtc_periodic_interrupt(void *);
 
 void pmtimer_init(struct vcpu *v);
 void pmtimer_deinit(struct domain *d);

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYR-0003Km-Lv; Fri, 14 Sep 2012 10:55:23 +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 1TCTYP-0003Hx-RT
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:22 +0000
Received: from [85.158.138.51:29724] by server-9.bemta-3.messagelabs.com id
	A9/49-15390-81D03505; Fri, 14 Sep 2012 10:55:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-174.messagelabs.com!1347620111!30040613!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21603 invoked from network); 14 Sep 2012 10:55:13 -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;
	14 Sep 2012 10: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 1TCTYF-00012s-7C
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYE-0000ff-SV
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:10 +0000
Message-Id: <E1TCTYE-0000ff-SV@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/HVM: assorted RTC emulation
	adjustments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347350406 -7200
# Node ID 51090fe1ab9737c13c54c925a961db288581c4fd
# Parent  a1f73e989c249d9d4357d2e6cdf983a83536a0ab
x86/HVM: assorted RTC emulation adjustments

- don't look at RTC_PIE in rtc_timer_update(), and hence don't call the
  function on REG_B writes at all
- only call alarm_timer_update() on REG_B writes when relevant bits
  change
- only call check_update_timer() on REG_B writes when SET changes
- instead properly handle AF and PF when the guest is not also setting
  AIE/PIE respectively (for UF this was already the case, only a
  comment was slightly inaccurate)
- raise the RTC IRQ not only when UIE gets set while UF was already
  set, but generalize this to cover AIE and PIE as well
- properly mask off bit 7 when retrieving the hour values in
  alarm_timer_update(), and properly use RTC_HOURS_ALARM's bit 7 when
  converting from 12- to 24-hour value
- also handle the two other possible clock bases
- use RTC_* names in a couple of places where literal numbers were used
  so far

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


diff -r a1f73e989c24 -r 51090fe1ab97 xen/arch/x86/hvm/rtc.c
--- a/xen/arch/x86/hvm/rtc.c	Mon Sep 10 16:47:31 2012 +0200
+++ b/xen/arch/x86/hvm/rtc.c	Tue Sep 11 10:00:06 2012 +0200
@@ -50,11 +50,24 @@ static void rtc_set_time(RTCState *s);
 static inline int from_bcd(RTCState *s, int a);
 static inline int convert_hour(RTCState *s, int hour);
 
-static void rtc_periodic_cb(struct vcpu *v, void *opaque)
+static void rtc_toggle_irq(RTCState *s)
+{
+    struct domain *d = vrtc_domain(s);
+
+    ASSERT(spin_is_locked(&s->lock));
+    s->hw.cmos_data[RTC_REG_C] |= RTC_IRQF;
+    hvm_isa_irq_deassert(d, RTC_IRQ);
+    hvm_isa_irq_assert(d, RTC_IRQ);
+}
+
+void rtc_periodic_interrupt(void *opaque)
 {
     RTCState *s = opaque;
+
     spin_lock(&s->lock);
-    s->hw.cmos_data[RTC_REG_C] |= 0xc0;
+    s->hw.cmos_data[RTC_REG_C] |= RTC_PF;
+    if ( s->hw.cmos_data[RTC_REG_B] & RTC_PIE )
+        rtc_toggle_irq(s);
     spin_unlock(&s->lock);
 }
 
@@ -68,19 +81,25 @@ static void rtc_timer_update(RTCState *s
     ASSERT(spin_is_locked(&s->lock));
 
     period_code = s->hw.cmos_data[RTC_REG_A] & RTC_RATE_SELECT;
-    if ( (period_code != 0) && (s->hw.cmos_data[RTC_REG_B] & RTC_PIE) )
+    switch ( s->hw.cmos_data[RTC_REG_A] & RTC_DIV_CTL )
     {
-        if ( period_code <= 2 )
+    case RTC_REF_CLCK_32KHZ:
+        if ( (period_code != 0) && (period_code <= 2) )
             period_code += 7;
-
-        period = 1 << (period_code - 1); /* period in 32 Khz cycles */
-        period = DIV_ROUND((period * 1000000000ULL), 32768); /* period in ns */
-        create_periodic_time(v, &s->pt, period, period, RTC_IRQ,
-                             rtc_periodic_cb, s);
-    }
-    else
-    {
+        /* fall through */
+    case RTC_REF_CLCK_1MHZ:
+    case RTC_REF_CLCK_4MHZ:
+        if ( period_code != 0 )
+        {
+            period = 1 << (period_code - 1); /* period in 32 Khz cycles */
+            period = DIV_ROUND(period * 1000000000ULL, 32768); /* in ns */
+            create_periodic_time(v, &s->pt, period, period, RTC_IRQ, NULL, s);
+            break;
+        }
+        /* fall through */
+    default:
         destroy_periodic_time(&s->pt);
+        break;
     }
 }
 
@@ -102,7 +121,7 @@ static void check_update_timer(RTCState 
         guest_usec = get_localtime_us(d) % USEC_PER_SEC;
         if (guest_usec >= (USEC_PER_SEC - 244))
         {
-            /* RTC is in update cycle when enabling UIE */
+            /* RTC is in update cycle */
             s->hw.cmos_data[RTC_REG_A] |= RTC_UIP;
             next_update_time = (USEC_PER_SEC - guest_usec) * NS_PER_USEC;
             expire_time = NOW() + next_update_time;
@@ -144,7 +163,6 @@ static void rtc_update_timer(void *opaqu
 static void rtc_update_timer2(void *opaque)
 {
     RTCState *s = opaque;
-    struct domain *d = vrtc_domain(s);
 
     spin_lock(&s->lock);
     if (!(s->hw.cmos_data[RTC_REG_B] & RTC_SET))
@@ -152,11 +170,7 @@ static void rtc_update_timer2(void *opaq
         s->hw.cmos_data[RTC_REG_C] |= RTC_UF;
         s->hw.cmos_data[RTC_REG_A] &= ~RTC_UIP;
         if ((s->hw.cmos_data[RTC_REG_B] & RTC_UIE))
-        {
-            s->hw.cmos_data[RTC_REG_C] |= RTC_IRQF;
-            hvm_isa_irq_deassert(d, RTC_IRQ);
-            hvm_isa_irq_assert(d, RTC_IRQ);
-        }
+            rtc_toggle_irq(s);
         check_update_timer(s);
     }
     spin_unlock(&s->lock);
@@ -175,21 +189,18 @@ static void alarm_timer_update(RTCState 
 
     stop_timer(&s->alarm_timer);
 
-    if ((s->hw.cmos_data[RTC_REG_B] & RTC_AIE) &&
-            !(s->hw.cmos_data[RTC_REG_B] & RTC_SET))
+    if ( !(s->hw.cmos_data[RTC_REG_B] & RTC_SET) )
     {
         s->current_tm = gmtime(get_localtime(d));
         rtc_copy_date(s);
 
         alarm_sec = from_bcd(s, s->hw.cmos_data[RTC_SECONDS_ALARM]);
         alarm_min = from_bcd(s, s->hw.cmos_data[RTC_MINUTES_ALARM]);
-        alarm_hour = from_bcd(s, s->hw.cmos_data[RTC_HOURS_ALARM]);
-        alarm_hour = convert_hour(s, alarm_hour);
+        alarm_hour = convert_hour(s, s->hw.cmos_data[RTC_HOURS_ALARM]);
 
         cur_sec = from_bcd(s, s->hw.cmos_data[RTC_SECONDS]);
         cur_min = from_bcd(s, s->hw.cmos_data[RTC_MINUTES]);
-        cur_hour = from_bcd(s, s->hw.cmos_data[RTC_HOURS]);
-        cur_hour = convert_hour(s, cur_hour);
+        cur_hour = convert_hour(s, s->hw.cmos_data[RTC_HOURS]);
 
         next_update_time = USEC_PER_SEC - (get_localtime_us(d) % USEC_PER_SEC);
         next_update_time = next_update_time * NS_PER_USEC + NOW();
@@ -343,7 +354,6 @@ static void alarm_timer_update(RTCState 
 static void rtc_alarm_cb(void *opaque)
 {
     RTCState *s = opaque;
-    struct domain *d = vrtc_domain(s);
 
     spin_lock(&s->lock);
     if (!(s->hw.cmos_data[RTC_REG_B] & RTC_SET))
@@ -351,11 +361,7 @@ static void rtc_alarm_cb(void *opaque)
         s->hw.cmos_data[RTC_REG_C] |= RTC_AF;
         /* alarm interrupt */
         if (s->hw.cmos_data[RTC_REG_B] & RTC_AIE)
-        {
-            s->hw.cmos_data[RTC_REG_C] |= RTC_IRQF;
-            hvm_isa_irq_deassert(d, RTC_IRQ);
-            hvm_isa_irq_assert(d, RTC_IRQ);
-        }
+            rtc_toggle_irq(s);
         alarm_timer_update(s);
     }
     spin_unlock(&s->lock);
@@ -365,7 +371,7 @@ static int rtc_ioport_write(void *opaque
 {
     RTCState *s = opaque;
     struct domain *d = vrtc_domain(s);
-    uint32_t orig;
+    uint32_t orig, mask;
 
     spin_lock(&s->lock);
 
@@ -417,7 +423,7 @@ static int rtc_ioport_write(void *opaque
             /* set mode: reset UIP mode */
             s->hw.cmos_data[RTC_REG_A] &= ~RTC_UIP;
             /* adjust cmos before stopping */
-            if (!(s->hw.cmos_data[RTC_REG_B] & RTC_SET))
+            if (!(orig & RTC_SET))
             {
                 s->current_tm = gmtime(get_localtime(d));
                 rtc_copy_date(s);
@@ -426,22 +432,26 @@ static int rtc_ioport_write(void *opaque
         else
         {
             /* if disabling set mode, update the time */
-            if ( s->hw.cmos_data[RTC_REG_B] & RTC_SET )
+            if ( orig & RTC_SET )
                 rtc_set_time(s);
         }
-        /* if the interrupt is already set when the interrupt become
-         * enabled, raise an interrupt immediately*/
-        if ((data & RTC_UIE) && !(s->hw.cmos_data[RTC_REG_B] & RTC_UIE))
-            if (s->hw.cmos_data[RTC_REG_C] & RTC_UF)
+        /*
+         * If the interrupt is already set when the interrupt becomes
+         * enabled, raise an interrupt immediately.
+         * NB: RTC_{A,P,U}IE == RTC_{A,P,U}F respectively.
+         */
+        for ( mask = RTC_UIE; mask <= RTC_PIE; mask <<= 1 )
+            if ( (data & mask) && !(orig & mask) &&
+                 (s->hw.cmos_data[RTC_REG_C] & mask) )
             {
-                hvm_isa_irq_deassert(d, RTC_IRQ);
-                hvm_isa_irq_assert(d, RTC_IRQ);
+                rtc_toggle_irq(s);
+                break;
             }
         s->hw.cmos_data[RTC_REG_B] = data;
-        if ( (data ^ orig) & RTC_PIE )
-            rtc_timer_update(s);
-        check_update_timer(s);
-        alarm_timer_update(s);
+        if ( (data ^ orig) & RTC_SET )
+            check_update_timer(s);
+        if ( (data ^ orig) & (RTC_24H | RTC_DM_BINARY | RTC_SET) )
+            alarm_timer_update(s);
         break;
     case RTC_REG_C:
     case RTC_REG_D:
@@ -456,7 +466,7 @@ static int rtc_ioport_write(void *opaque
 
 static inline int to_bcd(RTCState *s, int a)
 {
-    if ( s->hw.cmos_data[RTC_REG_B] & 0x04 )
+    if ( s->hw.cmos_data[RTC_REG_B] & RTC_DM_BINARY )
         return a;
     else
         return ((a / 10) << 4) | (a % 10);
@@ -464,7 +474,7 @@ static inline int to_bcd(RTCState *s, in
 
 static inline int from_bcd(RTCState *s, int a)
 {
-    if ( s->hw.cmos_data[RTC_REG_B] & 0x04 )
+    if ( s->hw.cmos_data[RTC_REG_B] & RTC_DM_BINARY )
         return a;
     else
         return ((a >> 4) * 10) + (a & 0x0f);
@@ -472,12 +482,14 @@ static inline int from_bcd(RTCState *s, 
 
 /* Hours in 12 hour mode are in 1-12 range, not 0-11.
  * So we need convert it before using it*/
-static inline int convert_hour(RTCState *s, int hour)
+static inline int convert_hour(RTCState *s, int raw)
 {
+    int hour = from_bcd(s, raw & 0x7f);
+
     if (!(s->hw.cmos_data[RTC_REG_B] & RTC_24H))
     {
         hour %= 12;
-        if (s->hw.cmos_data[RTC_HOURS] & 0x80)
+        if (raw & 0x80)
             hour += 12;
     }
     return hour;
@@ -496,8 +508,7 @@ static void rtc_set_time(RTCState *s)
     
     tm->tm_sec = from_bcd(s, s->hw.cmos_data[RTC_SECONDS]);
     tm->tm_min = from_bcd(s, s->hw.cmos_data[RTC_MINUTES]);
-    tm->tm_hour = from_bcd(s, s->hw.cmos_data[RTC_HOURS] & 0x7f);
-    tm->tm_hour = convert_hour(s, tm->tm_hour);
+    tm->tm_hour = convert_hour(s, s->hw.cmos_data[RTC_HOURS]);
     tm->tm_wday = from_bcd(s, s->hw.cmos_data[RTC_DAY_OF_WEEK]);
     tm->tm_mday = from_bcd(s, s->hw.cmos_data[RTC_DAY_OF_MONTH]);
     tm->tm_mon = from_bcd(s, s->hw.cmos_data[RTC_MONTH]) - 1;
diff -r a1f73e989c24 -r 51090fe1ab97 xen/arch/x86/hvm/vpt.c
--- a/xen/arch/x86/hvm/vpt.c	Mon Sep 10 16:47:31 2012 +0200
+++ b/xen/arch/x86/hvm/vpt.c	Tue Sep 11 10:00:06 2012 +0200
@@ -22,6 +22,7 @@
 #include <asm/hvm/vpt.h>
 #include <asm/event.h>
 #include <asm/apic.h>
+#include <asm/mc146818rtc.h>
 
 #define mode_is(d, name) \
     ((d)->arch.hvm_domain.params[HVM_PARAM_TIMER_MODE] == HVMPTM_##name)
@@ -218,6 +219,7 @@ void pt_update_irq(struct vcpu *v)
     struct periodic_time *pt, *temp, *earliest_pt = NULL;
     uint64_t max_lag = -1ULL;
     int irq, is_lapic;
+    void *pt_priv;
 
     spin_lock(&v->arch.hvm_vcpu.tm_lock);
 
@@ -251,13 +253,14 @@ void pt_update_irq(struct vcpu *v)
     earliest_pt->irq_issued = 1;
     irq = earliest_pt->irq;
     is_lapic = (earliest_pt->source == PTSRC_lapic);
+    pt_priv = earliest_pt->priv;
 
     spin_unlock(&v->arch.hvm_vcpu.tm_lock);
 
     if ( is_lapic )
-    {
         vlapic_set_irq(vcpu_vlapic(v), irq, 0);
-    }
+    else if ( irq == RTC_IRQ && pt_priv )
+        rtc_periodic_interrupt(pt_priv);
     else
     {
         hvm_isa_irq_deassert(v->domain, irq);
diff -r a1f73e989c24 -r 51090fe1ab97 xen/include/asm-x86/hvm/vpt.h
--- a/xen/include/asm-x86/hvm/vpt.h	Mon Sep 10 16:47:31 2012 +0200
+++ b/xen/include/asm-x86/hvm/vpt.h	Tue Sep 11 10:00:06 2012 +0200
@@ -181,6 +181,7 @@ void rtc_migrate_timers(struct vcpu *v);
 void rtc_deinit(struct domain *d);
 void rtc_reset(struct domain *d);
 void rtc_update_clock(struct domain *d);
+void rtc_periodic_interrupt(void *);
 
 void pmtimer_init(struct vcpu *v);
 void pmtimer_deinit(struct domain *d);

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYS-0003M7-PZ; Fri, 14 Sep 2012 10:55:24 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYQ-0003Hg-OG
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:23 +0000
Received: from [85.158.143.99:29510] by server-3.bemta-4.messagelabs.com id
	43/16-08232-A1D03505; Fri, 14 Sep 2012 10:55:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1347620118!23928139!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14099 invoked from network); 14 Sep 2012 10:55:20 -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;
	14 Sep 2012 10: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 1TCTYM-00013P-KG
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYM-0000iK-G1
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:18 +0000
Message-Id: <E1TCTYM-0000iK-G1@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tmem: don't access guest memory
	without using the accessors intended for this
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347365869 -7200
# Node ID ccd60ed6c555e1816cac448fcb20a84533977b43
# Parent  f53c5aadbba9d389f4a7d83f308499e22d1d1eda
tmem: don't access guest memory without using the accessors intended for this

This is not permitted, not even for buffers coming from Dom0 (and it
would also break the moment Dom0 runs in HVM mode). An implication from
the changes here is that tmh_copy_page() can't be used anymore for
control operations calling tmh_copy_{from,to}_client() (as those pass
the buffer by virtual address rather than MFN).

Note that tmemc_save_get_next_page() previously didn't set the returned
handle's pool_id field, while the new code does. It need to be
confirmed that this is not a problem (otherwise the copy-out operation
will require further tmh_...() abstractions to be added).

Further note that the patch removes (rather than adjusts) an invalid
call to unmap_domain_page() (no matching map_domain_page()) from
tmh_compress_from_client() and adds a missing one to an error return
path in tmh_copy_from_client().

Finally note that the patch adds a previously missing return statement
to cli_get_page() (without which that function could de-reference a
NULL pointer, triggerable from guest mode).

This is part of XSA-15 / CVE-2012-3497.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
---


diff -r f53c5aadbba9 -r ccd60ed6c555 xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 11 14:17:27 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 11 14:17:49 2012 +0200
@@ -388,11 +388,13 @@ static NOINLINE int pcd_copy_to_client(t
     pcd = pgp->pcd;
     if ( pgp->size < PAGE_SIZE && pgp->size != 0 &&
          pcd->size < PAGE_SIZE && pcd->size != 0 )
-        ret = tmh_decompress_to_client(cmfn, pcd->cdata, pcd->size, NULL);
+        ret = tmh_decompress_to_client(cmfn, pcd->cdata, pcd->size,
+                                       tmh_cli_buf_null);
     else if ( tmh_tze_enabled() && pcd->size < PAGE_SIZE )
         ret = tmh_copy_tze_to_client(cmfn, pcd->tze, pcd->size);
     else
-        ret = tmh_copy_to_client(cmfn, pcd->pfp, 0, 0, PAGE_SIZE, NULL);
+        ret = tmh_copy_to_client(cmfn, pcd->pfp, 0, 0, PAGE_SIZE,
+                                 tmh_cli_buf_null);
     tmem_read_unlock(&pcd_tree_rwlocks[firstbyte]);
     return ret;
 }
@@ -1444,7 +1446,7 @@ static inline void tmem_ensure_avail_pag
 /************ TMEM CORE OPERATIONS ************************************/
 
 static NOINLINE int do_tmem_put_compress(pgp_t *pgp, tmem_cli_mfn_t cmfn,
-                                         void *cva)
+                                         tmem_cli_va_t clibuf)
 {
     void *dst, *p;
     size_t size;
@@ -1463,7 +1465,7 @@ static NOINLINE int do_tmem_put_compress
     if ( pgp->pfp != NULL )
         pgp_free_data(pgp, pgp->us.obj->pool);
     START_CYC_COUNTER(compress);
-    ret = tmh_compress_from_client(cmfn, &dst, &size, cva);
+    ret = tmh_compress_from_client(cmfn, &dst, &size, clibuf);
     if ( (ret == -EFAULT) || (ret == 0) )
         goto out;
     else if ( (size == 0) || (size >= tmem_subpage_maxsize()) ) {
@@ -1490,7 +1492,8 @@ out:
 }
 
 static NOINLINE int do_tmem_dup_put(pgp_t *pgp, tmem_cli_mfn_t cmfn,
-       pagesize_t tmem_offset, pagesize_t pfn_offset, pagesize_t len, void *cva)
+       pagesize_t tmem_offset, pagesize_t pfn_offset, pagesize_t len,
+       tmem_cli_va_t clibuf)
 {
     pool_t *pool;
     obj_t *obj;
@@ -1512,7 +1515,7 @@ static NOINLINE int do_tmem_dup_put(pgp_
     /* can we successfully manipulate pgp to change out the data? */
     if ( len != 0 && client->compress && pgp->size != 0 )
     {
-        ret = do_tmem_put_compress(pgp,cmfn,cva);
+        ret = do_tmem_put_compress(pgp, cmfn, clibuf);
         if ( ret == 1 )
             goto done;
         else if ( ret == 0 )
@@ -1530,7 +1533,8 @@ copy_uncompressed:
         goto failed_dup;
     pgp->size = 0;
     /* tmh_copy_from_client properly handles len==0 and offsets != 0 */
-    ret = tmh_copy_from_client(pgp->pfp,cmfn,tmem_offset,pfn_offset,len,0);
+    ret = tmh_copy_from_client(pgp->pfp, cmfn, tmem_offset, pfn_offset, len,
+                               tmh_cli_buf_null);
     if ( ret == -EFAULT )
         goto bad_copy;
     if ( tmh_dedup_enabled() && !is_persistent(pool) )
@@ -1582,7 +1586,7 @@ cleanup:
 static NOINLINE int do_tmem_put(pool_t *pool,
               OID *oidp, uint32_t index,
               tmem_cli_mfn_t cmfn, pagesize_t tmem_offset,
-              pagesize_t pfn_offset, pagesize_t len, void *cva)
+              pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_t clibuf)
 {
     obj_t *obj = NULL, *objfound = NULL, *objnew = NULL;
     pgp_t *pgp = NULL, *pgpdel = NULL;
@@ -1596,7 +1600,8 @@ static NOINLINE int do_tmem_put(pool_t *
     {
         ASSERT_SPINLOCK(&objfound->obj_spinlock);
         if ((pgp = pgp_lookup_in_obj(objfound, index)) != NULL)
-            return do_tmem_dup_put(pgp,cmfn,tmem_offset,pfn_offset,len,cva);
+            return do_tmem_dup_put(pgp, cmfn, tmem_offset, pfn_offset, len,
+                                   clibuf);
     }
 
     /* no puts allowed into a frozen pool (except dup puts) */
@@ -1631,7 +1636,7 @@ static NOINLINE int do_tmem_put(pool_t *
     if ( len != 0 && client->compress )
     {
         ASSERT(pgp->pfp == NULL);
-        ret = do_tmem_put_compress(pgp,cmfn,cva);
+        ret = do_tmem_put_compress(pgp, cmfn, clibuf);
         if ( ret == 1 )
             goto insert_page;
         if ( ret == -ENOMEM )
@@ -1655,7 +1660,8 @@ copy_uncompressed:
         goto delete_and_free;
     }
     /* tmh_copy_from_client properly handles len==0 (TMEM_NEW_PAGE) */
-    ret = tmh_copy_from_client(pgp->pfp,cmfn,tmem_offset,pfn_offset,len,cva);
+    ret = tmh_copy_from_client(pgp->pfp, cmfn, tmem_offset, pfn_offset, len,
+                               clibuf);
     if ( ret == -EFAULT )
         goto bad_copy;
     if ( tmh_dedup_enabled() && !is_persistent(pool) )
@@ -1725,12 +1731,13 @@ free:
 
 static NOINLINE int do_tmem_get(pool_t *pool, OID *oidp, uint32_t index,
               tmem_cli_mfn_t cmfn, pagesize_t tmem_offset,
-              pagesize_t pfn_offset, pagesize_t len, void *cva)
+              pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_t clibuf)
 {
     obj_t *obj;
     pgp_t *pgp;
     client_t *client = pool->client;
     DECL_LOCAL_CYC_COUNTER(decompress);
+    int rc = -EFAULT;
 
     if ( !_atomic_read(pool->pgp_count) )
         return -EEMPTY;
@@ -1755,16 +1762,18 @@ static NOINLINE int do_tmem_get(pool_t *
     if ( tmh_dedup_enabled() && !is_persistent(pool) &&
               pgp->firstbyte != NOT_SHAREABLE )
     {
-        if ( pcd_copy_to_client(cmfn, pgp) == -EFAULT )
+        rc = pcd_copy_to_client(cmfn, pgp);
+        if ( rc <= 0 )
             goto bad_copy;
     } else if ( pgp->size != 0 ) {
         START_CYC_COUNTER(decompress);
-        if ( tmh_decompress_to_client(cmfn, pgp->cdata,
-                                      pgp->size, cva) == -EFAULT )
+        rc = tmh_decompress_to_client(cmfn, pgp->cdata,
+                                      pgp->size, clibuf);
+        if ( rc <= 0 )
             goto bad_copy;
         END_CYC_COUNTER(decompress);
     } else if ( tmh_copy_to_client(cmfn, pgp->pfp, tmem_offset,
-                                 pfn_offset, len, cva) == -EFAULT)
+                                 pfn_offset, len, clibuf) == -EFAULT)
         goto bad_copy;
     if ( is_ephemeral(pool) )
     {
@@ -1804,8 +1813,7 @@ static NOINLINE int do_tmem_get(pool_t *
 bad_copy:
     /* this should only happen if the client passed a bad mfn */
     failed_copies++;
-    return -EFAULT;
-
+    return rc;
 }
 
 static NOINLINE int do_tmem_flush_page(pool_t *pool, OID *oidp, uint32_t index)
@@ -2345,7 +2353,6 @@ static NOINLINE int tmemc_save_subop(int
     pool_t *pool = (client == NULL || pool_id >= MAX_POOLS_PER_DOMAIN)
                    ? NULL : client->pools[pool_id];
     uint32_t p;
-    uint64_t *uuid;
     pgp_t *pgp, *pgp2;
     int rc = -1;
 
@@ -2409,9 +2416,7 @@ static NOINLINE int tmemc_save_subop(int
     case TMEMC_SAVE_GET_POOL_UUID:
          if ( pool == NULL )
              break;
-        uuid = (uint64_t *)buf.p;
-        *uuid++ = pool->uuid[0];
-        *uuid = pool->uuid[1];
+        tmh_copy_to_client_buf(buf, pool->uuid, 2);
         rc = 0;
     case TMEMC_SAVE_END:
         if ( client == NULL )
@@ -2436,7 +2441,7 @@ static NOINLINE int tmemc_save_get_next_
     pgp_t *pgp;
     OID oid;
     int ret = 0;
-    struct tmem_handle *h;
+    struct tmem_handle h;
     unsigned int pagesize = 1 << (pool->pageshift+12);
 
     if ( pool == NULL || is_ephemeral(pool) )
@@ -2467,11 +2472,13 @@ static NOINLINE int tmemc_save_get_next_
                          pgp_t,us.pool_pers_pages);
     pool->cur_pgp = pgp;
     oid = pgp->us.obj->oid;
-    h = (struct tmem_handle *)buf.p;
-    *(OID *)&h->oid[0] = oid;
-    h->index = pgp->index;
-    buf.p = (void *)(h+1);
-    ret = do_tmem_get(pool, &oid, h->index,0,0,0,pagesize,buf.p);
+    h.pool_id = pool_id;
+    BUILD_BUG_ON(sizeof(h.oid) != sizeof(oid));
+    memcpy(h.oid, oid.oid, sizeof(h.oid));
+    h.index = pgp->index;
+    tmh_copy_to_client_buf(buf, &h, 1);
+    tmh_client_buf_add(buf, sizeof(h));
+    ret = do_tmem_get(pool, &oid, pgp->index, 0, 0, 0, pagesize, buf);
 
 out:
     tmem_spin_unlock(&pers_lists_spinlock);
@@ -2483,7 +2490,7 @@ static NOINLINE int tmemc_save_get_next_
 {
     client_t *client = tmh_client_from_cli_id(cli_id);
     pgp_t *pgp;
-    struct tmem_handle *h;
+    struct tmem_handle h;
     int ret = 0;
 
     if ( client == NULL )
@@ -2509,10 +2516,11 @@ static NOINLINE int tmemc_save_get_next_
                          pgp_t,client_inv_pages);
         client->cur_pgp = pgp;
     }
-    h = (struct tmem_handle *)buf.p;
-    h->pool_id = pgp->pool_id;
-    *(OID *)&h->oid = pgp->inv_oid;
-    h->index = pgp->index;
+    h.pool_id = pgp->pool_id;
+    BUILD_BUG_ON(sizeof(h.oid) != sizeof(pgp->inv_oid));
+    memcpy(h.oid, pgp->inv_oid.oid, sizeof(h.oid));
+    h.index = pgp->index;
+    tmh_copy_to_client_buf(buf, &h, 1);
     ret = 1;
 out:
     tmem_spin_unlock(&pers_lists_spinlock);
@@ -2528,7 +2536,7 @@ static int tmemc_restore_put_page(int cl
 
     if ( pool == NULL )
         return -1;
-    return do_tmem_put(pool,oidp,index,0,0,0,bufsize,buf.p);
+    return do_tmem_put(pool, oidp, index, 0, 0, 0, bufsize, buf);
 }
 
 static int tmemc_restore_flush_page(int cli_id, uint32_t pool_id, OID *oidp,
@@ -2732,19 +2740,19 @@ EXPORT long do_tmem_op(tmem_cli_op_t uop
         break;
     case TMEM_NEW_PAGE:
         tmem_ensure_avail_pages();
-        rc = do_tmem_put(pool, oidp,
-                         op.u.gen.index, op.u.gen.cmfn, 0, 0, 0, NULL);
+        rc = do_tmem_put(pool, oidp, op.u.gen.index, op.u.gen.cmfn, 0, 0, 0,
+                         tmh_cli_buf_null);
         break;
     case TMEM_PUT_PAGE:
         tmem_ensure_avail_pages();
-        rc = do_tmem_put(pool, oidp,
-                    op.u.gen.index, op.u.gen.cmfn, 0, 0, PAGE_SIZE, NULL);
+        rc = do_tmem_put(pool, oidp, op.u.gen.index, op.u.gen.cmfn, 0, 0,
+                         PAGE_SIZE, tmh_cli_buf_null);
         if (rc == 1) succ_put = 1;
         else non_succ_put = 1;
         break;
     case TMEM_GET_PAGE:
         rc = do_tmem_get(pool, oidp, op.u.gen.index, op.u.gen.cmfn,
-                         0, 0, PAGE_SIZE, 0);
+                         0, 0, PAGE_SIZE, tmh_cli_buf_null);
         if (rc == 1) succ_get = 1;
         else non_succ_get = 1;
         break;
@@ -2763,13 +2771,13 @@ EXPORT long do_tmem_op(tmem_cli_op_t uop
     case TMEM_READ:
         rc = do_tmem_get(pool, oidp, op.u.gen.index, op.u.gen.cmfn,
                          op.u.gen.tmem_offset, op.u.gen.pfn_offset,
-                         op.u.gen.len,0);
+                         op.u.gen.len, tmh_cli_buf_null);
         break;
     case TMEM_WRITE:
         rc = do_tmem_put(pool, oidp,
                          op.u.gen.index, op.u.gen.cmfn,
                          op.u.gen.tmem_offset, op.u.gen.pfn_offset,
-                         op.u.gen.len, NULL);
+                         op.u.gen.len, tmh_cli_buf_null);
         break;
     case TMEM_XCHG:
         /* need to hold global lock to ensure xchg is atomic */
diff -r f53c5aadbba9 -r ccd60ed6c555 xen/common/tmem_xen.c
--- a/xen/common/tmem_xen.c	Tue Sep 11 14:17:27 2012 +0200
+++ b/xen/common/tmem_xen.c	Tue Sep 11 14:17:49 2012 +0200
@@ -51,6 +51,7 @@ DECL_CYC_COUNTER(pg_copy);
 #define LZO_DSTMEM_PAGES 2
 static DEFINE_PER_CPU_READ_MOSTLY(unsigned char *, workmem);
 static DEFINE_PER_CPU_READ_MOSTLY(unsigned char *, dstmem);
+static DEFINE_PER_CPU_READ_MOSTLY(void *, scratch_page);
 
 #ifdef COMPARE_COPY_PAGE_SSE2
 #include <asm/flushtlb.h>  /* REMOVE ME AFTER TEST */
@@ -115,6 +116,7 @@ static inline void *cli_get_page(tmem_cl
     {
         if ( page )
             put_page(page);
+        return NULL;
     }
 
     if ( cli_write && !get_page_type(page, PGT_writable_page) )
@@ -144,12 +146,12 @@ static inline void cli_put_page(tmem_cli
 
 EXPORT int tmh_copy_from_client(pfp_t *pfp,
     tmem_cli_mfn_t cmfn, pagesize_t tmem_offset,
-    pagesize_t pfn_offset, pagesize_t len, void *cli_va)
+    pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_t clibuf)
 {
     unsigned long tmem_mfn, cli_mfn = 0;
-    void *tmem_va;
+    char *tmem_va, *cli_va = NULL;
     pfp_t *cli_pfp = NULL;
-    bool_t tmemc = cli_va != NULL; /* if true, cli_va is control-op buffer */
+    int rc = 1;
 
     ASSERT(pfp != NULL);
     tmem_mfn = page_to_mfn(pfp);
@@ -160,62 +162,76 @@ EXPORT int tmh_copy_from_client(pfp_t *p
         unmap_domain_page(tmem_va);
         return 1;
     }
-    if ( !tmemc )
+    if ( guest_handle_is_null(clibuf) )
+    {
+        cli_va = cli_get_page(cmfn, &cli_mfn, &cli_pfp, 0);
+        if ( cli_va == NULL )
+        {
+            unmap_domain_page(tmem_va);
+            return -EFAULT;
+        }
+    }
+    mb();
+    if ( len == PAGE_SIZE && !tmem_offset && !pfn_offset && cli_va )
+        tmh_copy_page(tmem_va, cli_va);
+    else if ( (tmem_offset+len <= PAGE_SIZE) &&
+              (pfn_offset+len <= PAGE_SIZE) )
+    {
+        if ( cli_va )
+            memcpy(tmem_va + tmem_offset, cli_va + pfn_offset, len);
+        else if ( copy_from_guest_offset(tmem_va + tmem_offset, clibuf,
+                                         pfn_offset, len) )
+            rc = -EFAULT;
+    }
+    if ( cli_va )
+        cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 0);
+    unmap_domain_page(tmem_va);
+    return rc;
+}
+
+EXPORT int tmh_compress_from_client(tmem_cli_mfn_t cmfn,
+    void **out_va, size_t *out_len, tmem_cli_va_t clibuf)
+{
+    int ret = 0;
+    unsigned char *dmem = this_cpu(dstmem);
+    unsigned char *wmem = this_cpu(workmem);
+    char *scratch = this_cpu(scratch_page);
+    pfp_t *cli_pfp = NULL;
+    unsigned long cli_mfn = 0;
+    void *cli_va = NULL;
+
+    if ( dmem == NULL || wmem == NULL )
+        return 0;  /* no buffer, so can't compress */
+    if ( guest_handle_is_null(clibuf) )
     {
         cli_va = cli_get_page(cmfn, &cli_mfn, &cli_pfp, 0);
         if ( cli_va == NULL )
             return -EFAULT;
     }
+    else if ( !scratch )
+        return 0;
+    else if ( copy_from_guest(scratch, clibuf, PAGE_SIZE) )
+        return -EFAULT;
     mb();
-    if (len == PAGE_SIZE && !tmem_offset && !pfn_offset)
-        tmh_copy_page(tmem_va, cli_va);
-    else if ( (tmem_offset+len <= PAGE_SIZE) &&
-              (pfn_offset+len <= PAGE_SIZE) )
-        memcpy((char *)tmem_va+tmem_offset,(char *)cli_va+pfn_offset,len);
-    if ( !tmemc )
-        cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 0);
-    unmap_domain_page(tmem_va);
-    return 1;
-}
-
-EXPORT int tmh_compress_from_client(tmem_cli_mfn_t cmfn,
-    void **out_va, size_t *out_len, void *cli_va)
-{
-    int ret = 0;
-    unsigned char *dmem = this_cpu(dstmem);
-    unsigned char *wmem = this_cpu(workmem);
-    pfp_t *cli_pfp = NULL;
-    unsigned long cli_mfn = 0;
-    bool_t tmemc = cli_va != NULL; /* if true, cli_va is control-op buffer */
-
-    if ( dmem == NULL || wmem == NULL )
-        return 0;  /* no buffer, so can't compress */
-    if ( !tmemc )
-    {
-        cli_va = cli_get_page(cmfn, &cli_mfn, &cli_pfp, 0);
-        if ( cli_va == NULL )
-            return -EFAULT;
-    }
-    mb();
-    ret = lzo1x_1_compress(cli_va, PAGE_SIZE, dmem, out_len, wmem);
+    ret = lzo1x_1_compress(cli_va ?: scratch, PAGE_SIZE, dmem, out_len, wmem);
     ASSERT(ret == LZO_E_OK);
     *out_va = dmem;
-    if ( !tmemc )
+    if ( cli_va )
         cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 0);
-    unmap_domain_page(cli_va);
     return 1;
 }
 
 EXPORT int tmh_copy_to_client(tmem_cli_mfn_t cmfn, pfp_t *pfp,
-    pagesize_t tmem_offset, pagesize_t pfn_offset, pagesize_t len, void *cli_va)
+    pagesize_t tmem_offset, pagesize_t pfn_offset, pagesize_t len,
+    tmem_cli_va_t clibuf)
 {
     unsigned long tmem_mfn, cli_mfn = 0;
-    void *tmem_va;
+    char *tmem_va, *cli_va = NULL;
     pfp_t *cli_pfp = NULL;
-    bool_t tmemc = cli_va != NULL; /* if true, cli_va is control-op buffer */
+    int rc = 1;
 
     ASSERT(pfp != NULL);
-    if ( !tmemc )
+    if ( guest_handle_is_null(clibuf) )
     {
         cli_va = cli_get_page(cmfn, &cli_mfn, &cli_pfp, 1);
         if ( cli_va == NULL )
@@ -223,37 +239,48 @@ EXPORT int tmh_copy_to_client(tmem_cli_m
     }
     tmem_mfn = page_to_mfn(pfp);
     tmem_va = map_domain_page(tmem_mfn);
-    if (len == PAGE_SIZE && !tmem_offset && !pfn_offset)
+    if ( len == PAGE_SIZE && !tmem_offset && !pfn_offset && cli_va )
         tmh_copy_page(cli_va, tmem_va);
     else if ( (tmem_offset+len <= PAGE_SIZE) && (pfn_offset+len <= PAGE_SIZE) )
-        memcpy((char *)cli_va+pfn_offset,(char *)tmem_va+tmem_offset,len);
+    {
+        if ( cli_va )
+            memcpy(cli_va + pfn_offset, tmem_va + tmem_offset, len);
+        else if ( copy_to_guest_offset(clibuf, pfn_offset,
+                                       tmem_va + tmem_offset, len) )
+            rc = -EFAULT;
+    }
     unmap_domain_page(tmem_va);
-    if ( !tmemc )
+    if ( cli_va )
         cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 1);
     mb();
-    return 1;
+    return rc;
 }
 
 EXPORT int tmh_decompress_to_client(tmem_cli_mfn_t cmfn, void *tmem_va,
-                                    size_t size, void *cli_va)
+                                    size_t size, tmem_cli_va_t clibuf)
 {
     unsigned long cli_mfn = 0;
     pfp_t *cli_pfp = NULL;
+    void *cli_va = NULL;
+    char *scratch = this_cpu(scratch_page);
     size_t out_len = PAGE_SIZE;
-    bool_t tmemc = cli_va != NULL; /* if true, cli_va is control-op buffer */
     int ret;
 
-    if ( !tmemc )
+    if ( guest_handle_is_null(clibuf) )
     {
         cli_va = cli_get_page(cmfn, &cli_mfn, &cli_pfp, 1);
         if ( cli_va == NULL )
             return -EFAULT;
     }
-    ret = lzo1x_decompress_safe(tmem_va, size, cli_va, &out_len);
+    else if ( !scratch )
+        return 0;
+    ret = lzo1x_decompress_safe(tmem_va, size, cli_va ?: scratch, &out_len);
     ASSERT(ret == LZO_E_OK);
     ASSERT(out_len == PAGE_SIZE);
-    if ( !tmemc )
+    if ( cli_va )
         cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 1);
+    else if ( copy_to_guest(clibuf, scratch, PAGE_SIZE) )
+        return -EFAULT;
     mb();
     return 1;
 }
@@ -423,6 +450,11 @@ static int cpu_callback(
             struct page_info *p = alloc_domheap_pages(0, workmem_order, 0);
             per_cpu(workmem, cpu) = p ? page_to_virt(p) : NULL;
         }
+        if ( per_cpu(scratch_page, cpu) == NULL )
+        {
+            struct page_info *p = alloc_domheap_page(NULL, 0);
+            per_cpu(scratch_page, cpu) = p ? page_to_virt(p) : NULL;
+        }
         break;
     }
     case CPU_DEAD:
@@ -439,6 +471,11 @@ static int cpu_callback(
             free_domheap_pages(p, workmem_order);
             per_cpu(workmem, cpu) = NULL;
         }
+        if ( per_cpu(scratch_page, cpu) != NULL )
+        {
+            free_domheap_page(virt_to_page(per_cpu(scratch_page, cpu)));
+            per_cpu(scratch_page, cpu) = NULL;
+        }
         break;
     }
     default:
diff -r f53c5aadbba9 -r ccd60ed6c555 xen/include/xen/tmem_xen.h
--- a/xen/include/xen/tmem_xen.h	Tue Sep 11 14:17:27 2012 +0200
+++ b/xen/include/xen/tmem_xen.h	Tue Sep 11 14:17:49 2012 +0200
@@ -482,27 +482,33 @@ static inline int tmh_get_tmemop_from_cl
     return copy_from_guest(op, uops, 1);
 }
 
+#define tmh_cli_buf_null guest_handle_from_ptr(NULL, char)
+
 static inline void tmh_copy_to_client_buf_offset(tmem_cli_va_t clibuf, int off,
                                            char *tmembuf, int len)
 {
     copy_to_guest_offset(clibuf,off,tmembuf,len);
 }
 
+#define tmh_copy_to_client_buf(clibuf, tmembuf, cnt) \
+    copy_to_guest(guest_handle_cast(clibuf, void), tmembuf, cnt)
+
+#define tmh_client_buf_add guest_handle_add_offset
+
 #define TMH_CLI_ID_NULL ((cli_id_t)((domid_t)-1L))
 
 #define tmh_cli_id_str "domid"
 #define tmh_client_str "domain"
 
-extern int tmh_decompress_to_client(tmem_cli_mfn_t,void*,size_t,void*);
+int tmh_decompress_to_client(tmem_cli_mfn_t, void *, size_t, tmem_cli_va_t);
 
-extern int tmh_compress_from_client(tmem_cli_mfn_t,void**,size_t *,void*);
+int tmh_compress_from_client(tmem_cli_mfn_t, void **, size_t *, tmem_cli_va_t);
 
-extern int tmh_copy_from_client(pfp_t *pfp,
-    tmem_cli_mfn_t cmfn, pagesize_t tmem_offset,
-    pagesize_t pfn_offset, pagesize_t len, void *cva);
+int tmh_copy_from_client(pfp_t *, tmem_cli_mfn_t, pagesize_t tmem_offset,
+    pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_t);
 
-extern int tmh_copy_to_client(tmem_cli_mfn_t cmfn, pfp_t *pfp,
-    pagesize_t tmem_offset, pagesize_t pfn_offset, pagesize_t len, void *cva);
+int tmh_copy_to_client(tmem_cli_mfn_t, pfp_t *, pagesize_t tmem_offset,
+    pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_t);
 
 extern int tmh_copy_tze_to_client(tmem_cli_mfn_t cmfn, void *tmem_va, pagesize_t len);
 

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYS-0003M7-PZ; Fri, 14 Sep 2012 10:55:24 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYQ-0003Hg-OG
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:23 +0000
Received: from [85.158.143.99:29510] by server-3.bemta-4.messagelabs.com id
	43/16-08232-A1D03505; Fri, 14 Sep 2012 10:55:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1347620118!23928139!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14099 invoked from network); 14 Sep 2012 10:55:20 -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;
	14 Sep 2012 10: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 1TCTYM-00013P-KG
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYM-0000iK-G1
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:18 +0000
Message-Id: <E1TCTYM-0000iK-G1@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tmem: don't access guest memory
	without using the accessors intended for this
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347365869 -7200
# Node ID ccd60ed6c555e1816cac448fcb20a84533977b43
# Parent  f53c5aadbba9d389f4a7d83f308499e22d1d1eda
tmem: don't access guest memory without using the accessors intended for this

This is not permitted, not even for buffers coming from Dom0 (and it
would also break the moment Dom0 runs in HVM mode). An implication from
the changes here is that tmh_copy_page() can't be used anymore for
control operations calling tmh_copy_{from,to}_client() (as those pass
the buffer by virtual address rather than MFN).

Note that tmemc_save_get_next_page() previously didn't set the returned
handle's pool_id field, while the new code does. It need to be
confirmed that this is not a problem (otherwise the copy-out operation
will require further tmh_...() abstractions to be added).

Further note that the patch removes (rather than adjusts) an invalid
call to unmap_domain_page() (no matching map_domain_page()) from
tmh_compress_from_client() and adds a missing one to an error return
path in tmh_copy_from_client().

Finally note that the patch adds a previously missing return statement
to cli_get_page() (without which that function could de-reference a
NULL pointer, triggerable from guest mode).

This is part of XSA-15 / CVE-2012-3497.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
---


diff -r f53c5aadbba9 -r ccd60ed6c555 xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 11 14:17:27 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 11 14:17:49 2012 +0200
@@ -388,11 +388,13 @@ static NOINLINE int pcd_copy_to_client(t
     pcd = pgp->pcd;
     if ( pgp->size < PAGE_SIZE && pgp->size != 0 &&
          pcd->size < PAGE_SIZE && pcd->size != 0 )
-        ret = tmh_decompress_to_client(cmfn, pcd->cdata, pcd->size, NULL);
+        ret = tmh_decompress_to_client(cmfn, pcd->cdata, pcd->size,
+                                       tmh_cli_buf_null);
     else if ( tmh_tze_enabled() && pcd->size < PAGE_SIZE )
         ret = tmh_copy_tze_to_client(cmfn, pcd->tze, pcd->size);
     else
-        ret = tmh_copy_to_client(cmfn, pcd->pfp, 0, 0, PAGE_SIZE, NULL);
+        ret = tmh_copy_to_client(cmfn, pcd->pfp, 0, 0, PAGE_SIZE,
+                                 tmh_cli_buf_null);
     tmem_read_unlock(&pcd_tree_rwlocks[firstbyte]);
     return ret;
 }
@@ -1444,7 +1446,7 @@ static inline void tmem_ensure_avail_pag
 /************ TMEM CORE OPERATIONS ************************************/
 
 static NOINLINE int do_tmem_put_compress(pgp_t *pgp, tmem_cli_mfn_t cmfn,
-                                         void *cva)
+                                         tmem_cli_va_t clibuf)
 {
     void *dst, *p;
     size_t size;
@@ -1463,7 +1465,7 @@ static NOINLINE int do_tmem_put_compress
     if ( pgp->pfp != NULL )
         pgp_free_data(pgp, pgp->us.obj->pool);
     START_CYC_COUNTER(compress);
-    ret = tmh_compress_from_client(cmfn, &dst, &size, cva);
+    ret = tmh_compress_from_client(cmfn, &dst, &size, clibuf);
     if ( (ret == -EFAULT) || (ret == 0) )
         goto out;
     else if ( (size == 0) || (size >= tmem_subpage_maxsize()) ) {
@@ -1490,7 +1492,8 @@ out:
 }
 
 static NOINLINE int do_tmem_dup_put(pgp_t *pgp, tmem_cli_mfn_t cmfn,
-       pagesize_t tmem_offset, pagesize_t pfn_offset, pagesize_t len, void *cva)
+       pagesize_t tmem_offset, pagesize_t pfn_offset, pagesize_t len,
+       tmem_cli_va_t clibuf)
 {
     pool_t *pool;
     obj_t *obj;
@@ -1512,7 +1515,7 @@ static NOINLINE int do_tmem_dup_put(pgp_
     /* can we successfully manipulate pgp to change out the data? */
     if ( len != 0 && client->compress && pgp->size != 0 )
     {
-        ret = do_tmem_put_compress(pgp,cmfn,cva);
+        ret = do_tmem_put_compress(pgp, cmfn, clibuf);
         if ( ret == 1 )
             goto done;
         else if ( ret == 0 )
@@ -1530,7 +1533,8 @@ copy_uncompressed:
         goto failed_dup;
     pgp->size = 0;
     /* tmh_copy_from_client properly handles len==0 and offsets != 0 */
-    ret = tmh_copy_from_client(pgp->pfp,cmfn,tmem_offset,pfn_offset,len,0);
+    ret = tmh_copy_from_client(pgp->pfp, cmfn, tmem_offset, pfn_offset, len,
+                               tmh_cli_buf_null);
     if ( ret == -EFAULT )
         goto bad_copy;
     if ( tmh_dedup_enabled() && !is_persistent(pool) )
@@ -1582,7 +1586,7 @@ cleanup:
 static NOINLINE int do_tmem_put(pool_t *pool,
               OID *oidp, uint32_t index,
               tmem_cli_mfn_t cmfn, pagesize_t tmem_offset,
-              pagesize_t pfn_offset, pagesize_t len, void *cva)
+              pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_t clibuf)
 {
     obj_t *obj = NULL, *objfound = NULL, *objnew = NULL;
     pgp_t *pgp = NULL, *pgpdel = NULL;
@@ -1596,7 +1600,8 @@ static NOINLINE int do_tmem_put(pool_t *
     {
         ASSERT_SPINLOCK(&objfound->obj_spinlock);
         if ((pgp = pgp_lookup_in_obj(objfound, index)) != NULL)
-            return do_tmem_dup_put(pgp,cmfn,tmem_offset,pfn_offset,len,cva);
+            return do_tmem_dup_put(pgp, cmfn, tmem_offset, pfn_offset, len,
+                                   clibuf);
     }
 
     /* no puts allowed into a frozen pool (except dup puts) */
@@ -1631,7 +1636,7 @@ static NOINLINE int do_tmem_put(pool_t *
     if ( len != 0 && client->compress )
     {
         ASSERT(pgp->pfp == NULL);
-        ret = do_tmem_put_compress(pgp,cmfn,cva);
+        ret = do_tmem_put_compress(pgp, cmfn, clibuf);
         if ( ret == 1 )
             goto insert_page;
         if ( ret == -ENOMEM )
@@ -1655,7 +1660,8 @@ copy_uncompressed:
         goto delete_and_free;
     }
     /* tmh_copy_from_client properly handles len==0 (TMEM_NEW_PAGE) */
-    ret = tmh_copy_from_client(pgp->pfp,cmfn,tmem_offset,pfn_offset,len,cva);
+    ret = tmh_copy_from_client(pgp->pfp, cmfn, tmem_offset, pfn_offset, len,
+                               clibuf);
     if ( ret == -EFAULT )
         goto bad_copy;
     if ( tmh_dedup_enabled() && !is_persistent(pool) )
@@ -1725,12 +1731,13 @@ free:
 
 static NOINLINE int do_tmem_get(pool_t *pool, OID *oidp, uint32_t index,
               tmem_cli_mfn_t cmfn, pagesize_t tmem_offset,
-              pagesize_t pfn_offset, pagesize_t len, void *cva)
+              pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_t clibuf)
 {
     obj_t *obj;
     pgp_t *pgp;
     client_t *client = pool->client;
     DECL_LOCAL_CYC_COUNTER(decompress);
+    int rc = -EFAULT;
 
     if ( !_atomic_read(pool->pgp_count) )
         return -EEMPTY;
@@ -1755,16 +1762,18 @@ static NOINLINE int do_tmem_get(pool_t *
     if ( tmh_dedup_enabled() && !is_persistent(pool) &&
               pgp->firstbyte != NOT_SHAREABLE )
     {
-        if ( pcd_copy_to_client(cmfn, pgp) == -EFAULT )
+        rc = pcd_copy_to_client(cmfn, pgp);
+        if ( rc <= 0 )
             goto bad_copy;
     } else if ( pgp->size != 0 ) {
         START_CYC_COUNTER(decompress);
-        if ( tmh_decompress_to_client(cmfn, pgp->cdata,
-                                      pgp->size, cva) == -EFAULT )
+        rc = tmh_decompress_to_client(cmfn, pgp->cdata,
+                                      pgp->size, clibuf);
+        if ( rc <= 0 )
             goto bad_copy;
         END_CYC_COUNTER(decompress);
     } else if ( tmh_copy_to_client(cmfn, pgp->pfp, tmem_offset,
-                                 pfn_offset, len, cva) == -EFAULT)
+                                 pfn_offset, len, clibuf) == -EFAULT)
         goto bad_copy;
     if ( is_ephemeral(pool) )
     {
@@ -1804,8 +1813,7 @@ static NOINLINE int do_tmem_get(pool_t *
 bad_copy:
     /* this should only happen if the client passed a bad mfn */
     failed_copies++;
-    return -EFAULT;
-
+    return rc;
 }
 
 static NOINLINE int do_tmem_flush_page(pool_t *pool, OID *oidp, uint32_t index)
@@ -2345,7 +2353,6 @@ static NOINLINE int tmemc_save_subop(int
     pool_t *pool = (client == NULL || pool_id >= MAX_POOLS_PER_DOMAIN)
                    ? NULL : client->pools[pool_id];
     uint32_t p;
-    uint64_t *uuid;
     pgp_t *pgp, *pgp2;
     int rc = -1;
 
@@ -2409,9 +2416,7 @@ static NOINLINE int tmemc_save_subop(int
     case TMEMC_SAVE_GET_POOL_UUID:
          if ( pool == NULL )
              break;
-        uuid = (uint64_t *)buf.p;
-        *uuid++ = pool->uuid[0];
-        *uuid = pool->uuid[1];
+        tmh_copy_to_client_buf(buf, pool->uuid, 2);
         rc = 0;
     case TMEMC_SAVE_END:
         if ( client == NULL )
@@ -2436,7 +2441,7 @@ static NOINLINE int tmemc_save_get_next_
     pgp_t *pgp;
     OID oid;
     int ret = 0;
-    struct tmem_handle *h;
+    struct tmem_handle h;
     unsigned int pagesize = 1 << (pool->pageshift+12);
 
     if ( pool == NULL || is_ephemeral(pool) )
@@ -2467,11 +2472,13 @@ static NOINLINE int tmemc_save_get_next_
                          pgp_t,us.pool_pers_pages);
     pool->cur_pgp = pgp;
     oid = pgp->us.obj->oid;
-    h = (struct tmem_handle *)buf.p;
-    *(OID *)&h->oid[0] = oid;
-    h->index = pgp->index;
-    buf.p = (void *)(h+1);
-    ret = do_tmem_get(pool, &oid, h->index,0,0,0,pagesize,buf.p);
+    h.pool_id = pool_id;
+    BUILD_BUG_ON(sizeof(h.oid) != sizeof(oid));
+    memcpy(h.oid, oid.oid, sizeof(h.oid));
+    h.index = pgp->index;
+    tmh_copy_to_client_buf(buf, &h, 1);
+    tmh_client_buf_add(buf, sizeof(h));
+    ret = do_tmem_get(pool, &oid, pgp->index, 0, 0, 0, pagesize, buf);
 
 out:
     tmem_spin_unlock(&pers_lists_spinlock);
@@ -2483,7 +2490,7 @@ static NOINLINE int tmemc_save_get_next_
 {
     client_t *client = tmh_client_from_cli_id(cli_id);
     pgp_t *pgp;
-    struct tmem_handle *h;
+    struct tmem_handle h;
     int ret = 0;
 
     if ( client == NULL )
@@ -2509,10 +2516,11 @@ static NOINLINE int tmemc_save_get_next_
                          pgp_t,client_inv_pages);
         client->cur_pgp = pgp;
     }
-    h = (struct tmem_handle *)buf.p;
-    h->pool_id = pgp->pool_id;
-    *(OID *)&h->oid = pgp->inv_oid;
-    h->index = pgp->index;
+    h.pool_id = pgp->pool_id;
+    BUILD_BUG_ON(sizeof(h.oid) != sizeof(pgp->inv_oid));
+    memcpy(h.oid, pgp->inv_oid.oid, sizeof(h.oid));
+    h.index = pgp->index;
+    tmh_copy_to_client_buf(buf, &h, 1);
     ret = 1;
 out:
     tmem_spin_unlock(&pers_lists_spinlock);
@@ -2528,7 +2536,7 @@ static int tmemc_restore_put_page(int cl
 
     if ( pool == NULL )
         return -1;
-    return do_tmem_put(pool,oidp,index,0,0,0,bufsize,buf.p);
+    return do_tmem_put(pool, oidp, index, 0, 0, 0, bufsize, buf);
 }
 
 static int tmemc_restore_flush_page(int cli_id, uint32_t pool_id, OID *oidp,
@@ -2732,19 +2740,19 @@ EXPORT long do_tmem_op(tmem_cli_op_t uop
         break;
     case TMEM_NEW_PAGE:
         tmem_ensure_avail_pages();
-        rc = do_tmem_put(pool, oidp,
-                         op.u.gen.index, op.u.gen.cmfn, 0, 0, 0, NULL);
+        rc = do_tmem_put(pool, oidp, op.u.gen.index, op.u.gen.cmfn, 0, 0, 0,
+                         tmh_cli_buf_null);
         break;
     case TMEM_PUT_PAGE:
         tmem_ensure_avail_pages();
-        rc = do_tmem_put(pool, oidp,
-                    op.u.gen.index, op.u.gen.cmfn, 0, 0, PAGE_SIZE, NULL);
+        rc = do_tmem_put(pool, oidp, op.u.gen.index, op.u.gen.cmfn, 0, 0,
+                         PAGE_SIZE, tmh_cli_buf_null);
         if (rc == 1) succ_put = 1;
         else non_succ_put = 1;
         break;
     case TMEM_GET_PAGE:
         rc = do_tmem_get(pool, oidp, op.u.gen.index, op.u.gen.cmfn,
-                         0, 0, PAGE_SIZE, 0);
+                         0, 0, PAGE_SIZE, tmh_cli_buf_null);
         if (rc == 1) succ_get = 1;
         else non_succ_get = 1;
         break;
@@ -2763,13 +2771,13 @@ EXPORT long do_tmem_op(tmem_cli_op_t uop
     case TMEM_READ:
         rc = do_tmem_get(pool, oidp, op.u.gen.index, op.u.gen.cmfn,
                          op.u.gen.tmem_offset, op.u.gen.pfn_offset,
-                         op.u.gen.len,0);
+                         op.u.gen.len, tmh_cli_buf_null);
         break;
     case TMEM_WRITE:
         rc = do_tmem_put(pool, oidp,
                          op.u.gen.index, op.u.gen.cmfn,
                          op.u.gen.tmem_offset, op.u.gen.pfn_offset,
-                         op.u.gen.len, NULL);
+                         op.u.gen.len, tmh_cli_buf_null);
         break;
     case TMEM_XCHG:
         /* need to hold global lock to ensure xchg is atomic */
diff -r f53c5aadbba9 -r ccd60ed6c555 xen/common/tmem_xen.c
--- a/xen/common/tmem_xen.c	Tue Sep 11 14:17:27 2012 +0200
+++ b/xen/common/tmem_xen.c	Tue Sep 11 14:17:49 2012 +0200
@@ -51,6 +51,7 @@ DECL_CYC_COUNTER(pg_copy);
 #define LZO_DSTMEM_PAGES 2
 static DEFINE_PER_CPU_READ_MOSTLY(unsigned char *, workmem);
 static DEFINE_PER_CPU_READ_MOSTLY(unsigned char *, dstmem);
+static DEFINE_PER_CPU_READ_MOSTLY(void *, scratch_page);
 
 #ifdef COMPARE_COPY_PAGE_SSE2
 #include <asm/flushtlb.h>  /* REMOVE ME AFTER TEST */
@@ -115,6 +116,7 @@ static inline void *cli_get_page(tmem_cl
     {
         if ( page )
             put_page(page);
+        return NULL;
     }
 
     if ( cli_write && !get_page_type(page, PGT_writable_page) )
@@ -144,12 +146,12 @@ static inline void cli_put_page(tmem_cli
 
 EXPORT int tmh_copy_from_client(pfp_t *pfp,
     tmem_cli_mfn_t cmfn, pagesize_t tmem_offset,
-    pagesize_t pfn_offset, pagesize_t len, void *cli_va)
+    pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_t clibuf)
 {
     unsigned long tmem_mfn, cli_mfn = 0;
-    void *tmem_va;
+    char *tmem_va, *cli_va = NULL;
     pfp_t *cli_pfp = NULL;
-    bool_t tmemc = cli_va != NULL; /* if true, cli_va is control-op buffer */
+    int rc = 1;
 
     ASSERT(pfp != NULL);
     tmem_mfn = page_to_mfn(pfp);
@@ -160,62 +162,76 @@ EXPORT int tmh_copy_from_client(pfp_t *p
         unmap_domain_page(tmem_va);
         return 1;
     }
-    if ( !tmemc )
+    if ( guest_handle_is_null(clibuf) )
+    {
+        cli_va = cli_get_page(cmfn, &cli_mfn, &cli_pfp, 0);
+        if ( cli_va == NULL )
+        {
+            unmap_domain_page(tmem_va);
+            return -EFAULT;
+        }
+    }
+    mb();
+    if ( len == PAGE_SIZE && !tmem_offset && !pfn_offset && cli_va )
+        tmh_copy_page(tmem_va, cli_va);
+    else if ( (tmem_offset+len <= PAGE_SIZE) &&
+              (pfn_offset+len <= PAGE_SIZE) )
+    {
+        if ( cli_va )
+            memcpy(tmem_va + tmem_offset, cli_va + pfn_offset, len);
+        else if ( copy_from_guest_offset(tmem_va + tmem_offset, clibuf,
+                                         pfn_offset, len) )
+            rc = -EFAULT;
+    }
+    if ( cli_va )
+        cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 0);
+    unmap_domain_page(tmem_va);
+    return rc;
+}
+
+EXPORT int tmh_compress_from_client(tmem_cli_mfn_t cmfn,
+    void **out_va, size_t *out_len, tmem_cli_va_t clibuf)
+{
+    int ret = 0;
+    unsigned char *dmem = this_cpu(dstmem);
+    unsigned char *wmem = this_cpu(workmem);
+    char *scratch = this_cpu(scratch_page);
+    pfp_t *cli_pfp = NULL;
+    unsigned long cli_mfn = 0;
+    void *cli_va = NULL;
+
+    if ( dmem == NULL || wmem == NULL )
+        return 0;  /* no buffer, so can't compress */
+    if ( guest_handle_is_null(clibuf) )
     {
         cli_va = cli_get_page(cmfn, &cli_mfn, &cli_pfp, 0);
         if ( cli_va == NULL )
             return -EFAULT;
     }
+    else if ( !scratch )
+        return 0;
+    else if ( copy_from_guest(scratch, clibuf, PAGE_SIZE) )
+        return -EFAULT;
     mb();
-    if (len == PAGE_SIZE && !tmem_offset && !pfn_offset)
-        tmh_copy_page(tmem_va, cli_va);
-    else if ( (tmem_offset+len <= PAGE_SIZE) &&
-              (pfn_offset+len <= PAGE_SIZE) )
-        memcpy((char *)tmem_va+tmem_offset,(char *)cli_va+pfn_offset,len);
-    if ( !tmemc )
-        cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 0);
-    unmap_domain_page(tmem_va);
-    return 1;
-}
-
-EXPORT int tmh_compress_from_client(tmem_cli_mfn_t cmfn,
-    void **out_va, size_t *out_len, void *cli_va)
-{
-    int ret = 0;
-    unsigned char *dmem = this_cpu(dstmem);
-    unsigned char *wmem = this_cpu(workmem);
-    pfp_t *cli_pfp = NULL;
-    unsigned long cli_mfn = 0;
-    bool_t tmemc = cli_va != NULL; /* if true, cli_va is control-op buffer */
-
-    if ( dmem == NULL || wmem == NULL )
-        return 0;  /* no buffer, so can't compress */
-    if ( !tmemc )
-    {
-        cli_va = cli_get_page(cmfn, &cli_mfn, &cli_pfp, 0);
-        if ( cli_va == NULL )
-            return -EFAULT;
-    }
-    mb();
-    ret = lzo1x_1_compress(cli_va, PAGE_SIZE, dmem, out_len, wmem);
+    ret = lzo1x_1_compress(cli_va ?: scratch, PAGE_SIZE, dmem, out_len, wmem);
     ASSERT(ret == LZO_E_OK);
     *out_va = dmem;
-    if ( !tmemc )
+    if ( cli_va )
         cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 0);
-    unmap_domain_page(cli_va);
     return 1;
 }
 
 EXPORT int tmh_copy_to_client(tmem_cli_mfn_t cmfn, pfp_t *pfp,
-    pagesize_t tmem_offset, pagesize_t pfn_offset, pagesize_t len, void *cli_va)
+    pagesize_t tmem_offset, pagesize_t pfn_offset, pagesize_t len,
+    tmem_cli_va_t clibuf)
 {
     unsigned long tmem_mfn, cli_mfn = 0;
-    void *tmem_va;
+    char *tmem_va, *cli_va = NULL;
     pfp_t *cli_pfp = NULL;
-    bool_t tmemc = cli_va != NULL; /* if true, cli_va is control-op buffer */
+    int rc = 1;
 
     ASSERT(pfp != NULL);
-    if ( !tmemc )
+    if ( guest_handle_is_null(clibuf) )
     {
         cli_va = cli_get_page(cmfn, &cli_mfn, &cli_pfp, 1);
         if ( cli_va == NULL )
@@ -223,37 +239,48 @@ EXPORT int tmh_copy_to_client(tmem_cli_m
     }
     tmem_mfn = page_to_mfn(pfp);
     tmem_va = map_domain_page(tmem_mfn);
-    if (len == PAGE_SIZE && !tmem_offset && !pfn_offset)
+    if ( len == PAGE_SIZE && !tmem_offset && !pfn_offset && cli_va )
         tmh_copy_page(cli_va, tmem_va);
     else if ( (tmem_offset+len <= PAGE_SIZE) && (pfn_offset+len <= PAGE_SIZE) )
-        memcpy((char *)cli_va+pfn_offset,(char *)tmem_va+tmem_offset,len);
+    {
+        if ( cli_va )
+            memcpy(cli_va + pfn_offset, tmem_va + tmem_offset, len);
+        else if ( copy_to_guest_offset(clibuf, pfn_offset,
+                                       tmem_va + tmem_offset, len) )
+            rc = -EFAULT;
+    }
     unmap_domain_page(tmem_va);
-    if ( !tmemc )
+    if ( cli_va )
         cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 1);
     mb();
-    return 1;
+    return rc;
 }
 
 EXPORT int tmh_decompress_to_client(tmem_cli_mfn_t cmfn, void *tmem_va,
-                                    size_t size, void *cli_va)
+                                    size_t size, tmem_cli_va_t clibuf)
 {
     unsigned long cli_mfn = 0;
     pfp_t *cli_pfp = NULL;
+    void *cli_va = NULL;
+    char *scratch = this_cpu(scratch_page);
     size_t out_len = PAGE_SIZE;
-    bool_t tmemc = cli_va != NULL; /* if true, cli_va is control-op buffer */
     int ret;
 
-    if ( !tmemc )
+    if ( guest_handle_is_null(clibuf) )
     {
         cli_va = cli_get_page(cmfn, &cli_mfn, &cli_pfp, 1);
         if ( cli_va == NULL )
             return -EFAULT;
     }
-    ret = lzo1x_decompress_safe(tmem_va, size, cli_va, &out_len);
+    else if ( !scratch )
+        return 0;
+    ret = lzo1x_decompress_safe(tmem_va, size, cli_va ?: scratch, &out_len);
     ASSERT(ret == LZO_E_OK);
     ASSERT(out_len == PAGE_SIZE);
-    if ( !tmemc )
+    if ( cli_va )
         cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 1);
+    else if ( copy_to_guest(clibuf, scratch, PAGE_SIZE) )
+        return -EFAULT;
     mb();
     return 1;
 }
@@ -423,6 +450,11 @@ static int cpu_callback(
             struct page_info *p = alloc_domheap_pages(0, workmem_order, 0);
             per_cpu(workmem, cpu) = p ? page_to_virt(p) : NULL;
         }
+        if ( per_cpu(scratch_page, cpu) == NULL )
+        {
+            struct page_info *p = alloc_domheap_page(NULL, 0);
+            per_cpu(scratch_page, cpu) = p ? page_to_virt(p) : NULL;
+        }
         break;
     }
     case CPU_DEAD:
@@ -439,6 +471,11 @@ static int cpu_callback(
             free_domheap_pages(p, workmem_order);
             per_cpu(workmem, cpu) = NULL;
         }
+        if ( per_cpu(scratch_page, cpu) != NULL )
+        {
+            free_domheap_page(virt_to_page(per_cpu(scratch_page, cpu)));
+            per_cpu(scratch_page, cpu) = NULL;
+        }
         break;
     }
     default:
diff -r f53c5aadbba9 -r ccd60ed6c555 xen/include/xen/tmem_xen.h
--- a/xen/include/xen/tmem_xen.h	Tue Sep 11 14:17:27 2012 +0200
+++ b/xen/include/xen/tmem_xen.h	Tue Sep 11 14:17:49 2012 +0200
@@ -482,27 +482,33 @@ static inline int tmh_get_tmemop_from_cl
     return copy_from_guest(op, uops, 1);
 }
 
+#define tmh_cli_buf_null guest_handle_from_ptr(NULL, char)
+
 static inline void tmh_copy_to_client_buf_offset(tmem_cli_va_t clibuf, int off,
                                            char *tmembuf, int len)
 {
     copy_to_guest_offset(clibuf,off,tmembuf,len);
 }
 
+#define tmh_copy_to_client_buf(clibuf, tmembuf, cnt) \
+    copy_to_guest(guest_handle_cast(clibuf, void), tmembuf, cnt)
+
+#define tmh_client_buf_add guest_handle_add_offset
+
 #define TMH_CLI_ID_NULL ((cli_id_t)((domid_t)-1L))
 
 #define tmh_cli_id_str "domid"
 #define tmh_client_str "domain"
 
-extern int tmh_decompress_to_client(tmem_cli_mfn_t,void*,size_t,void*);
+int tmh_decompress_to_client(tmem_cli_mfn_t, void *, size_t, tmem_cli_va_t);
 
-extern int tmh_compress_from_client(tmem_cli_mfn_t,void**,size_t *,void*);
+int tmh_compress_from_client(tmem_cli_mfn_t, void **, size_t *, tmem_cli_va_t);
 
-extern int tmh_copy_from_client(pfp_t *pfp,
-    tmem_cli_mfn_t cmfn, pagesize_t tmem_offset,
-    pagesize_t pfn_offset, pagesize_t len, void *cva);
+int tmh_copy_from_client(pfp_t *, tmem_cli_mfn_t, pagesize_t tmem_offset,
+    pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_t);
 
-extern int tmh_copy_to_client(tmem_cli_mfn_t cmfn, pfp_t *pfp,
-    pagesize_t tmem_offset, pagesize_t pfn_offset, pagesize_t len, void *cva);
+int tmh_copy_to_client(tmem_cli_mfn_t, pfp_t *, pagesize_t tmem_offset,
+    pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_t);
 
 extern int tmh_copy_tze_to_client(tmem_cli_mfn_t cmfn, void *tmem_va, pagesize_t len);
 

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYU-0003N0-3n; Fri, 14 Sep 2012 10:55:26 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYS-0003Ht-7J
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:24 +0000
Received: from [85.158.143.35:62529] by server-2.bemta-4.messagelabs.com id
	E2/1E-21239-B1D03505; Fri, 14 Sep 2012 10:55:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-21.messagelabs.com!1347620121!18244816!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21701 invoked from network); 14 Sep 2012 10:55:22 -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;
	14 Sep 2012 10: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 1TCTYP-00013e-5x
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYP-0000jX-4i
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:21 +0000
Message-Id: <E1TCTYP-0000jX-4i@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tmem: fixup 2010 cleanup patch that
	breaks tmem save/restore
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dan Magenheimer <dan.magenheimer@oracle.com>
# Date 1347365943 -7200
# Node ID 16e0392c6594b1757bbaa82076630a73d843229b
# Parent  0520982a602a3ac06dd5bc573ddaff5edc9c6987
tmem: fixup 2010 cleanup patch that breaks tmem save/restore

20918:a3fa6d444b25 "Fix domain reference leaks" (in Feb 2010, by Jan)
does some cleanup in addition to the leak fixes.  Unfortunately, that
cleanup inadvertently resulted in an incorrect fallthrough in a switch
statement which breaks tmem save/restore.

That broken patch was apparently applied to 4.0-testing and 4.1-testing
so those are broken as well.

What is the process now for requesting back-patches to 4.0 and 4.1?

(Side note: This does not by itself entirely fix save/restore in 4.2.)

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 0520982a602a -r 16e0392c6594 xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 11 14:18:36 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 11 14:19:03 2012 +0200
@@ -2419,6 +2419,7 @@ static NOINLINE int tmemc_save_subop(int
              break;
         tmh_copy_to_client_buf(buf, pool->uuid, 2);
         rc = 0;
+        break;
     case TMEMC_SAVE_END:
         if ( client == NULL )
             break;
@@ -2429,6 +2430,7 @@ static NOINLINE int tmemc_save_subop(int
                 pgp_free_from_inv_list(client,pgp);
         client->frozen = client->was_frozen;
         rc = 0;
+        break;
     }
     return rc;
 }

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYU-0003N0-3n; Fri, 14 Sep 2012 10:55:26 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYS-0003Ht-7J
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:24 +0000
Received: from [85.158.143.35:62529] by server-2.bemta-4.messagelabs.com id
	E2/1E-21239-B1D03505; Fri, 14 Sep 2012 10:55:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-21.messagelabs.com!1347620121!18244816!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21701 invoked from network); 14 Sep 2012 10:55:22 -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;
	14 Sep 2012 10: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 1TCTYP-00013e-5x
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYP-0000jX-4i
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:21 +0000
Message-Id: <E1TCTYP-0000jX-4i@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tmem: fixup 2010 cleanup patch that
	breaks tmem save/restore
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dan Magenheimer <dan.magenheimer@oracle.com>
# Date 1347365943 -7200
# Node ID 16e0392c6594b1757bbaa82076630a73d843229b
# Parent  0520982a602a3ac06dd5bc573ddaff5edc9c6987
tmem: fixup 2010 cleanup patch that breaks tmem save/restore

20918:a3fa6d444b25 "Fix domain reference leaks" (in Feb 2010, by Jan)
does some cleanup in addition to the leak fixes.  Unfortunately, that
cleanup inadvertently resulted in an incorrect fallthrough in a switch
statement which breaks tmem save/restore.

That broken patch was apparently applied to 4.0-testing and 4.1-testing
so those are broken as well.

What is the process now for requesting back-patches to 4.0 and 4.1?

(Side note: This does not by itself entirely fix save/restore in 4.2.)

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 0520982a602a -r 16e0392c6594 xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 11 14:18:36 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 11 14:19:03 2012 +0200
@@ -2419,6 +2419,7 @@ static NOINLINE int tmemc_save_subop(int
              break;
         tmh_copy_to_client_buf(buf, pool->uuid, 2);
         rc = 0;
+        break;
     case TMEMC_SAVE_END:
         if ( client == NULL )
             break;
@@ -2429,6 +2430,7 @@ static NOINLINE int tmemc_save_subop(int
                 pgp_free_from_inv_list(client,pgp);
         client->frozen = client->was_frozen;
         rc = 0;
+        break;
     }
     return rc;
 }

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYT-0003Mq-Ve; Fri, 14 Sep 2012 10:55:26 +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 1TCTYR-0003KR-Os
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:23 +0000
Received: from [85.158.138.51:29972] by server-12.bemta-3.messagelabs.com id
	FC/13-10384-B1D03505; Fri, 14 Sep 2012 10:55:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-174.messagelabs.com!1347620119!30040643!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22208 invoked from network); 14 Sep 2012 10:55:20 -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;
	14 Sep 2012 10: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 1TCTYN-00013S-2M
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYN-0000iZ-17
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:19 +0000
Message-Id: <E1TCTYN-0000iZ-17@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tmem: detect arithmetic overflow in
	tmh_copy_{from, to}_client()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347365879 -7200
# Node ID 33b8c42a87ec2fa6e6533dd9ee7603f732b168f5
# Parent  ccd60ed6c555e1816cac448fcb20a84533977b43
tmem: detect arithmetic overflow in tmh_copy_{from,to}_client()

This implies adjusting callers to deal with errors other than -EFAULT
and removing some comments which would otherwise become stale.

Reported-by: Tim Deegan <tim@xen.org>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
---


diff -r ccd60ed6c555 -r 33b8c42a87ec xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 11 14:17:49 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 11 14:17:59 2012 +0200
@@ -1535,7 +1535,7 @@ copy_uncompressed:
     /* tmh_copy_from_client properly handles len==0 and offsets != 0 */
     ret = tmh_copy_from_client(pgp->pfp, cmfn, tmem_offset, pfn_offset, len,
                                tmh_cli_buf_null);
-    if ( ret == -EFAULT )
+    if ( ret < 0 )
         goto bad_copy;
     if ( tmh_dedup_enabled() && !is_persistent(pool) )
     {
@@ -1556,9 +1556,7 @@ done:
     return 1;
 
 bad_copy:
-    /* this should only happen if the client passed a bad mfn */
     failed_copies++;
-    ret = -EFAULT;
     goto cleanup;
 
 failed_dup:
@@ -1662,7 +1660,7 @@ copy_uncompressed:
     /* tmh_copy_from_client properly handles len==0 (TMEM_NEW_PAGE) */
     ret = tmh_copy_from_client(pgp->pfp, cmfn, tmem_offset, pfn_offset, len,
                                clibuf);
-    if ( ret == -EFAULT )
+    if ( ret < 0 )
         goto bad_copy;
     if ( tmh_dedup_enabled() && !is_persistent(pool) )
     {
@@ -1702,8 +1700,6 @@ insert_page:
     return 1;
 
 bad_copy:
-    /* this should only happen if the client passed a bad mfn */
-    ret = -EFAULT;
     failed_copies++;
 
 delete_and_free:
@@ -1737,7 +1733,7 @@ static NOINLINE int do_tmem_get(pool_t *
     pgp_t *pgp;
     client_t *client = pool->client;
     DECL_LOCAL_CYC_COUNTER(decompress);
-    int rc = -EFAULT;
+    int rc;
 
     if ( !_atomic_read(pool->pgp_count) )
         return -EEMPTY;
@@ -1761,20 +1757,20 @@ static NOINLINE int do_tmem_get(pool_t *
     ASSERT(pgp->size != -1);
     if ( tmh_dedup_enabled() && !is_persistent(pool) &&
               pgp->firstbyte != NOT_SHAREABLE )
+        rc = pcd_copy_to_client(cmfn, pgp);
+    else if ( pgp->size != 0 )
     {
-        rc = pcd_copy_to_client(cmfn, pgp);
-        if ( rc <= 0 )
-            goto bad_copy;
-    } else if ( pgp->size != 0 ) {
         START_CYC_COUNTER(decompress);
         rc = tmh_decompress_to_client(cmfn, pgp->cdata,
                                       pgp->size, clibuf);
-        if ( rc <= 0 )
-            goto bad_copy;
         END_CYC_COUNTER(decompress);
-    } else if ( tmh_copy_to_client(cmfn, pgp->pfp, tmem_offset,
-                                 pfn_offset, len, clibuf) == -EFAULT)
+    }
+    else
+        rc = tmh_copy_to_client(cmfn, pgp->pfp, tmem_offset,
+                                pfn_offset, len, clibuf);
+    if ( rc <= 0 )
         goto bad_copy;
+
     if ( is_ephemeral(pool) )
     {
         if ( is_private(pool) )
@@ -1811,7 +1807,6 @@ static NOINLINE int do_tmem_get(pool_t *
     return 1;
 
 bad_copy:
-    /* this should only happen if the client passed a bad mfn */
     failed_copies++;
     return rc;
 }
diff -r ccd60ed6c555 -r 33b8c42a87ec xen/common/tmem_xen.c
--- a/xen/common/tmem_xen.c	Tue Sep 11 14:17:49 2012 +0200
+++ b/xen/common/tmem_xen.c	Tue Sep 11 14:17:59 2012 +0200
@@ -153,6 +153,8 @@ EXPORT int tmh_copy_from_client(pfp_t *p
     pfp_t *cli_pfp = NULL;
     int rc = 1;
 
+    if ( tmem_offset > PAGE_SIZE || pfn_offset > PAGE_SIZE || len > PAGE_SIZE )
+        return -EINVAL;
     ASSERT(pfp != NULL);
     tmem_mfn = page_to_mfn(pfp);
     tmem_va = map_domain_page(tmem_mfn);
@@ -183,6 +185,8 @@ EXPORT int tmh_copy_from_client(pfp_t *p
                                          pfn_offset, len) )
             rc = -EFAULT;
     }
+    else if ( len )
+        rc = -EINVAL;
     if ( cli_va )
         cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 0);
     unmap_domain_page(tmem_va);
@@ -230,6 +234,8 @@ EXPORT int tmh_copy_to_client(tmem_cli_m
     pfp_t *cli_pfp = NULL;
     int rc = 1;
 
+    if ( tmem_offset > PAGE_SIZE || pfn_offset > PAGE_SIZE || len > PAGE_SIZE )
+        return -EINVAL;
     ASSERT(pfp != NULL);
     if ( guest_handle_is_null(clibuf) )
     {
@@ -249,6 +255,8 @@ EXPORT int tmh_copy_to_client(tmem_cli_m
                                        tmem_va + tmem_offset, len) )
             rc = -EFAULT;
     }
+    else if ( len )
+        rc = -EINVAL;
     unmap_domain_page(tmem_va);
     if ( cli_va )
         cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 1);

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYT-0003Mq-Ve; Fri, 14 Sep 2012 10:55:26 +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 1TCTYR-0003KR-Os
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:23 +0000
Received: from [85.158.138.51:29972] by server-12.bemta-3.messagelabs.com id
	FC/13-10384-B1D03505; Fri, 14 Sep 2012 10:55:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-174.messagelabs.com!1347620119!30040643!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22208 invoked from network); 14 Sep 2012 10:55:20 -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;
	14 Sep 2012 10: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 1TCTYN-00013S-2M
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYN-0000iZ-17
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:19 +0000
Message-Id: <E1TCTYN-0000iZ-17@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tmem: detect arithmetic overflow in
	tmh_copy_{from, to}_client()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347365879 -7200
# Node ID 33b8c42a87ec2fa6e6533dd9ee7603f732b168f5
# Parent  ccd60ed6c555e1816cac448fcb20a84533977b43
tmem: detect arithmetic overflow in tmh_copy_{from,to}_client()

This implies adjusting callers to deal with errors other than -EFAULT
and removing some comments which would otherwise become stale.

Reported-by: Tim Deegan <tim@xen.org>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
---


diff -r ccd60ed6c555 -r 33b8c42a87ec xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 11 14:17:49 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 11 14:17:59 2012 +0200
@@ -1535,7 +1535,7 @@ copy_uncompressed:
     /* tmh_copy_from_client properly handles len==0 and offsets != 0 */
     ret = tmh_copy_from_client(pgp->pfp, cmfn, tmem_offset, pfn_offset, len,
                                tmh_cli_buf_null);
-    if ( ret == -EFAULT )
+    if ( ret < 0 )
         goto bad_copy;
     if ( tmh_dedup_enabled() && !is_persistent(pool) )
     {
@@ -1556,9 +1556,7 @@ done:
     return 1;
 
 bad_copy:
-    /* this should only happen if the client passed a bad mfn */
     failed_copies++;
-    ret = -EFAULT;
     goto cleanup;
 
 failed_dup:
@@ -1662,7 +1660,7 @@ copy_uncompressed:
     /* tmh_copy_from_client properly handles len==0 (TMEM_NEW_PAGE) */
     ret = tmh_copy_from_client(pgp->pfp, cmfn, tmem_offset, pfn_offset, len,
                                clibuf);
-    if ( ret == -EFAULT )
+    if ( ret < 0 )
         goto bad_copy;
     if ( tmh_dedup_enabled() && !is_persistent(pool) )
     {
@@ -1702,8 +1700,6 @@ insert_page:
     return 1;
 
 bad_copy:
-    /* this should only happen if the client passed a bad mfn */
-    ret = -EFAULT;
     failed_copies++;
 
 delete_and_free:
@@ -1737,7 +1733,7 @@ static NOINLINE int do_tmem_get(pool_t *
     pgp_t *pgp;
     client_t *client = pool->client;
     DECL_LOCAL_CYC_COUNTER(decompress);
-    int rc = -EFAULT;
+    int rc;
 
     if ( !_atomic_read(pool->pgp_count) )
         return -EEMPTY;
@@ -1761,20 +1757,20 @@ static NOINLINE int do_tmem_get(pool_t *
     ASSERT(pgp->size != -1);
     if ( tmh_dedup_enabled() && !is_persistent(pool) &&
               pgp->firstbyte != NOT_SHAREABLE )
+        rc = pcd_copy_to_client(cmfn, pgp);
+    else if ( pgp->size != 0 )
     {
-        rc = pcd_copy_to_client(cmfn, pgp);
-        if ( rc <= 0 )
-            goto bad_copy;
-    } else if ( pgp->size != 0 ) {
         START_CYC_COUNTER(decompress);
         rc = tmh_decompress_to_client(cmfn, pgp->cdata,
                                       pgp->size, clibuf);
-        if ( rc <= 0 )
-            goto bad_copy;
         END_CYC_COUNTER(decompress);
-    } else if ( tmh_copy_to_client(cmfn, pgp->pfp, tmem_offset,
-                                 pfn_offset, len, clibuf) == -EFAULT)
+    }
+    else
+        rc = tmh_copy_to_client(cmfn, pgp->pfp, tmem_offset,
+                                pfn_offset, len, clibuf);
+    if ( rc <= 0 )
         goto bad_copy;
+
     if ( is_ephemeral(pool) )
     {
         if ( is_private(pool) )
@@ -1811,7 +1807,6 @@ static NOINLINE int do_tmem_get(pool_t *
     return 1;
 
 bad_copy:
-    /* this should only happen if the client passed a bad mfn */
     failed_copies++;
     return rc;
 }
diff -r ccd60ed6c555 -r 33b8c42a87ec xen/common/tmem_xen.c
--- a/xen/common/tmem_xen.c	Tue Sep 11 14:17:49 2012 +0200
+++ b/xen/common/tmem_xen.c	Tue Sep 11 14:17:59 2012 +0200
@@ -153,6 +153,8 @@ EXPORT int tmh_copy_from_client(pfp_t *p
     pfp_t *cli_pfp = NULL;
     int rc = 1;
 
+    if ( tmem_offset > PAGE_SIZE || pfn_offset > PAGE_SIZE || len > PAGE_SIZE )
+        return -EINVAL;
     ASSERT(pfp != NULL);
     tmem_mfn = page_to_mfn(pfp);
     tmem_va = map_domain_page(tmem_mfn);
@@ -183,6 +185,8 @@ EXPORT int tmh_copy_from_client(pfp_t *p
                                          pfn_offset, len) )
             rc = -EFAULT;
     }
+    else if ( len )
+        rc = -EINVAL;
     if ( cli_va )
         cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 0);
     unmap_domain_page(tmem_va);
@@ -230,6 +234,8 @@ EXPORT int tmh_copy_to_client(tmem_cli_m
     pfp_t *cli_pfp = NULL;
     int rc = 1;
 
+    if ( tmem_offset > PAGE_SIZE || pfn_offset > PAGE_SIZE || len > PAGE_SIZE )
+        return -EINVAL;
     ASSERT(pfp != NULL);
     if ( guest_handle_is_null(clibuf) )
     {
@@ -249,6 +255,8 @@ EXPORT int tmh_copy_to_client(tmem_cli_m
                                        tmem_va + tmem_offset, len) )
             rc = -EFAULT;
     }
+    else if ( len )
+        rc = -EINVAL;
     unmap_domain_page(tmem_va);
     if ( cli_va )
         cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 1);

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYU-0003NB-6g; Fri, 14 Sep 2012 10:55:26 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYS-0003Ht-J2
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:24 +0000
Received: from [85.158.143.35:62549] by server-2.bemta-4.messagelabs.com id
	24/1E-21239-C1D03505; Fri, 14 Sep 2012 10:55:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-21.messagelabs.com!1347620120!15772720!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30879 invoked from network); 14 Sep 2012 10:55:22 -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;
	14 Sep 2012 10: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 1TCTYO-00013b-ON
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYO-0000jI-Jx
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:20 +0000
Message-Id: <E1TCTYO-0000jI-Jx@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tmem: reduce severity of log messages
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347365916 -7200
# Node ID 0520982a602a3ac06dd5bc573ddaff5edc9c6987
# Parent  109ea6a0c23aa0c5df79e3f5658162aed959ffcf
tmem: reduce severity of log messages

Otherwise they can be used by a guest to spam the hypervisor log with
all settings at their defaults.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
---


diff -r 109ea6a0c23a -r 0520982a602a xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 11 14:18:26 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 11 14:18:36 2012 +0200
@@ -1107,7 +1107,7 @@ static int shared_pool_join(pool_t *pool
     sl->client = new_client;
     list_add_tail(&sl->share_list, &pool->share_list);
     if ( new_client->cli_id != pool->client->cli_id )
-        printk("adding new %s %d to shared pool owned by %s %d\n",
+        tmh_client_info("adding new %s %d to shared pool owned by %s %d\n",
             client_str, new_client->cli_id, client_str, pool->client->cli_id);
     return ++pool->shared_count;
 }
@@ -1137,7 +1137,7 @@ static NOINLINE void shared_pool_reassig
     old_client->eph_count -= _atomic_read(pool->pgp_count);
     list_splice_init(&old_client->ephemeral_page_list,
                      &new_client->ephemeral_page_list);
-    printk("reassigned shared pool from %s=%d to %s=%d pool_id=%d\n",
+    tmh_client_info("reassigned shared pool from %s=%d to %s=%d pool_id=%d\n",
         cli_id_str, old_client->cli_id, cli_id_str, new_client->cli_id, poolid);
     pool->pool_id = poolid;
 }
@@ -1173,7 +1173,7 @@ static NOINLINE int shared_pool_quit(poo
             }
         return 0;
     }
-    printk("tmem: no match unsharing pool, %s=%d\n",
+    tmh_client_warn("tmem: no match unsharing pool, %s=%d\n",
         cli_id_str,pool->client->cli_id);
     return -1;
 }
@@ -1184,17 +1184,18 @@ static void pool_flush(pool_t *pool, cli
     ASSERT(pool != NULL);
     if ( (is_shared(pool)) && (shared_pool_quit(pool,cli_id) > 0) )
     {
-        printk("tmem: %s=%d no longer using shared pool %d owned by %s=%d\n",
+        tmh_client_warn("tmem: %s=%d no longer using shared pool %d owned by %s=%d\n",
            cli_id_str, cli_id, pool->pool_id, cli_id_str,pool->client->cli_id);
         return;
     }
-    printk("%s %s-%s tmem pool ",destroy?"destroying":"flushing",
-        is_persistent(pool) ? "persistent" : "ephemeral" ,
-        is_shared(pool) ? "shared" : "private");
-    printk("%s=%d pool_id=%d\n", cli_id_str,pool->client->cli_id,pool->pool_id);
+    tmh_client_info("%s %s-%s tmem pool %s=%d pool_id=%d\n",
+                    destroy ? "destroying" : "flushing",
+                    is_persistent(pool) ? "persistent" : "ephemeral" ,
+                    is_shared(pool) ? "shared" : "private",
+                    cli_id_str, pool->client->cli_id, pool->pool_id);
     if ( pool->client->live_migrating )
     {
-        printk("can't %s pool while %s is live-migrating\n",
+        tmh_client_warn("can't %s pool while %s is live-migrating\n",
                destroy?"destroy":"flush", client_str);
         return;
     }
@@ -1213,21 +1214,22 @@ static client_t *client_create(cli_id_t 
     client_t *client = tmh_alloc_infra(sizeof(client_t),__alignof__(client_t));
     int i;
 
-    printk("tmem: initializing tmem capability for %s=%d...",cli_id_str,cli_id);
+    tmh_client_info("tmem: initializing tmem capability for %s=%d...",
+                    cli_id_str, cli_id);
     if ( client == NULL )
     {
-        printk("failed... out of memory\n");
+        tmh_client_err("failed... out of memory\n");
         goto fail;
     }
     memset(client,0,sizeof(client_t));
     if ( (client->tmh = tmh_client_init(cli_id)) == NULL )
     {
-        printk("failed... can't allocate host-dependent part of client\n");
+        tmh_client_err("failed... can't allocate host-dependent part of client\n");
         goto fail;
     }
     if ( !tmh_set_client_from_id(client, client->tmh, cli_id) )
     {
-        printk("failed... can't set client\n");
+        tmh_client_err("failed... can't set client\n");
         goto fail;
     }
     client->cli_id = cli_id;
@@ -1249,7 +1251,7 @@ static client_t *client_create(cli_id_t 
     client->eph_count = client->eph_count_max = 0;
     client->total_cycles = 0; client->succ_pers_puts = 0;
     client->succ_eph_gets = 0; client->succ_pers_gets = 0;
-    printk("ok\n");
+    tmh_client_info("ok\n");
     return client;
 
  fail:
@@ -1903,32 +1905,33 @@ static NOINLINE int do_tmem_new_pool(cli
         cli_id = tmh_get_cli_id_from_current();
     else
         cli_id = this_cli_id;
-    printk("tmem: allocating %s-%s tmem pool for %s=%d...",
+    tmh_client_info("tmem: allocating %s-%s tmem pool for %s=%d...",
         persistent ? "persistent" : "ephemeral" ,
         shared ? "shared" : "private", cli_id_str, cli_id);
     if ( specversion != TMEM_SPEC_VERSION )
     {
-        printk("failed... unsupported spec version\n");
+        tmh_client_err("failed... unsupported spec version\n");
         return -EPERM;
     }
     if ( pagebits != (PAGE_SHIFT - 12) )
     {
-        printk("failed... unsupported pagesize %d\n",1<<(pagebits+12));
+        tmh_client_err("failed... unsupported pagesize %d\n",
+                       1 << (pagebits + 12));
         return -EPERM;
     }
     if ( flags & TMEM_POOL_PRECOMPRESSED )
     {
-        printk("failed... precompression flag set but unsupported\n");
+        tmh_client_err("failed... precompression flag set but unsupported\n");
         return -EPERM;
     }
     if ( flags & TMEM_POOL_RESERVED_BITS )
     {
-        printk("failed... reserved bits must be zero\n");
+        tmh_client_err("failed... reserved bits must be zero\n");
         return -EPERM;
     }
     if ( (pool = pool_alloc()) == NULL )
     {
-        printk("failed... out of memory\n");
+        tmh_client_err("failed... out of memory\n");
         return -ENOMEM;
     }
     if ( this_cli_id != CLI_ID_NULL )
@@ -1947,7 +1950,7 @@ static NOINLINE int do_tmem_new_pool(cli
                 break;
         if ( d_poolid >= MAX_POOLS_PER_DOMAIN )
         {
-            printk("failed... no more pool slots available for this %s\n",
+            tmh_client_err("failed... no more pool slots available for this %s\n",
                    client_str);
             goto fail;
         }
@@ -1977,9 +1980,8 @@ static NOINLINE int do_tmem_new_pool(cli
             {
                 if ( shpool->uuid[0] == uuid_lo && shpool->uuid[1] == uuid_hi )
                 {
-                    printk("(matches shared pool uuid=%"PRIx64".%"PRIx64") ",
-                        uuid_hi, uuid_lo);
-                    printk("pool_id=%d\n",d_poolid);
+                    tmh_client_info("(matches shared pool uuid=%"PRIx64".%"PRIx64") pool_id=%d\n",
+                        uuid_hi, uuid_lo, d_poolid);
                     client->pools[d_poolid] = global_shared_pools[s_poolid];
                     shared_pool_join(global_shared_pools[s_poolid], client);
                     pool_free(pool);
@@ -1991,7 +1993,7 @@ static NOINLINE int do_tmem_new_pool(cli
         }
         if ( first_unused_s_poolid == MAX_GLOBAL_SHARED_POOLS )
         {
-            printk("tmem: failed... no global shared pool slots available\n");
+            tmh_client_warn("tmem: failed... no global shared pool slots available\n");
             goto fail;
         }
         else
@@ -2007,7 +2009,7 @@ static NOINLINE int do_tmem_new_pool(cli
     pool->pool_id = d_poolid;
     pool->persistent = persistent;
     pool->uuid[0] = uuid_lo; pool->uuid[1] = uuid_hi;
-    printk("pool_id=%d\n",d_poolid);
+    tmh_client_info("pool_id=%d\n", d_poolid);
     return d_poolid;
 
 fail:
@@ -2030,14 +2032,15 @@ static int tmemc_freeze_pools(cli_id_t c
     {
         list_for_each_entry(client,&global_client_list,client_list)
             client_freeze(client,freeze);
-        printk("tmem: all pools %s for all %ss\n",s,client_str);
+        tmh_client_info("tmem: all pools %s for all %ss\n", s, client_str);
     }
     else
     {
         if ( (client = tmh_client_from_cli_id(cli_id)) == NULL)
             return -1;
         client_freeze(client,freeze);
-        printk("tmem: all pools %s for %s=%d\n",s,cli_id_str,cli_id);
+        tmh_client_info("tmem: all pools %s for %s=%d\n",
+                         s, cli_id_str, cli_id);
     }
     return 0;
 }
@@ -2048,7 +2051,7 @@ static int tmemc_flush_mem(cli_id_t cli_
 
     if ( cli_id != CLI_ID_NULL )
     {
-        printk("tmem: %s-specific flush not supported yet, use --all\n",
+        tmh_client_warn("tmem: %s-specific flush not supported yet, use --all\n",
            client_str);
         return -1;
     }
@@ -2261,13 +2264,15 @@ static int tmemc_set_var_one(client_t *c
     case TMEMC_SET_WEIGHT:
         old_weight = client->weight;
         client->weight = arg1;
-        printk("tmem: weight set to %d for %s=%d\n",arg1,cli_id_str,cli_id);
+        tmh_client_info("tmem: weight set to %d for %s=%d\n",
+                        arg1, cli_id_str, cli_id);
         atomic_sub(old_weight,&client_weight_total);
         atomic_add(client->weight,&client_weight_total);
         break;
     case TMEMC_SET_CAP:
         client->cap = arg1;
-        printk("tmem: cap set to %d for %s=%d\n",arg1,cli_id_str,cli_id);
+        tmh_client_info("tmem: cap set to %d for %s=%d\n",
+                        arg1, cli_id_str, cli_id);
         break;
     case TMEMC_SET_COMPRESS:
 #ifdef __i386__
@@ -2275,17 +2280,17 @@ static int tmemc_set_var_one(client_t *c
 #endif
         if ( tmh_dedup_enabled() )
         {
-            printk("tmem: compression %s for all %ss, cannot be changed "
-                   "when tmem_dedup is enabled\n",
-            tmh_compression_enabled() ? "enabled" : "disabled",client_str);
+            tmh_client_warn("tmem: compression %s for all %ss, cannot be changed when tmem_dedup is enabled\n",
+                            tmh_compression_enabled() ? "enabled" : "disabled",
+                            client_str);
             return -1;
         }
         client->compress = arg1 ? 1 : 0;
-        printk("tmem: compression %s for %s=%d\n",
+        tmh_client_info("tmem: compression %s for %s=%d\n",
             arg1 ? "enabled" : "disabled",cli_id_str,cli_id);
         break;
     default:
-        printk("tmem: unknown subop %d for tmemc_set_var\n",subop);
+        tmh_client_warn("tmem: unknown subop %d for tmemc_set_var\n", subop);
         return -1;
     }
     return 0;
@@ -2668,7 +2673,7 @@ EXPORT long do_tmem_op(tmem_cli_op_t uop
 
     if ( unlikely(tmh_get_tmemop_from_client(&op, uops) != 0) )
     {
-        printk("tmem: can't get tmem struct from %s\n",client_str);
+        tmh_client_err("tmem: can't get tmem struct from %s\n", client_str);
         rc = -EFAULT;
         if ( !tmh_lock_all )
             goto simple_error;
@@ -2702,7 +2707,8 @@ EXPORT long do_tmem_op(tmem_cli_op_t uop
         tmem_write_lock_set = 1;
         if ( (client = client_create(tmh_get_cli_id_from_current())) == NULL )
         {
-            printk("tmem: can't create tmem structure for %s\n",client_str);
+            tmh_client_err("tmem: can't create tmem structure for %s\n",
+                           client_str);
             rc = -ENOMEM;
             goto out;
         }
@@ -2726,8 +2732,8 @@ EXPORT long do_tmem_op(tmem_cli_op_t uop
         if ( ((uint32_t)op.pool_id >= MAX_POOLS_PER_DOMAIN) ||
              ((pool = client->pools[op.pool_id]) == NULL) )
         {
+            tmh_client_err("tmem: operation requested on uncreated pool\n");
             rc = -ENODEV;
-            printk("tmem: operation requested on uncreated pool\n");
             goto out;
         }
         ASSERT_SENTINEL(pool,POOL);
@@ -2783,11 +2789,11 @@ EXPORT long do_tmem_op(tmem_cli_op_t uop
         break;
     case TMEM_XCHG:
         /* need to hold global lock to ensure xchg is atomic */
-        printk("tmem_xchg op not implemented yet\n");
+        tmh_client_warn("tmem_xchg op not implemented yet\n");
         rc = 0;
         break;
     default:
-        printk("tmem: op %d not implemented\n", op.cmd);
+        tmh_client_warn("tmem: op %d not implemented\n", op.cmd);
         rc = 0;
         break;
     }
diff -r 109ea6a0c23a -r 0520982a602a xen/include/xen/tmem_xen.h
--- a/xen/include/xen/tmem_xen.h	Tue Sep 11 14:18:26 2012 +0200
+++ b/xen/include/xen/tmem_xen.h	Tue Sep 11 14:18:36 2012 +0200
@@ -512,6 +512,9 @@ int tmh_copy_to_client(tmem_cli_mfn_t, p
 
 extern int tmh_copy_tze_to_client(tmem_cli_mfn_t cmfn, void *tmem_va, pagesize_t len);
 
+#define tmh_client_err(fmt, args...)  printk(XENLOG_G_ERR fmt, ##args)
+#define tmh_client_warn(fmt, args...) printk(XENLOG_G_WARNING fmt, ##args)
+#define tmh_client_info(fmt, args...) printk(XENLOG_G_INFO fmt, ##args)
 
 #define TMEM_PERF
 #ifdef TMEM_PERF

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYU-0003NB-6g; Fri, 14 Sep 2012 10:55:26 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYS-0003Ht-J2
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:24 +0000
Received: from [85.158.143.35:62549] by server-2.bemta-4.messagelabs.com id
	24/1E-21239-C1D03505; Fri, 14 Sep 2012 10:55:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-21.messagelabs.com!1347620120!15772720!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30879 invoked from network); 14 Sep 2012 10:55:22 -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;
	14 Sep 2012 10: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 1TCTYO-00013b-ON
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYO-0000jI-Jx
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:20 +0000
Message-Id: <E1TCTYO-0000jI-Jx@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tmem: reduce severity of log messages
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347365916 -7200
# Node ID 0520982a602a3ac06dd5bc573ddaff5edc9c6987
# Parent  109ea6a0c23aa0c5df79e3f5658162aed959ffcf
tmem: reduce severity of log messages

Otherwise they can be used by a guest to spam the hypervisor log with
all settings at their defaults.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
---


diff -r 109ea6a0c23a -r 0520982a602a xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 11 14:18:26 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 11 14:18:36 2012 +0200
@@ -1107,7 +1107,7 @@ static int shared_pool_join(pool_t *pool
     sl->client = new_client;
     list_add_tail(&sl->share_list, &pool->share_list);
     if ( new_client->cli_id != pool->client->cli_id )
-        printk("adding new %s %d to shared pool owned by %s %d\n",
+        tmh_client_info("adding new %s %d to shared pool owned by %s %d\n",
             client_str, new_client->cli_id, client_str, pool->client->cli_id);
     return ++pool->shared_count;
 }
@@ -1137,7 +1137,7 @@ static NOINLINE void shared_pool_reassig
     old_client->eph_count -= _atomic_read(pool->pgp_count);
     list_splice_init(&old_client->ephemeral_page_list,
                      &new_client->ephemeral_page_list);
-    printk("reassigned shared pool from %s=%d to %s=%d pool_id=%d\n",
+    tmh_client_info("reassigned shared pool from %s=%d to %s=%d pool_id=%d\n",
         cli_id_str, old_client->cli_id, cli_id_str, new_client->cli_id, poolid);
     pool->pool_id = poolid;
 }
@@ -1173,7 +1173,7 @@ static NOINLINE int shared_pool_quit(poo
             }
         return 0;
     }
-    printk("tmem: no match unsharing pool, %s=%d\n",
+    tmh_client_warn("tmem: no match unsharing pool, %s=%d\n",
         cli_id_str,pool->client->cli_id);
     return -1;
 }
@@ -1184,17 +1184,18 @@ static void pool_flush(pool_t *pool, cli
     ASSERT(pool != NULL);
     if ( (is_shared(pool)) && (shared_pool_quit(pool,cli_id) > 0) )
     {
-        printk("tmem: %s=%d no longer using shared pool %d owned by %s=%d\n",
+        tmh_client_warn("tmem: %s=%d no longer using shared pool %d owned by %s=%d\n",
            cli_id_str, cli_id, pool->pool_id, cli_id_str,pool->client->cli_id);
         return;
     }
-    printk("%s %s-%s tmem pool ",destroy?"destroying":"flushing",
-        is_persistent(pool) ? "persistent" : "ephemeral" ,
-        is_shared(pool) ? "shared" : "private");
-    printk("%s=%d pool_id=%d\n", cli_id_str,pool->client->cli_id,pool->pool_id);
+    tmh_client_info("%s %s-%s tmem pool %s=%d pool_id=%d\n",
+                    destroy ? "destroying" : "flushing",
+                    is_persistent(pool) ? "persistent" : "ephemeral" ,
+                    is_shared(pool) ? "shared" : "private",
+                    cli_id_str, pool->client->cli_id, pool->pool_id);
     if ( pool->client->live_migrating )
     {
-        printk("can't %s pool while %s is live-migrating\n",
+        tmh_client_warn("can't %s pool while %s is live-migrating\n",
                destroy?"destroy":"flush", client_str);
         return;
     }
@@ -1213,21 +1214,22 @@ static client_t *client_create(cli_id_t 
     client_t *client = tmh_alloc_infra(sizeof(client_t),__alignof__(client_t));
     int i;
 
-    printk("tmem: initializing tmem capability for %s=%d...",cli_id_str,cli_id);
+    tmh_client_info("tmem: initializing tmem capability for %s=%d...",
+                    cli_id_str, cli_id);
     if ( client == NULL )
     {
-        printk("failed... out of memory\n");
+        tmh_client_err("failed... out of memory\n");
         goto fail;
     }
     memset(client,0,sizeof(client_t));
     if ( (client->tmh = tmh_client_init(cli_id)) == NULL )
     {
-        printk("failed... can't allocate host-dependent part of client\n");
+        tmh_client_err("failed... can't allocate host-dependent part of client\n");
         goto fail;
     }
     if ( !tmh_set_client_from_id(client, client->tmh, cli_id) )
     {
-        printk("failed... can't set client\n");
+        tmh_client_err("failed... can't set client\n");
         goto fail;
     }
     client->cli_id = cli_id;
@@ -1249,7 +1251,7 @@ static client_t *client_create(cli_id_t 
     client->eph_count = client->eph_count_max = 0;
     client->total_cycles = 0; client->succ_pers_puts = 0;
     client->succ_eph_gets = 0; client->succ_pers_gets = 0;
-    printk("ok\n");
+    tmh_client_info("ok\n");
     return client;
 
  fail:
@@ -1903,32 +1905,33 @@ static NOINLINE int do_tmem_new_pool(cli
         cli_id = tmh_get_cli_id_from_current();
     else
         cli_id = this_cli_id;
-    printk("tmem: allocating %s-%s tmem pool for %s=%d...",
+    tmh_client_info("tmem: allocating %s-%s tmem pool for %s=%d...",
         persistent ? "persistent" : "ephemeral" ,
         shared ? "shared" : "private", cli_id_str, cli_id);
     if ( specversion != TMEM_SPEC_VERSION )
     {
-        printk("failed... unsupported spec version\n");
+        tmh_client_err("failed... unsupported spec version\n");
         return -EPERM;
     }
     if ( pagebits != (PAGE_SHIFT - 12) )
     {
-        printk("failed... unsupported pagesize %d\n",1<<(pagebits+12));
+        tmh_client_err("failed... unsupported pagesize %d\n",
+                       1 << (pagebits + 12));
         return -EPERM;
     }
     if ( flags & TMEM_POOL_PRECOMPRESSED )
     {
-        printk("failed... precompression flag set but unsupported\n");
+        tmh_client_err("failed... precompression flag set but unsupported\n");
         return -EPERM;
     }
     if ( flags & TMEM_POOL_RESERVED_BITS )
     {
-        printk("failed... reserved bits must be zero\n");
+        tmh_client_err("failed... reserved bits must be zero\n");
         return -EPERM;
     }
     if ( (pool = pool_alloc()) == NULL )
     {
-        printk("failed... out of memory\n");
+        tmh_client_err("failed... out of memory\n");
         return -ENOMEM;
     }
     if ( this_cli_id != CLI_ID_NULL )
@@ -1947,7 +1950,7 @@ static NOINLINE int do_tmem_new_pool(cli
                 break;
         if ( d_poolid >= MAX_POOLS_PER_DOMAIN )
         {
-            printk("failed... no more pool slots available for this %s\n",
+            tmh_client_err("failed... no more pool slots available for this %s\n",
                    client_str);
             goto fail;
         }
@@ -1977,9 +1980,8 @@ static NOINLINE int do_tmem_new_pool(cli
             {
                 if ( shpool->uuid[0] == uuid_lo && shpool->uuid[1] == uuid_hi )
                 {
-                    printk("(matches shared pool uuid=%"PRIx64".%"PRIx64") ",
-                        uuid_hi, uuid_lo);
-                    printk("pool_id=%d\n",d_poolid);
+                    tmh_client_info("(matches shared pool uuid=%"PRIx64".%"PRIx64") pool_id=%d\n",
+                        uuid_hi, uuid_lo, d_poolid);
                     client->pools[d_poolid] = global_shared_pools[s_poolid];
                     shared_pool_join(global_shared_pools[s_poolid], client);
                     pool_free(pool);
@@ -1991,7 +1993,7 @@ static NOINLINE int do_tmem_new_pool(cli
         }
         if ( first_unused_s_poolid == MAX_GLOBAL_SHARED_POOLS )
         {
-            printk("tmem: failed... no global shared pool slots available\n");
+            tmh_client_warn("tmem: failed... no global shared pool slots available\n");
             goto fail;
         }
         else
@@ -2007,7 +2009,7 @@ static NOINLINE int do_tmem_new_pool(cli
     pool->pool_id = d_poolid;
     pool->persistent = persistent;
     pool->uuid[0] = uuid_lo; pool->uuid[1] = uuid_hi;
-    printk("pool_id=%d\n",d_poolid);
+    tmh_client_info("pool_id=%d\n", d_poolid);
     return d_poolid;
 
 fail:
@@ -2030,14 +2032,15 @@ static int tmemc_freeze_pools(cli_id_t c
     {
         list_for_each_entry(client,&global_client_list,client_list)
             client_freeze(client,freeze);
-        printk("tmem: all pools %s for all %ss\n",s,client_str);
+        tmh_client_info("tmem: all pools %s for all %ss\n", s, client_str);
     }
     else
     {
         if ( (client = tmh_client_from_cli_id(cli_id)) == NULL)
             return -1;
         client_freeze(client,freeze);
-        printk("tmem: all pools %s for %s=%d\n",s,cli_id_str,cli_id);
+        tmh_client_info("tmem: all pools %s for %s=%d\n",
+                         s, cli_id_str, cli_id);
     }
     return 0;
 }
@@ -2048,7 +2051,7 @@ static int tmemc_flush_mem(cli_id_t cli_
 
     if ( cli_id != CLI_ID_NULL )
     {
-        printk("tmem: %s-specific flush not supported yet, use --all\n",
+        tmh_client_warn("tmem: %s-specific flush not supported yet, use --all\n",
            client_str);
         return -1;
     }
@@ -2261,13 +2264,15 @@ static int tmemc_set_var_one(client_t *c
     case TMEMC_SET_WEIGHT:
         old_weight = client->weight;
         client->weight = arg1;
-        printk("tmem: weight set to %d for %s=%d\n",arg1,cli_id_str,cli_id);
+        tmh_client_info("tmem: weight set to %d for %s=%d\n",
+                        arg1, cli_id_str, cli_id);
         atomic_sub(old_weight,&client_weight_total);
         atomic_add(client->weight,&client_weight_total);
         break;
     case TMEMC_SET_CAP:
         client->cap = arg1;
-        printk("tmem: cap set to %d for %s=%d\n",arg1,cli_id_str,cli_id);
+        tmh_client_info("tmem: cap set to %d for %s=%d\n",
+                        arg1, cli_id_str, cli_id);
         break;
     case TMEMC_SET_COMPRESS:
 #ifdef __i386__
@@ -2275,17 +2280,17 @@ static int tmemc_set_var_one(client_t *c
 #endif
         if ( tmh_dedup_enabled() )
         {
-            printk("tmem: compression %s for all %ss, cannot be changed "
-                   "when tmem_dedup is enabled\n",
-            tmh_compression_enabled() ? "enabled" : "disabled",client_str);
+            tmh_client_warn("tmem: compression %s for all %ss, cannot be changed when tmem_dedup is enabled\n",
+                            tmh_compression_enabled() ? "enabled" : "disabled",
+                            client_str);
             return -1;
         }
         client->compress = arg1 ? 1 : 0;
-        printk("tmem: compression %s for %s=%d\n",
+        tmh_client_info("tmem: compression %s for %s=%d\n",
             arg1 ? "enabled" : "disabled",cli_id_str,cli_id);
         break;
     default:
-        printk("tmem: unknown subop %d for tmemc_set_var\n",subop);
+        tmh_client_warn("tmem: unknown subop %d for tmemc_set_var\n", subop);
         return -1;
     }
     return 0;
@@ -2668,7 +2673,7 @@ EXPORT long do_tmem_op(tmem_cli_op_t uop
 
     if ( unlikely(tmh_get_tmemop_from_client(&op, uops) != 0) )
     {
-        printk("tmem: can't get tmem struct from %s\n",client_str);
+        tmh_client_err("tmem: can't get tmem struct from %s\n", client_str);
         rc = -EFAULT;
         if ( !tmh_lock_all )
             goto simple_error;
@@ -2702,7 +2707,8 @@ EXPORT long do_tmem_op(tmem_cli_op_t uop
         tmem_write_lock_set = 1;
         if ( (client = client_create(tmh_get_cli_id_from_current())) == NULL )
         {
-            printk("tmem: can't create tmem structure for %s\n",client_str);
+            tmh_client_err("tmem: can't create tmem structure for %s\n",
+                           client_str);
             rc = -ENOMEM;
             goto out;
         }
@@ -2726,8 +2732,8 @@ EXPORT long do_tmem_op(tmem_cli_op_t uop
         if ( ((uint32_t)op.pool_id >= MAX_POOLS_PER_DOMAIN) ||
              ((pool = client->pools[op.pool_id]) == NULL) )
         {
+            tmh_client_err("tmem: operation requested on uncreated pool\n");
             rc = -ENODEV;
-            printk("tmem: operation requested on uncreated pool\n");
             goto out;
         }
         ASSERT_SENTINEL(pool,POOL);
@@ -2783,11 +2789,11 @@ EXPORT long do_tmem_op(tmem_cli_op_t uop
         break;
     case TMEM_XCHG:
         /* need to hold global lock to ensure xchg is atomic */
-        printk("tmem_xchg op not implemented yet\n");
+        tmh_client_warn("tmem_xchg op not implemented yet\n");
         rc = 0;
         break;
     default:
-        printk("tmem: op %d not implemented\n", op.cmd);
+        tmh_client_warn("tmem: op %d not implemented\n", op.cmd);
         rc = 0;
         break;
     }
diff -r 109ea6a0c23a -r 0520982a602a xen/include/xen/tmem_xen.h
--- a/xen/include/xen/tmem_xen.h	Tue Sep 11 14:18:26 2012 +0200
+++ b/xen/include/xen/tmem_xen.h	Tue Sep 11 14:18:36 2012 +0200
@@ -512,6 +512,9 @@ int tmh_copy_to_client(tmem_cli_mfn_t, p
 
 extern int tmh_copy_tze_to_client(tmem_cli_mfn_t cmfn, void *tmem_va, pagesize_t len);
 
+#define tmh_client_err(fmt, args...)  printk(XENLOG_G_ERR fmt, ##args)
+#define tmh_client_warn(fmt, args...) printk(XENLOG_G_WARNING fmt, ##args)
+#define tmh_client_info(fmt, args...) printk(XENLOG_G_INFO fmt, ##args)
 
 #define TMEM_PERF
 #ifdef TMEM_PERF

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYV-0003PC-GD; Fri, 14 Sep 2012 10:55:27 +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 1TCTYU-0003Me-6X
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:26 +0000
Received: from [85.158.137.99:61839] by server-4.bemta-3.messagelabs.com id
	EF/B2-24831-D1D03505; Fri, 14 Sep 2012 10:55:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-217.messagelabs.com!1347620123!17669879!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32483 invoked from network); 14 Sep 2012 10:55:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Sep 2012 10: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 1TCTYQ-00013p-Vq
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYQ-0000kJ-Rd
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:22 +0000
Message-Id: <E1TCTYQ-0000kJ-Rd@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] console: prepare for non-COMn port
	support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347371236 -7200
# Node ID 776a23fa0e938e4cf3307fc2e3b3f1a9488a5927
# Parent  51c2d7c83cbc2a0357ce112a463f91d354dcdba9
console: prepare for non-COMn port support

Widen SERHND_IDX (and use it where needed), introduce a flush low level
driver method, and remove unnecessary peeking of the common code at the
(driver specific) serial port identification string in the "console="
command line option value.

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


diff -r 51c2d7c83cbc -r 776a23fa0e93 xen/arch/x86/smpboot.c
--- a/xen/arch/x86/smpboot.c	Tue Sep 11 15:45:20 2012 +0200
+++ b/xen/arch/x86/smpboot.c	Tue Sep 11 15:47:16 2012 +0200
@@ -1017,7 +1017,7 @@ void __init smp_intr_init(void)
      * Also ensure serial interrupts are high priority. We do not
      * want them to be blocked by unacknowledged guest-bound interrupts.
      */
-    for ( seridx = 0; seridx < 2; seridx++ )
+    for ( seridx = 0; seridx <= SERHND_IDX; seridx++ )
     {
         if ( (irq = serial_irq(seridx)) < 0 )
             continue;
diff -r 51c2d7c83cbc -r 776a23fa0e93 xen/drivers/char/console.c
--- a/xen/drivers/char/console.c	Tue Sep 11 15:45:20 2012 +0200
+++ b/xen/drivers/char/console.c	Tue Sep 11 15:47:16 2012 +0200
@@ -539,6 +539,7 @@ void printk(const char *fmt, ...)
 void __init console_init_preirq(void)
 {
     char *p;
+    int sh;
 
     serial_init_preirq();
 
@@ -551,8 +552,9 @@ void __init console_init_preirq(void)
             vga_init();
         else if ( !strncmp(p, "none", 4) )
             continue;
-        else if ( strncmp(p, "com", 3) ||
-                  (sercon_handle = serial_parse_handle(p)) == -1 )
+        else if ( (sh = serial_parse_handle(p)) >= 0 )
+            sercon_handle = sh;
+        else
         {
             char *q = strchr(p, ',');
             if ( q != NULL )
diff -r 51c2d7c83cbc -r 776a23fa0e93 xen/drivers/char/serial.c
--- a/xen/drivers/char/serial.c	Tue Sep 11 15:45:20 2012 +0200
+++ b/xen/drivers/char/serial.c	Tue Sep 11 15:47:16 2012 +0200
@@ -22,9 +22,11 @@ size_param("serial_tx_buffer", serial_tx
 #define mask_serial_rxbuf_idx(_i) ((_i)&(serial_rxbufsz-1))
 #define mask_serial_txbuf_idx(_i) ((_i)&(serial_txbufsz-1))
 
-static struct serial_port com[2] = {
-    { .rx_lock = SPIN_LOCK_UNLOCKED, .tx_lock = SPIN_LOCK_UNLOCKED }, 
-    { .rx_lock = SPIN_LOCK_UNLOCKED, .tx_lock = SPIN_LOCK_UNLOCKED }
+static struct serial_port com[SERHND_IDX + 1] = {
+    [0 ... SERHND_IDX] = {
+        .rx_lock = SPIN_LOCK_UNLOCKED,
+        .tx_lock = SPIN_LOCK_UNLOCKED
+    }
 };
 
 void serial_rx_interrupt(struct serial_port *port, struct cpu_user_regs *regs)
@@ -81,6 +83,8 @@ void serial_tx_interrupt(struct serial_p
             port->driver->putc(
                 port, port->txbuf[mask_serial_txbuf_idx(port->txbufc++)]);
         }
+        if ( i && port->driver->flush )
+            port->driver->flush(port);
     }
 
     spin_unlock(&port->tx_lock);
@@ -175,6 +179,9 @@ void serial_putc(int handle, char c)
 
     __serial_putc(port, c);
 
+    if ( port->driver->flush )
+        port->driver->flush(port);
+
     spin_unlock_irqrestore(&port->tx_lock, flags);
 }
 
@@ -206,6 +213,9 @@ void serial_puts(int handle, const char 
         __serial_putc(port, c);
     }
 
+    if ( port->driver->flush )
+        port->driver->flush(port);
+
     spin_unlock_irqrestore(&port->tx_lock, flags);
 }
 
@@ -261,10 +271,10 @@ int __init serial_parse_handle(char *con
     switch ( conf[3] )
     {
     case '1':
-        handle = 0;
+        handle = SERHND_COM1;
         break;
     case '2':
-        handle = 1;
+        handle = SERHND_COM2;
         break;
     default:
         goto fail;
@@ -365,6 +375,8 @@ void serial_start_sync(int handle)
             port->driver->putc(
                 port, port->txbuf[mask_serial_txbuf_idx(port->txbufc++)]);
         }
+        if ( port->driver->flush )
+            port->driver->flush(port);
     }
 
     spin_unlock_irqrestore(&port->tx_lock, flags);
diff -r 51c2d7c83cbc -r 776a23fa0e93 xen/include/xen/serial.h
--- a/xen/include/xen/serial.h	Tue Sep 11 15:45:20 2012 +0200
+++ b/xen/include/xen/serial.h	Tue Sep 11 15:47:16 2012 +0200
@@ -60,6 +60,8 @@ struct uart_driver {
     int  (*tx_empty)(struct serial_port *);
     /* Put a character onto the serial line. */
     void (*putc)(struct serial_port *, char);
+    /* Flush accumulated characters. */
+    void (*flush)(struct serial_port *);
     /* Get a character from the serial line: returns 0 if none available. */
     int  (*getc)(struct serial_port *, char *);
     /* Get IRQ number for this port's serial line: returns -1 if none. */
@@ -67,10 +69,12 @@ struct uart_driver {
 };
 
 /* 'Serial handles' are composed from the following fields. */
-#define SERHND_IDX      (1<<0) /* COM1 or COM2?                           */
-#define SERHND_HI       (1<<1) /* Mux/demux each transferred char by MSB. */
-#define SERHND_LO       (1<<2) /* Ditto, except that the MSB is cleared.  */
-#define SERHND_COOKED   (1<<3) /* Newline/carriage-return translation?    */
+#define SERHND_IDX      (3<<0) /* COM1 or COM2?                           */
+# define SERHND_COM1    (0<<0)
+# define SERHND_COM2    (1<<0)
+#define SERHND_HI       (1<<2) /* Mux/demux each transferred char by MSB. */
+#define SERHND_LO       (1<<3) /* Ditto, except that the MSB is cleared.  */
+#define SERHND_COOKED   (1<<4) /* Newline/carriage-return translation?    */
 
 /* Two-stage initialisation (before/after IRQ-subsystem initialisation). */
 void serial_init_preirq(void);

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYV-0003PC-GD; Fri, 14 Sep 2012 10:55:27 +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 1TCTYU-0003Me-6X
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:26 +0000
Received: from [85.158.137.99:61839] by server-4.bemta-3.messagelabs.com id
	EF/B2-24831-D1D03505; Fri, 14 Sep 2012 10:55:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-217.messagelabs.com!1347620123!17669879!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32483 invoked from network); 14 Sep 2012 10:55:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Sep 2012 10: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 1TCTYQ-00013p-Vq
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYQ-0000kJ-Rd
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:22 +0000
Message-Id: <E1TCTYQ-0000kJ-Rd@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] console: prepare for non-COMn port
	support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347371236 -7200
# Node ID 776a23fa0e938e4cf3307fc2e3b3f1a9488a5927
# Parent  51c2d7c83cbc2a0357ce112a463f91d354dcdba9
console: prepare for non-COMn port support

Widen SERHND_IDX (and use it where needed), introduce a flush low level
driver method, and remove unnecessary peeking of the common code at the
(driver specific) serial port identification string in the "console="
command line option value.

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


diff -r 51c2d7c83cbc -r 776a23fa0e93 xen/arch/x86/smpboot.c
--- a/xen/arch/x86/smpboot.c	Tue Sep 11 15:45:20 2012 +0200
+++ b/xen/arch/x86/smpboot.c	Tue Sep 11 15:47:16 2012 +0200
@@ -1017,7 +1017,7 @@ void __init smp_intr_init(void)
      * Also ensure serial interrupts are high priority. We do not
      * want them to be blocked by unacknowledged guest-bound interrupts.
      */
-    for ( seridx = 0; seridx < 2; seridx++ )
+    for ( seridx = 0; seridx <= SERHND_IDX; seridx++ )
     {
         if ( (irq = serial_irq(seridx)) < 0 )
             continue;
diff -r 51c2d7c83cbc -r 776a23fa0e93 xen/drivers/char/console.c
--- a/xen/drivers/char/console.c	Tue Sep 11 15:45:20 2012 +0200
+++ b/xen/drivers/char/console.c	Tue Sep 11 15:47:16 2012 +0200
@@ -539,6 +539,7 @@ void printk(const char *fmt, ...)
 void __init console_init_preirq(void)
 {
     char *p;
+    int sh;
 
     serial_init_preirq();
 
@@ -551,8 +552,9 @@ void __init console_init_preirq(void)
             vga_init();
         else if ( !strncmp(p, "none", 4) )
             continue;
-        else if ( strncmp(p, "com", 3) ||
-                  (sercon_handle = serial_parse_handle(p)) == -1 )
+        else if ( (sh = serial_parse_handle(p)) >= 0 )
+            sercon_handle = sh;
+        else
         {
             char *q = strchr(p, ',');
             if ( q != NULL )
diff -r 51c2d7c83cbc -r 776a23fa0e93 xen/drivers/char/serial.c
--- a/xen/drivers/char/serial.c	Tue Sep 11 15:45:20 2012 +0200
+++ b/xen/drivers/char/serial.c	Tue Sep 11 15:47:16 2012 +0200
@@ -22,9 +22,11 @@ size_param("serial_tx_buffer", serial_tx
 #define mask_serial_rxbuf_idx(_i) ((_i)&(serial_rxbufsz-1))
 #define mask_serial_txbuf_idx(_i) ((_i)&(serial_txbufsz-1))
 
-static struct serial_port com[2] = {
-    { .rx_lock = SPIN_LOCK_UNLOCKED, .tx_lock = SPIN_LOCK_UNLOCKED }, 
-    { .rx_lock = SPIN_LOCK_UNLOCKED, .tx_lock = SPIN_LOCK_UNLOCKED }
+static struct serial_port com[SERHND_IDX + 1] = {
+    [0 ... SERHND_IDX] = {
+        .rx_lock = SPIN_LOCK_UNLOCKED,
+        .tx_lock = SPIN_LOCK_UNLOCKED
+    }
 };
 
 void serial_rx_interrupt(struct serial_port *port, struct cpu_user_regs *regs)
@@ -81,6 +83,8 @@ void serial_tx_interrupt(struct serial_p
             port->driver->putc(
                 port, port->txbuf[mask_serial_txbuf_idx(port->txbufc++)]);
         }
+        if ( i && port->driver->flush )
+            port->driver->flush(port);
     }
 
     spin_unlock(&port->tx_lock);
@@ -175,6 +179,9 @@ void serial_putc(int handle, char c)
 
     __serial_putc(port, c);
 
+    if ( port->driver->flush )
+        port->driver->flush(port);
+
     spin_unlock_irqrestore(&port->tx_lock, flags);
 }
 
@@ -206,6 +213,9 @@ void serial_puts(int handle, const char 
         __serial_putc(port, c);
     }
 
+    if ( port->driver->flush )
+        port->driver->flush(port);
+
     spin_unlock_irqrestore(&port->tx_lock, flags);
 }
 
@@ -261,10 +271,10 @@ int __init serial_parse_handle(char *con
     switch ( conf[3] )
     {
     case '1':
-        handle = 0;
+        handle = SERHND_COM1;
         break;
     case '2':
-        handle = 1;
+        handle = SERHND_COM2;
         break;
     default:
         goto fail;
@@ -365,6 +375,8 @@ void serial_start_sync(int handle)
             port->driver->putc(
                 port, port->txbuf[mask_serial_txbuf_idx(port->txbufc++)]);
         }
+        if ( port->driver->flush )
+            port->driver->flush(port);
     }
 
     spin_unlock_irqrestore(&port->tx_lock, flags);
diff -r 51c2d7c83cbc -r 776a23fa0e93 xen/include/xen/serial.h
--- a/xen/include/xen/serial.h	Tue Sep 11 15:45:20 2012 +0200
+++ b/xen/include/xen/serial.h	Tue Sep 11 15:47:16 2012 +0200
@@ -60,6 +60,8 @@ struct uart_driver {
     int  (*tx_empty)(struct serial_port *);
     /* Put a character onto the serial line. */
     void (*putc)(struct serial_port *, char);
+    /* Flush accumulated characters. */
+    void (*flush)(struct serial_port *);
     /* Get a character from the serial line: returns 0 if none available. */
     int  (*getc)(struct serial_port *, char *);
     /* Get IRQ number for this port's serial line: returns -1 if none. */
@@ -67,10 +69,12 @@ struct uart_driver {
 };
 
 /* 'Serial handles' are composed from the following fields. */
-#define SERHND_IDX      (1<<0) /* COM1 or COM2?                           */
-#define SERHND_HI       (1<<1) /* Mux/demux each transferred char by MSB. */
-#define SERHND_LO       (1<<2) /* Ditto, except that the MSB is cleared.  */
-#define SERHND_COOKED   (1<<3) /* Newline/carriage-return translation?    */
+#define SERHND_IDX      (3<<0) /* COM1 or COM2?                           */
+# define SERHND_COM1    (0<<0)
+# define SERHND_COM2    (1<<0)
+#define SERHND_HI       (1<<2) /* Mux/demux each transferred char by MSB. */
+#define SERHND_LO       (1<<3) /* Ditto, except that the MSB is cleared.  */
+#define SERHND_COOKED   (1<<4) /* Newline/carriage-return translation?    */
 
 /* Two-stage initialisation (before/after IRQ-subsystem initialisation). */
 void serial_init_preirq(void);

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYV-0003P2-Dx; Fri, 14 Sep 2012 10:55:27 +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 1TCTYU-0003MV-2z
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:26 +0000
Received: from [85.158.137.99:61639] by server-7.bemta-3.messagelabs.com id
	85/B9-32000-C1D03505; Fri, 14 Sep 2012 10:55:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-217.messagelabs.com!1347620119!17663662!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12291 invoked from network); 14 Sep 2012 10:55:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Sep 2012 10: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 1TCTYN-00013V-JI
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYN-0000io-Hk
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:19 +0000
Message-Id: <E1TCTYN-0000io-Hk@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tmem: properly drop lock on error
	path in do_tmem_get()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347365888 -7200
# Node ID 83b97a59888b6d2d0f984b8403bd5764dd55c10c
# Parent  33b8c42a87ec2fa6e6533dd9ee7603f732b168f5
tmem: properly drop lock on error path in do_tmem_get()

Also remove a bogus assertion.

Reported-by: Tim Deegan <tim@xen.org>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
---


diff -r 33b8c42a87ec -r 83b97a59888b xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 11 14:17:59 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 11 14:18:08 2012 +0200
@@ -1790,7 +1790,6 @@ static NOINLINE int do_tmem_get(pool_t *
             list_del(&pgp->us.client_eph_pages);
             list_add_tail(&pgp->us.client_eph_pages,&client->ephemeral_page_list);
             tmem_spin_unlock(&eph_lists_spinlock);
-            ASSERT(obj != NULL);
             obj->last_client = tmh_get_cli_id_from_current();
         }
     }
@@ -1807,6 +1806,8 @@ static NOINLINE int do_tmem_get(pool_t *
     return 1;
 
 bad_copy:
+    obj->no_evict = 0;
+    tmem_spin_unlock(&obj->obj_spinlock);
     failed_copies++;
     return rc;
 }

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYV-0003P2-Dx; Fri, 14 Sep 2012 10:55:27 +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 1TCTYU-0003MV-2z
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:26 +0000
Received: from [85.158.137.99:61639] by server-7.bemta-3.messagelabs.com id
	85/B9-32000-C1D03505; Fri, 14 Sep 2012 10:55:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-217.messagelabs.com!1347620119!17663662!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12291 invoked from network); 14 Sep 2012 10:55:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Sep 2012 10: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 1TCTYN-00013V-JI
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYN-0000io-Hk
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:19 +0000
Message-Id: <E1TCTYN-0000io-Hk@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tmem: properly drop lock on error
	path in do_tmem_get()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347365888 -7200
# Node ID 83b97a59888b6d2d0f984b8403bd5764dd55c10c
# Parent  33b8c42a87ec2fa6e6533dd9ee7603f732b168f5
tmem: properly drop lock on error path in do_tmem_get()

Also remove a bogus assertion.

Reported-by: Tim Deegan <tim@xen.org>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
---


diff -r 33b8c42a87ec -r 83b97a59888b xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 11 14:17:59 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 11 14:18:08 2012 +0200
@@ -1790,7 +1790,6 @@ static NOINLINE int do_tmem_get(pool_t *
             list_del(&pgp->us.client_eph_pages);
             list_add_tail(&pgp->us.client_eph_pages,&client->ephemeral_page_list);
             tmem_spin_unlock(&eph_lists_spinlock);
-            ASSERT(obj != NULL);
             obj->last_client = tmh_get_cli_id_from_current();
         }
     }
@@ -1807,6 +1806,8 @@ static NOINLINE int do_tmem_get(pool_t *
     return 1;
 
 bad_copy:
+    obj->no_evict = 0;
+    tmem_spin_unlock(&obj->obj_spinlock);
     failed_copies++;
     return rc;
 }

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:28 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYV-0003Ov-Aw; Fri, 14 Sep 2012 10:55:27 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYT-0003Ht-Rl
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:26 +0000
Received: from [85.158.143.99:56570] by server-2.bemta-4.messagelabs.com id
	AA/1E-21239-D1D03505; Fri, 14 Sep 2012 10:55:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-216.messagelabs.com!1347620122!22817129!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16338 invoked from network); 14 Sep 2012 10:55:23 -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;
	14 Sep 2012 10: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 1TCTYQ-00013k-CJ
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYQ-0000k4-9U
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:22 +0000
Message-Id: <E1TCTYQ-0000k4-9U@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: allow early use of fixmaps
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347371120 -7200
# Node ID 51c2d7c83cbc2a0357ce112a463f91d354dcdba9
# Parent  e4cb8411161043c726f699252cc761e77853e820
x86: allow early use of fixmaps

As a prerequisite for adding an EHCI debug port based console
implementation, set up the page tables needed for (a sub-portion of)
the fixmaps together with other boot time page table construction.

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


diff -r e4cb84111610 -r 51c2d7c83cbc xen/arch/x86/boot/head.S
--- a/xen/arch/x86/boot/head.S	Tue Sep 11 14:19:29 2012 +0200
+++ b/xen/arch/x86/boot/head.S	Tue Sep 11 15:45:20 2012 +0200
@@ -3,6 +3,7 @@
 #include <public/xen.h>
 #include <asm/asm_defns.h>
 #include <asm/desc.h>
+#include <asm/fixmap.h>
 #include <asm/page.h>
 #include <asm/msr.h>
 
@@ -136,6 +137,9 @@ 1:      mov     %eax,(%edi)
         add     $8,%edx
         add     $(1<<L2_PAGETABLE_SHIFT),%eax
         loop    1b
+        /* Initialise L2 fixmap page directory entry. */
+        mov     $(sym_phys(l1_fixmap)+7),%eax
+        mov     %eax,sym_phys(l2_fixmap) + l2_table_offset(FIXADDR_TOP-1)*8
         /* Initialise L3 identity-map page directory entries. */
         mov     $sym_phys(l3_identmap),%edi
         mov     $(sym_phys(l2_identmap)+7),%eax
@@ -144,9 +148,11 @@ 1:      mov     %eax,(%edi)
         add     $8,%edi
         add     $PAGE_SIZE,%eax
         loop    1b
-        /* Initialise L3 xen-map page directory entry. */
+        /* Initialise L3 xen-map and fixmap page directory entries. */
         mov     $(sym_phys(l2_xenmap)+7),%eax
         mov     %eax,sym_phys(l3_xenmap) + l3_table_offset(XEN_VIRT_START)*8
+        mov     $(sym_phys(l2_fixmap)+7),%eax
+        mov     %eax,sym_phys(l3_xenmap) + l3_table_offset(FIXADDR_TOP-1)*8
         /* Initialise L3 boot-map page directory entry. */
         mov     $(sym_phys(l2_bootmap)+7),%eax
         mov     %eax,sym_phys(l3_bootmap) + 0*8
@@ -172,6 +178,9 @@ 1:      stosl   /* low mappings cover up
         add     $(1<<L2_PAGETABLE_SHIFT),%eax
         cmp     $(16<<20)+0xe3,%eax
         jne     1b
+        /* Initialise L2 fixmap page directory entry. */
+        mov     $(sym_phys(l1_fixmap)+7),%eax
+        mov     %eax,sym_phys(idle_pg_table_l2) + l2_table_offset(FIXADDR_TOP-1)*8
 #endif
 
         /* Initialize 4kB mappings of first 2MB or 4MB of memory. */
diff -r e4cb84111610 -r 51c2d7c83cbc xen/arch/x86/efi/boot.c
--- a/xen/arch/x86/efi/boot.c	Tue Sep 11 14:19:29 2012 +0200
+++ b/xen/arch/x86/efi/boot.c	Tue Sep 11 15:45:20 2012 +0200
@@ -17,6 +17,9 @@
 #include <xen/vga.h>
 #include <asm/e820.h>
 #include <asm/edd.h>
+#define __ASSEMBLY__ /* avoid pulling in ACPI stuff (conflicts with EFI) */
+#include <asm/fixmap.h>
+#undef __ASSEMBLY__
 #include <asm/mm.h>
 #include <asm/msr.h>
 #include <asm/processor.h>
@@ -1123,14 +1126,19 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SY
         slot &= L2_PAGETABLE_ENTRIES - 1;
         l2_bootmap[slot] = l2e_from_paddr(addr, __PAGE_HYPERVISOR|_PAGE_PSE);
     }
+    /* Initialise L2 fixmap page directory entry. */
+    l2_fixmap[l2_table_offset(FIXADDR_TOP - 1)] =
+        l2e_from_paddr((UINTN)l1_fixmap, __PAGE_HYPERVISOR);
     /* Initialise L3 identity-map page directory entries. */
     for ( i = 0; i < ARRAY_SIZE(l2_identmap) / L2_PAGETABLE_ENTRIES; ++i )
         l3_identmap[i] = l3e_from_paddr((UINTN)(l2_identmap +
                                                 i * L2_PAGETABLE_ENTRIES),
                                         __PAGE_HYPERVISOR);
-    /* Initialise L3 xen-map page directory entry. */
+    /* Initialise L3 xen-map and fixmap page directory entries. */
     l3_xenmap[l3_table_offset(XEN_VIRT_START)] =
         l3e_from_paddr((UINTN)l2_xenmap, __PAGE_HYPERVISOR);
+    l3_xenmap[l3_table_offset(FIXADDR_TOP - 1)] =
+        l3e_from_paddr((UINTN)l2_fixmap, __PAGE_HYPERVISOR);
     /* Initialise L3 boot-map page directory entries. */
     l3_bootmap[l3_table_offset(xen_phys_start)] =
         l3e_from_paddr((UINTN)l2_bootmap, __PAGE_HYPERVISOR);
diff -r e4cb84111610 -r 51c2d7c83cbc xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Tue Sep 11 14:19:29 2012 +0200
+++ b/xen/arch/x86/mm.c	Tue Sep 11 15:45:20 2012 +0200
@@ -130,6 +130,10 @@
 l1_pgentry_t __attribute__ ((__section__ (".bss.page_aligned")))
     l1_identmap[L1_PAGETABLE_ENTRIES];
 
+/* Mapping of the fixmap space needed early. */
+l1_pgentry_t __attribute__ ((__section__ (".bss.page_aligned")))
+    l1_fixmap[L1_PAGETABLE_ENTRIES];
+
 #define MEM_LOG(_f, _a...) gdprintk(XENLOG_WARNING , _f "\n" , ## _a)
 
 /*
diff -r e4cb84111610 -r 51c2d7c83cbc xen/arch/x86/x86_64/mm.c
--- a/xen/arch/x86/x86_64/mm.c	Tue Sep 11 14:19:29 2012 +0200
+++ b/xen/arch/x86/x86_64/mm.c	Tue Sep 11 15:45:20 2012 +0200
@@ -65,6 +65,10 @@ l3_pgentry_t __attribute__ ((__section__
 l2_pgentry_t __attribute__ ((__section__ (".bss.page_aligned")))
     l2_xenmap[L2_PAGETABLE_ENTRIES];
 
+/* Enough page directories to map the early fixmap space. */
+l2_pgentry_t __attribute__ ((__section__ (".bss.page_aligned")))
+    l2_fixmap[L2_PAGETABLE_ENTRIES];
+
 /* Enough page directories to map into the bottom 1GB. */
 l3_pgentry_t __attribute__ ((__section__ (".bss.page_aligned")))
     l3_bootmap[L3_PAGETABLE_ENTRIES];
diff -r e4cb84111610 -r 51c2d7c83cbc xen/include/asm-x86/config.h
--- a/xen/include/asm-x86/config.h	Tue Sep 11 14:19:29 2012 +0200
+++ b/xen/include/asm-x86/config.h	Tue Sep 11 15:45:20 2012 +0200
@@ -315,7 +315,7 @@ extern unsigned char boot_edid_info[128]
 #define MACHPHYS_MBYTES         16 /* 1 MB needed per 1 GB memory */
 #define FRAMETABLE_MBYTES       (MACHPHYS_MBYTES * 6)
 
-#define IOREMAP_VIRT_END	0UL
+#define IOREMAP_VIRT_END	_AC(0,UL)
 #define IOREMAP_VIRT_START	(IOREMAP_VIRT_END - (IOREMAP_MBYTES<<20))
 #define DIRECTMAP_VIRT_END	IOREMAP_VIRT_START
 #define DIRECTMAP_VIRT_START	(DIRECTMAP_VIRT_END - (DIRECTMAP_MBYTES<<20))
diff -r e4cb84111610 -r 51c2d7c83cbc xen/include/asm-x86/fixmap.h
--- a/xen/include/asm-x86/fixmap.h	Tue Sep 11 14:19:29 2012 +0200
+++ b/xen/include/asm-x86/fixmap.h	Tue Sep 11 15:45:20 2012 +0200
@@ -13,12 +13,17 @@
 #define _ASM_FIXMAP_H
 
 #include <xen/config.h>
+#include <asm/page.h>
+
+#define FIXADDR_TOP (IOREMAP_VIRT_END - PAGE_SIZE)
+
+#ifndef __ASSEMBLY__
+
 #include <xen/pfn.h>
 #include <xen/kexec.h>
 #include <xen/iommu.h>
 #include <asm/apicdef.h>
 #include <asm/acpi.h>
-#include <asm/page.h>
 #include <asm/amd-iommu.h>
 #include <asm/msi.h>
 #include <acpi/apei.h>
@@ -66,7 +71,6 @@ enum fixed_addresses {
     __end_of_fixed_addresses
 };
 
-#define FIXADDR_TOP   (IOREMAP_VIRT_END - PAGE_SIZE)
 #define FIXADDR_SIZE  (__end_of_fixed_addresses << PAGE_SHIFT)
 #define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)
 
@@ -90,4 +94,6 @@ static inline unsigned long virt_to_fix(
     return __virt_to_fix(vaddr);
 }
 
+#endif /* __ASSEMBLY__ */
+
 #endif
diff -r e4cb84111610 -r 51c2d7c83cbc xen/include/asm-x86/page.h
--- a/xen/include/asm-x86/page.h	Tue Sep 11 14:19:29 2012 +0200
+++ b/xen/include/asm-x86/page.h	Tue Sep 11 15:45:20 2012 +0200
@@ -1,6 +1,8 @@
 #ifndef __X86_PAGE_H__
 #define __X86_PAGE_H__
 
+#include <xen/const.h>
+
 /*
  * It is important that the masks are signed quantities. This ensures that
  * the compiler sign-extends a 32-bit mask to 64 bits if that is required.
@@ -306,13 +308,15 @@ extern l2_pgentry_t   idle_pg_table_l2[
 extern l2_pgentry_t  *compat_idle_pg_table_l2;
 extern unsigned int   m2p_compat_vstart;
 extern l2_pgentry_t l2_xenmap[L2_PAGETABLE_ENTRIES],
+    l2_fixmap[L2_PAGETABLE_ENTRIES],
     l2_bootmap[L2_PAGETABLE_ENTRIES];
 extern l3_pgentry_t l3_xenmap[L3_PAGETABLE_ENTRIES],
     l3_identmap[L3_PAGETABLE_ENTRIES],
     l3_bootmap[L3_PAGETABLE_ENTRIES];
 #endif
 extern l2_pgentry_t l2_identmap[4*L2_PAGETABLE_ENTRIES];
-extern l1_pgentry_t l1_identmap[L1_PAGETABLE_ENTRIES];
+extern l1_pgentry_t l1_identmap[L1_PAGETABLE_ENTRIES],
+    l1_fixmap[L1_PAGETABLE_ENTRIES];
 void paging_init(void);
 void setup_idle_pagetable(void);
 #endif /* !defined(__ASSEMBLY__) */
diff -r e4cb84111610 -r 51c2d7c83cbc xen/include/xen/const.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/include/xen/const.h	Tue Sep 11 15:45:20 2012 +0200
@@ -0,0 +1,24 @@
+/* const.h: Macros for dealing with constants.  */
+
+#ifndef __XEN_CONST_H__
+#define __XEN_CONST_H__
+
+/* Some constant macros are used in both assembler and
+ * C code.  Therefore we cannot annotate them always with
+ * 'UL' and other type specifiers unilaterally.  We
+ * use the following macros to deal with this.
+ *
+ * Similarly, _AT() will cast an expression with a type in C, but
+ * leave it unchanged in asm.
+ */
+
+#ifdef __ASSEMBLY__
+#define _AC(X,Y)	X
+#define _AT(T,X)	X
+#else
+#define __AC(X,Y)	(X##Y)
+#define _AC(X,Y)	__AC(X,Y)
+#define _AT(T,X)	((T)(X))
+#endif
+
+#endif /* __XEN_CONST_H__ */

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:28 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYV-0003Ov-Aw; Fri, 14 Sep 2012 10:55:27 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYT-0003Ht-Rl
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:26 +0000
Received: from [85.158.143.99:56570] by server-2.bemta-4.messagelabs.com id
	AA/1E-21239-D1D03505; Fri, 14 Sep 2012 10:55:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-216.messagelabs.com!1347620122!22817129!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16338 invoked from network); 14 Sep 2012 10:55:23 -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;
	14 Sep 2012 10: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 1TCTYQ-00013k-CJ
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYQ-0000k4-9U
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:22 +0000
Message-Id: <E1TCTYQ-0000k4-9U@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: allow early use of fixmaps
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347371120 -7200
# Node ID 51c2d7c83cbc2a0357ce112a463f91d354dcdba9
# Parent  e4cb8411161043c726f699252cc761e77853e820
x86: allow early use of fixmaps

As a prerequisite for adding an EHCI debug port based console
implementation, set up the page tables needed for (a sub-portion of)
the fixmaps together with other boot time page table construction.

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


diff -r e4cb84111610 -r 51c2d7c83cbc xen/arch/x86/boot/head.S
--- a/xen/arch/x86/boot/head.S	Tue Sep 11 14:19:29 2012 +0200
+++ b/xen/arch/x86/boot/head.S	Tue Sep 11 15:45:20 2012 +0200
@@ -3,6 +3,7 @@
 #include <public/xen.h>
 #include <asm/asm_defns.h>
 #include <asm/desc.h>
+#include <asm/fixmap.h>
 #include <asm/page.h>
 #include <asm/msr.h>
 
@@ -136,6 +137,9 @@ 1:      mov     %eax,(%edi)
         add     $8,%edx
         add     $(1<<L2_PAGETABLE_SHIFT),%eax
         loop    1b
+        /* Initialise L2 fixmap page directory entry. */
+        mov     $(sym_phys(l1_fixmap)+7),%eax
+        mov     %eax,sym_phys(l2_fixmap) + l2_table_offset(FIXADDR_TOP-1)*8
         /* Initialise L3 identity-map page directory entries. */
         mov     $sym_phys(l3_identmap),%edi
         mov     $(sym_phys(l2_identmap)+7),%eax
@@ -144,9 +148,11 @@ 1:      mov     %eax,(%edi)
         add     $8,%edi
         add     $PAGE_SIZE,%eax
         loop    1b
-        /* Initialise L3 xen-map page directory entry. */
+        /* Initialise L3 xen-map and fixmap page directory entries. */
         mov     $(sym_phys(l2_xenmap)+7),%eax
         mov     %eax,sym_phys(l3_xenmap) + l3_table_offset(XEN_VIRT_START)*8
+        mov     $(sym_phys(l2_fixmap)+7),%eax
+        mov     %eax,sym_phys(l3_xenmap) + l3_table_offset(FIXADDR_TOP-1)*8
         /* Initialise L3 boot-map page directory entry. */
         mov     $(sym_phys(l2_bootmap)+7),%eax
         mov     %eax,sym_phys(l3_bootmap) + 0*8
@@ -172,6 +178,9 @@ 1:      stosl   /* low mappings cover up
         add     $(1<<L2_PAGETABLE_SHIFT),%eax
         cmp     $(16<<20)+0xe3,%eax
         jne     1b
+        /* Initialise L2 fixmap page directory entry. */
+        mov     $(sym_phys(l1_fixmap)+7),%eax
+        mov     %eax,sym_phys(idle_pg_table_l2) + l2_table_offset(FIXADDR_TOP-1)*8
 #endif
 
         /* Initialize 4kB mappings of first 2MB or 4MB of memory. */
diff -r e4cb84111610 -r 51c2d7c83cbc xen/arch/x86/efi/boot.c
--- a/xen/arch/x86/efi/boot.c	Tue Sep 11 14:19:29 2012 +0200
+++ b/xen/arch/x86/efi/boot.c	Tue Sep 11 15:45:20 2012 +0200
@@ -17,6 +17,9 @@
 #include <xen/vga.h>
 #include <asm/e820.h>
 #include <asm/edd.h>
+#define __ASSEMBLY__ /* avoid pulling in ACPI stuff (conflicts with EFI) */
+#include <asm/fixmap.h>
+#undef __ASSEMBLY__
 #include <asm/mm.h>
 #include <asm/msr.h>
 #include <asm/processor.h>
@@ -1123,14 +1126,19 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SY
         slot &= L2_PAGETABLE_ENTRIES - 1;
         l2_bootmap[slot] = l2e_from_paddr(addr, __PAGE_HYPERVISOR|_PAGE_PSE);
     }
+    /* Initialise L2 fixmap page directory entry. */
+    l2_fixmap[l2_table_offset(FIXADDR_TOP - 1)] =
+        l2e_from_paddr((UINTN)l1_fixmap, __PAGE_HYPERVISOR);
     /* Initialise L3 identity-map page directory entries. */
     for ( i = 0; i < ARRAY_SIZE(l2_identmap) / L2_PAGETABLE_ENTRIES; ++i )
         l3_identmap[i] = l3e_from_paddr((UINTN)(l2_identmap +
                                                 i * L2_PAGETABLE_ENTRIES),
                                         __PAGE_HYPERVISOR);
-    /* Initialise L3 xen-map page directory entry. */
+    /* Initialise L3 xen-map and fixmap page directory entries. */
     l3_xenmap[l3_table_offset(XEN_VIRT_START)] =
         l3e_from_paddr((UINTN)l2_xenmap, __PAGE_HYPERVISOR);
+    l3_xenmap[l3_table_offset(FIXADDR_TOP - 1)] =
+        l3e_from_paddr((UINTN)l2_fixmap, __PAGE_HYPERVISOR);
     /* Initialise L3 boot-map page directory entries. */
     l3_bootmap[l3_table_offset(xen_phys_start)] =
         l3e_from_paddr((UINTN)l2_bootmap, __PAGE_HYPERVISOR);
diff -r e4cb84111610 -r 51c2d7c83cbc xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Tue Sep 11 14:19:29 2012 +0200
+++ b/xen/arch/x86/mm.c	Tue Sep 11 15:45:20 2012 +0200
@@ -130,6 +130,10 @@
 l1_pgentry_t __attribute__ ((__section__ (".bss.page_aligned")))
     l1_identmap[L1_PAGETABLE_ENTRIES];
 
+/* Mapping of the fixmap space needed early. */
+l1_pgentry_t __attribute__ ((__section__ (".bss.page_aligned")))
+    l1_fixmap[L1_PAGETABLE_ENTRIES];
+
 #define MEM_LOG(_f, _a...) gdprintk(XENLOG_WARNING , _f "\n" , ## _a)
 
 /*
diff -r e4cb84111610 -r 51c2d7c83cbc xen/arch/x86/x86_64/mm.c
--- a/xen/arch/x86/x86_64/mm.c	Tue Sep 11 14:19:29 2012 +0200
+++ b/xen/arch/x86/x86_64/mm.c	Tue Sep 11 15:45:20 2012 +0200
@@ -65,6 +65,10 @@ l3_pgentry_t __attribute__ ((__section__
 l2_pgentry_t __attribute__ ((__section__ (".bss.page_aligned")))
     l2_xenmap[L2_PAGETABLE_ENTRIES];
 
+/* Enough page directories to map the early fixmap space. */
+l2_pgentry_t __attribute__ ((__section__ (".bss.page_aligned")))
+    l2_fixmap[L2_PAGETABLE_ENTRIES];
+
 /* Enough page directories to map into the bottom 1GB. */
 l3_pgentry_t __attribute__ ((__section__ (".bss.page_aligned")))
     l3_bootmap[L3_PAGETABLE_ENTRIES];
diff -r e4cb84111610 -r 51c2d7c83cbc xen/include/asm-x86/config.h
--- a/xen/include/asm-x86/config.h	Tue Sep 11 14:19:29 2012 +0200
+++ b/xen/include/asm-x86/config.h	Tue Sep 11 15:45:20 2012 +0200
@@ -315,7 +315,7 @@ extern unsigned char boot_edid_info[128]
 #define MACHPHYS_MBYTES         16 /* 1 MB needed per 1 GB memory */
 #define FRAMETABLE_MBYTES       (MACHPHYS_MBYTES * 6)
 
-#define IOREMAP_VIRT_END	0UL
+#define IOREMAP_VIRT_END	_AC(0,UL)
 #define IOREMAP_VIRT_START	(IOREMAP_VIRT_END - (IOREMAP_MBYTES<<20))
 #define DIRECTMAP_VIRT_END	IOREMAP_VIRT_START
 #define DIRECTMAP_VIRT_START	(DIRECTMAP_VIRT_END - (DIRECTMAP_MBYTES<<20))
diff -r e4cb84111610 -r 51c2d7c83cbc xen/include/asm-x86/fixmap.h
--- a/xen/include/asm-x86/fixmap.h	Tue Sep 11 14:19:29 2012 +0200
+++ b/xen/include/asm-x86/fixmap.h	Tue Sep 11 15:45:20 2012 +0200
@@ -13,12 +13,17 @@
 #define _ASM_FIXMAP_H
 
 #include <xen/config.h>
+#include <asm/page.h>
+
+#define FIXADDR_TOP (IOREMAP_VIRT_END - PAGE_SIZE)
+
+#ifndef __ASSEMBLY__
+
 #include <xen/pfn.h>
 #include <xen/kexec.h>
 #include <xen/iommu.h>
 #include <asm/apicdef.h>
 #include <asm/acpi.h>
-#include <asm/page.h>
 #include <asm/amd-iommu.h>
 #include <asm/msi.h>
 #include <acpi/apei.h>
@@ -66,7 +71,6 @@ enum fixed_addresses {
     __end_of_fixed_addresses
 };
 
-#define FIXADDR_TOP   (IOREMAP_VIRT_END - PAGE_SIZE)
 #define FIXADDR_SIZE  (__end_of_fixed_addresses << PAGE_SHIFT)
 #define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)
 
@@ -90,4 +94,6 @@ static inline unsigned long virt_to_fix(
     return __virt_to_fix(vaddr);
 }
 
+#endif /* __ASSEMBLY__ */
+
 #endif
diff -r e4cb84111610 -r 51c2d7c83cbc xen/include/asm-x86/page.h
--- a/xen/include/asm-x86/page.h	Tue Sep 11 14:19:29 2012 +0200
+++ b/xen/include/asm-x86/page.h	Tue Sep 11 15:45:20 2012 +0200
@@ -1,6 +1,8 @@
 #ifndef __X86_PAGE_H__
 #define __X86_PAGE_H__
 
+#include <xen/const.h>
+
 /*
  * It is important that the masks are signed quantities. This ensures that
  * the compiler sign-extends a 32-bit mask to 64 bits if that is required.
@@ -306,13 +308,15 @@ extern l2_pgentry_t   idle_pg_table_l2[
 extern l2_pgentry_t  *compat_idle_pg_table_l2;
 extern unsigned int   m2p_compat_vstart;
 extern l2_pgentry_t l2_xenmap[L2_PAGETABLE_ENTRIES],
+    l2_fixmap[L2_PAGETABLE_ENTRIES],
     l2_bootmap[L2_PAGETABLE_ENTRIES];
 extern l3_pgentry_t l3_xenmap[L3_PAGETABLE_ENTRIES],
     l3_identmap[L3_PAGETABLE_ENTRIES],
     l3_bootmap[L3_PAGETABLE_ENTRIES];
 #endif
 extern l2_pgentry_t l2_identmap[4*L2_PAGETABLE_ENTRIES];
-extern l1_pgentry_t l1_identmap[L1_PAGETABLE_ENTRIES];
+extern l1_pgentry_t l1_identmap[L1_PAGETABLE_ENTRIES],
+    l1_fixmap[L1_PAGETABLE_ENTRIES];
 void paging_init(void);
 void setup_idle_pagetable(void);
 #endif /* !defined(__ASSEMBLY__) */
diff -r e4cb84111610 -r 51c2d7c83cbc xen/include/xen/const.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/include/xen/const.h	Tue Sep 11 15:45:20 2012 +0200
@@ -0,0 +1,24 @@
+/* const.h: Macros for dealing with constants.  */
+
+#ifndef __XEN_CONST_H__
+#define __XEN_CONST_H__
+
+/* Some constant macros are used in both assembler and
+ * C code.  Therefore we cannot annotate them always with
+ * 'UL' and other type specifiers unilaterally.  We
+ * use the following macros to deal with this.
+ *
+ * Similarly, _AT() will cast an expression with a type in C, but
+ * leave it unchanged in asm.
+ */
+
+#ifdef __ASSEMBLY__
+#define _AC(X,Y)	X
+#define _AT(T,X)	X
+#else
+#define __AC(X,Y)	(X##Y)
+#define _AC(X,Y)	__AC(X,Y)
+#define _AT(T,X)	((T)(X))
+#endif
+
+#endif /* __XEN_CONST_H__ */

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:28 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYW-0003Qg-Kz; Fri, 14 Sep 2012 10:55:28 +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 1TCTYV-0003OY-Ep
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:27 +0000
Received: from [85.158.137.99:61922] by server-6.bemta-3.messagelabs.com id
	78/10-29694-E1D03505; Fri, 14 Sep 2012 10:55:26 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-217.messagelabs.com!1347620124!14530112!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7180 invoked from network); 14 Sep 2012 10:55:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Sep 2012 10: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 1TCTYS-00013z-0P
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYR-0000kn-VC
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:23 +0000
Message-Id: <E1TCTYR-0000kn-VC@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:23 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] serial: avoid fully initializing
	unused consoles
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347371512 -7200
# Node ID e1380b5311ccee14eb47d7badb75339933d42249
# Parent  0d0c55a1975db9c6cac2e9259b5ebea7a7bdbaec
serial: avoid fully initializing unused consoles

Defer calling the drivers' post-IRQ initialization functions (generally
doing allocation of transmit buffers) until it is known that the
respective console is actually going to be used.

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


diff -r 0d0c55a1975d -r e1380b5311cc xen/drivers/char/ehci-dbgp.c
--- a/xen/drivers/char/ehci-dbgp.c	Tue Sep 11 15:49:52 2012 +0200
+++ b/xen/drivers/char/ehci-dbgp.c	Tue Sep 11 15:51:52 2012 +0200
@@ -1391,7 +1391,8 @@ static int ehci_dbgp_check_release(struc
     printk(XENLOG_INFO "Releasing EHCI debug port at %02x:%02x.%u\n",
            dbgp->bus, dbgp->slot, dbgp->func);
 
-    kill_timer(&dbgp->timer);
+    if ( dbgp->timer.function )
+        kill_timer(&dbgp->timer);
     dbgp->ehci_debug = NULL;
 
     ctrl = readl(&ehci_debug->control);
diff -r 0d0c55a1975d -r e1380b5311cc xen/drivers/char/serial.c
--- a/xen/drivers/char/serial.c	Tue Sep 11 15:49:52 2012 +0200
+++ b/xen/drivers/char/serial.c	Tue Sep 11 15:51:52 2012 +0200
@@ -29,6 +29,8 @@ static struct serial_port com[SERHND_IDX
     }
 };
 
+static bool_t __read_mostly post_irq;
+
 void serial_rx_interrupt(struct serial_port *port, struct cpu_user_regs *regs)
 {
     char c;
@@ -263,14 +265,12 @@ char serial_getc(int handle)
 
 int __init serial_parse_handle(char *conf)
 {
-    int handle;
+    int handle, flags = 0;
 
     if ( !strncmp(conf, "dbgp", 4) && (!conf[4] || conf[4] == ',') )
     {
-        if ( !com[SERHND_DBGP].driver )
-            goto fail;
-
-        return SERHND_DBGP | SERHND_COOKED;
+        handle = SERHND_DBGP;
+        goto common;
     }
 
     if ( strncmp(conf, "com", 3) )
@@ -288,17 +288,25 @@ int __init serial_parse_handle(char *con
         goto fail;
     }
 
+    if ( conf[4] == 'H' )
+        flags |= SERHND_HI;
+    else if ( conf[4] == 'L' )
+        flags |= SERHND_LO;
+
+ common:
     if ( !com[handle].driver )
         goto fail;
 
-    if ( conf[4] == 'H' )
-        handle |= SERHND_HI;
-    else if ( conf[4] == 'L' )
-        handle |= SERHND_LO;
+    if ( !post_irq )
+        com[handle].state = serial_parsed;
+    else if ( com[handle].state != serial_initialized )
+    {
+        if ( com[handle].driver->init_postirq )
+            com[handle].driver->init_postirq(&com[handle]);
+        com[handle].state = serial_initialized;
+    }
 
-    handle |= SERHND_COOKED;
-
-    return handle;
+    return handle | flags | SERHND_COOKED;
 
  fail:
     return -1;
@@ -450,8 +458,13 @@ void __init serial_init_postirq(void)
 {
     int i;
     for ( i = 0; i < ARRAY_SIZE(com); i++ )
-        if ( com[i].driver && com[i].driver->init_postirq )
-            com[i].driver->init_postirq(&com[i]);
+        if ( com[i].state == serial_parsed )
+        {
+            if ( com[i].driver->init_postirq )
+                com[i].driver->init_postirq(&com[i]);
+            com[i].state = serial_initialized;
+        }
+    post_irq = 1;
 }
 
 void __init serial_endboot(void)
@@ -475,7 +488,7 @@ void serial_suspend(void)
 {
     int i;
     for ( i = 0; i < ARRAY_SIZE(com); i++ )
-        if ( com[i].driver && com[i].driver->suspend )
+        if ( com[i].state == serial_initialized && com[i].driver->suspend )
             com[i].driver->suspend(&com[i]);
 }
 
@@ -483,7 +496,7 @@ void serial_resume(void)
 {
     int i;
     for ( i = 0; i < ARRAY_SIZE(com); i++ )
-        if ( com[i].driver && com[i].driver->resume )
+        if ( com[i].state == serial_initialized && com[i].driver->resume )
             com[i].driver->resume(&com[i]);
 }
 
diff -r 0d0c55a1975d -r e1380b5311cc xen/include/xen/serial.h
--- a/xen/include/xen/serial.h	Tue Sep 11 15:49:52 2012 +0200
+++ b/xen/include/xen/serial.h	Tue Sep 11 15:51:52 2012 +0200
@@ -25,10 +25,17 @@ extern unsigned int serial_txbufsz;
 
 struct uart_driver;
 
+enum serial_port_state {
+    serial_unused,
+    serial_parsed,
+    serial_initialized
+};
+
 struct serial_port {
     /* Uart-driver parameters. */
     struct uart_driver *driver;
     void               *uart;
+    enum serial_port_state state;
     /* Number of characters the port can hold for transmit. */
     int                 tx_fifo_size;
     /* Transmit data buffer (interrupt-driven uart). */

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:28 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYW-0003Qg-Kz; Fri, 14 Sep 2012 10:55:28 +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 1TCTYV-0003OY-Ep
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:27 +0000
Received: from [85.158.137.99:61922] by server-6.bemta-3.messagelabs.com id
	78/10-29694-E1D03505; Fri, 14 Sep 2012 10:55:26 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-217.messagelabs.com!1347620124!14530112!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7180 invoked from network); 14 Sep 2012 10:55:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Sep 2012 10: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 1TCTYS-00013z-0P
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYR-0000kn-VC
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:23 +0000
Message-Id: <E1TCTYR-0000kn-VC@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:23 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] serial: avoid fully initializing
	unused consoles
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347371512 -7200
# Node ID e1380b5311ccee14eb47d7badb75339933d42249
# Parent  0d0c55a1975db9c6cac2e9259b5ebea7a7bdbaec
serial: avoid fully initializing unused consoles

Defer calling the drivers' post-IRQ initialization functions (generally
doing allocation of transmit buffers) until it is known that the
respective console is actually going to be used.

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


diff -r 0d0c55a1975d -r e1380b5311cc xen/drivers/char/ehci-dbgp.c
--- a/xen/drivers/char/ehci-dbgp.c	Tue Sep 11 15:49:52 2012 +0200
+++ b/xen/drivers/char/ehci-dbgp.c	Tue Sep 11 15:51:52 2012 +0200
@@ -1391,7 +1391,8 @@ static int ehci_dbgp_check_release(struc
     printk(XENLOG_INFO "Releasing EHCI debug port at %02x:%02x.%u\n",
            dbgp->bus, dbgp->slot, dbgp->func);
 
-    kill_timer(&dbgp->timer);
+    if ( dbgp->timer.function )
+        kill_timer(&dbgp->timer);
     dbgp->ehci_debug = NULL;
 
     ctrl = readl(&ehci_debug->control);
diff -r 0d0c55a1975d -r e1380b5311cc xen/drivers/char/serial.c
--- a/xen/drivers/char/serial.c	Tue Sep 11 15:49:52 2012 +0200
+++ b/xen/drivers/char/serial.c	Tue Sep 11 15:51:52 2012 +0200
@@ -29,6 +29,8 @@ static struct serial_port com[SERHND_IDX
     }
 };
 
+static bool_t __read_mostly post_irq;
+
 void serial_rx_interrupt(struct serial_port *port, struct cpu_user_regs *regs)
 {
     char c;
@@ -263,14 +265,12 @@ char serial_getc(int handle)
 
 int __init serial_parse_handle(char *conf)
 {
-    int handle;
+    int handle, flags = 0;
 
     if ( !strncmp(conf, "dbgp", 4) && (!conf[4] || conf[4] == ',') )
     {
-        if ( !com[SERHND_DBGP].driver )
-            goto fail;
-
-        return SERHND_DBGP | SERHND_COOKED;
+        handle = SERHND_DBGP;
+        goto common;
     }
 
     if ( strncmp(conf, "com", 3) )
@@ -288,17 +288,25 @@ int __init serial_parse_handle(char *con
         goto fail;
     }
 
+    if ( conf[4] == 'H' )
+        flags |= SERHND_HI;
+    else if ( conf[4] == 'L' )
+        flags |= SERHND_LO;
+
+ common:
     if ( !com[handle].driver )
         goto fail;
 
-    if ( conf[4] == 'H' )
-        handle |= SERHND_HI;
-    else if ( conf[4] == 'L' )
-        handle |= SERHND_LO;
+    if ( !post_irq )
+        com[handle].state = serial_parsed;
+    else if ( com[handle].state != serial_initialized )
+    {
+        if ( com[handle].driver->init_postirq )
+            com[handle].driver->init_postirq(&com[handle]);
+        com[handle].state = serial_initialized;
+    }
 
-    handle |= SERHND_COOKED;
-
-    return handle;
+    return handle | flags | SERHND_COOKED;
 
  fail:
     return -1;
@@ -450,8 +458,13 @@ void __init serial_init_postirq(void)
 {
     int i;
     for ( i = 0; i < ARRAY_SIZE(com); i++ )
-        if ( com[i].driver && com[i].driver->init_postirq )
-            com[i].driver->init_postirq(&com[i]);
+        if ( com[i].state == serial_parsed )
+        {
+            if ( com[i].driver->init_postirq )
+                com[i].driver->init_postirq(&com[i]);
+            com[i].state = serial_initialized;
+        }
+    post_irq = 1;
 }
 
 void __init serial_endboot(void)
@@ -475,7 +488,7 @@ void serial_suspend(void)
 {
     int i;
     for ( i = 0; i < ARRAY_SIZE(com); i++ )
-        if ( com[i].driver && com[i].driver->suspend )
+        if ( com[i].state == serial_initialized && com[i].driver->suspend )
             com[i].driver->suspend(&com[i]);
 }
 
@@ -483,7 +496,7 @@ void serial_resume(void)
 {
     int i;
     for ( i = 0; i < ARRAY_SIZE(com); i++ )
-        if ( com[i].driver && com[i].driver->resume )
+        if ( com[i].state == serial_initialized && com[i].driver->resume )
             com[i].driver->resume(&com[i]);
 }
 
diff -r 0d0c55a1975d -r e1380b5311cc xen/include/xen/serial.h
--- a/xen/include/xen/serial.h	Tue Sep 11 15:49:52 2012 +0200
+++ b/xen/include/xen/serial.h	Tue Sep 11 15:51:52 2012 +0200
@@ -25,10 +25,17 @@ extern unsigned int serial_txbufsz;
 
 struct uart_driver;
 
+enum serial_port_state {
+    serial_unused,
+    serial_parsed,
+    serial_initialized
+};
+
 struct serial_port {
     /* Uart-driver parameters. */
     struct uart_driver *driver;
     void               *uart;
+    enum serial_port_state state;
     /* Number of characters the port can hold for transmit. */
     int                 tx_fifo_size;
     /* Transmit data buffer (interrupt-driven uart). */

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:30 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYX-0003SF-Nt; Fri, 14 Sep 2012 10:55:29 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYW-0003Q9-IW
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:28 +0000
Received: from [85.158.143.35:40298] by server-1.bemta-4.messagelabs.com id
	61/97-12504-F1D03505; Fri, 14 Sep 2012 10:55:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-21.messagelabs.com!1347620125!12430225!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22548 invoked from network); 14 Sep 2012 10:55:26 -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;
	14 Sep 2012 10: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 1TCTYT-000148-3B
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYT-0000lH-1m
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:25 +0000
Message-Id: <E1TCTYT-0000lH-1m@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:24 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] ns16550: PCI initialization
	adjustments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347371733 -7200
# Node ID ee12dc357fbecbb0517798f395d14bf1764c6766
# Parent  5fb5b3b70e34ef278d06aff27878b4b8e6d9145f
ns16550: PCI initialization adjustments

Besides single-port serial cards, also accept multi-port ones and such
providing mixed functionality (e.g. also having a parallel port).

Reading PCI_INTERRUPT_PIN before ACPI gets enabled generally produces
an incorrect IRQ (below 16, whereas after enabling ACPI it frequently
would end up at a higher one), so this is useful (almost) only when a
system already boots in ACPI mode.

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


diff -r 5fb5b3b70e34 -r ee12dc357fbe xen/drivers/char/ns16550.c
--- a/xen/drivers/char/ns16550.c	Tue Sep 11 15:52:36 2012 +0200
+++ b/xen/drivers/char/ns16550.c	Tue Sep 11 15:55:33 2012 +0200
@@ -468,7 +468,6 @@ static int __init check_existence(struct
 static int
 pci_uart_config (struct ns16550 *uart, int skip_amt, int bar_idx)
 {
-    uint16_t class;
     uint32_t bar, len;
     int b, d, f;
 
@@ -479,9 +478,15 @@ pci_uart_config (struct ns16550 *uart, i
         {
             for ( f = 0; f < 0x8; f++ )
             {
-                class = pci_conf_read16(0, b, d, f, PCI_CLASS_DEVICE);
-                if ( class != 0x700 )
+                switch ( pci_conf_read16(0, b, d, f, PCI_CLASS_DEVICE) )
+                {
+                case 0x0700: /* single port serial */
+                case 0x0702: /* multi port serial */
+                case 0x0780: /* other (e.g serial+parallel) */
+                    break;
+                default:
                     continue;
+                }
 
                 bar = pci_conf_read32(0, b, d, f,
                                       PCI_BASE_ADDRESS_0 + bar_idx*4);
@@ -504,7 +509,8 @@ pci_uart_config (struct ns16550 *uart, i
                 uart->bar = bar;
                 uart->bar_idx = bar_idx;
                 uart->io_base = bar & ~PCI_BASE_ADDRESS_SPACE_IO;
-                uart->irq = 0;
+                uart->irq = pci_conf_read8(0, b, d, f, PCI_INTERRUPT_PIN) ?
+                    pci_conf_read8(0, b, d, f, PCI_INTERRUPT_LINE) : 0;
 
                 return 0;
             }

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:30 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYX-0003SF-Nt; Fri, 14 Sep 2012 10:55:29 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYW-0003Q9-IW
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:28 +0000
Received: from [85.158.143.35:40298] by server-1.bemta-4.messagelabs.com id
	61/97-12504-F1D03505; Fri, 14 Sep 2012 10:55:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-21.messagelabs.com!1347620125!12430225!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22548 invoked from network); 14 Sep 2012 10:55:26 -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;
	14 Sep 2012 10: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 1TCTYT-000148-3B
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYT-0000lH-1m
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:25 +0000
Message-Id: <E1TCTYT-0000lH-1m@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:24 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] ns16550: PCI initialization
	adjustments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347371733 -7200
# Node ID ee12dc357fbecbb0517798f395d14bf1764c6766
# Parent  5fb5b3b70e34ef278d06aff27878b4b8e6d9145f
ns16550: PCI initialization adjustments

Besides single-port serial cards, also accept multi-port ones and such
providing mixed functionality (e.g. also having a parallel port).

Reading PCI_INTERRUPT_PIN before ACPI gets enabled generally produces
an incorrect IRQ (below 16, whereas after enabling ACPI it frequently
would end up at a higher one), so this is useful (almost) only when a
system already boots in ACPI mode.

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


diff -r 5fb5b3b70e34 -r ee12dc357fbe xen/drivers/char/ns16550.c
--- a/xen/drivers/char/ns16550.c	Tue Sep 11 15:52:36 2012 +0200
+++ b/xen/drivers/char/ns16550.c	Tue Sep 11 15:55:33 2012 +0200
@@ -468,7 +468,6 @@ static int __init check_existence(struct
 static int
 pci_uart_config (struct ns16550 *uart, int skip_amt, int bar_idx)
 {
-    uint16_t class;
     uint32_t bar, len;
     int b, d, f;
 
@@ -479,9 +478,15 @@ pci_uart_config (struct ns16550 *uart, i
         {
             for ( f = 0; f < 0x8; f++ )
             {
-                class = pci_conf_read16(0, b, d, f, PCI_CLASS_DEVICE);
-                if ( class != 0x700 )
+                switch ( pci_conf_read16(0, b, d, f, PCI_CLASS_DEVICE) )
+                {
+                case 0x0700: /* single port serial */
+                case 0x0702: /* multi port serial */
+                case 0x0780: /* other (e.g serial+parallel) */
+                    break;
+                default:
                     continue;
+                }
 
                 bar = pci_conf_read32(0, b, d, f,
                                       PCI_BASE_ADDRESS_0 + bar_idx*4);
@@ -504,7 +509,8 @@ pci_uart_config (struct ns16550 *uart, i
                 uart->bar = bar;
                 uart->bar_idx = bar_idx;
                 uart->io_base = bar & ~PCI_BASE_ADDRESS_SPACE_IO;
-                uart->irq = 0;
+                uart->irq = pci_conf_read8(0, b, d, f, PCI_INTERRUPT_PIN) ?
+                    pci_conf_read8(0, b, d, f, PCI_INTERRUPT_LINE) : 0;
 
                 return 0;
             }

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:31 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYY-0003Tl-R0; Fri, 14 Sep 2012 10:55:30 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYX-0003Q9-OP
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:29 +0000
Received: from [85.158.143.35:40347] by server-1.bemta-4.messagelabs.com id
	DB/97-12504-12D03505; Fri, 14 Sep 2012 10:55:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-21.messagelabs.com!1347620126!14631659!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11797 invoked from network); 14 Sep 2012 10:55:28 -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;
	14 Sep 2012 10: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 1TCTYU-00014Y-PB
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYU-0000m0-Nt
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:26 +0000
Message-Id: <E1TCTYU-0000m0-Nt@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:26 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] PCI: bus scan adjustments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347371983 -7200
# Node ID 59b3663316db97d2e5d25501438a8b93d0cb287a
# Parent  9b5e0952ba7c9e6c57e37366f582ec0241fb378e
PCI: bus scan adjustments

As done elsewhere, the ns16550 code shouldn't look at non-zero
functions of a device if that isn't multi-function.

Also both there and in pass-through's _scan_pci_devices() skip looking
at non-zero functions when the device at function zero doesn't exist.

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


diff -r 9b5e0952ba7c -r 59b3663316db xen/drivers/char/ns16550.c
--- a/xen/drivers/char/ns16550.c	Tue Sep 11 15:57:38 2012 +0200
+++ b/xen/drivers/char/ns16550.c	Tue Sep 11 15:59:43 2012 +0200
@@ -470,21 +470,28 @@ static int
 pci_uart_config (struct ns16550 *uart, int skip_amt, int bar_idx)
 {
     uint32_t bar, len;
-    int b, d, f;
+    int b, d, f, nextf;
 
     /* NB. Start at bus 1 to avoid AMT: a plug-in card cannot be on bus 0. */
     for ( b = skip_amt ? 1 : 0; b < 0x100; b++ )
     {
         for ( d = 0; d < 0x20; d++ )
         {
-            for ( f = 0; f < 0x8; f++ )
+            for ( f = 0; f < 8; f = nextf )
             {
+                nextf = (f || (pci_conf_read16(0, b, d, f, PCI_HEADER_TYPE) &
+                               0x80)) ? f + 1 : 8;
+
                 switch ( pci_conf_read16(0, b, d, f, PCI_CLASS_DEVICE) )
                 {
                 case 0x0700: /* single port serial */
                 case 0x0702: /* multi port serial */
                 case 0x0780: /* other (e.g serial+parallel) */
                     break;
+                case 0xffff:
+                    if ( !f )
+                        nextf = 8;
+                    /* fall through */
                 default:
                     continue;
                 }
diff -r 9b5e0952ba7c -r 59b3663316db xen/drivers/passthrough/pci.c
--- a/xen/drivers/passthrough/pci.c	Tue Sep 11 15:57:38 2012 +0200
+++ b/xen/drivers/passthrough/pci.c	Tue Sep 11 15:59:43 2012 +0200
@@ -665,7 +665,11 @@ static int __init _scan_pci_devices(stru
             for ( func = 0; func < 8; func++ )
             {
                 if ( pci_device_detect(pseg->nr, bus, dev, func) == 0 )
+                {
+                    if ( !func )
+                        break;
                     continue;
+                }
 
                 pdev = alloc_pdev(pseg, bus, PCI_DEVFN(dev, func));
                 if ( !pdev )

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:31 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYY-0003Tl-R0; Fri, 14 Sep 2012 10:55:30 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYX-0003Q9-OP
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:29 +0000
Received: from [85.158.143.35:40347] by server-1.bemta-4.messagelabs.com id
	DB/97-12504-12D03505; Fri, 14 Sep 2012 10:55:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-21.messagelabs.com!1347620126!14631659!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11797 invoked from network); 14 Sep 2012 10:55:28 -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;
	14 Sep 2012 10: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 1TCTYU-00014Y-PB
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYU-0000m0-Nt
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:26 +0000
Message-Id: <E1TCTYU-0000m0-Nt@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:26 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] PCI: bus scan adjustments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347371983 -7200
# Node ID 59b3663316db97d2e5d25501438a8b93d0cb287a
# Parent  9b5e0952ba7c9e6c57e37366f582ec0241fb378e
PCI: bus scan adjustments

As done elsewhere, the ns16550 code shouldn't look at non-zero
functions of a device if that isn't multi-function.

Also both there and in pass-through's _scan_pci_devices() skip looking
at non-zero functions when the device at function zero doesn't exist.

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


diff -r 9b5e0952ba7c -r 59b3663316db xen/drivers/char/ns16550.c
--- a/xen/drivers/char/ns16550.c	Tue Sep 11 15:57:38 2012 +0200
+++ b/xen/drivers/char/ns16550.c	Tue Sep 11 15:59:43 2012 +0200
@@ -470,21 +470,28 @@ static int
 pci_uart_config (struct ns16550 *uart, int skip_amt, int bar_idx)
 {
     uint32_t bar, len;
-    int b, d, f;
+    int b, d, f, nextf;
 
     /* NB. Start at bus 1 to avoid AMT: a plug-in card cannot be on bus 0. */
     for ( b = skip_amt ? 1 : 0; b < 0x100; b++ )
     {
         for ( d = 0; d < 0x20; d++ )
         {
-            for ( f = 0; f < 0x8; f++ )
+            for ( f = 0; f < 8; f = nextf )
             {
+                nextf = (f || (pci_conf_read16(0, b, d, f, PCI_HEADER_TYPE) &
+                               0x80)) ? f + 1 : 8;
+
                 switch ( pci_conf_read16(0, b, d, f, PCI_CLASS_DEVICE) )
                 {
                 case 0x0700: /* single port serial */
                 case 0x0702: /* multi port serial */
                 case 0x0780: /* other (e.g serial+parallel) */
                     break;
+                case 0xffff:
+                    if ( !f )
+                        nextf = 8;
+                    /* fall through */
                 default:
                     continue;
                 }
diff -r 9b5e0952ba7c -r 59b3663316db xen/drivers/passthrough/pci.c
--- a/xen/drivers/passthrough/pci.c	Tue Sep 11 15:57:38 2012 +0200
+++ b/xen/drivers/passthrough/pci.c	Tue Sep 11 15:59:43 2012 +0200
@@ -665,7 +665,11 @@ static int __init _scan_pci_devices(stru
             for ( func = 0; func < 8; func++ )
             {
                 if ( pci_device_detect(pseg->nr, bus, dev, func) == 0 )
+                {
+                    if ( !func )
+                        break;
                     continue;
+                }
 
                 pdev = alloc_pdev(pseg, bus, PCI_DEVFN(dev, func));
                 if ( !pdev )

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:32 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYa-0003VM-2f; Fri, 14 Sep 2012 10:55:32 +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 1TCTYY-0003OY-EQ
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:30 +0000
Received: from [85.158.138.51:30643] by server-6.bemta-3.messagelabs.com id
	99/30-29694-22D03505; Fri, 14 Sep 2012 10:55:30 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-174.messagelabs.com!1347620127!21663547!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27287 invoked from network); 14 Sep 2012 10:55:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Sep 2012 10: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 1TCTYV-00014e-Bl
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYV-0000mF-AM
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:27 +0000
Message-Id: <E1TCTYV-0000mF-AM@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:26 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] PCI: don't allow guest assignment of
	devices used by Xen
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347372075 -7200
# Node ID 47e6725ec6f2b5d129f928ffa2ed4eb19d1095a3
# Parent  59b3663316db97d2e5d25501438a8b93d0cb287a
PCI: don't allow guest assignment of devices used by Xen

This covers the devices used for the console and the AMD IOMMU ones (as
would be any others that might get passed to pci_ro_device()).

Boot video device determination cloned from similar Linux logic.

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


diff -r 59b3663316db -r 47e6725ec6f2 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Tue Sep 11 15:59:43 2012 +0200
+++ b/xen/arch/x86/mm.c	Tue Sep 11 16:01:15 2012 +0200
@@ -311,9 +311,12 @@ void __init arch_init_memory(void)
      * Initialise our DOMID_XEN domain.
      * Any Xen-heap pages that we will allow to be mapped will have
      * their domain field set to dom_xen.
+     * Hidden PCI devices will also be associated with this domain
+     * (but be [partly] controlled by Dom0 nevertheless).
      */
     dom_xen = domain_create(DOMID_XEN, DOMCRF_dummy, 0);
     BUG_ON(IS_ERR(dom_xen));
+    INIT_LIST_HEAD(&dom_xen->arch.pdev_list);
 
     /*
      * Initialise our DOMID_IO domain.
diff -r 59b3663316db -r 47e6725ec6f2 xen/drivers/char/ehci-dbgp.c
--- a/xen/drivers/char/ehci-dbgp.c	Tue Sep 11 15:59:43 2012 +0200
+++ b/xen/drivers/char/ehci-dbgp.c	Tue Sep 11 16:01:15 2012 +0200
@@ -1364,6 +1364,8 @@ static void __init ehci_dbgp_init_postir
     init_timer(&dbgp->timer, ehci_dbgp_poll, port, 0);
 
     ehci_dbgp_setup_postirq(dbgp);
+
+    pci_hide_device(dbgp->bus, PCI_DEVFN(dbgp->slot, dbgp->func));
 }
 
 static int ehci_dbgp_check_release(struct ehci_dbgp *dbgp)
diff -r 59b3663316db -r 47e6725ec6f2 xen/drivers/char/ns16550.c
--- a/xen/drivers/char/ns16550.c	Tue Sep 11 15:59:43 2012 +0200
+++ b/xen/drivers/char/ns16550.c	Tue Sep 11 16:01:15 2012 +0200
@@ -334,6 +334,10 @@ static void __init ns16550_init_postirq(
     }
 
     ns16550_setup_postirq(uart);
+
+    if ( uart->bar || uart->ps_bdf_enable )
+        pci_hide_device(uart->ps_bdf[0], PCI_DEVFN(uart->ps_bdf[1],
+                                                   uart->ps_bdf[2]));
 }
 
 static void ns16550_suspend(struct serial_port *port)
diff -r 59b3663316db -r 47e6725ec6f2 xen/drivers/passthrough/iommu.c
--- a/xen/drivers/passthrough/iommu.c	Tue Sep 11 15:59:43 2012 +0200
+++ b/xen/drivers/passthrough/iommu.c	Tue Sep 11 16:01:15 2012 +0200
@@ -208,7 +208,7 @@ static int device_assigned(u16 seg, u8 b
     pdev = pci_get_pdev_by_domain(dom0, seg, bus, devfn);
     spin_unlock(&pcidevs_lock);
 
-    return pdev ? 0 : -1;
+    return pdev ? 0 : -EBUSY;
 }
 
 static int assign_device(struct domain *d, u16 seg, u8 bus, u8 devfn)
@@ -614,7 +614,8 @@ int iommu_do_domctl(
         bus = (domctl->u.assign_device.machine_sbdf >> 8) & 0xff;
         devfn = domctl->u.assign_device.machine_sbdf & 0xff;
 
-        ret = assign_device(d, seg, bus, devfn);
+        ret = device_assigned(seg, bus, devfn) ?:
+              assign_device(d, seg, bus, devfn);
         if ( ret )
             printk(XENLOG_G_ERR "XEN_DOMCTL_assign_device: "
                    "assign %04x:%02x:%02x.%u to dom%d failed (%d)\n",
diff -r 59b3663316db -r 47e6725ec6f2 xen/drivers/passthrough/pci.c
--- a/xen/drivers/passthrough/pci.c	Tue Sep 11 15:59:43 2012 +0200
+++ b/xen/drivers/passthrough/pci.c	Tue Sep 11 16:01:15 2012 +0200
@@ -208,6 +208,31 @@ static void free_pdev(struct pci_seg *ps
     xfree(pdev);
 }
 
+static void _pci_hide_device(struct pci_dev *pdev)
+{
+    if ( pdev->domain )
+        return;
+    pdev->domain = dom_xen;
+    list_add(&pdev->domain_list, &dom_xen->arch.pdev_list);
+}
+
+int __init pci_hide_device(int bus, int devfn)
+{
+    struct pci_dev *pdev;
+    int rc = -ENOMEM;
+
+    spin_lock(&pcidevs_lock);
+    pdev = alloc_pdev(get_pseg(0), bus, devfn);
+    if ( pdev )
+    {
+        _pci_hide_device(pdev);
+        rc = 0;
+    }
+    spin_unlock(&pcidevs_lock);
+
+    return rc;
+}
+
 int __init pci_ro_device(int seg, int bus, int devfn)
 {
     struct pci_seg *pseg = alloc_pseg(seg);
@@ -231,6 +256,7 @@ int __init pci_ro_device(int seg, int bu
 
     __set_bit(PCI_BDF2(bus, devfn), pseg->ro_map);
     arch_pci_ro_device(seg, PCI_BDF2(bus, devfn));
+    _pci_hide_device(pdev);
 
     return 0;
 }
@@ -718,9 +744,22 @@ static int __init _setup_dom0_pci_device
             if ( !pdev )
                 continue;
 
-            pdev->domain = ctxt->d;
-            list_add(&pdev->domain_list, &ctxt->d->arch.pdev_list);
-            ctxt->handler(pdev);
+            if ( !pdev->domain )
+            {
+                pdev->domain = ctxt->d;
+                list_add(&pdev->domain_list, &ctxt->d->arch.pdev_list);
+                ctxt->handler(pdev);
+            }
+            else if ( pdev->domain == dom_xen )
+            {
+                pdev->domain = ctxt->d;
+                ctxt->handler(pdev);
+                pdev->domain = dom_xen;
+            }
+            else if ( pdev->domain != ctxt->d )
+                printk(XENLOG_WARNING "Dom%d owning %04x:%02x:%02x.%u?\n",
+                       pdev->domain->domain_id, pseg->nr, bus,
+                       PCI_SLOT(devfn), PCI_FUNC(devfn));
         }
     }
 
diff -r 59b3663316db -r 47e6725ec6f2 xen/drivers/video/vga.c
--- a/xen/drivers/video/vga.c	Tue Sep 11 15:59:43 2012 +0200
+++ b/xen/drivers/video/vga.c	Tue Sep 11 16:01:15 2012 +0200
@@ -9,6 +9,7 @@
 #include <xen/lib.h>
 #include <xen/mm.h>
 #include <xen/vga.h>
+#include <xen/pci.h>
 #include <asm/io.h>
 
 /* Filled in by arch boot code. */
@@ -106,6 +107,61 @@ void __init vga_endboot(void)
 
     if ( !vgacon_keep )
         vga_puts = vga_noop_puts;
+    else
+    {
+        int bus, devfn;
+
+        for ( bus = 0; bus < 256; ++bus )
+            for ( devfn = 0; devfn < 256; ++devfn )
+            {
+                const struct pci_dev *pdev;
+                u8 b = bus, df = devfn, sb;
+
+                spin_lock(&pcidevs_lock);
+                pdev = pci_get_pdev(0, bus, devfn);
+                spin_unlock(&pcidevs_lock);
+
+                if ( !pdev ||
+                     pci_conf_read16(0, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
+                                     PCI_CLASS_DEVICE) != 0x0300 ||
+                     !(pci_conf_read16(0, bus, PCI_SLOT(devfn),
+                                       PCI_FUNC(devfn), PCI_COMMAND) &
+                       (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) )
+                    continue;
+
+                while ( b )
+                {
+                    switch ( find_upstream_bridge(0, &b, &df, &sb) )
+                    {
+                    case 0:
+                        b = 0;
+                        break;
+                    case 1:
+                        switch ( pci_conf_read8(0, b, PCI_SLOT(df),
+                                                PCI_FUNC(df),
+                                                PCI_HEADER_TYPE) )
+                        {
+                        case PCI_HEADER_TYPE_BRIDGE:
+                        case PCI_HEADER_TYPE_CARDBUS:
+                            if ( pci_conf_read16(0, b, PCI_SLOT(df),
+                                                 PCI_FUNC(df),
+                                                 PCI_BRIDGE_CONTROL) &
+                                 PCI_BRIDGE_CTL_VGA )
+                                continue;
+                            break;
+                        }
+                        break;
+                    }
+                    break;
+                }
+                if ( !b )
+                {
+                    printk(XENLOG_INFO "Boot video device %02x:%02x.%u\n",
+                           bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
+                    pci_hide_device(bus, devfn);
+                }
+            }
+    }
 
     switch ( vga_console_info.video_type )
     {
diff -r 59b3663316db -r 47e6725ec6f2 xen/include/xen/pci.h
--- a/xen/include/xen/pci.h	Tue Sep 11 15:59:43 2012 +0200
+++ b/xen/include/xen/pci.h	Tue Sep 11 16:01:15 2012 +0200
@@ -103,6 +103,7 @@ int pci_add_device(u16 seg, u8 bus, u8 d
 int pci_remove_device(u16 seg, u8 bus, u8 devfn);
 int pci_ro_device(int seg, int bus, int devfn);
 void arch_pci_ro_device(int seg, int bdf);
+int pci_hide_device(int bus, int devfn);
 struct pci_dev *pci_get_pdev(int seg, int bus, int devfn);
 struct pci_dev *pci_get_pdev_by_domain(
     struct domain *, int seg, int bus, int devfn);

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:32 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYa-0003VM-2f; Fri, 14 Sep 2012 10:55:32 +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 1TCTYY-0003OY-EQ
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:30 +0000
Received: from [85.158.138.51:30643] by server-6.bemta-3.messagelabs.com id
	99/30-29694-22D03505; Fri, 14 Sep 2012 10:55:30 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-174.messagelabs.com!1347620127!21663547!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27287 invoked from network); 14 Sep 2012 10:55:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Sep 2012 10: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 1TCTYV-00014e-Bl
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYV-0000mF-AM
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:27 +0000
Message-Id: <E1TCTYV-0000mF-AM@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:26 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] PCI: don't allow guest assignment of
	devices used by Xen
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347372075 -7200
# Node ID 47e6725ec6f2b5d129f928ffa2ed4eb19d1095a3
# Parent  59b3663316db97d2e5d25501438a8b93d0cb287a
PCI: don't allow guest assignment of devices used by Xen

This covers the devices used for the console and the AMD IOMMU ones (as
would be any others that might get passed to pci_ro_device()).

Boot video device determination cloned from similar Linux logic.

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


diff -r 59b3663316db -r 47e6725ec6f2 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Tue Sep 11 15:59:43 2012 +0200
+++ b/xen/arch/x86/mm.c	Tue Sep 11 16:01:15 2012 +0200
@@ -311,9 +311,12 @@ void __init arch_init_memory(void)
      * Initialise our DOMID_XEN domain.
      * Any Xen-heap pages that we will allow to be mapped will have
      * their domain field set to dom_xen.
+     * Hidden PCI devices will also be associated with this domain
+     * (but be [partly] controlled by Dom0 nevertheless).
      */
     dom_xen = domain_create(DOMID_XEN, DOMCRF_dummy, 0);
     BUG_ON(IS_ERR(dom_xen));
+    INIT_LIST_HEAD(&dom_xen->arch.pdev_list);
 
     /*
      * Initialise our DOMID_IO domain.
diff -r 59b3663316db -r 47e6725ec6f2 xen/drivers/char/ehci-dbgp.c
--- a/xen/drivers/char/ehci-dbgp.c	Tue Sep 11 15:59:43 2012 +0200
+++ b/xen/drivers/char/ehci-dbgp.c	Tue Sep 11 16:01:15 2012 +0200
@@ -1364,6 +1364,8 @@ static void __init ehci_dbgp_init_postir
     init_timer(&dbgp->timer, ehci_dbgp_poll, port, 0);
 
     ehci_dbgp_setup_postirq(dbgp);
+
+    pci_hide_device(dbgp->bus, PCI_DEVFN(dbgp->slot, dbgp->func));
 }
 
 static int ehci_dbgp_check_release(struct ehci_dbgp *dbgp)
diff -r 59b3663316db -r 47e6725ec6f2 xen/drivers/char/ns16550.c
--- a/xen/drivers/char/ns16550.c	Tue Sep 11 15:59:43 2012 +0200
+++ b/xen/drivers/char/ns16550.c	Tue Sep 11 16:01:15 2012 +0200
@@ -334,6 +334,10 @@ static void __init ns16550_init_postirq(
     }
 
     ns16550_setup_postirq(uart);
+
+    if ( uart->bar || uart->ps_bdf_enable )
+        pci_hide_device(uart->ps_bdf[0], PCI_DEVFN(uart->ps_bdf[1],
+                                                   uart->ps_bdf[2]));
 }
 
 static void ns16550_suspend(struct serial_port *port)
diff -r 59b3663316db -r 47e6725ec6f2 xen/drivers/passthrough/iommu.c
--- a/xen/drivers/passthrough/iommu.c	Tue Sep 11 15:59:43 2012 +0200
+++ b/xen/drivers/passthrough/iommu.c	Tue Sep 11 16:01:15 2012 +0200
@@ -208,7 +208,7 @@ static int device_assigned(u16 seg, u8 b
     pdev = pci_get_pdev_by_domain(dom0, seg, bus, devfn);
     spin_unlock(&pcidevs_lock);
 
-    return pdev ? 0 : -1;
+    return pdev ? 0 : -EBUSY;
 }
 
 static int assign_device(struct domain *d, u16 seg, u8 bus, u8 devfn)
@@ -614,7 +614,8 @@ int iommu_do_domctl(
         bus = (domctl->u.assign_device.machine_sbdf >> 8) & 0xff;
         devfn = domctl->u.assign_device.machine_sbdf & 0xff;
 
-        ret = assign_device(d, seg, bus, devfn);
+        ret = device_assigned(seg, bus, devfn) ?:
+              assign_device(d, seg, bus, devfn);
         if ( ret )
             printk(XENLOG_G_ERR "XEN_DOMCTL_assign_device: "
                    "assign %04x:%02x:%02x.%u to dom%d failed (%d)\n",
diff -r 59b3663316db -r 47e6725ec6f2 xen/drivers/passthrough/pci.c
--- a/xen/drivers/passthrough/pci.c	Tue Sep 11 15:59:43 2012 +0200
+++ b/xen/drivers/passthrough/pci.c	Tue Sep 11 16:01:15 2012 +0200
@@ -208,6 +208,31 @@ static void free_pdev(struct pci_seg *ps
     xfree(pdev);
 }
 
+static void _pci_hide_device(struct pci_dev *pdev)
+{
+    if ( pdev->domain )
+        return;
+    pdev->domain = dom_xen;
+    list_add(&pdev->domain_list, &dom_xen->arch.pdev_list);
+}
+
+int __init pci_hide_device(int bus, int devfn)
+{
+    struct pci_dev *pdev;
+    int rc = -ENOMEM;
+
+    spin_lock(&pcidevs_lock);
+    pdev = alloc_pdev(get_pseg(0), bus, devfn);
+    if ( pdev )
+    {
+        _pci_hide_device(pdev);
+        rc = 0;
+    }
+    spin_unlock(&pcidevs_lock);
+
+    return rc;
+}
+
 int __init pci_ro_device(int seg, int bus, int devfn)
 {
     struct pci_seg *pseg = alloc_pseg(seg);
@@ -231,6 +256,7 @@ int __init pci_ro_device(int seg, int bu
 
     __set_bit(PCI_BDF2(bus, devfn), pseg->ro_map);
     arch_pci_ro_device(seg, PCI_BDF2(bus, devfn));
+    _pci_hide_device(pdev);
 
     return 0;
 }
@@ -718,9 +744,22 @@ static int __init _setup_dom0_pci_device
             if ( !pdev )
                 continue;
 
-            pdev->domain = ctxt->d;
-            list_add(&pdev->domain_list, &ctxt->d->arch.pdev_list);
-            ctxt->handler(pdev);
+            if ( !pdev->domain )
+            {
+                pdev->domain = ctxt->d;
+                list_add(&pdev->domain_list, &ctxt->d->arch.pdev_list);
+                ctxt->handler(pdev);
+            }
+            else if ( pdev->domain == dom_xen )
+            {
+                pdev->domain = ctxt->d;
+                ctxt->handler(pdev);
+                pdev->domain = dom_xen;
+            }
+            else if ( pdev->domain != ctxt->d )
+                printk(XENLOG_WARNING "Dom%d owning %04x:%02x:%02x.%u?\n",
+                       pdev->domain->domain_id, pseg->nr, bus,
+                       PCI_SLOT(devfn), PCI_FUNC(devfn));
         }
     }
 
diff -r 59b3663316db -r 47e6725ec6f2 xen/drivers/video/vga.c
--- a/xen/drivers/video/vga.c	Tue Sep 11 15:59:43 2012 +0200
+++ b/xen/drivers/video/vga.c	Tue Sep 11 16:01:15 2012 +0200
@@ -9,6 +9,7 @@
 #include <xen/lib.h>
 #include <xen/mm.h>
 #include <xen/vga.h>
+#include <xen/pci.h>
 #include <asm/io.h>
 
 /* Filled in by arch boot code. */
@@ -106,6 +107,61 @@ void __init vga_endboot(void)
 
     if ( !vgacon_keep )
         vga_puts = vga_noop_puts;
+    else
+    {
+        int bus, devfn;
+
+        for ( bus = 0; bus < 256; ++bus )
+            for ( devfn = 0; devfn < 256; ++devfn )
+            {
+                const struct pci_dev *pdev;
+                u8 b = bus, df = devfn, sb;
+
+                spin_lock(&pcidevs_lock);
+                pdev = pci_get_pdev(0, bus, devfn);
+                spin_unlock(&pcidevs_lock);
+
+                if ( !pdev ||
+                     pci_conf_read16(0, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
+                                     PCI_CLASS_DEVICE) != 0x0300 ||
+                     !(pci_conf_read16(0, bus, PCI_SLOT(devfn),
+                                       PCI_FUNC(devfn), PCI_COMMAND) &
+                       (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) )
+                    continue;
+
+                while ( b )
+                {
+                    switch ( find_upstream_bridge(0, &b, &df, &sb) )
+                    {
+                    case 0:
+                        b = 0;
+                        break;
+                    case 1:
+                        switch ( pci_conf_read8(0, b, PCI_SLOT(df),
+                                                PCI_FUNC(df),
+                                                PCI_HEADER_TYPE) )
+                        {
+                        case PCI_HEADER_TYPE_BRIDGE:
+                        case PCI_HEADER_TYPE_CARDBUS:
+                            if ( pci_conf_read16(0, b, PCI_SLOT(df),
+                                                 PCI_FUNC(df),
+                                                 PCI_BRIDGE_CONTROL) &
+                                 PCI_BRIDGE_CTL_VGA )
+                                continue;
+                            break;
+                        }
+                        break;
+                    }
+                    break;
+                }
+                if ( !b )
+                {
+                    printk(XENLOG_INFO "Boot video device %02x:%02x.%u\n",
+                           bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
+                    pci_hide_device(bus, devfn);
+                }
+            }
+    }
 
     switch ( vga_console_info.video_type )
     {
diff -r 59b3663316db -r 47e6725ec6f2 xen/include/xen/pci.h
--- a/xen/include/xen/pci.h	Tue Sep 11 15:59:43 2012 +0200
+++ b/xen/include/xen/pci.h	Tue Sep 11 16:01:15 2012 +0200
@@ -103,6 +103,7 @@ int pci_add_device(u16 seg, u8 bus, u8 d
 int pci_remove_device(u16 seg, u8 bus, u8 devfn);
 int pci_ro_device(int seg, int bus, int devfn);
 void arch_pci_ro_device(int seg, int bdf);
+int pci_hide_device(int bus, int devfn);
 struct pci_dev *pci_get_pdev(int seg, int bus, int devfn);
 struct pci_dev *pci_get_pdev_by_domain(
     struct domain *, int seg, int bus, int devfn);

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:32 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYZ-0003V1-TY; Fri, 14 Sep 2012 10:55:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYX-0003Qq-Tm
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:30 +0000
Received: from [85.158.139.83:2827] by server-4.bemta-5.messagelabs.com id
	CD/6C-23042-02D03505; Fri, 14 Sep 2012 10:55:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-182.messagelabs.com!1347620125!30776640!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18055 invoked from network); 14 Sep 2012 10:55:27 -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;
	14 Sep 2012 10: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 1TCTYT-00014J-ML
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYT-0000lW-KK
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:25 +0000
Message-Id: <E1TCTYT-0000lW-KK@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:25 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] ns16550: command line parsing
	adjustments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347371805 -7200
# Node ID b22f184e1a3cac03abeed92ec4b74235fd0881f4
# Parent  ee12dc357fbecbb0517798f395d14bf1764c6766
ns16550: command line parsing adjustments

Allow intermediate parts of the command line options to be absent
(expressed by two immediately succeeding commas).

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


diff -r ee12dc357fbe -r b22f184e1a3c docs/misc/xen-command-line.markdown
--- a/docs/misc/xen-command-line.markdown	Tue Sep 11 15:55:33 2012 +0200
+++ b/docs/misc/xen-command-line.markdown	Tue Sep 11 15:56:45 2012 +0200
@@ -199,7 +199,7 @@ If set, override Xen's calculation of th
 If set, override Xen's default choice for the platform timer.
 
 ### com1,com2
-> `= <baud>[/<clock_hz>][,DPS[,<io-base>[,<irq>[,<port-bdf>[,<bridge-bdf>]]]] | pci | amt ] `
+> `= <baud>[/<clock_hz>][,[DPS][,[<io-base>|pci|amt][,[<irq>][,[<port-bdf>][,[<bridge-bdf>]]]]]]`
 
 Both option `com1` and `com2` follow the same format.
 
diff -r ee12dc357fbe -r b22f184e1a3c xen/drivers/char/ns16550.c
--- a/xen/drivers/char/ns16550.c	Tue Sep 11 15:55:33 2012 +0200
+++ b/xen/drivers/char/ns16550.c	Tue Sep 11 15:56:45 2012 +0200
@@ -555,26 +555,23 @@ static void __init ns16550_parse_port_co
     else if ( (baud = simple_strtoul(conf, &conf, 10)) != 0 )
         uart->baud = baud;
 
-    if ( *conf == '/')
+    if ( *conf == '/' )
     {
         conf++;
         uart->clock_hz = simple_strtoul(conf, &conf, 0) << 4;
     }
 
-    if ( *conf != ',' )
-        goto config_parsed;
-    conf++;
+    if ( *conf == ',' && *++conf != ',' )
+    {
+        uart->data_bits = simple_strtoul(conf, &conf, 10);
 
-    uart->data_bits = simple_strtoul(conf, &conf, 10);
+        uart->parity = parse_parity_char(*conf);
 
-    uart->parity = parse_parity_char(*conf);
-    conf++;
+        uart->stop_bits = simple_strtoul(conf + 1, &conf, 10);
+    }
 
-    uart->stop_bits = simple_strtoul(conf, &conf, 10);
-
-    if ( *conf == ',' )
+    if ( *conf == ',' && *++conf != ',' )
     {
-        conf++;
         if ( strncmp(conf, "pci", 3) == 0 )
         {
             if ( pci_uart_config(uart, 1/* skip AMT */, uart - ns16550_com) )
@@ -591,24 +588,21 @@ static void __init ns16550_parse_port_co
         {
             uart->io_base = simple_strtoul(conf, &conf, 0);
         }
+    }
 
-        if ( *conf == ',' )
-        {
-            conf++;
-            uart->irq = simple_strtoul(conf, &conf, 10);
-            if ( *conf == ',' )
-            {
-                conf++;
-                uart->ps_bdf_enable = 1;
-                parse_pci_bdf(&conf, &uart->ps_bdf[0]);
-                if ( *conf == ',' )
-                {
-                    conf++;
-                    uart->pb_bdf_enable = 1;
-                    parse_pci_bdf(&conf, &uart->pb_bdf[0]);
-                }
-            }
-        }
+    if ( *conf == ',' && *++conf != ',' )
+        uart->irq = simple_strtol(conf, &conf, 10);
+
+    if ( *conf == ',' && *++conf != ',' )
+    {
+        uart->ps_bdf_enable = 1;
+        parse_pci_bdf(&conf, &uart->ps_bdf[0]);
+    }
+
+    if ( *conf == ',' && *++conf != ',' )
+    {
+        uart->pb_bdf_enable = 1;
+        parse_pci_bdf(&conf, &uart->pb_bdf[0]);
     }
 
  config_parsed:

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:32 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYZ-0003V1-TY; Fri, 14 Sep 2012 10:55:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYX-0003Qq-Tm
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:30 +0000
Received: from [85.158.139.83:2827] by server-4.bemta-5.messagelabs.com id
	CD/6C-23042-02D03505; Fri, 14 Sep 2012 10:55:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-182.messagelabs.com!1347620125!30776640!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18055 invoked from network); 14 Sep 2012 10:55:27 -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;
	14 Sep 2012 10: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 1TCTYT-00014J-ML
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYT-0000lW-KK
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:25 +0000
Message-Id: <E1TCTYT-0000lW-KK@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:25 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] ns16550: command line parsing
	adjustments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347371805 -7200
# Node ID b22f184e1a3cac03abeed92ec4b74235fd0881f4
# Parent  ee12dc357fbecbb0517798f395d14bf1764c6766
ns16550: command line parsing adjustments

Allow intermediate parts of the command line options to be absent
(expressed by two immediately succeeding commas).

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


diff -r ee12dc357fbe -r b22f184e1a3c docs/misc/xen-command-line.markdown
--- a/docs/misc/xen-command-line.markdown	Tue Sep 11 15:55:33 2012 +0200
+++ b/docs/misc/xen-command-line.markdown	Tue Sep 11 15:56:45 2012 +0200
@@ -199,7 +199,7 @@ If set, override Xen's calculation of th
 If set, override Xen's default choice for the platform timer.
 
 ### com1,com2
-> `= <baud>[/<clock_hz>][,DPS[,<io-base>[,<irq>[,<port-bdf>[,<bridge-bdf>]]]] | pci | amt ] `
+> `= <baud>[/<clock_hz>][,[DPS][,[<io-base>|pci|amt][,[<irq>][,[<port-bdf>][,[<bridge-bdf>]]]]]]`
 
 Both option `com1` and `com2` follow the same format.
 
diff -r ee12dc357fbe -r b22f184e1a3c xen/drivers/char/ns16550.c
--- a/xen/drivers/char/ns16550.c	Tue Sep 11 15:55:33 2012 +0200
+++ b/xen/drivers/char/ns16550.c	Tue Sep 11 15:56:45 2012 +0200
@@ -555,26 +555,23 @@ static void __init ns16550_parse_port_co
     else if ( (baud = simple_strtoul(conf, &conf, 10)) != 0 )
         uart->baud = baud;
 
-    if ( *conf == '/')
+    if ( *conf == '/' )
     {
         conf++;
         uart->clock_hz = simple_strtoul(conf, &conf, 0) << 4;
     }
 
-    if ( *conf != ',' )
-        goto config_parsed;
-    conf++;
+    if ( *conf == ',' && *++conf != ',' )
+    {
+        uart->data_bits = simple_strtoul(conf, &conf, 10);
 
-    uart->data_bits = simple_strtoul(conf, &conf, 10);
+        uart->parity = parse_parity_char(*conf);
 
-    uart->parity = parse_parity_char(*conf);
-    conf++;
+        uart->stop_bits = simple_strtoul(conf + 1, &conf, 10);
+    }
 
-    uart->stop_bits = simple_strtoul(conf, &conf, 10);
-
-    if ( *conf == ',' )
+    if ( *conf == ',' && *++conf != ',' )
     {
-        conf++;
         if ( strncmp(conf, "pci", 3) == 0 )
         {
             if ( pci_uart_config(uart, 1/* skip AMT */, uart - ns16550_com) )
@@ -591,24 +588,21 @@ static void __init ns16550_parse_port_co
         {
             uart->io_base = simple_strtoul(conf, &conf, 0);
         }
+    }
 
-        if ( *conf == ',' )
-        {
-            conf++;
-            uart->irq = simple_strtoul(conf, &conf, 10);
-            if ( *conf == ',' )
-            {
-                conf++;
-                uart->ps_bdf_enable = 1;
-                parse_pci_bdf(&conf, &uart->ps_bdf[0]);
-                if ( *conf == ',' )
-                {
-                    conf++;
-                    uart->pb_bdf_enable = 1;
-                    parse_pci_bdf(&conf, &uart->pb_bdf[0]);
-                }
-            }
-        }
+    if ( *conf == ',' && *++conf != ',' )
+        uart->irq = simple_strtol(conf, &conf, 10);
+
+    if ( *conf == ',' && *++conf != ',' )
+    {
+        uart->ps_bdf_enable = 1;
+        parse_pci_bdf(&conf, &uart->ps_bdf[0]);
+    }
+
+    if ( *conf == ',' && *++conf != ',' )
+    {
+        uart->pb_bdf_enable = 1;
+        parse_pci_bdf(&conf, &uart->pb_bdf[0]);
     }
 
  config_parsed:

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:32 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYZ-0003VB-Vq; Fri, 14 Sep 2012 10:55:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYY-0003RT-4E
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:30 +0000
Received: from [85.158.139.83:2869] by server-11.bemta-5.messagelabs.com id
	3B/92-24658-02D03505; Fri, 14 Sep 2012 10:55:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1347620126!28300925!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27400 invoked from network); 14 Sep 2012 10:55:27 -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;
	14 Sep 2012 10: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 1TCTYU-00014Q-8B
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYU-0000ll-6U
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:26 +0000
Message-Id: <E1TCTYU-0000ll-6U@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:25 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] drop tx_fifo_size
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347371858 -7200
# Node ID 9b5e0952ba7c9e6c57e37366f582ec0241fb378e
# Parent  b22f184e1a3cac03abeed92ec4b74235fd0881f4
drop tx_fifo_size

... in favor of having what so far was called tx_empty() return the
amount of space available.

Note that in the pl011.c case, original code and comment disagreed, and
I picked the conservative value for it's ->tx_ready() handler's return
value.

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


diff -r b22f184e1a3c -r 9b5e0952ba7c xen/drivers/char/ehci-dbgp.c
--- a/xen/drivers/char/ehci-dbgp.c	Tue Sep 11 15:56:45 2012 +0200
+++ b/xen/drivers/char/ehci-dbgp.c	Tue Sep 11 15:57:38 2012 +0200
@@ -1204,7 +1204,7 @@ static void ehci_dbgp_putc(struct serial
         ehci_dbgp_flush(port);
 }
 
-static int ehci_dbgp_tx_empty(struct serial_port *port)
+static unsigned int ehci_dbgp_tx_ready(struct serial_port *port)
 {
     struct ehci_dbgp *dbgp = port->uart;
 
@@ -1219,11 +1219,8 @@ static int ehci_dbgp_tx_empty(struct ser
     if ( dbgp->state != dbgp_idle && dbgp->out.chunk >= DBGP_MAX_PACKET )
         return 0;
 
-    port->tx_fifo_size = DBGP_MAX_PACKET - dbgp->out.chunk;
-    if ( dbgp->state == dbgp_idle )
-        port->tx_fifo_size += DBGP_MAX_PACKET;
-
-    return 1;
+    return DBGP_MAX_PACKET - dbgp->out.chunk +
+           (dbgp->state == dbgp_idle) * DBGP_MAX_PACKET;
 }
 
 static int ehci_dbgp_getc(struct serial_port *port, char *pc)
@@ -1347,7 +1344,6 @@ static void __init ehci_dbgp_init_preirq
     if ( ehci_dbgp_setup_preirq(dbgp) )
         ehci_dbgp_status(dbgp, "ehci_dbgp_init_preirq complete");
 
-    port->tx_fifo_size = DBGP_MAX_PACKET;
     dbgp->lock = &port->tx_lock;
 }
 
@@ -1448,7 +1444,7 @@ static struct uart_driver __read_mostly 
     .endboot      = ehci_dbgp_endboot,
     .suspend      = ehci_dbgp_suspend,
     .resume       = ehci_dbgp_resume,
-    .tx_empty     = ehci_dbgp_tx_empty,
+    .tx_ready     = ehci_dbgp_tx_ready,
     .putc         = ehci_dbgp_putc,
     .flush        = ehci_dbgp_flush,
     .getc         = ehci_dbgp_getc
diff -r b22f184e1a3c -r 9b5e0952ba7c xen/drivers/char/ns16550.c
--- a/xen/drivers/char/ns16550.c	Tue Sep 11 15:56:45 2012 +0200
+++ b/xen/drivers/char/ns16550.c	Tue Sep 11 15:57:38 2012 +0200
@@ -38,7 +38,7 @@ string_param("com1", opt_com1);
 string_param("com2", opt_com2);
 
 static struct ns16550 {
-    int baud, clock_hz, data_bits, parity, stop_bits, irq;
+    int baud, clock_hz, data_bits, parity, stop_bits, fifo_size, irq;
     unsigned long io_base;   /* I/O port or memory-mapped I/O address. */
     char __iomem *remapped_io_base;  /* Remapped virtual address of MMIO. */
     /* UART with IRQ line: interrupt-driven I/O. */
@@ -185,10 +185,11 @@ static void ns16550_poll(void *data)
 #endif
 }
 
-static int ns16550_tx_empty(struct serial_port *port)
+static unsigned int ns16550_tx_ready(struct serial_port *port)
 {
     struct ns16550 *uart = port->uart;
-    return !!(ns_read_reg(uart, LSR) & LSR_THRE);
+
+    return ns_read_reg(uart, LSR) & LSR_THRE ? uart->fifo_size : 0;
 }
 
 static void ns16550_putc(struct serial_port *port, char c)
@@ -288,7 +289,7 @@ static void __init ns16550_init_preirq(s
     /* Check this really is a 16550+. Otherwise we have no FIFOs. */
     if ( ((ns_read_reg(uart, IIR) & 0xc0) == 0xc0) &&
          ((ns_read_reg(uart, FCR) & FCR_TRG14) == FCR_TRG14) )
-        port->tx_fifo_size = 16;
+        uart->fifo_size = 16;
 }
 
 static void ns16550_setup_postirq(struct ns16550 *uart)
@@ -321,7 +322,7 @@ static void __init ns16550_init_postirq(
     /* Calculate time to fill RX FIFO and/or empty TX FIFO for polling. */
     bits = uart->data_bits + uart->stop_bits + !!uart->parity;
     uart->timeout_ms = max_t(
-        unsigned int, 1, (bits * port->tx_fifo_size * 1000) / uart->baud);
+        unsigned int, 1, (bits * uart->fifo_size * 1000) / uart->baud);
 
     if ( uart->irq > 0 )
     {
@@ -388,7 +389,7 @@ static struct uart_driver __read_mostly 
     .endboot      = ns16550_endboot,
     .suspend      = ns16550_suspend,
     .resume       = ns16550_resume,
-    .tx_empty     = ns16550_tx_empty,
+    .tx_ready     = ns16550_tx_ready,
     .putc         = ns16550_putc,
     .getc         = ns16550_getc,
     .irq          = ns16550_irq
@@ -641,6 +642,8 @@ void __init ns16550_init(int index, stru
     uart->stop_bits = defaults->stop_bits;
     uart->irq       = defaults->irq;
     uart->io_base   = defaults->io_base;
+    /* Default is no transmit FIFO. */
+    uart->fifo_size = 1;
 
     ns16550_parse_port_config(uart, (index == 0) ? opt_com1 : opt_com2);
 }
diff -r b22f184e1a3c -r 9b5e0952ba7c xen/drivers/char/pl011.c
--- a/xen/drivers/char/pl011.c	Tue Sep 11 15:56:45 2012 +0200
+++ b/xen/drivers/char/pl011.c	Tue Sep 11 15:57:38 2012 +0200
@@ -156,9 +156,6 @@ static void __init pl011_init_preirq(str
 
     /* Enable the UART for RX and TX; no flow ctrl */
     uart->regs[CR] = RXE | TXE | UARTEN;
-
-    /* Tell the serial framework about our fine 156-character FIFO */
-    port->tx_fifo_size = 16;
 }
 
 static void __init pl011_init_postirq(struct serial_port *port)
@@ -192,10 +189,10 @@ static void pl011_resume(struct serial_p
     BUG(); // XXX
 }
 
-static int pl011_tx_empty(struct serial_port *port)
+static unsigned int pl011_tx_ready(struct serial_port *port)
 {
     struct pl011 *uart = port->uart;
-    return !!(uart->regs[FR] & TXFE);
+    return uart->regs[FR] & TXFE ? 16 : 0;
 }
 
 static void pl011_putc(struct serial_port *port, char c)
@@ -227,7 +224,7 @@ static struct uart_driver __read_mostly 
     .endboot      = NULL,
     .suspend      = pl011_suspend,
     .resume       = pl011_resume,
-    .tx_empty     = pl011_tx_empty,
+    .tx_ready     = pl011_tx_ready,
     .putc         = pl011_putc,
     .getc         = pl011_getc,
     .irq          = pl011_irq
diff -r b22f184e1a3c -r 9b5e0952ba7c xen/drivers/char/serial.c
--- a/xen/drivers/char/serial.c	Tue Sep 11 15:56:45 2012 +0200
+++ b/xen/drivers/char/serial.c	Tue Sep 11 15:57:38 2012 +0200
@@ -59,7 +59,7 @@ void serial_rx_interrupt(struct serial_p
 
 void serial_tx_interrupt(struct serial_port *port, struct cpu_user_regs *regs)
 {
-    int i;
+    unsigned int i, n;
     unsigned long flags;
 
     local_irq_save(flags);
@@ -71,23 +71,20 @@ void serial_tx_interrupt(struct serial_p
      */
     while ( !spin_trylock(&port->tx_lock) )
     {
-        if ( !port->driver->tx_empty(port) )
+        if ( !port->driver->tx_ready(port) )
             goto out;
         cpu_relax();
     }
 
-    if ( port->driver->tx_empty(port) )
+    for ( i = 0, n = port->driver->tx_ready(port); i < n; i++ )
     {
-        for ( i = 0; i < port->tx_fifo_size; i++ )
-        {
-            if ( port->txbufc == port->txbufp )
-                break;
-            port->driver->putc(
-                port, port->txbuf[mask_serial_txbuf_idx(port->txbufc++)]);
-        }
-        if ( i && port->driver->flush )
-            port->driver->flush(port);
+        if ( port->txbufc == port->txbufp )
+            break;
+        port->driver->putc(
+            port, port->txbuf[mask_serial_txbuf_idx(port->txbufc++)]);
     }
+    if ( i && port->driver->flush )
+        port->driver->flush(port);
 
     spin_unlock(&port->tx_lock);
 
@@ -114,10 +111,11 @@ static void __serial_putc(struct serial_
             if ( port->tx_log_everything )
             {
                 /* Buffer is full: we spin waiting for space to appear. */
-                int i;
-                while ( !port->driver->tx_empty(port) )
+                unsigned int n;
+
+                while ( (n = port->driver->tx_ready(port)) == 0 )
                     cpu_relax();
-                for ( i = 0; i < port->tx_fifo_size; i++ )
+                while ( n-- )
                     port->driver->putc(
                         port,
                         port->txbuf[mask_serial_txbuf_idx(port->txbufc++)]);
@@ -132,7 +130,7 @@ static void __serial_putc(struct serial_
         }
 
         if ( ((port->txbufp - port->txbufc) == 0) &&
-                  port->driver->tx_empty(port) )
+             port->driver->tx_ready(port) )
         {
             /* Buffer and UART FIFO are both empty. */
             port->driver->putc(port, c);
@@ -143,10 +141,10 @@ static void __serial_putc(struct serial_
             port->txbuf[mask_serial_txbuf_idx(port->txbufp++)] = c;
         }
     }
-    else if ( port->driver->tx_empty )
+    else if ( port->driver->tx_ready )
     {
         /* Synchronous finite-capacity transmitter. */
-        while ( !port->driver->tx_empty(port) )
+        while ( !port->driver->tx_ready(port) )
             cpu_relax();
         port->driver->putc(port, c);
     }
@@ -386,7 +384,7 @@ void serial_start_sync(int handle)
     {
         while ( (port->txbufp - port->txbufc) != 0 )
         {
-            while ( !port->driver->tx_empty(port) )
+            while ( !port->driver->tx_ready(port) )
                 cpu_relax();
             port->driver->putc(
                 port, port->txbuf[mask_serial_txbuf_idx(port->txbufc++)]);
@@ -506,14 +504,11 @@ void __init serial_register_uart(int idx
     /* Store UART-specific info. */
     com[idx].driver = driver;
     com[idx].uart   = uart;
-
-    /* Default is no transmit FIFO. */
-    com[idx].tx_fifo_size = 1;
 }
 
 void __init serial_async_transmit(struct serial_port *port)
 {
-    BUG_ON(!port->driver->tx_empty);
+    BUG_ON(!port->driver->tx_ready);
     if ( port->txbuf != NULL )
         return;
     if ( serial_txbufsz < PAGE_SIZE )
diff -r b22f184e1a3c -r 9b5e0952ba7c xen/include/xen/serial.h
--- a/xen/include/xen/serial.h	Tue Sep 11 15:56:45 2012 +0200
+++ b/xen/include/xen/serial.h	Tue Sep 11 15:57:38 2012 +0200
@@ -36,8 +36,6 @@ struct serial_port {
     struct uart_driver *driver;
     void               *uart;
     enum serial_port_state state;
-    /* Number of characters the port can hold for transmit. */
-    int                 tx_fifo_size;
     /* Transmit data buffer (interrupt-driven uart). */
     char               *txbuf;
     unsigned int        txbufp, txbufc;
@@ -63,8 +61,8 @@ struct uart_driver {
     /* Driver suspend/resume. */
     void (*suspend)(struct serial_port *);
     void (*resume)(struct serial_port *);
-    /* Transmit FIFO ready to receive up to @tx_fifo_size characters? */
-    int  (*tx_empty)(struct serial_port *);
+    /* Return number of characters the port can hold for transmit. */
+    unsigned int (*tx_ready)(struct serial_port *);
     /* Put a character onto the serial line. */
     void (*putc)(struct serial_port *, char);
     /* Flush accumulated characters. */

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:32 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYZ-0003VB-Vq; Fri, 14 Sep 2012 10:55:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYY-0003RT-4E
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:30 +0000
Received: from [85.158.139.83:2869] by server-11.bemta-5.messagelabs.com id
	3B/92-24658-02D03505; Fri, 14 Sep 2012 10:55:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1347620126!28300925!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27400 invoked from network); 14 Sep 2012 10:55:27 -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;
	14 Sep 2012 10: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 1TCTYU-00014Q-8B
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYU-0000ll-6U
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:26 +0000
Message-Id: <E1TCTYU-0000ll-6U@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:25 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] drop tx_fifo_size
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347371858 -7200
# Node ID 9b5e0952ba7c9e6c57e37366f582ec0241fb378e
# Parent  b22f184e1a3cac03abeed92ec4b74235fd0881f4
drop tx_fifo_size

... in favor of having what so far was called tx_empty() return the
amount of space available.

Note that in the pl011.c case, original code and comment disagreed, and
I picked the conservative value for it's ->tx_ready() handler's return
value.

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


diff -r b22f184e1a3c -r 9b5e0952ba7c xen/drivers/char/ehci-dbgp.c
--- a/xen/drivers/char/ehci-dbgp.c	Tue Sep 11 15:56:45 2012 +0200
+++ b/xen/drivers/char/ehci-dbgp.c	Tue Sep 11 15:57:38 2012 +0200
@@ -1204,7 +1204,7 @@ static void ehci_dbgp_putc(struct serial
         ehci_dbgp_flush(port);
 }
 
-static int ehci_dbgp_tx_empty(struct serial_port *port)
+static unsigned int ehci_dbgp_tx_ready(struct serial_port *port)
 {
     struct ehci_dbgp *dbgp = port->uart;
 
@@ -1219,11 +1219,8 @@ static int ehci_dbgp_tx_empty(struct ser
     if ( dbgp->state != dbgp_idle && dbgp->out.chunk >= DBGP_MAX_PACKET )
         return 0;
 
-    port->tx_fifo_size = DBGP_MAX_PACKET - dbgp->out.chunk;
-    if ( dbgp->state == dbgp_idle )
-        port->tx_fifo_size += DBGP_MAX_PACKET;
-
-    return 1;
+    return DBGP_MAX_PACKET - dbgp->out.chunk +
+           (dbgp->state == dbgp_idle) * DBGP_MAX_PACKET;
 }
 
 static int ehci_dbgp_getc(struct serial_port *port, char *pc)
@@ -1347,7 +1344,6 @@ static void __init ehci_dbgp_init_preirq
     if ( ehci_dbgp_setup_preirq(dbgp) )
         ehci_dbgp_status(dbgp, "ehci_dbgp_init_preirq complete");
 
-    port->tx_fifo_size = DBGP_MAX_PACKET;
     dbgp->lock = &port->tx_lock;
 }
 
@@ -1448,7 +1444,7 @@ static struct uart_driver __read_mostly 
     .endboot      = ehci_dbgp_endboot,
     .suspend      = ehci_dbgp_suspend,
     .resume       = ehci_dbgp_resume,
-    .tx_empty     = ehci_dbgp_tx_empty,
+    .tx_ready     = ehci_dbgp_tx_ready,
     .putc         = ehci_dbgp_putc,
     .flush        = ehci_dbgp_flush,
     .getc         = ehci_dbgp_getc
diff -r b22f184e1a3c -r 9b5e0952ba7c xen/drivers/char/ns16550.c
--- a/xen/drivers/char/ns16550.c	Tue Sep 11 15:56:45 2012 +0200
+++ b/xen/drivers/char/ns16550.c	Tue Sep 11 15:57:38 2012 +0200
@@ -38,7 +38,7 @@ string_param("com1", opt_com1);
 string_param("com2", opt_com2);
 
 static struct ns16550 {
-    int baud, clock_hz, data_bits, parity, stop_bits, irq;
+    int baud, clock_hz, data_bits, parity, stop_bits, fifo_size, irq;
     unsigned long io_base;   /* I/O port or memory-mapped I/O address. */
     char __iomem *remapped_io_base;  /* Remapped virtual address of MMIO. */
     /* UART with IRQ line: interrupt-driven I/O. */
@@ -185,10 +185,11 @@ static void ns16550_poll(void *data)
 #endif
 }
 
-static int ns16550_tx_empty(struct serial_port *port)
+static unsigned int ns16550_tx_ready(struct serial_port *port)
 {
     struct ns16550 *uart = port->uart;
-    return !!(ns_read_reg(uart, LSR) & LSR_THRE);
+
+    return ns_read_reg(uart, LSR) & LSR_THRE ? uart->fifo_size : 0;
 }
 
 static void ns16550_putc(struct serial_port *port, char c)
@@ -288,7 +289,7 @@ static void __init ns16550_init_preirq(s
     /* Check this really is a 16550+. Otherwise we have no FIFOs. */
     if ( ((ns_read_reg(uart, IIR) & 0xc0) == 0xc0) &&
          ((ns_read_reg(uart, FCR) & FCR_TRG14) == FCR_TRG14) )
-        port->tx_fifo_size = 16;
+        uart->fifo_size = 16;
 }
 
 static void ns16550_setup_postirq(struct ns16550 *uart)
@@ -321,7 +322,7 @@ static void __init ns16550_init_postirq(
     /* Calculate time to fill RX FIFO and/or empty TX FIFO for polling. */
     bits = uart->data_bits + uart->stop_bits + !!uart->parity;
     uart->timeout_ms = max_t(
-        unsigned int, 1, (bits * port->tx_fifo_size * 1000) / uart->baud);
+        unsigned int, 1, (bits * uart->fifo_size * 1000) / uart->baud);
 
     if ( uart->irq > 0 )
     {
@@ -388,7 +389,7 @@ static struct uart_driver __read_mostly 
     .endboot      = ns16550_endboot,
     .suspend      = ns16550_suspend,
     .resume       = ns16550_resume,
-    .tx_empty     = ns16550_tx_empty,
+    .tx_ready     = ns16550_tx_ready,
     .putc         = ns16550_putc,
     .getc         = ns16550_getc,
     .irq          = ns16550_irq
@@ -641,6 +642,8 @@ void __init ns16550_init(int index, stru
     uart->stop_bits = defaults->stop_bits;
     uart->irq       = defaults->irq;
     uart->io_base   = defaults->io_base;
+    /* Default is no transmit FIFO. */
+    uart->fifo_size = 1;
 
     ns16550_parse_port_config(uart, (index == 0) ? opt_com1 : opt_com2);
 }
diff -r b22f184e1a3c -r 9b5e0952ba7c xen/drivers/char/pl011.c
--- a/xen/drivers/char/pl011.c	Tue Sep 11 15:56:45 2012 +0200
+++ b/xen/drivers/char/pl011.c	Tue Sep 11 15:57:38 2012 +0200
@@ -156,9 +156,6 @@ static void __init pl011_init_preirq(str
 
     /* Enable the UART for RX and TX; no flow ctrl */
     uart->regs[CR] = RXE | TXE | UARTEN;
-
-    /* Tell the serial framework about our fine 156-character FIFO */
-    port->tx_fifo_size = 16;
 }
 
 static void __init pl011_init_postirq(struct serial_port *port)
@@ -192,10 +189,10 @@ static void pl011_resume(struct serial_p
     BUG(); // XXX
 }
 
-static int pl011_tx_empty(struct serial_port *port)
+static unsigned int pl011_tx_ready(struct serial_port *port)
 {
     struct pl011 *uart = port->uart;
-    return !!(uart->regs[FR] & TXFE);
+    return uart->regs[FR] & TXFE ? 16 : 0;
 }
 
 static void pl011_putc(struct serial_port *port, char c)
@@ -227,7 +224,7 @@ static struct uart_driver __read_mostly 
     .endboot      = NULL,
     .suspend      = pl011_suspend,
     .resume       = pl011_resume,
-    .tx_empty     = pl011_tx_empty,
+    .tx_ready     = pl011_tx_ready,
     .putc         = pl011_putc,
     .getc         = pl011_getc,
     .irq          = pl011_irq
diff -r b22f184e1a3c -r 9b5e0952ba7c xen/drivers/char/serial.c
--- a/xen/drivers/char/serial.c	Tue Sep 11 15:56:45 2012 +0200
+++ b/xen/drivers/char/serial.c	Tue Sep 11 15:57:38 2012 +0200
@@ -59,7 +59,7 @@ void serial_rx_interrupt(struct serial_p
 
 void serial_tx_interrupt(struct serial_port *port, struct cpu_user_regs *regs)
 {
-    int i;
+    unsigned int i, n;
     unsigned long flags;
 
     local_irq_save(flags);
@@ -71,23 +71,20 @@ void serial_tx_interrupt(struct serial_p
      */
     while ( !spin_trylock(&port->tx_lock) )
     {
-        if ( !port->driver->tx_empty(port) )
+        if ( !port->driver->tx_ready(port) )
             goto out;
         cpu_relax();
     }
 
-    if ( port->driver->tx_empty(port) )
+    for ( i = 0, n = port->driver->tx_ready(port); i < n; i++ )
     {
-        for ( i = 0; i < port->tx_fifo_size; i++ )
-        {
-            if ( port->txbufc == port->txbufp )
-                break;
-            port->driver->putc(
-                port, port->txbuf[mask_serial_txbuf_idx(port->txbufc++)]);
-        }
-        if ( i && port->driver->flush )
-            port->driver->flush(port);
+        if ( port->txbufc == port->txbufp )
+            break;
+        port->driver->putc(
+            port, port->txbuf[mask_serial_txbuf_idx(port->txbufc++)]);
     }
+    if ( i && port->driver->flush )
+        port->driver->flush(port);
 
     spin_unlock(&port->tx_lock);
 
@@ -114,10 +111,11 @@ static void __serial_putc(struct serial_
             if ( port->tx_log_everything )
             {
                 /* Buffer is full: we spin waiting for space to appear. */
-                int i;
-                while ( !port->driver->tx_empty(port) )
+                unsigned int n;
+
+                while ( (n = port->driver->tx_ready(port)) == 0 )
                     cpu_relax();
-                for ( i = 0; i < port->tx_fifo_size; i++ )
+                while ( n-- )
                     port->driver->putc(
                         port,
                         port->txbuf[mask_serial_txbuf_idx(port->txbufc++)]);
@@ -132,7 +130,7 @@ static void __serial_putc(struct serial_
         }
 
         if ( ((port->txbufp - port->txbufc) == 0) &&
-                  port->driver->tx_empty(port) )
+             port->driver->tx_ready(port) )
         {
             /* Buffer and UART FIFO are both empty. */
             port->driver->putc(port, c);
@@ -143,10 +141,10 @@ static void __serial_putc(struct serial_
             port->txbuf[mask_serial_txbuf_idx(port->txbufp++)] = c;
         }
     }
-    else if ( port->driver->tx_empty )
+    else if ( port->driver->tx_ready )
     {
         /* Synchronous finite-capacity transmitter. */
-        while ( !port->driver->tx_empty(port) )
+        while ( !port->driver->tx_ready(port) )
             cpu_relax();
         port->driver->putc(port, c);
     }
@@ -386,7 +384,7 @@ void serial_start_sync(int handle)
     {
         while ( (port->txbufp - port->txbufc) != 0 )
         {
-            while ( !port->driver->tx_empty(port) )
+            while ( !port->driver->tx_ready(port) )
                 cpu_relax();
             port->driver->putc(
                 port, port->txbuf[mask_serial_txbuf_idx(port->txbufc++)]);
@@ -506,14 +504,11 @@ void __init serial_register_uart(int idx
     /* Store UART-specific info. */
     com[idx].driver = driver;
     com[idx].uart   = uart;
-
-    /* Default is no transmit FIFO. */
-    com[idx].tx_fifo_size = 1;
 }
 
 void __init serial_async_transmit(struct serial_port *port)
 {
-    BUG_ON(!port->driver->tx_empty);
+    BUG_ON(!port->driver->tx_ready);
     if ( port->txbuf != NULL )
         return;
     if ( serial_txbufsz < PAGE_SIZE )
diff -r b22f184e1a3c -r 9b5e0952ba7c xen/include/xen/serial.h
--- a/xen/include/xen/serial.h	Tue Sep 11 15:56:45 2012 +0200
+++ b/xen/include/xen/serial.h	Tue Sep 11 15:57:38 2012 +0200
@@ -36,8 +36,6 @@ struct serial_port {
     struct uart_driver *driver;
     void               *uart;
     enum serial_port_state state;
-    /* Number of characters the port can hold for transmit. */
-    int                 tx_fifo_size;
     /* Transmit data buffer (interrupt-driven uart). */
     char               *txbuf;
     unsigned int        txbufp, txbufc;
@@ -63,8 +61,8 @@ struct uart_driver {
     /* Driver suspend/resume. */
     void (*suspend)(struct serial_port *);
     void (*resume)(struct serial_port *);
-    /* Transmit FIFO ready to receive up to @tx_fifo_size characters? */
-    int  (*tx_empty)(struct serial_port *);
+    /* Return number of characters the port can hold for transmit. */
+    unsigned int (*tx_ready)(struct serial_port *);
     /* Put a character onto the serial line. */
     void (*putc)(struct serial_port *, char);
     /* Flush accumulated characters. */

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:32 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYa-0003Ve-8Y; Fri, 14 Sep 2012 10:55:32 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYZ-0003Ht-3g
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:31 +0000
Received: from [85.158.143.35:62806] by server-2.bemta-4.messagelabs.com id
	EB/3E-21239-22D03505; Fri, 14 Sep 2012 10:55:30 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1347620121!6523712!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9871 invoked from network); 14 Sep 2012 10:55:23 -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;
	14 Sep 2012 10: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 1TCTYP-00013h-OR
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYP-0000jp-M5
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:21 +0000
Message-Id: <E1TCTYP-0000jp-M5@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tmem: cleanup
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347365969 -7200
# Node ID e4cb8411161043c726f699252cc761e77853e820
# Parent  16e0392c6594b1757bbaa82076630a73d843229b
tmem: cleanup

- one more case of checking for a specific rather than any error
- drop no longer needed first parameter from cli_put_page()
- drop a redundant cast

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
---


diff -r 16e0392c6594 -r e4cb84111610 xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 11 14:19:03 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 11 14:19:29 2012 +0200
@@ -1468,7 +1468,7 @@ static NOINLINE int do_tmem_put_compress
         pgp_free_data(pgp, pgp->us.obj->pool);
     START_CYC_COUNTER(compress);
     ret = tmh_compress_from_client(cmfn, &dst, &size, clibuf);
-    if ( (ret == -EFAULT) || (ret == 0) )
+    if ( ret <= 0 )
         goto out;
     else if ( (size == 0) || (size >= tmem_subpage_maxsize()) ) {
         ret = 0;
diff -r 16e0392c6594 -r e4cb84111610 xen/common/tmem_xen.c
--- a/xen/common/tmem_xen.c	Tue Sep 11 14:19:03 2012 +0200
+++ b/xen/common/tmem_xen.c	Tue Sep 11 14:19:29 2012 +0200
@@ -97,7 +97,7 @@ static inline void *cli_get_page(tmem_cl
     return NULL;
 }
 
-static inline void cli_put_page(tmem_cli_mfn_t cmfn, void *cli_va, pfp_t *cli_pfp,
+static inline void cli_put_page(void *cli_va, pfp_t *cli_pfp,
                                 unsigned long cli_mfn, bool_t mark_dirty)
 {
     ASSERT(0);
@@ -126,20 +126,20 @@ static inline void *cli_get_page(tmem_cl
     }
 
     *pcli_mfn = page_to_mfn(page);
-    *pcli_pfp = (pfp_t *)page;
+    *pcli_pfp = page;
     return map_domain_page(*pcli_mfn);
 }
 
-static inline void cli_put_page(tmem_cli_mfn_t cmfn, void *cli_va, pfp_t *cli_pfp,
+static inline void cli_put_page(void *cli_va, pfp_t *cli_pfp,
                                 unsigned long cli_mfn, bool_t mark_dirty)
 {
     if ( mark_dirty )
     {
-        put_page_and_type((struct page_info *)cli_pfp);
+        put_page_and_type(cli_pfp);
         paging_mark_dirty(current->domain,cli_mfn);
     }
     else
-        put_page((struct page_info *)cli_pfp);
+        put_page(cli_pfp);
     unmap_domain_page(cli_va);
 }
 #endif
@@ -188,7 +188,7 @@ EXPORT int tmh_copy_from_client(pfp_t *p
     else if ( len )
         rc = -EINVAL;
     if ( cli_va )
-        cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 0);
+        cli_put_page(cli_va, cli_pfp, cli_mfn, 0);
     unmap_domain_page(tmem_va);
     return rc;
 }
@@ -221,7 +221,7 @@ EXPORT int tmh_compress_from_client(tmem
     ASSERT(ret == LZO_E_OK);
     *out_va = dmem;
     if ( cli_va )
-        cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 0);
+        cli_put_page(cli_va, cli_pfp, cli_mfn, 0);
     return 1;
 }
 
@@ -259,7 +259,7 @@ EXPORT int tmh_copy_to_client(tmem_cli_m
         rc = -EINVAL;
     unmap_domain_page(tmem_va);
     if ( cli_va )
-        cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 1);
+        cli_put_page(cli_va, cli_pfp, cli_mfn, 1);
     mb();
     return rc;
 }
@@ -286,7 +286,7 @@ EXPORT int tmh_decompress_to_client(tmem
     ASSERT(ret == LZO_E_OK);
     ASSERT(out_len == PAGE_SIZE);
     if ( cli_va )
-        cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 1);
+        cli_put_page(cli_va, cli_pfp, cli_mfn, 1);
     else if ( copy_to_guest(clibuf, scratch, PAGE_SIZE) )
         return -EFAULT;
     mb();
@@ -310,7 +310,7 @@ EXPORT int tmh_copy_tze_to_client(tmem_c
         memcpy((char *)cli_va,(char *)tmem_va,len);
     if ( len < PAGE_SIZE )
         memset((char *)cli_va+len,0,PAGE_SIZE-len);
-    cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 1);
+    cli_put_page(cli_va, cli_pfp, cli_mfn, 1);
     mb();
     return 1;
 }

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:32 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYa-0003Ve-8Y; Fri, 14 Sep 2012 10:55:32 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYZ-0003Ht-3g
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:31 +0000
Received: from [85.158.143.35:62806] by server-2.bemta-4.messagelabs.com id
	EB/3E-21239-22D03505; Fri, 14 Sep 2012 10:55:30 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1347620121!6523712!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9871 invoked from network); 14 Sep 2012 10:55:23 -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;
	14 Sep 2012 10: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 1TCTYP-00013h-OR
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYP-0000jp-M5
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:21 +0000
Message-Id: <E1TCTYP-0000jp-M5@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tmem: cleanup
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347365969 -7200
# Node ID e4cb8411161043c726f699252cc761e77853e820
# Parent  16e0392c6594b1757bbaa82076630a73d843229b
tmem: cleanup

- one more case of checking for a specific rather than any error
- drop no longer needed first parameter from cli_put_page()
- drop a redundant cast

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
---


diff -r 16e0392c6594 -r e4cb84111610 xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 11 14:19:03 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 11 14:19:29 2012 +0200
@@ -1468,7 +1468,7 @@ static NOINLINE int do_tmem_put_compress
         pgp_free_data(pgp, pgp->us.obj->pool);
     START_CYC_COUNTER(compress);
     ret = tmh_compress_from_client(cmfn, &dst, &size, clibuf);
-    if ( (ret == -EFAULT) || (ret == 0) )
+    if ( ret <= 0 )
         goto out;
     else if ( (size == 0) || (size >= tmem_subpage_maxsize()) ) {
         ret = 0;
diff -r 16e0392c6594 -r e4cb84111610 xen/common/tmem_xen.c
--- a/xen/common/tmem_xen.c	Tue Sep 11 14:19:03 2012 +0200
+++ b/xen/common/tmem_xen.c	Tue Sep 11 14:19:29 2012 +0200
@@ -97,7 +97,7 @@ static inline void *cli_get_page(tmem_cl
     return NULL;
 }
 
-static inline void cli_put_page(tmem_cli_mfn_t cmfn, void *cli_va, pfp_t *cli_pfp,
+static inline void cli_put_page(void *cli_va, pfp_t *cli_pfp,
                                 unsigned long cli_mfn, bool_t mark_dirty)
 {
     ASSERT(0);
@@ -126,20 +126,20 @@ static inline void *cli_get_page(tmem_cl
     }
 
     *pcli_mfn = page_to_mfn(page);
-    *pcli_pfp = (pfp_t *)page;
+    *pcli_pfp = page;
     return map_domain_page(*pcli_mfn);
 }
 
-static inline void cli_put_page(tmem_cli_mfn_t cmfn, void *cli_va, pfp_t *cli_pfp,
+static inline void cli_put_page(void *cli_va, pfp_t *cli_pfp,
                                 unsigned long cli_mfn, bool_t mark_dirty)
 {
     if ( mark_dirty )
     {
-        put_page_and_type((struct page_info *)cli_pfp);
+        put_page_and_type(cli_pfp);
         paging_mark_dirty(current->domain,cli_mfn);
     }
     else
-        put_page((struct page_info *)cli_pfp);
+        put_page(cli_pfp);
     unmap_domain_page(cli_va);
 }
 #endif
@@ -188,7 +188,7 @@ EXPORT int tmh_copy_from_client(pfp_t *p
     else if ( len )
         rc = -EINVAL;
     if ( cli_va )
-        cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 0);
+        cli_put_page(cli_va, cli_pfp, cli_mfn, 0);
     unmap_domain_page(tmem_va);
     return rc;
 }
@@ -221,7 +221,7 @@ EXPORT int tmh_compress_from_client(tmem
     ASSERT(ret == LZO_E_OK);
     *out_va = dmem;
     if ( cli_va )
-        cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 0);
+        cli_put_page(cli_va, cli_pfp, cli_mfn, 0);
     return 1;
 }
 
@@ -259,7 +259,7 @@ EXPORT int tmh_copy_to_client(tmem_cli_m
         rc = -EINVAL;
     unmap_domain_page(tmem_va);
     if ( cli_va )
-        cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 1);
+        cli_put_page(cli_va, cli_pfp, cli_mfn, 1);
     mb();
     return rc;
 }
@@ -286,7 +286,7 @@ EXPORT int tmh_decompress_to_client(tmem
     ASSERT(ret == LZO_E_OK);
     ASSERT(out_len == PAGE_SIZE);
     if ( cli_va )
-        cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 1);
+        cli_put_page(cli_va, cli_pfp, cli_mfn, 1);
     else if ( copy_to_guest(clibuf, scratch, PAGE_SIZE) )
         return -EFAULT;
     mb();
@@ -310,7 +310,7 @@ EXPORT int tmh_copy_tze_to_client(tmem_c
         memcpy((char *)cli_va,(char *)tmem_va,len);
     if ( len < PAGE_SIZE )
         memset((char *)cli_va+len,0,PAGE_SIZE-len);
-    cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 1);
+    cli_put_page(cli_va, cli_pfp, cli_mfn, 1);
     mb();
     return 1;
 }

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:33 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYb-0003YI-Ee; Fri, 14 Sep 2012 10:55:33 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYZ-0003RT-Ms
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:31 +0000
Received: from [85.158.139.83:3106] by server-11.bemta-5.messagelabs.com id
	C6/B2-24658-32D03505; Fri, 14 Sep 2012 10:55:31 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-182.messagelabs.com!1347620129!26226093!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15528 invoked from network); 14 Sep 2012 10:55:30 -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;
	14 Sep 2012 10: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 1TCTYX-00014q-5o
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYX-0000my-4V
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:29 +0000
Message-Id: <E1TCTYX-0000my-4V@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:28 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: retrieve keyboard shift status
	flags from BIOS
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347437854 -7200
# Node ID ac8f4afccd6c6786a3fd5691e8b0c9b38c47e994
# Parent  f47bc4eb8256cba78517137f59029deed3144aad
x86: retrieve keyboard shift status flags from BIOS

Recent Linux tries to make use of this, and has no way of getting at
these bits without Xen assisting it.

There doesn't appear to be a way to obtain the same information from
UEFI.

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


diff -r f47bc4eb8256 -r ac8f4afccd6c xen/arch/x86/boot/trampoline.S
--- a/xen/arch/x86/boot/trampoline.S	Tue Sep 11 16:04:49 2012 +0200
+++ b/xen/arch/x86/boot/trampoline.S	Wed Sep 12 10:17:34 2012 +0200
@@ -184,11 +184,16 @@ 1:      mov     %cs,%ax
          *  1. Get memory map.
          *  2. Get Enhanced Disk Drive (EDD) information.
          *  3. Set video mode.
+         *  4. Get keyboard shift flags.
          */
         call    get_memory_map
         call    get_edd
         call    video
 
+        mov     $0x0200,%ax
+        int     $0x16
+        mov     %al,bootsym(kbd_shift_flags)
+
         /* Disable irqs before returning to protected mode. */
         cli
 
@@ -221,6 +226,10 @@ 1:      mov     $BOOT_DS,%eax
 skip_realmode:
         .byte   0
 
+        .globl kbd_shift_flags
+kbd_shift_flags:
+        .byte   0
+
 rm_idt: .word   256*4-1, 0, 0
 
 #include "mem.S"
diff -r f47bc4eb8256 -r ac8f4afccd6c xen/arch/x86/platform_hypercall.c
--- a/xen/arch/x86/platform_hypercall.c	Tue Sep 11 16:04:49 2012 +0200
+++ b/xen/arch/x86/platform_hypercall.c	Wed Sep 12 10:17:34 2012 +0200
@@ -29,6 +29,7 @@
 #include <asm/edd.h>
 #include <asm/mtrr.h>
 #include <asm/io_apic.h>
+#include <asm/setup.h>
 #include "cpu/mtrr/mtrr.h"
 #include <xsm/xsm.h>
 
@@ -319,6 +320,18 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xe
                                      u.firmware_info.u.efi_info) )
                 ret = -EFAULT;
             break;
+        case XEN_FW_KBD_SHIFT_FLAGS:
+            ret = -ESRCH;
+            if ( op->u.firmware_info.index != 0 )
+                break;
+
+            op->u.firmware_info.u.kbd_shift_flags = bootsym(kbd_shift_flags);
+
+            ret = 0;
+            if ( copy_field_to_guest(u_xenpf_op, op,
+                                     u.firmware_info.u.kbd_shift_flags) )
+                ret = -EFAULT;
+            break;
         default:
             ret = -EINVAL;
             break;
diff -r f47bc4eb8256 -r ac8f4afccd6c xen/include/asm-x86/setup.h
--- a/xen/include/asm-x86/setup.h	Tue Sep 11 16:04:49 2012 +0200
+++ b/xen/include/asm-x86/setup.h	Wed Sep 12 10:17:34 2012 +0200
@@ -41,4 +41,6 @@ int xen_in_range(unsigned long mfn);
 void microcode_grab_module(
     unsigned long *, const multiboot_info_t *, void *(*)(const module_t *));
 
+extern uint8_t kbd_shift_flags;
+
 #endif
diff -r f47bc4eb8256 -r ac8f4afccd6c xen/include/public/platform.h
--- a/xen/include/public/platform.h	Tue Sep 11 16:04:49 2012 +0200
+++ b/xen/include/public/platform.h	Wed Sep 12 10:17:34 2012 +0200
@@ -218,6 +218,7 @@ DEFINE_XEN_GUEST_HANDLE(xenpf_efi_runtim
 #define  XEN_FW_EFI_VENDOR         2
 #define  XEN_FW_EFI_MEM_INFO       3
 #define  XEN_FW_EFI_RT_VERSION     4
+#define XEN_FW_KBD_SHIFT_FLAGS    5
 struct xenpf_firmware_info {
     /* IN variables. */
     uint32_t type;
@@ -266,6 +267,9 @@ struct xenpf_firmware_info {
                 uint32_t type;
             } mem;
         } efi_info; /* XEN_FW_EFI_INFO */
+
+        /* Int16, Fn02: Get keyboard shift flags. */
+        uint8_t kbd_shift_flags; /* XEN_FW_KBD_SHIFT_FLAGS */
     } u;
 };
 typedef struct xenpf_firmware_info xenpf_firmware_info_t;

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:33 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYb-0003YI-Ee; Fri, 14 Sep 2012 10:55:33 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYZ-0003RT-Ms
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:31 +0000
Received: from [85.158.139.83:3106] by server-11.bemta-5.messagelabs.com id
	C6/B2-24658-32D03505; Fri, 14 Sep 2012 10:55:31 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-182.messagelabs.com!1347620129!26226093!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15528 invoked from network); 14 Sep 2012 10:55:30 -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;
	14 Sep 2012 10: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 1TCTYX-00014q-5o
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYX-0000my-4V
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:29 +0000
Message-Id: <E1TCTYX-0000my-4V@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:28 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: retrieve keyboard shift status
	flags from BIOS
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347437854 -7200
# Node ID ac8f4afccd6c6786a3fd5691e8b0c9b38c47e994
# Parent  f47bc4eb8256cba78517137f59029deed3144aad
x86: retrieve keyboard shift status flags from BIOS

Recent Linux tries to make use of this, and has no way of getting at
these bits without Xen assisting it.

There doesn't appear to be a way to obtain the same information from
UEFI.

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


diff -r f47bc4eb8256 -r ac8f4afccd6c xen/arch/x86/boot/trampoline.S
--- a/xen/arch/x86/boot/trampoline.S	Tue Sep 11 16:04:49 2012 +0200
+++ b/xen/arch/x86/boot/trampoline.S	Wed Sep 12 10:17:34 2012 +0200
@@ -184,11 +184,16 @@ 1:      mov     %cs,%ax
          *  1. Get memory map.
          *  2. Get Enhanced Disk Drive (EDD) information.
          *  3. Set video mode.
+         *  4. Get keyboard shift flags.
          */
         call    get_memory_map
         call    get_edd
         call    video
 
+        mov     $0x0200,%ax
+        int     $0x16
+        mov     %al,bootsym(kbd_shift_flags)
+
         /* Disable irqs before returning to protected mode. */
         cli
 
@@ -221,6 +226,10 @@ 1:      mov     $BOOT_DS,%eax
 skip_realmode:
         .byte   0
 
+        .globl kbd_shift_flags
+kbd_shift_flags:
+        .byte   0
+
 rm_idt: .word   256*4-1, 0, 0
 
 #include "mem.S"
diff -r f47bc4eb8256 -r ac8f4afccd6c xen/arch/x86/platform_hypercall.c
--- a/xen/arch/x86/platform_hypercall.c	Tue Sep 11 16:04:49 2012 +0200
+++ b/xen/arch/x86/platform_hypercall.c	Wed Sep 12 10:17:34 2012 +0200
@@ -29,6 +29,7 @@
 #include <asm/edd.h>
 #include <asm/mtrr.h>
 #include <asm/io_apic.h>
+#include <asm/setup.h>
 #include "cpu/mtrr/mtrr.h"
 #include <xsm/xsm.h>
 
@@ -319,6 +320,18 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xe
                                      u.firmware_info.u.efi_info) )
                 ret = -EFAULT;
             break;
+        case XEN_FW_KBD_SHIFT_FLAGS:
+            ret = -ESRCH;
+            if ( op->u.firmware_info.index != 0 )
+                break;
+
+            op->u.firmware_info.u.kbd_shift_flags = bootsym(kbd_shift_flags);
+
+            ret = 0;
+            if ( copy_field_to_guest(u_xenpf_op, op,
+                                     u.firmware_info.u.kbd_shift_flags) )
+                ret = -EFAULT;
+            break;
         default:
             ret = -EINVAL;
             break;
diff -r f47bc4eb8256 -r ac8f4afccd6c xen/include/asm-x86/setup.h
--- a/xen/include/asm-x86/setup.h	Tue Sep 11 16:04:49 2012 +0200
+++ b/xen/include/asm-x86/setup.h	Wed Sep 12 10:17:34 2012 +0200
@@ -41,4 +41,6 @@ int xen_in_range(unsigned long mfn);
 void microcode_grab_module(
     unsigned long *, const multiboot_info_t *, void *(*)(const module_t *));
 
+extern uint8_t kbd_shift_flags;
+
 #endif
diff -r f47bc4eb8256 -r ac8f4afccd6c xen/include/public/platform.h
--- a/xen/include/public/platform.h	Tue Sep 11 16:04:49 2012 +0200
+++ b/xen/include/public/platform.h	Wed Sep 12 10:17:34 2012 +0200
@@ -218,6 +218,7 @@ DEFINE_XEN_GUEST_HANDLE(xenpf_efi_runtim
 #define  XEN_FW_EFI_VENDOR         2
 #define  XEN_FW_EFI_MEM_INFO       3
 #define  XEN_FW_EFI_RT_VERSION     4
+#define XEN_FW_KBD_SHIFT_FLAGS    5
 struct xenpf_firmware_info {
     /* IN variables. */
     uint32_t type;
@@ -266,6 +267,9 @@ struct xenpf_firmware_info {
                 uint32_t type;
             } mem;
         } efi_info; /* XEN_FW_EFI_INFO */
+
+        /* Int16, Fn02: Get keyboard shift flags. */
+        uint8_t kbd_shift_flags; /* XEN_FW_KBD_SHIFT_FLAGS */
     } u;
 };
 typedef struct xenpf_firmware_info xenpf_firmware_info_t;

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:33 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYb-0003Y5-C5; Fri, 14 Sep 2012 10:55:33 +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 1TCTYZ-0003Me-3P
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:31 +0000
Received: from [85.158.138.51:30688] by server-4.bemta-3.messagelabs.com id
	0A/F2-24831-22D03505; Fri, 14 Sep 2012 10:55:30 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-174.messagelabs.com!1347620128!22461992!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25118 invoked from network); 14 Sep 2012 10:55:29 -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;
	14 Sep 2012 10: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 1TCTYV-00014h-W4
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYV-0000mU-US
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:27 +0000
Message-Id: <E1TCTYV-0000mU-US@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:27 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: construct static part of 1:1
	mapping at build time
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347372218 -7200
# Node ID 2378a69cd0f240ee87a53bfa4ef3c815dc0c8155
# Parent  47e6725ec6f2b5d129f928ffa2ed4eb19d1095a3
x86: construct static part of 1:1 mapping at build time

... rather than at boot time, removing unnecessary redundancy between
EFI and legacy boot code.

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


diff -r 47e6725ec6f2 -r 2378a69cd0f2 xen/arch/x86/boot/head.S
--- a/xen/arch/x86/boot/head.S	Tue Sep 11 16:01:15 2012 +0200
+++ b/xen/arch/x86/boot/head.S	Tue Sep 11 16:03:38 2012 +0200
@@ -124,14 +124,11 @@ 1:      mov     %edx,sym_phys(cpuid_ext_
         bt      $29,%edx
         jnc     bad_cpu
         /* Initialise L2 identity-map and xen page table entries (16MB). */
-        mov     $sym_phys(l2_identmap),%edi
         mov     $sym_phys(l2_xenmap),%esi
         mov     $sym_phys(l2_bootmap),%edx
         mov     $0x1e3,%eax                  /* PRESENT+RW+A+D+2MB+GLOBAL */
         mov     $8,%ecx
-1:      mov     %eax,(%edi)
-        add     $8,%edi
-        mov     %eax,(%esi)
+1:      mov     %eax,(%esi)
         add     $8,%esi
         mov     %eax,(%edx)
         add     $8,%edx
@@ -163,54 +160,11 @@ 1:      mov     %eax,(%edi)
         mov     %eax,sym_phys(idle_pg_table) + l4_table_offset(DIRECTMAP_VIRT_START)*8
         mov     $(sym_phys(l3_xenmap)+7),%eax
         mov     %eax,sym_phys(idle_pg_table) + l4_table_offset(XEN_VIRT_START)*8
-#else
-        /* Initialize low and high mappings of memory with 2MB pages */
-        mov     $sym_phys(idle_pg_table_l2),%edi
-        mov     $0xe3,%eax                   /* PRESENT+RW+A+D+2MB */
-1:      mov     %eax,__PAGE_OFFSET>>18(%edi) /* high mapping */
-        stosl                                /* low mapping */
-        add     $4,%edi
-        add     $(1<<L2_PAGETABLE_SHIFT),%eax
-        cmp     $DIRECTMAP_PHYS_END+0xe3,%eax
-        jne     1b
-1:      stosl   /* low mappings cover up to 16MB */
-        add     $4,%edi
-        add     $(1<<L2_PAGETABLE_SHIFT),%eax
-        cmp     $(16<<20)+0xe3,%eax
-        jne     1b
-        /* Initialise L2 fixmap page directory entry. */
-        mov     $(sym_phys(l1_fixmap)+7),%eax
-        mov     %eax,sym_phys(idle_pg_table_l2) + l2_table_offset(FIXADDR_TOP-1)*8
-#endif
-
-        /* Initialize 4kB mappings of first 2MB or 4MB of memory. */
-        mov     $sym_phys(l1_identmap),%edi
-        mov     $0x263,%eax                  /* PRESENT+RW+A+D+SMALL_PAGES */
-#if defined(__x86_64__)
-        or      $0x100,%eax                  /* GLOBAL */
-#endif
-        xor     %ecx,%ecx
-1:      stosl
-        add     $4,%edi
-        add     $PAGE_SIZE,%eax
-        inc     %ecx
-        /* VGA hole (0xa0000-0xc0000) should be mapped UC. */
-        cmp     $0xa0,%ecx
-        jne     2f
-        or      $0x10,%eax                   /* +PCD */
-2:      cmp     $0xc0,%ecx
-        jne     2f
-        and     $~0x10,%eax                  /* -PCD */
-2:      cmp     $L1_PAGETABLE_ENTRIES,%ecx
-        jne     1b
-        sub     $(PAGE_SIZE-0x63),%edi
-#if defined(__x86_64__)
+        /* Hook 4kB mappings of first 2MB of memory into L2. */
+        mov     $sym_phys(l1_identmap)+__PAGE_HYPERVISOR,%edi
         mov     %edi,sym_phys(l2_identmap)
         mov     %edi,sym_phys(l2_xenmap)
         mov     %edi,sym_phys(l2_bootmap)
-#else
-        mov     %edi,sym_phys(idle_pg_table_l2)
-        mov     %edi,sym_phys(idle_pg_table_l2) + (__PAGE_OFFSET>>18)
 #endif
 
         /* Apply relocations to bootstrap trampoline. */
@@ -269,3 +223,25 @@ __high_start:
 #else
 #include "x86_32.S"
 #endif
+
+        .section .data.page_aligned, "aw", @progbits
+        .p2align PAGE_SHIFT
+/*
+ * Mapping of first 2 megabytes of memory. This is mapped with 4kB mappings
+ * to avoid type conflicts with fixed-range MTRRs covering the lowest megabyte
+ * of physical memory. In any case the VGA hole should be mapped with type UC.
+ */
+        .globl l1_identmap
+l1_identmap:
+        pfn = 0
+        .rept L1_PAGETABLE_ENTRIES
+        /* VGA hole (0xa0000-0xc0000) should be mapped UC. */
+        .if pfn >= 0xa0 && pfn < 0xc0
+        .long (pfn << PAGE_SHIFT) | PAGE_HYPERVISOR_NOCACHE | MAP_SMALL_PAGES
+        .else
+        .long (pfn << PAGE_SHIFT) | PAGE_HYPERVISOR | MAP_SMALL_PAGES
+        .endif
+        .long 0
+        pfn = pfn + 1
+        .endr
+        .size l1_identmap, . - l1_identmap
diff -r 47e6725ec6f2 -r 2378a69cd0f2 xen/arch/x86/boot/x86_32.S
--- a/xen/arch/x86/boot/x86_32.S	Tue Sep 11 16:01:15 2012 +0200
+++ b/xen/arch/x86/boot/x86_32.S	Tue Sep 11 16:03:38 2012 +0200
@@ -108,3 +108,24 @@ ENTRY(boot_cpu_gdt_table)
         .fill (PER_CPU_GDT_ENTRY - FLAT_RING3_DS / 8 - 1), 8, 0
         .quad 0x0000910000000000     /* per-CPU entry (limit == cpu) */
         .align PAGE_SIZE,0
+
+#define PAGE_HYPERVISOR         __PAGE_HYPERVISOR
+#define PAGE_HYPERVISOR_NOCACHE __PAGE_HYPERVISOR_NOCACHE
+
+/* Mapping of first 16 megabytes of memory. */
+        .globl idle_pg_table_l2
+idle_pg_table_l2:
+        range = 8
+        .irp count, l2_linear_offset(__PAGE_OFFSET), \
+                    (4 * L2_PAGETABLE_ENTRIES - l2_linear_offset(__PAGE_OFFSET) - 1)
+        .long sym_phys(l1_identmap) + PAGE_HYPERVISOR, 0
+        pfn = 1 << PAGETABLE_ORDER
+        .rept range - 1
+        .long (pfn << PAGE_SHIFT) | PAGE_HYPERVISOR | _PAGE_PSE, 0
+        pfn = pfn + (1 << PAGETABLE_ORDER)
+        .endr
+        .fill \count - range, 8, 0
+        range = DIRECTMAP_MBYTES / 2
+        .endr
+        .long sym_phys(l1_fixmap) + PAGE_HYPERVISOR, 0
+        .size idle_pg_table_l2, . - idle_pg_table_l2
diff -r 47e6725ec6f2 -r 2378a69cd0f2 xen/arch/x86/boot/x86_64.S
--- a/xen/arch/x86/boot/x86_64.S	Tue Sep 11 16:01:15 2012 +0200
+++ b/xen/arch/x86/boot/x86_64.S	Tue Sep 11 16:03:38 2012 +0200
@@ -127,3 +127,15 @@ ENTRY(boot_cpu_compat_gdt_table)
         .fill (PER_CPU_GDT_ENTRY - __HYPERVISOR_CS32 / 8 - 1), 8, 0
         .quad 0x0000910000000000     /* per-CPU entry (limit == cpu)      */
         .align PAGE_SIZE, 0
+
+/* Mapping of first 16 megabytes of memory. */
+        .globl l2_identmap
+l2_identmap:
+        .quad 0
+        pfn = 0
+        .rept 7
+        pfn = pfn + (1 << PAGETABLE_ORDER)
+        .quad (pfn << PAGE_SHIFT) | PAGE_HYPERVISOR | _PAGE_PSE
+        .endr
+        .fill 4 * L2_PAGETABLE_ENTRIES - 8, 8, 0
+        .size l2_identmap, . - l2_identmap
diff -r 47e6725ec6f2 -r 2378a69cd0f2 xen/arch/x86/efi/boot.c
--- a/xen/arch/x86/efi/boot.c	Tue Sep 11 16:01:15 2012 +0200
+++ b/xen/arch/x86/efi/boot.c	Tue Sep 11 16:03:38 2012 +0200
@@ -1119,8 +1119,6 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SY
         unsigned int slot = (xen_phys_start >> L2_PAGETABLE_SHIFT) + i;
         paddr_t addr = slot << L2_PAGETABLE_SHIFT;
 
-        l2_identmap[i] = l2e_from_paddr(i << L2_PAGETABLE_SHIFT,
-                                        PAGE_HYPERVISOR|_PAGE_PSE);
         l2_identmap[slot] = l2e_from_paddr(addr, PAGE_HYPERVISOR|_PAGE_PSE);
         l2_xenmap[i] = l2e_from_paddr(addr, PAGE_HYPERVISOR|_PAGE_PSE);
         slot &= L2_PAGETABLE_ENTRIES - 1;
@@ -1150,16 +1148,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SY
         l4e_from_paddr((UINTN)l3_identmap, __PAGE_HYPERVISOR);
     idle_pg_table[l4_table_offset(XEN_VIRT_START)] =
         l4e_from_paddr((UINTN)l3_xenmap, __PAGE_HYPERVISOR);
-    /* Initialize 4kB mappings of first 2MB of memory. */
-    for ( i = 0; i < L1_PAGETABLE_ENTRIES; ++i )
-    {
-        unsigned int attr = PAGE_HYPERVISOR|MAP_SMALL_PAGES;
-
-        /* VGA hole (0xa0000-0xc0000) should be mapped UC. */
-        if ( i >= 0xa0 && i < 0xc0 )
-            attr |= _PAGE_PCD;
-        l1_identmap[i] = l1e_from_pfn(i, attr);
-    }
+    /* Hook 4kB mappings of first 2MB of memory into L2. */
     l2_identmap[0] = l2e_from_paddr((UINTN)l1_identmap, __PAGE_HYPERVISOR);
 
     if ( gop )
diff -r 47e6725ec6f2 -r 2378a69cd0f2 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Tue Sep 11 16:01:15 2012 +0200
+++ b/xen/arch/x86/mm.c	Tue Sep 11 16:03:38 2012 +0200
@@ -121,15 +121,6 @@
 #include <asm/setup.h>
 #include <asm/fixmap.h>
 
-/*
- * Mapping of first 2 or 4 megabytes of memory. This is mapped with 4kB
- * mappings to avoid type conflicts with fixed-range MTRRs covering the
- * lowest megabyte of physical memory. In any case the VGA hole should be
- * mapped with type UC.
- */
-l1_pgentry_t __attribute__ ((__section__ (".bss.page_aligned")))
-    l1_identmap[L1_PAGETABLE_ENTRIES];
-
 /* Mapping of the fixmap space needed early. */
 l1_pgentry_t __attribute__ ((__section__ (".bss.page_aligned")))
     l1_fixmap[L1_PAGETABLE_ENTRIES];
diff -r 47e6725ec6f2 -r 2378a69cd0f2 xen/arch/x86/x86_32/mm.c
--- a/xen/arch/x86/x86_32/mm.c	Tue Sep 11 16:01:15 2012 +0200
+++ b/xen/arch/x86/x86_32/mm.c	Tue Sep 11 16:03:38 2012 +0200
@@ -31,9 +31,6 @@
 #include <asm/setup.h>
 #include <public/memory.h>
 
-l2_pgentry_t __attribute__ ((__section__ (".bss.page_aligned")))
-    idle_pg_table_l2[4 * L2_PAGETABLE_ENTRIES];
-
 unsigned int __read_mostly PAGE_HYPERVISOR         = __PAGE_HYPERVISOR;
 unsigned int __read_mostly PAGE_HYPERVISOR_NOCACHE = __PAGE_HYPERVISOR_NOCACHE;
 
diff -r 47e6725ec6f2 -r 2378a69cd0f2 xen/arch/x86/x86_64/mm.c
--- a/xen/arch/x86/x86_64/mm.c	Tue Sep 11 16:01:15 2012 +0200
+++ b/xen/arch/x86/x86_64/mm.c	Tue Sep 11 16:03:38 2012 +0200
@@ -56,8 +56,6 @@ l4_pgentry_t __attribute__ ((__section__
 /* Enough page directories to map bottom 4GB of the memory map. */
 l3_pgentry_t __attribute__ ((__section__ (".bss.page_aligned")))
     l3_identmap[L3_PAGETABLE_ENTRIES];
-l2_pgentry_t __attribute__ ((__section__ (".bss.page_aligned")))
-    l2_identmap[4*L2_PAGETABLE_ENTRIES];
 
 /* Enough page directories to map the Xen text and static data. */
 l3_pgentry_t __attribute__ ((__section__ (".bss.page_aligned")))
diff -r 47e6725ec6f2 -r 2378a69cd0f2 xen/include/asm-x86/page.h
--- a/xen/include/asm-x86/page.h	Tue Sep 11 16:01:15 2012 +0200
+++ b/xen/include/asm-x86/page.h	Tue Sep 11 16:03:38 2012 +0200
@@ -7,11 +7,7 @@
  * It is important that the masks are signed quantities. This ensures that
  * the compiler sign-extends a 32-bit mask to 64 bits if that is required.
  */
-#ifndef __ASSEMBLY__
-#define PAGE_SIZE           (1L << PAGE_SHIFT)
-#else
-#define PAGE_SIZE           (1 << PAGE_SHIFT)
-#endif
+#define PAGE_SIZE           (_AC(1,L) << PAGE_SHIFT)
 #define PAGE_MASK           (~(PAGE_SIZE-1))
 #define PAGE_FLAG_MASK      (~0)
 
@@ -321,21 +317,22 @@ void paging_init(void);
 void setup_idle_pagetable(void);
 #endif /* !defined(__ASSEMBLY__) */
 
-#define _PAGE_PRESENT  0x001U
-#define _PAGE_RW       0x002U
-#define _PAGE_USER     0x004U
-#define _PAGE_PWT      0x008U
-#define _PAGE_PCD      0x010U
-#define _PAGE_ACCESSED 0x020U
-#define _PAGE_DIRTY    0x040U
-#define _PAGE_PAT      0x080U
-#define _PAGE_PSE      0x080U
-#define _PAGE_GLOBAL   0x100U
-#define _PAGE_AVAIL0   0x200U
-#define _PAGE_AVAIL1   0x400U
-#define _PAGE_AVAIL2   0x800U
-#define _PAGE_AVAIL    0xE00U
-#define _PAGE_PSE_PAT 0x1000U
+#define _PAGE_PRESENT  _AC(0x001,U)
+#define _PAGE_RW       _AC(0x002,U)
+#define _PAGE_USER     _AC(0x004,U)
+#define _PAGE_PWT      _AC(0x008,U)
+#define _PAGE_PCD      _AC(0x010,U)
+#define _PAGE_ACCESSED _AC(0x020,U)
+#define _PAGE_DIRTY    _AC(0x040,U)
+#define _PAGE_PAT      _AC(0x080,U)
+#define _PAGE_PSE      _AC(0x080,U)
+#define _PAGE_GLOBAL   _AC(0x100,U)
+#define _PAGE_AVAIL0   _AC(0x200,U)
+#define _PAGE_AVAIL1   _AC(0x400,U)
+#define _PAGE_AVAIL2   _AC(0x800,U)
+#define _PAGE_AVAIL    _AC(0xE00,U)
+#define _PAGE_PSE_PAT _AC(0x1000,U)
+/* non-architectural flags */
 #define _PAGE_PAGED   0x2000U
 #define _PAGE_SHARED  0x4000U
 
@@ -356,6 +353,8 @@ void setup_idle_pagetable(void);
 #define __PAGE_HYPERVISOR_NOCACHE \
     (_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_PCD | _PAGE_ACCESSED)
 
+#define MAP_SMALL_PAGES _PAGE_AVAIL0 /* don't use superpages mappings */
+
 #ifndef __ASSEMBLY__
 
 /* Allocator functions for Xen pagetables. */
@@ -369,7 +368,6 @@ l3_pgentry_t *virt_to_xen_l3e(unsigned l
 extern void set_pdx_range(unsigned long smfn, unsigned long emfn);
 
 /* Map machine page range in Xen virtual address space. */
-#define MAP_SMALL_PAGES _PAGE_AVAIL0 /* don't use superpages for the mapping */
 int map_pages_to_xen(
     unsigned long virt,
     unsigned long mfn,

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:33 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYb-0003Y5-C5; Fri, 14 Sep 2012 10:55:33 +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 1TCTYZ-0003Me-3P
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:31 +0000
Received: from [85.158.138.51:30688] by server-4.bemta-3.messagelabs.com id
	0A/F2-24831-22D03505; Fri, 14 Sep 2012 10:55:30 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-174.messagelabs.com!1347620128!22461992!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25118 invoked from network); 14 Sep 2012 10:55:29 -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;
	14 Sep 2012 10: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 1TCTYV-00014h-W4
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYV-0000mU-US
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:27 +0000
Message-Id: <E1TCTYV-0000mU-US@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:27 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: construct static part of 1:1
	mapping at build time
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347372218 -7200
# Node ID 2378a69cd0f240ee87a53bfa4ef3c815dc0c8155
# Parent  47e6725ec6f2b5d129f928ffa2ed4eb19d1095a3
x86: construct static part of 1:1 mapping at build time

... rather than at boot time, removing unnecessary redundancy between
EFI and legacy boot code.

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


diff -r 47e6725ec6f2 -r 2378a69cd0f2 xen/arch/x86/boot/head.S
--- a/xen/arch/x86/boot/head.S	Tue Sep 11 16:01:15 2012 +0200
+++ b/xen/arch/x86/boot/head.S	Tue Sep 11 16:03:38 2012 +0200
@@ -124,14 +124,11 @@ 1:      mov     %edx,sym_phys(cpuid_ext_
         bt      $29,%edx
         jnc     bad_cpu
         /* Initialise L2 identity-map and xen page table entries (16MB). */
-        mov     $sym_phys(l2_identmap),%edi
         mov     $sym_phys(l2_xenmap),%esi
         mov     $sym_phys(l2_bootmap),%edx
         mov     $0x1e3,%eax                  /* PRESENT+RW+A+D+2MB+GLOBAL */
         mov     $8,%ecx
-1:      mov     %eax,(%edi)
-        add     $8,%edi
-        mov     %eax,(%esi)
+1:      mov     %eax,(%esi)
         add     $8,%esi
         mov     %eax,(%edx)
         add     $8,%edx
@@ -163,54 +160,11 @@ 1:      mov     %eax,(%edi)
         mov     %eax,sym_phys(idle_pg_table) + l4_table_offset(DIRECTMAP_VIRT_START)*8
         mov     $(sym_phys(l3_xenmap)+7),%eax
         mov     %eax,sym_phys(idle_pg_table) + l4_table_offset(XEN_VIRT_START)*8
-#else
-        /* Initialize low and high mappings of memory with 2MB pages */
-        mov     $sym_phys(idle_pg_table_l2),%edi
-        mov     $0xe3,%eax                   /* PRESENT+RW+A+D+2MB */
-1:      mov     %eax,__PAGE_OFFSET>>18(%edi) /* high mapping */
-        stosl                                /* low mapping */
-        add     $4,%edi
-        add     $(1<<L2_PAGETABLE_SHIFT),%eax
-        cmp     $DIRECTMAP_PHYS_END+0xe3,%eax
-        jne     1b
-1:      stosl   /* low mappings cover up to 16MB */
-        add     $4,%edi
-        add     $(1<<L2_PAGETABLE_SHIFT),%eax
-        cmp     $(16<<20)+0xe3,%eax
-        jne     1b
-        /* Initialise L2 fixmap page directory entry. */
-        mov     $(sym_phys(l1_fixmap)+7),%eax
-        mov     %eax,sym_phys(idle_pg_table_l2) + l2_table_offset(FIXADDR_TOP-1)*8
-#endif
-
-        /* Initialize 4kB mappings of first 2MB or 4MB of memory. */
-        mov     $sym_phys(l1_identmap),%edi
-        mov     $0x263,%eax                  /* PRESENT+RW+A+D+SMALL_PAGES */
-#if defined(__x86_64__)
-        or      $0x100,%eax                  /* GLOBAL */
-#endif
-        xor     %ecx,%ecx
-1:      stosl
-        add     $4,%edi
-        add     $PAGE_SIZE,%eax
-        inc     %ecx
-        /* VGA hole (0xa0000-0xc0000) should be mapped UC. */
-        cmp     $0xa0,%ecx
-        jne     2f
-        or      $0x10,%eax                   /* +PCD */
-2:      cmp     $0xc0,%ecx
-        jne     2f
-        and     $~0x10,%eax                  /* -PCD */
-2:      cmp     $L1_PAGETABLE_ENTRIES,%ecx
-        jne     1b
-        sub     $(PAGE_SIZE-0x63),%edi
-#if defined(__x86_64__)
+        /* Hook 4kB mappings of first 2MB of memory into L2. */
+        mov     $sym_phys(l1_identmap)+__PAGE_HYPERVISOR,%edi
         mov     %edi,sym_phys(l2_identmap)
         mov     %edi,sym_phys(l2_xenmap)
         mov     %edi,sym_phys(l2_bootmap)
-#else
-        mov     %edi,sym_phys(idle_pg_table_l2)
-        mov     %edi,sym_phys(idle_pg_table_l2) + (__PAGE_OFFSET>>18)
 #endif
 
         /* Apply relocations to bootstrap trampoline. */
@@ -269,3 +223,25 @@ __high_start:
 #else
 #include "x86_32.S"
 #endif
+
+        .section .data.page_aligned, "aw", @progbits
+        .p2align PAGE_SHIFT
+/*
+ * Mapping of first 2 megabytes of memory. This is mapped with 4kB mappings
+ * to avoid type conflicts with fixed-range MTRRs covering the lowest megabyte
+ * of physical memory. In any case the VGA hole should be mapped with type UC.
+ */
+        .globl l1_identmap
+l1_identmap:
+        pfn = 0
+        .rept L1_PAGETABLE_ENTRIES
+        /* VGA hole (0xa0000-0xc0000) should be mapped UC. */
+        .if pfn >= 0xa0 && pfn < 0xc0
+        .long (pfn << PAGE_SHIFT) | PAGE_HYPERVISOR_NOCACHE | MAP_SMALL_PAGES
+        .else
+        .long (pfn << PAGE_SHIFT) | PAGE_HYPERVISOR | MAP_SMALL_PAGES
+        .endif
+        .long 0
+        pfn = pfn + 1
+        .endr
+        .size l1_identmap, . - l1_identmap
diff -r 47e6725ec6f2 -r 2378a69cd0f2 xen/arch/x86/boot/x86_32.S
--- a/xen/arch/x86/boot/x86_32.S	Tue Sep 11 16:01:15 2012 +0200
+++ b/xen/arch/x86/boot/x86_32.S	Tue Sep 11 16:03:38 2012 +0200
@@ -108,3 +108,24 @@ ENTRY(boot_cpu_gdt_table)
         .fill (PER_CPU_GDT_ENTRY - FLAT_RING3_DS / 8 - 1), 8, 0
         .quad 0x0000910000000000     /* per-CPU entry (limit == cpu) */
         .align PAGE_SIZE,0
+
+#define PAGE_HYPERVISOR         __PAGE_HYPERVISOR
+#define PAGE_HYPERVISOR_NOCACHE __PAGE_HYPERVISOR_NOCACHE
+
+/* Mapping of first 16 megabytes of memory. */
+        .globl idle_pg_table_l2
+idle_pg_table_l2:
+        range = 8
+        .irp count, l2_linear_offset(__PAGE_OFFSET), \
+                    (4 * L2_PAGETABLE_ENTRIES - l2_linear_offset(__PAGE_OFFSET) - 1)
+        .long sym_phys(l1_identmap) + PAGE_HYPERVISOR, 0
+        pfn = 1 << PAGETABLE_ORDER
+        .rept range - 1
+        .long (pfn << PAGE_SHIFT) | PAGE_HYPERVISOR | _PAGE_PSE, 0
+        pfn = pfn + (1 << PAGETABLE_ORDER)
+        .endr
+        .fill \count - range, 8, 0
+        range = DIRECTMAP_MBYTES / 2
+        .endr
+        .long sym_phys(l1_fixmap) + PAGE_HYPERVISOR, 0
+        .size idle_pg_table_l2, . - idle_pg_table_l2
diff -r 47e6725ec6f2 -r 2378a69cd0f2 xen/arch/x86/boot/x86_64.S
--- a/xen/arch/x86/boot/x86_64.S	Tue Sep 11 16:01:15 2012 +0200
+++ b/xen/arch/x86/boot/x86_64.S	Tue Sep 11 16:03:38 2012 +0200
@@ -127,3 +127,15 @@ ENTRY(boot_cpu_compat_gdt_table)
         .fill (PER_CPU_GDT_ENTRY - __HYPERVISOR_CS32 / 8 - 1), 8, 0
         .quad 0x0000910000000000     /* per-CPU entry (limit == cpu)      */
         .align PAGE_SIZE, 0
+
+/* Mapping of first 16 megabytes of memory. */
+        .globl l2_identmap
+l2_identmap:
+        .quad 0
+        pfn = 0
+        .rept 7
+        pfn = pfn + (1 << PAGETABLE_ORDER)
+        .quad (pfn << PAGE_SHIFT) | PAGE_HYPERVISOR | _PAGE_PSE
+        .endr
+        .fill 4 * L2_PAGETABLE_ENTRIES - 8, 8, 0
+        .size l2_identmap, . - l2_identmap
diff -r 47e6725ec6f2 -r 2378a69cd0f2 xen/arch/x86/efi/boot.c
--- a/xen/arch/x86/efi/boot.c	Tue Sep 11 16:01:15 2012 +0200
+++ b/xen/arch/x86/efi/boot.c	Tue Sep 11 16:03:38 2012 +0200
@@ -1119,8 +1119,6 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SY
         unsigned int slot = (xen_phys_start >> L2_PAGETABLE_SHIFT) + i;
         paddr_t addr = slot << L2_PAGETABLE_SHIFT;
 
-        l2_identmap[i] = l2e_from_paddr(i << L2_PAGETABLE_SHIFT,
-                                        PAGE_HYPERVISOR|_PAGE_PSE);
         l2_identmap[slot] = l2e_from_paddr(addr, PAGE_HYPERVISOR|_PAGE_PSE);
         l2_xenmap[i] = l2e_from_paddr(addr, PAGE_HYPERVISOR|_PAGE_PSE);
         slot &= L2_PAGETABLE_ENTRIES - 1;
@@ -1150,16 +1148,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SY
         l4e_from_paddr((UINTN)l3_identmap, __PAGE_HYPERVISOR);
     idle_pg_table[l4_table_offset(XEN_VIRT_START)] =
         l4e_from_paddr((UINTN)l3_xenmap, __PAGE_HYPERVISOR);
-    /* Initialize 4kB mappings of first 2MB of memory. */
-    for ( i = 0; i < L1_PAGETABLE_ENTRIES; ++i )
-    {
-        unsigned int attr = PAGE_HYPERVISOR|MAP_SMALL_PAGES;
-
-        /* VGA hole (0xa0000-0xc0000) should be mapped UC. */
-        if ( i >= 0xa0 && i < 0xc0 )
-            attr |= _PAGE_PCD;
-        l1_identmap[i] = l1e_from_pfn(i, attr);
-    }
+    /* Hook 4kB mappings of first 2MB of memory into L2. */
     l2_identmap[0] = l2e_from_paddr((UINTN)l1_identmap, __PAGE_HYPERVISOR);
 
     if ( gop )
diff -r 47e6725ec6f2 -r 2378a69cd0f2 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Tue Sep 11 16:01:15 2012 +0200
+++ b/xen/arch/x86/mm.c	Tue Sep 11 16:03:38 2012 +0200
@@ -121,15 +121,6 @@
 #include <asm/setup.h>
 #include <asm/fixmap.h>
 
-/*
- * Mapping of first 2 or 4 megabytes of memory. This is mapped with 4kB
- * mappings to avoid type conflicts with fixed-range MTRRs covering the
- * lowest megabyte of physical memory. In any case the VGA hole should be
- * mapped with type UC.
- */
-l1_pgentry_t __attribute__ ((__section__ (".bss.page_aligned")))
-    l1_identmap[L1_PAGETABLE_ENTRIES];
-
 /* Mapping of the fixmap space needed early. */
 l1_pgentry_t __attribute__ ((__section__ (".bss.page_aligned")))
     l1_fixmap[L1_PAGETABLE_ENTRIES];
diff -r 47e6725ec6f2 -r 2378a69cd0f2 xen/arch/x86/x86_32/mm.c
--- a/xen/arch/x86/x86_32/mm.c	Tue Sep 11 16:01:15 2012 +0200
+++ b/xen/arch/x86/x86_32/mm.c	Tue Sep 11 16:03:38 2012 +0200
@@ -31,9 +31,6 @@
 #include <asm/setup.h>
 #include <public/memory.h>
 
-l2_pgentry_t __attribute__ ((__section__ (".bss.page_aligned")))
-    idle_pg_table_l2[4 * L2_PAGETABLE_ENTRIES];
-
 unsigned int __read_mostly PAGE_HYPERVISOR         = __PAGE_HYPERVISOR;
 unsigned int __read_mostly PAGE_HYPERVISOR_NOCACHE = __PAGE_HYPERVISOR_NOCACHE;
 
diff -r 47e6725ec6f2 -r 2378a69cd0f2 xen/arch/x86/x86_64/mm.c
--- a/xen/arch/x86/x86_64/mm.c	Tue Sep 11 16:01:15 2012 +0200
+++ b/xen/arch/x86/x86_64/mm.c	Tue Sep 11 16:03:38 2012 +0200
@@ -56,8 +56,6 @@ l4_pgentry_t __attribute__ ((__section__
 /* Enough page directories to map bottom 4GB of the memory map. */
 l3_pgentry_t __attribute__ ((__section__ (".bss.page_aligned")))
     l3_identmap[L3_PAGETABLE_ENTRIES];
-l2_pgentry_t __attribute__ ((__section__ (".bss.page_aligned")))
-    l2_identmap[4*L2_PAGETABLE_ENTRIES];
 
 /* Enough page directories to map the Xen text and static data. */
 l3_pgentry_t __attribute__ ((__section__ (".bss.page_aligned")))
diff -r 47e6725ec6f2 -r 2378a69cd0f2 xen/include/asm-x86/page.h
--- a/xen/include/asm-x86/page.h	Tue Sep 11 16:01:15 2012 +0200
+++ b/xen/include/asm-x86/page.h	Tue Sep 11 16:03:38 2012 +0200
@@ -7,11 +7,7 @@
  * It is important that the masks are signed quantities. This ensures that
  * the compiler sign-extends a 32-bit mask to 64 bits if that is required.
  */
-#ifndef __ASSEMBLY__
-#define PAGE_SIZE           (1L << PAGE_SHIFT)
-#else
-#define PAGE_SIZE           (1 << PAGE_SHIFT)
-#endif
+#define PAGE_SIZE           (_AC(1,L) << PAGE_SHIFT)
 #define PAGE_MASK           (~(PAGE_SIZE-1))
 #define PAGE_FLAG_MASK      (~0)
 
@@ -321,21 +317,22 @@ void paging_init(void);
 void setup_idle_pagetable(void);
 #endif /* !defined(__ASSEMBLY__) */
 
-#define _PAGE_PRESENT  0x001U
-#define _PAGE_RW       0x002U
-#define _PAGE_USER     0x004U
-#define _PAGE_PWT      0x008U
-#define _PAGE_PCD      0x010U
-#define _PAGE_ACCESSED 0x020U
-#define _PAGE_DIRTY    0x040U
-#define _PAGE_PAT      0x080U
-#define _PAGE_PSE      0x080U
-#define _PAGE_GLOBAL   0x100U
-#define _PAGE_AVAIL0   0x200U
-#define _PAGE_AVAIL1   0x400U
-#define _PAGE_AVAIL2   0x800U
-#define _PAGE_AVAIL    0xE00U
-#define _PAGE_PSE_PAT 0x1000U
+#define _PAGE_PRESENT  _AC(0x001,U)
+#define _PAGE_RW       _AC(0x002,U)
+#define _PAGE_USER     _AC(0x004,U)
+#define _PAGE_PWT      _AC(0x008,U)
+#define _PAGE_PCD      _AC(0x010,U)
+#define _PAGE_ACCESSED _AC(0x020,U)
+#define _PAGE_DIRTY    _AC(0x040,U)
+#define _PAGE_PAT      _AC(0x080,U)
+#define _PAGE_PSE      _AC(0x080,U)
+#define _PAGE_GLOBAL   _AC(0x100,U)
+#define _PAGE_AVAIL0   _AC(0x200,U)
+#define _PAGE_AVAIL1   _AC(0x400,U)
+#define _PAGE_AVAIL2   _AC(0x800,U)
+#define _PAGE_AVAIL    _AC(0xE00,U)
+#define _PAGE_PSE_PAT _AC(0x1000,U)
+/* non-architectural flags */
 #define _PAGE_PAGED   0x2000U
 #define _PAGE_SHARED  0x4000U
 
@@ -356,6 +353,8 @@ void setup_idle_pagetable(void);
 #define __PAGE_HYPERVISOR_NOCACHE \
     (_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_PCD | _PAGE_ACCESSED)
 
+#define MAP_SMALL_PAGES _PAGE_AVAIL0 /* don't use superpages mappings */
+
 #ifndef __ASSEMBLY__
 
 /* Allocator functions for Xen pagetables. */
@@ -369,7 +368,6 @@ l3_pgentry_t *virt_to_xen_l3e(unsigned l
 extern void set_pdx_range(unsigned long smfn, unsigned long emfn);
 
 /* Map machine page range in Xen virtual address space. */
-#define MAP_SMALL_PAGES _PAGE_AVAIL0 /* don't use superpages for the mapping */
 int map_pages_to_xen(
     unsigned long virt,
     unsigned long mfn,

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:35 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYd-0003bo-Kc; Fri, 14 Sep 2012 10:55:35 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYc-0003Yx-6w
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:34 +0000
Received: from [85.158.139.83:49577] by server-12.bemta-5.messagelabs.com id
	B4/1B-19338-52D03505; Fri, 14 Sep 2012 10:55:33 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1347620131!30329147!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22312 invoked from network); 14 Sep 2012 10:55:32 -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;
	14 Sep 2012 10: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 1TCTYY-00015A-UF
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYY-0000ni-Sl
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:30 +0000
Message-Id: <E1TCTYY-0000ni-Sl@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:30 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] gnttab: cleanup of
	number-of-active-frames calculations
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347438081 -7200
# Node ID 35fa512c60b2bb8e907e4c7cd3a3ef98bc671cfb
# Parent  dd40b43f16bc5bebd833d4cd2691a5b2a5fbef27
gnttab: cleanup of number-of-active-frames calculations

max_nr_active_grant_frames() is merly is special case of
num_act_frames_from_sha_frames(), so there's no need to have a special
case implementation for it.

Further, some of the related definitions (including the "struct
active_grant_entry" definition itself) can (and hence should) really be
private to grant_table.c.

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


diff -r dd40b43f16bc -r 35fa512c60b2 xen/common/grant_table.c
--- a/xen/common/grant_table.c	Wed Sep 12 10:20:18 2012 +0200
+++ b/xen/common/grant_table.c	Wed Sep 12 10:21:21 2012 +0200
@@ -127,10 +127,45 @@ shared_entry_header(struct grant_table *
     else
         return &shared_entry_v2(t, ref).hdr;
 }
+
+/* Active grant entry - used for shadowing GTF_permit_access grants. */
+struct active_grant_entry {
+    u32           pin;    /* Reference count information.             */
+    domid_t       domid;  /* Domain being granted access.             */
+    struct domain *trans_domain;
+    uint32_t      trans_gref;
+    unsigned long frame;  /* Frame being granted.                     */
+    unsigned long gfn;    /* Guest's idea of the frame being granted. */
+    unsigned      is_sub_page:1; /* True if this is a sub-page grant. */
+    unsigned      start:15; /* For sub-page grants, the start offset
+                               in the page.                           */
+    unsigned      length:16; /* For sub-page grants, the length of the
+                                grant.                                */
+};
+
 #define ACGNT_PER_PAGE (PAGE_SIZE / sizeof(struct active_grant_entry))
 #define active_entry(t, e) \
     ((t)->active[(e)/ACGNT_PER_PAGE][(e)%ACGNT_PER_PAGE])
 
+static inline unsigned int
+num_act_frames_from_sha_frames(const unsigned int num)
+{
+    /* How many frames are needed for the active grant table,
+     * given the size of the shared grant table? */
+    unsigned int sha_per_page = PAGE_SIZE / sizeof(grant_entry_v1_t);
+    unsigned int num_sha_entries = num * sha_per_page;
+    return (num_sha_entries + (ACGNT_PER_PAGE - 1)) / ACGNT_PER_PAGE;
+}
+
+#define max_nr_active_grant_frames \
+    num_act_frames_from_sha_frames(max_nr_grant_frames)
+
+static inline unsigned int
+nr_active_grant_frames(struct grant_table *gt)
+{
+    return num_act_frames_from_sha_frames(nr_grant_frames(gt));
+}
+
 /* Check if the page has been paged out, or needs unsharing. 
    If rc == GNTST_okay, *page contains the page struct with a ref taken.
    Caller must do put_page(*page).
@@ -2542,13 +2577,6 @@ do_grant_table_op(
 #include "compat/grant_table.c"
 #endif
 
-static unsigned int max_nr_active_grant_frames(void)
-{
-    return (((max_nr_grant_frames * (PAGE_SIZE / sizeof(grant_entry_v1_t))) + 
-                    ((PAGE_SIZE / sizeof(struct active_grant_entry))-1)) 
-                   / (PAGE_SIZE / sizeof(struct active_grant_entry)));
-}
-
 int 
 grant_table_create(
     struct domain *d)
@@ -2565,7 +2593,7 @@ grant_table_create(
 
     /* Active grant table. */
     if ( (t->active = xzalloc_array(struct active_grant_entry *,
-                                    max_nr_active_grant_frames())) == NULL )
+                                    max_nr_active_grant_frames)) == NULL )
         goto no_mem_1;
     for ( i = 0;
           i < num_act_frames_from_sha_frames(INITIAL_NR_GRANT_FRAMES); i++ )
diff -r dd40b43f16bc -r 35fa512c60b2 xen/include/xen/grant_table.h
--- a/xen/include/xen/grant_table.h	Wed Sep 12 10:20:18 2012 +0200
+++ b/xen/include/xen/grant_table.h	Wed Sep 12 10:21:21 2012 +0200
@@ -28,21 +28,6 @@
 #include <asm/page.h>
 #include <asm/grant_table.h>
 
-/* Active grant entry - used for shadowing GTF_permit_access grants. */
-struct active_grant_entry {
-    u32           pin;    /* Reference count information.             */
-    domid_t       domid;  /* Domain being granted access.             */
-    struct domain *trans_domain;
-    uint32_t      trans_gref;
-    unsigned long frame;  /* Frame being granted.                     */
-    unsigned long gfn;    /* Guest's idea of the frame being granted. */
-    unsigned      is_sub_page:1; /* True if this is a sub-page grant. */
-    unsigned      start:15; /* For sub-page grants, the start offset
-                               in the page.                           */
-    unsigned      length:16; /* For sub-page grants, the length of the
-                                grant.                                */
-};
-
  /* Count of writable host-CPU mappings. */
 #define GNTPIN_hstw_shift    (0)
 #define GNTPIN_hstw_inc      (1 << GNTPIN_hstw_shift)
@@ -147,23 +132,4 @@ static inline unsigned int grant_to_stat
         GRANT_STATUS_PER_PAGE;
 }
 
-static inline unsigned int
-num_act_frames_from_sha_frames(const unsigned int num)
-{
-    /* How many frames are needed for the active grant table,
-     * given the size of the shared grant table? */
-    unsigned act_per_page = PAGE_SIZE / sizeof(struct active_grant_entry);
-    unsigned sha_per_page = PAGE_SIZE / sizeof(grant_entry_v1_t);
-    unsigned num_sha_entries = num * sha_per_page;
-    unsigned num_act_frames =
-        (num_sha_entries + (act_per_page-1)) / act_per_page;
-    return num_act_frames;
-}
-
-static inline unsigned int
-nr_active_grant_frames(struct grant_table *gt)
-{
-    return num_act_frames_from_sha_frames(nr_grant_frames(gt));
-}
-
 #endif /* __XEN_GRANT_TABLE_H__ */

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:35 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYd-0003bo-Kc; Fri, 14 Sep 2012 10:55:35 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYc-0003Yx-6w
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:34 +0000
Received: from [85.158.139.83:49577] by server-12.bemta-5.messagelabs.com id
	B4/1B-19338-52D03505; Fri, 14 Sep 2012 10:55:33 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1347620131!30329147!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22312 invoked from network); 14 Sep 2012 10:55:32 -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;
	14 Sep 2012 10: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 1TCTYY-00015A-UF
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYY-0000ni-Sl
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:30 +0000
Message-Id: <E1TCTYY-0000ni-Sl@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:30 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] gnttab: cleanup of
	number-of-active-frames calculations
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347438081 -7200
# Node ID 35fa512c60b2bb8e907e4c7cd3a3ef98bc671cfb
# Parent  dd40b43f16bc5bebd833d4cd2691a5b2a5fbef27
gnttab: cleanup of number-of-active-frames calculations

max_nr_active_grant_frames() is merly is special case of
num_act_frames_from_sha_frames(), so there's no need to have a special
case implementation for it.

Further, some of the related definitions (including the "struct
active_grant_entry" definition itself) can (and hence should) really be
private to grant_table.c.

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


diff -r dd40b43f16bc -r 35fa512c60b2 xen/common/grant_table.c
--- a/xen/common/grant_table.c	Wed Sep 12 10:20:18 2012 +0200
+++ b/xen/common/grant_table.c	Wed Sep 12 10:21:21 2012 +0200
@@ -127,10 +127,45 @@ shared_entry_header(struct grant_table *
     else
         return &shared_entry_v2(t, ref).hdr;
 }
+
+/* Active grant entry - used for shadowing GTF_permit_access grants. */
+struct active_grant_entry {
+    u32           pin;    /* Reference count information.             */
+    domid_t       domid;  /* Domain being granted access.             */
+    struct domain *trans_domain;
+    uint32_t      trans_gref;
+    unsigned long frame;  /* Frame being granted.                     */
+    unsigned long gfn;    /* Guest's idea of the frame being granted. */
+    unsigned      is_sub_page:1; /* True if this is a sub-page grant. */
+    unsigned      start:15; /* For sub-page grants, the start offset
+                               in the page.                           */
+    unsigned      length:16; /* For sub-page grants, the length of the
+                                grant.                                */
+};
+
 #define ACGNT_PER_PAGE (PAGE_SIZE / sizeof(struct active_grant_entry))
 #define active_entry(t, e) \
     ((t)->active[(e)/ACGNT_PER_PAGE][(e)%ACGNT_PER_PAGE])
 
+static inline unsigned int
+num_act_frames_from_sha_frames(const unsigned int num)
+{
+    /* How many frames are needed for the active grant table,
+     * given the size of the shared grant table? */
+    unsigned int sha_per_page = PAGE_SIZE / sizeof(grant_entry_v1_t);
+    unsigned int num_sha_entries = num * sha_per_page;
+    return (num_sha_entries + (ACGNT_PER_PAGE - 1)) / ACGNT_PER_PAGE;
+}
+
+#define max_nr_active_grant_frames \
+    num_act_frames_from_sha_frames(max_nr_grant_frames)
+
+static inline unsigned int
+nr_active_grant_frames(struct grant_table *gt)
+{
+    return num_act_frames_from_sha_frames(nr_grant_frames(gt));
+}
+
 /* Check if the page has been paged out, or needs unsharing. 
    If rc == GNTST_okay, *page contains the page struct with a ref taken.
    Caller must do put_page(*page).
@@ -2542,13 +2577,6 @@ do_grant_table_op(
 #include "compat/grant_table.c"
 #endif
 
-static unsigned int max_nr_active_grant_frames(void)
-{
-    return (((max_nr_grant_frames * (PAGE_SIZE / sizeof(grant_entry_v1_t))) + 
-                    ((PAGE_SIZE / sizeof(struct active_grant_entry))-1)) 
-                   / (PAGE_SIZE / sizeof(struct active_grant_entry)));
-}
-
 int 
 grant_table_create(
     struct domain *d)
@@ -2565,7 +2593,7 @@ grant_table_create(
 
     /* Active grant table. */
     if ( (t->active = xzalloc_array(struct active_grant_entry *,
-                                    max_nr_active_grant_frames())) == NULL )
+                                    max_nr_active_grant_frames)) == NULL )
         goto no_mem_1;
     for ( i = 0;
           i < num_act_frames_from_sha_frames(INITIAL_NR_GRANT_FRAMES); i++ )
diff -r dd40b43f16bc -r 35fa512c60b2 xen/include/xen/grant_table.h
--- a/xen/include/xen/grant_table.h	Wed Sep 12 10:20:18 2012 +0200
+++ b/xen/include/xen/grant_table.h	Wed Sep 12 10:21:21 2012 +0200
@@ -28,21 +28,6 @@
 #include <asm/page.h>
 #include <asm/grant_table.h>
 
-/* Active grant entry - used for shadowing GTF_permit_access grants. */
-struct active_grant_entry {
-    u32           pin;    /* Reference count information.             */
-    domid_t       domid;  /* Domain being granted access.             */
-    struct domain *trans_domain;
-    uint32_t      trans_gref;
-    unsigned long frame;  /* Frame being granted.                     */
-    unsigned long gfn;    /* Guest's idea of the frame being granted. */
-    unsigned      is_sub_page:1; /* True if this is a sub-page grant. */
-    unsigned      start:15; /* For sub-page grants, the start offset
-                               in the page.                           */
-    unsigned      length:16; /* For sub-page grants, the length of the
-                                grant.                                */
-};
-
  /* Count of writable host-CPU mappings. */
 #define GNTPIN_hstw_shift    (0)
 #define GNTPIN_hstw_inc      (1 << GNTPIN_hstw_shift)
@@ -147,23 +132,4 @@ static inline unsigned int grant_to_stat
         GRANT_STATUS_PER_PAGE;
 }
 
-static inline unsigned int
-num_act_frames_from_sha_frames(const unsigned int num)
-{
-    /* How many frames are needed for the active grant table,
-     * given the size of the shared grant table? */
-    unsigned act_per_page = PAGE_SIZE / sizeof(struct active_grant_entry);
-    unsigned sha_per_page = PAGE_SIZE / sizeof(grant_entry_v1_t);
-    unsigned num_sha_entries = num * sha_per_page;
-    unsigned num_act_frames =
-        (num_sha_entries + (act_per_page-1)) / act_per_page;
-    return num_act_frames;
-}
-
-static inline unsigned int
-nr_active_grant_frames(struct grant_table *gt)
-{
-    return num_act_frames_from_sha_frames(nr_grant_frames(gt));
-}
-
 #endif /* __XEN_GRANT_TABLE_H__ */

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:37 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYe-0003dZ-Ni; Fri, 14 Sep 2012 10:55:36 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYc-0003Q9-Sb
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:35 +0000
Received: from [85.158.143.35:40549] by server-1.bemta-4.messagelabs.com id
	66/B7-12504-52D03505; Fri, 14 Sep 2012 10:55:33 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-21.messagelabs.com!1347620128!16874481!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12351 invoked from network); 14 Sep 2012 10:55:30 -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;
	14 Sep 2012 10: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 1TCTYW-00014m-Ju
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYW-0000mj-IP
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:28 +0000
Message-Id: <E1TCTYW-0000mj-IP@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:27 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86-64: construct static,
	uniform parts of page tables at build time
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347372289 -7200
# Node ID f47bc4eb8256cba78517137f59029deed3144aad
# Parent  2378a69cd0f240ee87a53bfa4ef3c815dc0c8155
x86-64: construct static, uniform parts of page tables at build time

... rather than at boot time, removing unnecessary redundancy between
EFI and legacy boot code.

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


diff -r 2378a69cd0f2 -r f47bc4eb8256 xen/arch/x86/boot/head.S
--- a/xen/arch/x86/boot/head.S	Tue Sep 11 16:03:38 2012 +0200
+++ b/xen/arch/x86/boot/head.S	Tue Sep 11 16:04:49 2012 +0200
@@ -123,46 +123,19 @@ 1:      mov     %edx,sym_phys(cpuid_ext_
         /* Check for availability of long mode. */
         bt      $29,%edx
         jnc     bad_cpu
-        /* Initialise L2 identity-map and xen page table entries (16MB). */
-        mov     $sym_phys(l2_xenmap),%esi
+        /* Initialise L2 boot-map page table entries (16MB). */
         mov     $sym_phys(l2_bootmap),%edx
-        mov     $0x1e3,%eax                  /* PRESENT+RW+A+D+2MB+GLOBAL */
+        mov     $PAGE_HYPERVISOR|_PAGE_PSE,%eax
         mov     $8,%ecx
-1:      mov     %eax,(%esi)
-        add     $8,%esi
-        mov     %eax,(%edx)
+1:      mov     %eax,(%edx)
         add     $8,%edx
         add     $(1<<L2_PAGETABLE_SHIFT),%eax
         loop    1b
-        /* Initialise L2 fixmap page directory entry. */
-        mov     $(sym_phys(l1_fixmap)+7),%eax
-        mov     %eax,sym_phys(l2_fixmap) + l2_table_offset(FIXADDR_TOP-1)*8
-        /* Initialise L3 identity-map page directory entries. */
-        mov     $sym_phys(l3_identmap),%edi
-        mov     $(sym_phys(l2_identmap)+7),%eax
-        mov     $4,%ecx
-1:      mov     %eax,(%edi)
-        add     $8,%edi
-        add     $PAGE_SIZE,%eax
-        loop    1b
-        /* Initialise L3 xen-map and fixmap page directory entries. */
-        mov     $(sym_phys(l2_xenmap)+7),%eax
-        mov     %eax,sym_phys(l3_xenmap) + l3_table_offset(XEN_VIRT_START)*8
-        mov     $(sym_phys(l2_fixmap)+7),%eax
-        mov     %eax,sym_phys(l3_xenmap) + l3_table_offset(FIXADDR_TOP-1)*8
         /* Initialise L3 boot-map page directory entry. */
-        mov     $(sym_phys(l2_bootmap)+7),%eax
+        mov     $sym_phys(l2_bootmap)+__PAGE_HYPERVISOR,%eax
         mov     %eax,sym_phys(l3_bootmap) + 0*8
-        /* Hook identity-map, xen-map, and boot-map L3 tables into PML4. */
-        mov     $(sym_phys(l3_bootmap)+7),%eax
-        mov     %eax,sym_phys(idle_pg_table) + 0*8
-        mov     $(sym_phys(l3_identmap)+7),%eax
-        mov     %eax,sym_phys(idle_pg_table) + l4_table_offset(DIRECTMAP_VIRT_START)*8
-        mov     $(sym_phys(l3_xenmap)+7),%eax
-        mov     %eax,sym_phys(idle_pg_table) + l4_table_offset(XEN_VIRT_START)*8
         /* Hook 4kB mappings of first 2MB of memory into L2. */
         mov     $sym_phys(l1_identmap)+__PAGE_HYPERVISOR,%edi
-        mov     %edi,sym_phys(l2_identmap)
         mov     %edi,sym_phys(l2_xenmap)
         mov     %edi,sym_phys(l2_bootmap)
 #endif
diff -r 2378a69cd0f2 -r f47bc4eb8256 xen/arch/x86/boot/x86_64.S
--- a/xen/arch/x86/boot/x86_64.S	Tue Sep 11 16:03:38 2012 +0200
+++ b/xen/arch/x86/boot/x86_64.S	Tue Sep 11 16:04:49 2012 +0200
@@ -128,10 +128,13 @@ ENTRY(boot_cpu_compat_gdt_table)
         .quad 0x0000910000000000     /* per-CPU entry (limit == cpu)      */
         .align PAGE_SIZE, 0
 
+	.globl __page_tables_start, __page_tables_end
+__page_tables_start:
+
 /* Mapping of first 16 megabytes of memory. */
         .globl l2_identmap
 l2_identmap:
-        .quad 0
+        .quad sym_phys(l1_identmap) + __PAGE_HYPERVISOR
         pfn = 0
         .rept 7
         pfn = pfn + (1 << PAGETABLE_ORDER)
@@ -139,3 +142,68 @@ l2_identmap:
         .endr
         .fill 4 * L2_PAGETABLE_ENTRIES - 8, 8, 0
         .size l2_identmap, . - l2_identmap
+
+        .globl l2_xenmap
+l2_xenmap:
+        idx = 0
+        .rept 8
+        .quad sym_phys(__image_base__) + (idx << L2_PAGETABLE_SHIFT) + (PAGE_HYPERVISOR | _PAGE_PSE)
+        idx = idx + 1
+        .endr
+        .fill L2_PAGETABLE_ENTRIES - 8, 8, 0
+        .size l2_xenmap, . - l2_xenmap
+
+l2_fixmap:
+        idx = 0
+        .rept L2_PAGETABLE_ENTRIES
+        .if idx == l2_table_offset(FIXADDR_TOP - 1)
+        .quad sym_phys(l1_fixmap) + __PAGE_HYPERVISOR
+        .else
+        .quad 0
+        .endif
+        idx = idx + 1
+        .endr
+        .size l2_fixmap, . - l2_fixmap
+
+        .globl l3_identmap
+l3_identmap:
+        idx = 0
+        .rept 4
+        .quad sym_phys(l2_identmap) + (idx << PAGE_SHIFT) + __PAGE_HYPERVISOR
+        idx = idx + 1
+        .endr
+        .fill L3_PAGETABLE_ENTRIES - 4, 8, 0
+        .size l3_identmap, . - l3_identmap
+
+l3_xenmap:
+        idx = 0
+        .rept L3_PAGETABLE_ENTRIES
+        .if idx == l3_table_offset(XEN_VIRT_START)
+        .quad sym_phys(l2_xenmap) + __PAGE_HYPERVISOR
+        .elseif idx == l3_table_offset(FIXADDR_TOP - 1)
+        .quad sym_phys(l2_fixmap) + __PAGE_HYPERVISOR
+        .else
+        .quad 0
+        .endif
+        idx = idx + 1
+        .endr
+        .size l3_xenmap, . - l3_xenmap
+
+/* Top-level master (and idle-domain) page directory. */
+        .globl idle_pg_table
+idle_pg_table:
+        .quad sym_phys(l3_bootmap) + __PAGE_HYPERVISOR
+        idx = 1
+        .rept L4_PAGETABLE_ENTRIES - 1
+        .if idx == l4_table_offset(DIRECTMAP_VIRT_START)
+        .quad sym_phys(l3_identmap) + __PAGE_HYPERVISOR
+        .elseif idx == l4_table_offset(XEN_VIRT_START)
+        .quad sym_phys(l3_xenmap) + __PAGE_HYPERVISOR
+        .else
+        .quad 0
+        .endif
+        idx = idx + 1
+        .endr
+        .size idle_pg_table, . - idle_pg_table
+
+__page_tables_end:
diff -r 2378a69cd0f2 -r f47bc4eb8256 xen/arch/x86/efi/boot.c
--- a/xen/arch/x86/efi/boot.c	Tue Sep 11 16:03:38 2012 +0200
+++ b/xen/arch/x86/efi/boot.c	Tue Sep 11 16:04:49 2012 +0200
@@ -573,6 +573,10 @@ static int __init set_color(u32 mask, in
    return max(*pos + *sz, bpp);
 }
 
+extern const intpte_t __page_tables_start[], __page_tables_end[];
+#define in_page_tables(v) ((intpte_t *)(v) >= __page_tables_start && \
+                           (intpte_t *)(v) < __page_tables_end)
+
 #define PE_BASE_RELOC_ABS      0
 #define PE_BASE_RELOC_HIGHLOW  3
 #define PE_BASE_RELOC_DIR64   10
@@ -604,11 +608,19 @@ static void __init relocate_image(unsign
                 break;
             case PE_BASE_RELOC_HIGHLOW:
                 if ( delta )
+                {
                     *(u32 *)addr += delta;
+                    if ( in_page_tables(addr) )
+                        *(u32 *)addr += xen_phys_start;
+                }
                 break;
             case PE_BASE_RELOC_DIR64:
                 if ( delta )
+                {
                     *(u64 *)addr += delta;
+                    if ( in_page_tables(addr) )
+                        *(intpte_t *)addr += xen_phys_start;
+                }
                 break;
             default:
                 blexit(L"Unsupported relocation type\r\n");
@@ -1113,43 +1125,21 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SY
         *(u16 *)(*trampoline_ptr + (long)trampoline_ptr) =
             trampoline_phys >> 4;
 
-    /* Initialise L2 identity-map and xen page table entries (16MB). */
+    /* Initialise L2 identity-map and boot-map page table entries (16MB). */
     for ( i = 0; i < 8; ++i )
     {
         unsigned int slot = (xen_phys_start >> L2_PAGETABLE_SHIFT) + i;
         paddr_t addr = slot << L2_PAGETABLE_SHIFT;
 
         l2_identmap[slot] = l2e_from_paddr(addr, PAGE_HYPERVISOR|_PAGE_PSE);
-        l2_xenmap[i] = l2e_from_paddr(addr, PAGE_HYPERVISOR|_PAGE_PSE);
         slot &= L2_PAGETABLE_ENTRIES - 1;
         l2_bootmap[slot] = l2e_from_paddr(addr, __PAGE_HYPERVISOR|_PAGE_PSE);
     }
-    /* Initialise L2 fixmap page directory entry. */
-    l2_fixmap[l2_table_offset(FIXADDR_TOP - 1)] =
-        l2e_from_paddr((UINTN)l1_fixmap, __PAGE_HYPERVISOR);
-    /* Initialise L3 identity-map page directory entries. */
-    for ( i = 0; i < ARRAY_SIZE(l2_identmap) / L2_PAGETABLE_ENTRIES; ++i )
-        l3_identmap[i] = l3e_from_paddr((UINTN)(l2_identmap +
-                                                i * L2_PAGETABLE_ENTRIES),
-                                        __PAGE_HYPERVISOR);
-    /* Initialise L3 xen-map and fixmap page directory entries. */
-    l3_xenmap[l3_table_offset(XEN_VIRT_START)] =
-        l3e_from_paddr((UINTN)l2_xenmap, __PAGE_HYPERVISOR);
-    l3_xenmap[l3_table_offset(FIXADDR_TOP - 1)] =
-        l3e_from_paddr((UINTN)l2_fixmap, __PAGE_HYPERVISOR);
     /* Initialise L3 boot-map page directory entries. */
     l3_bootmap[l3_table_offset(xen_phys_start)] =
         l3e_from_paddr((UINTN)l2_bootmap, __PAGE_HYPERVISOR);
     l3_bootmap[l3_table_offset(xen_phys_start + (8 << L2_PAGETABLE_SHIFT) - 1)] =
         l3e_from_paddr((UINTN)l2_bootmap, __PAGE_HYPERVISOR);
-    /* Hook identity-map, xen-map, and boot-map L3 tables into PML4. */
-    idle_pg_table[0] = l4e_from_paddr((UINTN)l3_bootmap, __PAGE_HYPERVISOR);
-    idle_pg_table[l4_table_offset(DIRECTMAP_VIRT_START)] =
-        l4e_from_paddr((UINTN)l3_identmap, __PAGE_HYPERVISOR);
-    idle_pg_table[l4_table_offset(XEN_VIRT_START)] =
-        l4e_from_paddr((UINTN)l3_xenmap, __PAGE_HYPERVISOR);
-    /* Hook 4kB mappings of first 2MB of memory into L2. */
-    l2_identmap[0] = l2e_from_paddr((UINTN)l1_identmap, __PAGE_HYPERVISOR);
 
     if ( gop )
     {
diff -r 2378a69cd0f2 -r f47bc4eb8256 xen/arch/x86/x86_64/mm.c
--- a/xen/arch/x86/x86_64/mm.c	Tue Sep 11 16:03:38 2012 +0200
+++ b/xen/arch/x86/x86_64/mm.c	Tue Sep 11 16:04:49 2012 +0200
@@ -49,24 +49,6 @@ unsigned int __read_mostly pfn_pdx_hole_
 
 unsigned int __read_mostly m2p_compat_vstart = __HYPERVISOR_COMPAT_VIRT_START;
 
-/* Top-level master (and idle-domain) page directory. */
-l4_pgentry_t __attribute__ ((__section__ (".bss.page_aligned")))
-    idle_pg_table[L4_PAGETABLE_ENTRIES];
-
-/* Enough page directories to map bottom 4GB of the memory map. */
-l3_pgentry_t __attribute__ ((__section__ (".bss.page_aligned")))
-    l3_identmap[L3_PAGETABLE_ENTRIES];
-
-/* Enough page directories to map the Xen text and static data. */
-l3_pgentry_t __attribute__ ((__section__ (".bss.page_aligned")))
-    l3_xenmap[L3_PAGETABLE_ENTRIES];
-l2_pgentry_t __attribute__ ((__section__ (".bss.page_aligned")))
-    l2_xenmap[L2_PAGETABLE_ENTRIES];
-
-/* Enough page directories to map the early fixmap space. */
-l2_pgentry_t __attribute__ ((__section__ (".bss.page_aligned")))
-    l2_fixmap[L2_PAGETABLE_ENTRIES];
-
 /* Enough page directories to map into the bottom 1GB. */
 l3_pgentry_t __attribute__ ((__section__ (".bss.page_aligned")))
     l3_bootmap[L3_PAGETABLE_ENTRIES];
diff -r 2378a69cd0f2 -r f47bc4eb8256 xen/arch/x86/xen.lds.S
--- a/xen/arch/x86/xen.lds.S	Tue Sep 11 16:03:38 2012 +0200
+++ b/xen/arch/x86/xen.lds.S	Tue Sep 11 16:04:49 2012 +0200
@@ -42,6 +42,10 @@ PHDRS
 }
 SECTIONS
 {
+#if defined(__x86_64__) && !defined(EFI)
+  . = __XEN_VIRT_START;
+  __image_base__ = .;
+#endif
   . = __XEN_VIRT_START + 0x100000;
   _start = .;
   .text : {
diff -r 2378a69cd0f2 -r f47bc4eb8256 xen/include/asm-x86/page.h
--- a/xen/include/asm-x86/page.h	Tue Sep 11 16:03:38 2012 +0200
+++ b/xen/include/asm-x86/page.h	Tue Sep 11 16:04:49 2012 +0200
@@ -304,11 +304,8 @@ extern l2_pgentry_t   idle_pg_table_l2[
 extern l2_pgentry_t  *compat_idle_pg_table_l2;
 extern unsigned int   m2p_compat_vstart;
 extern l2_pgentry_t l2_xenmap[L2_PAGETABLE_ENTRIES],
-    l2_fixmap[L2_PAGETABLE_ENTRIES],
     l2_bootmap[L2_PAGETABLE_ENTRIES];
-extern l3_pgentry_t l3_xenmap[L3_PAGETABLE_ENTRIES],
-    l3_identmap[L3_PAGETABLE_ENTRIES],
-    l3_bootmap[L3_PAGETABLE_ENTRIES];
+extern l3_pgentry_t l3_bootmap[L3_PAGETABLE_ENTRIES];
 #endif
 extern l2_pgentry_t l2_identmap[4*L2_PAGETABLE_ENTRIES];
 extern l1_pgentry_t l1_identmap[L1_PAGETABLE_ENTRIES],

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:37 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYe-0003dZ-Ni; Fri, 14 Sep 2012 10:55:36 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYc-0003Q9-Sb
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:35 +0000
Received: from [85.158.143.35:40549] by server-1.bemta-4.messagelabs.com id
	66/B7-12504-52D03505; Fri, 14 Sep 2012 10:55:33 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-21.messagelabs.com!1347620128!16874481!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12351 invoked from network); 14 Sep 2012 10:55:30 -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;
	14 Sep 2012 10: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 1TCTYW-00014m-Ju
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYW-0000mj-IP
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:28 +0000
Message-Id: <E1TCTYW-0000mj-IP@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:27 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86-64: construct static,
	uniform parts of page tables at build time
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347372289 -7200
# Node ID f47bc4eb8256cba78517137f59029deed3144aad
# Parent  2378a69cd0f240ee87a53bfa4ef3c815dc0c8155
x86-64: construct static, uniform parts of page tables at build time

... rather than at boot time, removing unnecessary redundancy between
EFI and legacy boot code.

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


diff -r 2378a69cd0f2 -r f47bc4eb8256 xen/arch/x86/boot/head.S
--- a/xen/arch/x86/boot/head.S	Tue Sep 11 16:03:38 2012 +0200
+++ b/xen/arch/x86/boot/head.S	Tue Sep 11 16:04:49 2012 +0200
@@ -123,46 +123,19 @@ 1:      mov     %edx,sym_phys(cpuid_ext_
         /* Check for availability of long mode. */
         bt      $29,%edx
         jnc     bad_cpu
-        /* Initialise L2 identity-map and xen page table entries (16MB). */
-        mov     $sym_phys(l2_xenmap),%esi
+        /* Initialise L2 boot-map page table entries (16MB). */
         mov     $sym_phys(l2_bootmap),%edx
-        mov     $0x1e3,%eax                  /* PRESENT+RW+A+D+2MB+GLOBAL */
+        mov     $PAGE_HYPERVISOR|_PAGE_PSE,%eax
         mov     $8,%ecx
-1:      mov     %eax,(%esi)
-        add     $8,%esi
-        mov     %eax,(%edx)
+1:      mov     %eax,(%edx)
         add     $8,%edx
         add     $(1<<L2_PAGETABLE_SHIFT),%eax
         loop    1b
-        /* Initialise L2 fixmap page directory entry. */
-        mov     $(sym_phys(l1_fixmap)+7),%eax
-        mov     %eax,sym_phys(l2_fixmap) + l2_table_offset(FIXADDR_TOP-1)*8
-        /* Initialise L3 identity-map page directory entries. */
-        mov     $sym_phys(l3_identmap),%edi
-        mov     $(sym_phys(l2_identmap)+7),%eax
-        mov     $4,%ecx
-1:      mov     %eax,(%edi)
-        add     $8,%edi
-        add     $PAGE_SIZE,%eax
-        loop    1b
-        /* Initialise L3 xen-map and fixmap page directory entries. */
-        mov     $(sym_phys(l2_xenmap)+7),%eax
-        mov     %eax,sym_phys(l3_xenmap) + l3_table_offset(XEN_VIRT_START)*8
-        mov     $(sym_phys(l2_fixmap)+7),%eax
-        mov     %eax,sym_phys(l3_xenmap) + l3_table_offset(FIXADDR_TOP-1)*8
         /* Initialise L3 boot-map page directory entry. */
-        mov     $(sym_phys(l2_bootmap)+7),%eax
+        mov     $sym_phys(l2_bootmap)+__PAGE_HYPERVISOR,%eax
         mov     %eax,sym_phys(l3_bootmap) + 0*8
-        /* Hook identity-map, xen-map, and boot-map L3 tables into PML4. */
-        mov     $(sym_phys(l3_bootmap)+7),%eax
-        mov     %eax,sym_phys(idle_pg_table) + 0*8
-        mov     $(sym_phys(l3_identmap)+7),%eax
-        mov     %eax,sym_phys(idle_pg_table) + l4_table_offset(DIRECTMAP_VIRT_START)*8
-        mov     $(sym_phys(l3_xenmap)+7),%eax
-        mov     %eax,sym_phys(idle_pg_table) + l4_table_offset(XEN_VIRT_START)*8
         /* Hook 4kB mappings of first 2MB of memory into L2. */
         mov     $sym_phys(l1_identmap)+__PAGE_HYPERVISOR,%edi
-        mov     %edi,sym_phys(l2_identmap)
         mov     %edi,sym_phys(l2_xenmap)
         mov     %edi,sym_phys(l2_bootmap)
 #endif
diff -r 2378a69cd0f2 -r f47bc4eb8256 xen/arch/x86/boot/x86_64.S
--- a/xen/arch/x86/boot/x86_64.S	Tue Sep 11 16:03:38 2012 +0200
+++ b/xen/arch/x86/boot/x86_64.S	Tue Sep 11 16:04:49 2012 +0200
@@ -128,10 +128,13 @@ ENTRY(boot_cpu_compat_gdt_table)
         .quad 0x0000910000000000     /* per-CPU entry (limit == cpu)      */
         .align PAGE_SIZE, 0
 
+	.globl __page_tables_start, __page_tables_end
+__page_tables_start:
+
 /* Mapping of first 16 megabytes of memory. */
         .globl l2_identmap
 l2_identmap:
-        .quad 0
+        .quad sym_phys(l1_identmap) + __PAGE_HYPERVISOR
         pfn = 0
         .rept 7
         pfn = pfn + (1 << PAGETABLE_ORDER)
@@ -139,3 +142,68 @@ l2_identmap:
         .endr
         .fill 4 * L2_PAGETABLE_ENTRIES - 8, 8, 0
         .size l2_identmap, . - l2_identmap
+
+        .globl l2_xenmap
+l2_xenmap:
+        idx = 0
+        .rept 8
+        .quad sym_phys(__image_base__) + (idx << L2_PAGETABLE_SHIFT) + (PAGE_HYPERVISOR | _PAGE_PSE)
+        idx = idx + 1
+        .endr
+        .fill L2_PAGETABLE_ENTRIES - 8, 8, 0
+        .size l2_xenmap, . - l2_xenmap
+
+l2_fixmap:
+        idx = 0
+        .rept L2_PAGETABLE_ENTRIES
+        .if idx == l2_table_offset(FIXADDR_TOP - 1)
+        .quad sym_phys(l1_fixmap) + __PAGE_HYPERVISOR
+        .else
+        .quad 0
+        .endif
+        idx = idx + 1
+        .endr
+        .size l2_fixmap, . - l2_fixmap
+
+        .globl l3_identmap
+l3_identmap:
+        idx = 0
+        .rept 4
+        .quad sym_phys(l2_identmap) + (idx << PAGE_SHIFT) + __PAGE_HYPERVISOR
+        idx = idx + 1
+        .endr
+        .fill L3_PAGETABLE_ENTRIES - 4, 8, 0
+        .size l3_identmap, . - l3_identmap
+
+l3_xenmap:
+        idx = 0
+        .rept L3_PAGETABLE_ENTRIES
+        .if idx == l3_table_offset(XEN_VIRT_START)
+        .quad sym_phys(l2_xenmap) + __PAGE_HYPERVISOR
+        .elseif idx == l3_table_offset(FIXADDR_TOP - 1)
+        .quad sym_phys(l2_fixmap) + __PAGE_HYPERVISOR
+        .else
+        .quad 0
+        .endif
+        idx = idx + 1
+        .endr
+        .size l3_xenmap, . - l3_xenmap
+
+/* Top-level master (and idle-domain) page directory. */
+        .globl idle_pg_table
+idle_pg_table:
+        .quad sym_phys(l3_bootmap) + __PAGE_HYPERVISOR
+        idx = 1
+        .rept L4_PAGETABLE_ENTRIES - 1
+        .if idx == l4_table_offset(DIRECTMAP_VIRT_START)
+        .quad sym_phys(l3_identmap) + __PAGE_HYPERVISOR
+        .elseif idx == l4_table_offset(XEN_VIRT_START)
+        .quad sym_phys(l3_xenmap) + __PAGE_HYPERVISOR
+        .else
+        .quad 0
+        .endif
+        idx = idx + 1
+        .endr
+        .size idle_pg_table, . - idle_pg_table
+
+__page_tables_end:
diff -r 2378a69cd0f2 -r f47bc4eb8256 xen/arch/x86/efi/boot.c
--- a/xen/arch/x86/efi/boot.c	Tue Sep 11 16:03:38 2012 +0200
+++ b/xen/arch/x86/efi/boot.c	Tue Sep 11 16:04:49 2012 +0200
@@ -573,6 +573,10 @@ static int __init set_color(u32 mask, in
    return max(*pos + *sz, bpp);
 }
 
+extern const intpte_t __page_tables_start[], __page_tables_end[];
+#define in_page_tables(v) ((intpte_t *)(v) >= __page_tables_start && \
+                           (intpte_t *)(v) < __page_tables_end)
+
 #define PE_BASE_RELOC_ABS      0
 #define PE_BASE_RELOC_HIGHLOW  3
 #define PE_BASE_RELOC_DIR64   10
@@ -604,11 +608,19 @@ static void __init relocate_image(unsign
                 break;
             case PE_BASE_RELOC_HIGHLOW:
                 if ( delta )
+                {
                     *(u32 *)addr += delta;
+                    if ( in_page_tables(addr) )
+                        *(u32 *)addr += xen_phys_start;
+                }
                 break;
             case PE_BASE_RELOC_DIR64:
                 if ( delta )
+                {
                     *(u64 *)addr += delta;
+                    if ( in_page_tables(addr) )
+                        *(intpte_t *)addr += xen_phys_start;
+                }
                 break;
             default:
                 blexit(L"Unsupported relocation type\r\n");
@@ -1113,43 +1125,21 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SY
         *(u16 *)(*trampoline_ptr + (long)trampoline_ptr) =
             trampoline_phys >> 4;
 
-    /* Initialise L2 identity-map and xen page table entries (16MB). */
+    /* Initialise L2 identity-map and boot-map page table entries (16MB). */
     for ( i = 0; i < 8; ++i )
     {
         unsigned int slot = (xen_phys_start >> L2_PAGETABLE_SHIFT) + i;
         paddr_t addr = slot << L2_PAGETABLE_SHIFT;
 
         l2_identmap[slot] = l2e_from_paddr(addr, PAGE_HYPERVISOR|_PAGE_PSE);
-        l2_xenmap[i] = l2e_from_paddr(addr, PAGE_HYPERVISOR|_PAGE_PSE);
         slot &= L2_PAGETABLE_ENTRIES - 1;
         l2_bootmap[slot] = l2e_from_paddr(addr, __PAGE_HYPERVISOR|_PAGE_PSE);
     }
-    /* Initialise L2 fixmap page directory entry. */
-    l2_fixmap[l2_table_offset(FIXADDR_TOP - 1)] =
-        l2e_from_paddr((UINTN)l1_fixmap, __PAGE_HYPERVISOR);
-    /* Initialise L3 identity-map page directory entries. */
-    for ( i = 0; i < ARRAY_SIZE(l2_identmap) / L2_PAGETABLE_ENTRIES; ++i )
-        l3_identmap[i] = l3e_from_paddr((UINTN)(l2_identmap +
-                                                i * L2_PAGETABLE_ENTRIES),
-                                        __PAGE_HYPERVISOR);
-    /* Initialise L3 xen-map and fixmap page directory entries. */
-    l3_xenmap[l3_table_offset(XEN_VIRT_START)] =
-        l3e_from_paddr((UINTN)l2_xenmap, __PAGE_HYPERVISOR);
-    l3_xenmap[l3_table_offset(FIXADDR_TOP - 1)] =
-        l3e_from_paddr((UINTN)l2_fixmap, __PAGE_HYPERVISOR);
     /* Initialise L3 boot-map page directory entries. */
     l3_bootmap[l3_table_offset(xen_phys_start)] =
         l3e_from_paddr((UINTN)l2_bootmap, __PAGE_HYPERVISOR);
     l3_bootmap[l3_table_offset(xen_phys_start + (8 << L2_PAGETABLE_SHIFT) - 1)] =
         l3e_from_paddr((UINTN)l2_bootmap, __PAGE_HYPERVISOR);
-    /* Hook identity-map, xen-map, and boot-map L3 tables into PML4. */
-    idle_pg_table[0] = l4e_from_paddr((UINTN)l3_bootmap, __PAGE_HYPERVISOR);
-    idle_pg_table[l4_table_offset(DIRECTMAP_VIRT_START)] =
-        l4e_from_paddr((UINTN)l3_identmap, __PAGE_HYPERVISOR);
-    idle_pg_table[l4_table_offset(XEN_VIRT_START)] =
-        l4e_from_paddr((UINTN)l3_xenmap, __PAGE_HYPERVISOR);
-    /* Hook 4kB mappings of first 2MB of memory into L2. */
-    l2_identmap[0] = l2e_from_paddr((UINTN)l1_identmap, __PAGE_HYPERVISOR);
 
     if ( gop )
     {
diff -r 2378a69cd0f2 -r f47bc4eb8256 xen/arch/x86/x86_64/mm.c
--- a/xen/arch/x86/x86_64/mm.c	Tue Sep 11 16:03:38 2012 +0200
+++ b/xen/arch/x86/x86_64/mm.c	Tue Sep 11 16:04:49 2012 +0200
@@ -49,24 +49,6 @@ unsigned int __read_mostly pfn_pdx_hole_
 
 unsigned int __read_mostly m2p_compat_vstart = __HYPERVISOR_COMPAT_VIRT_START;
 
-/* Top-level master (and idle-domain) page directory. */
-l4_pgentry_t __attribute__ ((__section__ (".bss.page_aligned")))
-    idle_pg_table[L4_PAGETABLE_ENTRIES];
-
-/* Enough page directories to map bottom 4GB of the memory map. */
-l3_pgentry_t __attribute__ ((__section__ (".bss.page_aligned")))
-    l3_identmap[L3_PAGETABLE_ENTRIES];
-
-/* Enough page directories to map the Xen text and static data. */
-l3_pgentry_t __attribute__ ((__section__ (".bss.page_aligned")))
-    l3_xenmap[L3_PAGETABLE_ENTRIES];
-l2_pgentry_t __attribute__ ((__section__ (".bss.page_aligned")))
-    l2_xenmap[L2_PAGETABLE_ENTRIES];
-
-/* Enough page directories to map the early fixmap space. */
-l2_pgentry_t __attribute__ ((__section__ (".bss.page_aligned")))
-    l2_fixmap[L2_PAGETABLE_ENTRIES];
-
 /* Enough page directories to map into the bottom 1GB. */
 l3_pgentry_t __attribute__ ((__section__ (".bss.page_aligned")))
     l3_bootmap[L3_PAGETABLE_ENTRIES];
diff -r 2378a69cd0f2 -r f47bc4eb8256 xen/arch/x86/xen.lds.S
--- a/xen/arch/x86/xen.lds.S	Tue Sep 11 16:03:38 2012 +0200
+++ b/xen/arch/x86/xen.lds.S	Tue Sep 11 16:04:49 2012 +0200
@@ -42,6 +42,10 @@ PHDRS
 }
 SECTIONS
 {
+#if defined(__x86_64__) && !defined(EFI)
+  . = __XEN_VIRT_START;
+  __image_base__ = .;
+#endif
   . = __XEN_VIRT_START + 0x100000;
   _start = .;
   .text : {
diff -r 2378a69cd0f2 -r f47bc4eb8256 xen/include/asm-x86/page.h
--- a/xen/include/asm-x86/page.h	Tue Sep 11 16:03:38 2012 +0200
+++ b/xen/include/asm-x86/page.h	Tue Sep 11 16:04:49 2012 +0200
@@ -304,11 +304,8 @@ extern l2_pgentry_t   idle_pg_table_l2[
 extern l2_pgentry_t  *compat_idle_pg_table_l2;
 extern unsigned int   m2p_compat_vstart;
 extern l2_pgentry_t l2_xenmap[L2_PAGETABLE_ENTRIES],
-    l2_fixmap[L2_PAGETABLE_ENTRIES],
     l2_bootmap[L2_PAGETABLE_ENTRIES];
-extern l3_pgentry_t l3_xenmap[L3_PAGETABLE_ENTRIES],
-    l3_identmap[L3_PAGETABLE_ENTRIES],
-    l3_bootmap[L3_PAGETABLE_ENTRIES];
+extern l3_pgentry_t l3_bootmap[L3_PAGETABLE_ENTRIES];
 #endif
 extern l2_pgentry_t l2_identmap[4*L2_PAGETABLE_ENTRIES];
 extern l1_pgentry_t l1_identmap[L1_PAGETABLE_ENTRIES],

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:38 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYf-0003fO-RC; Fri, 14 Sep 2012 10:55:37 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYe-0003dI-US
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:37 +0000
Received: from [85.158.143.99:57228] by server-3.bemta-4.messagelabs.com id
	42/76-08232-82D03505; Fri, 14 Sep 2012 10:55:36 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-216.messagelabs.com!1347620129!30009336!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4968 invoked from network); 14 Sep 2012 10:55:31 -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;
	14 Sep 2012 10: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 1TCTYX-00014v-OD
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYX-0000nE-MD
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:29 +0000
Message-Id: <E1TCTYX-0000nE-MD@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:29 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86-64/EFI: allow chaining of config
	files
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347437974 -7200
# Node ID 8c0aa97d529a55de2ab96be1a5a6e9ed6a9c6bf0
# Parent  ac8f4afccd6c6786a3fd5691e8b0c9b38c47e994
x86-64/EFI: allow chaining of config files

Namely when making use the CONFIG_XEN_COMPAT_* options in the legacy
Linux kernels, newer kernels may not be compatible with older
hypervisors, so trying to boot such a combination makes little sense.
Booting older kernels on newer hypervisors, however, has to always
work.

With the way xen.efi looks for its configuration file, allowing
individual configuration files to refer only to compatible kernels,
and referring from an older- to a newer-hypervisor one (the kernels
of which will, as said, necessarily be compatible with the older
hypervisor) allows to greatly reduce redundancy at least in
development environments where one frequently wants multiple
hypervisors and kernles to be installed in parallel.

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


diff -r ac8f4afccd6c -r 8c0aa97d529a docs/misc/efi.markdown
--- a/docs/misc/efi.markdown	Wed Sep 12 10:17:34 2012 +0200
+++ b/docs/misc/efi.markdown	Wed Sep 12 10:19:34 2012 +0200
@@ -75,6 +75,13 @@ Specifies an XSM module to load.
 
 Specifies a CPU microcode blob to load.
 
+###`chain=<filename>`
+
+Specifies an alternate configuration file to use in case the specified section
+(and in particular its `kernel=` setting) can't be found in the default (or
+specified) configuration file. This is only meaningful in the [global] section
+and really not meant to be used together with the `-cfg=` command line option.
+
 Filenames must be specified relative to the location of the EFI binary.
 
 Extra options to be passed to Xen can also be specified on the command line,
diff -r ac8f4afccd6c -r 8c0aa97d529a xen/arch/x86/efi/boot.c
--- a/xen/arch/x86/efi/boot.c	Wed Sep 12 10:17:34 2012 +0200
+++ b/xen/arch/x86/efi/boot.c	Wed Sep 12 10:19:34 2012 +0200
@@ -809,7 +809,26 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SY
     else
         section.s = get_value(&cfg, "global", "default");
 
-    name.s = get_value(&cfg, section.s, "kernel");
+    for ( ; ; )
+    {
+        name.s = get_value(&cfg, section.s, "kernel");
+        if ( name.s )
+            break;
+        name.s = get_value(&cfg, "global", "chain");
+        if ( !name.s )
+            break;
+        efi_bs->FreePages(cfg.addr, PFN_UP(cfg.size));
+        cfg.addr = 0;
+        if ( !read_file(dir_handle, s2w(&name), &cfg) )
+        {
+            PrintStr(L"Chained configuration file '");
+            PrintStr(name.w);
+            efi_bs->FreePool(name.w);
+            blexit(L"'not found\r\n");
+        }
+        pre_parse(&cfg);
+        efi_bs->FreePool(name.w);
+    }
     if ( !name.s )
         blexit(L"No Dom0 kernel image specified\r\n");
     split_value(name.s);

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:38 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYf-0003fO-RC; Fri, 14 Sep 2012 10:55:37 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYe-0003dI-US
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:37 +0000
Received: from [85.158.143.99:57228] by server-3.bemta-4.messagelabs.com id
	42/76-08232-82D03505; Fri, 14 Sep 2012 10:55:36 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-216.messagelabs.com!1347620129!30009336!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4968 invoked from network); 14 Sep 2012 10:55:31 -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;
	14 Sep 2012 10: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 1TCTYX-00014v-OD
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYX-0000nE-MD
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:29 +0000
Message-Id: <E1TCTYX-0000nE-MD@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:29 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86-64/EFI: allow chaining of config
	files
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347437974 -7200
# Node ID 8c0aa97d529a55de2ab96be1a5a6e9ed6a9c6bf0
# Parent  ac8f4afccd6c6786a3fd5691e8b0c9b38c47e994
x86-64/EFI: allow chaining of config files

Namely when making use the CONFIG_XEN_COMPAT_* options in the legacy
Linux kernels, newer kernels may not be compatible with older
hypervisors, so trying to boot such a combination makes little sense.
Booting older kernels on newer hypervisors, however, has to always
work.

With the way xen.efi looks for its configuration file, allowing
individual configuration files to refer only to compatible kernels,
and referring from an older- to a newer-hypervisor one (the kernels
of which will, as said, necessarily be compatible with the older
hypervisor) allows to greatly reduce redundancy at least in
development environments where one frequently wants multiple
hypervisors and kernles to be installed in parallel.

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


diff -r ac8f4afccd6c -r 8c0aa97d529a docs/misc/efi.markdown
--- a/docs/misc/efi.markdown	Wed Sep 12 10:17:34 2012 +0200
+++ b/docs/misc/efi.markdown	Wed Sep 12 10:19:34 2012 +0200
@@ -75,6 +75,13 @@ Specifies an XSM module to load.
 
 Specifies a CPU microcode blob to load.
 
+###`chain=<filename>`
+
+Specifies an alternate configuration file to use in case the specified section
+(and in particular its `kernel=` setting) can't be found in the default (or
+specified) configuration file. This is only meaningful in the [global] section
+and really not meant to be used together with the `-cfg=` command line option.
+
 Filenames must be specified relative to the location of the EFI binary.
 
 Extra options to be passed to Xen can also be specified on the command line,
diff -r ac8f4afccd6c -r 8c0aa97d529a xen/arch/x86/efi/boot.c
--- a/xen/arch/x86/efi/boot.c	Wed Sep 12 10:17:34 2012 +0200
+++ b/xen/arch/x86/efi/boot.c	Wed Sep 12 10:19:34 2012 +0200
@@ -809,7 +809,26 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SY
     else
         section.s = get_value(&cfg, "global", "default");
 
-    name.s = get_value(&cfg, section.s, "kernel");
+    for ( ; ; )
+    {
+        name.s = get_value(&cfg, section.s, "kernel");
+        if ( name.s )
+            break;
+        name.s = get_value(&cfg, "global", "chain");
+        if ( !name.s )
+            break;
+        efi_bs->FreePages(cfg.addr, PFN_UP(cfg.size));
+        cfg.addr = 0;
+        if ( !read_file(dir_handle, s2w(&name), &cfg) )
+        {
+            PrintStr(L"Chained configuration file '");
+            PrintStr(name.w);
+            efi_bs->FreePool(name.w);
+            blexit(L"'not found\r\n");
+        }
+        pre_parse(&cfg);
+        efi_bs->FreePool(name.w);
+    }
     if ( !name.s )
         blexit(L"No Dom0 kernel image specified\r\n");
     split_value(name.s);

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:41 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYj-0003jt-0U; Fri, 14 Sep 2012 10:55:41 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYh-0003dI-Kn
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:39 +0000
Received: from [85.158.143.35:63275] by server-3.bemta-4.messagelabs.com id
	C6/86-08232-B2D03505; Fri, 14 Sep 2012 10:55:39 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-21.messagelabs.com!1347620137!7209659!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8946 invoked from network); 14 Sep 2012 10:55:38 -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;
	14 Sep 2012 10: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 1TCTYf-000162-4r
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYf-0000pw-3K
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:37 +0000
Message-Id: <E1TCTYf-0000pw-3K@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:36 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: HYPERVISOR_VIRT_END is always
	defined. Remove ifdef'ery.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347477790 -3600
# Node ID baf1da1e0be53c018dcec16292c9f33258b71e35
# Parent  9686576228e552bd235a4dc2399e8855417c1142
x86: HYPERVISOR_VIRT_END is always defined. Remove ifdef'ery.

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r 9686576228e5 -r baf1da1e0be5 xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c	Wed Sep 12 20:21:02 2012 +0100
+++ b/xen/arch/x86/setup.c	Wed Sep 12 20:23:10 2012 +0100
@@ -1087,9 +1087,7 @@ void __init __start_xen(unsigned long mb
 
     /* Check definitions in public headers match internal defs. */
     BUILD_BUG_ON(__HYPERVISOR_VIRT_START != HYPERVISOR_VIRT_START);
-#ifdef HYPERVISOR_VIRT_END
     BUILD_BUG_ON(__HYPERVISOR_VIRT_END   != HYPERVISOR_VIRT_END);
-#endif
     BUILD_BUG_ON(MACH2PHYS_VIRT_START != RO_MPT_VIRT_START);
     BUILD_BUG_ON(MACH2PHYS_VIRT_END   != RO_MPT_VIRT_END);
 
diff -r 9686576228e5 -r baf1da1e0be5 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c	Wed Sep 12 20:21:02 2012 +0100
+++ b/xen/arch/x86/traps.c	Wed Sep 12 20:23:10 2012 +0100
@@ -1161,13 +1161,8 @@ static int handle_gdt_ldt_mapping_fault(
     return EXCRET_fault_fixed;
 }
 
-#ifdef HYPERVISOR_VIRT_END
 #define IN_HYPERVISOR_RANGE(va) \
     (((va) >= HYPERVISOR_VIRT_START) && ((va) < HYPERVISOR_VIRT_END))
-#else
-#define IN_HYPERVISOR_RANGE(va) \
-    (((va) >= HYPERVISOR_VIRT_START))
-#endif
 
 enum pf_type {
     real_fault,

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:41 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYj-0003jt-0U; Fri, 14 Sep 2012 10:55:41 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYh-0003dI-Kn
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:39 +0000
Received: from [85.158.143.35:63275] by server-3.bemta-4.messagelabs.com id
	C6/86-08232-B2D03505; Fri, 14 Sep 2012 10:55:39 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-21.messagelabs.com!1347620137!7209659!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8946 invoked from network); 14 Sep 2012 10:55:38 -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;
	14 Sep 2012 10: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 1TCTYf-000162-4r
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYf-0000pw-3K
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:37 +0000
Message-Id: <E1TCTYf-0000pw-3K@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:36 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: HYPERVISOR_VIRT_END is always
	defined. Remove ifdef'ery.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347477790 -3600
# Node ID baf1da1e0be53c018dcec16292c9f33258b71e35
# Parent  9686576228e552bd235a4dc2399e8855417c1142
x86: HYPERVISOR_VIRT_END is always defined. Remove ifdef'ery.

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r 9686576228e5 -r baf1da1e0be5 xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c	Wed Sep 12 20:21:02 2012 +0100
+++ b/xen/arch/x86/setup.c	Wed Sep 12 20:23:10 2012 +0100
@@ -1087,9 +1087,7 @@ void __init __start_xen(unsigned long mb
 
     /* Check definitions in public headers match internal defs. */
     BUILD_BUG_ON(__HYPERVISOR_VIRT_START != HYPERVISOR_VIRT_START);
-#ifdef HYPERVISOR_VIRT_END
     BUILD_BUG_ON(__HYPERVISOR_VIRT_END   != HYPERVISOR_VIRT_END);
-#endif
     BUILD_BUG_ON(MACH2PHYS_VIRT_START != RO_MPT_VIRT_START);
     BUILD_BUG_ON(MACH2PHYS_VIRT_END   != RO_MPT_VIRT_END);
 
diff -r 9686576228e5 -r baf1da1e0be5 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c	Wed Sep 12 20:21:02 2012 +0100
+++ b/xen/arch/x86/traps.c	Wed Sep 12 20:23:10 2012 +0100
@@ -1161,13 +1161,8 @@ static int handle_gdt_ldt_mapping_fault(
     return EXCRET_fault_fixed;
 }
 
-#ifdef HYPERVISOR_VIRT_END
 #define IN_HYPERVISOR_RANGE(va) \
     (((va) >= HYPERVISOR_VIRT_START) && ((va) < HYPERVISOR_VIRT_END))
-#else
-#define IN_HYPERVISOR_RANGE(va) \
-    (((va) >= HYPERVISOR_VIRT_START))
-#endif
 
 enum pf_type {
     real_fault,

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:41 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYj-0003k7-3B; Fri, 14 Sep 2012 10: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 1TCTYh-0003Zl-M5
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:39 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1347620124!11024012!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5277 invoked from network); 14 Sep 2012 10:55:25 -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;
	14 Sep 2012 10: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 1TCTYS-000143-Hg
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYS-0000l2-GH
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:24 +0000
Message-Id: <E1TCTYS-0000l2-GH@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:24 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] ns16550: MMIO adjustments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347371556 -7200
# Node ID 5fb5b3b70e34ef278d06aff27878b4b8e6d9145f
# Parent  e1380b5311ccee14eb47d7badb75339933d42249
ns16550: MMIO adjustments

On x86 ioremap() is not suitable here, set_fixmap() must be used
instead.

Also replace some literal numbers by their proper symbolic constants,
making the code easier to understand.

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


diff -r e1380b5311cc -r 5fb5b3b70e34 xen/drivers/char/ns16550.c
--- a/xen/drivers/char/ns16550.c	Tue Sep 11 15:51:52 2012 +0200
+++ b/xen/drivers/char/ns16550.c	Tue Sep 11 15:52:36 2012 +0200
@@ -20,6 +20,9 @@
 #include <xen/pci.h>
 #include <xen/pci_regs.h>
 #include <asm/io.h>
+#ifdef CONFIG_X86
+#include <asm/fixmap.h>
+#endif
 
 /*
  * Configure serial port with a string:
@@ -37,7 +40,7 @@ string_param("com2", opt_com2);
 static struct ns16550 {
     int baud, clock_hz, data_bits, parity, stop_bits, irq;
     unsigned long io_base;   /* I/O port or memory-mapped I/O address. */
-    char *remapped_io_base;  /* Remapped virtual address of mmap I/O.  */ 
+    char __iomem *remapped_io_base;  /* Remapped virtual address of MMIO. */
     /* UART with IRQ line: interrupt-driven I/O. */
     struct irqaction irqaction;
     /* UART with no IRQ line: periodically-polled I/O. */
@@ -207,17 +210,20 @@ static int ns16550_getc(struct serial_po
 
 static void pci_serial_early_init(struct ns16550 *uart)
 {
-    if ( !uart->ps_bdf_enable )
+    if ( !uart->ps_bdf_enable || uart->io_base >= 0x10000 )
         return;
     
     if ( uart->pb_bdf_enable )
         pci_conf_write16(0, uart->pb_bdf[0], uart->pb_bdf[1], uart->pb_bdf[2],
-            0x1c, (uart->io_base & 0xF000) | ((uart->io_base & 0xF000) >> 8));
+                         PCI_IO_BASE,
+                         (uart->io_base & 0xF000) |
+                         ((uart->io_base & 0xF000) >> 8));
 
     pci_conf_write32(0, uart->ps_bdf[0], uart->ps_bdf[1], uart->ps_bdf[2],
-        0x10, uart->io_base | 0x1);
+                     PCI_BASE_ADDRESS_0,
+                     uart->io_base | PCI_BASE_ADDRESS_SPACE_IO);
     pci_conf_write16(0, uart->ps_bdf[0], uart->ps_bdf[1], uart->ps_bdf[2],
-        0x4, 0x1);
+                     PCI_COMMAND, PCI_COMMAND_IO);
 }
 
 static void ns16550_setup_preirq(struct ns16550 *uart)
@@ -265,7 +271,17 @@ static void __init ns16550_init_preirq(s
 
     /* I/O ports are distinguished by their size (16 bits). */
     if ( uart->io_base >= 0x10000 )
+    {
+#ifdef CONFIG_X86
+        enum fixed_addresses idx = FIX_COM_BEGIN + (uart - ns16550_com);
+
+        set_fixmap_nocache(idx, uart->io_base);
+        uart->remapped_io_base = (void __iomem *)fix_to_virt(idx);
+        uart->remapped_io_base += uart->io_base & ~PAGE_MASK;
+#else
         uart->remapped_io_base = (char *)ioremap(uart->io_base, 8);
+#endif
+    }
 
     ns16550_setup_preirq(uart);
 
@@ -350,6 +366,9 @@ static void ns16550_resume(struct serial
 static void __init ns16550_endboot(struct serial_port *port)
 {
     struct ns16550 *uart = port->uart;
+
+    if ( uart->remapped_io_base )
+        return;
     if ( ioports_deny_access(dom0, uart->io_base, uart->io_base + 7) != 0 )
         BUG();
 }
@@ -453,7 +472,7 @@ pci_uart_config (struct ns16550 *uart, i
     uint32_t bar, len;
     int b, d, f;
 
-    /* NB. Start at bus 1 to avoid AMT: a plug-in card cannot be on bus 1. */
+    /* NB. Start at bus 1 to avoid AMT: a plug-in card cannot be on bus 0. */
     for ( b = skip_amt ? 1 : 0; b < 0x100; b++ )
     {
         for ( d = 0; d < 0x20; d++ )
@@ -468,7 +487,7 @@ pci_uart_config (struct ns16550 *uart, i
                                       PCI_BASE_ADDRESS_0 + bar_idx*4);
 
                 /* Not IO */
-                if ( !(bar & 1) )
+                if ( !(bar & PCI_BASE_ADDRESS_SPACE_IO) )
                     continue;
 
                 pci_conf_write32(0, b, d, f, PCI_BASE_ADDRESS_0, ~0u);
@@ -484,7 +503,7 @@ pci_uart_config (struct ns16550 *uart, i
                 uart->ps_bdf[2] = f;
                 uart->bar = bar;
                 uart->bar_idx = bar_idx;
-                uart->io_base = bar & 0xfffe;
+                uart->io_base = bar & ~PCI_BASE_ADDRESS_SPACE_IO;
                 uart->irq = 0;
 
                 return 0;
diff -r e1380b5311cc -r 5fb5b3b70e34 xen/include/asm-x86/fixmap.h
--- a/xen/include/asm-x86/fixmap.h	Tue Sep 11 15:51:52 2012 +0200
+++ b/xen/include/asm-x86/fixmap.h	Tue Sep 11 15:52:36 2012 +0200
@@ -43,6 +43,8 @@ enum fixed_addresses {
      * must be among the first (L1_PAGETABLE_ENTRIES - 1) entries.
      * These are generally those needed by the various console drivers.
      */
+    FIX_COM_BEGIN,
+    FIX_COM_END,
     FIX_EHCI_DBGP,
     /* Everything else should go further down. */
 #ifdef __i386__

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:41 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYj-0003k7-3B; Fri, 14 Sep 2012 10: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 1TCTYh-0003Zl-M5
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:39 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1347620124!11024012!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5277 invoked from network); 14 Sep 2012 10:55:25 -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;
	14 Sep 2012 10: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 1TCTYS-000143-Hg
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYS-0000l2-GH
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:24 +0000
Message-Id: <E1TCTYS-0000l2-GH@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:24 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] ns16550: MMIO adjustments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347371556 -7200
# Node ID 5fb5b3b70e34ef278d06aff27878b4b8e6d9145f
# Parent  e1380b5311ccee14eb47d7badb75339933d42249
ns16550: MMIO adjustments

On x86 ioremap() is not suitable here, set_fixmap() must be used
instead.

Also replace some literal numbers by their proper symbolic constants,
making the code easier to understand.

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


diff -r e1380b5311cc -r 5fb5b3b70e34 xen/drivers/char/ns16550.c
--- a/xen/drivers/char/ns16550.c	Tue Sep 11 15:51:52 2012 +0200
+++ b/xen/drivers/char/ns16550.c	Tue Sep 11 15:52:36 2012 +0200
@@ -20,6 +20,9 @@
 #include <xen/pci.h>
 #include <xen/pci_regs.h>
 #include <asm/io.h>
+#ifdef CONFIG_X86
+#include <asm/fixmap.h>
+#endif
 
 /*
  * Configure serial port with a string:
@@ -37,7 +40,7 @@ string_param("com2", opt_com2);
 static struct ns16550 {
     int baud, clock_hz, data_bits, parity, stop_bits, irq;
     unsigned long io_base;   /* I/O port or memory-mapped I/O address. */
-    char *remapped_io_base;  /* Remapped virtual address of mmap I/O.  */ 
+    char __iomem *remapped_io_base;  /* Remapped virtual address of MMIO. */
     /* UART with IRQ line: interrupt-driven I/O. */
     struct irqaction irqaction;
     /* UART with no IRQ line: periodically-polled I/O. */
@@ -207,17 +210,20 @@ static int ns16550_getc(struct serial_po
 
 static void pci_serial_early_init(struct ns16550 *uart)
 {
-    if ( !uart->ps_bdf_enable )
+    if ( !uart->ps_bdf_enable || uart->io_base >= 0x10000 )
         return;
     
     if ( uart->pb_bdf_enable )
         pci_conf_write16(0, uart->pb_bdf[0], uart->pb_bdf[1], uart->pb_bdf[2],
-            0x1c, (uart->io_base & 0xF000) | ((uart->io_base & 0xF000) >> 8));
+                         PCI_IO_BASE,
+                         (uart->io_base & 0xF000) |
+                         ((uart->io_base & 0xF000) >> 8));
 
     pci_conf_write32(0, uart->ps_bdf[0], uart->ps_bdf[1], uart->ps_bdf[2],
-        0x10, uart->io_base | 0x1);
+                     PCI_BASE_ADDRESS_0,
+                     uart->io_base | PCI_BASE_ADDRESS_SPACE_IO);
     pci_conf_write16(0, uart->ps_bdf[0], uart->ps_bdf[1], uart->ps_bdf[2],
-        0x4, 0x1);
+                     PCI_COMMAND, PCI_COMMAND_IO);
 }
 
 static void ns16550_setup_preirq(struct ns16550 *uart)
@@ -265,7 +271,17 @@ static void __init ns16550_init_preirq(s
 
     /* I/O ports are distinguished by their size (16 bits). */
     if ( uart->io_base >= 0x10000 )
+    {
+#ifdef CONFIG_X86
+        enum fixed_addresses idx = FIX_COM_BEGIN + (uart - ns16550_com);
+
+        set_fixmap_nocache(idx, uart->io_base);
+        uart->remapped_io_base = (void __iomem *)fix_to_virt(idx);
+        uart->remapped_io_base += uart->io_base & ~PAGE_MASK;
+#else
         uart->remapped_io_base = (char *)ioremap(uart->io_base, 8);
+#endif
+    }
 
     ns16550_setup_preirq(uart);
 
@@ -350,6 +366,9 @@ static void ns16550_resume(struct serial
 static void __init ns16550_endboot(struct serial_port *port)
 {
     struct ns16550 *uart = port->uart;
+
+    if ( uart->remapped_io_base )
+        return;
     if ( ioports_deny_access(dom0, uart->io_base, uart->io_base + 7) != 0 )
         BUG();
 }
@@ -453,7 +472,7 @@ pci_uart_config (struct ns16550 *uart, i
     uint32_t bar, len;
     int b, d, f;
 
-    /* NB. Start at bus 1 to avoid AMT: a plug-in card cannot be on bus 1. */
+    /* NB. Start at bus 1 to avoid AMT: a plug-in card cannot be on bus 0. */
     for ( b = skip_amt ? 1 : 0; b < 0x100; b++ )
     {
         for ( d = 0; d < 0x20; d++ )
@@ -468,7 +487,7 @@ pci_uart_config (struct ns16550 *uart, i
                                       PCI_BASE_ADDRESS_0 + bar_idx*4);
 
                 /* Not IO */
-                if ( !(bar & 1) )
+                if ( !(bar & PCI_BASE_ADDRESS_SPACE_IO) )
                     continue;
 
                 pci_conf_write32(0, b, d, f, PCI_BASE_ADDRESS_0, ~0u);
@@ -484,7 +503,7 @@ pci_uart_config (struct ns16550 *uart, i
                 uart->ps_bdf[2] = f;
                 uart->bar = bar;
                 uart->bar_idx = bar_idx;
-                uart->io_base = bar & 0xfffe;
+                uart->io_base = bar & ~PCI_BASE_ADDRESS_SPACE_IO;
                 uart->irq = 0;
 
                 return 0;
diff -r e1380b5311cc -r 5fb5b3b70e34 xen/include/asm-x86/fixmap.h
--- a/xen/include/asm-x86/fixmap.h	Tue Sep 11 15:51:52 2012 +0200
+++ b/xen/include/asm-x86/fixmap.h	Tue Sep 11 15:52:36 2012 +0200
@@ -43,6 +43,8 @@ enum fixed_addresses {
      * must be among the first (L1_PAGETABLE_ENTRIES - 1) entries.
      * These are generally those needed by the various console drivers.
      */
+    FIX_COM_BEGIN,
+    FIX_COM_END,
     FIX_EHCI_DBGP,
     /* Everything else should go further down. */
 #ifdef __i386__

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:41 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYj-0003kP-7L; Fri, 14 Sep 2012 10:55:41 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYh-0003Q9-QJ
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:40 +0000
Received: from [85.158.143.35:63280] by server-1.bemta-4.messagelabs.com id
	F9/D7-12504-B2D03505; Fri, 14 Sep 2012 10:55:39 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-21.messagelabs.com!1347620133!18244848!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22687 invoked from network); 14 Sep 2012 10:55:34 -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;
	14 Sep 2012 10: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 1TCTYb-00015S-BO
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYb-0000oU-9p
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:33 +0000
Message-Id: <E1TCTYb-0000oU-9p@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:32 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: We can assume
	CONFIG_PAGING_LEVELS==4.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347454766 -3600
# Node ID 7b658d31b5e1ebaaf9ea9cdc31cdba25d34d68ea
# Parent  bc8cb47787025aaa987a5a01719d014d8ede8665
x86: We can assume CONFIG_PAGING_LEVELS==4.

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r bc8cb4778702 -r 7b658d31b5e1 xen/arch/x86/boot/trampoline.S
--- a/xen/arch/x86/boot/trampoline.S	Wed Sep 12 13:29:30 2012 +0100
+++ b/xen/arch/x86/boot/trampoline.S	Wed Sep 12 13:59:26 2012 +0100
@@ -94,10 +94,8 @@ trampoline_protmode_entry:
         jz      .Lskip_efer
         movl    $MSR_EFER,%ecx
         rdmsr
-#if CONFIG_PAGING_LEVELS == 4
         btsl    $_EFER_LME,%eax /* Long Mode      */
         btsl    $_EFER_SCE,%eax /* SYSCALL/SYSRET */
-#endif
         btl     $20,%edi        /* No Execute?    */
         jnc     1f
         btsl    $_EFER_NX,%eax  /* No Execute     */
diff -r bc8cb4778702 -r 7b658d31b5e1 xen/arch/x86/boot/wakeup.S
--- a/xen/arch/x86/boot/wakeup.S	Wed Sep 12 13:29:30 2012 +0100
+++ b/xen/arch/x86/boot/wakeup.S	Wed Sep 12 13:59:26 2012 +0100
@@ -143,10 +143,8 @@ wakeup_32:
         jz      .Lskip_eferw
         movl    $MSR_EFER,%ecx
         rdmsr
-#if CONFIG_PAGING_LEVELS == 4
         btsl    $_EFER_LME,%eax /* Long Mode      */
         btsl    $_EFER_SCE,%eax /* SYSCALL/SYSRET */
-#endif
         btl     $20,%edi        /* No Execute?    */
         jnc     1f
         btsl    $_EFER_NX,%eax  /* No Execute     */
diff -r bc8cb4778702 -r 7b658d31b5e1 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c	Wed Sep 12 13:29:30 2012 +0100
+++ b/xen/arch/x86/domain.c	Wed Sep 12 13:59:26 2012 +0100
@@ -588,9 +588,8 @@ int arch_domain_create(struct domain *d,
     }
     else
     {
-        /* 32-bit PV guest by default only if Xen is not 64-bit. */
-        d->arch.is_32bit_pv = d->arch.has_32bit_shinfo =
-            (CONFIG_PAGING_LEVELS != 4);
+        /* 64-bit PV guest by default. */
+        d->arch.is_32bit_pv = d->arch.has_32bit_shinfo = 0;
 
         spin_lock_init(&d->arch.pv_domain.e820_lock);
     }
@@ -2096,7 +2095,6 @@ int domain_relinquish_resources(struct d
         ret = relinquish_memory(d, &d->xenpage_list, ~0UL);
         if ( ret )
             return ret;
-#if CONFIG_PAGING_LEVELS >= 4
         d->arch.relmem = RELMEM_l4;
         /* fallthrough */
 
@@ -2104,8 +2102,6 @@ int domain_relinquish_resources(struct d
         ret = relinquish_memory(d, &d->page_list, PGT_l4_page_table);
         if ( ret )
             return ret;
-#endif
-#if CONFIG_PAGING_LEVELS >= 3
         d->arch.relmem = RELMEM_l3;
         /* fallthrough */
 
@@ -2113,7 +2109,6 @@ int domain_relinquish_resources(struct d
         ret = relinquish_memory(d, &d->page_list, PGT_l3_page_table);
         if ( ret )
             return ret;
-#endif
         d->arch.relmem = RELMEM_l2;
         /* fallthrough */
 
diff -r bc8cb4778702 -r 7b658d31b5e1 xen/arch/x86/domain_build.c
--- a/xen/arch/x86/domain_build.c	Wed Sep 12 13:29:30 2012 +0100
+++ b/xen/arch/x86/domain_build.c	Wed Sep 12 13:59:26 2012 +0100
@@ -331,12 +331,7 @@ int __init construct_dom0(
     unsigned long image_len = image->mod_end;
     char *image_start = image_base + image_headroom;
     unsigned long initrd_len = initrd ? initrd->mod_end : 0;
-#if CONFIG_PAGING_LEVELS < 4
-    module_t mpt;
-    void *mpt_ptr;
-#else
     l4_pgentry_t *l4tab = NULL, *l4start = NULL;
-#endif
     l3_pgentry_t *l3tab = NULL, *l3start = NULL;
     l2_pgentry_t *l2tab = NULL, *l2start = NULL;
     l1_pgentry_t *l1tab = NULL, *l1start = NULL;
@@ -391,27 +386,16 @@ int __init construct_dom0(
     compatible = 0;
     compat32   = 0;
     machine = elf_uval(&elf, elf.ehdr, e_machine);
-    switch (CONFIG_PAGING_LEVELS) {
-    case 3: /* x86_32p */
-        if (parms.pae == PAEKERN_bimodal)
-            parms.pae = PAEKERN_extended_cr3;
-        printk(" Xen  kernel: 32-bit, PAE, lsb\n");
-        if (elf_32bit(&elf) && parms.pae && machine == EM_386)
-            compatible = 1;
-        break;
-    case 4: /* x86_64 */
-        printk(" Xen  kernel: 64-bit, lsb, compat32\n");
-        if (elf_32bit(&elf) && parms.pae == PAEKERN_bimodal)
-            parms.pae = PAEKERN_extended_cr3;
-        if (elf_32bit(&elf) && parms.pae && machine == EM_386)
-        {
-            compat32 = 1;
-            compatible = 1;
-        }
-        if (elf_64bit(&elf) && machine == EM_X86_64)
-            compatible = 1;
-        break;
+    printk(" Xen  kernel: 64-bit, lsb, compat32\n");
+    if (elf_32bit(&elf) && parms.pae == PAEKERN_bimodal)
+        parms.pae = PAEKERN_extended_cr3;
+    if (elf_32bit(&elf) && parms.pae && machine == EM_386)
+    {
+        compat32 = 1;
+        compatible = 1;
     }
+    if (elf_64bit(&elf) && machine == EM_X86_64)
+        compatible = 1;
     printk(" Dom0 kernel: %s%s, %s, paddr 0x%" PRIx64 " -> 0x%" PRIx64 "\n",
            elf_64bit(&elf) ? "64-bit" : "32-bit",
            parms.pae       ? ", PAE"  : "",
diff -r bc8cb4778702 -r 7b658d31b5e1 xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c	Wed Sep 12 13:29:30 2012 +0100
+++ b/xen/arch/x86/hvm/svm/svm.c	Wed Sep 12 13:59:26 2012 +0100
@@ -1285,8 +1285,7 @@ struct hvm_function_table * __init start
 
     svm_function_table.hap_supported = cpu_has_svm_npt;
     svm_function_table.hap_capabilities = HVM_HAP_SUPERPAGE_2MB |
-        (((CONFIG_PAGING_LEVELS == 4) && (cpuid_edx(0x80000001) & 0x04000000)) ?
-            HVM_HAP_SUPERPAGE_1GB : 0);
+        ((cpuid_edx(0x80000001) & 0x04000000) ? HVM_HAP_SUPERPAGE_1GB : 0);
 
     return &svm_function_table;
 }
diff -r bc8cb4778702 -r 7b658d31b5e1 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Wed Sep 12 13:29:30 2012 +0100
+++ b/xen/arch/x86/mm.c	Wed Sep 12 13:59:26 2012 +0100
@@ -277,8 +277,7 @@ void __init arch_init_memory(void)
     if ( cpu_has_nx )
         base_disallow_mask &= ~_PAGE_NX_BIT;
     /* On x86/64, range [62:52] is available for guest software use. */
-    if ( CONFIG_PAGING_LEVELS == 4 )
-        base_disallow_mask &= ~get_pte_flags((intpte_t)0x7ff << 52);
+    base_disallow_mask &= ~get_pte_flags((intpte_t)0x7ff << 52);
 
     /*
      * Initialise our DOMID_XEN domain.
@@ -475,11 +474,9 @@ void update_cr3(struct vcpu *v)
         return;
     }
 
-#if CONFIG_PAGING_LEVELS == 4
     if ( !(v->arch.flags & TF_kernel_mode) )
         cr3_mfn = pagetable_get_pfn(v->arch.guest_table_user);
     else
-#endif
         cr3_mfn = pagetable_get_pfn(v->arch.guest_table);
 
     make_cr3(v, cr3_mfn);
@@ -925,7 +922,6 @@ get_page_from_l3e(
     return rc;
 }
 
-#if CONFIG_PAGING_LEVELS >= 4
 define_get_linear_pagetable(l4);
 static int
 get_page_from_l4e(
@@ -949,7 +945,6 @@ get_page_from_l4e(
 
     return rc;
 }
-#endif /* 4 level */
 
 #ifdef USER_MAPPINGS_ARE_GLOBAL
 #define adjust_guest_l1e(pl1e, d)                                            \
@@ -1107,7 +1102,6 @@ static int put_page_from_l3e(l3_pgentry_
     return put_page_and_type_preemptible(l3e_get_page(l3e), preemptible);
 }
 
-#if CONFIG_PAGING_LEVELS >= 4
 static int put_page_from_l4e(l4_pgentry_t l4e, unsigned long pfn,
                              int partial, int preemptible)
 {
@@ -1120,7 +1114,6 @@ static int put_page_from_l4e(l4_pgentry_
     }
     return 1;
 }
-#endif
 
 static int alloc_l1_table(struct page_info *page)
 {
@@ -1259,21 +1252,6 @@ static int alloc_l3_table(struct page_in
     unsigned int   i;
     int            rc = 0, partial = page->partial_pte;
 
-#if CONFIG_PAGING_LEVELS == 3
-    /*
-     * PAE pgdirs above 4GB are unacceptable if the guest does not understand
-     * the weird 'extended cr3' format for dealing with high-order address
-     * bits. We cut some slack for control tools (before vcpu0 is initialised).
-     */
-    if ( (pfn >= 0x100000) &&
-         unlikely(!VM_ASSIST(d, VMASST_TYPE_pae_extended_cr3)) &&
-         d->vcpu && d->vcpu[0] && d->vcpu[0]->is_initialised )
-    {
-        MEM_LOG("PAE pgd must be below 4GB (0x%lx >= 0x100000)", pfn);
-        return -EINVAL;
-    }
-#endif
-
     pl3e = map_domain_page(pfn);
 
     /*
@@ -1340,7 +1318,6 @@ static int alloc_l3_table(struct page_in
     return rc > 0 ? 0 : rc;
 }
 
-#if CONFIG_PAGING_LEVELS >= 4
 static int alloc_l4_table(struct page_info *page, int preemptible)
 {
     struct domain *d = page_get_owner(page);
@@ -1396,10 +1373,6 @@ static int alloc_l4_table(struct page_in
 
     return rc > 0 ? 0 : rc;
 }
-#else
-#define alloc_l4_table(page, preemptible) (-EINVAL)
-#endif
-
 
 static void free_l1_table(struct page_info *page)
 {
@@ -1486,7 +1459,6 @@ static int free_l3_table(struct page_inf
     return rc > 0 ? 0 : rc;
 }
 
-#if CONFIG_PAGING_LEVELS >= 4
 static int free_l4_table(struct page_info *page, int preemptible)
 {
     struct domain *d = page_get_owner(page);
@@ -1516,9 +1488,6 @@ static int free_l4_table(struct page_inf
     }
     return rc > 0 ? 0 : rc;
 }
-#else
-#define free_l4_table(page, preemptible) (-EINVAL)
-#endif
 
 int page_lock(struct page_info *page)
 {
@@ -1823,8 +1792,6 @@ static int mod_l3_entry(l3_pgentry_t *pl
     return rc;
 }
 
-#if CONFIG_PAGING_LEVELS >= 4
-
 /* Update the L4 entry at pl4e to new value nl4e. pl4e is within frame pfn. */
 static int mod_l4_entry(l4_pgentry_t *pl4e, 
                         l4_pgentry_t nl4e, 
@@ -1886,8 +1853,6 @@ static int mod_l4_entry(l4_pgentry_t *pl
     return rc;
 }
 
-#endif
-
 static int cleanup_page_cacheattr(struct page_info *page)
 {
     uint32_t cacheattr =
@@ -2089,10 +2054,6 @@ int free_page_type(struct page_info *pag
         rc = free_l2_table(page, preemptible);
         break;
     case PGT_l3_page_table:
-#if CONFIG_PAGING_LEVELS == 3
-        if ( !(type & PGT_partial) )
-            page->nr_validated_ptes = L3_PAGETABLE_ENTRIES;
-#endif
         rc = free_l3_table(page, preemptible);
         break;
     case PGT_l4_page_table:
@@ -3348,12 +3309,10 @@ long do_mmu_update(
                     rc = mod_l3_entry(va, l3e_from_intpte(req.val), mfn,
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, 1, v);
                     break;
-#if CONFIG_PAGING_LEVELS >= 4
                 case PGT_l4_page_table:
                     rc = mod_l4_entry(va, l4e_from_intpte(req.val), mfn,
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, 1, v);
                 break;
-#endif
                 case PGT_writable_page:
                     perfc_incr(writable_mmu_updates);
                     if ( paging_write_guest_entry(v, va, req.val, _mfn(mfn)) )
diff -r bc8cb4778702 -r 7b658d31b5e1 xen/arch/x86/mm/hap/hap.c
--- a/xen/arch/x86/mm/hap/hap.c	Wed Sep 12 13:29:30 2012 +0100
+++ b/xen/arch/x86/mm/hap/hap.c	Wed Sep 12 13:59:26 2012 +0100
@@ -280,26 +280,6 @@ static struct page_info *hap_alloc_p2m_p
     paging_lock_recursive(d);
     pg = hap_alloc(d);
 
-#if CONFIG_PAGING_LEVELS == 3
-    /* Under PAE mode, top-level P2M table should be allocated below 4GB space
-     * because the size of h_cr3 is only 32-bit. We use alloc_domheap_pages to
-     * force this requirement, and exchange the guaranteed 32-bit-clean
-     * page for the one we just hap_alloc()ed. */
-    if ( d->arch.paging.hap.p2m_pages == 0
-         && mfn_x(page_to_mfn(pg)) >= (1UL << (32 - PAGE_SHIFT)) )
-    {
-        free_domheap_page(pg);
-        pg = alloc_domheap_page(
-            NULL, MEMF_bits(32) | MEMF_node(domain_to_node(d)));
-        if ( likely(pg != NULL) )
-        {
-            void *p = __map_domain_page(pg);
-            clear_page(p);
-            hap_unmap_domain_page(p);
-        }
-    }
-#endif
-
     if ( likely(pg != NULL) )
     {
         d->arch.paging.hap.total_pages--;
@@ -403,7 +383,6 @@ hap_set_allocation(struct domain *d, uns
     return 0;
 }
 
-#if CONFIG_PAGING_LEVELS == 4
 static void hap_install_xen_entries_in_l4(struct vcpu *v, mfn_t l4mfn)
 {
     struct domain *d = v->domain;
@@ -433,103 +412,20 @@ static void hap_install_xen_entries_in_l
 
     hap_unmap_domain_page(l4e);
 }
-#endif /* CONFIG_PAGING_LEVELS == 4 */
-
-#if CONFIG_PAGING_LEVELS == 3
-static void hap_install_xen_entries_in_l2h(struct vcpu *v, mfn_t l2hmfn)
-{
-    struct domain *d = v->domain;
-    struct p2m_domain *hostp2m = p2m_get_hostp2m(d);
-    l2_pgentry_t *l2e;
-    l3_pgentry_t *p2m;
-    int i;
-
-    l2e = hap_map_domain_page(l2hmfn);
-    ASSERT(l2e != NULL);
-
-    /* Copy the common Xen mappings from the idle domain */
-    memcpy(&l2e[L2_PAGETABLE_FIRST_XEN_SLOT & (L2_PAGETABLE_ENTRIES-1)],
-           &idle_pg_table_l2[L2_PAGETABLE_FIRST_XEN_SLOT],
-           L2_PAGETABLE_XEN_SLOTS * sizeof(l2_pgentry_t));
-
-    /* Install the per-domain mappings for this domain */
-    for ( i = 0; i < PDPT_L2_ENTRIES; i++ )
-        l2e[l2_table_offset(PERDOMAIN_VIRT_START) + i] =
-            l2e_from_pfn(
-                mfn_x(page_to_mfn(perdomain_pt_page(d, i))),
-                __PAGE_HYPERVISOR);
-
-    /* No linear mapping; will be set up by monitor-table contructor. */
-    for ( i = 0; i < 4; i++ )
-        l2e[l2_table_offset(LINEAR_PT_VIRT_START) + i] =
-            l2e_empty();
-
-    /* Install the domain-specific p2m table */
-    ASSERT(pagetable_get_pfn(p2m_get_pagetable(hostp2m)) != 0);
-    p2m = hap_map_domain_page(pagetable_get_mfn(p2m_get_pagetable(hostp2m)));
-    for ( i = 0; i < MACHPHYS_MBYTES>>1; i++ )
-    {
-        l2e[l2_table_offset(RO_MPT_VIRT_START) + i] =
-            (l3e_get_flags(p2m[i]) & _PAGE_PRESENT)
-            ? l2e_from_pfn(mfn_x(_mfn(l3e_get_pfn(p2m[i]))),
-                           __PAGE_HYPERVISOR)
-            : l2e_empty();
-    }
-    hap_unmap_domain_page(p2m);
-    hap_unmap_domain_page(l2e);
-}
-#endif
 
 static mfn_t hap_make_monitor_table(struct vcpu *v)
 {
     struct domain *d = v->domain;
     struct page_info *pg;
+    mfn_t m4mfn;
 
     ASSERT(pagetable_get_pfn(v->arch.monitor_table) == 0);
 
-#if CONFIG_PAGING_LEVELS == 4
-    {
-        mfn_t m4mfn;
-        if ( (pg = hap_alloc(d)) == NULL )
-            goto oom;
-        m4mfn = page_to_mfn(pg);
-        hap_install_xen_entries_in_l4(v, m4mfn);
-        return m4mfn;
-    }
-#elif CONFIG_PAGING_LEVELS == 3
-    {
-        mfn_t m3mfn, m2mfn;
-        l3_pgentry_t *l3e;
-        l2_pgentry_t *l2e;
-        int i;
-
-        if ( (pg = hap_alloc(d)) == NULL )
-            goto oom;
-        m3mfn = page_to_mfn(pg);
-
-        /* Install a monitor l2 table in slot 3 of the l3 table.
-         * This is used for all Xen entries, including linear maps
-         */
-        if ( (pg = hap_alloc(d)) == NULL )
-            goto oom;
-        m2mfn = page_to_mfn(pg);
-        l3e = hap_map_domain_page(m3mfn);
-        l3e[3] = l3e_from_pfn(mfn_x(m2mfn), _PAGE_PRESENT);
-        hap_install_xen_entries_in_l2h(v, m2mfn);
-        /* Install the monitor's own linear map */
-        l2e = hap_map_domain_page(m2mfn);
-        for ( i = 0; i < L3_PAGETABLE_ENTRIES; i++ )
-            l2e[l2_table_offset(LINEAR_PT_VIRT_START) + i] =
-                (l3e_get_flags(l3e[i]) & _PAGE_PRESENT)
-                ? l2e_from_pfn(l3e_get_pfn(l3e[i]), __PAGE_HYPERVISOR)
-                : l2e_empty();
-        hap_unmap_domain_page(l2e);
-        hap_unmap_domain_page(l3e);
-
-        HAP_PRINTK("new monitor table: %#lx\n", mfn_x(m3mfn));
-        return m3mfn;
-    }
-#endif
+    if ( (pg = hap_alloc(d)) == NULL )
+        goto oom;
+    m4mfn = page_to_mfn(pg);
+    hap_install_xen_entries_in_l4(v, m4mfn);
+    return m4mfn;
 
  oom:
     HAP_ERROR("out of memory building monitor pagetable\n");
@@ -541,16 +437,6 @@ static void hap_destroy_monitor_table(st
 {
     struct domain *d = v->domain;
 
-#if CONFIG_PAGING_LEVELS == 3
-    /* Need to destroy the l2 monitor page in slot 4 too */
-    {
-        l3_pgentry_t *l3e = hap_map_domain_page(mmfn);
-        ASSERT(l3e_get_flags(l3e[3]) & _PAGE_PRESENT);
-        hap_free(d, _mfn(l3e_get_pfn(l3e[3])));
-        hap_unmap_domain_page(l3e);
-    }
-#endif
-
     /* Put the memory back in the pool */
     hap_free(d, mmfn);
 }
@@ -814,47 +700,6 @@ static void hap_update_paging_modes(stru
     put_gfn(d, cr3_gfn);
 }
 
-#if CONFIG_PAGING_LEVELS == 3
-static void p2m_install_entry_in_monitors(struct domain *d, l3_pgentry_t *l3e)
-/* Special case, only used for PAE hosts: update the mapping of the p2m
- * table.  This is trivial in other paging modes (one top-level entry
- * points to the top-level p2m, no maintenance needed), but PAE makes
- * life difficult by needing a copy of the p2m table in eight l2h slots
- * in the monitor table.  This function makes fresh copies when a p2m
- * l3e changes. */
-{
-    l2_pgentry_t *ml2e;
-    struct vcpu *v;
-    unsigned int index;
-
-    index = ((unsigned long)l3e & ~PAGE_MASK) / sizeof(l3_pgentry_t);
-    ASSERT(index < MACHPHYS_MBYTES>>1);
-
-    for_each_vcpu ( d, v )
-    {
-        if ( pagetable_get_pfn(v->arch.monitor_table) == 0 )
-            continue;
-
-        ASSERT(paging_mode_external(v->domain));
-
-        if ( v == current ) /* OK to use linear map of monitor_table */
-            ml2e = __linear_l2_table + l2_linear_offset(RO_MPT_VIRT_START);
-        else {
-            l3_pgentry_t *ml3e;
-            ml3e = hap_map_domain_page(
-                pagetable_get_mfn(v->arch.monitor_table));
-            ASSERT(l3e_get_flags(ml3e[3]) & _PAGE_PRESENT);
-            ml2e = hap_map_domain_page(_mfn(l3e_get_pfn(ml3e[3])));
-            ml2e += l2_table_offset(RO_MPT_VIRT_START);
-            hap_unmap_domain_page(ml3e);
-        }
-        ml2e[index] = l2e_from_pfn(l3e_get_pfn(*l3e), __PAGE_HYPERVISOR);
-        if ( v != current )
-            hap_unmap_domain_page(ml2e);
-    }
-}
-#endif
-
 static void
 hap_write_p2m_entry(struct vcpu *v, unsigned long gfn, l1_pgentry_t *p,
                     mfn_t table_mfn, l1_pgentry_t new, unsigned int level)
@@ -886,14 +731,6 @@ hap_write_p2m_entry(struct vcpu *v, unsi
          && (level == 1 || (level == 2 && (old_flags & _PAGE_PSE))) )
              flush_tlb_mask(d->domain_dirty_cpumask);
 
-#if CONFIG_PAGING_LEVELS == 3
-    /* install P2M in monitor table for PAE Xen */
-    if ( level == 3 )
-        /* We have written to the p2m l3: need to sync the per-vcpu
-         * copies of it in the monitor tables */
-        p2m_install_entry_in_monitors(d, (l3_pgentry_t *)p);
-#endif
-
     paging_unlock(d);
 
     if ( flush_nestedp2m )
diff -r bc8cb4778702 -r 7b658d31b5e1 xen/arch/x86/mm/p2m-pod.c
--- a/xen/arch/x86/mm/p2m-pod.c	Wed Sep 12 13:29:30 2012 +0100
+++ b/xen/arch/x86/mm/p2m-pod.c	Wed Sep 12 13:59:26 2012 +0100
@@ -1120,10 +1120,6 @@ guest_physmap_mark_populate_on_demand(st
     if ( !paging_mode_translate(d) )
         return -EINVAL;
 
-    rc = p2m_gfn_check_limit(d, gfn, order);
-    if ( rc != 0 )
-        return rc;
-
     gfn_lock(p2m, gfn, order);
 
     P2M_DEBUG("mark pod gfn=%#lx\n", gfn);
diff -r bc8cb4778702 -r 7b658d31b5e1 xen/arch/x86/mm/p2m-pt.c
--- a/xen/arch/x86/mm/p2m-pt.c	Wed Sep 12 13:29:30 2012 +0100
+++ b/xen/arch/x86/mm/p2m-pt.c	Wed Sep 12 13:59:26 2012 +0100
@@ -150,10 +150,8 @@ p2m_free_entry(struct p2m_domain *p2m, l
 static void p2m_add_iommu_flags(l1_pgentry_t *p2m_entry,
                                 unsigned int nlevel, unsigned int flags)
 {
-#if CONFIG_PAGING_LEVELS == 4
     if ( iommu_hap_pt_share )
         l1e_add_flags(*p2m_entry, iommu_nlevel_to_flags(nlevel, flags));
-#endif
 }
 
 static int
@@ -189,10 +187,6 @@ p2m_next_level(struct p2m_domain *p2m, m
             p2m->write_p2m_entry(p2m, gfn, p2m_entry, *table_mfn, new_entry, 4);
             break;
         case PGT_l2_page_table:
-#if CONFIG_PAGING_LEVELS == 3
-            /* for PAE mode, PDPE only has PCD/PWT/P bits available */
-            new_entry = l1e_from_pfn(mfn_x(page_to_mfn(pg)), _PAGE_PRESENT);
-#endif
             p2m_add_iommu_flags(&new_entry, 2, IOMMUF_readable|IOMMUF_writable);
             p2m->write_p2m_entry(p2m, gfn, p2m_entry, *table_mfn, new_entry, 3);
             break;
@@ -317,12 +311,11 @@ p2m_set_entry(struct p2m_domain *p2m, un
         __trace_var(TRC_MEM_SET_P2M_ENTRY, 0, sizeof(t), &t);
     }
 
-#if CONFIG_PAGING_LEVELS >= 4
     if ( !p2m_next_level(p2m, &table_mfn, &table, &gfn_remainder, gfn,
                          L4_PAGETABLE_SHIFT - PAGE_SHIFT,
                          L4_PAGETABLE_ENTRIES, PGT_l3_page_table) )
         goto out;
-#endif
+
     /*
      * Try to allocate 1GB page table if this feature is supported.
      */
@@ -361,18 +354,9 @@ p2m_set_entry(struct p2m_domain *p2m, un
         if ( l1e_get_flags(old_entry) & _PAGE_PRESENT )
             p2m_free_entry(p2m, &old_entry, page_order);
     }
-    /*
-     * When using PAE Xen, we only allow 33 bits of pseudo-physical
-     * address in translated guests (i.e. 8 GBytes).  This restriction
-     * comes from wanting to map the P2M table into the 16MB RO_MPT hole
-     * in Xen's address space for translated PV guests.
-     * When using AMD's NPT on PAE Xen, we are restricted to 4GB.
-     */
     else if ( !p2m_next_level(p2m, &table_mfn, &table, &gfn_remainder, gfn,
                               L3_PAGETABLE_SHIFT - PAGE_SHIFT,
-                              ((CONFIG_PAGING_LEVELS == 3)
-                               ? (hap_enabled(p2m->domain) ? 4 : 8)
-                               : L3_PAGETABLE_ENTRIES),
+                              L3_PAGETABLE_ENTRIES,
                               PGT_l2_page_table) )
         goto out;
 
@@ -493,15 +477,12 @@ static mfn_t p2m_gfn_to_mfn_current(stru
 
     l1_pgentry_t l1e = l1e_empty(), *p2m_entry;
     l2_pgentry_t l2e = l2e_empty();
+    l3_pgentry_t l3e = l3e_empty();
     int ret;
-#if CONFIG_PAGING_LEVELS >= 4
-    l3_pgentry_t l3e = l3e_empty();
-#endif
 
     ASSERT(gfn < (RO_MPT_VIRT_END - RO_MPT_VIRT_START) 
            / sizeof(l1_pgentry_t));
 
-#if CONFIG_PAGING_LEVELS >= 4
     /*
      * Read & process L3
      */
@@ -549,7 +530,7 @@ pod_retry_l3:
             *page_order = PAGE_ORDER_1G;
         goto out;
     }
-#endif
+
     /*
      * Read & process L2
      */
@@ -691,7 +672,6 @@ p2m_gfn_to_mfn(struct p2m_domain *p2m, u
 
     mfn = pagetable_get_mfn(p2m_get_pagetable(p2m));
 
-#if CONFIG_PAGING_LEVELS >= 4
     {
         l4_pgentry_t *l4e = map_domain_page(mfn_x(mfn));
         l4e += l4_table_offset(addr);
@@ -703,19 +683,9 @@ p2m_gfn_to_mfn(struct p2m_domain *p2m, u
         mfn = _mfn(l4e_get_pfn(*l4e));
         unmap_domain_page(l4e);
     }
-#endif
     {
         l3_pgentry_t *l3e = map_domain_page(mfn_x(mfn));
-#if CONFIG_PAGING_LEVELS == 3
-        /* On PAE hosts the p2m has eight l3 entries, not four (see
-         * shadow_set_p2m_entry()) so we can't use l3_table_offset.
-         * Instead, just count the number of l3es from zero.  It's safe
-         * to do this because we already checked that the gfn is within
-         * the bounds of the p2m. */
-        l3e += (addr >> L3_PAGETABLE_SHIFT);
-#else
         l3e += l3_table_offset(addr);
-#endif
 pod_retry_l3:
         if ( (l3e_get_flags(*l3e) & _PAGE_PRESENT) == 0 )
         {
@@ -828,10 +798,8 @@ static void p2m_change_type_global(struc
     mfn_t l1mfn, l2mfn, l3mfn;
     unsigned long i1, i2, i3;
     l3_pgentry_t *l3e;
-#if CONFIG_PAGING_LEVELS == 4
     l4_pgentry_t *l4e;
     unsigned long i4;
-#endif /* CONFIG_PAGING_LEVELS == 4 */
 
     BUG_ON(p2m_is_grant(ot) || p2m_is_grant(nt));
     BUG_ON(ot != nt && (ot == p2m_mmio_direct || nt == p2m_mmio_direct));
@@ -844,14 +812,8 @@ static void p2m_change_type_global(struc
 
     ASSERT(p2m_locked_by_me(p2m));
 
-#if CONFIG_PAGING_LEVELS == 4
     l4e = map_domain_page(mfn_x(pagetable_get_mfn(p2m_get_pagetable(p2m))));
-#else /* CONFIG_PAGING_LEVELS == 3 */
-    l3mfn = _mfn(mfn_x(pagetable_get_mfn(p2m_get_pagetable(p2m))));
-    l3e = map_domain_page(mfn_x(pagetable_get_mfn(p2m_get_pagetable(p2m))));
-#endif
 
-#if CONFIG_PAGING_LEVELS >= 4
     for ( i4 = 0; i4 < L4_PAGETABLE_ENTRIES; i4++ )
     {
         if ( !(l4e_get_flags(l4e[i4]) & _PAGE_PRESENT) )
@@ -860,9 +822,8 @@ static void p2m_change_type_global(struc
         }
         l3mfn = _mfn(l4e_get_pfn(l4e[i4]));
         l3e = map_domain_page(l4e_get_pfn(l4e[i4]));
-#endif
         for ( i3 = 0;
-              i3 < ((CONFIG_PAGING_LEVELS==4) ? L3_PAGETABLE_ENTRIES : 8);
+              i3 < L3_PAGETABLE_ENTRIES;
               i3++ )
         {
             if ( !(l3e_get_flags(l3e[i3]) & _PAGE_PRESENT) )
@@ -901,11 +862,7 @@ static void p2m_change_type_global(struc
                     mfn = l2e_get_pfn(l2e[i2]);
                     /* Do not use get_gpfn_from_mfn because it may return 
                        SHARED_M2P_ENTRY */
-                    gfn = (i2 + (i3
-#if CONFIG_PAGING_LEVELS >= 4
-				   + (i4 * L3_PAGETABLE_ENTRIES)
-#endif
-				)
+                    gfn = (i2 + (i3 + (i4 * L3_PAGETABLE_ENTRIES))
                            * L2_PAGETABLE_ENTRIES) * L1_PAGETABLE_ENTRIES; 
                     flags = p2m_type_to_flags(nt, _mfn(mfn));
                     l1e_content = l1e_from_pfn(mfn, flags | _PAGE_PSE);
@@ -924,12 +881,8 @@ static void p2m_change_type_global(struc
                     if ( p2m_flags_to_type(flags) != ot )
                         continue;
                     mfn = l1e_get_pfn(l1e[i1]);
-                    gfn = i1 + (i2 + (i3
-#if CONFIG_PAGING_LEVELS >= 4
-					+ (i4 * L3_PAGETABLE_ENTRIES)
-#endif
-				     )
-                           * L2_PAGETABLE_ENTRIES) * L1_PAGETABLE_ENTRIES; 
+                    gfn = i1 + (i2 + (i3 + (i4 * L3_PAGETABLE_ENTRIES))
+                                * L2_PAGETABLE_ENTRIES) * L1_PAGETABLE_ENTRIES; 
                     /* create a new 1le entry with the new type */
                     flags = p2m_type_to_flags(nt, _mfn(mfn));
                     l1e_content = p2m_l1e_from_pfn(mfn, flags);
@@ -940,17 +893,10 @@ static void p2m_change_type_global(struc
             }
             unmap_domain_page(l2e);
         }
-#if CONFIG_PAGING_LEVELS >= 4
         unmap_domain_page(l3e);
     }
-#endif
 
-#if CONFIG_PAGING_LEVELS == 4
     unmap_domain_page(l4e);
-#else /* CONFIG_PAGING_LEVELS == 3 */
-    unmap_domain_page(l3e);
-#endif
-
 }
 
 #if P2M_AUDIT
@@ -976,19 +922,12 @@ long p2m_pt_audit_p2m(struct p2m_domain 
         l1_pgentry_t *l1e;
         int i1, i2;
 
-#if CONFIG_PAGING_LEVELS == 4
         l4_pgentry_t *l4e;
         l3_pgentry_t *l3e;
         int i4, i3;
         l4e = map_domain_page(mfn_x(pagetable_get_mfn(p2m_get_pagetable(p2m))));
-#else /* CONFIG_PAGING_LEVELS == 3 */
-        l3_pgentry_t *l3e;
-        int i3;
-        l3e = map_domain_page(mfn_x(pagetable_get_mfn(p2m_get_pagetable(p2m))));
-#endif
 
         gfn = 0;
-#if CONFIG_PAGING_LEVELS >= 4
         for ( i4 = 0; i4 < L4_PAGETABLE_ENTRIES; i4++ )
         {
             if ( !(l4e_get_flags(l4e[i4]) & _PAGE_PRESENT) )
@@ -997,9 +936,8 @@ long p2m_pt_audit_p2m(struct p2m_domain 
                 continue;
             }
             l3e = map_domain_page(mfn_x(_mfn(l4e_get_pfn(l4e[i4]))));
-#endif
             for ( i3 = 0;
-                  i3 < ((CONFIG_PAGING_LEVELS==4) ? L3_PAGETABLE_ENTRIES : 8);
+                  i3 < L3_PAGETABLE_ENTRIES;
                   i3++ )
             {
                 if ( !(l3e_get_flags(l3e[i3]) & _PAGE_PRESENT) )
@@ -1101,17 +1039,10 @@ long p2m_pt_audit_p2m(struct p2m_domain 
                 }
                 unmap_domain_page(l2e);
             }
-#if CONFIG_PAGING_LEVELS >= 4
             unmap_domain_page(l3e);
         }
-#endif
 
-#if CONFIG_PAGING_LEVELS == 4
         unmap_domain_page(l4e);
-#else /* CONFIG_PAGING_LEVELS == 3 */
-        unmap_domain_page(l3e);
-#endif
-
     }
 
     if ( entry_count != p2m->pod.entry_count )
diff -r bc8cb4778702 -r 7b658d31b5e1 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Wed Sep 12 13:29:30 2012 +0100
+++ b/xen/arch/x86/mm/p2m.c	Wed Sep 12 13:59:26 2012 +0100
@@ -343,14 +343,7 @@ int p2m_alloc_table(struct p2m_domain *p
 
     P2M_PRINTK("allocating p2m table\n");
 
-    p2m_top = p2m_alloc_ptp(p2m,
-#if CONFIG_PAGING_LEVELS == 4
-        PGT_l4_page_table
-#else
-        PGT_l3_page_table
-#endif
-        );
-
+    p2m_top = p2m_alloc_ptp(p2m, PGT_l4_page_table);
     if ( p2m_top == NULL )
     {
         p2m_unlock(p2m);
@@ -545,10 +538,6 @@ guest_physmap_add_entry(struct domain *d
         return 0;
     }
 
-    rc = p2m_gfn_check_limit(d, gfn, page_order);
-    if ( rc != 0 )
-        return rc;
-
     p2m_lock(p2m);
 
     P2M_DEBUG("adding gfn=%#lx mfn=%#lx\n", gfn, mfn);
diff -r bc8cb4778702 -r 7b658d31b5e1 xen/arch/x86/mm/shadow/common.c
--- a/xen/arch/x86/mm/shadow/common.c	Wed Sep 12 13:29:30 2012 +0100
+++ b/xen/arch/x86/mm/shadow/common.c	Wed Sep 12 13:59:26 2012 +0100
@@ -566,10 +566,8 @@ static inline void _sh_resync_l1(struct 
         SHADOW_INTERNAL_NAME(sh_resync_l1, 2)(v, gmfn, snpmfn);
     else if ( pg->shadow_flags & SHF_L1_PAE )
         SHADOW_INTERNAL_NAME(sh_resync_l1, 3)(v, gmfn, snpmfn);
-#if CONFIG_PAGING_LEVELS >= 4
     else if ( pg->shadow_flags & SHF_L1_64 )
         SHADOW_INTERNAL_NAME(sh_resync_l1, 4)(v, gmfn, snpmfn);
-#endif
 }
 
 
@@ -872,10 +870,8 @@ static int sh_skip_sync(struct vcpu *v, 
         return SHADOW_INTERNAL_NAME(sh_safe_not_to_sync, 2)(v, gl1mfn);
     else if ( pg->shadow_flags & SHF_L1_PAE )
         return SHADOW_INTERNAL_NAME(sh_safe_not_to_sync, 3)(v, gl1mfn);
-#if CONFIG_PAGING_LEVELS >= 4
     else if ( pg->shadow_flags & SHF_L1_64 )
         return SHADOW_INTERNAL_NAME(sh_safe_not_to_sync, 4)(v, gl1mfn);
-#endif
     SHADOW_ERROR("gmfn 0x%lx was OOS but not shadowed as an l1.\n", 
                  mfn_x(gl1mfn));
     BUG();
@@ -1083,7 +1079,6 @@ sh_validate_guest_entry(struct vcpu *v, 
         result |= SHADOW_INTERNAL_NAME(sh_map_and_validate_gl2he, 3)
             (v, gmfn, entry, size);
 
-#if CONFIG_PAGING_LEVELS >= 4 
     if ( page->shadow_flags & SHF_L1_64 ) 
         result |= SHADOW_INTERNAL_NAME(sh_map_and_validate_gl1e, 4)
             (v, gmfn, entry, size);
@@ -1099,10 +1094,7 @@ sh_validate_guest_entry(struct vcpu *v, 
     if ( page->shadow_flags & SHF_L4_64 ) 
         result |= SHADOW_INTERNAL_NAME(sh_map_and_validate_gl4e, 4)
             (v, gmfn, entry, size);
-#else /* 32-bit hypervisor does not support 64-bit guests */
-    ASSERT((page->shadow_flags 
-            & (SHF_L4_64|SHF_L3_64|SHF_L2H_64|SHF_L2_64|SHF_L1_64)) == 0);
-#endif
+
     this_cpu(trace_shadow_path_flags) |= (result<<(TRCE_SFLAG_SET_CHANGED)); 
 
     return result;
@@ -1265,11 +1257,9 @@ void shadow_unhook_mappings(struct vcpu 
     case SH_type_l2h_pae_shadow:
         SHADOW_INTERNAL_NAME(sh_unhook_pae_mappings, 3)(v, smfn, user_only);
         break;
-#if CONFIG_PAGING_LEVELS >= 4
     case SH_type_l4_64_shadow:
         SHADOW_INTERNAL_NAME(sh_unhook_64b_mappings, 4)(v, smfn, user_only);
         break;
-#endif
     default:
         SHADOW_ERROR("top-level shadow has bad type %08x\n", sp->u.sh.type);
         BUG();
@@ -1647,51 +1637,6 @@ shadow_free_p2m_page(struct domain *d, s
     paging_unlock(d);
 }
 
-#if CONFIG_PAGING_LEVELS == 3
-static void p2m_install_entry_in_monitors(struct domain *d, 
-                                          l3_pgentry_t *l3e) 
-/* Special case, only used for external-mode domains on PAE hosts:
- * update the mapping of the p2m table.  Once again, this is trivial in
- * other paging modes (one top-level entry points to the top-level p2m,
- * no maintenance needed), but PAE makes life difficult by needing a
- * copy the eight l3es of the p2m table in eight l2h slots in the
- * monitor table.  This function makes fresh copies when a p2m l3e
- * changes. */
-{
-    l2_pgentry_t *ml2e;
-    struct vcpu *v;
-    unsigned int index;
-
-    index = ((unsigned long)l3e & ~PAGE_MASK) / sizeof(l3_pgentry_t);
-    ASSERT(index < MACHPHYS_MBYTES>>1);
-
-    for_each_vcpu(d, v) 
-    {
-        if ( pagetable_get_pfn(v->arch.monitor_table) == 0 ) 
-            continue;
-        ASSERT(shadow_mode_external(v->domain));
-
-        SHADOW_DEBUG(P2M, "d=%u v=%u index=%u mfn=%#lx\n",
-                      d->domain_id, v->vcpu_id, index, l3e_get_pfn(*l3e));
-
-        if ( v == current ) /* OK to use linear map of monitor_table */
-            ml2e = __linear_l2_table + l2_linear_offset(RO_MPT_VIRT_START);
-        else 
-        {
-            l3_pgentry_t *ml3e;
-            ml3e = sh_map_domain_page(pagetable_get_mfn(v->arch.monitor_table));
-            ASSERT(l3e_get_flags(ml3e[3]) & _PAGE_PRESENT);
-            ml2e = sh_map_domain_page(_mfn(l3e_get_pfn(ml3e[3])));
-            ml2e += l2_table_offset(RO_MPT_VIRT_START);
-            sh_unmap_domain_page(ml3e);
-        }
-        ml2e[index] = l2e_from_pfn(l3e_get_pfn(*l3e), __PAGE_HYPERVISOR);
-        if ( v != current )
-            sh_unmap_domain_page(ml2e);
-    }
-}
-#endif
-
 /* Set the pool of shadow pages to the required number of pages.
  * Input will be rounded up to at least shadow_min_acceptable_pages(),
  * plus space for the p2m table.
@@ -2141,7 +2086,6 @@ void sh_destroy_shadow(struct vcpu *v, m
         SHADOW_INTERNAL_NAME(sh_destroy_l2_shadow, 3)(v, smfn);
         break;
 
-#if CONFIG_PAGING_LEVELS >= 4
     case SH_type_l1_64_shadow:
     case SH_type_fl1_64_shadow:
         SHADOW_INTERNAL_NAME(sh_destroy_l1_shadow, 4)(v, smfn);
@@ -2158,7 +2102,7 @@ void sh_destroy_shadow(struct vcpu *v, m
     case SH_type_l4_64_shadow:
         SHADOW_INTERNAL_NAME(sh_destroy_l4_shadow, 4)(v, smfn);
         break;
-#endif
+
     default:
         SHADOW_ERROR("tried to destroy shadow of bad type %08lx\n",
                      (unsigned long)t);
@@ -2197,13 +2141,8 @@ int sh_remove_write_access(struct vcpu *
         SHADOW_INTERNAL_NAME(sh_rm_write_access_from_l1, 3), /* fl1_pae */
         NULL, /* l2_pae  */
         NULL, /* l2h_pae */
-#if CONFIG_PAGING_LEVELS >= 4
         SHADOW_INTERNAL_NAME(sh_rm_write_access_from_l1, 4), /* l1_64   */
         SHADOW_INTERNAL_NAME(sh_rm_write_access_from_l1, 4), /* fl1_64  */
-#else
-        NULL, /* l1_64   */
-        NULL, /* fl1_64  */
-#endif
         NULL, /* l2_64   */
         NULL, /* l2h_64  */
         NULL, /* l3_64   */
@@ -2310,7 +2249,6 @@ int sh_remove_write_access(struct vcpu *
                           + ((fault_addr & VADDR_MASK) >> 18), 6); break;
             }
         }
-#if CONFIG_PAGING_LEVELS >= 4
         else if ( v->arch.paging.mode->guest_levels == 4 )
         {
             /* 64bit w2k3: linear map at 0xfffff68000000000 */
@@ -2351,7 +2289,6 @@ int sh_remove_write_access(struct vcpu *
              /* FreeBSD 64bit: direct map at 0xffffff0000000000 */
              GUESS(0xffffff0000000000 + (gfn << PAGE_SHIFT), 6);
         }
-#endif /* CONFIG_PAGING_LEVELS >= 4 */
 
 #undef GUESS
     }
@@ -2423,18 +2360,14 @@ int sh_remove_write_access_from_sl1p(str
         return SHADOW_INTERNAL_NAME(sh_rm_write_access_from_sl1p,2)
             (v, gmfn, smfn, off);
     }
-#if CONFIG_PAGING_LEVELS >= 3
     else if ( sp->u.sh.type == SH_type_l1_pae_shadow
               || sp->u.sh.type == SH_type_fl1_pae_shadow )
         return SHADOW_INTERNAL_NAME(sh_rm_write_access_from_sl1p,3)
             (v, gmfn, smfn, off);
-#if CONFIG_PAGING_LEVELS >= 4
     else if ( sp->u.sh.type == SH_type_l1_64_shadow
               || sp->u.sh.type == SH_type_fl1_64_shadow )
         return SHADOW_INTERNAL_NAME(sh_rm_write_access_from_sl1p,4)
             (v, gmfn, smfn, off);
-#endif
-#endif
 
     return 0;
 }
@@ -2458,13 +2391,8 @@ int sh_remove_all_mappings(struct vcpu *
         SHADOW_INTERNAL_NAME(sh_rm_mappings_from_l1, 3), /* fl1_pae */
         NULL, /* l2_pae  */
         NULL, /* l2h_pae */
-#if CONFIG_PAGING_LEVELS >= 4
         SHADOW_INTERNAL_NAME(sh_rm_mappings_from_l1, 4), /* l1_64   */
         SHADOW_INTERNAL_NAME(sh_rm_mappings_from_l1, 4), /* fl1_64  */
-#else
-        NULL, /* l1_64   */
-        NULL, /* fl1_64  */
-#endif
         NULL, /* l2_64   */
         NULL, /* l2h_64  */
         NULL, /* l3_64   */
@@ -2560,7 +2488,6 @@ static int sh_remove_shadow_via_pointer(
     case SH_type_l2h_pae_shadow:
         SHADOW_INTERNAL_NAME(sh_clear_shadow_entry, 3)(v, vaddr, pmfn);
         break;
-#if CONFIG_PAGING_LEVELS >= 4
     case SH_type_l1_64_shadow:
     case SH_type_l2_64_shadow:
     case SH_type_l2h_64_shadow:
@@ -2568,7 +2495,6 @@ static int sh_remove_shadow_via_pointer(
     case SH_type_l4_64_shadow:
         SHADOW_INTERNAL_NAME(sh_clear_shadow_entry, 4)(v, vaddr, pmfn);
         break;
-#endif
     default: BUG(); /* Some wierd unknown shadow type */
     }
     
@@ -2607,17 +2533,10 @@ void sh_remove_shadows(struct vcpu *v, m
         SHADOW_INTERNAL_NAME(sh_remove_l1_shadow, 3), /* l2h_pae */
         NULL, /* l1_64   */
         NULL, /* fl1_64  */
-#if CONFIG_PAGING_LEVELS >= 4
         SHADOW_INTERNAL_NAME(sh_remove_l1_shadow, 4), /* l2_64   */
         SHADOW_INTERNAL_NAME(sh_remove_l1_shadow, 4), /* l2h_64  */
         SHADOW_INTERNAL_NAME(sh_remove_l2_shadow, 4), /* l3_64   */
         SHADOW_INTERNAL_NAME(sh_remove_l3_shadow, 4), /* l4_64   */
-#else
-        NULL, /* l2_64   */
-        NULL, /* l2h_64  */
-        NULL, /* l3_64   */
-        NULL, /* l4_64   */
-#endif
         NULL, /* p2m     */
         NULL  /* unused  */
     };
@@ -2697,13 +2616,11 @@ void sh_remove_shadows(struct vcpu *v, m
     DO_UNSHADOW(SH_type_l2h_pae_shadow);
     DO_UNSHADOW(SH_type_l2_pae_shadow);
     DO_UNSHADOW(SH_type_l1_pae_shadow);
-#if CONFIG_PAGING_LEVELS >= 4
     DO_UNSHADOW(SH_type_l4_64_shadow);
     DO_UNSHADOW(SH_type_l3_64_shadow);
     DO_UNSHADOW(SH_type_l2h_64_shadow);
     DO_UNSHADOW(SH_type_l2_64_shadow);
     DO_UNSHADOW(SH_type_l1_64_shadow);
-#endif
 
 #undef DO_UNSHADOW
 
@@ -2741,7 +2658,6 @@ sh_remove_all_shadows_and_parents(struct
 
 /**************************************************************************/
 
-#if CONFIG_PAGING_LEVELS >= 4
 /* Reset the up-pointers of every L3 shadow to 0. 
  * This is called when l3 shadows stop being pinnable, to clear out all
  * the list-head bits so the up-pointer field is properly inititalised. */
@@ -2750,7 +2666,6 @@ static int sh_clear_up_pointer(struct vc
     mfn_to_page(smfn)->up = 0;
     return 0;
 }
-#endif
 
 void sh_reset_l3_up_pointers(struct vcpu *v)
 {
@@ -2767,11 +2682,7 @@ void sh_reset_l3_up_pointers(struct vcpu
         NULL, /* fl1_64  */
         NULL, /* l2_64   */
         NULL, /* l2h_64  */
-#if CONFIG_PAGING_LEVELS >= 4
         sh_clear_up_pointer, /* l3_64   */
-#else
-        NULL, /* l3_64   */
-#endif
         NULL, /* l4_64   */
         NULL, /* p2m     */
         NULL  /* unused  */
@@ -2838,11 +2749,7 @@ static void sh_update_paging_modes(struc
         ///
         /// PV guest
         ///
-#if CONFIG_PAGING_LEVELS == 4
         v->arch.paging.mode = &SHADOW_INTERNAL_NAME(sh_paging_mode, 4);
-#else /* CONFIG_PAGING_LEVELS == 3 */
-        v->arch.paging.mode = &SHADOW_INTERNAL_NAME(sh_paging_mode, 3);
-#endif
     }
     else
     {
@@ -3325,11 +3232,9 @@ static int shadow_one_bit_disable(struct
         {
             if ( v->arch.paging.mode )
                 v->arch.paging.mode->shadow.detach_old_tables(v);
-#if CONFIG_PAGING_LEVELS == 4
             if ( !(v->arch.flags & TF_kernel_mode) )
                 make_cr3(v, pagetable_get_pfn(v->arch.guest_table_user));
             else
-#endif
                 make_cr3(v, pagetable_get_pfn(v->arch.guest_table));
 
 #if (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC) 
@@ -3481,14 +3386,6 @@ shadow_write_p2m_entry(struct vcpu *v, u
     /* Update the entry with new content */
     safe_write_pte(p, new);
 
-    /* install P2M in monitors for PAE Xen */
-#if CONFIG_PAGING_LEVELS == 3
-    if ( level == 3 )
-        /* We have written to the p2m l3: need to sync the per-vcpu
-         * copies of it in the monitor tables */
-        p2m_install_entry_in_monitors(d, (l3_pgentry_t *)p);
-#endif
-
 #if (SHADOW_OPTIMIZATIONS & SHOPT_FAST_FAULT_PATH)
     /* If we're doing FAST_FAULT_PATH, then shadow mode may have
        cached the fact that this is an mmio region in the shadow
@@ -3815,14 +3712,12 @@ void shadow_audit_tables(struct vcpu *v)
         SHADOW_INTERNAL_NAME(sh_audit_fl1_table, 3), /* fl1_pae */
         SHADOW_INTERNAL_NAME(sh_audit_l2_table, 3),  /* l2_pae  */
         SHADOW_INTERNAL_NAME(sh_audit_l2_table, 3),  /* l2h_pae */
-#if CONFIG_PAGING_LEVELS >= 4
         SHADOW_INTERNAL_NAME(sh_audit_l1_table, 4),  /* l1_64   */
         SHADOW_INTERNAL_NAME(sh_audit_fl1_table, 4), /* fl1_64  */
         SHADOW_INTERNAL_NAME(sh_audit_l2_table, 4),  /* l2_64   */
         SHADOW_INTERNAL_NAME(sh_audit_l2_table, 4),  /* l2h_64   */
         SHADOW_INTERNAL_NAME(sh_audit_l3_table, 4),  /* l3_64   */
         SHADOW_INTERNAL_NAME(sh_audit_l4_table, 4),  /* l4_64   */
-#endif /* CONFIG_PAGING_LEVELS >= 4 */
         NULL  /* All the rest */
     };
     unsigned int mask; 
diff -r bc8cb4778702 -r 7b658d31b5e1 xen/arch/x86/mm/shadow/multi.c
--- a/xen/arch/x86/mm/shadow/multi.c	Wed Sep 12 13:29:30 2012 +0100
+++ b/xen/arch/x86/mm/shadow/multi.c	Wed Sep 12 13:59:26 2012 +0100
@@ -788,22 +788,10 @@ static inline void safe_write_entry(void
     volatile unsigned long *d = dst;
     unsigned long *s = src;
     ASSERT(!((unsigned long) d & (sizeof (shadow_l1e_t) - 1)));
-#if CONFIG_PAGING_LEVELS == 3
-    /* In PAE mode, pagetable entries are larger
-     * than machine words, so won't get written atomically.  We need to make
-     * sure any other cpu running on these shadows doesn't see a
-     * half-written entry.  Do this by marking the entry not-present first,
-     * then writing the high word before the low word. */
-    BUILD_BUG_ON(sizeof (shadow_l1e_t) != 2 * sizeof (unsigned long));
-    d[0] = 0;
-    d[1] = s[1];
-    d[0] = s[0];
-#else
     /* In 64-bit, sizeof(pte) == sizeof(ulong) == 1 word,
      * which will be an atomic write, since the entry is aligned. */
     BUILD_BUG_ON(sizeof (shadow_l1e_t) != sizeof (unsigned long));
     *d = *s;
-#endif
 }
 
 
@@ -1444,7 +1432,7 @@ do {                                    
 //        probably wants to wait until the shadow types have been moved from
 //        shadow-types.h to shadow-private.h
 //
-#if CONFIG_PAGING_LEVELS == 4 && GUEST_PAGING_LEVELS == 4
+#if GUEST_PAGING_LEVELS == 4
 void sh_install_xen_entries_in_l4(struct vcpu *v, mfn_t gl4mfn, mfn_t sl4mfn)
 {
     struct domain *d = v->domain;
@@ -1496,7 +1484,7 @@ void sh_install_xen_entries_in_l4(struct
 }
 #endif
 
-#if CONFIG_PAGING_LEVELS >= 3 && GUEST_PAGING_LEVELS >= 3
+#if GUEST_PAGING_LEVELS >= 3
 // For 3-on-3 PV guests, we need to make sure the xen mappings are in
 // place, which means that we need to populate the l2h entry in the l3
 // table.
@@ -1505,62 +1493,13 @@ static void sh_install_xen_entries_in_l2
 {
     struct domain *d = v->domain;
     shadow_l2e_t *sl2e;
-#if CONFIG_PAGING_LEVELS == 3
-    int i;
-#else
 
     if ( !is_pv_32on64_vcpu(v) )
         return;
-#endif
 
     sl2e = sh_map_domain_page(sl2hmfn);
     ASSERT(sl2e != NULL);
     ASSERT(sizeof (l2_pgentry_t) == sizeof (shadow_l2e_t));
-    
-#if CONFIG_PAGING_LEVELS == 3
-
-    /* Copy the common Xen mappings from the idle domain */
-    memcpy(&sl2e[L2_PAGETABLE_FIRST_XEN_SLOT & (L2_PAGETABLE_ENTRIES-1)],
-           &idle_pg_table_l2[L2_PAGETABLE_FIRST_XEN_SLOT],
-           L2_PAGETABLE_XEN_SLOTS * sizeof(l2_pgentry_t));
-
-    /* Install the per-domain mappings for this domain */
-    for ( i = 0; i < PDPT_L2_ENTRIES; i++ )
-        sl2e[shadow_l2_table_offset(PERDOMAIN_VIRT_START) + i] =
-            shadow_l2e_from_mfn(
-                page_to_mfn(perdomain_pt_page(d, i)),
-                __PAGE_HYPERVISOR);
-    
-    /* We don't set up a linear mapping here because we can't until this
-     * l2h is installed in an l3e.  sh_update_linear_entries() handles
-     * the linear mappings when CR3 (and so the fourth l3e) is loaded.  
-     * We zero them here, just as a safety measure.
-     */
-    for ( i = 0; i < SHADOW_L3_PAGETABLE_ENTRIES; i++ )
-        sl2e[shadow_l2_table_offset(LINEAR_PT_VIRT_START) + i] =
-            shadow_l2e_empty();
-    for ( i = 0; i < SHADOW_L3_PAGETABLE_ENTRIES; i++ )
-        sl2e[shadow_l2_table_offset(SH_LINEAR_PT_VIRT_START) + i] =
-            shadow_l2e_empty();
-
-    if ( shadow_mode_translate(d) )
-    {
-        /* Install the domain-specific p2m table */
-        l3_pgentry_t *p2m;
-        ASSERT(pagetable_get_pfn(p2m_get_pagetable(p2m_get_hostp2m(d))) != 0);
-        p2m = sh_map_domain_page(pagetable_get_mfn(p2m_get_pagetable(p2m_get_hostp2m(d))));
-        for ( i = 0; i < MACHPHYS_MBYTES>>1; i++ )
-        {
-            sl2e[shadow_l2_table_offset(RO_MPT_VIRT_START) + i] =
-                (l3e_get_flags(p2m[i]) & _PAGE_PRESENT)
-                ? shadow_l2e_from_mfn(_mfn(l3e_get_pfn(p2m[i])),
-                                      __PAGE_HYPERVISOR)
-                : shadow_l2e_empty();
-        }
-        sh_unmap_domain_page(p2m);
-    }
-
-#else
 
     /* Copy the common Xen mappings from the idle domain */
     memcpy(
@@ -1568,16 +1507,11 @@ static void sh_install_xen_entries_in_l2
         &compat_idle_pg_table_l2[l2_table_offset(HIRO_COMPAT_MPT_VIRT_START)],
         COMPAT_L2_PAGETABLE_XEN_SLOTS(d) * sizeof(*sl2e));
 
-#endif
-    
     sh_unmap_domain_page(sl2e);
 }
 #endif
 
 
-
-
-
 /**************************************************************************/
 /* Create a shadow of a given guest page.
  */
@@ -1633,11 +1567,11 @@ sh_make_shadow(struct vcpu *v, mfn_t gmf
     {
         switch (shadow_type) 
         {
-#if CONFIG_PAGING_LEVELS == 4 && GUEST_PAGING_LEVELS == 4
+#if GUEST_PAGING_LEVELS == 4
         case SH_type_l4_shadow:
             sh_install_xen_entries_in_l4(v, gmfn, smfn); break;
 #endif
-#if CONFIG_PAGING_LEVELS >= 3 && GUEST_PAGING_LEVELS >= 3
+#if GUEST_PAGING_LEVELS >= 3
         case SH_type_l2h_shadow:
             sh_install_xen_entries_in_l2h(v, smfn); break;
 #endif
@@ -1677,7 +1611,6 @@ sh_make_monitor_table(struct vcpu *v)
     /* Guarantee we can get the memory we need */
     shadow_prealloc(d, SH_type_monitor_table, CONFIG_PAGING_LEVELS);
 
-#if CONFIG_PAGING_LEVELS == 4    
     {
         mfn_t m4mfn;
         m4mfn = shadow_alloc(d, SH_type_monitor_table, 0);
@@ -1726,43 +1659,6 @@ sh_make_monitor_table(struct vcpu *v)
 #endif /* SHADOW_PAGING_LEVELS < 4 */
         return m4mfn;
     }
-
-#elif CONFIG_PAGING_LEVELS == 3
-
-    {
-        mfn_t m3mfn, m2mfn; 
-        l3_pgentry_t *l3e;
-        l2_pgentry_t *l2e;
-        int i;
-
-        m3mfn = shadow_alloc(d, SH_type_monitor_table, 0);
-        /* Remember the level of this table */
-        mfn_to_page(m3mfn)->shadow_flags = 3;
-
-        // Install a monitor l2 table in slot 3 of the l3 table.
-        // This is used for all Xen entries, including linear maps
-        m2mfn = shadow_alloc(d, SH_type_monitor_table, 0);
-        mfn_to_page(m2mfn)->shadow_flags = 2;
-        l3e = sh_map_domain_page(m3mfn);
-        l3e[3] = l3e_from_pfn(mfn_x(m2mfn), _PAGE_PRESENT);
-        sh_install_xen_entries_in_l2h(v, m2mfn);
-        /* Install the monitor's own linear map */
-        l2e = sh_map_domain_page(m2mfn);
-        for ( i = 0; i < L3_PAGETABLE_ENTRIES; i++ )
-            l2e[l2_table_offset(LINEAR_PT_VIRT_START) + i] =
-                (l3e_get_flags(l3e[i]) & _PAGE_PRESENT) 
-                ? l2e_from_pfn(l3e_get_pfn(l3e[i]), __PAGE_HYPERVISOR) 
-                : l2e_empty();
-        sh_unmap_domain_page(l2e);
-        sh_unmap_domain_page(l3e);
-
-        SHADOW_PRINTK("new monitor table: %#lx\n", mfn_x(m3mfn));
-        return m3mfn;
-    }
-
-#else
-#error this should not happen
-#endif /* CONFIG_PAGING_LEVELS */
 }
 #endif /* SHADOW_PAGING_LEVELS == GUEST_PAGING_LEVELS */
 
@@ -2146,7 +2042,7 @@ void sh_destroy_monitor_table(struct vcp
     struct domain *d = v->domain;
     ASSERT(mfn_to_page(mmfn)->u.sh.type == SH_type_monitor_table);
 
-#if (CONFIG_PAGING_LEVELS == 4) && (SHADOW_PAGING_LEVELS != 4)
+#if SHADOW_PAGING_LEVELS != 4
     {
         mfn_t m3mfn;
         l4_pgentry_t *l4e = sh_map_domain_page(mmfn);
@@ -2177,14 +2073,6 @@ void sh_destroy_monitor_table(struct vcp
         }
         sh_unmap_domain_page(l4e);
     }
-#elif CONFIG_PAGING_LEVELS == 3
-    /* Need to destroy the l2 monitor page in slot 4 too */
-    {
-        l3_pgentry_t *l3e = sh_map_domain_page(mmfn);
-        ASSERT(l3e_get_flags(l3e[3]) & _PAGE_PRESENT);
-        shadow_free(d, _mfn(l3e_get_pfn(l3e[3])));
-        sh_unmap_domain_page(l3e);
-    }
 #endif
 
     /* Put the memory back in the pool */
@@ -2382,46 +2270,6 @@ static int validate_gl2e(struct vcpu *v,
     }
     l2e_propagate_from_guest(v, new_gl2e, sl1mfn, &new_sl2e, ft_prefetch);
 
-    // check for updates to xen reserved slots in PV guests...
-    // XXX -- need to revisit this for PV 3-on-4 guests.
-    //
-#if SHADOW_PAGING_LEVELS < 4
-#if CONFIG_PAGING_LEVELS == SHADOW_PAGING_LEVELS
-    if ( !shadow_mode_external(v->domain) )
-    {
-        int shadow_index = (((unsigned long)sl2p & ~PAGE_MASK) /
-                            sizeof(shadow_l2e_t));
-        int reserved_xen_slot;
-
-#if SHADOW_PAGING_LEVELS == 3
-        reserved_xen_slot = 
-            ((mfn_to_page(sl2mfn)->u.sh.type == SH_type_l2h_pae_shadow) &&
-             (shadow_index 
-              >= (L2_PAGETABLE_FIRST_XEN_SLOT & (L2_PAGETABLE_ENTRIES-1))));
-#else /* SHADOW_PAGING_LEVELS == 2 */
-        reserved_xen_slot = (shadow_index >= L2_PAGETABLE_FIRST_XEN_SLOT);
-#endif
-
-        if ( unlikely(reserved_xen_slot) )
-        {
-            // attempt by the guest to write to a xen reserved slot
-            //
-            SHADOW_PRINTK("%s out-of-range update "
-                           "sl2mfn=%05lx index=0x%x val=%" SH_PRI_pte "\n",
-                           __func__, mfn_x(sl2mfn), shadow_index, new_sl2e.l2);
-            if ( shadow_l2e_get_flags(new_sl2e) & _PAGE_PRESENT )
-            {
-                SHADOW_ERROR("out-of-range l2e update\n");
-                result |= SHADOW_SET_ERROR;
-            }
-
-            // do not call shadow_set_l2e...
-            return result;
-        }
-    }
-#endif /* CONFIG_PAGING_LEVELS == SHADOW_PAGING_LEVELS */
-#endif /* SHADOW_PAGING_LEVELS < 4 */
-
     result |= shadow_set_l2e(v, sl2p, new_sl2e, sl2mfn);
 
     return result;
@@ -3836,7 +3684,7 @@ sh_update_linear_entries(struct vcpu *v)
          && pagetable_get_pfn(v->arch.monitor_table) == 0 ) 
         return;
 
-#if (CONFIG_PAGING_LEVELS == 4) && (SHADOW_PAGING_LEVELS == 4)
+#if SHADOW_PAGING_LEVELS == 4
     
     /* For PV, one l4e points at the guest l4, one points at the shadow
      * l4.  No maintenance required. 
@@ -3862,7 +3710,7 @@ sh_update_linear_entries(struct vcpu *v)
         }
     }
 
-#elif (CONFIG_PAGING_LEVELS == 4) && (SHADOW_PAGING_LEVELS == 3)
+#elif SHADOW_PAGING_LEVELS == 3
 
     /* PV: XXX
      *
@@ -3923,102 +3771,6 @@ sh_update_linear_entries(struct vcpu *v)
     else
         domain_crash(d); /* XXX */
 
-#elif CONFIG_PAGING_LEVELS == 3
-
-    /* PV: need to copy the guest's l3 entries into the guest-linear-map l2
-     * entries in the shadow, and the shadow's l3 entries into the 
-     * shadow-linear-map l2 entries in the shadow.  This is safe to do 
-     * because Xen does not let guests share high-slot l2 tables between l3s,
-     * so we know we're not treading on anyone's toes. 
-     *
-     * HVM: need to copy the shadow's l3 entries into the
-     * shadow-linear-map l2 entries in the monitor table.  This is safe
-     * because we have one monitor table for each vcpu.  The monitor's
-     * own l3es don't need to be copied because they never change.  
-     * XXX That might change if we start stuffing things into the rest
-     * of the monitor's virtual address space. 
-     */ 
-    {
-        l2_pgentry_t *l2e, new_l2e;
-        shadow_l3e_t *guest_l3e = NULL, *shadow_l3e;
-        int i;
-        int unmap_l2e = 0;
-
-#if GUEST_PAGING_LEVELS == 2
-
-        /* Shadow l3 tables were built by sh_update_cr3 */
-        BUG_ON(!shadow_mode_external(d)); /* PV 2-on-3 is unsupported */
-        shadow_l3e = (shadow_l3e_t *)&v->arch.paging.shadow.l3table;
-        
-#else /* GUEST_PAGING_LEVELS == 3 */
-        
-        shadow_l3e = (shadow_l3e_t *)&v->arch.paging.shadow.l3table;
-        guest_l3e = (guest_l3e_t *)&v->arch.paging.shadow.gl3e;
-
-#endif /* GUEST_PAGING_LEVELS */
-        
-        /* Choose where to write the entries, using linear maps if possible */
-        if ( shadow_mode_external(d) )
-        {
-            if ( v == current )
-            {
-                /* From the monitor tables, it's safe to use linear maps
-                 * to update monitor l2s */
-                l2e = __linear_l2_table + (3 * L2_PAGETABLE_ENTRIES);
-            }
-            else
-            {
-                /* Map the monitor table's high l2 */
-                l3_pgentry_t *l3e;
-                l3e = sh_map_domain_page(
-                    pagetable_get_mfn(v->arch.monitor_table));
-                ASSERT(l3e_get_flags(l3e[3]) & _PAGE_PRESENT);
-                l2e = sh_map_domain_page(_mfn(l3e_get_pfn(l3e[3])));
-                unmap_l2e = 1;
-                sh_unmap_domain_page(l3e);
-            }
-        }
-        else 
-        {
-            /* Map the shadow table's high l2 */
-            ASSERT(shadow_l3e_get_flags(shadow_l3e[3]) & _PAGE_PRESENT);
-            l2e = sh_map_domain_page(shadow_l3e_get_mfn(shadow_l3e[3]));
-            unmap_l2e = 1;
-        }
-        
-        /* Write linear mapping of guest (only in PV, and only when 
-         * not translated). */
-        if ( !shadow_mode_translate(d) )
-        {
-            for ( i = 0; i < SHADOW_L3_PAGETABLE_ENTRIES; i++ )
-            {
-                new_l2e = 
-                    ((shadow_l3e_get_flags(guest_l3e[i]) & _PAGE_PRESENT)
-                     ? l2e_from_pfn(mfn_x(shadow_l3e_get_mfn(guest_l3e[i])),
-                                    __PAGE_HYPERVISOR) 
-                     : l2e_empty());
-                safe_write_entry(
-                    &l2e[l2_table_offset(LINEAR_PT_VIRT_START) + i],
-                    &new_l2e);
-            }
-        }
-        
-        /* Write linear mapping of shadow. */
-        for ( i = 0; i < SHADOW_L3_PAGETABLE_ENTRIES; i++ )
-        {
-            new_l2e = (shadow_l3e_get_flags(shadow_l3e[i]) & _PAGE_PRESENT) 
-                ? l2e_from_pfn(mfn_x(shadow_l3e_get_mfn(shadow_l3e[i])),
-                               __PAGE_HYPERVISOR) 
-                : l2e_empty();
-            safe_write_entry(
-                &l2e[l2_table_offset(SH_LINEAR_PT_VIRT_START) + i],
-                &new_l2e);
-        }
-        
-        if ( unmap_l2e )
-            sh_unmap_domain_page(l2e);
-    }
-
 #else
 #error this should not happen
 #endif
diff -r bc8cb4778702 -r 7b658d31b5e1 xen/arch/x86/mm/shadow/private.h
--- a/xen/arch/x86/mm/shadow/private.h	Wed Sep 12 13:29:30 2012 +0100
+++ b/xen/arch/x86/mm/shadow/private.h	Wed Sep 12 13:59:26 2012 +0100
@@ -165,11 +165,9 @@ extern void shadow_audit_tables(struct v
 #include "multi.h"
 #undef GUEST_LEVELS
 
-#if CONFIG_PAGING_LEVELS == 4
 #define GUEST_LEVELS  4
 #include "multi.h"
 #undef GUEST_LEVELS
-#endif /* CONFIG_PAGING_LEVELS == 4 */
 
 /* Shadow type codes */
 #define SH_type_none           (0U) /* on the shadow free list */
@@ -214,7 +212,6 @@ static inline int sh_type_is_pinnable(st
      * shadows so they don't just evaporate on every context switch.
      * For all other guests, we'd rather use the up-pointer field in l3s. */ 
     if ( unlikely((v->domain->arch.paging.shadow.opt_flags & SHOPT_LINUX_L3_TOPLEVEL) 
-                  && CONFIG_PAGING_LEVELS >= 4
                   && t == SH_type_l3_64_shadow) )
         return 1;
 #endif
diff -r bc8cb4778702 -r 7b658d31b5e1 xen/arch/x86/trace.c
--- a/xen/arch/x86/trace.c	Wed Sep 12 13:29:30 2012 +0100
+++ b/xen/arch/x86/trace.c	Wed Sep 12 13:59:26 2012 +0100
@@ -185,8 +185,7 @@ void __trace_ptwr_emulation(unsigned lon
         d.eip = eip;
         d.pte = npte;
 
-        event = ((CONFIG_PAGING_LEVELS == 3) ?
-                 TRC_PV_PTWR_EMULATION_PAE : TRC_PV_PTWR_EMULATION);
+        event = TRC_PV_PTWR_EMULATION;
         event |= TRC_64_FLAG;
         __trace_var(event, 1/*tsc*/, sizeof(d), &d);
     }
diff -r bc8cb4778702 -r 7b658d31b5e1 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c	Wed Sep 12 13:29:30 2012 +0100
+++ b/xen/arch/x86/traps.c	Wed Sep 12 13:59:26 2012 +0100
@@ -1181,12 +1181,8 @@ static enum pf_type __page_fault_type(
     unsigned long addr, unsigned int error_code)
 {
     unsigned long mfn, cr3 = read_cr3();
-#if CONFIG_PAGING_LEVELS >= 4
     l4_pgentry_t l4e, *l4t;
-#endif
-#if CONFIG_PAGING_LEVELS >= 3
     l3_pgentry_t l3e, *l3t;
-#endif
     l2_pgentry_t l2e, *l2t;
     l1_pgentry_t l1e, *l1t;
     unsigned int required_flags, disallowed_flags, page_user;
@@ -1217,7 +1213,6 @@ static enum pf_type __page_fault_type(
 
     mfn = cr3 >> PAGE_SHIFT;
 
-#if CONFIG_PAGING_LEVELS >= 4
     l4t = map_domain_page(mfn);
     l4e = l4e_read_atomic(&l4t[l4_table_offset(addr)]);
     mfn = l4e_get_pfn(l4e);
@@ -1226,28 +1221,17 @@ static enum pf_type __page_fault_type(
          (l4e_get_flags(l4e) & disallowed_flags) )
         return real_fault;
     page_user &= l4e_get_flags(l4e);
-#endif
-
-#if CONFIG_PAGING_LEVELS >= 3
+
     l3t  = map_domain_page(mfn);
-#if CONFIG_PAGING_LEVELS == 3
-    l3t += (cr3 & 0xFE0UL) >> 3;
-#endif
     l3e = l3e_read_atomic(&l3t[l3_table_offset(addr)]);
     mfn = l3e_get_pfn(l3e);
     unmap_domain_page(l3t);
-#if CONFIG_PAGING_LEVELS == 3
-    if ( !(l3e_get_flags(l3e) & _PAGE_PRESENT) )
-        return real_fault;
-#else
     if ( ((l3e_get_flags(l3e) & required_flags) != required_flags) ||
          (l3e_get_flags(l3e) & disallowed_flags) )
         return real_fault;
     page_user &= l3e_get_flags(l3e);
     if ( l3e_get_flags(l3e) & _PAGE_PSE )
         goto leaf;
-#endif
-#endif
 
     l2t = map_domain_page(mfn);
     l2e = l2e_read_atomic(&l2t[l2_table_offset(addr)]);
diff -r bc8cb4778702 -r 7b658d31b5e1 xen/include/asm-x86/domain.h
--- a/xen/include/asm-x86/domain.h	Wed Sep 12 13:29:30 2012 +0100
+++ b/xen/include/asm-x86/domain.h	Wed Sep 12 13:59:26 2012 +0100
@@ -119,12 +119,10 @@ struct shadow_domain {
 };
 
 struct shadow_vcpu {
-#if CONFIG_PAGING_LEVELS >= 3
     /* PAE guests: per-vcpu shadow top-level table */
     l3_pgentry_t l3table[4] __attribute__((__aligned__(32)));
     /* PAE guests: per-vcpu cache of the top-level *guest* entries */
     l3_pgentry_t gl3e[4] __attribute__((__aligned__(32)));
-#endif
     /* Non-PAE guests: pointer to guest top-level pagetable */
     void *guest_vtable;
     /* Last MFN that we emulated a write to as unshadow heuristics. */
diff -r bc8cb4778702 -r 7b658d31b5e1 xen/include/asm-x86/hvm/svm/vmcb.h
--- a/xen/include/asm-x86/hvm/svm/vmcb.h	Wed Sep 12 13:29:30 2012 +0100
+++ b/xen/include/asm-x86/hvm/svm/vmcb.h	Wed Sep 12 13:59:26 2012 +0100
@@ -490,9 +490,6 @@ struct vmcb_struct {
 } __attribute__ ((packed));
 
 struct svm_domain {
-#if CONFIG_PAGING_LEVELS == 3
-    bool_t npt_4gb_warning;
-#endif
 };
 
 struct arch_svm_struct {
diff -r bc8cb4778702 -r 7b658d31b5e1 xen/include/asm-x86/mm.h
--- a/xen/include/asm-x86/mm.h	Wed Sep 12 13:29:30 2012 +0100
+++ b/xen/include/asm-x86/mm.h	Wed Sep 12 13:59:26 2012 +0100
@@ -398,16 +398,6 @@ static inline int get_page_and_type(stru
     ASSERT(((_p)->count_info & PGC_count_mask) != 0);          \
     ASSERT(page_get_owner(_p) == (_d))
 
-// Quick test for whether a given page can be represented directly in CR3.
-//
-#if CONFIG_PAGING_LEVELS == 3
-#define MFN_FITS_IN_CR3(_MFN) !(mfn_x(_MFN) >> 20)
-
-/* returns a lowmem machine address of the copied L3 root table */
-unsigned long
-pae_copy_root(struct vcpu *v, l3_pgentry_t *l3tab);
-#endif /* CONFIG_PAGING_LEVELS == 3 */
-
 int check_descriptor(const struct domain *, struct desc_struct *d);
 
 extern bool_t opt_allow_superpage;
diff -r bc8cb4778702 -r 7b658d31b5e1 xen/include/asm-x86/p2m.h
--- a/xen/include/asm-x86/p2m.h	Wed Sep 12 13:29:30 2012 +0100
+++ b/xen/include/asm-x86/p2m.h	Wed Sep 12 13:59:26 2012 +0100
@@ -603,30 +603,6 @@ int p2m_get_mem_access(struct domain *d,
 struct page_info *p2m_alloc_ptp(struct p2m_domain *p2m, unsigned long type);
 void p2m_free_ptp(struct p2m_domain *p2m, struct page_info *pg);
 
-#if CONFIG_PAGING_LEVELS == 3
-static inline int p2m_gfn_check_limit(
-    struct domain *d, unsigned long gfn, unsigned int order)
-{
-    /*
-     * 32bit AMD nested paging does not support over 4GB guest due to 
-     * hardware translation limit. This limitation is checked by comparing
-     * gfn with 0xfffffUL.
-     */
-    if ( !hap_enabled(d) || ((gfn + (1ul << order)) <= 0x100000UL) ||
-         (boot_cpu_data.x86_vendor != X86_VENDOR_AMD) )
-        return 0;
-
-    if ( !test_and_set_bool(d->arch.hvm_domain.svm.npt_4gb_warning) )
-        dprintk(XENLOG_WARNING, "Dom%d failed to populate memory beyond"
-                " 4GB: specify 'hap=0' domain config option.\n",
-                d->domain_id);
-
-    return -EINVAL;
-}
-#else
-#define p2m_gfn_check_limit(d, g, o) 0
-#endif
-
 /* Directly set a p2m entry: only for use by p2m code. Does not need
  * a call to put_gfn afterwards/ */
 int set_p2m_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn, 
diff -r bc8cb4778702 -r 7b658d31b5e1 xen/include/asm-x86/page.h
--- a/xen/include/asm-x86/page.h	Wed Sep 12 13:29:30 2012 +0100
+++ b/xen/include/asm-x86/page.h	Wed Sep 12 13:59:26 2012 +0100
@@ -126,13 +126,11 @@ static inline l3_pgentry_t l3e_from_padd
     ASSERT((pa & ~(PADDR_MASK & PAGE_MASK)) == 0);
     return (l3_pgentry_t) { pa | put_pte_flags(flags) };
 }
-#if CONFIG_PAGING_LEVELS >= 4
 static inline l4_pgentry_t l4e_from_paddr(paddr_t pa, unsigned int flags)
 {
     ASSERT((pa & ~(PADDR_MASK & PAGE_MASK)) == 0);
     return (l4_pgentry_t) { pa | put_pte_flags(flags) };
 }
-#endif
 #endif /* !__ASSEMBLY__ */
 
 /* Construct a pte from its direct integer representation. */
@@ -191,13 +189,7 @@ static inline l4_pgentry_t l4e_from_padd
 #ifndef __ASSEMBLY__
 
 /* Page-table type. */
-#if CONFIG_PAGING_LEVELS == 3
-/* x86_32 PAE */
-typedef struct { u32 pfn; } pagetable_t;
-#elif CONFIG_PAGING_LEVELS == 4
-/* x86_64 */
 typedef struct { u64 pfn; } pagetable_t;
-#endif
 #define pagetable_get_paddr(x)  ((paddr_t)(x).pfn << PAGE_SHIFT)
 #define pagetable_get_page(x)   mfn_to_page((x).pfn)
 #define pagetable_get_pfn(x)    ((x).pfn)
@@ -293,16 +285,11 @@ void copy_page_sse2(void *, const void *
 
 #ifndef __ASSEMBLY__
 extern root_pgentry_t idle_pg_table[ROOT_PAGETABLE_ENTRIES];
-#if CONFIG_PAGING_LEVELS == 3
-extern l2_pgentry_t   idle_pg_table_l2[
-    ROOT_PAGETABLE_ENTRIES * L2_PAGETABLE_ENTRIES];
-#elif CONFIG_PAGING_LEVELS == 4
 extern l2_pgentry_t  *compat_idle_pg_table_l2;
 extern unsigned int   m2p_compat_vstart;
 extern l2_pgentry_t l2_xenmap[L2_PAGETABLE_ENTRIES],
     l2_bootmap[L2_PAGETABLE_ENTRIES];
 extern l3_pgentry_t l3_bootmap[L3_PAGETABLE_ENTRIES];
-#endif
 extern l2_pgentry_t l2_identmap[4*L2_PAGETABLE_ENTRIES];
 extern l1_pgentry_t l1_identmap[L1_PAGETABLE_ENTRIES],
     l1_fixmap[L1_PAGETABLE_ENTRIES];
diff -r bc8cb4778702 -r 7b658d31b5e1 xen/include/asm-x86/paging.h
--- a/xen/include/asm-x86/paging.h	Wed Sep 12 13:29:30 2012 +0100
+++ b/xen/include/asm-x86/paging.h	Wed Sep 12 13:59:26 2012 +0100
@@ -327,17 +327,7 @@ static inline int paging_cmpxchg_guest_e
  * never sees a half-written entry that has _PAGE_PRESENT set */
 static inline void safe_write_pte(l1_pgentry_t *p, l1_pgentry_t new)
 {
-#if CONFIG_PAGING_LEVELS == 3
-    /* PAE machines write 64bit PTEs as two 32bit writes. */
-    volatile unsigned long *d = (unsigned long *) p;
-    unsigned long *s = (unsigned long *) &new;
-    BUILD_BUG_ON(sizeof (l1_pgentry_t) != 2 * sizeof (unsigned long));
-    d[0] = 0;
-    d[1] = s[1];
-    d[0] = s[0]; 
-#else
     *p = new;
-#endif
 }
 
 /* Atomically write a P2M entry and update the paging-assistance state 

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:41 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYj-0003kP-7L; Fri, 14 Sep 2012 10:55:41 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYh-0003Q9-QJ
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:40 +0000
Received: from [85.158.143.35:63280] by server-1.bemta-4.messagelabs.com id
	F9/D7-12504-B2D03505; Fri, 14 Sep 2012 10:55:39 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-21.messagelabs.com!1347620133!18244848!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22687 invoked from network); 14 Sep 2012 10:55:34 -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;
	14 Sep 2012 10: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 1TCTYb-00015S-BO
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYb-0000oU-9p
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:33 +0000
Message-Id: <E1TCTYb-0000oU-9p@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:32 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: We can assume
	CONFIG_PAGING_LEVELS==4.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347454766 -3600
# Node ID 7b658d31b5e1ebaaf9ea9cdc31cdba25d34d68ea
# Parent  bc8cb47787025aaa987a5a01719d014d8ede8665
x86: We can assume CONFIG_PAGING_LEVELS==4.

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r bc8cb4778702 -r 7b658d31b5e1 xen/arch/x86/boot/trampoline.S
--- a/xen/arch/x86/boot/trampoline.S	Wed Sep 12 13:29:30 2012 +0100
+++ b/xen/arch/x86/boot/trampoline.S	Wed Sep 12 13:59:26 2012 +0100
@@ -94,10 +94,8 @@ trampoline_protmode_entry:
         jz      .Lskip_efer
         movl    $MSR_EFER,%ecx
         rdmsr
-#if CONFIG_PAGING_LEVELS == 4
         btsl    $_EFER_LME,%eax /* Long Mode      */
         btsl    $_EFER_SCE,%eax /* SYSCALL/SYSRET */
-#endif
         btl     $20,%edi        /* No Execute?    */
         jnc     1f
         btsl    $_EFER_NX,%eax  /* No Execute     */
diff -r bc8cb4778702 -r 7b658d31b5e1 xen/arch/x86/boot/wakeup.S
--- a/xen/arch/x86/boot/wakeup.S	Wed Sep 12 13:29:30 2012 +0100
+++ b/xen/arch/x86/boot/wakeup.S	Wed Sep 12 13:59:26 2012 +0100
@@ -143,10 +143,8 @@ wakeup_32:
         jz      .Lskip_eferw
         movl    $MSR_EFER,%ecx
         rdmsr
-#if CONFIG_PAGING_LEVELS == 4
         btsl    $_EFER_LME,%eax /* Long Mode      */
         btsl    $_EFER_SCE,%eax /* SYSCALL/SYSRET */
-#endif
         btl     $20,%edi        /* No Execute?    */
         jnc     1f
         btsl    $_EFER_NX,%eax  /* No Execute     */
diff -r bc8cb4778702 -r 7b658d31b5e1 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c	Wed Sep 12 13:29:30 2012 +0100
+++ b/xen/arch/x86/domain.c	Wed Sep 12 13:59:26 2012 +0100
@@ -588,9 +588,8 @@ int arch_domain_create(struct domain *d,
     }
     else
     {
-        /* 32-bit PV guest by default only if Xen is not 64-bit. */
-        d->arch.is_32bit_pv = d->arch.has_32bit_shinfo =
-            (CONFIG_PAGING_LEVELS != 4);
+        /* 64-bit PV guest by default. */
+        d->arch.is_32bit_pv = d->arch.has_32bit_shinfo = 0;
 
         spin_lock_init(&d->arch.pv_domain.e820_lock);
     }
@@ -2096,7 +2095,6 @@ int domain_relinquish_resources(struct d
         ret = relinquish_memory(d, &d->xenpage_list, ~0UL);
         if ( ret )
             return ret;
-#if CONFIG_PAGING_LEVELS >= 4
         d->arch.relmem = RELMEM_l4;
         /* fallthrough */
 
@@ -2104,8 +2102,6 @@ int domain_relinquish_resources(struct d
         ret = relinquish_memory(d, &d->page_list, PGT_l4_page_table);
         if ( ret )
             return ret;
-#endif
-#if CONFIG_PAGING_LEVELS >= 3
         d->arch.relmem = RELMEM_l3;
         /* fallthrough */
 
@@ -2113,7 +2109,6 @@ int domain_relinquish_resources(struct d
         ret = relinquish_memory(d, &d->page_list, PGT_l3_page_table);
         if ( ret )
             return ret;
-#endif
         d->arch.relmem = RELMEM_l2;
         /* fallthrough */
 
diff -r bc8cb4778702 -r 7b658d31b5e1 xen/arch/x86/domain_build.c
--- a/xen/arch/x86/domain_build.c	Wed Sep 12 13:29:30 2012 +0100
+++ b/xen/arch/x86/domain_build.c	Wed Sep 12 13:59:26 2012 +0100
@@ -331,12 +331,7 @@ int __init construct_dom0(
     unsigned long image_len = image->mod_end;
     char *image_start = image_base + image_headroom;
     unsigned long initrd_len = initrd ? initrd->mod_end : 0;
-#if CONFIG_PAGING_LEVELS < 4
-    module_t mpt;
-    void *mpt_ptr;
-#else
     l4_pgentry_t *l4tab = NULL, *l4start = NULL;
-#endif
     l3_pgentry_t *l3tab = NULL, *l3start = NULL;
     l2_pgentry_t *l2tab = NULL, *l2start = NULL;
     l1_pgentry_t *l1tab = NULL, *l1start = NULL;
@@ -391,27 +386,16 @@ int __init construct_dom0(
     compatible = 0;
     compat32   = 0;
     machine = elf_uval(&elf, elf.ehdr, e_machine);
-    switch (CONFIG_PAGING_LEVELS) {
-    case 3: /* x86_32p */
-        if (parms.pae == PAEKERN_bimodal)
-            parms.pae = PAEKERN_extended_cr3;
-        printk(" Xen  kernel: 32-bit, PAE, lsb\n");
-        if (elf_32bit(&elf) && parms.pae && machine == EM_386)
-            compatible = 1;
-        break;
-    case 4: /* x86_64 */
-        printk(" Xen  kernel: 64-bit, lsb, compat32\n");
-        if (elf_32bit(&elf) && parms.pae == PAEKERN_bimodal)
-            parms.pae = PAEKERN_extended_cr3;
-        if (elf_32bit(&elf) && parms.pae && machine == EM_386)
-        {
-            compat32 = 1;
-            compatible = 1;
-        }
-        if (elf_64bit(&elf) && machine == EM_X86_64)
-            compatible = 1;
-        break;
+    printk(" Xen  kernel: 64-bit, lsb, compat32\n");
+    if (elf_32bit(&elf) && parms.pae == PAEKERN_bimodal)
+        parms.pae = PAEKERN_extended_cr3;
+    if (elf_32bit(&elf) && parms.pae && machine == EM_386)
+    {
+        compat32 = 1;
+        compatible = 1;
     }
+    if (elf_64bit(&elf) && machine == EM_X86_64)
+        compatible = 1;
     printk(" Dom0 kernel: %s%s, %s, paddr 0x%" PRIx64 " -> 0x%" PRIx64 "\n",
            elf_64bit(&elf) ? "64-bit" : "32-bit",
            parms.pae       ? ", PAE"  : "",
diff -r bc8cb4778702 -r 7b658d31b5e1 xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c	Wed Sep 12 13:29:30 2012 +0100
+++ b/xen/arch/x86/hvm/svm/svm.c	Wed Sep 12 13:59:26 2012 +0100
@@ -1285,8 +1285,7 @@ struct hvm_function_table * __init start
 
     svm_function_table.hap_supported = cpu_has_svm_npt;
     svm_function_table.hap_capabilities = HVM_HAP_SUPERPAGE_2MB |
-        (((CONFIG_PAGING_LEVELS == 4) && (cpuid_edx(0x80000001) & 0x04000000)) ?
-            HVM_HAP_SUPERPAGE_1GB : 0);
+        ((cpuid_edx(0x80000001) & 0x04000000) ? HVM_HAP_SUPERPAGE_1GB : 0);
 
     return &svm_function_table;
 }
diff -r bc8cb4778702 -r 7b658d31b5e1 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Wed Sep 12 13:29:30 2012 +0100
+++ b/xen/arch/x86/mm.c	Wed Sep 12 13:59:26 2012 +0100
@@ -277,8 +277,7 @@ void __init arch_init_memory(void)
     if ( cpu_has_nx )
         base_disallow_mask &= ~_PAGE_NX_BIT;
     /* On x86/64, range [62:52] is available for guest software use. */
-    if ( CONFIG_PAGING_LEVELS == 4 )
-        base_disallow_mask &= ~get_pte_flags((intpte_t)0x7ff << 52);
+    base_disallow_mask &= ~get_pte_flags((intpte_t)0x7ff << 52);
 
     /*
      * Initialise our DOMID_XEN domain.
@@ -475,11 +474,9 @@ void update_cr3(struct vcpu *v)
         return;
     }
 
-#if CONFIG_PAGING_LEVELS == 4
     if ( !(v->arch.flags & TF_kernel_mode) )
         cr3_mfn = pagetable_get_pfn(v->arch.guest_table_user);
     else
-#endif
         cr3_mfn = pagetable_get_pfn(v->arch.guest_table);
 
     make_cr3(v, cr3_mfn);
@@ -925,7 +922,6 @@ get_page_from_l3e(
     return rc;
 }
 
-#if CONFIG_PAGING_LEVELS >= 4
 define_get_linear_pagetable(l4);
 static int
 get_page_from_l4e(
@@ -949,7 +945,6 @@ get_page_from_l4e(
 
     return rc;
 }
-#endif /* 4 level */
 
 #ifdef USER_MAPPINGS_ARE_GLOBAL
 #define adjust_guest_l1e(pl1e, d)                                            \
@@ -1107,7 +1102,6 @@ static int put_page_from_l3e(l3_pgentry_
     return put_page_and_type_preemptible(l3e_get_page(l3e), preemptible);
 }
 
-#if CONFIG_PAGING_LEVELS >= 4
 static int put_page_from_l4e(l4_pgentry_t l4e, unsigned long pfn,
                              int partial, int preemptible)
 {
@@ -1120,7 +1114,6 @@ static int put_page_from_l4e(l4_pgentry_
     }
     return 1;
 }
-#endif
 
 static int alloc_l1_table(struct page_info *page)
 {
@@ -1259,21 +1252,6 @@ static int alloc_l3_table(struct page_in
     unsigned int   i;
     int            rc = 0, partial = page->partial_pte;
 
-#if CONFIG_PAGING_LEVELS == 3
-    /*
-     * PAE pgdirs above 4GB are unacceptable if the guest does not understand
-     * the weird 'extended cr3' format for dealing with high-order address
-     * bits. We cut some slack for control tools (before vcpu0 is initialised).
-     */
-    if ( (pfn >= 0x100000) &&
-         unlikely(!VM_ASSIST(d, VMASST_TYPE_pae_extended_cr3)) &&
-         d->vcpu && d->vcpu[0] && d->vcpu[0]->is_initialised )
-    {
-        MEM_LOG("PAE pgd must be below 4GB (0x%lx >= 0x100000)", pfn);
-        return -EINVAL;
-    }
-#endif
-
     pl3e = map_domain_page(pfn);
 
     /*
@@ -1340,7 +1318,6 @@ static int alloc_l3_table(struct page_in
     return rc > 0 ? 0 : rc;
 }
 
-#if CONFIG_PAGING_LEVELS >= 4
 static int alloc_l4_table(struct page_info *page, int preemptible)
 {
     struct domain *d = page_get_owner(page);
@@ -1396,10 +1373,6 @@ static int alloc_l4_table(struct page_in
 
     return rc > 0 ? 0 : rc;
 }
-#else
-#define alloc_l4_table(page, preemptible) (-EINVAL)
-#endif
-
 
 static void free_l1_table(struct page_info *page)
 {
@@ -1486,7 +1459,6 @@ static int free_l3_table(struct page_inf
     return rc > 0 ? 0 : rc;
 }
 
-#if CONFIG_PAGING_LEVELS >= 4
 static int free_l4_table(struct page_info *page, int preemptible)
 {
     struct domain *d = page_get_owner(page);
@@ -1516,9 +1488,6 @@ static int free_l4_table(struct page_inf
     }
     return rc > 0 ? 0 : rc;
 }
-#else
-#define free_l4_table(page, preemptible) (-EINVAL)
-#endif
 
 int page_lock(struct page_info *page)
 {
@@ -1823,8 +1792,6 @@ static int mod_l3_entry(l3_pgentry_t *pl
     return rc;
 }
 
-#if CONFIG_PAGING_LEVELS >= 4
-
 /* Update the L4 entry at pl4e to new value nl4e. pl4e is within frame pfn. */
 static int mod_l4_entry(l4_pgentry_t *pl4e, 
                         l4_pgentry_t nl4e, 
@@ -1886,8 +1853,6 @@ static int mod_l4_entry(l4_pgentry_t *pl
     return rc;
 }
 
-#endif
-
 static int cleanup_page_cacheattr(struct page_info *page)
 {
     uint32_t cacheattr =
@@ -2089,10 +2054,6 @@ int free_page_type(struct page_info *pag
         rc = free_l2_table(page, preemptible);
         break;
     case PGT_l3_page_table:
-#if CONFIG_PAGING_LEVELS == 3
-        if ( !(type & PGT_partial) )
-            page->nr_validated_ptes = L3_PAGETABLE_ENTRIES;
-#endif
         rc = free_l3_table(page, preemptible);
         break;
     case PGT_l4_page_table:
@@ -3348,12 +3309,10 @@ long do_mmu_update(
                     rc = mod_l3_entry(va, l3e_from_intpte(req.val), mfn,
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, 1, v);
                     break;
-#if CONFIG_PAGING_LEVELS >= 4
                 case PGT_l4_page_table:
                     rc = mod_l4_entry(va, l4e_from_intpte(req.val), mfn,
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, 1, v);
                 break;
-#endif
                 case PGT_writable_page:
                     perfc_incr(writable_mmu_updates);
                     if ( paging_write_guest_entry(v, va, req.val, _mfn(mfn)) )
diff -r bc8cb4778702 -r 7b658d31b5e1 xen/arch/x86/mm/hap/hap.c
--- a/xen/arch/x86/mm/hap/hap.c	Wed Sep 12 13:29:30 2012 +0100
+++ b/xen/arch/x86/mm/hap/hap.c	Wed Sep 12 13:59:26 2012 +0100
@@ -280,26 +280,6 @@ static struct page_info *hap_alloc_p2m_p
     paging_lock_recursive(d);
     pg = hap_alloc(d);
 
-#if CONFIG_PAGING_LEVELS == 3
-    /* Under PAE mode, top-level P2M table should be allocated below 4GB space
-     * because the size of h_cr3 is only 32-bit. We use alloc_domheap_pages to
-     * force this requirement, and exchange the guaranteed 32-bit-clean
-     * page for the one we just hap_alloc()ed. */
-    if ( d->arch.paging.hap.p2m_pages == 0
-         && mfn_x(page_to_mfn(pg)) >= (1UL << (32 - PAGE_SHIFT)) )
-    {
-        free_domheap_page(pg);
-        pg = alloc_domheap_page(
-            NULL, MEMF_bits(32) | MEMF_node(domain_to_node(d)));
-        if ( likely(pg != NULL) )
-        {
-            void *p = __map_domain_page(pg);
-            clear_page(p);
-            hap_unmap_domain_page(p);
-        }
-    }
-#endif
-
     if ( likely(pg != NULL) )
     {
         d->arch.paging.hap.total_pages--;
@@ -403,7 +383,6 @@ hap_set_allocation(struct domain *d, uns
     return 0;
 }
 
-#if CONFIG_PAGING_LEVELS == 4
 static void hap_install_xen_entries_in_l4(struct vcpu *v, mfn_t l4mfn)
 {
     struct domain *d = v->domain;
@@ -433,103 +412,20 @@ static void hap_install_xen_entries_in_l
 
     hap_unmap_domain_page(l4e);
 }
-#endif /* CONFIG_PAGING_LEVELS == 4 */
-
-#if CONFIG_PAGING_LEVELS == 3
-static void hap_install_xen_entries_in_l2h(struct vcpu *v, mfn_t l2hmfn)
-{
-    struct domain *d = v->domain;
-    struct p2m_domain *hostp2m = p2m_get_hostp2m(d);
-    l2_pgentry_t *l2e;
-    l3_pgentry_t *p2m;
-    int i;
-
-    l2e = hap_map_domain_page(l2hmfn);
-    ASSERT(l2e != NULL);
-
-    /* Copy the common Xen mappings from the idle domain */
-    memcpy(&l2e[L2_PAGETABLE_FIRST_XEN_SLOT & (L2_PAGETABLE_ENTRIES-1)],
-           &idle_pg_table_l2[L2_PAGETABLE_FIRST_XEN_SLOT],
-           L2_PAGETABLE_XEN_SLOTS * sizeof(l2_pgentry_t));
-
-    /* Install the per-domain mappings for this domain */
-    for ( i = 0; i < PDPT_L2_ENTRIES; i++ )
-        l2e[l2_table_offset(PERDOMAIN_VIRT_START) + i] =
-            l2e_from_pfn(
-                mfn_x(page_to_mfn(perdomain_pt_page(d, i))),
-                __PAGE_HYPERVISOR);
-
-    /* No linear mapping; will be set up by monitor-table contructor. */
-    for ( i = 0; i < 4; i++ )
-        l2e[l2_table_offset(LINEAR_PT_VIRT_START) + i] =
-            l2e_empty();
-
-    /* Install the domain-specific p2m table */
-    ASSERT(pagetable_get_pfn(p2m_get_pagetable(hostp2m)) != 0);
-    p2m = hap_map_domain_page(pagetable_get_mfn(p2m_get_pagetable(hostp2m)));
-    for ( i = 0; i < MACHPHYS_MBYTES>>1; i++ )
-    {
-        l2e[l2_table_offset(RO_MPT_VIRT_START) + i] =
-            (l3e_get_flags(p2m[i]) & _PAGE_PRESENT)
-            ? l2e_from_pfn(mfn_x(_mfn(l3e_get_pfn(p2m[i]))),
-                           __PAGE_HYPERVISOR)
-            : l2e_empty();
-    }
-    hap_unmap_domain_page(p2m);
-    hap_unmap_domain_page(l2e);
-}
-#endif
 
 static mfn_t hap_make_monitor_table(struct vcpu *v)
 {
     struct domain *d = v->domain;
     struct page_info *pg;
+    mfn_t m4mfn;
 
     ASSERT(pagetable_get_pfn(v->arch.monitor_table) == 0);
 
-#if CONFIG_PAGING_LEVELS == 4
-    {
-        mfn_t m4mfn;
-        if ( (pg = hap_alloc(d)) == NULL )
-            goto oom;
-        m4mfn = page_to_mfn(pg);
-        hap_install_xen_entries_in_l4(v, m4mfn);
-        return m4mfn;
-    }
-#elif CONFIG_PAGING_LEVELS == 3
-    {
-        mfn_t m3mfn, m2mfn;
-        l3_pgentry_t *l3e;
-        l2_pgentry_t *l2e;
-        int i;
-
-        if ( (pg = hap_alloc(d)) == NULL )
-            goto oom;
-        m3mfn = page_to_mfn(pg);
-
-        /* Install a monitor l2 table in slot 3 of the l3 table.
-         * This is used for all Xen entries, including linear maps
-         */
-        if ( (pg = hap_alloc(d)) == NULL )
-            goto oom;
-        m2mfn = page_to_mfn(pg);
-        l3e = hap_map_domain_page(m3mfn);
-        l3e[3] = l3e_from_pfn(mfn_x(m2mfn), _PAGE_PRESENT);
-        hap_install_xen_entries_in_l2h(v, m2mfn);
-        /* Install the monitor's own linear map */
-        l2e = hap_map_domain_page(m2mfn);
-        for ( i = 0; i < L3_PAGETABLE_ENTRIES; i++ )
-            l2e[l2_table_offset(LINEAR_PT_VIRT_START) + i] =
-                (l3e_get_flags(l3e[i]) & _PAGE_PRESENT)
-                ? l2e_from_pfn(l3e_get_pfn(l3e[i]), __PAGE_HYPERVISOR)
-                : l2e_empty();
-        hap_unmap_domain_page(l2e);
-        hap_unmap_domain_page(l3e);
-
-        HAP_PRINTK("new monitor table: %#lx\n", mfn_x(m3mfn));
-        return m3mfn;
-    }
-#endif
+    if ( (pg = hap_alloc(d)) == NULL )
+        goto oom;
+    m4mfn = page_to_mfn(pg);
+    hap_install_xen_entries_in_l4(v, m4mfn);
+    return m4mfn;
 
  oom:
     HAP_ERROR("out of memory building monitor pagetable\n");
@@ -541,16 +437,6 @@ static void hap_destroy_monitor_table(st
 {
     struct domain *d = v->domain;
 
-#if CONFIG_PAGING_LEVELS == 3
-    /* Need to destroy the l2 monitor page in slot 4 too */
-    {
-        l3_pgentry_t *l3e = hap_map_domain_page(mmfn);
-        ASSERT(l3e_get_flags(l3e[3]) & _PAGE_PRESENT);
-        hap_free(d, _mfn(l3e_get_pfn(l3e[3])));
-        hap_unmap_domain_page(l3e);
-    }
-#endif
-
     /* Put the memory back in the pool */
     hap_free(d, mmfn);
 }
@@ -814,47 +700,6 @@ static void hap_update_paging_modes(stru
     put_gfn(d, cr3_gfn);
 }
 
-#if CONFIG_PAGING_LEVELS == 3
-static void p2m_install_entry_in_monitors(struct domain *d, l3_pgentry_t *l3e)
-/* Special case, only used for PAE hosts: update the mapping of the p2m
- * table.  This is trivial in other paging modes (one top-level entry
- * points to the top-level p2m, no maintenance needed), but PAE makes
- * life difficult by needing a copy of the p2m table in eight l2h slots
- * in the monitor table.  This function makes fresh copies when a p2m
- * l3e changes. */
-{
-    l2_pgentry_t *ml2e;
-    struct vcpu *v;
-    unsigned int index;
-
-    index = ((unsigned long)l3e & ~PAGE_MASK) / sizeof(l3_pgentry_t);
-    ASSERT(index < MACHPHYS_MBYTES>>1);
-
-    for_each_vcpu ( d, v )
-    {
-        if ( pagetable_get_pfn(v->arch.monitor_table) == 0 )
-            continue;
-
-        ASSERT(paging_mode_external(v->domain));
-
-        if ( v == current ) /* OK to use linear map of monitor_table */
-            ml2e = __linear_l2_table + l2_linear_offset(RO_MPT_VIRT_START);
-        else {
-            l3_pgentry_t *ml3e;
-            ml3e = hap_map_domain_page(
-                pagetable_get_mfn(v->arch.monitor_table));
-            ASSERT(l3e_get_flags(ml3e[3]) & _PAGE_PRESENT);
-            ml2e = hap_map_domain_page(_mfn(l3e_get_pfn(ml3e[3])));
-            ml2e += l2_table_offset(RO_MPT_VIRT_START);
-            hap_unmap_domain_page(ml3e);
-        }
-        ml2e[index] = l2e_from_pfn(l3e_get_pfn(*l3e), __PAGE_HYPERVISOR);
-        if ( v != current )
-            hap_unmap_domain_page(ml2e);
-    }
-}
-#endif
-
 static void
 hap_write_p2m_entry(struct vcpu *v, unsigned long gfn, l1_pgentry_t *p,
                     mfn_t table_mfn, l1_pgentry_t new, unsigned int level)
@@ -886,14 +731,6 @@ hap_write_p2m_entry(struct vcpu *v, unsi
          && (level == 1 || (level == 2 && (old_flags & _PAGE_PSE))) )
              flush_tlb_mask(d->domain_dirty_cpumask);
 
-#if CONFIG_PAGING_LEVELS == 3
-    /* install P2M in monitor table for PAE Xen */
-    if ( level == 3 )
-        /* We have written to the p2m l3: need to sync the per-vcpu
-         * copies of it in the monitor tables */
-        p2m_install_entry_in_monitors(d, (l3_pgentry_t *)p);
-#endif
-
     paging_unlock(d);
 
     if ( flush_nestedp2m )
diff -r bc8cb4778702 -r 7b658d31b5e1 xen/arch/x86/mm/p2m-pod.c
--- a/xen/arch/x86/mm/p2m-pod.c	Wed Sep 12 13:29:30 2012 +0100
+++ b/xen/arch/x86/mm/p2m-pod.c	Wed Sep 12 13:59:26 2012 +0100
@@ -1120,10 +1120,6 @@ guest_physmap_mark_populate_on_demand(st
     if ( !paging_mode_translate(d) )
         return -EINVAL;
 
-    rc = p2m_gfn_check_limit(d, gfn, order);
-    if ( rc != 0 )
-        return rc;
-
     gfn_lock(p2m, gfn, order);
 
     P2M_DEBUG("mark pod gfn=%#lx\n", gfn);
diff -r bc8cb4778702 -r 7b658d31b5e1 xen/arch/x86/mm/p2m-pt.c
--- a/xen/arch/x86/mm/p2m-pt.c	Wed Sep 12 13:29:30 2012 +0100
+++ b/xen/arch/x86/mm/p2m-pt.c	Wed Sep 12 13:59:26 2012 +0100
@@ -150,10 +150,8 @@ p2m_free_entry(struct p2m_domain *p2m, l
 static void p2m_add_iommu_flags(l1_pgentry_t *p2m_entry,
                                 unsigned int nlevel, unsigned int flags)
 {
-#if CONFIG_PAGING_LEVELS == 4
     if ( iommu_hap_pt_share )
         l1e_add_flags(*p2m_entry, iommu_nlevel_to_flags(nlevel, flags));
-#endif
 }
 
 static int
@@ -189,10 +187,6 @@ p2m_next_level(struct p2m_domain *p2m, m
             p2m->write_p2m_entry(p2m, gfn, p2m_entry, *table_mfn, new_entry, 4);
             break;
         case PGT_l2_page_table:
-#if CONFIG_PAGING_LEVELS == 3
-            /* for PAE mode, PDPE only has PCD/PWT/P bits available */
-            new_entry = l1e_from_pfn(mfn_x(page_to_mfn(pg)), _PAGE_PRESENT);
-#endif
             p2m_add_iommu_flags(&new_entry, 2, IOMMUF_readable|IOMMUF_writable);
             p2m->write_p2m_entry(p2m, gfn, p2m_entry, *table_mfn, new_entry, 3);
             break;
@@ -317,12 +311,11 @@ p2m_set_entry(struct p2m_domain *p2m, un
         __trace_var(TRC_MEM_SET_P2M_ENTRY, 0, sizeof(t), &t);
     }
 
-#if CONFIG_PAGING_LEVELS >= 4
     if ( !p2m_next_level(p2m, &table_mfn, &table, &gfn_remainder, gfn,
                          L4_PAGETABLE_SHIFT - PAGE_SHIFT,
                          L4_PAGETABLE_ENTRIES, PGT_l3_page_table) )
         goto out;
-#endif
+
     /*
      * Try to allocate 1GB page table if this feature is supported.
      */
@@ -361,18 +354,9 @@ p2m_set_entry(struct p2m_domain *p2m, un
         if ( l1e_get_flags(old_entry) & _PAGE_PRESENT )
             p2m_free_entry(p2m, &old_entry, page_order);
     }
-    /*
-     * When using PAE Xen, we only allow 33 bits of pseudo-physical
-     * address in translated guests (i.e. 8 GBytes).  This restriction
-     * comes from wanting to map the P2M table into the 16MB RO_MPT hole
-     * in Xen's address space for translated PV guests.
-     * When using AMD's NPT on PAE Xen, we are restricted to 4GB.
-     */
     else if ( !p2m_next_level(p2m, &table_mfn, &table, &gfn_remainder, gfn,
                               L3_PAGETABLE_SHIFT - PAGE_SHIFT,
-                              ((CONFIG_PAGING_LEVELS == 3)
-                               ? (hap_enabled(p2m->domain) ? 4 : 8)
-                               : L3_PAGETABLE_ENTRIES),
+                              L3_PAGETABLE_ENTRIES,
                               PGT_l2_page_table) )
         goto out;
 
@@ -493,15 +477,12 @@ static mfn_t p2m_gfn_to_mfn_current(stru
 
     l1_pgentry_t l1e = l1e_empty(), *p2m_entry;
     l2_pgentry_t l2e = l2e_empty();
+    l3_pgentry_t l3e = l3e_empty();
     int ret;
-#if CONFIG_PAGING_LEVELS >= 4
-    l3_pgentry_t l3e = l3e_empty();
-#endif
 
     ASSERT(gfn < (RO_MPT_VIRT_END - RO_MPT_VIRT_START) 
            / sizeof(l1_pgentry_t));
 
-#if CONFIG_PAGING_LEVELS >= 4
     /*
      * Read & process L3
      */
@@ -549,7 +530,7 @@ pod_retry_l3:
             *page_order = PAGE_ORDER_1G;
         goto out;
     }
-#endif
+
     /*
      * Read & process L2
      */
@@ -691,7 +672,6 @@ p2m_gfn_to_mfn(struct p2m_domain *p2m, u
 
     mfn = pagetable_get_mfn(p2m_get_pagetable(p2m));
 
-#if CONFIG_PAGING_LEVELS >= 4
     {
         l4_pgentry_t *l4e = map_domain_page(mfn_x(mfn));
         l4e += l4_table_offset(addr);
@@ -703,19 +683,9 @@ p2m_gfn_to_mfn(struct p2m_domain *p2m, u
         mfn = _mfn(l4e_get_pfn(*l4e));
         unmap_domain_page(l4e);
     }
-#endif
     {
         l3_pgentry_t *l3e = map_domain_page(mfn_x(mfn));
-#if CONFIG_PAGING_LEVELS == 3
-        /* On PAE hosts the p2m has eight l3 entries, not four (see
-         * shadow_set_p2m_entry()) so we can't use l3_table_offset.
-         * Instead, just count the number of l3es from zero.  It's safe
-         * to do this because we already checked that the gfn is within
-         * the bounds of the p2m. */
-        l3e += (addr >> L3_PAGETABLE_SHIFT);
-#else
         l3e += l3_table_offset(addr);
-#endif
 pod_retry_l3:
         if ( (l3e_get_flags(*l3e) & _PAGE_PRESENT) == 0 )
         {
@@ -828,10 +798,8 @@ static void p2m_change_type_global(struc
     mfn_t l1mfn, l2mfn, l3mfn;
     unsigned long i1, i2, i3;
     l3_pgentry_t *l3e;
-#if CONFIG_PAGING_LEVELS == 4
     l4_pgentry_t *l4e;
     unsigned long i4;
-#endif /* CONFIG_PAGING_LEVELS == 4 */
 
     BUG_ON(p2m_is_grant(ot) || p2m_is_grant(nt));
     BUG_ON(ot != nt && (ot == p2m_mmio_direct || nt == p2m_mmio_direct));
@@ -844,14 +812,8 @@ static void p2m_change_type_global(struc
 
     ASSERT(p2m_locked_by_me(p2m));
 
-#if CONFIG_PAGING_LEVELS == 4
     l4e = map_domain_page(mfn_x(pagetable_get_mfn(p2m_get_pagetable(p2m))));
-#else /* CONFIG_PAGING_LEVELS == 3 */
-    l3mfn = _mfn(mfn_x(pagetable_get_mfn(p2m_get_pagetable(p2m))));
-    l3e = map_domain_page(mfn_x(pagetable_get_mfn(p2m_get_pagetable(p2m))));
-#endif
 
-#if CONFIG_PAGING_LEVELS >= 4
     for ( i4 = 0; i4 < L4_PAGETABLE_ENTRIES; i4++ )
     {
         if ( !(l4e_get_flags(l4e[i4]) & _PAGE_PRESENT) )
@@ -860,9 +822,8 @@ static void p2m_change_type_global(struc
         }
         l3mfn = _mfn(l4e_get_pfn(l4e[i4]));
         l3e = map_domain_page(l4e_get_pfn(l4e[i4]));
-#endif
         for ( i3 = 0;
-              i3 < ((CONFIG_PAGING_LEVELS==4) ? L3_PAGETABLE_ENTRIES : 8);
+              i3 < L3_PAGETABLE_ENTRIES;
               i3++ )
         {
             if ( !(l3e_get_flags(l3e[i3]) & _PAGE_PRESENT) )
@@ -901,11 +862,7 @@ static void p2m_change_type_global(struc
                     mfn = l2e_get_pfn(l2e[i2]);
                     /* Do not use get_gpfn_from_mfn because it may return 
                        SHARED_M2P_ENTRY */
-                    gfn = (i2 + (i3
-#if CONFIG_PAGING_LEVELS >= 4
-				   + (i4 * L3_PAGETABLE_ENTRIES)
-#endif
-				)
+                    gfn = (i2 + (i3 + (i4 * L3_PAGETABLE_ENTRIES))
                            * L2_PAGETABLE_ENTRIES) * L1_PAGETABLE_ENTRIES; 
                     flags = p2m_type_to_flags(nt, _mfn(mfn));
                     l1e_content = l1e_from_pfn(mfn, flags | _PAGE_PSE);
@@ -924,12 +881,8 @@ static void p2m_change_type_global(struc
                     if ( p2m_flags_to_type(flags) != ot )
                         continue;
                     mfn = l1e_get_pfn(l1e[i1]);
-                    gfn = i1 + (i2 + (i3
-#if CONFIG_PAGING_LEVELS >= 4
-					+ (i4 * L3_PAGETABLE_ENTRIES)
-#endif
-				     )
-                           * L2_PAGETABLE_ENTRIES) * L1_PAGETABLE_ENTRIES; 
+                    gfn = i1 + (i2 + (i3 + (i4 * L3_PAGETABLE_ENTRIES))
+                                * L2_PAGETABLE_ENTRIES) * L1_PAGETABLE_ENTRIES; 
                     /* create a new 1le entry with the new type */
                     flags = p2m_type_to_flags(nt, _mfn(mfn));
                     l1e_content = p2m_l1e_from_pfn(mfn, flags);
@@ -940,17 +893,10 @@ static void p2m_change_type_global(struc
             }
             unmap_domain_page(l2e);
         }
-#if CONFIG_PAGING_LEVELS >= 4
         unmap_domain_page(l3e);
     }
-#endif
 
-#if CONFIG_PAGING_LEVELS == 4
     unmap_domain_page(l4e);
-#else /* CONFIG_PAGING_LEVELS == 3 */
-    unmap_domain_page(l3e);
-#endif
-
 }
 
 #if P2M_AUDIT
@@ -976,19 +922,12 @@ long p2m_pt_audit_p2m(struct p2m_domain 
         l1_pgentry_t *l1e;
         int i1, i2;
 
-#if CONFIG_PAGING_LEVELS == 4
         l4_pgentry_t *l4e;
         l3_pgentry_t *l3e;
         int i4, i3;
         l4e = map_domain_page(mfn_x(pagetable_get_mfn(p2m_get_pagetable(p2m))));
-#else /* CONFIG_PAGING_LEVELS == 3 */
-        l3_pgentry_t *l3e;
-        int i3;
-        l3e = map_domain_page(mfn_x(pagetable_get_mfn(p2m_get_pagetable(p2m))));
-#endif
 
         gfn = 0;
-#if CONFIG_PAGING_LEVELS >= 4
         for ( i4 = 0; i4 < L4_PAGETABLE_ENTRIES; i4++ )
         {
             if ( !(l4e_get_flags(l4e[i4]) & _PAGE_PRESENT) )
@@ -997,9 +936,8 @@ long p2m_pt_audit_p2m(struct p2m_domain 
                 continue;
             }
             l3e = map_domain_page(mfn_x(_mfn(l4e_get_pfn(l4e[i4]))));
-#endif
             for ( i3 = 0;
-                  i3 < ((CONFIG_PAGING_LEVELS==4) ? L3_PAGETABLE_ENTRIES : 8);
+                  i3 < L3_PAGETABLE_ENTRIES;
                   i3++ )
             {
                 if ( !(l3e_get_flags(l3e[i3]) & _PAGE_PRESENT) )
@@ -1101,17 +1039,10 @@ long p2m_pt_audit_p2m(struct p2m_domain 
                 }
                 unmap_domain_page(l2e);
             }
-#if CONFIG_PAGING_LEVELS >= 4
             unmap_domain_page(l3e);
         }
-#endif
 
-#if CONFIG_PAGING_LEVELS == 4
         unmap_domain_page(l4e);
-#else /* CONFIG_PAGING_LEVELS == 3 */
-        unmap_domain_page(l3e);
-#endif
-
     }
 
     if ( entry_count != p2m->pod.entry_count )
diff -r bc8cb4778702 -r 7b658d31b5e1 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Wed Sep 12 13:29:30 2012 +0100
+++ b/xen/arch/x86/mm/p2m.c	Wed Sep 12 13:59:26 2012 +0100
@@ -343,14 +343,7 @@ int p2m_alloc_table(struct p2m_domain *p
 
     P2M_PRINTK("allocating p2m table\n");
 
-    p2m_top = p2m_alloc_ptp(p2m,
-#if CONFIG_PAGING_LEVELS == 4
-        PGT_l4_page_table
-#else
-        PGT_l3_page_table
-#endif
-        );
-
+    p2m_top = p2m_alloc_ptp(p2m, PGT_l4_page_table);
     if ( p2m_top == NULL )
     {
         p2m_unlock(p2m);
@@ -545,10 +538,6 @@ guest_physmap_add_entry(struct domain *d
         return 0;
     }
 
-    rc = p2m_gfn_check_limit(d, gfn, page_order);
-    if ( rc != 0 )
-        return rc;
-
     p2m_lock(p2m);
 
     P2M_DEBUG("adding gfn=%#lx mfn=%#lx\n", gfn, mfn);
diff -r bc8cb4778702 -r 7b658d31b5e1 xen/arch/x86/mm/shadow/common.c
--- a/xen/arch/x86/mm/shadow/common.c	Wed Sep 12 13:29:30 2012 +0100
+++ b/xen/arch/x86/mm/shadow/common.c	Wed Sep 12 13:59:26 2012 +0100
@@ -566,10 +566,8 @@ static inline void _sh_resync_l1(struct 
         SHADOW_INTERNAL_NAME(sh_resync_l1, 2)(v, gmfn, snpmfn);
     else if ( pg->shadow_flags & SHF_L1_PAE )
         SHADOW_INTERNAL_NAME(sh_resync_l1, 3)(v, gmfn, snpmfn);
-#if CONFIG_PAGING_LEVELS >= 4
     else if ( pg->shadow_flags & SHF_L1_64 )
         SHADOW_INTERNAL_NAME(sh_resync_l1, 4)(v, gmfn, snpmfn);
-#endif
 }
 
 
@@ -872,10 +870,8 @@ static int sh_skip_sync(struct vcpu *v, 
         return SHADOW_INTERNAL_NAME(sh_safe_not_to_sync, 2)(v, gl1mfn);
     else if ( pg->shadow_flags & SHF_L1_PAE )
         return SHADOW_INTERNAL_NAME(sh_safe_not_to_sync, 3)(v, gl1mfn);
-#if CONFIG_PAGING_LEVELS >= 4
     else if ( pg->shadow_flags & SHF_L1_64 )
         return SHADOW_INTERNAL_NAME(sh_safe_not_to_sync, 4)(v, gl1mfn);
-#endif
     SHADOW_ERROR("gmfn 0x%lx was OOS but not shadowed as an l1.\n", 
                  mfn_x(gl1mfn));
     BUG();
@@ -1083,7 +1079,6 @@ sh_validate_guest_entry(struct vcpu *v, 
         result |= SHADOW_INTERNAL_NAME(sh_map_and_validate_gl2he, 3)
             (v, gmfn, entry, size);
 
-#if CONFIG_PAGING_LEVELS >= 4 
     if ( page->shadow_flags & SHF_L1_64 ) 
         result |= SHADOW_INTERNAL_NAME(sh_map_and_validate_gl1e, 4)
             (v, gmfn, entry, size);
@@ -1099,10 +1094,7 @@ sh_validate_guest_entry(struct vcpu *v, 
     if ( page->shadow_flags & SHF_L4_64 ) 
         result |= SHADOW_INTERNAL_NAME(sh_map_and_validate_gl4e, 4)
             (v, gmfn, entry, size);
-#else /* 32-bit hypervisor does not support 64-bit guests */
-    ASSERT((page->shadow_flags 
-            & (SHF_L4_64|SHF_L3_64|SHF_L2H_64|SHF_L2_64|SHF_L1_64)) == 0);
-#endif
+
     this_cpu(trace_shadow_path_flags) |= (result<<(TRCE_SFLAG_SET_CHANGED)); 
 
     return result;
@@ -1265,11 +1257,9 @@ void shadow_unhook_mappings(struct vcpu 
     case SH_type_l2h_pae_shadow:
         SHADOW_INTERNAL_NAME(sh_unhook_pae_mappings, 3)(v, smfn, user_only);
         break;
-#if CONFIG_PAGING_LEVELS >= 4
     case SH_type_l4_64_shadow:
         SHADOW_INTERNAL_NAME(sh_unhook_64b_mappings, 4)(v, smfn, user_only);
         break;
-#endif
     default:
         SHADOW_ERROR("top-level shadow has bad type %08x\n", sp->u.sh.type);
         BUG();
@@ -1647,51 +1637,6 @@ shadow_free_p2m_page(struct domain *d, s
     paging_unlock(d);
 }
 
-#if CONFIG_PAGING_LEVELS == 3
-static void p2m_install_entry_in_monitors(struct domain *d, 
-                                          l3_pgentry_t *l3e) 
-/* Special case, only used for external-mode domains on PAE hosts:
- * update the mapping of the p2m table.  Once again, this is trivial in
- * other paging modes (one top-level entry points to the top-level p2m,
- * no maintenance needed), but PAE makes life difficult by needing a
- * copy the eight l3es of the p2m table in eight l2h slots in the
- * monitor table.  This function makes fresh copies when a p2m l3e
- * changes. */
-{
-    l2_pgentry_t *ml2e;
-    struct vcpu *v;
-    unsigned int index;
-
-    index = ((unsigned long)l3e & ~PAGE_MASK) / sizeof(l3_pgentry_t);
-    ASSERT(index < MACHPHYS_MBYTES>>1);
-
-    for_each_vcpu(d, v) 
-    {
-        if ( pagetable_get_pfn(v->arch.monitor_table) == 0 ) 
-            continue;
-        ASSERT(shadow_mode_external(v->domain));
-
-        SHADOW_DEBUG(P2M, "d=%u v=%u index=%u mfn=%#lx\n",
-                      d->domain_id, v->vcpu_id, index, l3e_get_pfn(*l3e));
-
-        if ( v == current ) /* OK to use linear map of monitor_table */
-            ml2e = __linear_l2_table + l2_linear_offset(RO_MPT_VIRT_START);
-        else 
-        {
-            l3_pgentry_t *ml3e;
-            ml3e = sh_map_domain_page(pagetable_get_mfn(v->arch.monitor_table));
-            ASSERT(l3e_get_flags(ml3e[3]) & _PAGE_PRESENT);
-            ml2e = sh_map_domain_page(_mfn(l3e_get_pfn(ml3e[3])));
-            ml2e += l2_table_offset(RO_MPT_VIRT_START);
-            sh_unmap_domain_page(ml3e);
-        }
-        ml2e[index] = l2e_from_pfn(l3e_get_pfn(*l3e), __PAGE_HYPERVISOR);
-        if ( v != current )
-            sh_unmap_domain_page(ml2e);
-    }
-}
-#endif
-
 /* Set the pool of shadow pages to the required number of pages.
  * Input will be rounded up to at least shadow_min_acceptable_pages(),
  * plus space for the p2m table.
@@ -2141,7 +2086,6 @@ void sh_destroy_shadow(struct vcpu *v, m
         SHADOW_INTERNAL_NAME(sh_destroy_l2_shadow, 3)(v, smfn);
         break;
 
-#if CONFIG_PAGING_LEVELS >= 4
     case SH_type_l1_64_shadow:
     case SH_type_fl1_64_shadow:
         SHADOW_INTERNAL_NAME(sh_destroy_l1_shadow, 4)(v, smfn);
@@ -2158,7 +2102,7 @@ void sh_destroy_shadow(struct vcpu *v, m
     case SH_type_l4_64_shadow:
         SHADOW_INTERNAL_NAME(sh_destroy_l4_shadow, 4)(v, smfn);
         break;
-#endif
+
     default:
         SHADOW_ERROR("tried to destroy shadow of bad type %08lx\n",
                      (unsigned long)t);
@@ -2197,13 +2141,8 @@ int sh_remove_write_access(struct vcpu *
         SHADOW_INTERNAL_NAME(sh_rm_write_access_from_l1, 3), /* fl1_pae */
         NULL, /* l2_pae  */
         NULL, /* l2h_pae */
-#if CONFIG_PAGING_LEVELS >= 4
         SHADOW_INTERNAL_NAME(sh_rm_write_access_from_l1, 4), /* l1_64   */
         SHADOW_INTERNAL_NAME(sh_rm_write_access_from_l1, 4), /* fl1_64  */
-#else
-        NULL, /* l1_64   */
-        NULL, /* fl1_64  */
-#endif
         NULL, /* l2_64   */
         NULL, /* l2h_64  */
         NULL, /* l3_64   */
@@ -2310,7 +2249,6 @@ int sh_remove_write_access(struct vcpu *
                           + ((fault_addr & VADDR_MASK) >> 18), 6); break;
             }
         }
-#if CONFIG_PAGING_LEVELS >= 4
         else if ( v->arch.paging.mode->guest_levels == 4 )
         {
             /* 64bit w2k3: linear map at 0xfffff68000000000 */
@@ -2351,7 +2289,6 @@ int sh_remove_write_access(struct vcpu *
              /* FreeBSD 64bit: direct map at 0xffffff0000000000 */
              GUESS(0xffffff0000000000 + (gfn << PAGE_SHIFT), 6);
         }
-#endif /* CONFIG_PAGING_LEVELS >= 4 */
 
 #undef GUESS
     }
@@ -2423,18 +2360,14 @@ int sh_remove_write_access_from_sl1p(str
         return SHADOW_INTERNAL_NAME(sh_rm_write_access_from_sl1p,2)
             (v, gmfn, smfn, off);
     }
-#if CONFIG_PAGING_LEVELS >= 3
     else if ( sp->u.sh.type == SH_type_l1_pae_shadow
               || sp->u.sh.type == SH_type_fl1_pae_shadow )
         return SHADOW_INTERNAL_NAME(sh_rm_write_access_from_sl1p,3)
             (v, gmfn, smfn, off);
-#if CONFIG_PAGING_LEVELS >= 4
     else if ( sp->u.sh.type == SH_type_l1_64_shadow
               || sp->u.sh.type == SH_type_fl1_64_shadow )
         return SHADOW_INTERNAL_NAME(sh_rm_write_access_from_sl1p,4)
             (v, gmfn, smfn, off);
-#endif
-#endif
 
     return 0;
 }
@@ -2458,13 +2391,8 @@ int sh_remove_all_mappings(struct vcpu *
         SHADOW_INTERNAL_NAME(sh_rm_mappings_from_l1, 3), /* fl1_pae */
         NULL, /* l2_pae  */
         NULL, /* l2h_pae */
-#if CONFIG_PAGING_LEVELS >= 4
         SHADOW_INTERNAL_NAME(sh_rm_mappings_from_l1, 4), /* l1_64   */
         SHADOW_INTERNAL_NAME(sh_rm_mappings_from_l1, 4), /* fl1_64  */
-#else
-        NULL, /* l1_64   */
-        NULL, /* fl1_64  */
-#endif
         NULL, /* l2_64   */
         NULL, /* l2h_64  */
         NULL, /* l3_64   */
@@ -2560,7 +2488,6 @@ static int sh_remove_shadow_via_pointer(
     case SH_type_l2h_pae_shadow:
         SHADOW_INTERNAL_NAME(sh_clear_shadow_entry, 3)(v, vaddr, pmfn);
         break;
-#if CONFIG_PAGING_LEVELS >= 4
     case SH_type_l1_64_shadow:
     case SH_type_l2_64_shadow:
     case SH_type_l2h_64_shadow:
@@ -2568,7 +2495,6 @@ static int sh_remove_shadow_via_pointer(
     case SH_type_l4_64_shadow:
         SHADOW_INTERNAL_NAME(sh_clear_shadow_entry, 4)(v, vaddr, pmfn);
         break;
-#endif
     default: BUG(); /* Some wierd unknown shadow type */
     }
     
@@ -2607,17 +2533,10 @@ void sh_remove_shadows(struct vcpu *v, m
         SHADOW_INTERNAL_NAME(sh_remove_l1_shadow, 3), /* l2h_pae */
         NULL, /* l1_64   */
         NULL, /* fl1_64  */
-#if CONFIG_PAGING_LEVELS >= 4
         SHADOW_INTERNAL_NAME(sh_remove_l1_shadow, 4), /* l2_64   */
         SHADOW_INTERNAL_NAME(sh_remove_l1_shadow, 4), /* l2h_64  */
         SHADOW_INTERNAL_NAME(sh_remove_l2_shadow, 4), /* l3_64   */
         SHADOW_INTERNAL_NAME(sh_remove_l3_shadow, 4), /* l4_64   */
-#else
-        NULL, /* l2_64   */
-        NULL, /* l2h_64  */
-        NULL, /* l3_64   */
-        NULL, /* l4_64   */
-#endif
         NULL, /* p2m     */
         NULL  /* unused  */
     };
@@ -2697,13 +2616,11 @@ void sh_remove_shadows(struct vcpu *v, m
     DO_UNSHADOW(SH_type_l2h_pae_shadow);
     DO_UNSHADOW(SH_type_l2_pae_shadow);
     DO_UNSHADOW(SH_type_l1_pae_shadow);
-#if CONFIG_PAGING_LEVELS >= 4
     DO_UNSHADOW(SH_type_l4_64_shadow);
     DO_UNSHADOW(SH_type_l3_64_shadow);
     DO_UNSHADOW(SH_type_l2h_64_shadow);
     DO_UNSHADOW(SH_type_l2_64_shadow);
     DO_UNSHADOW(SH_type_l1_64_shadow);
-#endif
 
 #undef DO_UNSHADOW
 
@@ -2741,7 +2658,6 @@ sh_remove_all_shadows_and_parents(struct
 
 /**************************************************************************/
 
-#if CONFIG_PAGING_LEVELS >= 4
 /* Reset the up-pointers of every L3 shadow to 0. 
  * This is called when l3 shadows stop being pinnable, to clear out all
  * the list-head bits so the up-pointer field is properly inititalised. */
@@ -2750,7 +2666,6 @@ static int sh_clear_up_pointer(struct vc
     mfn_to_page(smfn)->up = 0;
     return 0;
 }
-#endif
 
 void sh_reset_l3_up_pointers(struct vcpu *v)
 {
@@ -2767,11 +2682,7 @@ void sh_reset_l3_up_pointers(struct vcpu
         NULL, /* fl1_64  */
         NULL, /* l2_64   */
         NULL, /* l2h_64  */
-#if CONFIG_PAGING_LEVELS >= 4
         sh_clear_up_pointer, /* l3_64   */
-#else
-        NULL, /* l3_64   */
-#endif
         NULL, /* l4_64   */
         NULL, /* p2m     */
         NULL  /* unused  */
@@ -2838,11 +2749,7 @@ static void sh_update_paging_modes(struc
         ///
         /// PV guest
         ///
-#if CONFIG_PAGING_LEVELS == 4
         v->arch.paging.mode = &SHADOW_INTERNAL_NAME(sh_paging_mode, 4);
-#else /* CONFIG_PAGING_LEVELS == 3 */
-        v->arch.paging.mode = &SHADOW_INTERNAL_NAME(sh_paging_mode, 3);
-#endif
     }
     else
     {
@@ -3325,11 +3232,9 @@ static int shadow_one_bit_disable(struct
         {
             if ( v->arch.paging.mode )
                 v->arch.paging.mode->shadow.detach_old_tables(v);
-#if CONFIG_PAGING_LEVELS == 4
             if ( !(v->arch.flags & TF_kernel_mode) )
                 make_cr3(v, pagetable_get_pfn(v->arch.guest_table_user));
             else
-#endif
                 make_cr3(v, pagetable_get_pfn(v->arch.guest_table));
 
 #if (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC) 
@@ -3481,14 +3386,6 @@ shadow_write_p2m_entry(struct vcpu *v, u
     /* Update the entry with new content */
     safe_write_pte(p, new);
 
-    /* install P2M in monitors for PAE Xen */
-#if CONFIG_PAGING_LEVELS == 3
-    if ( level == 3 )
-        /* We have written to the p2m l3: need to sync the per-vcpu
-         * copies of it in the monitor tables */
-        p2m_install_entry_in_monitors(d, (l3_pgentry_t *)p);
-#endif
-
 #if (SHADOW_OPTIMIZATIONS & SHOPT_FAST_FAULT_PATH)
     /* If we're doing FAST_FAULT_PATH, then shadow mode may have
        cached the fact that this is an mmio region in the shadow
@@ -3815,14 +3712,12 @@ void shadow_audit_tables(struct vcpu *v)
         SHADOW_INTERNAL_NAME(sh_audit_fl1_table, 3), /* fl1_pae */
         SHADOW_INTERNAL_NAME(sh_audit_l2_table, 3),  /* l2_pae  */
         SHADOW_INTERNAL_NAME(sh_audit_l2_table, 3),  /* l2h_pae */
-#if CONFIG_PAGING_LEVELS >= 4
         SHADOW_INTERNAL_NAME(sh_audit_l1_table, 4),  /* l1_64   */
         SHADOW_INTERNAL_NAME(sh_audit_fl1_table, 4), /* fl1_64  */
         SHADOW_INTERNAL_NAME(sh_audit_l2_table, 4),  /* l2_64   */
         SHADOW_INTERNAL_NAME(sh_audit_l2_table, 4),  /* l2h_64   */
         SHADOW_INTERNAL_NAME(sh_audit_l3_table, 4),  /* l3_64   */
         SHADOW_INTERNAL_NAME(sh_audit_l4_table, 4),  /* l4_64   */
-#endif /* CONFIG_PAGING_LEVELS >= 4 */
         NULL  /* All the rest */
     };
     unsigned int mask; 
diff -r bc8cb4778702 -r 7b658d31b5e1 xen/arch/x86/mm/shadow/multi.c
--- a/xen/arch/x86/mm/shadow/multi.c	Wed Sep 12 13:29:30 2012 +0100
+++ b/xen/arch/x86/mm/shadow/multi.c	Wed Sep 12 13:59:26 2012 +0100
@@ -788,22 +788,10 @@ static inline void safe_write_entry(void
     volatile unsigned long *d = dst;
     unsigned long *s = src;
     ASSERT(!((unsigned long) d & (sizeof (shadow_l1e_t) - 1)));
-#if CONFIG_PAGING_LEVELS == 3
-    /* In PAE mode, pagetable entries are larger
-     * than machine words, so won't get written atomically.  We need to make
-     * sure any other cpu running on these shadows doesn't see a
-     * half-written entry.  Do this by marking the entry not-present first,
-     * then writing the high word before the low word. */
-    BUILD_BUG_ON(sizeof (shadow_l1e_t) != 2 * sizeof (unsigned long));
-    d[0] = 0;
-    d[1] = s[1];
-    d[0] = s[0];
-#else
     /* In 64-bit, sizeof(pte) == sizeof(ulong) == 1 word,
      * which will be an atomic write, since the entry is aligned. */
     BUILD_BUG_ON(sizeof (shadow_l1e_t) != sizeof (unsigned long));
     *d = *s;
-#endif
 }
 
 
@@ -1444,7 +1432,7 @@ do {                                    
 //        probably wants to wait until the shadow types have been moved from
 //        shadow-types.h to shadow-private.h
 //
-#if CONFIG_PAGING_LEVELS == 4 && GUEST_PAGING_LEVELS == 4
+#if GUEST_PAGING_LEVELS == 4
 void sh_install_xen_entries_in_l4(struct vcpu *v, mfn_t gl4mfn, mfn_t sl4mfn)
 {
     struct domain *d = v->domain;
@@ -1496,7 +1484,7 @@ void sh_install_xen_entries_in_l4(struct
 }
 #endif
 
-#if CONFIG_PAGING_LEVELS >= 3 && GUEST_PAGING_LEVELS >= 3
+#if GUEST_PAGING_LEVELS >= 3
 // For 3-on-3 PV guests, we need to make sure the xen mappings are in
 // place, which means that we need to populate the l2h entry in the l3
 // table.
@@ -1505,62 +1493,13 @@ static void sh_install_xen_entries_in_l2
 {
     struct domain *d = v->domain;
     shadow_l2e_t *sl2e;
-#if CONFIG_PAGING_LEVELS == 3
-    int i;
-#else
 
     if ( !is_pv_32on64_vcpu(v) )
         return;
-#endif
 
     sl2e = sh_map_domain_page(sl2hmfn);
     ASSERT(sl2e != NULL);
     ASSERT(sizeof (l2_pgentry_t) == sizeof (shadow_l2e_t));
-    
-#if CONFIG_PAGING_LEVELS == 3
-
-    /* Copy the common Xen mappings from the idle domain */
-    memcpy(&sl2e[L2_PAGETABLE_FIRST_XEN_SLOT & (L2_PAGETABLE_ENTRIES-1)],
-           &idle_pg_table_l2[L2_PAGETABLE_FIRST_XEN_SLOT],
-           L2_PAGETABLE_XEN_SLOTS * sizeof(l2_pgentry_t));
-
-    /* Install the per-domain mappings for this domain */
-    for ( i = 0; i < PDPT_L2_ENTRIES; i++ )
-        sl2e[shadow_l2_table_offset(PERDOMAIN_VIRT_START) + i] =
-            shadow_l2e_from_mfn(
-                page_to_mfn(perdomain_pt_page(d, i)),
-                __PAGE_HYPERVISOR);
-    
-    /* We don't set up a linear mapping here because we can't until this
-     * l2h is installed in an l3e.  sh_update_linear_entries() handles
-     * the linear mappings when CR3 (and so the fourth l3e) is loaded.  
-     * We zero them here, just as a safety measure.
-     */
-    for ( i = 0; i < SHADOW_L3_PAGETABLE_ENTRIES; i++ )
-        sl2e[shadow_l2_table_offset(LINEAR_PT_VIRT_START) + i] =
-            shadow_l2e_empty();
-    for ( i = 0; i < SHADOW_L3_PAGETABLE_ENTRIES; i++ )
-        sl2e[shadow_l2_table_offset(SH_LINEAR_PT_VIRT_START) + i] =
-            shadow_l2e_empty();
-
-    if ( shadow_mode_translate(d) )
-    {
-        /* Install the domain-specific p2m table */
-        l3_pgentry_t *p2m;
-        ASSERT(pagetable_get_pfn(p2m_get_pagetable(p2m_get_hostp2m(d))) != 0);
-        p2m = sh_map_domain_page(pagetable_get_mfn(p2m_get_pagetable(p2m_get_hostp2m(d))));
-        for ( i = 0; i < MACHPHYS_MBYTES>>1; i++ )
-        {
-            sl2e[shadow_l2_table_offset(RO_MPT_VIRT_START) + i] =
-                (l3e_get_flags(p2m[i]) & _PAGE_PRESENT)
-                ? shadow_l2e_from_mfn(_mfn(l3e_get_pfn(p2m[i])),
-                                      __PAGE_HYPERVISOR)
-                : shadow_l2e_empty();
-        }
-        sh_unmap_domain_page(p2m);
-    }
-
-#else
 
     /* Copy the common Xen mappings from the idle domain */
     memcpy(
@@ -1568,16 +1507,11 @@ static void sh_install_xen_entries_in_l2
         &compat_idle_pg_table_l2[l2_table_offset(HIRO_COMPAT_MPT_VIRT_START)],
         COMPAT_L2_PAGETABLE_XEN_SLOTS(d) * sizeof(*sl2e));
 
-#endif
-    
     sh_unmap_domain_page(sl2e);
 }
 #endif
 
 
-
-
-
 /**************************************************************************/
 /* Create a shadow of a given guest page.
  */
@@ -1633,11 +1567,11 @@ sh_make_shadow(struct vcpu *v, mfn_t gmf
     {
         switch (shadow_type) 
         {
-#if CONFIG_PAGING_LEVELS == 4 && GUEST_PAGING_LEVELS == 4
+#if GUEST_PAGING_LEVELS == 4
         case SH_type_l4_shadow:
             sh_install_xen_entries_in_l4(v, gmfn, smfn); break;
 #endif
-#if CONFIG_PAGING_LEVELS >= 3 && GUEST_PAGING_LEVELS >= 3
+#if GUEST_PAGING_LEVELS >= 3
         case SH_type_l2h_shadow:
             sh_install_xen_entries_in_l2h(v, smfn); break;
 #endif
@@ -1677,7 +1611,6 @@ sh_make_monitor_table(struct vcpu *v)
     /* Guarantee we can get the memory we need */
     shadow_prealloc(d, SH_type_monitor_table, CONFIG_PAGING_LEVELS);
 
-#if CONFIG_PAGING_LEVELS == 4    
     {
         mfn_t m4mfn;
         m4mfn = shadow_alloc(d, SH_type_monitor_table, 0);
@@ -1726,43 +1659,6 @@ sh_make_monitor_table(struct vcpu *v)
 #endif /* SHADOW_PAGING_LEVELS < 4 */
         return m4mfn;
     }
-
-#elif CONFIG_PAGING_LEVELS == 3
-
-    {
-        mfn_t m3mfn, m2mfn; 
-        l3_pgentry_t *l3e;
-        l2_pgentry_t *l2e;
-        int i;
-
-        m3mfn = shadow_alloc(d, SH_type_monitor_table, 0);
-        /* Remember the level of this table */
-        mfn_to_page(m3mfn)->shadow_flags = 3;
-
-        // Install a monitor l2 table in slot 3 of the l3 table.
-        // This is used for all Xen entries, including linear maps
-        m2mfn = shadow_alloc(d, SH_type_monitor_table, 0);
-        mfn_to_page(m2mfn)->shadow_flags = 2;
-        l3e = sh_map_domain_page(m3mfn);
-        l3e[3] = l3e_from_pfn(mfn_x(m2mfn), _PAGE_PRESENT);
-        sh_install_xen_entries_in_l2h(v, m2mfn);
-        /* Install the monitor's own linear map */
-        l2e = sh_map_domain_page(m2mfn);
-        for ( i = 0; i < L3_PAGETABLE_ENTRIES; i++ )
-            l2e[l2_table_offset(LINEAR_PT_VIRT_START) + i] =
-                (l3e_get_flags(l3e[i]) & _PAGE_PRESENT) 
-                ? l2e_from_pfn(l3e_get_pfn(l3e[i]), __PAGE_HYPERVISOR) 
-                : l2e_empty();
-        sh_unmap_domain_page(l2e);
-        sh_unmap_domain_page(l3e);
-
-        SHADOW_PRINTK("new monitor table: %#lx\n", mfn_x(m3mfn));
-        return m3mfn;
-    }
-
-#else
-#error this should not happen
-#endif /* CONFIG_PAGING_LEVELS */
 }
 #endif /* SHADOW_PAGING_LEVELS == GUEST_PAGING_LEVELS */
 
@@ -2146,7 +2042,7 @@ void sh_destroy_monitor_table(struct vcp
     struct domain *d = v->domain;
     ASSERT(mfn_to_page(mmfn)->u.sh.type == SH_type_monitor_table);
 
-#if (CONFIG_PAGING_LEVELS == 4) && (SHADOW_PAGING_LEVELS != 4)
+#if SHADOW_PAGING_LEVELS != 4
     {
         mfn_t m3mfn;
         l4_pgentry_t *l4e = sh_map_domain_page(mmfn);
@@ -2177,14 +2073,6 @@ void sh_destroy_monitor_table(struct vcp
         }
         sh_unmap_domain_page(l4e);
     }
-#elif CONFIG_PAGING_LEVELS == 3
-    /* Need to destroy the l2 monitor page in slot 4 too */
-    {
-        l3_pgentry_t *l3e = sh_map_domain_page(mmfn);
-        ASSERT(l3e_get_flags(l3e[3]) & _PAGE_PRESENT);
-        shadow_free(d, _mfn(l3e_get_pfn(l3e[3])));
-        sh_unmap_domain_page(l3e);
-    }
 #endif
 
     /* Put the memory back in the pool */
@@ -2382,46 +2270,6 @@ static int validate_gl2e(struct vcpu *v,
     }
     l2e_propagate_from_guest(v, new_gl2e, sl1mfn, &new_sl2e, ft_prefetch);
 
-    // check for updates to xen reserved slots in PV guests...
-    // XXX -- need to revisit this for PV 3-on-4 guests.
-    //
-#if SHADOW_PAGING_LEVELS < 4
-#if CONFIG_PAGING_LEVELS == SHADOW_PAGING_LEVELS
-    if ( !shadow_mode_external(v->domain) )
-    {
-        int shadow_index = (((unsigned long)sl2p & ~PAGE_MASK) /
-                            sizeof(shadow_l2e_t));
-        int reserved_xen_slot;
-
-#if SHADOW_PAGING_LEVELS == 3
-        reserved_xen_slot = 
-            ((mfn_to_page(sl2mfn)->u.sh.type == SH_type_l2h_pae_shadow) &&
-             (shadow_index 
-              >= (L2_PAGETABLE_FIRST_XEN_SLOT & (L2_PAGETABLE_ENTRIES-1))));
-#else /* SHADOW_PAGING_LEVELS == 2 */
-        reserved_xen_slot = (shadow_index >= L2_PAGETABLE_FIRST_XEN_SLOT);
-#endif
-
-        if ( unlikely(reserved_xen_slot) )
-        {
-            // attempt by the guest to write to a xen reserved slot
-            //
-            SHADOW_PRINTK("%s out-of-range update "
-                           "sl2mfn=%05lx index=0x%x val=%" SH_PRI_pte "\n",
-                           __func__, mfn_x(sl2mfn), shadow_index, new_sl2e.l2);
-            if ( shadow_l2e_get_flags(new_sl2e) & _PAGE_PRESENT )
-            {
-                SHADOW_ERROR("out-of-range l2e update\n");
-                result |= SHADOW_SET_ERROR;
-            }
-
-            // do not call shadow_set_l2e...
-            return result;
-        }
-    }
-#endif /* CONFIG_PAGING_LEVELS == SHADOW_PAGING_LEVELS */
-#endif /* SHADOW_PAGING_LEVELS < 4 */
-
     result |= shadow_set_l2e(v, sl2p, new_sl2e, sl2mfn);
 
     return result;
@@ -3836,7 +3684,7 @@ sh_update_linear_entries(struct vcpu *v)
          && pagetable_get_pfn(v->arch.monitor_table) == 0 ) 
         return;
 
-#if (CONFIG_PAGING_LEVELS == 4) && (SHADOW_PAGING_LEVELS == 4)
+#if SHADOW_PAGING_LEVELS == 4
     
     /* For PV, one l4e points at the guest l4, one points at the shadow
      * l4.  No maintenance required. 
@@ -3862,7 +3710,7 @@ sh_update_linear_entries(struct vcpu *v)
         }
     }
 
-#elif (CONFIG_PAGING_LEVELS == 4) && (SHADOW_PAGING_LEVELS == 3)
+#elif SHADOW_PAGING_LEVELS == 3
 
     /* PV: XXX
      *
@@ -3923,102 +3771,6 @@ sh_update_linear_entries(struct vcpu *v)
     else
         domain_crash(d); /* XXX */
 
-#elif CONFIG_PAGING_LEVELS == 3
-
-    /* PV: need to copy the guest's l3 entries into the guest-linear-map l2
-     * entries in the shadow, and the shadow's l3 entries into the 
-     * shadow-linear-map l2 entries in the shadow.  This is safe to do 
-     * because Xen does not let guests share high-slot l2 tables between l3s,
-     * so we know we're not treading on anyone's toes. 
-     *
-     * HVM: need to copy the shadow's l3 entries into the
-     * shadow-linear-map l2 entries in the monitor table.  This is safe
-     * because we have one monitor table for each vcpu.  The monitor's
-     * own l3es don't need to be copied because they never change.  
-     * XXX That might change if we start stuffing things into the rest
-     * of the monitor's virtual address space. 
-     */ 
-    {
-        l2_pgentry_t *l2e, new_l2e;
-        shadow_l3e_t *guest_l3e = NULL, *shadow_l3e;
-        int i;
-        int unmap_l2e = 0;
-
-#if GUEST_PAGING_LEVELS == 2
-
-        /* Shadow l3 tables were built by sh_update_cr3 */
-        BUG_ON(!shadow_mode_external(d)); /* PV 2-on-3 is unsupported */
-        shadow_l3e = (shadow_l3e_t *)&v->arch.paging.shadow.l3table;
-        
-#else /* GUEST_PAGING_LEVELS == 3 */
-        
-        shadow_l3e = (shadow_l3e_t *)&v->arch.paging.shadow.l3table;
-        guest_l3e = (guest_l3e_t *)&v->arch.paging.shadow.gl3e;
-
-#endif /* GUEST_PAGING_LEVELS */
-        
-        /* Choose where to write the entries, using linear maps if possible */
-        if ( shadow_mode_external(d) )
-        {
-            if ( v == current )
-            {
-                /* From the monitor tables, it's safe to use linear maps
-                 * to update monitor l2s */
-                l2e = __linear_l2_table + (3 * L2_PAGETABLE_ENTRIES);
-            }
-            else
-            {
-                /* Map the monitor table's high l2 */
-                l3_pgentry_t *l3e;
-                l3e = sh_map_domain_page(
-                    pagetable_get_mfn(v->arch.monitor_table));
-                ASSERT(l3e_get_flags(l3e[3]) & _PAGE_PRESENT);
-                l2e = sh_map_domain_page(_mfn(l3e_get_pfn(l3e[3])));
-                unmap_l2e = 1;
-                sh_unmap_domain_page(l3e);
-            }
-        }
-        else 
-        {
-            /* Map the shadow table's high l2 */
-            ASSERT(shadow_l3e_get_flags(shadow_l3e[3]) & _PAGE_PRESENT);
-            l2e = sh_map_domain_page(shadow_l3e_get_mfn(shadow_l3e[3]));
-            unmap_l2e = 1;
-        }
-        
-        /* Write linear mapping of guest (only in PV, and only when 
-         * not translated). */
-        if ( !shadow_mode_translate(d) )
-        {
-            for ( i = 0; i < SHADOW_L3_PAGETABLE_ENTRIES; i++ )
-            {
-                new_l2e = 
-                    ((shadow_l3e_get_flags(guest_l3e[i]) & _PAGE_PRESENT)
-                     ? l2e_from_pfn(mfn_x(shadow_l3e_get_mfn(guest_l3e[i])),
-                                    __PAGE_HYPERVISOR) 
-                     : l2e_empty());
-                safe_write_entry(
-                    &l2e[l2_table_offset(LINEAR_PT_VIRT_START) + i],
-                    &new_l2e);
-            }
-        }
-        
-        /* Write linear mapping of shadow. */
-        for ( i = 0; i < SHADOW_L3_PAGETABLE_ENTRIES; i++ )
-        {
-            new_l2e = (shadow_l3e_get_flags(shadow_l3e[i]) & _PAGE_PRESENT) 
-                ? l2e_from_pfn(mfn_x(shadow_l3e_get_mfn(shadow_l3e[i])),
-                               __PAGE_HYPERVISOR) 
-                : l2e_empty();
-            safe_write_entry(
-                &l2e[l2_table_offset(SH_LINEAR_PT_VIRT_START) + i],
-                &new_l2e);
-        }
-        
-        if ( unmap_l2e )
-            sh_unmap_domain_page(l2e);
-    }
-
 #else
 #error this should not happen
 #endif
diff -r bc8cb4778702 -r 7b658d31b5e1 xen/arch/x86/mm/shadow/private.h
--- a/xen/arch/x86/mm/shadow/private.h	Wed Sep 12 13:29:30 2012 +0100
+++ b/xen/arch/x86/mm/shadow/private.h	Wed Sep 12 13:59:26 2012 +0100
@@ -165,11 +165,9 @@ extern void shadow_audit_tables(struct v
 #include "multi.h"
 #undef GUEST_LEVELS
 
-#if CONFIG_PAGING_LEVELS == 4
 #define GUEST_LEVELS  4
 #include "multi.h"
 #undef GUEST_LEVELS
-#endif /* CONFIG_PAGING_LEVELS == 4 */
 
 /* Shadow type codes */
 #define SH_type_none           (0U) /* on the shadow free list */
@@ -214,7 +212,6 @@ static inline int sh_type_is_pinnable(st
      * shadows so they don't just evaporate on every context switch.
      * For all other guests, we'd rather use the up-pointer field in l3s. */ 
     if ( unlikely((v->domain->arch.paging.shadow.opt_flags & SHOPT_LINUX_L3_TOPLEVEL) 
-                  && CONFIG_PAGING_LEVELS >= 4
                   && t == SH_type_l3_64_shadow) )
         return 1;
 #endif
diff -r bc8cb4778702 -r 7b658d31b5e1 xen/arch/x86/trace.c
--- a/xen/arch/x86/trace.c	Wed Sep 12 13:29:30 2012 +0100
+++ b/xen/arch/x86/trace.c	Wed Sep 12 13:59:26 2012 +0100
@@ -185,8 +185,7 @@ void __trace_ptwr_emulation(unsigned lon
         d.eip = eip;
         d.pte = npte;
 
-        event = ((CONFIG_PAGING_LEVELS == 3) ?
-                 TRC_PV_PTWR_EMULATION_PAE : TRC_PV_PTWR_EMULATION);
+        event = TRC_PV_PTWR_EMULATION;
         event |= TRC_64_FLAG;
         __trace_var(event, 1/*tsc*/, sizeof(d), &d);
     }
diff -r bc8cb4778702 -r 7b658d31b5e1 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c	Wed Sep 12 13:29:30 2012 +0100
+++ b/xen/arch/x86/traps.c	Wed Sep 12 13:59:26 2012 +0100
@@ -1181,12 +1181,8 @@ static enum pf_type __page_fault_type(
     unsigned long addr, unsigned int error_code)
 {
     unsigned long mfn, cr3 = read_cr3();
-#if CONFIG_PAGING_LEVELS >= 4
     l4_pgentry_t l4e, *l4t;
-#endif
-#if CONFIG_PAGING_LEVELS >= 3
     l3_pgentry_t l3e, *l3t;
-#endif
     l2_pgentry_t l2e, *l2t;
     l1_pgentry_t l1e, *l1t;
     unsigned int required_flags, disallowed_flags, page_user;
@@ -1217,7 +1213,6 @@ static enum pf_type __page_fault_type(
 
     mfn = cr3 >> PAGE_SHIFT;
 
-#if CONFIG_PAGING_LEVELS >= 4
     l4t = map_domain_page(mfn);
     l4e = l4e_read_atomic(&l4t[l4_table_offset(addr)]);
     mfn = l4e_get_pfn(l4e);
@@ -1226,28 +1221,17 @@ static enum pf_type __page_fault_type(
          (l4e_get_flags(l4e) & disallowed_flags) )
         return real_fault;
     page_user &= l4e_get_flags(l4e);
-#endif
-
-#if CONFIG_PAGING_LEVELS >= 3
+
     l3t  = map_domain_page(mfn);
-#if CONFIG_PAGING_LEVELS == 3
-    l3t += (cr3 & 0xFE0UL) >> 3;
-#endif
     l3e = l3e_read_atomic(&l3t[l3_table_offset(addr)]);
     mfn = l3e_get_pfn(l3e);
     unmap_domain_page(l3t);
-#if CONFIG_PAGING_LEVELS == 3
-    if ( !(l3e_get_flags(l3e) & _PAGE_PRESENT) )
-        return real_fault;
-#else
     if ( ((l3e_get_flags(l3e) & required_flags) != required_flags) ||
          (l3e_get_flags(l3e) & disallowed_flags) )
         return real_fault;
     page_user &= l3e_get_flags(l3e);
     if ( l3e_get_flags(l3e) & _PAGE_PSE )
         goto leaf;
-#endif
-#endif
 
     l2t = map_domain_page(mfn);
     l2e = l2e_read_atomic(&l2t[l2_table_offset(addr)]);
diff -r bc8cb4778702 -r 7b658d31b5e1 xen/include/asm-x86/domain.h
--- a/xen/include/asm-x86/domain.h	Wed Sep 12 13:29:30 2012 +0100
+++ b/xen/include/asm-x86/domain.h	Wed Sep 12 13:59:26 2012 +0100
@@ -119,12 +119,10 @@ struct shadow_domain {
 };
 
 struct shadow_vcpu {
-#if CONFIG_PAGING_LEVELS >= 3
     /* PAE guests: per-vcpu shadow top-level table */
     l3_pgentry_t l3table[4] __attribute__((__aligned__(32)));
     /* PAE guests: per-vcpu cache of the top-level *guest* entries */
     l3_pgentry_t gl3e[4] __attribute__((__aligned__(32)));
-#endif
     /* Non-PAE guests: pointer to guest top-level pagetable */
     void *guest_vtable;
     /* Last MFN that we emulated a write to as unshadow heuristics. */
diff -r bc8cb4778702 -r 7b658d31b5e1 xen/include/asm-x86/hvm/svm/vmcb.h
--- a/xen/include/asm-x86/hvm/svm/vmcb.h	Wed Sep 12 13:29:30 2012 +0100
+++ b/xen/include/asm-x86/hvm/svm/vmcb.h	Wed Sep 12 13:59:26 2012 +0100
@@ -490,9 +490,6 @@ struct vmcb_struct {
 } __attribute__ ((packed));
 
 struct svm_domain {
-#if CONFIG_PAGING_LEVELS == 3
-    bool_t npt_4gb_warning;
-#endif
 };
 
 struct arch_svm_struct {
diff -r bc8cb4778702 -r 7b658d31b5e1 xen/include/asm-x86/mm.h
--- a/xen/include/asm-x86/mm.h	Wed Sep 12 13:29:30 2012 +0100
+++ b/xen/include/asm-x86/mm.h	Wed Sep 12 13:59:26 2012 +0100
@@ -398,16 +398,6 @@ static inline int get_page_and_type(stru
     ASSERT(((_p)->count_info & PGC_count_mask) != 0);          \
     ASSERT(page_get_owner(_p) == (_d))
 
-// Quick test for whether a given page can be represented directly in CR3.
-//
-#if CONFIG_PAGING_LEVELS == 3
-#define MFN_FITS_IN_CR3(_MFN) !(mfn_x(_MFN) >> 20)
-
-/* returns a lowmem machine address of the copied L3 root table */
-unsigned long
-pae_copy_root(struct vcpu *v, l3_pgentry_t *l3tab);
-#endif /* CONFIG_PAGING_LEVELS == 3 */
-
 int check_descriptor(const struct domain *, struct desc_struct *d);
 
 extern bool_t opt_allow_superpage;
diff -r bc8cb4778702 -r 7b658d31b5e1 xen/include/asm-x86/p2m.h
--- a/xen/include/asm-x86/p2m.h	Wed Sep 12 13:29:30 2012 +0100
+++ b/xen/include/asm-x86/p2m.h	Wed Sep 12 13:59:26 2012 +0100
@@ -603,30 +603,6 @@ int p2m_get_mem_access(struct domain *d,
 struct page_info *p2m_alloc_ptp(struct p2m_domain *p2m, unsigned long type);
 void p2m_free_ptp(struct p2m_domain *p2m, struct page_info *pg);
 
-#if CONFIG_PAGING_LEVELS == 3
-static inline int p2m_gfn_check_limit(
-    struct domain *d, unsigned long gfn, unsigned int order)
-{
-    /*
-     * 32bit AMD nested paging does not support over 4GB guest due to 
-     * hardware translation limit. This limitation is checked by comparing
-     * gfn with 0xfffffUL.
-     */
-    if ( !hap_enabled(d) || ((gfn + (1ul << order)) <= 0x100000UL) ||
-         (boot_cpu_data.x86_vendor != X86_VENDOR_AMD) )
-        return 0;
-
-    if ( !test_and_set_bool(d->arch.hvm_domain.svm.npt_4gb_warning) )
-        dprintk(XENLOG_WARNING, "Dom%d failed to populate memory beyond"
-                " 4GB: specify 'hap=0' domain config option.\n",
-                d->domain_id);
-
-    return -EINVAL;
-}
-#else
-#define p2m_gfn_check_limit(d, g, o) 0
-#endif
-
 /* Directly set a p2m entry: only for use by p2m code. Does not need
  * a call to put_gfn afterwards/ */
 int set_p2m_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn, 
diff -r bc8cb4778702 -r 7b658d31b5e1 xen/include/asm-x86/page.h
--- a/xen/include/asm-x86/page.h	Wed Sep 12 13:29:30 2012 +0100
+++ b/xen/include/asm-x86/page.h	Wed Sep 12 13:59:26 2012 +0100
@@ -126,13 +126,11 @@ static inline l3_pgentry_t l3e_from_padd
     ASSERT((pa & ~(PADDR_MASK & PAGE_MASK)) == 0);
     return (l3_pgentry_t) { pa | put_pte_flags(flags) };
 }
-#if CONFIG_PAGING_LEVELS >= 4
 static inline l4_pgentry_t l4e_from_paddr(paddr_t pa, unsigned int flags)
 {
     ASSERT((pa & ~(PADDR_MASK & PAGE_MASK)) == 0);
     return (l4_pgentry_t) { pa | put_pte_flags(flags) };
 }
-#endif
 #endif /* !__ASSEMBLY__ */
 
 /* Construct a pte from its direct integer representation. */
@@ -191,13 +189,7 @@ static inline l4_pgentry_t l4e_from_padd
 #ifndef __ASSEMBLY__
 
 /* Page-table type. */
-#if CONFIG_PAGING_LEVELS == 3
-/* x86_32 PAE */
-typedef struct { u32 pfn; } pagetable_t;
-#elif CONFIG_PAGING_LEVELS == 4
-/* x86_64 */
 typedef struct { u64 pfn; } pagetable_t;
-#endif
 #define pagetable_get_paddr(x)  ((paddr_t)(x).pfn << PAGE_SHIFT)
 #define pagetable_get_page(x)   mfn_to_page((x).pfn)
 #define pagetable_get_pfn(x)    ((x).pfn)
@@ -293,16 +285,11 @@ void copy_page_sse2(void *, const void *
 
 #ifndef __ASSEMBLY__
 extern root_pgentry_t idle_pg_table[ROOT_PAGETABLE_ENTRIES];
-#if CONFIG_PAGING_LEVELS == 3
-extern l2_pgentry_t   idle_pg_table_l2[
-    ROOT_PAGETABLE_ENTRIES * L2_PAGETABLE_ENTRIES];
-#elif CONFIG_PAGING_LEVELS == 4
 extern l2_pgentry_t  *compat_idle_pg_table_l2;
 extern unsigned int   m2p_compat_vstart;
 extern l2_pgentry_t l2_xenmap[L2_PAGETABLE_ENTRIES],
     l2_bootmap[L2_PAGETABLE_ENTRIES];
 extern l3_pgentry_t l3_bootmap[L3_PAGETABLE_ENTRIES];
-#endif
 extern l2_pgentry_t l2_identmap[4*L2_PAGETABLE_ENTRIES];
 extern l1_pgentry_t l1_identmap[L1_PAGETABLE_ENTRIES],
     l1_fixmap[L1_PAGETABLE_ENTRIES];
diff -r bc8cb4778702 -r 7b658d31b5e1 xen/include/asm-x86/paging.h
--- a/xen/include/asm-x86/paging.h	Wed Sep 12 13:29:30 2012 +0100
+++ b/xen/include/asm-x86/paging.h	Wed Sep 12 13:59:26 2012 +0100
@@ -327,17 +327,7 @@ static inline int paging_cmpxchg_guest_e
  * never sees a half-written entry that has _PAGE_PRESENT set */
 static inline void safe_write_pte(l1_pgentry_t *p, l1_pgentry_t new)
 {
-#if CONFIG_PAGING_LEVELS == 3
-    /* PAE machines write 64bit PTEs as two 32bit writes. */
-    volatile unsigned long *d = (unsigned long *) p;
-    unsigned long *s = (unsigned long *) &new;
-    BUILD_BUG_ON(sizeof (l1_pgentry_t) != 2 * sizeof (unsigned long));
-    d[0] = 0;
-    d[1] = s[1];
-    d[0] = s[0]; 
-#else
     *p = new;
-#endif
 }
 
 /* Atomically write a P2M entry and update the paging-assistance state 

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:42 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYk-0003n1-J6; Fri, 14 Sep 2012 10:55:42 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYj-0003dI-Dw
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:41 +0000
Received: from [85.158.143.35:63354] by server-3.bemta-4.messagelabs.com id
	FF/86-08232-D2D03505; Fri, 14 Sep 2012 10:55:41 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-21.messagelabs.com!1347620138!18244865!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23365 invoked from network); 14 Sep 2012 10:55:39 -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;
	14 Sep 2012 10: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 1TCTYg-00016B-AS
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYg-0000qQ-8O
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:38 +0000
Message-Id: <E1TCTYg-0000qQ-8O@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:37 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] In most of the codebase,
	use CONFIG_X86 in place of __i386__||__x86_64__
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347478861 -3600
# Node ID d4761aa7daa244d8aae2496cb7eac9981c84c246
# Parent  dab6583e187381811b84d2b93c63c9197a0a8e31
In most of the codebase, use CONFIG_X86 in place of __i386__||__x86_64__

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r dab6583e1873 -r d4761aa7daa2 xen/common/lib.c
--- a/xen/common/lib.c	Wed Sep 12 20:32:52 2012 +0100
+++ b/xen/common/lib.c	Wed Sep 12 20:41:01 2012 +0100
@@ -423,7 +423,7 @@ s64 __ldivmod_helper(s64 a, s64 b, s64 *
 /* Compute with 96 bit intermediate result: (a*b)/c */
 uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c)
 {
-#ifdef __x86_64__
+#ifdef CONFIG_X86
     asm ( "mul %%rdx; div %%rcx" : "=a" (a) : "0" (a), "d" (b), "c" (c) );
     return a;
 #else
diff -r dab6583e1873 -r d4761aa7daa2 xen/common/page_alloc.c
--- a/xen/common/page_alloc.c	Wed Sep 12 20:32:52 2012 +0100
+++ b/xen/common/page_alloc.c	Wed Sep 12 20:41:01 2012 +0100
@@ -1141,7 +1141,7 @@ void __init scrub_heap_pages(void)
  * XEN-HEAP SUB-ALLOCATOR
  */
 
-#if !defined(__x86_64__)
+#if !defined(CONFIG_X86)
 
 void init_xenheap_pages(paddr_t ps, paddr_t pe)
 {
diff -r dab6583e1873 -r d4761aa7daa2 xen/common/time.c
--- a/xen/common/time.c	Wed Sep 12 20:32:52 2012 +0100
+++ b/xen/common/time.c	Wed Sep 12 20:41:01 2012 +0100
@@ -43,7 +43,7 @@ struct tm gmtime(unsigned long t)
     const unsigned short int *ip;
 
     y = 1970;
-#ifdef __x86_64__
+#if BITS_PER_LONG >= 64
     /* Allow the concept of time before 1970.  64-bit only; for 32-bit
      * time after 2038 seems more important than time before 1970. */
     while ( t & (1UL<<39) )
diff -r dab6583e1873 -r d4761aa7daa2 xen/drivers/passthrough/vtd/intremap.c
--- a/xen/drivers/passthrough/vtd/intremap.c	Wed Sep 12 20:32:52 2012 +0100
+++ b/xen/drivers/passthrough/vtd/intremap.c	Wed Sep 12 20:41:01 2012 +0100
@@ -31,7 +31,7 @@
 #include "vtd.h"
 #include "extern.h"
 
-#if defined(__i386__) || defined(__x86_64__)
+#if defined(CONFIG_X86)
 #include <asm/apic.h>
 #include <asm/io_apic.h>
 #define nr_ioapic_entries(i)  nr_ioapic_entries[i]
@@ -302,7 +302,7 @@ static int ioapic_rte_to_remap_entry(str
 
     if ( rte_upper )
     {
-#if defined(__i386__) || defined(__x86_64__)
+#if defined(CONFIG_X86)
         if ( x2apic_enabled )
             new_ire.lo.dst = value;
         else
@@ -422,7 +422,7 @@ void io_apic_write_remap_rte(
         __ioapic_write_entry(apic, ioapic_pin, 1, old_rte);
 }
 
-#if defined(__i386__) || defined(__x86_64__)
+#if defined(CONFIG_X86)
 
 static void set_msi_source_id(struct pci_dev *pdev, struct iremap_entry *ire)
 {
diff -r dab6583e1873 -r d4761aa7daa2 xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c	Wed Sep 12 20:32:52 2012 +0100
+++ b/xen/drivers/passthrough/vtd/iommu.c	Wed Sep 12 20:41:01 2012 +0100
@@ -34,7 +34,7 @@
 #include <xen/softirq.h>
 #include <asm/msi.h>
 #include <asm/irq.h>
-#if defined(__i386__) || defined(__x86_64__)
+#if defined(CONFIG_X86)
 #include <asm/hvm/vmx/vmx.h>
 #include <asm/p2m.h>
 #include <mach_apic.h>
diff -r dab6583e1873 -r d4761aa7daa2 xen/drivers/passthrough/vtd/utils.c
--- a/xen/drivers/passthrough/vtd/utils.c	Wed Sep 12 20:32:52 2012 +0100
+++ b/xen/drivers/passthrough/vtd/utils.c	Wed Sep 12 20:41:01 2012 +0100
@@ -188,7 +188,7 @@ void print_vtd_entries(struct iommu *iom
 
 static void dump_iommu_info(unsigned char key)
 {
-#if defined(__i386__) || defined(__x86_64__)
+#if defined(CONFIG_X86)
     struct acpi_drhd_unit *drhd;
     struct iommu *iommu;
     int i;
diff -r dab6583e1873 -r d4761aa7daa2 xen/include/xen/elfcore.h
--- a/xen/include/xen/elfcore.h	Wed Sep 12 20:32:52 2012 +0100
+++ b/xen/include/xen/elfcore.h	Wed Sep 12 20:41:01 2012 +0100
@@ -65,7 +65,7 @@ typedef struct {
     unsigned long xen_compile_date;
     unsigned long xen_compile_time;
     unsigned long tainted;
-#if defined(__x86_64__)
+#if defined(CONFIG_X86)
     unsigned long xen_phys_start;
     unsigned long dom0_pfn_to_mfn_frame_list_list;
 #endif
diff -r dab6583e1873 -r d4761aa7daa2 xen/include/xen/hvm/irq.h
--- a/xen/include/xen/hvm/irq.h	Wed Sep 12 20:32:52 2012 +0100
+++ b/xen/include/xen/hvm/irq.h	Wed Sep 12 20:41:01 2012 +0100
@@ -76,7 +76,7 @@ struct hvm_girq_dpci_mapping {
 
 #define NR_ISAIRQS  16
 #define NR_LINK     4
-#if defined(__x86_64__)
+#if defined(CONFIG_X86)
 # define NR_HVM_IRQS VIOAPIC_NUM_PINS
 #endif
 

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:42 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYk-0003n1-J6; Fri, 14 Sep 2012 10:55:42 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYj-0003dI-Dw
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:41 +0000
Received: from [85.158.143.35:63354] by server-3.bemta-4.messagelabs.com id
	FF/86-08232-D2D03505; Fri, 14 Sep 2012 10:55:41 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-21.messagelabs.com!1347620138!18244865!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23365 invoked from network); 14 Sep 2012 10:55:39 -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;
	14 Sep 2012 10: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 1TCTYg-00016B-AS
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYg-0000qQ-8O
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:38 +0000
Message-Id: <E1TCTYg-0000qQ-8O@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:37 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] In most of the codebase,
	use CONFIG_X86 in place of __i386__||__x86_64__
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347478861 -3600
# Node ID d4761aa7daa244d8aae2496cb7eac9981c84c246
# Parent  dab6583e187381811b84d2b93c63c9197a0a8e31
In most of the codebase, use CONFIG_X86 in place of __i386__||__x86_64__

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r dab6583e1873 -r d4761aa7daa2 xen/common/lib.c
--- a/xen/common/lib.c	Wed Sep 12 20:32:52 2012 +0100
+++ b/xen/common/lib.c	Wed Sep 12 20:41:01 2012 +0100
@@ -423,7 +423,7 @@ s64 __ldivmod_helper(s64 a, s64 b, s64 *
 /* Compute with 96 bit intermediate result: (a*b)/c */
 uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c)
 {
-#ifdef __x86_64__
+#ifdef CONFIG_X86
     asm ( "mul %%rdx; div %%rcx" : "=a" (a) : "0" (a), "d" (b), "c" (c) );
     return a;
 #else
diff -r dab6583e1873 -r d4761aa7daa2 xen/common/page_alloc.c
--- a/xen/common/page_alloc.c	Wed Sep 12 20:32:52 2012 +0100
+++ b/xen/common/page_alloc.c	Wed Sep 12 20:41:01 2012 +0100
@@ -1141,7 +1141,7 @@ void __init scrub_heap_pages(void)
  * XEN-HEAP SUB-ALLOCATOR
  */
 
-#if !defined(__x86_64__)
+#if !defined(CONFIG_X86)
 
 void init_xenheap_pages(paddr_t ps, paddr_t pe)
 {
diff -r dab6583e1873 -r d4761aa7daa2 xen/common/time.c
--- a/xen/common/time.c	Wed Sep 12 20:32:52 2012 +0100
+++ b/xen/common/time.c	Wed Sep 12 20:41:01 2012 +0100
@@ -43,7 +43,7 @@ struct tm gmtime(unsigned long t)
     const unsigned short int *ip;
 
     y = 1970;
-#ifdef __x86_64__
+#if BITS_PER_LONG >= 64
     /* Allow the concept of time before 1970.  64-bit only; for 32-bit
      * time after 2038 seems more important than time before 1970. */
     while ( t & (1UL<<39) )
diff -r dab6583e1873 -r d4761aa7daa2 xen/drivers/passthrough/vtd/intremap.c
--- a/xen/drivers/passthrough/vtd/intremap.c	Wed Sep 12 20:32:52 2012 +0100
+++ b/xen/drivers/passthrough/vtd/intremap.c	Wed Sep 12 20:41:01 2012 +0100
@@ -31,7 +31,7 @@
 #include "vtd.h"
 #include "extern.h"
 
-#if defined(__i386__) || defined(__x86_64__)
+#if defined(CONFIG_X86)
 #include <asm/apic.h>
 #include <asm/io_apic.h>
 #define nr_ioapic_entries(i)  nr_ioapic_entries[i]
@@ -302,7 +302,7 @@ static int ioapic_rte_to_remap_entry(str
 
     if ( rte_upper )
     {
-#if defined(__i386__) || defined(__x86_64__)
+#if defined(CONFIG_X86)
         if ( x2apic_enabled )
             new_ire.lo.dst = value;
         else
@@ -422,7 +422,7 @@ void io_apic_write_remap_rte(
         __ioapic_write_entry(apic, ioapic_pin, 1, old_rte);
 }
 
-#if defined(__i386__) || defined(__x86_64__)
+#if defined(CONFIG_X86)
 
 static void set_msi_source_id(struct pci_dev *pdev, struct iremap_entry *ire)
 {
diff -r dab6583e1873 -r d4761aa7daa2 xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c	Wed Sep 12 20:32:52 2012 +0100
+++ b/xen/drivers/passthrough/vtd/iommu.c	Wed Sep 12 20:41:01 2012 +0100
@@ -34,7 +34,7 @@
 #include <xen/softirq.h>
 #include <asm/msi.h>
 #include <asm/irq.h>
-#if defined(__i386__) || defined(__x86_64__)
+#if defined(CONFIG_X86)
 #include <asm/hvm/vmx/vmx.h>
 #include <asm/p2m.h>
 #include <mach_apic.h>
diff -r dab6583e1873 -r d4761aa7daa2 xen/drivers/passthrough/vtd/utils.c
--- a/xen/drivers/passthrough/vtd/utils.c	Wed Sep 12 20:32:52 2012 +0100
+++ b/xen/drivers/passthrough/vtd/utils.c	Wed Sep 12 20:41:01 2012 +0100
@@ -188,7 +188,7 @@ void print_vtd_entries(struct iommu *iom
 
 static void dump_iommu_info(unsigned char key)
 {
-#if defined(__i386__) || defined(__x86_64__)
+#if defined(CONFIG_X86)
     struct acpi_drhd_unit *drhd;
     struct iommu *iommu;
     int i;
diff -r dab6583e1873 -r d4761aa7daa2 xen/include/xen/elfcore.h
--- a/xen/include/xen/elfcore.h	Wed Sep 12 20:32:52 2012 +0100
+++ b/xen/include/xen/elfcore.h	Wed Sep 12 20:41:01 2012 +0100
@@ -65,7 +65,7 @@ typedef struct {
     unsigned long xen_compile_date;
     unsigned long xen_compile_time;
     unsigned long tainted;
-#if defined(__x86_64__)
+#if defined(CONFIG_X86)
     unsigned long xen_phys_start;
     unsigned long dom0_pfn_to_mfn_frame_list_list;
 #endif
diff -r dab6583e1873 -r d4761aa7daa2 xen/include/xen/hvm/irq.h
--- a/xen/include/xen/hvm/irq.h	Wed Sep 12 20:32:52 2012 +0100
+++ b/xen/include/xen/hvm/irq.h	Wed Sep 12 20:41:01 2012 +0100
@@ -76,7 +76,7 @@ struct hvm_girq_dpci_mapping {
 
 #define NR_ISAIRQS  16
 #define NR_LINK     4
-#if defined(__x86_64__)
+#if defined(CONFIG_X86)
 # define NR_HVM_IRQS VIOAPIC_NUM_PINS
 #endif
 

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:42 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYk-0003ml-G3; Fri, 14 Sep 2012 10:55:42 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYi-0003ik-OK
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:40 +0000
Received: from [85.158.139.83:3841] by server-1.bemta-5.messagelabs.com id
	16/E8-32692-B2D03505; Fri, 14 Sep 2012 10:55:39 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-182.messagelabs.com!1347620138!23150067!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1660 invoked from network); 14 Sep 2012 10:55:39 -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;
	14 Sep 2012 10: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 1TCTYf-000167-Nf
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYf-0000qB-Ly
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:37 +0000
Message-Id: <E1TCTYf-0000qB-Ly@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:37 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] CONFIG_X86_64 -> CONFIG_X86
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347478372 -3600
# Node ID dab6583e187381811b84d2b93c63c9197a0a8e31
# Parent  baf1da1e0be53c018dcec16292c9f33258b71e35
CONFIG_X86_64 -> CONFIG_X86

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r baf1da1e0be5 -r dab6583e1873 xen/common/memory.c
--- a/xen/common/memory.c	Wed Sep 12 20:23:10 2012 +0100
+++ b/xen/common/memory.c	Wed Sep 12 20:32:52 2012 +0100
@@ -188,7 +188,7 @@ int guest_remove_page(struct domain *d, 
         return 0;
     }
             
-#ifdef CONFIG_X86_64
+#ifdef CONFIG_X86
     if ( p2m_is_shared(p2mt) )
     {
         /* Unshare the page, bail out on error. We unshare because 
@@ -205,7 +205,7 @@ int guest_remove_page(struct domain *d, 
         mfn = mfn_x(get_gfn_query_unlocked(d, gmfn, &p2mt));
         ASSERT(!p2m_is_shared(p2mt));
     }
-#endif /* CONFIG_X86_64 */
+#endif /* CONFIG_X86 */
 
     page = mfn_to_page(mfn);
     if ( unlikely(!get_page(page, d)) )
diff -r baf1da1e0be5 -r dab6583e1873 xen/drivers/passthrough/ats.h
--- a/xen/drivers/passthrough/ats.h	Wed Sep 12 20:23:10 2012 +0100
+++ b/xen/drivers/passthrough/ats.h	Wed Sep 12 20:32:52 2012 +0100
@@ -26,7 +26,7 @@ struct pci_ats_dev {
     u16 ats_queue_depth;    /* ATS device invalidation queue depth */
 };
 
-#ifdef CONFIG_X86_64
+#ifdef CONFIG_X86
 
 #define ATS_REG_CAP    4
 #define ATS_REG_CTL    6
diff -r baf1da1e0be5 -r dab6583e1873 xen/drivers/passthrough/vtd/extern.h
--- a/xen/drivers/passthrough/vtd/extern.h	Wed Sep 12 20:23:10 2012 +0100
+++ b/xen/drivers/passthrough/vtd/extern.h	Wed Sep 12 20:32:52 2012 +0100
@@ -56,7 +56,7 @@ struct acpi_drhd_unit * ioapic_to_drhd(u
 struct acpi_drhd_unit * iommu_to_drhd(struct iommu *iommu);
 struct acpi_rhsa_unit * drhd_to_rhsa(struct acpi_drhd_unit *drhd);
 
-#ifdef CONFIG_X86_64
+#ifdef CONFIG_X86
 struct acpi_drhd_unit * find_ats_dev_drhd(struct iommu *iommu);
 
 int ats_device(const struct pci_dev *, const struct acpi_drhd_unit *);
diff -r baf1da1e0be5 -r dab6583e1873 xen/drivers/passthrough/vtd/quirks.c
--- a/xen/drivers/passthrough/vtd/quirks.c	Wed Sep 12 20:23:10 2012 +0100
+++ b/xen/drivers/passthrough/vtd/quirks.c	Wed Sep 12 20:32:52 2012 +0100
@@ -363,7 +363,7 @@ void me_wifi_quirk(struct domain *domain
  */
 void __init pci_vtd_quirk(struct pci_dev *pdev)
 {
-#ifdef CONFIG_X86_64
+#ifdef CONFIG_X86
     int seg = pdev->seg;
     int bus = pdev->bus;
     int dev = PCI_SLOT(pdev->devfn);
diff -r baf1da1e0be5 -r dab6583e1873 xen/drivers/passthrough/vtd/x86/Makefile
--- a/xen/drivers/passthrough/vtd/x86/Makefile	Wed Sep 12 20:23:10 2012 +0100
+++ b/xen/drivers/passthrough/vtd/x86/Makefile	Wed Sep 12 20:32:52 2012 +0100
@@ -1,2 +1,2 @@
 obj-y += vtd.o
-obj-$(CONFIG_X86_64) += ats.o
+obj-y += ats.o
diff -r baf1da1e0be5 -r dab6583e1873 xen/drivers/passthrough/x86/Makefile
--- a/xen/drivers/passthrough/x86/Makefile	Wed Sep 12 20:23:10 2012 +0100
+++ b/xen/drivers/passthrough/x86/Makefile	Wed Sep 12 20:32:52 2012 +0100
@@ -1,1 +1,1 @@
-obj-$(CONFIG_X86_64) += ats.o
+obj-y += ats.o
diff -r baf1da1e0be5 -r dab6583e1873 xen/drivers/video/Makefile
--- a/xen/drivers/video/Makefile	Wed Sep 12 20:23:10 2012 +0100
+++ b/xen/drivers/video/Makefile	Wed Sep 12 20:32:52 2012 +0100
@@ -1,5 +1,5 @@
-obj-y                := vga.o
-obj-$(CONFIG_X86_64) += font_8x14.o
-obj-$(CONFIG_X86_64) += font_8x16.o
-obj-$(CONFIG_X86_64) += font_8x8.o
-obj-$(CONFIG_X86_64) += vesa.o
+obj-y := vga.o
+obj-$(CONFIG_X86) += font_8x14.o
+obj-$(CONFIG_X86) += font_8x16.o
+obj-$(CONFIG_X86) += font_8x8.o
+obj-$(CONFIG_X86) += vesa.o
diff -r baf1da1e0be5 -r dab6583e1873 xen/drivers/video/vga.c
--- a/xen/drivers/video/vga.c	Wed Sep 12 20:23:10 2012 +0100
+++ b/xen/drivers/video/vga.c	Wed Sep 12 20:32:52 2012 +0100
@@ -54,7 +54,7 @@ string_param("vga", opt_vga);
 static unsigned int columns, lines;
 #define ATTRIBUTE   7
 
-#ifdef CONFIG_X86_64
+#ifdef CONFIG_X86
 void vesa_early_init(void);
 void vesa_endboot(bool_t keep);
 #else
diff -r baf1da1e0be5 -r dab6583e1873 xen/include/asm-x86/config.h
--- a/xen/include/asm-x86/config.h	Wed Sep 12 20:23:10 2012 +0100
+++ b/xen/include/asm-x86/config.h	Wed Sep 12 20:32:52 2012 +0100
@@ -107,7 +107,6 @@ extern unsigned char boot_edid_info[128]
 
 #define asmlinkage
 
-#define CONFIG_X86_64 1
 #define CONFIG_COMPAT 1
 
 #define PML4_ENTRY_BITS  39

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:42 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYk-0003ml-G3; Fri, 14 Sep 2012 10:55:42 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYi-0003ik-OK
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:40 +0000
Received: from [85.158.139.83:3841] by server-1.bemta-5.messagelabs.com id
	16/E8-32692-B2D03505; Fri, 14 Sep 2012 10:55:39 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-182.messagelabs.com!1347620138!23150067!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1660 invoked from network); 14 Sep 2012 10:55:39 -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;
	14 Sep 2012 10: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 1TCTYf-000167-Nf
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYf-0000qB-Ly
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:37 +0000
Message-Id: <E1TCTYf-0000qB-Ly@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:37 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] CONFIG_X86_64 -> CONFIG_X86
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347478372 -3600
# Node ID dab6583e187381811b84d2b93c63c9197a0a8e31
# Parent  baf1da1e0be53c018dcec16292c9f33258b71e35
CONFIG_X86_64 -> CONFIG_X86

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r baf1da1e0be5 -r dab6583e1873 xen/common/memory.c
--- a/xen/common/memory.c	Wed Sep 12 20:23:10 2012 +0100
+++ b/xen/common/memory.c	Wed Sep 12 20:32:52 2012 +0100
@@ -188,7 +188,7 @@ int guest_remove_page(struct domain *d, 
         return 0;
     }
             
-#ifdef CONFIG_X86_64
+#ifdef CONFIG_X86
     if ( p2m_is_shared(p2mt) )
     {
         /* Unshare the page, bail out on error. We unshare because 
@@ -205,7 +205,7 @@ int guest_remove_page(struct domain *d, 
         mfn = mfn_x(get_gfn_query_unlocked(d, gmfn, &p2mt));
         ASSERT(!p2m_is_shared(p2mt));
     }
-#endif /* CONFIG_X86_64 */
+#endif /* CONFIG_X86 */
 
     page = mfn_to_page(mfn);
     if ( unlikely(!get_page(page, d)) )
diff -r baf1da1e0be5 -r dab6583e1873 xen/drivers/passthrough/ats.h
--- a/xen/drivers/passthrough/ats.h	Wed Sep 12 20:23:10 2012 +0100
+++ b/xen/drivers/passthrough/ats.h	Wed Sep 12 20:32:52 2012 +0100
@@ -26,7 +26,7 @@ struct pci_ats_dev {
     u16 ats_queue_depth;    /* ATS device invalidation queue depth */
 };
 
-#ifdef CONFIG_X86_64
+#ifdef CONFIG_X86
 
 #define ATS_REG_CAP    4
 #define ATS_REG_CTL    6
diff -r baf1da1e0be5 -r dab6583e1873 xen/drivers/passthrough/vtd/extern.h
--- a/xen/drivers/passthrough/vtd/extern.h	Wed Sep 12 20:23:10 2012 +0100
+++ b/xen/drivers/passthrough/vtd/extern.h	Wed Sep 12 20:32:52 2012 +0100
@@ -56,7 +56,7 @@ struct acpi_drhd_unit * ioapic_to_drhd(u
 struct acpi_drhd_unit * iommu_to_drhd(struct iommu *iommu);
 struct acpi_rhsa_unit * drhd_to_rhsa(struct acpi_drhd_unit *drhd);
 
-#ifdef CONFIG_X86_64
+#ifdef CONFIG_X86
 struct acpi_drhd_unit * find_ats_dev_drhd(struct iommu *iommu);
 
 int ats_device(const struct pci_dev *, const struct acpi_drhd_unit *);
diff -r baf1da1e0be5 -r dab6583e1873 xen/drivers/passthrough/vtd/quirks.c
--- a/xen/drivers/passthrough/vtd/quirks.c	Wed Sep 12 20:23:10 2012 +0100
+++ b/xen/drivers/passthrough/vtd/quirks.c	Wed Sep 12 20:32:52 2012 +0100
@@ -363,7 +363,7 @@ void me_wifi_quirk(struct domain *domain
  */
 void __init pci_vtd_quirk(struct pci_dev *pdev)
 {
-#ifdef CONFIG_X86_64
+#ifdef CONFIG_X86
     int seg = pdev->seg;
     int bus = pdev->bus;
     int dev = PCI_SLOT(pdev->devfn);
diff -r baf1da1e0be5 -r dab6583e1873 xen/drivers/passthrough/vtd/x86/Makefile
--- a/xen/drivers/passthrough/vtd/x86/Makefile	Wed Sep 12 20:23:10 2012 +0100
+++ b/xen/drivers/passthrough/vtd/x86/Makefile	Wed Sep 12 20:32:52 2012 +0100
@@ -1,2 +1,2 @@
 obj-y += vtd.o
-obj-$(CONFIG_X86_64) += ats.o
+obj-y += ats.o
diff -r baf1da1e0be5 -r dab6583e1873 xen/drivers/passthrough/x86/Makefile
--- a/xen/drivers/passthrough/x86/Makefile	Wed Sep 12 20:23:10 2012 +0100
+++ b/xen/drivers/passthrough/x86/Makefile	Wed Sep 12 20:32:52 2012 +0100
@@ -1,1 +1,1 @@
-obj-$(CONFIG_X86_64) += ats.o
+obj-y += ats.o
diff -r baf1da1e0be5 -r dab6583e1873 xen/drivers/video/Makefile
--- a/xen/drivers/video/Makefile	Wed Sep 12 20:23:10 2012 +0100
+++ b/xen/drivers/video/Makefile	Wed Sep 12 20:32:52 2012 +0100
@@ -1,5 +1,5 @@
-obj-y                := vga.o
-obj-$(CONFIG_X86_64) += font_8x14.o
-obj-$(CONFIG_X86_64) += font_8x16.o
-obj-$(CONFIG_X86_64) += font_8x8.o
-obj-$(CONFIG_X86_64) += vesa.o
+obj-y := vga.o
+obj-$(CONFIG_X86) += font_8x14.o
+obj-$(CONFIG_X86) += font_8x16.o
+obj-$(CONFIG_X86) += font_8x8.o
+obj-$(CONFIG_X86) += vesa.o
diff -r baf1da1e0be5 -r dab6583e1873 xen/drivers/video/vga.c
--- a/xen/drivers/video/vga.c	Wed Sep 12 20:23:10 2012 +0100
+++ b/xen/drivers/video/vga.c	Wed Sep 12 20:32:52 2012 +0100
@@ -54,7 +54,7 @@ string_param("vga", opt_vga);
 static unsigned int columns, lines;
 #define ATTRIBUTE   7
 
-#ifdef CONFIG_X86_64
+#ifdef CONFIG_X86
 void vesa_early_init(void);
 void vesa_endboot(bool_t keep);
 #else
diff -r baf1da1e0be5 -r dab6583e1873 xen/include/asm-x86/config.h
--- a/xen/include/asm-x86/config.h	Wed Sep 12 20:23:10 2012 +0100
+++ b/xen/include/asm-x86/config.h	Wed Sep 12 20:32:52 2012 +0100
@@ -107,7 +107,6 @@ extern unsigned char boot_edid_info[128]
 
 #define asmlinkage
 
-#define CONFIG_X86_64 1
 #define CONFIG_COMPAT 1
 
 #define PML4_ENTRY_BITS  39

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:43 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYl-0003or-N0; Fri, 14 Sep 2012 10:55:43 +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 1TCTYj-0003jR-7o
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:42 +0000
Received: from [85.158.138.51:57409] by server-12.bemta-3.messagelabs.com id
	25/F3-10384-C2D03505; Fri, 14 Sep 2012 10:55:40 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-174.messagelabs.com!1347620136!28856164!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10900 invoked from network); 14 Sep 2012 10:55:37 -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;
	14 Sep 2012 10: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 1TCTYe-00015w-IS
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYe-0000ph-En
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:36 +0000
Message-Id: <E1TCTYe-0000ph-En@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:35 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: Remove CONFIG_COMPAT ifdef'ery
	from arch/x86 -- it is always defined.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347477662 -3600
# Node ID 9686576228e552bd235a4dc2399e8855417c1142
# Parent  4fdaebea82d7c1d906df85eaf7fdab18625e8388
x86: Remove CONFIG_COMPAT ifdef'ery from arch/x86 -- it is always defined.

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r 4fdaebea82d7 -r 9686576228e5 xen/arch/x86/cpu/mcheck/mce.c
--- a/xen/arch/x86/cpu/mcheck/mce.c	Wed Sep 12 19:31:16 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce.c	Wed Sep 12 20:21:02 2012 +0100
@@ -1299,7 +1299,6 @@ static void x86_cmci_inject(void *data)
 #error BITS_PER_LONG definition absent
 #endif
 
-#ifdef CONFIG_COMPAT
 # include <compat/arch-x86/xen-mca.h>
 
 # define xen_mcinfo_msr              mcinfo_msr
@@ -1349,12 +1348,6 @@ CHECK_mcinfo_recovery;
 # undef xen_cpu_offline_action
 # undef xen_page_offline_action
 # undef xen_mcinfo_recovery
-#else
-# define compat_mc_fetch xen_mc_fetch
-# define compat_mc_physcpuinfo xen_mc_physcpuinfo
-# define compat_handle_is_null guest_handle_is_null
-# define copy_to_compat copy_to_guest
-#endif
 
 /* Machine Check Architecture Hypercall */
 long do_mca(XEN_GUEST_HANDLE(xen_mc_t) u_xen_mc)
diff -r 4fdaebea82d7 -r 9686576228e5 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c	Wed Sep 12 19:31:16 2012 +0100
+++ b/xen/arch/x86/domain.c	Wed Sep 12 20:21:02 2012 +0100
@@ -58,9 +58,7 @@
 #include <asm/amd.h>
 #include <xen/numa.h>
 #include <xen/iommu.h>
-#ifdef CONFIG_COMPAT
 #include <compat/vcpu.h>
-#endif
 
 DEFINE_PER_CPU(struct vcpu *, curr_vcpu);
 DEFINE_PER_CPU(unsigned long, cr4);
@@ -665,13 +663,11 @@ unsigned long pv_guest_cr4_fixup(const s
     return (hv_cr4 & hv_cr4_mask) | (guest_cr4 & ~hv_cr4_mask);
 }
 
-#ifdef CONFIG_COMPAT
 #define xen_vcpu_guest_context vcpu_guest_context
 #define fpu_ctxt fpu_ctxt.x
 CHECK_FIELD_(struct, vcpu_guest_context, fpu_ctxt);
 #undef fpu_ctxt
 #undef xen_vcpu_guest_context
-#endif
 
 /* Called by XEN_DOMCTL_setvcpucontext and VCPUOP_initialise. */
 int arch_set_info_guest(
@@ -688,11 +684,7 @@ int arch_set_info_guest(
      * we expect the tools to DTRT even in compat-mode callers. */
     compat = is_pv_32on64_domain(d);
 
-#ifdef CONFIG_COMPAT
 #define c(fld) (compat ? (c.cmp->fld) : (c.nat->fld))
-#else
-#define c(fld) (c.nat->fld)
-#endif
     flags = c(flags);
 
     if ( !is_hvm_vcpu(v) )
@@ -724,7 +716,6 @@ int arch_set_info_guest(
                                   LDT_ENTRY_SIZE) )
                 return -EINVAL;
         }
-#ifdef CONFIG_COMPAT
         else
         {
             fixup_guest_stack_selector(d, c.cmp->user_regs.ss);
@@ -744,7 +735,6 @@ int arch_set_info_guest(
                                          LDT_ENTRY_SIZE) )
                 return -EINVAL;
         }
-#endif
     }
 
     v->fpu_initialised = !!(flags & VGCF_I387_VALID);
@@ -763,7 +753,6 @@ int arch_set_info_guest(
             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);
@@ -771,7 +760,6 @@ int arch_set_info_guest(
             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]);
 
@@ -871,7 +859,6 @@ int arch_set_info_guest(
 
     if ( !compat )
         rc = (int)set_gdt(v, c.nat->gdt_frames, c.nat->gdt_ents);
-#ifdef CONFIG_COMPAT
     else
     {
         unsigned long gdt_frames[ARRAY_SIZE(v->arch.pv_vcpu.gdt_frames)];
@@ -883,7 +870,6 @@ int arch_set_info_guest(
             gdt_frames[i] = c.cmp->gdt_frames[i];
         rc = (int)set_gdt(v, gdt_frames, c.cmp->gdt_ents);
     }
-#endif
     if ( rc != 0 )
         return rc;
 
@@ -1463,7 +1449,6 @@ static void update_runstate_area(struct 
     if ( guest_handle_is_null(runstate_guest(v)) )
         return;
 
-#ifdef CONFIG_COMPAT
     if ( has_32bit_shinfo(v->domain) )
     {
         struct compat_vcpu_runstate_info info;
@@ -1472,7 +1457,6 @@ static void update_runstate_area(struct 
         __copy_to_guest(v->runstate_guest.compat, &info, 1);
         return;
     }
-#endif
 
     __copy_to_guest(runstate_guest(v), &v->runstate, 1);
 }
@@ -1593,7 +1577,6 @@ void context_switch(struct vcpu *prev, s
     {
         __context_switch();
 
-#ifdef CONFIG_COMPAT
         if ( !is_hvm_vcpu(next) &&
              (is_idle_vcpu(prev) ||
               is_hvm_vcpu(prev) ||
@@ -1603,7 +1586,6 @@ void context_switch(struct vcpu *prev, s
             if ( !(efer & EFER_SCE) )
                 write_efer(efer | EFER_SCE);
         }
-#endif
 
         /* Re-enable interrupts before restoring state which may fault. */
         local_irq_enable();
@@ -1776,7 +1758,6 @@ unsigned long hypercall_create_continuat
     return op;
 }
 
-#ifdef CONFIG_COMPAT
 int hypercall_xlat_continuation(unsigned int *id, unsigned int mask, ...)
 {
     int rc = 0;
@@ -1865,7 +1846,6 @@ int hypercall_xlat_continuation(unsigned
 
     return rc;
 }
-#endif
 
 static int relinquish_memory(
     struct domain *d, struct page_list_head *list, unsigned long type)
diff -r 4fdaebea82d7 -r 9686576228e5 xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Wed Sep 12 19:31:16 2012 +0100
+++ b/xen/arch/x86/domctl.c	Wed Sep 12 20:21:02 2012 +0100
@@ -594,14 +594,12 @@ long arch_do_domctl(
 
         switch ( domctl->u.address_size.size )
         {
-#ifdef CONFIG_COMPAT
         case 32:
             ret = switch_compat(d);
             break;
         case 64:
             ret = switch_native(d);
             break;
-#endif
         default:
             ret = (domctl->u.address_size.size == BITS_PER_LONG) ? 0 : -EINVAL;
             break;
@@ -1522,23 +1520,17 @@ long arch_do_domctl(
     return ret;
 }
 
-#ifdef CONFIG_COMPAT
 #define xen_vcpu_guest_context vcpu_guest_context
 #define fpu_ctxt fpu_ctxt.x
 CHECK_FIELD_(struct, vcpu_guest_context, fpu_ctxt);
 #undef fpu_ctxt
 #undef xen_vcpu_guest_context
-#endif
 
 void arch_get_info_guest(struct vcpu *v, vcpu_guest_context_u c)
 {
     unsigned int i;
     bool_t compat = is_pv_32on64_domain(v->domain);
-#ifdef CONFIG_COMPAT
 #define c(fld) (!compat ? (c.nat->fld) : (c.cmp->fld))
-#else
-#define c(fld) (c.nat->fld)
-#endif
 
     if ( is_hvm_vcpu(v) )
         memset(c.nat, 0, sizeof(*c.nat));
@@ -1555,7 +1547,6 @@ void arch_get_info_guest(struct vcpu *v,
             memcpy(c.nat->trap_ctxt, v->arch.pv_vcpu.trap_ctxt,
                    sizeof(c.nat->trap_ctxt));
     }
-#ifdef CONFIG_COMPAT
     else
     {
         XLAT_cpu_user_regs(&c.cmp->user_regs, &v->arch.user_regs);
@@ -1563,7 +1554,6 @@ void arch_get_info_guest(struct vcpu *v,
             XLAT_trap_info(c.cmp->trap_ctxt + i,
                            v->arch.pv_vcpu.trap_ctxt + i);
     }
-#endif
 
     for ( i = 0; i < ARRAY_SIZE(v->arch.debugreg); ++i )
         c(debugreg[i] = v->arch.debugreg[i]);
@@ -1606,10 +1596,8 @@ void arch_get_info_guest(struct vcpu *v,
         c(ldt_ents = v->arch.pv_vcpu.ldt_ents);
         for ( i = 0; i < ARRAY_SIZE(v->arch.pv_vcpu.gdt_frames); ++i )
             c(gdt_frames[i] = v->arch.pv_vcpu.gdt_frames[i]);
-#ifdef CONFIG_COMPAT
         BUILD_BUG_ON(ARRAY_SIZE(c.nat->gdt_frames) !=
                      ARRAY_SIZE(c.cmp->gdt_frames));
-#endif
         for ( ; i < ARRAY_SIZE(c.nat->gdt_frames); ++i )
             c(gdt_frames[i] = 0);
         c(gdt_ents = v->arch.pv_vcpu.gdt_ents);
@@ -1649,7 +1637,6 @@ void arch_get_info_guest(struct vcpu *v,
             c.nat->debugreg[7] |= c.nat->debugreg[5];
             c.nat->debugreg[5] = 0;
         }
-#ifdef CONFIG_COMPAT
         else
         {
             l4_pgentry_t *l4e = __va(pagetable_get_paddr(v->arch.guest_table));
@@ -1659,7 +1646,6 @@ void arch_get_info_guest(struct vcpu *v,
             c.cmp->debugreg[7] |= c.cmp->debugreg[5];
             c.cmp->debugreg[5] = 0;
         }
-#endif
 
         if ( guest_kernel_mode(v, &v->arch.user_regs) )
             c(flags |= VGCF_in_kernel);
diff -r 4fdaebea82d7 -r 9686576228e5 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Wed Sep 12 19:31:16 2012 +0100
+++ b/xen/arch/x86/hvm/hvm.c	Wed Sep 12 20:21:02 2012 +0100
@@ -1046,11 +1046,9 @@ int hvm_vcpu_initialise(struct vcpu *v)
 
     v->arch.hvm_vcpu.inject_trap.vector = -1;
 
-#ifdef CONFIG_COMPAT
     rc = setup_compat_arg_xlat(v);
     if ( rc != 0 )
         goto fail4;
-#endif
 
     rc = hvm_vcpu_cacheattr_init(v);
     if ( rc != 0 )
@@ -1081,9 +1079,7 @@ int hvm_vcpu_initialise(struct vcpu *v)
     return 0;
 
  fail5:
-#ifdef CONFIG_COMPAT
     free_compat_arg_xlat(v);
-#endif
  fail4:
     nestedhvm_vcpu_destroy(v);
  fail3:
@@ -1098,9 +1094,7 @@ void hvm_vcpu_destroy(struct vcpu *v)
 {
     nestedhvm_vcpu_destroy(v);
 
-#ifdef CONFIG_COMPAT
     free_compat_arg_xlat(v);
-#endif
 
     tasklet_kill(&v->arch.hvm_vcpu.assert_evtchn_irq_tasklet);
     hvm_vcpu_cacheattr_destroy(v);
diff -r 4fdaebea82d7 -r 9686576228e5 xen/arch/x86/machine_kexec.c
--- a/xen/arch/x86/machine_kexec.c	Wed Sep 12 19:31:16 2012 +0100
+++ b/xen/arch/x86/machine_kexec.c	Wed Sep 12 20:21:02 2012 +0100
@@ -94,7 +94,6 @@ void machine_kexec(xen_kexec_image_t *im
      */
     asm volatile ( "lgdt %0" : : "m" (gdt_desc) );
 
-#ifdef CONFIG_COMPAT
     if ( is_pv_32on64_domain(dom0) )
     {
         compat_machine_kexec(image->page_list[1],
@@ -103,7 +102,6 @@ void machine_kexec(xen_kexec_image_t *im
                              image->start_address);
     }
     else
-#endif
     {
         relocate_new_kernel_t rnk;
 
diff -r 4fdaebea82d7 -r 9686576228e5 xen/arch/x86/oprofile/xenoprof.c
--- a/xen/arch/x86/oprofile/xenoprof.c	Wed Sep 12 19:31:16 2012 +0100
+++ b/xen/arch/x86/oprofile/xenoprof.c	Wed Sep 12 20:21:02 2012 +0100
@@ -12,9 +12,7 @@
 #include <xen/sched.h>
 #include <xen/xenoprof.h>
 #include <public/xenoprof.h>
-#ifdef CONFIG_COMPAT
 #include <compat/xenoprof.h>
-#endif
 #include <asm/hvm/support.h>
 
 #include "op_counter.h"
@@ -56,7 +54,6 @@ int xenoprof_arch_ibs_counter(XEN_GUEST_
     return 0;
 }
 
-#ifdef CONFIG_COMPAT
 int compat_oprof_arch_counter(XEN_GUEST_HANDLE(void) arg)
 {
     struct compat_oprof_counter counter;
@@ -76,7 +73,6 @@ int compat_oprof_arch_counter(XEN_GUEST_
 
     return 0;
 }
-#endif
 
 int xenoprofile_get_mode(const struct vcpu *v,
                          const struct cpu_user_regs *regs)
diff -r 4fdaebea82d7 -r 9686576228e5 xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c	Wed Sep 12 19:31:16 2012 +0100
+++ b/xen/arch/x86/setup.c	Wed Sep 12 20:21:02 2012 +0100
@@ -26,10 +26,8 @@
 #include <xen/pfn.h>
 #include <xen/nodemask.h>
 #include <public/version.h>
-#ifdef CONFIG_COMPAT
 #include <compat/platform.h>
 #include <compat/xen.h>
-#endif
 #include <asm/bitops.h>
 #include <asm/smp.h>
 #include <asm/processor.h>
@@ -1082,12 +1080,10 @@ void __init __start_xen(unsigned long mb
     BUILD_BUG_ON(sizeof(shared_info_t) > PAGE_SIZE);
     BUILD_BUG_ON(sizeof(struct vcpu_info) != 64);
 
-#ifdef CONFIG_COMPAT
     BUILD_BUG_ON(sizeof(((struct compat_platform_op *)0)->u) !=
                  sizeof(((struct compat_platform_op *)0)->u.pad));
     BUILD_BUG_ON(sizeof(start_info_compat_t) > PAGE_SIZE);
     BUILD_BUG_ON(sizeof(struct compat_vcpu_info) != 64);
-#endif
 
     /* Check definitions in public headers match internal defs. */
     BUILD_BUG_ON(__HYPERVISOR_VIRT_START != HYPERVISOR_VIRT_START);
diff -r 4fdaebea82d7 -r 9686576228e5 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c	Wed Sep 12 19:31:16 2012 +0100
+++ b/xen/arch/x86/traps.c	Wed Sep 12 20:21:02 2012 +0100
@@ -92,9 +92,7 @@ DEFINE_PER_CPU(u64, efer);
 DEFINE_PER_CPU_READ_MOSTLY(u32, ler_msr);
 
 DEFINE_PER_CPU_READ_MOSTLY(struct desc_struct *, gdt_table);
-#ifdef CONFIG_COMPAT
 DEFINE_PER_CPU_READ_MOSTLY(struct desc_struct *, compat_gdt_table);
-#endif
 
 /* Master table, used by CPU0. */
 idt_entry_t idt_table[IDT_ENTRIES];
@@ -2273,14 +2271,12 @@ static int emulate_privileged_op(struct 
                 *reg = xen_pfn_to_cr3(mfn_to_gmfn(
                     v->domain, mfn));
             }
-#ifdef CONFIG_COMPAT
             else
             {
                 mfn = l4e_get_pfn(*(l4_pgentry_t *)__va(pagetable_get_paddr(v->arch.guest_table)));
                 *reg = compat_pfn_to_cr3(mfn_to_gmfn(
                     v->domain, mfn));
             }
-#endif
             /* PTs should not be shared */
             BUG_ON(page_get_owner(mfn_to_page(mfn)) == dom_cow);
         }
@@ -2337,14 +2333,8 @@ static int emulate_privileged_op(struct 
             unsigned long gfn;
             struct page_info *page;
             domain_lock(v->domain);
-            if ( !is_pv_32on64_vcpu(v) )
-            {
-                gfn = xen_cr3_to_pfn(*reg);
-#ifdef CONFIG_COMPAT
-            } else {
-                gfn = compat_cr3_to_pfn(*reg);
-#endif
-            }
+            gfn = !is_pv_32on64_vcpu(v)
+                ? xen_cr3_to_pfn(*reg) : compat_cr3_to_pfn(*reg);
             page = get_page_from_gfn(v->domain, gfn, NULL, P2M_ALLOC);
             rc = page ? new_guest_cr3(page_to_mfn(page)) : 0;
             if ( page )
@@ -3422,13 +3412,11 @@ void load_TR(void)
         (unsigned long)tss,
         offsetof(struct tss_struct, __cacheline_filler) - 1,
         9);
-#ifdef CONFIG_COMPAT
     _set_tssldt_desc(
         this_cpu(compat_gdt_table) + TSS_ENTRY - FIRST_RESERVED_GDT_ENTRY,
         (unsigned long)tss,
         offsetof(struct tss_struct, __cacheline_filler) - 1,
         11);
-#endif
 
     /* Switch to non-compat GDT (which has B bit clear) to execute LTR. */
     asm volatile (
@@ -3504,9 +3492,7 @@ void __init trap_init(void)
     idt_tables[0] = idt_table;
 
     this_cpu(gdt_table) = boot_cpu_gdt_table;
-#ifdef CONFIG_COMPAT
     this_cpu(compat_gdt_table) = boot_cpu_compat_gdt_table;
-#endif
 
     percpu_traps_init();
 
diff -r 4fdaebea82d7 -r 9686576228e5 xen/include/asm-x86/desc.h
--- a/xen/include/asm-x86/desc.h	Wed Sep 12 19:31:16 2012 +0100
+++ b/xen/include/asm-x86/desc.h	Wed Sep 12 20:21:02 2012 +0100
@@ -143,13 +143,8 @@ struct desc_ptr {
 
 extern struct desc_struct boot_cpu_gdt_table[];
 DECLARE_PER_CPU(struct desc_struct *, gdt_table);
-#ifdef CONFIG_COMPAT
 extern struct desc_struct boot_cpu_compat_gdt_table[];
 DECLARE_PER_CPU(struct desc_struct *, compat_gdt_table);
-#else
-# define boot_cpu_compat_gdt_table boot_cpu_gdt_table
-# define per_cpu__compat_gdt_table per_cpu__gdt_table
-#endif
 
 extern void set_intr_gate(unsigned int irq, void * addr);
 extern void load_TR(void);
diff -r 4fdaebea82d7 -r 9686576228e5 xen/include/asm-x86/domain.h
--- a/xen/include/asm-x86/domain.h	Wed Sep 12 19:31:16 2012 +0100
+++ b/xen/include/asm-x86/domain.h	Wed Sep 12 20:21:02 2012 +0100
@@ -447,9 +447,7 @@ struct arch_vcpu
     /* A secondary copy of the vcpu time info. */
     XEN_GUEST_HANDLE(vcpu_time_info_t) time_info_guest;
 
-#ifdef CONFIG_COMPAT
     void *compat_arg_xlat;
-#endif
 
 } __cacheline_aligned;
 
diff -r 4fdaebea82d7 -r 9686576228e5 xen/include/asm-x86/mm.h
--- a/xen/include/asm-x86/mm.h	Wed Sep 12 19:31:16 2012 +0100
+++ b/xen/include/asm-x86/mm.h	Wed Sep 12 20:21:02 2012 +0100
@@ -473,7 +473,6 @@ TYPE_SAFE(unsigned long,mfn);
 #define SHARED_M2P_ENTRY         (~0UL - 1UL)
 #define SHARED_M2P(_e)           ((_e) == SHARED_M2P_ENTRY)
 
-#ifdef CONFIG_COMPAT
 #define compat_machine_to_phys_mapping ((unsigned int *)RDWR_COMPAT_MPT_VIRT_START)
 #define _set_gpfn_from_mfn(mfn, pfn) ({                        \
     struct domain *d = page_get_owner(__mfn_to_page(mfn));     \
@@ -483,15 +482,6 @@ TYPE_SAFE(unsigned long,mfn);
             (compat_machine_to_phys_mapping[(mfn)] = (unsigned int)(entry))), \
      machine_to_phys_mapping[(mfn)] = (entry));                \
     })
-#else
-#define _set_gpfn_from_mfn(mfn, pfn) ({                        \
-    struct domain *d = page_get_owner(__mfn_to_page(mfn));     \
-    if(d && (d == dom_cow))                                    \
-        machine_to_phys_mapping[(mfn)] = SHARED_M2P_ENTRY;     \
-    else                                                       \
-        machine_to_phys_mapping[(mfn)] = (pfn);                \
-    })
-#endif
 
 /*
  * Disable some users of set_gpfn_from_mfn() (e.g., free_heap_pages()) until
@@ -579,13 +569,8 @@ int map_ldt_shadow_page(unsigned int);
 
 extern int memory_add(unsigned long spfn, unsigned long epfn, unsigned int pxm);
 
-#ifdef CONFIG_COMPAT
 void domain_set_alloc_bitsize(struct domain *d);
 unsigned int domain_clamp_alloc_bitsize(struct domain *d, unsigned int bits);
-#else
-# define domain_set_alloc_bitsize(d) ((void)0)
-# define domain_clamp_alloc_bitsize(d, b) (b)
-#endif
 
 unsigned long domain_get_maximum_gpfn(struct domain *d);
 
diff -r 4fdaebea82d7 -r 9686576228e5 xen/include/asm-x86/processor.h
--- a/xen/include/asm-x86/processor.h	Wed Sep 12 19:31:16 2012 +0100
+++ b/xen/include/asm-x86/processor.h	Wed Sep 12 20:21:02 2012 +0100
@@ -504,11 +504,7 @@ void show_execution_state(struct cpu_use
 void show_page_walk(unsigned long addr);
 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);
-#else
-#define compat_show_guest_stack(vcpu, regs, lines) ((void)0)
-#endif
 
 extern void mtrr_ap_init(void);
 extern void mtrr_bp_init(void);
diff -r 4fdaebea82d7 -r 9686576228e5 xen/include/asm-x86/shared.h
--- a/xen/include/asm-x86/shared.h	Wed Sep 12 19:31:16 2012 +0100
+++ b/xen/include/asm-x86/shared.h	Wed Sep 12 20:21:02 2012 +0100
@@ -1,8 +1,6 @@
 #ifndef __XEN_X86_SHARED_H__
 #define __XEN_X86_SHARED_H__
 
-#ifdef CONFIG_COMPAT
-
 #define nmi_reason(d) (!has_32bit_shinfo(d) ?                             \
                        (u32 *)&(d)->shared_info->native.arch.nmi_reason : \
                        (u32 *)&(d)->shared_info->compat.arch.nmi_reason)
@@ -39,33 +37,6 @@ static inline void arch_set_##field(stru
         v->vcpu_info->compat.arch.field = val;                  \
 }
 
-#else
-
-#define nmi_reason(d) ((u32 *)&(d)->shared_info->arch.nmi_reason)
-
-#define GET_SET_SHARED(type, field)                             \
-static inline type arch_get_##field(const struct domain *d)     \
-{                                                               \
-    return d->shared_info->arch.field;                          \
-}                                                               \
-static inline void arch_set_##field(struct domain *d,           \
-                                    type val)                   \
-{                                                               \
-    d->shared_info->arch.field = val;                           \
-}
-
-#define GET_SET_VCPU(type, field)                               \
-static inline type arch_get_##field(const struct vcpu *v)       \
-{                                                               \
-    return v->vcpu_info->arch.field;                            \
-}                                                               \
-static inline void arch_set_##field(struct vcpu *v,             \
-                                    type val)                   \
-{                                                               \
-    v->vcpu_info->arch.field = val;                             \
-}
-#endif
-
 GET_SET_SHARED(unsigned long, max_pfn)
 GET_SET_SHARED(xen_pfn_t, pfn_to_mfn_frame_list_list)
 GET_SET_SHARED(unsigned long, nmi_reason)

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:43 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYl-0003or-N0; Fri, 14 Sep 2012 10:55:43 +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 1TCTYj-0003jR-7o
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:42 +0000
Received: from [85.158.138.51:57409] by server-12.bemta-3.messagelabs.com id
	25/F3-10384-C2D03505; Fri, 14 Sep 2012 10:55:40 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-174.messagelabs.com!1347620136!28856164!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10900 invoked from network); 14 Sep 2012 10:55:37 -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;
	14 Sep 2012 10: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 1TCTYe-00015w-IS
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYe-0000ph-En
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:36 +0000
Message-Id: <E1TCTYe-0000ph-En@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:35 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: Remove CONFIG_COMPAT ifdef'ery
	from arch/x86 -- it is always defined.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347477662 -3600
# Node ID 9686576228e552bd235a4dc2399e8855417c1142
# Parent  4fdaebea82d7c1d906df85eaf7fdab18625e8388
x86: Remove CONFIG_COMPAT ifdef'ery from arch/x86 -- it is always defined.

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r 4fdaebea82d7 -r 9686576228e5 xen/arch/x86/cpu/mcheck/mce.c
--- a/xen/arch/x86/cpu/mcheck/mce.c	Wed Sep 12 19:31:16 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce.c	Wed Sep 12 20:21:02 2012 +0100
@@ -1299,7 +1299,6 @@ static void x86_cmci_inject(void *data)
 #error BITS_PER_LONG definition absent
 #endif
 
-#ifdef CONFIG_COMPAT
 # include <compat/arch-x86/xen-mca.h>
 
 # define xen_mcinfo_msr              mcinfo_msr
@@ -1349,12 +1348,6 @@ CHECK_mcinfo_recovery;
 # undef xen_cpu_offline_action
 # undef xen_page_offline_action
 # undef xen_mcinfo_recovery
-#else
-# define compat_mc_fetch xen_mc_fetch
-# define compat_mc_physcpuinfo xen_mc_physcpuinfo
-# define compat_handle_is_null guest_handle_is_null
-# define copy_to_compat copy_to_guest
-#endif
 
 /* Machine Check Architecture Hypercall */
 long do_mca(XEN_GUEST_HANDLE(xen_mc_t) u_xen_mc)
diff -r 4fdaebea82d7 -r 9686576228e5 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c	Wed Sep 12 19:31:16 2012 +0100
+++ b/xen/arch/x86/domain.c	Wed Sep 12 20:21:02 2012 +0100
@@ -58,9 +58,7 @@
 #include <asm/amd.h>
 #include <xen/numa.h>
 #include <xen/iommu.h>
-#ifdef CONFIG_COMPAT
 #include <compat/vcpu.h>
-#endif
 
 DEFINE_PER_CPU(struct vcpu *, curr_vcpu);
 DEFINE_PER_CPU(unsigned long, cr4);
@@ -665,13 +663,11 @@ unsigned long pv_guest_cr4_fixup(const s
     return (hv_cr4 & hv_cr4_mask) | (guest_cr4 & ~hv_cr4_mask);
 }
 
-#ifdef CONFIG_COMPAT
 #define xen_vcpu_guest_context vcpu_guest_context
 #define fpu_ctxt fpu_ctxt.x
 CHECK_FIELD_(struct, vcpu_guest_context, fpu_ctxt);
 #undef fpu_ctxt
 #undef xen_vcpu_guest_context
-#endif
 
 /* Called by XEN_DOMCTL_setvcpucontext and VCPUOP_initialise. */
 int arch_set_info_guest(
@@ -688,11 +684,7 @@ int arch_set_info_guest(
      * we expect the tools to DTRT even in compat-mode callers. */
     compat = is_pv_32on64_domain(d);
 
-#ifdef CONFIG_COMPAT
 #define c(fld) (compat ? (c.cmp->fld) : (c.nat->fld))
-#else
-#define c(fld) (c.nat->fld)
-#endif
     flags = c(flags);
 
     if ( !is_hvm_vcpu(v) )
@@ -724,7 +716,6 @@ int arch_set_info_guest(
                                   LDT_ENTRY_SIZE) )
                 return -EINVAL;
         }
-#ifdef CONFIG_COMPAT
         else
         {
             fixup_guest_stack_selector(d, c.cmp->user_regs.ss);
@@ -744,7 +735,6 @@ int arch_set_info_guest(
                                          LDT_ENTRY_SIZE) )
                 return -EINVAL;
         }
-#endif
     }
 
     v->fpu_initialised = !!(flags & VGCF_I387_VALID);
@@ -763,7 +753,6 @@ int arch_set_info_guest(
             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);
@@ -771,7 +760,6 @@ int arch_set_info_guest(
             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]);
 
@@ -871,7 +859,6 @@ int arch_set_info_guest(
 
     if ( !compat )
         rc = (int)set_gdt(v, c.nat->gdt_frames, c.nat->gdt_ents);
-#ifdef CONFIG_COMPAT
     else
     {
         unsigned long gdt_frames[ARRAY_SIZE(v->arch.pv_vcpu.gdt_frames)];
@@ -883,7 +870,6 @@ int arch_set_info_guest(
             gdt_frames[i] = c.cmp->gdt_frames[i];
         rc = (int)set_gdt(v, gdt_frames, c.cmp->gdt_ents);
     }
-#endif
     if ( rc != 0 )
         return rc;
 
@@ -1463,7 +1449,6 @@ static void update_runstate_area(struct 
     if ( guest_handle_is_null(runstate_guest(v)) )
         return;
 
-#ifdef CONFIG_COMPAT
     if ( has_32bit_shinfo(v->domain) )
     {
         struct compat_vcpu_runstate_info info;
@@ -1472,7 +1457,6 @@ static void update_runstate_area(struct 
         __copy_to_guest(v->runstate_guest.compat, &info, 1);
         return;
     }
-#endif
 
     __copy_to_guest(runstate_guest(v), &v->runstate, 1);
 }
@@ -1593,7 +1577,6 @@ void context_switch(struct vcpu *prev, s
     {
         __context_switch();
 
-#ifdef CONFIG_COMPAT
         if ( !is_hvm_vcpu(next) &&
              (is_idle_vcpu(prev) ||
               is_hvm_vcpu(prev) ||
@@ -1603,7 +1586,6 @@ void context_switch(struct vcpu *prev, s
             if ( !(efer & EFER_SCE) )
                 write_efer(efer | EFER_SCE);
         }
-#endif
 
         /* Re-enable interrupts before restoring state which may fault. */
         local_irq_enable();
@@ -1776,7 +1758,6 @@ unsigned long hypercall_create_continuat
     return op;
 }
 
-#ifdef CONFIG_COMPAT
 int hypercall_xlat_continuation(unsigned int *id, unsigned int mask, ...)
 {
     int rc = 0;
@@ -1865,7 +1846,6 @@ int hypercall_xlat_continuation(unsigned
 
     return rc;
 }
-#endif
 
 static int relinquish_memory(
     struct domain *d, struct page_list_head *list, unsigned long type)
diff -r 4fdaebea82d7 -r 9686576228e5 xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Wed Sep 12 19:31:16 2012 +0100
+++ b/xen/arch/x86/domctl.c	Wed Sep 12 20:21:02 2012 +0100
@@ -594,14 +594,12 @@ long arch_do_domctl(
 
         switch ( domctl->u.address_size.size )
         {
-#ifdef CONFIG_COMPAT
         case 32:
             ret = switch_compat(d);
             break;
         case 64:
             ret = switch_native(d);
             break;
-#endif
         default:
             ret = (domctl->u.address_size.size == BITS_PER_LONG) ? 0 : -EINVAL;
             break;
@@ -1522,23 +1520,17 @@ long arch_do_domctl(
     return ret;
 }
 
-#ifdef CONFIG_COMPAT
 #define xen_vcpu_guest_context vcpu_guest_context
 #define fpu_ctxt fpu_ctxt.x
 CHECK_FIELD_(struct, vcpu_guest_context, fpu_ctxt);
 #undef fpu_ctxt
 #undef xen_vcpu_guest_context
-#endif
 
 void arch_get_info_guest(struct vcpu *v, vcpu_guest_context_u c)
 {
     unsigned int i;
     bool_t compat = is_pv_32on64_domain(v->domain);
-#ifdef CONFIG_COMPAT
 #define c(fld) (!compat ? (c.nat->fld) : (c.cmp->fld))
-#else
-#define c(fld) (c.nat->fld)
-#endif
 
     if ( is_hvm_vcpu(v) )
         memset(c.nat, 0, sizeof(*c.nat));
@@ -1555,7 +1547,6 @@ void arch_get_info_guest(struct vcpu *v,
             memcpy(c.nat->trap_ctxt, v->arch.pv_vcpu.trap_ctxt,
                    sizeof(c.nat->trap_ctxt));
     }
-#ifdef CONFIG_COMPAT
     else
     {
         XLAT_cpu_user_regs(&c.cmp->user_regs, &v->arch.user_regs);
@@ -1563,7 +1554,6 @@ void arch_get_info_guest(struct vcpu *v,
             XLAT_trap_info(c.cmp->trap_ctxt + i,
                            v->arch.pv_vcpu.trap_ctxt + i);
     }
-#endif
 
     for ( i = 0; i < ARRAY_SIZE(v->arch.debugreg); ++i )
         c(debugreg[i] = v->arch.debugreg[i]);
@@ -1606,10 +1596,8 @@ void arch_get_info_guest(struct vcpu *v,
         c(ldt_ents = v->arch.pv_vcpu.ldt_ents);
         for ( i = 0; i < ARRAY_SIZE(v->arch.pv_vcpu.gdt_frames); ++i )
             c(gdt_frames[i] = v->arch.pv_vcpu.gdt_frames[i]);
-#ifdef CONFIG_COMPAT
         BUILD_BUG_ON(ARRAY_SIZE(c.nat->gdt_frames) !=
                      ARRAY_SIZE(c.cmp->gdt_frames));
-#endif
         for ( ; i < ARRAY_SIZE(c.nat->gdt_frames); ++i )
             c(gdt_frames[i] = 0);
         c(gdt_ents = v->arch.pv_vcpu.gdt_ents);
@@ -1649,7 +1637,6 @@ void arch_get_info_guest(struct vcpu *v,
             c.nat->debugreg[7] |= c.nat->debugreg[5];
             c.nat->debugreg[5] = 0;
         }
-#ifdef CONFIG_COMPAT
         else
         {
             l4_pgentry_t *l4e = __va(pagetable_get_paddr(v->arch.guest_table));
@@ -1659,7 +1646,6 @@ void arch_get_info_guest(struct vcpu *v,
             c.cmp->debugreg[7] |= c.cmp->debugreg[5];
             c.cmp->debugreg[5] = 0;
         }
-#endif
 
         if ( guest_kernel_mode(v, &v->arch.user_regs) )
             c(flags |= VGCF_in_kernel);
diff -r 4fdaebea82d7 -r 9686576228e5 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Wed Sep 12 19:31:16 2012 +0100
+++ b/xen/arch/x86/hvm/hvm.c	Wed Sep 12 20:21:02 2012 +0100
@@ -1046,11 +1046,9 @@ int hvm_vcpu_initialise(struct vcpu *v)
 
     v->arch.hvm_vcpu.inject_trap.vector = -1;
 
-#ifdef CONFIG_COMPAT
     rc = setup_compat_arg_xlat(v);
     if ( rc != 0 )
         goto fail4;
-#endif
 
     rc = hvm_vcpu_cacheattr_init(v);
     if ( rc != 0 )
@@ -1081,9 +1079,7 @@ int hvm_vcpu_initialise(struct vcpu *v)
     return 0;
 
  fail5:
-#ifdef CONFIG_COMPAT
     free_compat_arg_xlat(v);
-#endif
  fail4:
     nestedhvm_vcpu_destroy(v);
  fail3:
@@ -1098,9 +1094,7 @@ void hvm_vcpu_destroy(struct vcpu *v)
 {
     nestedhvm_vcpu_destroy(v);
 
-#ifdef CONFIG_COMPAT
     free_compat_arg_xlat(v);
-#endif
 
     tasklet_kill(&v->arch.hvm_vcpu.assert_evtchn_irq_tasklet);
     hvm_vcpu_cacheattr_destroy(v);
diff -r 4fdaebea82d7 -r 9686576228e5 xen/arch/x86/machine_kexec.c
--- a/xen/arch/x86/machine_kexec.c	Wed Sep 12 19:31:16 2012 +0100
+++ b/xen/arch/x86/machine_kexec.c	Wed Sep 12 20:21:02 2012 +0100
@@ -94,7 +94,6 @@ void machine_kexec(xen_kexec_image_t *im
      */
     asm volatile ( "lgdt %0" : : "m" (gdt_desc) );
 
-#ifdef CONFIG_COMPAT
     if ( is_pv_32on64_domain(dom0) )
     {
         compat_machine_kexec(image->page_list[1],
@@ -103,7 +102,6 @@ void machine_kexec(xen_kexec_image_t *im
                              image->start_address);
     }
     else
-#endif
     {
         relocate_new_kernel_t rnk;
 
diff -r 4fdaebea82d7 -r 9686576228e5 xen/arch/x86/oprofile/xenoprof.c
--- a/xen/arch/x86/oprofile/xenoprof.c	Wed Sep 12 19:31:16 2012 +0100
+++ b/xen/arch/x86/oprofile/xenoprof.c	Wed Sep 12 20:21:02 2012 +0100
@@ -12,9 +12,7 @@
 #include <xen/sched.h>
 #include <xen/xenoprof.h>
 #include <public/xenoprof.h>
-#ifdef CONFIG_COMPAT
 #include <compat/xenoprof.h>
-#endif
 #include <asm/hvm/support.h>
 
 #include "op_counter.h"
@@ -56,7 +54,6 @@ int xenoprof_arch_ibs_counter(XEN_GUEST_
     return 0;
 }
 
-#ifdef CONFIG_COMPAT
 int compat_oprof_arch_counter(XEN_GUEST_HANDLE(void) arg)
 {
     struct compat_oprof_counter counter;
@@ -76,7 +73,6 @@ int compat_oprof_arch_counter(XEN_GUEST_
 
     return 0;
 }
-#endif
 
 int xenoprofile_get_mode(const struct vcpu *v,
                          const struct cpu_user_regs *regs)
diff -r 4fdaebea82d7 -r 9686576228e5 xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c	Wed Sep 12 19:31:16 2012 +0100
+++ b/xen/arch/x86/setup.c	Wed Sep 12 20:21:02 2012 +0100
@@ -26,10 +26,8 @@
 #include <xen/pfn.h>
 #include <xen/nodemask.h>
 #include <public/version.h>
-#ifdef CONFIG_COMPAT
 #include <compat/platform.h>
 #include <compat/xen.h>
-#endif
 #include <asm/bitops.h>
 #include <asm/smp.h>
 #include <asm/processor.h>
@@ -1082,12 +1080,10 @@ void __init __start_xen(unsigned long mb
     BUILD_BUG_ON(sizeof(shared_info_t) > PAGE_SIZE);
     BUILD_BUG_ON(sizeof(struct vcpu_info) != 64);
 
-#ifdef CONFIG_COMPAT
     BUILD_BUG_ON(sizeof(((struct compat_platform_op *)0)->u) !=
                  sizeof(((struct compat_platform_op *)0)->u.pad));
     BUILD_BUG_ON(sizeof(start_info_compat_t) > PAGE_SIZE);
     BUILD_BUG_ON(sizeof(struct compat_vcpu_info) != 64);
-#endif
 
     /* Check definitions in public headers match internal defs. */
     BUILD_BUG_ON(__HYPERVISOR_VIRT_START != HYPERVISOR_VIRT_START);
diff -r 4fdaebea82d7 -r 9686576228e5 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c	Wed Sep 12 19:31:16 2012 +0100
+++ b/xen/arch/x86/traps.c	Wed Sep 12 20:21:02 2012 +0100
@@ -92,9 +92,7 @@ DEFINE_PER_CPU(u64, efer);
 DEFINE_PER_CPU_READ_MOSTLY(u32, ler_msr);
 
 DEFINE_PER_CPU_READ_MOSTLY(struct desc_struct *, gdt_table);
-#ifdef CONFIG_COMPAT
 DEFINE_PER_CPU_READ_MOSTLY(struct desc_struct *, compat_gdt_table);
-#endif
 
 /* Master table, used by CPU0. */
 idt_entry_t idt_table[IDT_ENTRIES];
@@ -2273,14 +2271,12 @@ static int emulate_privileged_op(struct 
                 *reg = xen_pfn_to_cr3(mfn_to_gmfn(
                     v->domain, mfn));
             }
-#ifdef CONFIG_COMPAT
             else
             {
                 mfn = l4e_get_pfn(*(l4_pgentry_t *)__va(pagetable_get_paddr(v->arch.guest_table)));
                 *reg = compat_pfn_to_cr3(mfn_to_gmfn(
                     v->domain, mfn));
             }
-#endif
             /* PTs should not be shared */
             BUG_ON(page_get_owner(mfn_to_page(mfn)) == dom_cow);
         }
@@ -2337,14 +2333,8 @@ static int emulate_privileged_op(struct 
             unsigned long gfn;
             struct page_info *page;
             domain_lock(v->domain);
-            if ( !is_pv_32on64_vcpu(v) )
-            {
-                gfn = xen_cr3_to_pfn(*reg);
-#ifdef CONFIG_COMPAT
-            } else {
-                gfn = compat_cr3_to_pfn(*reg);
-#endif
-            }
+            gfn = !is_pv_32on64_vcpu(v)
+                ? xen_cr3_to_pfn(*reg) : compat_cr3_to_pfn(*reg);
             page = get_page_from_gfn(v->domain, gfn, NULL, P2M_ALLOC);
             rc = page ? new_guest_cr3(page_to_mfn(page)) : 0;
             if ( page )
@@ -3422,13 +3412,11 @@ void load_TR(void)
         (unsigned long)tss,
         offsetof(struct tss_struct, __cacheline_filler) - 1,
         9);
-#ifdef CONFIG_COMPAT
     _set_tssldt_desc(
         this_cpu(compat_gdt_table) + TSS_ENTRY - FIRST_RESERVED_GDT_ENTRY,
         (unsigned long)tss,
         offsetof(struct tss_struct, __cacheline_filler) - 1,
         11);
-#endif
 
     /* Switch to non-compat GDT (which has B bit clear) to execute LTR. */
     asm volatile (
@@ -3504,9 +3492,7 @@ void __init trap_init(void)
     idt_tables[0] = idt_table;
 
     this_cpu(gdt_table) = boot_cpu_gdt_table;
-#ifdef CONFIG_COMPAT
     this_cpu(compat_gdt_table) = boot_cpu_compat_gdt_table;
-#endif
 
     percpu_traps_init();
 
diff -r 4fdaebea82d7 -r 9686576228e5 xen/include/asm-x86/desc.h
--- a/xen/include/asm-x86/desc.h	Wed Sep 12 19:31:16 2012 +0100
+++ b/xen/include/asm-x86/desc.h	Wed Sep 12 20:21:02 2012 +0100
@@ -143,13 +143,8 @@ struct desc_ptr {
 
 extern struct desc_struct boot_cpu_gdt_table[];
 DECLARE_PER_CPU(struct desc_struct *, gdt_table);
-#ifdef CONFIG_COMPAT
 extern struct desc_struct boot_cpu_compat_gdt_table[];
 DECLARE_PER_CPU(struct desc_struct *, compat_gdt_table);
-#else
-# define boot_cpu_compat_gdt_table boot_cpu_gdt_table
-# define per_cpu__compat_gdt_table per_cpu__gdt_table
-#endif
 
 extern void set_intr_gate(unsigned int irq, void * addr);
 extern void load_TR(void);
diff -r 4fdaebea82d7 -r 9686576228e5 xen/include/asm-x86/domain.h
--- a/xen/include/asm-x86/domain.h	Wed Sep 12 19:31:16 2012 +0100
+++ b/xen/include/asm-x86/domain.h	Wed Sep 12 20:21:02 2012 +0100
@@ -447,9 +447,7 @@ struct arch_vcpu
     /* A secondary copy of the vcpu time info. */
     XEN_GUEST_HANDLE(vcpu_time_info_t) time_info_guest;
 
-#ifdef CONFIG_COMPAT
     void *compat_arg_xlat;
-#endif
 
 } __cacheline_aligned;
 
diff -r 4fdaebea82d7 -r 9686576228e5 xen/include/asm-x86/mm.h
--- a/xen/include/asm-x86/mm.h	Wed Sep 12 19:31:16 2012 +0100
+++ b/xen/include/asm-x86/mm.h	Wed Sep 12 20:21:02 2012 +0100
@@ -473,7 +473,6 @@ TYPE_SAFE(unsigned long,mfn);
 #define SHARED_M2P_ENTRY         (~0UL - 1UL)
 #define SHARED_M2P(_e)           ((_e) == SHARED_M2P_ENTRY)
 
-#ifdef CONFIG_COMPAT
 #define compat_machine_to_phys_mapping ((unsigned int *)RDWR_COMPAT_MPT_VIRT_START)
 #define _set_gpfn_from_mfn(mfn, pfn) ({                        \
     struct domain *d = page_get_owner(__mfn_to_page(mfn));     \
@@ -483,15 +482,6 @@ TYPE_SAFE(unsigned long,mfn);
             (compat_machine_to_phys_mapping[(mfn)] = (unsigned int)(entry))), \
      machine_to_phys_mapping[(mfn)] = (entry));                \
     })
-#else
-#define _set_gpfn_from_mfn(mfn, pfn) ({                        \
-    struct domain *d = page_get_owner(__mfn_to_page(mfn));     \
-    if(d && (d == dom_cow))                                    \
-        machine_to_phys_mapping[(mfn)] = SHARED_M2P_ENTRY;     \
-    else                                                       \
-        machine_to_phys_mapping[(mfn)] = (pfn);                \
-    })
-#endif
 
 /*
  * Disable some users of set_gpfn_from_mfn() (e.g., free_heap_pages()) until
@@ -579,13 +569,8 @@ int map_ldt_shadow_page(unsigned int);
 
 extern int memory_add(unsigned long spfn, unsigned long epfn, unsigned int pxm);
 
-#ifdef CONFIG_COMPAT
 void domain_set_alloc_bitsize(struct domain *d);
 unsigned int domain_clamp_alloc_bitsize(struct domain *d, unsigned int bits);
-#else
-# define domain_set_alloc_bitsize(d) ((void)0)
-# define domain_clamp_alloc_bitsize(d, b) (b)
-#endif
 
 unsigned long domain_get_maximum_gpfn(struct domain *d);
 
diff -r 4fdaebea82d7 -r 9686576228e5 xen/include/asm-x86/processor.h
--- a/xen/include/asm-x86/processor.h	Wed Sep 12 19:31:16 2012 +0100
+++ b/xen/include/asm-x86/processor.h	Wed Sep 12 20:21:02 2012 +0100
@@ -504,11 +504,7 @@ void show_execution_state(struct cpu_use
 void show_page_walk(unsigned long addr);
 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);
-#else
-#define compat_show_guest_stack(vcpu, regs, lines) ((void)0)
-#endif
 
 extern void mtrr_ap_init(void);
 extern void mtrr_bp_init(void);
diff -r 4fdaebea82d7 -r 9686576228e5 xen/include/asm-x86/shared.h
--- a/xen/include/asm-x86/shared.h	Wed Sep 12 19:31:16 2012 +0100
+++ b/xen/include/asm-x86/shared.h	Wed Sep 12 20:21:02 2012 +0100
@@ -1,8 +1,6 @@
 #ifndef __XEN_X86_SHARED_H__
 #define __XEN_X86_SHARED_H__
 
-#ifdef CONFIG_COMPAT
-
 #define nmi_reason(d) (!has_32bit_shinfo(d) ?                             \
                        (u32 *)&(d)->shared_info->native.arch.nmi_reason : \
                        (u32 *)&(d)->shared_info->compat.arch.nmi_reason)
@@ -39,33 +37,6 @@ static inline void arch_set_##field(stru
         v->vcpu_info->compat.arch.field = val;                  \
 }
 
-#else
-
-#define nmi_reason(d) ((u32 *)&(d)->shared_info->arch.nmi_reason)
-
-#define GET_SET_SHARED(type, field)                             \
-static inline type arch_get_##field(const struct domain *d)     \
-{                                                               \
-    return d->shared_info->arch.field;                          \
-}                                                               \
-static inline void arch_set_##field(struct domain *d,           \
-                                    type val)                   \
-{                                                               \
-    d->shared_info->arch.field = val;                           \
-}
-
-#define GET_SET_VCPU(type, field)                               \
-static inline type arch_get_##field(const struct vcpu *v)       \
-{                                                               \
-    return v->vcpu_info->arch.field;                            \
-}                                                               \
-static inline void arch_set_##field(struct vcpu *v,             \
-                                    type val)                   \
-{                                                               \
-    v->vcpu_info->arch.field = val;                             \
-}
-#endif
-
 GET_SET_SHARED(unsigned long, max_pfn)
 GET_SET_SHARED(xen_pfn_t, pfn_to_mfn_frame_list_list)
 GET_SET_SHARED(unsigned long, nmi_reason)

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:45 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYm-0003r2-SS; Fri, 14 Sep 2012 10:55:44 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYl-0003nu-Kj
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:43 +0000
Received: from [85.158.139.83:52484] by server-6.bemta-5.messagelabs.com id
	F6/55-21336-E2D03505; Fri, 14 Sep 2012 10:55:42 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1347620140!29827276!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12967 invoked from network); 14 Sep 2012 10:55:41 -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 Sep 2012 10:55: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 1TCTYi-00016R-IV
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYi-0000rO-HH
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:40 +0000
Message-Id: <E1TCTYi-0000rO-HH@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:40 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Update comments now that Xen
	is always 64-bit.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Tim Deegan <tim@xen.org>
# Date 1347550893 -3600
# Node ID b3e6de36c91e9466498946cbb9a9e71c4efd5eae
# Parent  8bb4bc335ebbbeaa31960cc7d9bd3e8c49660f86
x86/mm: Update comments now that Xen is always 64-bit.

Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 8bb4bc335ebb -r b3e6de36c91e xen/arch/x86/mm/shadow/common.c
--- a/xen/arch/x86/mm/shadow/common.c	Thu Sep 13 16:41:33 2012 +0100
+++ b/xen/arch/x86/mm/shadow/common.c	Thu Sep 13 16:41:33 2012 +0100
@@ -1178,19 +1178,19 @@ int shadow_cmpxchg_guest_entry(struct vc
  *    
  * This table shows the allocation behaviour of the different modes:
  *
- * Xen paging      pae  pae  64b  64b  64b
- * Guest paging    32b  pae  32b  pae  64b
- * PV or HVM       HVM   *   HVM  HVM   * 
- * Shadow paging   pae  pae  pae  pae  64b
+ * Xen paging      64b  64b  64b
+ * Guest paging    32b  pae  64b
+ * PV or HVM       HVM  HVM   * 
+ * Shadow paging   pae  pae  64b
  *
- * sl1 size         8k   4k   8k   4k   4k
- * sl2 size        16k   4k  16k   4k   4k
- * sl3 size         -    -    -    -    4k
- * sl4 size         -    -    -    -    4k
+ * sl1 size         8k   4k   4k
+ * sl2 size        16k   4k   4k
+ * sl3 size         -    -    4k
+ * sl4 size         -    -    4k
  *
  * In HVM guests, the p2m table is built out of shadow pages, and we provide 
  * a function for the p2m management to steal pages, in max-order chunks, from 
- * the free pool.  We don't provide for giving them back, yet.
+ * the free pool.
  */
 
 /* Figure out the least acceptable quantity of shadow memory.

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:45 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYm-0003r2-SS; Fri, 14 Sep 2012 10:55:44 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYl-0003nu-Kj
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:43 +0000
Received: from [85.158.139.83:52484] by server-6.bemta-5.messagelabs.com id
	F6/55-21336-E2D03505; Fri, 14 Sep 2012 10:55:42 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1347620140!29827276!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12967 invoked from network); 14 Sep 2012 10:55:41 -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 Sep 2012 10:55: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 1TCTYi-00016R-IV
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYi-0000rO-HH
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:40 +0000
Message-Id: <E1TCTYi-0000rO-HH@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:40 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Update comments now that Xen
	is always 64-bit.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Tim Deegan <tim@xen.org>
# Date 1347550893 -3600
# Node ID b3e6de36c91e9466498946cbb9a9e71c4efd5eae
# Parent  8bb4bc335ebbbeaa31960cc7d9bd3e8c49660f86
x86/mm: Update comments now that Xen is always 64-bit.

Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 8bb4bc335ebb -r b3e6de36c91e xen/arch/x86/mm/shadow/common.c
--- a/xen/arch/x86/mm/shadow/common.c	Thu Sep 13 16:41:33 2012 +0100
+++ b/xen/arch/x86/mm/shadow/common.c	Thu Sep 13 16:41:33 2012 +0100
@@ -1178,19 +1178,19 @@ int shadow_cmpxchg_guest_entry(struct vc
  *    
  * This table shows the allocation behaviour of the different modes:
  *
- * Xen paging      pae  pae  64b  64b  64b
- * Guest paging    32b  pae  32b  pae  64b
- * PV or HVM       HVM   *   HVM  HVM   * 
- * Shadow paging   pae  pae  pae  pae  64b
+ * Xen paging      64b  64b  64b
+ * Guest paging    32b  pae  64b
+ * PV or HVM       HVM  HVM   * 
+ * Shadow paging   pae  pae  64b
  *
- * sl1 size         8k   4k   8k   4k   4k
- * sl2 size        16k   4k  16k   4k   4k
- * sl3 size         -    -    -    -    4k
- * sl4 size         -    -    -    -    4k
+ * sl1 size         8k   4k   4k
+ * sl2 size        16k   4k   4k
+ * sl3 size         -    -    4k
+ * sl4 size         -    -    4k
  *
  * In HVM guests, the p2m table is built out of shadow pages, and we provide 
  * a function for the p2m management to steal pages, in max-order chunks, from 
- * the free pool.  We don't provide for giving them back, yet.
+ * the free pool.
  */
 
 /* Figure out the least acceptable quantity of shadow memory.

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:45 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYm-0003rI-Uy; Fri, 14 Sep 2012 10:55:44 +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 1TCTYl-0003mb-Dk
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:43 +0000
Received: from [85.158.137.99:20827] by server-5.bemta-3.messagelabs.com id
	E2/E4-13133-E2D03505; Fri, 14 Sep 2012 10:55:42 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-217.messagelabs.com!1347620139!16463604!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10955 invoked from network); 14 Sep 2012 10:55:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Sep 2012 10: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 1TCTYh-00016H-Ep
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYh-0000qu-DV
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:39 +0000
Message-Id: <E1TCTYh-0000qu-DV@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:38 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] amd iommu: use PCI macros
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347524597 -7200
# Node ID 5691e4cc17da7fe8664a67f1d07c3755c0ca34ed
# Parent  3afa736ba7a57766c5ed72835e8d97affc951771
amd iommu: use PCI macros

... instead of open coding them.

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


diff -r 3afa736ba7a5 -r 5691e4cc17da xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c	Wed Sep 12 20:54:23 2012 +0100
+++ b/xen/drivers/passthrough/amd/iommu_init.c	Thu Sep 13 10:23:17 2012 +0200
@@ -455,9 +455,9 @@ static void iommu_msi_set_affinity(struc
     unsigned int dest;
     struct amd_iommu *iommu = desc->action->dev_id;
     u16 seg = iommu->seg;
-    u8 bus = (iommu->bdf >> 8) & 0xff;
-    u8 dev = PCI_SLOT(iommu->bdf & 0xff);
-    u8 func = PCI_FUNC(iommu->bdf & 0xff);
+    u8 bus = PCI_BUS(iommu->bdf);
+    u8 dev = PCI_SLOT(iommu->bdf);
+    u8 func = PCI_FUNC(iommu->bdf);
 
     dest = set_desc_affinity(desc, mask);
 
@@ -495,13 +495,13 @@ static void iommu_msi_set_affinity(struc
 static void amd_iommu_msi_enable(struct amd_iommu *iommu, int flag)
 {
     u16 control;
-    int bus = (iommu->bdf >> 8) & 0xff;
-    int dev = PCI_SLOT(iommu->bdf & 0xff);
-    int func = PCI_FUNC(iommu->bdf & 0xff);
+    int bus = PCI_BUS(iommu->bdf);
+    int dev = PCI_SLOT(iommu->bdf);
+    int func = PCI_FUNC(iommu->bdf);
 
     control = pci_conf_read16(iommu->seg, bus, dev, func,
         iommu->msi_cap + PCI_MSI_FLAGS);
-    control &= ~(1);
+    control &= ~PCI_MSI_FLAGS_ENABLE;
     if ( flag )
         control |= flag;
     pci_conf_write16(iommu->seg, bus, dev, func,
diff -r 3afa736ba7a5 -r 5691e4cc17da xen/drivers/passthrough/amd/iommu_intr.c
--- a/xen/drivers/passthrough/amd/iommu_intr.c	Wed Sep 12 20:54:23 2012 +0100
+++ b/xen/drivers/passthrough/amd/iommu_intr.c	Thu Sep 13 10:23:17 2012 +0200
@@ -272,7 +272,7 @@ static void update_intremap_entry_from_m
     spinlock_t *lock;
     int offset;
 
-    bdf = (pdev->bus << 8) | pdev->devfn;
+    bdf = PCI_BDF2(pdev->bus, pdev->devfn);
     req_id = get_dma_requestor_id(pdev->seg, bdf);
     alias_id = get_intremap_requestor_id(pdev->seg, bdf);
 
@@ -340,17 +340,16 @@ void amd_iommu_msi_msg_update_ire(
     struct msi_desc *msi_desc, struct msi_msg *msg)
 {
     struct pci_dev *pdev = msi_desc->dev;
-    struct amd_iommu *iommu = NULL;
+    int bdf = PCI_BDF2(pdev->bus, pdev->devfn);
+    struct amd_iommu *iommu;
 
     if ( !iommu_intremap )
         return;
 
-    iommu = find_iommu_for_device(pdev->seg, (pdev->bus << 8) | pdev->devfn);
-
+    iommu = find_iommu_for_device(pdev->seg, bdf);
     if ( !iommu )
     {
-        AMD_IOMMU_DEBUG("Fail to find iommu for MSI device id = 0x%x\n",
-                       (pdev->bus << 8) | pdev->devfn);
+        AMD_IOMMU_DEBUG("Fail to find iommu for MSI device id = %#x\n", bdf);
         return;
     }
 
diff -r 3afa736ba7a5 -r 5691e4cc17da xen/drivers/passthrough/amd/iommu_map.c
--- a/xen/drivers/passthrough/amd/iommu_map.c	Wed Sep 12 20:54:23 2012 +0100
+++ b/xen/drivers/passthrough/amd/iommu_map.c	Thu Sep 13 10:23:17 2012 +0200
@@ -597,7 +597,7 @@ static int update_paging_mode(struct dom
         /* Update device table entries using new root table and paging mode */
         for_each_pdev( d, pdev )
         {
-            bdf = (pdev->bus << 8) | pdev->devfn;
+            bdf = PCI_BDF2(pdev->bus, pdev->devfn);
             req_id = get_dma_requestor_id(pdev->seg, bdf);
             iommu = find_iommu_for_device(pdev->seg, bdf);
             if ( !iommu )
diff -r 3afa736ba7a5 -r 5691e4cc17da xen/drivers/passthrough/amd/pci_amd_iommu.c
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c	Wed Sep 12 20:54:23 2012 +0100
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c	Thu Sep 13 10:23:17 2012 +0200
@@ -373,7 +373,7 @@ static int reassign_device( struct domai
 static int amd_iommu_assign_device(struct domain *d, u16 seg, u8 bus, u8 devfn)
 {
     struct ivrs_mappings *ivrs_mappings = get_ivrs_mappings(seg);
-    int bdf = (bus << 8) | devfn;
+    int bdf = PCI_BDF2(bus, devfn);
     int req_id = get_dma_requestor_id(seg, bdf);
 
     if ( ivrs_mappings[req_id].unity_map_enable )
@@ -499,12 +499,9 @@ static int amd_iommu_remove_device(struc
 
 static int amd_iommu_group_id(u16 seg, u8 bus, u8 devfn)
 {
-    int rt;
-    int bdf = (bus << 8) | devfn;
-    rt = ( bdf < ivrs_bdf_entries ) ?
-        get_dma_requestor_id(seg, bdf) :
-        bdf;
-    return rt;
+    int bdf = PCI_BDF2(bus, devfn);
+
+    return (bdf < ivrs_bdf_entries) ? get_dma_requestor_id(seg, bdf) : bdf;
 }
 
 #include <asm/io_apic.h>

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:45 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYm-0003rI-Uy; Fri, 14 Sep 2012 10:55:44 +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 1TCTYl-0003mb-Dk
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:43 +0000
Received: from [85.158.137.99:20827] by server-5.bemta-3.messagelabs.com id
	E2/E4-13133-E2D03505; Fri, 14 Sep 2012 10:55:42 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-217.messagelabs.com!1347620139!16463604!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10955 invoked from network); 14 Sep 2012 10:55:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Sep 2012 10: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 1TCTYh-00016H-Ep
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYh-0000qu-DV
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:39 +0000
Message-Id: <E1TCTYh-0000qu-DV@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:38 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] amd iommu: use PCI macros
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347524597 -7200
# Node ID 5691e4cc17da7fe8664a67f1d07c3755c0ca34ed
# Parent  3afa736ba7a57766c5ed72835e8d97affc951771
amd iommu: use PCI macros

... instead of open coding them.

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


diff -r 3afa736ba7a5 -r 5691e4cc17da xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c	Wed Sep 12 20:54:23 2012 +0100
+++ b/xen/drivers/passthrough/amd/iommu_init.c	Thu Sep 13 10:23:17 2012 +0200
@@ -455,9 +455,9 @@ static void iommu_msi_set_affinity(struc
     unsigned int dest;
     struct amd_iommu *iommu = desc->action->dev_id;
     u16 seg = iommu->seg;
-    u8 bus = (iommu->bdf >> 8) & 0xff;
-    u8 dev = PCI_SLOT(iommu->bdf & 0xff);
-    u8 func = PCI_FUNC(iommu->bdf & 0xff);
+    u8 bus = PCI_BUS(iommu->bdf);
+    u8 dev = PCI_SLOT(iommu->bdf);
+    u8 func = PCI_FUNC(iommu->bdf);
 
     dest = set_desc_affinity(desc, mask);
 
@@ -495,13 +495,13 @@ static void iommu_msi_set_affinity(struc
 static void amd_iommu_msi_enable(struct amd_iommu *iommu, int flag)
 {
     u16 control;
-    int bus = (iommu->bdf >> 8) & 0xff;
-    int dev = PCI_SLOT(iommu->bdf & 0xff);
-    int func = PCI_FUNC(iommu->bdf & 0xff);
+    int bus = PCI_BUS(iommu->bdf);
+    int dev = PCI_SLOT(iommu->bdf);
+    int func = PCI_FUNC(iommu->bdf);
 
     control = pci_conf_read16(iommu->seg, bus, dev, func,
         iommu->msi_cap + PCI_MSI_FLAGS);
-    control &= ~(1);
+    control &= ~PCI_MSI_FLAGS_ENABLE;
     if ( flag )
         control |= flag;
     pci_conf_write16(iommu->seg, bus, dev, func,
diff -r 3afa736ba7a5 -r 5691e4cc17da xen/drivers/passthrough/amd/iommu_intr.c
--- a/xen/drivers/passthrough/amd/iommu_intr.c	Wed Sep 12 20:54:23 2012 +0100
+++ b/xen/drivers/passthrough/amd/iommu_intr.c	Thu Sep 13 10:23:17 2012 +0200
@@ -272,7 +272,7 @@ static void update_intremap_entry_from_m
     spinlock_t *lock;
     int offset;
 
-    bdf = (pdev->bus << 8) | pdev->devfn;
+    bdf = PCI_BDF2(pdev->bus, pdev->devfn);
     req_id = get_dma_requestor_id(pdev->seg, bdf);
     alias_id = get_intremap_requestor_id(pdev->seg, bdf);
 
@@ -340,17 +340,16 @@ void amd_iommu_msi_msg_update_ire(
     struct msi_desc *msi_desc, struct msi_msg *msg)
 {
     struct pci_dev *pdev = msi_desc->dev;
-    struct amd_iommu *iommu = NULL;
+    int bdf = PCI_BDF2(pdev->bus, pdev->devfn);
+    struct amd_iommu *iommu;
 
     if ( !iommu_intremap )
         return;
 
-    iommu = find_iommu_for_device(pdev->seg, (pdev->bus << 8) | pdev->devfn);
-
+    iommu = find_iommu_for_device(pdev->seg, bdf);
     if ( !iommu )
     {
-        AMD_IOMMU_DEBUG("Fail to find iommu for MSI device id = 0x%x\n",
-                       (pdev->bus << 8) | pdev->devfn);
+        AMD_IOMMU_DEBUG("Fail to find iommu for MSI device id = %#x\n", bdf);
         return;
     }
 
diff -r 3afa736ba7a5 -r 5691e4cc17da xen/drivers/passthrough/amd/iommu_map.c
--- a/xen/drivers/passthrough/amd/iommu_map.c	Wed Sep 12 20:54:23 2012 +0100
+++ b/xen/drivers/passthrough/amd/iommu_map.c	Thu Sep 13 10:23:17 2012 +0200
@@ -597,7 +597,7 @@ static int update_paging_mode(struct dom
         /* Update device table entries using new root table and paging mode */
         for_each_pdev( d, pdev )
         {
-            bdf = (pdev->bus << 8) | pdev->devfn;
+            bdf = PCI_BDF2(pdev->bus, pdev->devfn);
             req_id = get_dma_requestor_id(pdev->seg, bdf);
             iommu = find_iommu_for_device(pdev->seg, bdf);
             if ( !iommu )
diff -r 3afa736ba7a5 -r 5691e4cc17da xen/drivers/passthrough/amd/pci_amd_iommu.c
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c	Wed Sep 12 20:54:23 2012 +0100
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c	Thu Sep 13 10:23:17 2012 +0200
@@ -373,7 +373,7 @@ static int reassign_device( struct domai
 static int amd_iommu_assign_device(struct domain *d, u16 seg, u8 bus, u8 devfn)
 {
     struct ivrs_mappings *ivrs_mappings = get_ivrs_mappings(seg);
-    int bdf = (bus << 8) | devfn;
+    int bdf = PCI_BDF2(bus, devfn);
     int req_id = get_dma_requestor_id(seg, bdf);
 
     if ( ivrs_mappings[req_id].unity_map_enable )
@@ -499,12 +499,9 @@ static int amd_iommu_remove_device(struc
 
 static int amd_iommu_group_id(u16 seg, u8 bus, u8 devfn)
 {
-    int rt;
-    int bdf = (bus << 8) | devfn;
-    rt = ( bdf < ivrs_bdf_entries ) ?
-        get_dma_requestor_id(seg, bdf) :
-        bdf;
-    return rt;
+    int bdf = PCI_BDF2(bus, devfn);
+
+    return (bdf < ivrs_bdf_entries) ? get_dma_requestor_id(seg, bdf) : bdf;
 }
 
 #include <asm/io_apic.h>

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:45 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYn-0003rY-1Q; Fri, 14 Sep 2012 10:55:45 +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 1TCTYl-0003oJ-Lz
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:44 +0000
Received: from [85.158.137.99:63130] by server-9.bemta-3.messagelabs.com id
	39/5A-15390-E2D03505; Fri, 14 Sep 2012 10:55:42 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-217.messagelabs.com!1347620140!17663472!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14915 invoked from network); 14 Sep 2012 10:55:41 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Sep 2012 10:55: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 1TCTYi-00016N-16
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYh-0000r9-Vk
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:39 +0000
Message-Id: <E1TCTYh-0000r9-Vk@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:39 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: remove the linear mapping of
	the p2m tables.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Tim Deegan <tim@xen.org>
# Date 1347550893 -3600
# Node ID 8bb4bc335ebbbeaa31960cc7d9bd3e8c49660f86
# Parent  5691e4cc17da7fe8664a67f1d07c3755c0ca34ed
x86/mm: remove the linear mapping of the p2m tables.

Mapping the p2m into the monitor tables was an important optimization
on 32-bit builds, where it avoided mapping and unmapping p2m pages
during a walk.  On 64-bit it makes no difference -- see
http://old-list-archives.xen.org/archives/html/xen-devel/2010-04/msg00981.html
Get rid of it, and use the explicit walk for all lookups.

Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 5691e4cc17da -r 8bb4bc335ebb xen/arch/x86/mm/hap/hap.c
--- a/xen/arch/x86/mm/hap/hap.c	Thu Sep 13 10:23:17 2012 +0200
+++ b/xen/arch/x86/mm/hap/hap.c	Thu Sep 13 16:41:33 2012 +0100
@@ -405,11 +405,6 @@ static void hap_install_xen_entries_in_l
     l4e[l4_table_offset(LINEAR_PT_VIRT_START)] =
         l4e_from_pfn(mfn_x(l4mfn), __PAGE_HYPERVISOR);
 
-    /* Install the domain-specific P2M table */
-    l4e[l4_table_offset(RO_MPT_VIRT_START)] =
-        l4e_from_pfn(mfn_x(pagetable_get_mfn(p2m_get_pagetable(p2m_get_hostp2m(d)))),
-                     __PAGE_HYPERVISOR);
-
     hap_unmap_domain_page(l4e);
 }
 
diff -r 5691e4cc17da -r 8bb4bc335ebb xen/arch/x86/mm/p2m-pt.c
--- a/xen/arch/x86/mm/p2m-pt.c	Thu Sep 13 10:23:17 2012 +0200
+++ b/xen/arch/x86/mm/p2m-pt.c	Thu Sep 13 16:41:33 2012 +0100
@@ -460,186 +460,6 @@ out:
     return rv;
 }
 
-
-/* Read the current domain's p2m table (through the linear mapping). */
-static mfn_t p2m_gfn_to_mfn_current(struct p2m_domain *p2m, 
-                                    unsigned long gfn, p2m_type_t *t, 
-                                    p2m_access_t *a, p2m_query_t q,
-                                    unsigned int *page_order)
-{
-    mfn_t mfn = _mfn(INVALID_MFN);
-    p2m_type_t p2mt = p2m_mmio_dm;
-    paddr_t addr = ((paddr_t)gfn) << PAGE_SHIFT;
-    /* XXX This is for compatibility with the old model, where anything not 
-     * XXX marked as RAM was considered to be emulated MMIO space.
-     * XXX Once we start explicitly registering MMIO regions in the p2m 
-     * XXX we will return p2m_invalid for unmapped gfns */
-
-    l1_pgentry_t l1e = l1e_empty(), *p2m_entry;
-    l2_pgentry_t l2e = l2e_empty();
-    l3_pgentry_t l3e = l3e_empty();
-    int ret;
-
-    ASSERT(gfn < (RO_MPT_VIRT_END - RO_MPT_VIRT_START) 
-           / sizeof(l1_pgentry_t));
-
-    /*
-     * Read & process L3
-     */
-    p2m_entry = (l1_pgentry_t *)
-        &__linear_l2_table[l2_linear_offset(RO_MPT_VIRT_START)
-                           + l3_linear_offset(addr)];
-pod_retry_l3:
-    ret = __copy_from_user(&l3e, p2m_entry, sizeof(l3e));
-
-    if ( ret != 0 || !(l3e_get_flags(l3e) & _PAGE_PRESENT) )
-    {
-        if ( (l3e_get_flags(l3e) & _PAGE_PSE) &&
-             (p2m_flags_to_type(l3e_get_flags(l3e)) == p2m_populate_on_demand) )
-        {
-            /* The read has succeeded, so we know that mapping exists */
-            if ( q & P2M_ALLOC )
-            {
-                if ( !p2m_pod_demand_populate(p2m, gfn, PAGE_ORDER_1G, q) )
-                    goto pod_retry_l3;
-                p2mt = p2m_invalid;
-                gdprintk(XENLOG_ERR, "%s: Allocate 1GB failed!\n", __func__);
-                goto out;
-            }
-            else
-            {
-                p2mt = p2m_populate_on_demand;
-                goto out;
-            }
-        }
-        goto pod_retry_l2;
-    }
-
-    if ( l3e_get_flags(l3e) & _PAGE_PSE )
-    {
-        p2mt = p2m_flags_to_type(l3e_get_flags(l3e));
-        ASSERT(l3e_get_pfn(l3e) != INVALID_MFN || !p2m_is_ram(p2mt));
-        if (p2m_is_valid(p2mt) )
-            mfn = _mfn(l3e_get_pfn(l3e) + 
-                       l2_table_offset(addr) * L1_PAGETABLE_ENTRIES + 
-                       l1_table_offset(addr));
-        else
-            p2mt = p2m_mmio_dm;
-            
-        if ( page_order )
-            *page_order = PAGE_ORDER_1G;
-        goto out;
-    }
-
-    /*
-     * Read & process L2
-     */
-    p2m_entry = &__linear_l1_table[l1_linear_offset(RO_MPT_VIRT_START)
-                                   + l2_linear_offset(addr)];
-
-pod_retry_l2:
-    ret = __copy_from_user(&l2e,
-                           p2m_entry,
-                           sizeof(l2e));
-    if ( ret != 0
-         || !(l2e_get_flags(l2e) & _PAGE_PRESENT) )
-    {
-        if( (l2e_get_flags(l2e) & _PAGE_PSE)
-            && ( p2m_flags_to_type(l2e_get_flags(l2e))
-                 == p2m_populate_on_demand ) )
-        {
-            /* The read has succeeded, so we know that the mapping
-             * exits at this point.  */
-            if ( q & P2M_ALLOC )
-            {
-                if ( !p2m_pod_demand_populate(p2m, gfn, 
-                                                PAGE_ORDER_2M, q) )
-                    goto pod_retry_l2;
-
-                /* Allocate failed. */
-                p2mt = p2m_invalid;
-                printk("%s: Allocate failed!\n", __func__);
-                goto out;
-            }
-            else
-            {
-                p2mt = p2m_populate_on_demand;
-                goto out;
-            }
-        }
-
-        goto pod_retry_l1;
-    }
-        
-    if (l2e_get_flags(l2e) & _PAGE_PSE)
-    {
-        p2mt = p2m_flags_to_type(l2e_get_flags(l2e));
-        ASSERT(l2e_get_pfn(l2e) != INVALID_MFN || !p2m_is_ram(p2mt));
-
-        if ( p2m_is_valid(p2mt) )
-            mfn = _mfn(l2e_get_pfn(l2e) + l1_table_offset(addr));
-        else
-            p2mt = p2m_mmio_dm;
-
-        if ( page_order )
-            *page_order = PAGE_ORDER_2M;
-        goto out;
-    }
-
-    /*
-     * Read and process L1
-     */
-
-    /* Need to __copy_from_user because the p2m is sparse and this
-     * part might not exist */
-pod_retry_l1:
-    p2m_entry = &phys_to_machine_mapping[gfn];
-
-    ret = __copy_from_user(&l1e,
-                           p2m_entry,
-                           sizeof(l1e));
-            
-    if ( ret == 0 ) {
-        unsigned long l1e_mfn = l1e_get_pfn(l1e);
-        p2mt = p2m_flags_to_type(l1e_get_flags(l1e));
-        ASSERT( mfn_valid(_mfn(l1e_mfn)) || !p2m_is_ram(p2mt) ||
-                p2m_is_paging(p2mt) );
-
-        if ( p2mt == p2m_populate_on_demand )
-        {
-            /* The read has succeeded, so we know that the mapping
-             * exits at this point.  */
-            if ( q & P2M_ALLOC )
-            {
-                if ( !p2m_pod_demand_populate(p2m, gfn, 
-                                                PAGE_ORDER_4K, q) )
-                    goto pod_retry_l1;
-
-                /* Allocate failed. */
-                p2mt = p2m_invalid;
-                goto out;
-            }
-            else
-            {
-                p2mt = p2m_populate_on_demand;
-                goto out;
-            }
-        }
-
-        if ( p2m_is_valid(p2mt) || p2m_is_grant(p2mt) )
-            mfn = _mfn(l1e_mfn);
-        else 
-            /* XXX see above */
-            p2mt = p2m_mmio_dm;
-    }
-    
-    if ( page_order )
-        *page_order = PAGE_ORDER_4K;
-out:
-    *t = p2mt;
-    return mfn;
-}
-
 static mfn_t
 p2m_gfn_to_mfn(struct p2m_domain *p2m, unsigned long gfn, 
                p2m_type_t *t, p2m_access_t *a, p2m_query_t q,
@@ -666,10 +486,6 @@ p2m_gfn_to_mfn(struct p2m_domain *p2m, u
         /* This pfn is higher than the highest the p2m map currently holds */
         return _mfn(INVALID_MFN);
 
-    /* Use the fast path with the linear mapping if we can */
-    if ( p2m == p2m_get_hostp2m(current->domain) )
-        return p2m_gfn_to_mfn_current(p2m, gfn, t, a, q, page_order);
-
     mfn = pagetable_get_mfn(p2m_get_pagetable(p2m));
 
     {
@@ -904,17 +720,10 @@ long p2m_pt_audit_p2m(struct p2m_domain 
 {
     unsigned long entry_count = 0, pmbad = 0;
     unsigned long mfn, gfn, m2pfn;
-    int test_linear;
-    struct domain *d = p2m->domain;
 
     ASSERT(p2m_locked_by_me(p2m));
     ASSERT(pod_locked_by_me(p2m));
 
-    test_linear = ( (d == current->domain)
-                    && !pagetable_is_null(current->arch.monitor_table) );
-    if ( test_linear )
-        flush_tlb_local();
-
     /* Audit part one: walk the domain's p2m table, checking the entries. */
     if ( pagetable_get_pfn(p2m_get_pagetable(p2m)) != 0 )
     {
diff -r 5691e4cc17da -r 8bb4bc335ebb xen/arch/x86/mm/shadow/multi.c
--- a/xen/arch/x86/mm/shadow/multi.c	Thu Sep 13 10:23:17 2012 +0200
+++ b/xen/arch/x86/mm/shadow/multi.c	Thu Sep 13 16:41:33 2012 +0100
@@ -1472,14 +1472,6 @@ void sh_install_xen_entries_in_l4(struct
             shadow_l4e_from_mfn(gl4mfn, __PAGE_HYPERVISOR);
     }
 
-    if ( shadow_mode_translate(v->domain) )
-    {
-        /* install domain-specific P2M table */
-        sl4e[shadow_l4_table_offset(RO_MPT_VIRT_START)] =
-            shadow_l4e_from_mfn(pagetable_get_mfn(p2m_get_pagetable(p2m_get_hostp2m(d))),
-                                __PAGE_HYPERVISOR);
-    }
-
     sh_unmap_domain_page(sl4e);    
 }
 #endif
diff -r 5691e4cc17da -r 8bb4bc335ebb xen/include/asm-x86/p2m.h
--- a/xen/include/asm-x86/p2m.h	Thu Sep 13 10:23:17 2012 +0200
+++ b/xen/include/asm-x86/p2m.h	Thu Sep 13 16:41:33 2012 +0100
@@ -35,22 +35,6 @@
 extern bool_t opt_hap_1gb, opt_hap_2mb;
 
 /*
- * The phys_to_machine_mapping maps guest physical frame numbers 
- * to machine frame numbers.  It only exists for paging_mode_translate 
- * guests. It is organised in page-table format, which:
- *
- * (1) allows us to use it directly as the second pagetable in hardware-
- *     assisted paging and (hopefully) iommu support; and 
- * (2) lets us map it directly into the guest vcpus' virtual address space 
- *     as a linear pagetable, so we can read and write it easily.
- *
- * For (2) we steal the address space that would have normally been used
- * by the read-only MPT map in a non-translated guest.  (For 
- * paging_mode_external() guests this mapping is in the monitor table.)
- */
-#define phys_to_machine_mapping ((l1_pgentry_t *)RO_MPT_VIRT_START)
-
-/*
  * The upper levels of the p2m pagetable always contain full rights; all 
  * variation in the access control bits is made in the level-1 PTEs.
  * 

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:45 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYn-0003rY-1Q; Fri, 14 Sep 2012 10:55:45 +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 1TCTYl-0003oJ-Lz
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:44 +0000
Received: from [85.158.137.99:63130] by server-9.bemta-3.messagelabs.com id
	39/5A-15390-E2D03505; Fri, 14 Sep 2012 10:55:42 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-217.messagelabs.com!1347620140!17663472!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14915 invoked from network); 14 Sep 2012 10:55:41 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Sep 2012 10:55: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 1TCTYi-00016N-16
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYh-0000r9-Vk
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:39 +0000
Message-Id: <E1TCTYh-0000r9-Vk@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:39 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: remove the linear mapping of
	the p2m tables.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Tim Deegan <tim@xen.org>
# Date 1347550893 -3600
# Node ID 8bb4bc335ebbbeaa31960cc7d9bd3e8c49660f86
# Parent  5691e4cc17da7fe8664a67f1d07c3755c0ca34ed
x86/mm: remove the linear mapping of the p2m tables.

Mapping the p2m into the monitor tables was an important optimization
on 32-bit builds, where it avoided mapping and unmapping p2m pages
during a walk.  On 64-bit it makes no difference -- see
http://old-list-archives.xen.org/archives/html/xen-devel/2010-04/msg00981.html
Get rid of it, and use the explicit walk for all lookups.

Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 5691e4cc17da -r 8bb4bc335ebb xen/arch/x86/mm/hap/hap.c
--- a/xen/arch/x86/mm/hap/hap.c	Thu Sep 13 10:23:17 2012 +0200
+++ b/xen/arch/x86/mm/hap/hap.c	Thu Sep 13 16:41:33 2012 +0100
@@ -405,11 +405,6 @@ static void hap_install_xen_entries_in_l
     l4e[l4_table_offset(LINEAR_PT_VIRT_START)] =
         l4e_from_pfn(mfn_x(l4mfn), __PAGE_HYPERVISOR);
 
-    /* Install the domain-specific P2M table */
-    l4e[l4_table_offset(RO_MPT_VIRT_START)] =
-        l4e_from_pfn(mfn_x(pagetable_get_mfn(p2m_get_pagetable(p2m_get_hostp2m(d)))),
-                     __PAGE_HYPERVISOR);
-
     hap_unmap_domain_page(l4e);
 }
 
diff -r 5691e4cc17da -r 8bb4bc335ebb xen/arch/x86/mm/p2m-pt.c
--- a/xen/arch/x86/mm/p2m-pt.c	Thu Sep 13 10:23:17 2012 +0200
+++ b/xen/arch/x86/mm/p2m-pt.c	Thu Sep 13 16:41:33 2012 +0100
@@ -460,186 +460,6 @@ out:
     return rv;
 }
 
-
-/* Read the current domain's p2m table (through the linear mapping). */
-static mfn_t p2m_gfn_to_mfn_current(struct p2m_domain *p2m, 
-                                    unsigned long gfn, p2m_type_t *t, 
-                                    p2m_access_t *a, p2m_query_t q,
-                                    unsigned int *page_order)
-{
-    mfn_t mfn = _mfn(INVALID_MFN);
-    p2m_type_t p2mt = p2m_mmio_dm;
-    paddr_t addr = ((paddr_t)gfn) << PAGE_SHIFT;
-    /* XXX This is for compatibility with the old model, where anything not 
-     * XXX marked as RAM was considered to be emulated MMIO space.
-     * XXX Once we start explicitly registering MMIO regions in the p2m 
-     * XXX we will return p2m_invalid for unmapped gfns */
-
-    l1_pgentry_t l1e = l1e_empty(), *p2m_entry;
-    l2_pgentry_t l2e = l2e_empty();
-    l3_pgentry_t l3e = l3e_empty();
-    int ret;
-
-    ASSERT(gfn < (RO_MPT_VIRT_END - RO_MPT_VIRT_START) 
-           / sizeof(l1_pgentry_t));
-
-    /*
-     * Read & process L3
-     */
-    p2m_entry = (l1_pgentry_t *)
-        &__linear_l2_table[l2_linear_offset(RO_MPT_VIRT_START)
-                           + l3_linear_offset(addr)];
-pod_retry_l3:
-    ret = __copy_from_user(&l3e, p2m_entry, sizeof(l3e));
-
-    if ( ret != 0 || !(l3e_get_flags(l3e) & _PAGE_PRESENT) )
-    {
-        if ( (l3e_get_flags(l3e) & _PAGE_PSE) &&
-             (p2m_flags_to_type(l3e_get_flags(l3e)) == p2m_populate_on_demand) )
-        {
-            /* The read has succeeded, so we know that mapping exists */
-            if ( q & P2M_ALLOC )
-            {
-                if ( !p2m_pod_demand_populate(p2m, gfn, PAGE_ORDER_1G, q) )
-                    goto pod_retry_l3;
-                p2mt = p2m_invalid;
-                gdprintk(XENLOG_ERR, "%s: Allocate 1GB failed!\n", __func__);
-                goto out;
-            }
-            else
-            {
-                p2mt = p2m_populate_on_demand;
-                goto out;
-            }
-        }
-        goto pod_retry_l2;
-    }
-
-    if ( l3e_get_flags(l3e) & _PAGE_PSE )
-    {
-        p2mt = p2m_flags_to_type(l3e_get_flags(l3e));
-        ASSERT(l3e_get_pfn(l3e) != INVALID_MFN || !p2m_is_ram(p2mt));
-        if (p2m_is_valid(p2mt) )
-            mfn = _mfn(l3e_get_pfn(l3e) + 
-                       l2_table_offset(addr) * L1_PAGETABLE_ENTRIES + 
-                       l1_table_offset(addr));
-        else
-            p2mt = p2m_mmio_dm;
-            
-        if ( page_order )
-            *page_order = PAGE_ORDER_1G;
-        goto out;
-    }
-
-    /*
-     * Read & process L2
-     */
-    p2m_entry = &__linear_l1_table[l1_linear_offset(RO_MPT_VIRT_START)
-                                   + l2_linear_offset(addr)];
-
-pod_retry_l2:
-    ret = __copy_from_user(&l2e,
-                           p2m_entry,
-                           sizeof(l2e));
-    if ( ret != 0
-         || !(l2e_get_flags(l2e) & _PAGE_PRESENT) )
-    {
-        if( (l2e_get_flags(l2e) & _PAGE_PSE)
-            && ( p2m_flags_to_type(l2e_get_flags(l2e))
-                 == p2m_populate_on_demand ) )
-        {
-            /* The read has succeeded, so we know that the mapping
-             * exits at this point.  */
-            if ( q & P2M_ALLOC )
-            {
-                if ( !p2m_pod_demand_populate(p2m, gfn, 
-                                                PAGE_ORDER_2M, q) )
-                    goto pod_retry_l2;
-
-                /* Allocate failed. */
-                p2mt = p2m_invalid;
-                printk("%s: Allocate failed!\n", __func__);
-                goto out;
-            }
-            else
-            {
-                p2mt = p2m_populate_on_demand;
-                goto out;
-            }
-        }
-
-        goto pod_retry_l1;
-    }
-        
-    if (l2e_get_flags(l2e) & _PAGE_PSE)
-    {
-        p2mt = p2m_flags_to_type(l2e_get_flags(l2e));
-        ASSERT(l2e_get_pfn(l2e) != INVALID_MFN || !p2m_is_ram(p2mt));
-
-        if ( p2m_is_valid(p2mt) )
-            mfn = _mfn(l2e_get_pfn(l2e) + l1_table_offset(addr));
-        else
-            p2mt = p2m_mmio_dm;
-
-        if ( page_order )
-            *page_order = PAGE_ORDER_2M;
-        goto out;
-    }
-
-    /*
-     * Read and process L1
-     */
-
-    /* Need to __copy_from_user because the p2m is sparse and this
-     * part might not exist */
-pod_retry_l1:
-    p2m_entry = &phys_to_machine_mapping[gfn];
-
-    ret = __copy_from_user(&l1e,
-                           p2m_entry,
-                           sizeof(l1e));
-            
-    if ( ret == 0 ) {
-        unsigned long l1e_mfn = l1e_get_pfn(l1e);
-        p2mt = p2m_flags_to_type(l1e_get_flags(l1e));
-        ASSERT( mfn_valid(_mfn(l1e_mfn)) || !p2m_is_ram(p2mt) ||
-                p2m_is_paging(p2mt) );
-
-        if ( p2mt == p2m_populate_on_demand )
-        {
-            /* The read has succeeded, so we know that the mapping
-             * exits at this point.  */
-            if ( q & P2M_ALLOC )
-            {
-                if ( !p2m_pod_demand_populate(p2m, gfn, 
-                                                PAGE_ORDER_4K, q) )
-                    goto pod_retry_l1;
-
-                /* Allocate failed. */
-                p2mt = p2m_invalid;
-                goto out;
-            }
-            else
-            {
-                p2mt = p2m_populate_on_demand;
-                goto out;
-            }
-        }
-
-        if ( p2m_is_valid(p2mt) || p2m_is_grant(p2mt) )
-            mfn = _mfn(l1e_mfn);
-        else 
-            /* XXX see above */
-            p2mt = p2m_mmio_dm;
-    }
-    
-    if ( page_order )
-        *page_order = PAGE_ORDER_4K;
-out:
-    *t = p2mt;
-    return mfn;
-}
-
 static mfn_t
 p2m_gfn_to_mfn(struct p2m_domain *p2m, unsigned long gfn, 
                p2m_type_t *t, p2m_access_t *a, p2m_query_t q,
@@ -666,10 +486,6 @@ p2m_gfn_to_mfn(struct p2m_domain *p2m, u
         /* This pfn is higher than the highest the p2m map currently holds */
         return _mfn(INVALID_MFN);
 
-    /* Use the fast path with the linear mapping if we can */
-    if ( p2m == p2m_get_hostp2m(current->domain) )
-        return p2m_gfn_to_mfn_current(p2m, gfn, t, a, q, page_order);
-
     mfn = pagetable_get_mfn(p2m_get_pagetable(p2m));
 
     {
@@ -904,17 +720,10 @@ long p2m_pt_audit_p2m(struct p2m_domain 
 {
     unsigned long entry_count = 0, pmbad = 0;
     unsigned long mfn, gfn, m2pfn;
-    int test_linear;
-    struct domain *d = p2m->domain;
 
     ASSERT(p2m_locked_by_me(p2m));
     ASSERT(pod_locked_by_me(p2m));
 
-    test_linear = ( (d == current->domain)
-                    && !pagetable_is_null(current->arch.monitor_table) );
-    if ( test_linear )
-        flush_tlb_local();
-
     /* Audit part one: walk the domain's p2m table, checking the entries. */
     if ( pagetable_get_pfn(p2m_get_pagetable(p2m)) != 0 )
     {
diff -r 5691e4cc17da -r 8bb4bc335ebb xen/arch/x86/mm/shadow/multi.c
--- a/xen/arch/x86/mm/shadow/multi.c	Thu Sep 13 10:23:17 2012 +0200
+++ b/xen/arch/x86/mm/shadow/multi.c	Thu Sep 13 16:41:33 2012 +0100
@@ -1472,14 +1472,6 @@ void sh_install_xen_entries_in_l4(struct
             shadow_l4e_from_mfn(gl4mfn, __PAGE_HYPERVISOR);
     }
 
-    if ( shadow_mode_translate(v->domain) )
-    {
-        /* install domain-specific P2M table */
-        sl4e[shadow_l4_table_offset(RO_MPT_VIRT_START)] =
-            shadow_l4e_from_mfn(pagetable_get_mfn(p2m_get_pagetable(p2m_get_hostp2m(d))),
-                                __PAGE_HYPERVISOR);
-    }
-
     sh_unmap_domain_page(sl4e);    
 }
 #endif
diff -r 5691e4cc17da -r 8bb4bc335ebb xen/include/asm-x86/p2m.h
--- a/xen/include/asm-x86/p2m.h	Thu Sep 13 10:23:17 2012 +0200
+++ b/xen/include/asm-x86/p2m.h	Thu Sep 13 16:41:33 2012 +0100
@@ -35,22 +35,6 @@
 extern bool_t opt_hap_1gb, opt_hap_2mb;
 
 /*
- * The phys_to_machine_mapping maps guest physical frame numbers 
- * to machine frame numbers.  It only exists for paging_mode_translate 
- * guests. It is organised in page-table format, which:
- *
- * (1) allows us to use it directly as the second pagetable in hardware-
- *     assisted paging and (hopefully) iommu support; and 
- * (2) lets us map it directly into the guest vcpus' virtual address space 
- *     as a linear pagetable, so we can read and write it easily.
- *
- * For (2) we steal the address space that would have normally been used
- * by the read-only MPT map in a non-translated guest.  (For 
- * paging_mode_external() guests this mapping is in the monitor table.)
- */
-#define phys_to_machine_mapping ((l1_pgentry_t *)RO_MPT_VIRT_START)
-
-/*
  * The upper levels of the p2m pagetable always contain full rights; all 
  * variation in the access control bits is made in the level-1 PTEs.
  * 

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:46 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYo-0003tX-4m; Fri, 14 Sep 2012 10:55:46 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYl-0003dI-Pf
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:43 +0000
Received: from [85.158.143.99:30779] by server-3.bemta-4.messagelabs.com id
	B0/A6-08232-F2D03505; Fri, 14 Sep 2012 10:55:43 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1347620141!23928219!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16138 invoked from network); 14 Sep 2012 10:55:42 -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;
	14 Sep 2012 10:55: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 1TCTYj-00016U-3v
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYj-0000rd-2V
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:41 +0000
Message-Id: <E1TCTYj-0000rd-2V@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:40 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: check for data and BSS in reloc
	code at compile time.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Tim Deegan <tim@xen.org>
# Date 1347550893 -3600
# Node ID 4aa37a8fb32ae77beafb5ae9d6abd3878a2d4901
# Parent  b3e6de36c91e9466498946cbb9a9e71c4efd5eae
x86: check for data and BSS in reloc code at compile time.

This is a more useful failure mode than hanging at boot time, and
incidentally fixes the clang/LLVM build by removing a .subsection rune.

Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r b3e6de36c91e -r 4aa37a8fb32a xen/arch/x86/boot/build32.mk
--- a/xen/arch/x86/boot/build32.mk	Thu Sep 13 16:41:33 2012 +0100
+++ b/xen/arch/x86/boot/build32.mk	Thu Sep 13 16:41:33 2012 +0100
@@ -20,6 +20,15 @@ CFLAGS := $(filter-out -flto,$(CFLAGS))
 
 %.o: %.c
 	$(CC) $(CFLAGS) -c -fpic $< -o $@
+	$(OBJDUMP) -h $@ | sed -n '/[0-9]/{s,00*,0,g;p}' |\
+		while read idx name sz rest; do \
+			case "$$name" in \
+			.data|.data.*|.rodata|.rodata.*|.bss|.bss.*) \
+				test $$sz != 0 || continue; \
+				echo "Error: non-empty $$name: 0x$$sz" >&2; \
+				exit $$(expr $$idx + 1);; \
+			esac; \
+		done
 
 reloc.o: $(BASEDIR)/include/asm-x86/config.h
 .PRECIOUS: %.bin %.lnk
diff -r b3e6de36c91e -r 4aa37a8fb32a xen/arch/x86/boot/reloc.c
--- a/xen/arch/x86/boot/reloc.c	Thu Sep 13 16:41:33 2012 +0100
+++ b/xen/arch/x86/boot/reloc.c	Thu Sep 13 16:41:33 2012 +0100
@@ -18,10 +18,7 @@ asm (
     "    call 1f                       \n"
     "1:  pop  %ebx                     \n"
     "    mov  %eax,alloc-1b(%ebx)      \n"
-    "    mov  $_end,%ecx               \n"  /* check that BSS is empty! */
-    "    sub  $__bss_start,%ecx        \n"
-    "    jz reloc                      \n"
-    "1:  jmp 1b                        \n"
+    "    jmp  reloc                    \n"
     );
 
 /* This is our data.  Because the code must be relocatable, no BSS is
@@ -30,9 +27,6 @@ asm (
 asm (
     "alloc:                            \n"
     "    .long 0                       \n"
-    "    .subsection 1                 \n"
-    "    .p2align 4, 0xcc              \n"
-    "    .subsection 0                 \n"
     );
 
 typedef unsigned int u32;

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:46 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYo-0003tX-4m; Fri, 14 Sep 2012 10:55:46 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYl-0003dI-Pf
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:43 +0000
Received: from [85.158.143.99:30779] by server-3.bemta-4.messagelabs.com id
	B0/A6-08232-F2D03505; Fri, 14 Sep 2012 10:55:43 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1347620141!23928219!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16138 invoked from network); 14 Sep 2012 10:55:42 -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;
	14 Sep 2012 10:55: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 1TCTYj-00016U-3v
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYj-0000rd-2V
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:41 +0000
Message-Id: <E1TCTYj-0000rd-2V@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:40 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: check for data and BSS in reloc
	code at compile time.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Tim Deegan <tim@xen.org>
# Date 1347550893 -3600
# Node ID 4aa37a8fb32ae77beafb5ae9d6abd3878a2d4901
# Parent  b3e6de36c91e9466498946cbb9a9e71c4efd5eae
x86: check for data and BSS in reloc code at compile time.

This is a more useful failure mode than hanging at boot time, and
incidentally fixes the clang/LLVM build by removing a .subsection rune.

Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r b3e6de36c91e -r 4aa37a8fb32a xen/arch/x86/boot/build32.mk
--- a/xen/arch/x86/boot/build32.mk	Thu Sep 13 16:41:33 2012 +0100
+++ b/xen/arch/x86/boot/build32.mk	Thu Sep 13 16:41:33 2012 +0100
@@ -20,6 +20,15 @@ CFLAGS := $(filter-out -flto,$(CFLAGS))
 
 %.o: %.c
 	$(CC) $(CFLAGS) -c -fpic $< -o $@
+	$(OBJDUMP) -h $@ | sed -n '/[0-9]/{s,00*,0,g;p}' |\
+		while read idx name sz rest; do \
+			case "$$name" in \
+			.data|.data.*|.rodata|.rodata.*|.bss|.bss.*) \
+				test $$sz != 0 || continue; \
+				echo "Error: non-empty $$name: 0x$$sz" >&2; \
+				exit $$(expr $$idx + 1);; \
+			esac; \
+		done
 
 reloc.o: $(BASEDIR)/include/asm-x86/config.h
 .PRECIOUS: %.bin %.lnk
diff -r b3e6de36c91e -r 4aa37a8fb32a xen/arch/x86/boot/reloc.c
--- a/xen/arch/x86/boot/reloc.c	Thu Sep 13 16:41:33 2012 +0100
+++ b/xen/arch/x86/boot/reloc.c	Thu Sep 13 16:41:33 2012 +0100
@@ -18,10 +18,7 @@ asm (
     "    call 1f                       \n"
     "1:  pop  %ebx                     \n"
     "    mov  %eax,alloc-1b(%ebx)      \n"
-    "    mov  $_end,%ecx               \n"  /* check that BSS is empty! */
-    "    sub  $__bss_start,%ecx        \n"
-    "    jz reloc                      \n"
-    "1:  jmp 1b                        \n"
+    "    jmp  reloc                    \n"
     );
 
 /* This is our data.  Because the code must be relocatable, no BSS is
@@ -30,9 +27,6 @@ asm (
 asm (
     "alloc:                            \n"
     "    .long 0                       \n"
-    "    .subsection 1                 \n"
-    "    .p2align 4, 0xcc              \n"
-    "    .subsection 0                 \n"
     );
 
 typedef unsigned int u32;

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:46 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYo-0003tj-7Z; Fri, 14 Sep 2012 10:55:46 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYm-0003nu-5b
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:44 +0000
Received: from [85.158.139.83:4213] by server-6.bemta-5.messagelabs.com id
	1C/55-21336-F2D03505; Fri, 14 Sep 2012 10:55:43 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-182.messagelabs.com!1347620134!25961705!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28691 invoked from network); 14 Sep 2012 10:55:35 -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;
	14 Sep 2012 10: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 1TCTYb-00015Y-TV
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYb-0000oj-Rx
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:33 +0000
Message-Id: <E1TCTYb-0000oj-Rx@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:33 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: Remove unused 'sis_apic_bug'
	variable. It was only used on x86_32.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347461553 -3600
# Node ID 991dae046c66db7869fc423adc93572d12c16b93
# Parent  7b658d31b5e1ebaaf9ea9cdc31cdba25d34d68ea
x86: Remove unused 'sis_apic_bug' variable. It was only used on x86_32.

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r 7b658d31b5e1 -r 991dae046c66 xen/arch/x86/io_apic.c
--- a/xen/arch/x86/io_apic.c	Wed Sep 12 13:59:26 2012 +0100
+++ b/xen/arch/x86/io_apic.c	Wed Sep 12 15:52:33 2012 +0100
@@ -46,14 +46,6 @@ bool_t __read_mostly skip_ioapic_setup;
 bool_t __read_mostly ioapic_ack_new = 1;
 bool_t __read_mostly ioapic_ack_forced = 0;
 
-#ifndef sis_apic_bug
-/*
- * Is the SiS APIC rmw bug present?
- * -1 = don't know, 0 = no, 1 = yes
- */
-s8 __read_mostly sis_apic_bug = -1;
-#endif
-
 /*
  * # of IRQ routing registers
  */
diff -r 7b658d31b5e1 -r 991dae046c66 xen/arch/x86/platform_hypercall.c
--- a/xen/arch/x86/platform_hypercall.c	Wed Sep 12 13:59:26 2012 +0100
+++ b/xen/arch/x86/platform_hypercall.c	Wed Sep 12 15:52:33 2012 +0100
@@ -207,17 +207,10 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xe
             setup_ioapic_dest();
             break;
         case QUIRK_IOAPIC_BAD_REGSEL:
+            dprintk(XENLOG_WARNING,
+                    "Domain 0 thinks that IO-APIC REGSEL is bad\n");
+            break;
         case QUIRK_IOAPIC_GOOD_REGSEL:
-#ifndef sis_apic_bug
-            sis_apic_bug = (quirk_id == QUIRK_IOAPIC_BAD_REGSEL);
-            dprintk(XENLOG_INFO, "Domain 0 says that IO-APIC REGSEL is %s\n",
-                    sis_apic_bug ? "bad" : "good");
-#else
-            if ( sis_apic_bug != (quirk_id == QUIRK_IOAPIC_BAD_REGSEL) )
-                dprintk(XENLOG_WARNING,
-                        "Domain 0 thinks that IO-APIC REGSEL is %s\n",
-                        sis_apic_bug ? "good" : "bad");
-#endif
             break;
         default:
             ret = -EINVAL;
diff -r 7b658d31b5e1 -r 991dae046c66 xen/include/asm-x86/io_apic.h
--- a/xen/include/asm-x86/io_apic.h	Wed Sep 12 13:59:26 2012 +0100
+++ b/xen/include/asm-x86/io_apic.h	Wed Sep 12 15:52:33 2012 +0100
@@ -160,16 +160,11 @@ static inline void io_apic_write(unsigne
 /*
  * Re-write a value: to be used for read-modify-write
  * cycles where the read already set up the index register.
- *
- * Older SiS APIC requires we rewrite the index regiser
  */
-#define sis_apic_bug 0
 static inline void io_apic_modify(unsigned int apic, unsigned int reg, unsigned int value)
 {
 	if (ioapic_reg_remapped(reg))
 		return iommu_update_ire_from_apic(apic, reg, value);
-	if (sis_apic_bug)
-		*IO_APIC_BASE(apic) = reg;
 	*(IO_APIC_BASE(apic)+4) = value;
 }
 

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:46 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYo-0003tj-7Z; Fri, 14 Sep 2012 10:55:46 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYm-0003nu-5b
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:44 +0000
Received: from [85.158.139.83:4213] by server-6.bemta-5.messagelabs.com id
	1C/55-21336-F2D03505; Fri, 14 Sep 2012 10:55:43 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-182.messagelabs.com!1347620134!25961705!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28691 invoked from network); 14 Sep 2012 10:55:35 -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;
	14 Sep 2012 10: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 1TCTYb-00015Y-TV
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYb-0000oj-Rx
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:33 +0000
Message-Id: <E1TCTYb-0000oj-Rx@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:33 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: Remove unused 'sis_apic_bug'
	variable. It was only used on x86_32.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347461553 -3600
# Node ID 991dae046c66db7869fc423adc93572d12c16b93
# Parent  7b658d31b5e1ebaaf9ea9cdc31cdba25d34d68ea
x86: Remove unused 'sis_apic_bug' variable. It was only used on x86_32.

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r 7b658d31b5e1 -r 991dae046c66 xen/arch/x86/io_apic.c
--- a/xen/arch/x86/io_apic.c	Wed Sep 12 13:59:26 2012 +0100
+++ b/xen/arch/x86/io_apic.c	Wed Sep 12 15:52:33 2012 +0100
@@ -46,14 +46,6 @@ bool_t __read_mostly skip_ioapic_setup;
 bool_t __read_mostly ioapic_ack_new = 1;
 bool_t __read_mostly ioapic_ack_forced = 0;
 
-#ifndef sis_apic_bug
-/*
- * Is the SiS APIC rmw bug present?
- * -1 = don't know, 0 = no, 1 = yes
- */
-s8 __read_mostly sis_apic_bug = -1;
-#endif
-
 /*
  * # of IRQ routing registers
  */
diff -r 7b658d31b5e1 -r 991dae046c66 xen/arch/x86/platform_hypercall.c
--- a/xen/arch/x86/platform_hypercall.c	Wed Sep 12 13:59:26 2012 +0100
+++ b/xen/arch/x86/platform_hypercall.c	Wed Sep 12 15:52:33 2012 +0100
@@ -207,17 +207,10 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xe
             setup_ioapic_dest();
             break;
         case QUIRK_IOAPIC_BAD_REGSEL:
+            dprintk(XENLOG_WARNING,
+                    "Domain 0 thinks that IO-APIC REGSEL is bad\n");
+            break;
         case QUIRK_IOAPIC_GOOD_REGSEL:
-#ifndef sis_apic_bug
-            sis_apic_bug = (quirk_id == QUIRK_IOAPIC_BAD_REGSEL);
-            dprintk(XENLOG_INFO, "Domain 0 says that IO-APIC REGSEL is %s\n",
-                    sis_apic_bug ? "bad" : "good");
-#else
-            if ( sis_apic_bug != (quirk_id == QUIRK_IOAPIC_BAD_REGSEL) )
-                dprintk(XENLOG_WARNING,
-                        "Domain 0 thinks that IO-APIC REGSEL is %s\n",
-                        sis_apic_bug ? "good" : "bad");
-#endif
             break;
         default:
             ret = -EINVAL;
diff -r 7b658d31b5e1 -r 991dae046c66 xen/include/asm-x86/io_apic.h
--- a/xen/include/asm-x86/io_apic.h	Wed Sep 12 13:59:26 2012 +0100
+++ b/xen/include/asm-x86/io_apic.h	Wed Sep 12 15:52:33 2012 +0100
@@ -160,16 +160,11 @@ static inline void io_apic_write(unsigne
 /*
  * Re-write a value: to be used for read-modify-write
  * cycles where the read already set up the index register.
- *
- * Older SiS APIC requires we rewrite the index regiser
  */
-#define sis_apic_bug 0
 static inline void io_apic_modify(unsigned int apic, unsigned int reg, unsigned int value)
 {
 	if (ioapic_reg_remapped(reg))
 		return iommu_update_ire_from_apic(apic, reg, value);
-	if (sis_apic_bug)
-		*IO_APIC_BASE(apic) = reg;
 	*(IO_APIC_BASE(apic)+4) = value;
 }
 

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:48 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYq-0003x9-EZ; Fri, 14 Sep 2012 10:55:48 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYn-0003qw-9h
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:45 +0000
Received: from [85.158.143.99:61695] by server-2.bemta-4.messagelabs.com id
	58/9E-21239-03D03505; Fri, 14 Sep 2012 10:55:44 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-216.messagelabs.com!1347620141!30375430!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15405 invoked from network); 14 Sep 2012 10:55:43 -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;
	14 Sep 2012 10:55: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 1TCTYj-00016d-LJ
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYj-0000rs-Jr
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:41 +0000
Message-Id: <E1TCTYj-0000rs-Jr@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:41 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] build: Require GCC 4.1 or later.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347563616 -3600
# Node ID 5613018f93b1e80106655c75d8c40d28bd05323d
# Parent  4aa37a8fb32ae77beafb5ae9d6abd3878a2d4901
build: Require GCC 4.1 or later.

Centralise the version check in Config.mk. Any more strict version
requirements can be added to specific subdirs/arches.

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r 4aa37a8fb32a -r 5613018f93b1 Config.mk
--- a/Config.mk	Thu Sep 13 16:41:33 2012 +0100
+++ b/Config.mk	Thu Sep 13 20:13:36 2012 +0100
@@ -119,6 +119,10 @@ define cc-ver-check-closure
     endif
 endef
 
+# Require GCC v4.1+
+check-$(gcc) = $(call cc-ver-check,CC,0x040100,"Xen requires at least gcc-4.1")
+$(eval $(check-y))
+
 define buildmakevars2shellvars
     export PREFIX="$(PREFIX)";                                            \
     export XEN_SCRIPT_DIR="$(XEN_SCRIPT_DIR)";                            \
diff -r 4aa37a8fb32a -r 5613018f93b1 tools/Rules.mk
--- a/tools/Rules.mk	Thu Sep 13 16:41:33 2012 +0100
+++ b/tools/Rules.mk	Thu Sep 13 20:13:36 2012 +0100
@@ -78,11 +78,6 @@ CFLAGS += $(CFLAGS-y)
 
 CFLAGS += $(EXTRA_CFLAGS_XEN_TOOLS)
 
-# Require GCC v3.4+ (to avoid issues with alignment constraints in Xen headers)
-check-$(CONFIG_X86) = $(call cc-ver-check,CC,0x030400,\
-                        "Xen requires at least gcc-3.4")
-$(eval $(check-y))
-
 INSTALL_PYTHON_PROG = \
 	$(XEN_ROOT)/tools/python/install-wrap "$(PYTHON_PATH)" $(INSTALL_PROG)
 
diff -r 4aa37a8fb32a -r 5613018f93b1 xen/arch/arm/Rules.mk
--- a/xen/arch/arm/Rules.mk	Thu Sep 13 16:41:33 2012 +0100
+++ b/xen/arch/arm/Rules.mk	Thu Sep 13 20:13:36 2012 +0100
@@ -25,7 +25,3 @@ CFLAGS += -DGCC_HAS_VISIBILITY_ATTRIBUTE
 endif
 
 CFLAGS += -mcpu=cortex-a15 -mfpu=vfpv3 -mfloat-abi=softfp
-
-# Require GCC v3.4+ (to avoid issues with alignment constraints in Xen headers)
-check-$(gcc) = $(call cc-ver-check,CC,0x030400,"Xen requires at least gcc-3.4")
-$(eval $(check-y))
diff -r 4aa37a8fb32a -r 5613018f93b1 xen/arch/x86/Rules.mk
--- a/xen/arch/x86/Rules.mk	Thu Sep 13 16:41:33 2012 +0100
+++ b/xen/arch/x86/Rules.mk	Thu Sep 13 20:13:36 2012 +0100
@@ -50,7 +50,3 @@ CFLAGS += -fno-asynchronous-unwind-table
 ifneq ($(call cc-option,$(CC),-fvisibility=hidden,n),n)
 CFLAGS += -DGCC_HAS_VISIBILITY_ATTRIBUTE
 endif
-
-# Require GCC v3.4+ (to avoid issues with alignment constraints in Xen headers)
-check-$(gcc) = $(call cc-ver-check,CC,0x030400,"Xen requires at least gcc-3.4")
-$(eval $(check-y))

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:48 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYq-0003x9-EZ; Fri, 14 Sep 2012 10:55:48 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYn-0003qw-9h
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:45 +0000
Received: from [85.158.143.99:61695] by server-2.bemta-4.messagelabs.com id
	58/9E-21239-03D03505; Fri, 14 Sep 2012 10:55:44 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-216.messagelabs.com!1347620141!30375430!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15405 invoked from network); 14 Sep 2012 10:55:43 -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;
	14 Sep 2012 10:55: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 1TCTYj-00016d-LJ
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYj-0000rs-Jr
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:41 +0000
Message-Id: <E1TCTYj-0000rs-Jr@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:41 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] build: Require GCC 4.1 or later.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347563616 -3600
# Node ID 5613018f93b1e80106655c75d8c40d28bd05323d
# Parent  4aa37a8fb32ae77beafb5ae9d6abd3878a2d4901
build: Require GCC 4.1 or later.

Centralise the version check in Config.mk. Any more strict version
requirements can be added to specific subdirs/arches.

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r 4aa37a8fb32a -r 5613018f93b1 Config.mk
--- a/Config.mk	Thu Sep 13 16:41:33 2012 +0100
+++ b/Config.mk	Thu Sep 13 20:13:36 2012 +0100
@@ -119,6 +119,10 @@ define cc-ver-check-closure
     endif
 endef
 
+# Require GCC v4.1+
+check-$(gcc) = $(call cc-ver-check,CC,0x040100,"Xen requires at least gcc-4.1")
+$(eval $(check-y))
+
 define buildmakevars2shellvars
     export PREFIX="$(PREFIX)";                                            \
     export XEN_SCRIPT_DIR="$(XEN_SCRIPT_DIR)";                            \
diff -r 4aa37a8fb32a -r 5613018f93b1 tools/Rules.mk
--- a/tools/Rules.mk	Thu Sep 13 16:41:33 2012 +0100
+++ b/tools/Rules.mk	Thu Sep 13 20:13:36 2012 +0100
@@ -78,11 +78,6 @@ CFLAGS += $(CFLAGS-y)
 
 CFLAGS += $(EXTRA_CFLAGS_XEN_TOOLS)
 
-# Require GCC v3.4+ (to avoid issues with alignment constraints in Xen headers)
-check-$(CONFIG_X86) = $(call cc-ver-check,CC,0x030400,\
-                        "Xen requires at least gcc-3.4")
-$(eval $(check-y))
-
 INSTALL_PYTHON_PROG = \
 	$(XEN_ROOT)/tools/python/install-wrap "$(PYTHON_PATH)" $(INSTALL_PROG)
 
diff -r 4aa37a8fb32a -r 5613018f93b1 xen/arch/arm/Rules.mk
--- a/xen/arch/arm/Rules.mk	Thu Sep 13 16:41:33 2012 +0100
+++ b/xen/arch/arm/Rules.mk	Thu Sep 13 20:13:36 2012 +0100
@@ -25,7 +25,3 @@ CFLAGS += -DGCC_HAS_VISIBILITY_ATTRIBUTE
 endif
 
 CFLAGS += -mcpu=cortex-a15 -mfpu=vfpv3 -mfloat-abi=softfp
-
-# Require GCC v3.4+ (to avoid issues with alignment constraints in Xen headers)
-check-$(gcc) = $(call cc-ver-check,CC,0x030400,"Xen requires at least gcc-3.4")
-$(eval $(check-y))
diff -r 4aa37a8fb32a -r 5613018f93b1 xen/arch/x86/Rules.mk
--- a/xen/arch/x86/Rules.mk	Thu Sep 13 16:41:33 2012 +0100
+++ b/xen/arch/x86/Rules.mk	Thu Sep 13 20:13:36 2012 +0100
@@ -50,7 +50,3 @@ CFLAGS += -fno-asynchronous-unwind-table
 ifneq ($(call cc-option,$(CC),-fvisibility=hidden,n),n)
 CFLAGS += -DGCC_HAS_VISIBILITY_ATTRIBUTE
 endif
-
-# Require GCC v3.4+ (to avoid issues with alignment constraints in Xen headers)
-check-$(gcc) = $(call cc-ver-check,CC,0x030400,"Xen requires at least gcc-3.4")
-$(eval $(check-y))

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:49 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYr-0003yt-Hi; Fri, 14 Sep 2012 10:55:49 +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 1TCTYq-0003nl-78
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:48 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-27.messagelabs.com!1347620134!9908515!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21390 invoked from network); 14 Sep 2012 10:55:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Sep 2012 10: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 1TCTYc-00015d-EU
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYc-0000oy-D9
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:34 +0000
Message-Id: <E1TCTYc-0000oy-D9@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:33 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: Fix 32-bit stubdom build,
	libelf.h must support __i386__
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347462762 -3600
# Node ID a1bd69b08e9eb4a5dca1b0408e34d49fda767b81
# Parent  991dae046c66db7869fc423adc93572d12c16b93
x86: Fix 32-bit stubdom build, libelf.h must support __i386__

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r 991dae046c66 -r a1bd69b08e9e xen/include/xen/libelf.h
--- a/xen/include/xen/libelf.h	Wed Sep 12 15:52:33 2012 +0100
+++ b/xen/include/xen/libelf.h	Wed Sep 12 16:12:42 2012 +0100
@@ -23,7 +23,7 @@
 #ifndef __XEN_LIBELF_H__
 #define __XEN_LIBELF_H__
 
-#if defined(__x86_64__) || defined(__arm__)
+#if defined(__i386__) || defined(__x86_64__) || defined(__arm__)
 #define XEN_ELF_LITTLE_ENDIAN
 #else
 #error define architectural endianness

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:49 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10: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.xen.org>)
	id 1TCTYr-0003yt-Hi; Fri, 14 Sep 2012 10:55:49 +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 1TCTYq-0003nl-78
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:48 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-27.messagelabs.com!1347620134!9908515!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21390 invoked from network); 14 Sep 2012 10:55:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Sep 2012 10: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 1TCTYc-00015d-EU
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYc-0000oy-D9
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:34 +0000
Message-Id: <E1TCTYc-0000oy-D9@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:33 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: Fix 32-bit stubdom build,
	libelf.h must support __i386__
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347462762 -3600
# Node ID a1bd69b08e9eb4a5dca1b0408e34d49fda767b81
# Parent  991dae046c66db7869fc423adc93572d12c16b93
x86: Fix 32-bit stubdom build, libelf.h must support __i386__

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r 991dae046c66 -r a1bd69b08e9e xen/include/xen/libelf.h
--- a/xen/include/xen/libelf.h	Wed Sep 12 15:52:33 2012 +0100
+++ b/xen/include/xen/libelf.h	Wed Sep 12 16:12:42 2012 +0100
@@ -23,7 +23,7 @@
 #ifndef __XEN_LIBELF_H__
 #define __XEN_LIBELF_H__
 
-#if defined(__x86_64__) || defined(__arm__)
+#if defined(__i386__) || defined(__x86_64__) || defined(__arm__)
 #define XEN_ELF_LITTLE_ENDIAN
 #else
 #error define architectural endianness

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:52 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYu-00043G-MD; Fri, 14 Sep 2012 10:55:52 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYr-0003yh-PL
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:50 +0000
Received: from [85.158.143.99:61946] by server-1.bemta-4.messagelabs.com id
	0C/18-12504-53D03505; Fri, 14 Sep 2012 10:55:49 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-216.messagelabs.com!1347620135!20564898!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24804 invoked from network); 14 Sep 2012 10:55:36 -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;
	14 Sep 2012 10:55:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYd-00015i-9h
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYd-0000pD-6V
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:35 +0000
Message-Id: <E1TCTYd-0000pD-6V@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:34 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools: drop ia64 support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============4968845350088557548=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============4968845350088557548==
Content-Type: text/plain

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1347468927 -3600
# Node ID 485e6db28b93d69e33628635eb562ea6f5179c90
# Parent  a1bd69b08e9eb4a5dca1b0408e34d49fda767b81
tools: drop ia64 support

Removed support from libxc and mini-os.

This also took me under xen/include/public via various symlinks.

Dropped tools/debugger/xenitp entirely, it was described upon commit
as:
"Xenitp is a low-level debugger for ia64" and doesn't appear to be
linked into the build anywhere.

 99 files changed, 14 insertions(+), 32361 deletions(-)

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/Config.mk
--- a/extras/mini-os/Config.mk	Wed Sep 12 16:12:42 2012 +0100
+++ b/extras/mini-os/Config.mk	Wed Sep 12 17:55:27 2012 +0100
@@ -9,7 +9,7 @@ export XEN_INTERFACE_VERSION
 
 # Try to find out the architecture family TARGET_ARCH_FAM.
 # First check whether x86_... is contained (for x86_32, x86_32y, x86_64).
-# If not x86 then use $(XEN_TARGET_ARCH) -> for ia64, ...
+# If not x86 then use $(XEN_TARGET_ARCH)
 ifeq ($(findstring x86_,$(XEN_TARGET_ARCH)),x86_)
 TARGET_ARCH_FAM = x86
 else
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/arch/ia64/Makefile
--- a/extras/mini-os/arch/ia64/Makefile	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-#
-# Special makefile for ia64.
-#
-
-XEN_ROOT = $(CURDIR)/../../../..
-include $(XEN_ROOT)/Config.mk
-
-include ../../Config.mk
-
-include arch.mk
-include ../../minios.mk
-
-ARCH_SRCS := sal.c
-ARCH_SRCS += efi.c
-ARCH_SRCS += time.c
-ARCH_SRCS += ivt.S
-ARCH_SRCS += fw.S
-ARCH_SRCS += common.c
-ARCH_SRCS += time.c
-ARCH_SRCS += mm.c
-ARCH_SRCS += debug.c
-ARCH_SRCS += sched.c
-ARCH_SRCS += xencomm.c
-ARCH_SRCS += __umoddi3.S
-ARCH_SRCS += __udivdi3.S
-ARCH_SRCS += __divdi3.S
-
-ARCH_OBJS := sal.o
-ARCH_OBJS += efi.o
-ARCH_OBJS += time.o
-ARCH_OBJS += ivt.o
-ARCH_OBJS += fw.o
-ARCH_OBJS += common.o
-ARCH_OBJS += time.o
-ARCH_OBJS += mm.o
-ARCH_OBJS += debug.o
-ARCH_OBJS += sched.o
-ARCH_OBJS += xencomm.o
-ARCH_OBJS += __umoddi3.o
-ARCH_OBJS += __udivdi3.o
-ARCH_OBJS += __udivsi3.o
-ARCH_OBJS += __divdi3.o
-ARCH_OBJS := $(addprefix $(OBJ_DIR)/,$(ARCH_OBJS))
-
-GEN_OFF_SRC := gen_off.c
-GEN_OFF_ASM := gen_off.s
-GEN_OFF_H   := $(MINI-OS_ROOT)/include/$(ARCH_INC)/offsets.h
-
-all: $(OBJ_DIR)/$(ARCH_LIB)
-
-$(GEN_OFF_ASM): $(GEN_OFF_SRC)
-	$(CC) -S -o $@ $(CPPFLAGS) $<
-
-$(GEN_OFF_H): $(GEN_OFF_ASM)
-	sed -ne "/^->/ {s/->/#define /; p}" < $< > $@
-
-$(OBJ_DIR)/$(ARCH_LIB): $(GEN_OFF_H) $(ARCH_OBJS) $(OBJ_DIR)/$(HEAD_ARCH_OBJ)
-	$(AR) rv $(ARCH_LIB) $(ARCH_OBJS)
-
-clean:
-	rm -f $(OBJ_DIR)/$(ARCH_LIB) $(ARCH_OBJS) $(OBJ_DIR)/$(HEAD_ARCH_OBJ)
-	rm -f $(GEN_OFF_ASM)
-	rm -f $(GEN_OFF_H)
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/arch/ia64/__divdi3.S
--- a/extras/mini-os/arch/ia64/__divdi3.S	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,141 +0,0 @@
-.file "__divdi3.s"
-
-// $FreeBSD: src/sys/libkern/ia64/__divdi3.S,v 1.1 2000/10/04 17:53:03 dfr Exp $
-//  
-// Copyright (c) 2000, Intel Corporation
-// All rights reserved.
-//
-// Contributed 2/15/2000 by Marius Cornea, John Harrison, Cristina Iordache, 
-// Ted Kubaska, Bob Norin, and Shane Story of the Computational Software Lab, 
-// Intel Corporation.
-//
-// WARRANTY DISCLAIMER
-//
-// 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 INTEL OR ITS 
-// 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.
-//
-// Intel Corporation is the author of this code, and requests that all
-// problem reports or change requests be submitted to it directly at
-// http://developer.intel.com/opensource.
-//
-
-.section .text
-.proc __divdi3#
-.align 32
-.global __divdi3#
-.align 32
-
-// 64-bit signed integer divide
-
-__divdi3:
-
-{ .mii
-  alloc r31=ar.pfs,2,0,0,0
-  nop.i 0
-  nop.i 0;;
-} { .mmi
-
-  // 64-BIT SIGNED INTEGER DIVIDE BEGINS HERE
-
-  setf.sig f8=r32
-  setf.sig f9=r33
-  nop.i 0;;
-} { .mfb
-  nop.m 0
-  fcvt.xf f6=f8
-  nop.b 0
-} { .mfb
-  nop.m 0
-  fcvt.xf f7=f9
-  nop.b 0;;
-} { .mfi
-  nop.m 0
-  // Step (1)
-  // y0 = 1 / b in f8
-  frcpa.s1 f8,p6=f6,f7
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // Step (2)
-  // e0 = 1 - b * y0 in f9
-  (p6) fnma.s1 f9=f7,f8,f1
-  nop.i 0
-} { .mfi
-  nop.m 0
-  // Step (3)
-  // q0 = a * y0 in f10
-  (p6) fma.s1 f10=f6,f8,f0
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // Step (4)
-  // e1 = e0 * e0 in f11
-  (p6) fma.s1 f11=f9,f9,f0
-  nop.i 0
-} { .mfi
-  nop.m 0
-  // Step (5)
-  // q1 = q0 + e0 * q0 in f10
-  (p6) fma.s1 f10=f9,f10,f10
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // Step (6)
-  // y1 = y0 + e0 * y0 in f8
-  (p6) fma.s1 f8=f9,f8,f8
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // Step (7)
-  // q2 = q1 + e1 * q1 in f9
-  (p6) fma.s1 f9=f11,f10,f10
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // Step (8)
-  // y2 = y1 + e1 * y1 in f8
-  (p6) fma.s1 f8=f11,f8,f8
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // Step (9)
-  // r2 = a - b * q2 in f10
-  (p6) fnma.s1 f10=f7,f9,f6
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // Step (10)
-  // q3 = q2 + r2 * y2 in f8
-  (p6) fma.s1 f8=f10,f8,f9
-  nop.i 0;;
-} { .mfb
-  nop.m 0
-  // Step (11)
-  // q = trunc (q3)
-  fcvt.fx.trunc.s1 f8=f8
-  nop.b 0;;
-} { .mmi
-  // quotient will be in r8 (if b != 0)
-  getf.sig r8=f8
-  nop.m 0
-  nop.i 0;;
-}
-
-  // 64-BIT SIGNED INTEGER DIVIDE ENDS HERE
-
-{ .mmb
-  nop.m 0
-  nop.m 0
-  br.ret.sptk b0;;
-}
-
-.endp __divdi3
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/arch/ia64/__udivdi3.S
--- a/extras/mini-os/arch/ia64/__udivdi3.S	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,142 +0,0 @@
-.file "__udivdi3.s"
-
-// $FreeBSD: src/sys/libkern/ia64/__udivdi3.S,v 1.1 2000/10/04 17:53:03 dfr Exp $
-//  
-// Copyright (c) 2000, Intel Corporation
-// All rights reserved.
-//
-// Contributed 2/15/2000 by Marius Cornea, John Harrison, Cristina Iordache, 
-// Ted Kubaska, Bob Norin, and Shane Story of the Computational Software Lab, 
-// Intel Corporation.
-//
-// WARRANTY DISCLAIMER
-//
-// 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 INTEL OR ITS 
-// 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.
-//
-// Intel Corporation is the author of this code, and requests that all
-// problem reports or change requests be submitted to it directly at
-// http://developer.intel.com/opensource.
-//
-
-.section .text
-.proc __udivdi3#
-.align 32
-.global __udivdi3#
-.align 32
-
-// 64-bit unsigned integer divide
-
-__udivdi3:
-
-{ .mii
-  alloc r31=ar.pfs,2,0,0,0
-  nop.i 0
-  nop.i 0;;
-}
-
-{ .mmi
-
-  // 64-BIT UNSIGNED INTEGER DIVIDE BEGINS HERE
-
-  setf.sig f8=r32
-  setf.sig f9=r33
-  nop.i 0;;
-} { .mfb
-  nop.m 0
-  fma.s1 f6=f8,f1,f0
-  nop.b 0
-} { .mfb
-  nop.m 0
-  fma.s1 f7=f9,f1,f0
-  nop.b 0;;
-} { .mfi
-  nop.m 0
-  // Step (1)
-  // y0 = 1 / b in f8
-  frcpa.s1 f8,p6=f6,f7
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // Step (2)
-  // e0 = 1 - b * y0 in f9
-  (p6) fnma.s1 f9=f7,f8,f1
-  nop.i 0
-} { .mfi
-  nop.m 0
-  // Step (3)
-  // q0 = a * y0 in f10
-  (p6) fma.s1 f10=f6,f8,f0
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // Step (4)
-  // e1 = e0 * e0 in f11
-  (p6) fma.s1 f11=f9,f9,f0
-  nop.i 0
-} { .mfi
-  nop.m 0
-  // Step (5)
-  // q1 = q0 + e0 * q0 in f10
-  (p6) fma.s1 f10=f9,f10,f10
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // Step (6)
-  // y1 = y0 + e0 * y0 in f8
-  (p6) fma.s1 f8=f9,f8,f8
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // Step (7)
-  // q2 = q1 + e1 * q1 in f9
-  (p6) fma.s1 f9=f11,f10,f10
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // Step (8)
-  // y2 = y1 + e1 * y1 in f8
-  (p6) fma.s1 f8=f11,f8,f8
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // Step (9)
-  // r2 = a - b * q2 in f10
-  (p6) fnma.s1 f10=f7,f9,f6
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // Step (10)
-  // q3 = q2 + r2 * y2 in f8
-  (p6) fma.s1 f8=f10,f8,f9
-  nop.i 0;;
-} { .mfb
-  nop.m 0
-  // (11) q = trunc(q3)
-  fcvt.fxu.trunc.s1 f8=f8
-  nop.b 0;;
-} { .mmi
-  // quotient will be in r8 (if b != 0)
-  getf.sig r8=f8
-  nop.m 0
-  nop.i 0;;
-}
-
-  // 64-BIT UNSIGNED INTEGER DIVIDE ENDS HERE
-
-{ .mmb
-  nop.m 0
-  nop.m 0
-  br.ret.sptk b0;;
-}
-
-.endp __udivdi3
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/arch/ia64/__udivsi3.S
--- a/extras/mini-os/arch/ia64/__udivsi3.S	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,124 +0,0 @@
-.file "__udivsi3.s"
-
-// $FreeBSD: src/sys/libkern/ia64/__udivsi3.S,v 1.1.8.1 2005/01/31 23:26:21 imp Exp $
-
-//-
-// Copyright (c) 2000, Intel Corporation
-// All rights reserved.
-//
-// Contributed 2/15/2000 by Marius Cornea, John Harrison, Cristina Iordache, 
-// Ted Kubaska, Bob Norin, and Shane Story of the Computational Software Lab, 
-// Intel Corporation.
-//
-// WARRANTY DISCLAIMER
-//
-// 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 INTEL OR ITS 
-// 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.
-//
-// Intel Corporation is the author of this code, and requests that all
-// problem reports or change requests be submitted to it directly at
-// http://developer.intel.com/opensource.
-//
-
-.section .text
-
-// 32-bit unsigned integer divide
-
-.proc __udivsi3#
-.align 32
-.global __udivsi3#
-.align 32
-
-__udivsi3:
-
-{ .mii
-  alloc r31=ar.pfs,2,0,0,0
-  nop.i 0
-  nop.i 0;;
-} { .mii
-  nop.m 0
-
-  // 32-BIT UNSIGNED INTEGER DIVIDE BEGINS HERE
-
-  // general register used:
-  //    r32 - 32-bit unsigned integer dividend
-  //    r33 - 32-bit unsigned integer divisor
-  //    r8 - 32-bit unsigned integer result
-  //    r2 - scratch register
-  // floating-point registers used: f6, f7, f8, f9
-  // predicate registers used: p6
-
-  zxt4 r32=r32
-  zxt4 r33=r33;;
-} { .mmb
-  setf.sig f6=r32
-  setf.sig f7=r33
-  nop.b 0;;
-} { .mfi
-  nop.m 0
-  fcvt.xf f6=f6
-  nop.i 0
-} { .mfi
-  nop.m 0
-  fcvt.xf f7=f7
-  mov r2 = 0x0ffdd;;
-} { .mfi
-  setf.exp f9 = r2
-  // (1) y0
-  frcpa.s1 f8,p6=f6,f7
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // (2) q0 = a * y0
-  (p6) fma.s1 f6=f6,f8,f0
-  nop.i 0
-} { .mfi
-  nop.m 0
-  // (3) e0 = 1 - b * y0
-  (p6) fnma.s1 f7=f7,f8,f1
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // (4) q1 = q0 + e0 * q0
-  (p6) fma.s1 f6=f7,f6,f6
-  nop.i 0
-} { .mfi
-  nop.m 0
-  // (5) e1 = e0 * e0 + 2^-34
-  (p6) fma.s1 f7=f7,f7,f9
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // (6) q2 = q1 + e1 * q1
-  (p6) fma.s1 f8=f7,f6,f6
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // (7) q = trunc(q2)
-  fcvt.fxu.trunc.s1 f8=f8
-  nop.i 0;;
-} { .mmi
-  // quotient will be in the least significant 32 bits of r8 (if b != 0)
-  getf.sig r8=f8
-  nop.m 0
-  nop.i 0;;
-}
-
-  // 32-BIT UNSIGNED INTEGER DIVIDE ENDS HERE
-
-{ .mmb
-  nop.m 0
-  nop.m 0
-  br.ret.sptk b0;;
-}
-
-.endp __udivsi3
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/arch/ia64/__umoddi3.S
--- a/extras/mini-os/arch/ia64/__umoddi3.S	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,154 +0,0 @@
-.file "__umoddi3.s"
-
-// $FreeBSD: src/sys/libkern/ia64/__umoddi3.S,v 1.3 2003/02/11 20:15:11 schweikh Exp $
-//  
-// Copyright (c) 2000, Intel Corporation
-// All rights reserved.
-//
-// Contributed 2/15/2000 by Marius Cornea, John Harrison, Cristina Iordache, 
-// Ted Kubaska, Bob Norin, and Shane Story of the Computational Software Lab, 
-// Intel Corporation.
-//
-// WARRANTY DISCLAIMER
-//
-// 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 INTEL OR ITS 
-// 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.
-//
-// Intel Corporation is the author of this code, and requests that all
-// problem reports or change requests be submitted to it directly at
-// http://developer.intel.com/opensource.
-//
-
-.section .text
-
-  // 64-bit unsigned integer remainder
-
-.proc __umoddi3#
-.align 32
-.global __umoddi3#
-.align 32
-
-__umoddi3:
-
-{ .mii
-  alloc r31=ar.pfs,3,0,0,0
-  nop.i 0
-  nop.i 0
-} { .mmb
-
-  // 64-BIT UNSIGNED INTEGER REMAINDER BEGINS HERE
-
-  // general register used:
-  //    r32 - 64-bit unsigned integer dividend, called a below
-  //    r33 - 64-bit unsigned integer divisor, called b below
-  //    r8 - 64-bit unsigned integer result
-  // floating-point registers used: f6, f7, f8, f9, f10, f11, f12
-  // predicate registers used: p6
-
-  setf.sig f12=r32  // holds a in integer form
-  setf.sig f7=r33
-  nop.b 0;;
-} { .mfi
-  // get 2s complement of b
-  sub r33=r0,r33
-  fcvt.xuf.s1 f6=f12
-  nop.i 0
-} { .mfi
-  nop.m 0
-  fcvt.xuf.s1 f7=f7
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // Step (1)
-  // y0 = 1 / b in f8
-  frcpa.s1 f8,p6=f6,f7
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // Step (2)
-  // q0 = a * y0 in f10
-  (p6) fma.s1 f10=f6,f8,f0
-  nop.i 0
-} { .mfi
-  nop.m 0
-  // Step (3)
-  // e0 = 1 - b * y0 in f9
-  (p6) fnma.s1 f9=f7,f8,f1
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // Step (4)
-  // q1 = q0 + e0 * q0 in f10
-  (p6) fma.s1 f10=f9,f10,f10
-  nop.i 0
-} { .mfi
-  nop.m 0
-  // Step (5)
-  // e1 = e0 * e0 in f11
-  (p6) fma.s1 f11=f9,f9,f0
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // Step (6)
-  // y1 = y0 + e0 * y0 in f8
-  (p6) fma.s1 f8=f9,f8,f8
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // Step (7)
-  // q2 = q1 + e1 * q1 in f9
-  (p6) fma.s1 f9=f11,f10,f10
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // Step (8)
-  // y2 = y1 + e1 * y1 in f8
-  (p6) fma.s1 f8=f11,f8,f8
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // Step (9)
-  // r2 = a - b * q2 in f10
-  (p6) fnma.s1 f10=f7,f9,f6
-  nop.i 0;;
-} { .mfi
-  // f7=-b
-  setf.sig f7=r33
-  // Step (10)
-  // q3 = q2 + r2 * y2 in f8
-  (p6) fma.s1 f8=f10,f8,f9
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // (11) q = trunc(q3)
-  fcvt.fxu.trunc.s1 f8=f8
-  nop.i 0;;
-}  { .mfi
-  nop.m 0
-  // (12) r = a + (-b) * q
-  xma.l f8=f8,f7,f12
-  nop.i 0;;
-}  { .mib
-  getf.sig r8=f8
-  nop.i 0
-  nop.b 0
-}
-
-  // 64-BIT UNSIGNED INTEGER REMAINDER ENDS HERE
-
-{ .mib
-  nop.m 0
-  nop.i 0
-  br.ret.sptk b0;;
-}
-
-.endp __umoddi3
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/arch/ia64/arch.mk
--- a/extras/mini-os/arch/ia64/arch.mk	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-
-ARCH_CFLAGS := -mfixed-range=f2-f5,f12-f15,f32-f127 -mconstant-gp
-ARCH_CFLAGS += -O2
-ARCH_ASFLAGS := -x assembler-with-cpp
-ARCH_ASFLAGS += -mfixed-range=f2-f5,f12-f15,f32-f127 -fomit-frame-pointer
-ARCH_ASFLAGS += -fno-builtin -fno-common -fno-strict-aliasing -mconstant-gp
-
-ARCH_LDFLAGS = -warn-common
-
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/arch/ia64/common.c
--- a/extras/mini-os/arch/ia64/common.c	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,266 +0,0 @@
-/*
- * Done by Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
- *
- ****************************************************************************
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
- *
- ****************************************************************************
- *
- * Parts are taken from FreeBSD.
- *
- */
-
-
-#include <mini-os/os.h>
-#include <mini-os/types.h>
-#include <mini-os/lib.h>
-#include <mini-os/page.h>
-#include <xen/xen.h>
-#include <mini-os/privop.h>
-#include <xen/callback.h>
-#include <mini-os/ia64_cpu.h>
-#include <mini-os/hypervisor.h>
-#include <mini-os/events.h>
-#include <mini-os/console.h>
-#include <mini-os/time.h>
-#include <mini-os/xmalloc.h>
-
-
-/* For more console boot messages. */
-int bootverbose;
-
-/*
- * This structure contains start-of-day info, such as pagetable base pointer,
- * address of the shared_info structure, and things like that.
- */
-union start_info_union start_info_union;
-
-shared_info_t *HYPERVISOR_shared_info = (shared_info_t *)XSI_BASE;
-
-struct machine_fw machineFwG;
-
-/* This pointer is initialized in ia64.S with the address of the boot param
- * area passed by the bootloader. */
-struct xen_ia64_boot_param* ia64_boot_paramP;
-
-struct xen_ia64_boot_param ia64BootParamG;
-char boot_cmd_line[COMMAND_LINE_SIZE+1];
-
-
-void
-ia64_write_itr_i(ia64_pte_t* pteP, uint32_t reg, uint64_t vAddr,
-		  uint64_t ps, uint64_t pk)
-{
-	/* The virtual address. */
-	__asm __volatile("mov	cr.ifa=%0" :: "r"(vAddr));
-	/* The page size */
-	__asm __volatile("mov	cr.itir=%0;;" :: "r"((ps << IA64_ITIR_PS)|(pk << IA64_ITIR_KEY)));
-	/* Put pte into instruction translation register. */ 
-	__asm __volatile("itr.i	itr[%0]=%1" :: "r"(reg), "r"(*(uint64_t*)pteP));
-	/* Serialization */
-	__asm __volatile("srlz.i");
-}
-
-void
-map_pal_code(void)
-{
-	ia64_pte_t pte;
-
-	xen_set_virtual_psr_ic(0);
-	memset(&pte, 0, sizeof(pte));		/* Prepare the pte */
-	pte.pte_p = 1;				/* present bit */
-	pte.pte_ma = PTE_MA_WB;			/* memory attribute */
-	pte.pte_a = 1;				/* accessed bit */
-	pte.pte_d = 1;				/* dirty bit */
-	pte.pte_pl = PTE_PL_KERN;		/* privilege level */
-	pte.pte_ar = PTE_AR_RWX;		/* access rights */
-	pte.pte_ppn = ((uint64_t) __pa(machineFwG.ia64_pal_base)) >> 14;
-	pte.pte_ed = 0;				/* exception deferral */
-
-	/*
-	 * Must purge here because a itc/dtc with the same address
-	 * may be in the tlb!
-	 */
-	ia64_ptc_l(machineFwG.ia64_pal_base, PTE_PS_16K);
-	ia64_write_itr_i(&pte, IA64_TR_PAL,
-			 (uint64_t)machineFwG.ia64_pal_base,
-			 PTE_PS_16K, IA64_KEY_REG7);
-	xen_set_virtual_psr_ic(1);
-}
-
-/* In ivt.S */
-extern char hypervisor_callback;
-
-static void
-registerCallback(void)
-{
-	struct callback_register event =
-	{
-		.type = CALLBACKTYPE_event,
-		.address = (unsigned long)&hypervisor_callback,
-	};
-	HYPERVISOR_callback_op(CALLBACKOP_register, &event);
-}
-
-static void
-init_start_info(start_info_t* xen_start_info)
-{
-	/* Make a copy of the start_info structure */
-	start_info.nr_pages = xen_start_info->nr_pages;
-	start_info.shared_info = xen_start_info->shared_info;
-	start_info.flags = xen_start_info->flags;
-	start_info.store_mfn = xen_start_info->store_mfn;
-	start_info.store_evtchn	= xen_start_info->store_evtchn;
-	start_info.console.domU.mfn = xen_start_info->console.domU.mfn;
-	start_info.console.domU.evtchn =
-				xen_start_info->console.domU.evtchn;
-	start_info.pt_base = xen_start_info->pt_base;
-	start_info.nr_pt_frames	= xen_start_info->nr_pt_frames;
-	start_info.mfn_list = xen_start_info->mfn_list;
-	start_info.mod_start = xen_start_info->mod_start;
-	start_info.mod_len = xen_start_info->mod_len;
-}
-
-static void
-init_boot_params(void)
-{
-	ia64BootParamG.command_line = ia64_boot_paramP->command_line;
-	ia64BootParamG.efi_systab = ia64_boot_paramP->efi_systab;
-	ia64BootParamG.efi_memmap = ia64_boot_paramP->efi_memmap;
-	ia64BootParamG.efi_memmap_size = ia64_boot_paramP->efi_memmap_size;
-	ia64BootParamG.efi_memdesc_size	= ia64_boot_paramP->efi_memdesc_size;
-	ia64BootParamG.efi_memdesc_version =
-				ia64_boot_paramP->efi_memdesc_version;
-	ia64BootParamG.console_info.num_cols =
-				ia64_boot_paramP->console_info.num_cols;
-	ia64BootParamG.console_info.num_rows =
-				ia64_boot_paramP->console_info.num_rows;
-	ia64BootParamG.console_info.orig_x =
-				ia64_boot_paramP->console_info.orig_x;
-	ia64BootParamG.console_info.orig_y =
-				ia64_boot_paramP->console_info.orig_y;
-	ia64BootParamG.fpswa = ia64_boot_paramP->fpswa;
-	ia64BootParamG.initrd_start = ia64_boot_paramP->initrd_start;
-	ia64BootParamG.initrd_size = ia64_boot_paramP->initrd_size;
-	ia64BootParamG.domain_start = ia64_boot_paramP->domain_start;
-	ia64BootParamG.domain_size = ia64_boot_paramP->domain_size;
-
-	/*
-	 * Copy and parse the boot command line.
-	 * Currently only a check of bootverbose is done.
-	 */
-	memset(boot_cmd_line, 0, sizeof(boot_cmd_line));
-	strncpy(boot_cmd_line,
-		(char*)__va(ia64BootParamG.command_line), COMMAND_LINE_SIZE);
-	boot_cmd_line[COMMAND_LINE_SIZE - 1] = '\0';
-
-	/* Look for bootverbose. */
-	if (strstr(boot_cmd_line, "bootverbose"))
-		bootverbose = 1;
-}
-
-static void
-set_opt_feature(void)
-{
-	struct xen_ia64_opt_feature optf;
-
-	optf.cmd = XEN_IA64_OPTF_IDENT_MAP_REG7;
-	optf.on = XEN_IA64_OPTF_ON;
-	optf.pgprot = ((1 << PTE_OFF_P) | (1 << PTE_OFF_A) | (1 << PTE_OFF_D) |
-		       (PTE_MA_WB << PTE_OFF_MA) |
-		       (PTE_PL_KERN << PTE_OFF_PL) |
-		       (PTE_AR_RW << PTE_OFF_AR));
-	optf.key = IA64_KEY_REG7;
-	HYPERVISOR_opt_feature(&optf);
-}
-
-void
-arch_init(start_info_t *si)
-{
-	efi_time_t tm;
-	static int initialized;
-
-	if (initialized)
-		return;
-
-	init_start_info(si);
-
-	init_boot_params();
-
-	init_efi();
-
-	map_pal_code();
-
-	ia64_sal_init(machineFwG.ia64_sal_tableP);
-
-	if (efi_get_time(&tm)) {
-		printk("EFI-SystemTime: %d.%d.%d   %d:%d:%d",
-		       tm.Day, tm.Month, tm.Year,
-		       tm.Hour, tm.Minute, tm.Second);
-
-		if (tm.TimeZone == EFI_UNSPECIFIED_TIMEZONE)
-			printk("   Timezone not specified!\n");
-		else
-			printk("   TimeZone: %d Daylight: 0x%x\n",
-			       tm.TimeZone, tm.Daylight);
-	} else 
-		printk("efi_get_time() failed\n");
-
-	registerCallback();
-
-	set_opt_feature();
-
-	initialized = 1;
-}
-
-void
-arch_fini(void)
-{
-	/* TODO */
-}
-
-void
-arch_print_info(void)
-{
-	int major, minor;
-
-	minor = HYPERVISOR_xen_version(XENVER_version, 0);
-	major = minor >> 16;
-	minor &= ~0xffffffff;
-	printk("Running on Xen version: %d.%d\n", major, minor);
-#if 0
-	printk("machine addr of shared_info_t  : 0x%lx\n",
-	       start_info.shared_info);
-	printk("machine page number of shared page: 0x%lx\n",
-	       start_info.store_mfn);
-	printk("evtchn for store communication : %d\n",
-	       start_info.store_evtchn);
-	printk("MACHINE address of console page: 0x%lx\n",
-	       start_info.console.domU.mfn);
-	printk("evtchn for console messages    : %d\n",
-	       start_info.console.domU.evtchn);
-#endif
-	if(strlen(boot_cmd_line) > 0)
-		printk("xen_guest_cmdline              : %s\n", boot_cmd_line);
-}
-
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/arch/ia64/debug.c
--- a/extras/mini-os/arch/ia64/debug.c	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,168 +0,0 @@
-/* 
- ****************************************************************************
- * Done by Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com
- *
- * Description:	ia64 specific part of the mini-os
- * 		Prints debug information on a crash of mini-os
- *
- * Parts are taken from FreeBSD.
- *
- ****************************************************************************
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- * 
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
- * DEALINGS IN THE SOFTWARE.
- */
-
-#include <mini-os/os.h>
-
-static const char *ia64_vector_names[] = {
-	"VHPT Translation",			/* 0 */
-	"Instruction TLB",			/* 1 */
-	"Data TLB",				/* 2 */
-	"Alternate Instruction TLB",		/* 3 */
-	"Alternate Data TLB",			/* 4 */
-	"Data Nested TLB",			/* 5 */
-	"Instruction Key Miss",			/* 6 */
-	"Data Key Miss",			/* 7 */
-	"Dirty-Bit",				/* 8 */
-	"Instruction Access-Bit",		/* 9 */
-	"Data Access-Bit",			/* 10 */
-	"Break Instruction",			/* 11 */
-	"External Interrupt",			/* 12 */
-	"Reserved 13",				/* 13 */
-	"Reserved 14",				/* 14 */
-	"Reserved 15",				/* 15 */
-	"Reserved 16",				/* 16 */
-	"Reserved 17",				/* 17 */
-	"Reserved 18",				/* 18 */
-	"Reserved 19",				/* 19 */
-	"Page Not Present",			/* 20 */
-	"Key Permission",			/* 21 */
-	"Instruction Access Rights",		/* 22 */
-	"Data Access Rights",			/* 23 */
-	"General Exception",			/* 24 */
-	"Disabled FP-Register",			/* 25 */
-	"NaT Consumption",			/* 26 */
-	"Speculation",				/* 27 */
-	"Reserved 28",				/* 28 */
-	"Debug",				/* 29 */
-	"Unaligned Reference",			/* 30 */
-	"Unsupported Data Reference",		/* 31 */
-	"Floating-point Fault",			/* 32 */
-	"Floating-point Trap",			/* 33 */
-	"Lower-Privilege Transfer Trap",	/* 34 */
-	"Taken Branch Trap",			/* 35 */
-	"Single Step Trap",			/* 36 */
-	"Reserved 37",				/* 37 */
-	"Reserved 38",				/* 38 */
-	"Reserved 39",				/* 39 */
-	"Reserved 40",				/* 40 */
-	"Reserved 41",				/* 41 */
-	"Reserved 42",				/* 42 */
-	"Reserved 43",				/* 43 */
-	"Reserved 44",				/* 44 */
-	"IA-32 Exception",			/* 45 */
-	"IA-32 Intercept",			/* 46 */
-	"IA-32 Interrupt",			/* 47 */
-	"Reserved 48",				/* 48 */
-	"Reserved 49",				/* 49 */
-	"Reserved 50",				/* 50 */
-	"Reserved 51",				/* 51 */
-	"Reserved 52",				/* 52 */
-	"Reserved 53",				/* 53 */
-	"Reserved 54",				/* 54 */
-	"Reserved 55",				/* 55 */
-	"Reserved 56",				/* 56 */
-	"Reserved 57",				/* 57 */
-	"Reserved 58",				/* 58 */
-	"Reserved 59",				/* 59 */
-	"Reserved 60",				/* 60 */
-	"Reserved 61",				/* 61 */
-	"Reserved 62",				/* 62 */
-	"Reserved 63",				/* 63 */
-	"Reserved 64",				/* 64 */
-	"Reserved 65",				/* 65 */
-	"Reserved 66",				/* 66 */
-	"Reserved 67",				/* 67 */
-};
-
-typedef struct
-{
-	uint64_t sof	:7;	/* 0-6 size of frame */
-	uint64_t sol	:7;	/* 7-13 size of locals (in + loc) */
-	uint64_t sor	:4;
-	uint64_t rrb_gr	:7;
-	uint64_t rrb_fr	:7;
-	uint64_t rrb_pr	:6;
-	uint64_t res	:25;	/* reserved */
-	uint64_t v	:1;	/* The v bit */
-} ifs_t;
-
-void
-do_trap_error(trap_frame_t* tf)
-{
-	ifs_t curIfs;
-
-	printk("TRAP in mini-os:\n");
-	printk("  trap: %d (%s)\n", tf->trap_num,
-	       ia64_vector_names[tf->trap_num]);
-	printk("  iip : 0x%.16lx  ifa: 0x%.16lx\n", tf->iip, tf->ifa);
-	printk("  ipsr: 0x%.16lx  ifs: 0x%.16lx\n", tf->ipsr, tf->ifs);
-	printk("  isr : 0x%.16lx\n", tf->isr);
-	printk("  gp  : 0x%.16lx  sp : 0x%.16lx\n", tf->gp, tf->sp);
-	printk("  rp  : 0x%.16lx  tp : 0x%.16lx\n", tf->b0, tf->tp);
-	printk("  b6  : 0x%.16lx  b7 : 0x%.16lx\n", tf->b6, tf->b7);
-	printk("  r8  : 0x%.16lx\n", tf->r8);
-	printk("  bsp : 0x%.16lx  rsc: 0x%.16lx\n", tf->bsp, tf->rsc);
-	printk("  r14 : 0x%.16lx  r15: 0x%.16lx\n", tf->r14, tf->r15);
-	printk("  r16 : 0x%.16lx  r17: 0x%.16lx\n", tf->r16, tf->r17);
-	printk("  r18 : 0x%.16lx  r19: 0x%.16lx\n", tf->r18, tf->r19);
-	printk("  r20 : 0x%.16lx  r21: 0x%.16lx\n", tf->r20, tf->r21);
-	printk("  r22 : 0x%.16lx  r23: 0x%.16lx\n", tf->r22, tf->r23);
-	printk("  r24 : 0x%.16lx  r25: 0x%.16lx\n", tf->r24, tf->r25);
-	printk("  r26 : 0x%.16lx  r27: 0x%.16lx\n", tf->r26, tf->r27);
-	printk("  r28 : 0x%.16lx  r29: 0x%.16lx\n", tf->r28, tf->r29);
-	printk("  r30 : 0x%.16lx  r31: 0x%.16lx\n", tf->r30, tf->r31);
-
-	__asm __volatile("flushrs;;");
-	curIfs = *((ifs_t*)((void*)(&tf->ifs)));
-	if (!curIfs.v)
-		printk(" ifs.v = 0");
-	else {
-		uint64_t* regP;
-		uint32_t  i;
-
-		printk("  cfm.sof: %d  cfm.sol: %d\n", curIfs.sof, curIfs.sol);
-		regP = (uint64_t *)(tf->bsp + tf->ndirty);
-		for (i = curIfs.sof; i != 0; ) {
-			if (i <= (((uint64_t)regP & 0x000001f8) >> 3)) {
-				regP -= i;
-				i = 0;
-				break;
-			}
-			i -= ((uint64_t)regP & 0x000001f8) >> 3;
-			regP = (uint64_t *)((uint64_t)regP & ~0x000001ff) - 1;
-		}
-		for (i = 0; i < curIfs.sof; i++) {
-			if (((uint64_t)regP & 0x000001f8) == 0x000001f8)
-				regP++;
-			printk("  r%d: 0x%lx\n",  i+32, *regP);
-			regP++;
-		}
-	}
-	HYPERVISOR_shutdown(SHUTDOWN_poweroff);
-}
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/arch/ia64/efi.c
--- a/extras/mini-os/arch/ia64/efi.c	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,218 +0,0 @@
-/*
- * Done by Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
- * The code is partly taken from FreeBSD.
- *
- ***************************************************************************
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- */
-
-
-#include <mini-os/os.h>
-#include <mini-os/efi.h>
-#include <mini-os/page.h>
-#include <mini-os/lib.h>
-#include <mini-os/console.h>
-
-
-/* The implementation is in fw.S. */
-extern uint64_t
-ia64_call_efi_func(uint64_t funcP,uint64_t a,uint64_t b,uint64_t c,uint64_t d);
-
-int
-efi_get_time(efi_time_t* tmP)
-{
-	memset(tmP, 0, sizeof(efi_time_t));
-	if (ia64_call_efi_func((uint64_t)machineFwG.efi.getTimeF,
-			       (uint64_t)tmP,
-			       (uint64_t)NULL, 0, 0) != EFI_SUCCESS) {
-		printk("efi.getTime() failed\n");
-		return 0;
-	}
-	return 1;
-}
-
-/*
- * The function compares two efi_guid_t and returns 0 on equality, otherwise 1.
- */
-static int
-efi_guid_cmp(efi_guid_t* a_le, efi_guid_t* b)
-{
-	return memcmp(a_le, b, sizeof(efi_guid_t));
-}
-
-void
-init_efi(void)
-{
-	efi_system_table_t* efiSysTableP;
-	int mdcnt, i, numConvMem;
-	efi_memory_descriptor_t *memdP, *mdP;
-	efi_status_t status;
-	char fwVendor[100] = "unknown";
-	efi_char16_t* fwP;
-	efi_runtime_services_t* rsP;
-
-	efi_configuration_table_t* confP = (efi_configuration_table_t*)0;
-	efi_guid_t sal = SAL_SYSTEM_TABLE_GUID;
-	efi_guid_t acpi = ACPI_TABLE_GUID;
-	efi_guid_t acpi20 = ACPI_20_TABLE_GUID;
-	
-	memset(&machineFwG, 0, sizeof(machineFwG));
-	/* Read the efi_system_table.  */
-	efiSysTableP = (efi_system_table_t*)__va(ia64BootParamG.efi_systab);
-	machineFwG.efi.efiSysTableP = efiSysTableP;
-	PRINT_BV("EfiSystemTable at: %p\n", efiSysTableP);
-	fwP = (uint16_t*) __va(efiSysTableP->FirmwareVendor);
-	if (fwP) {
-		for (i = 0; i < (int)sizeof(fwVendor) - 1 && *fwP; ++i)
-			fwVendor[i] = *fwP++;
-		fwVendor[i] = '\0';
-	}
-	PRINT_BV("  EFI-FirmwareVendor        : %s\n", fwVendor);
-	PRINT_BV("  EFI-FirmwareRevision      : %d\n",
-		 efiSysTableP->FirmwareRevision);
-	PRINT_BV("  EFI-SystemTable-Revision  : %d.%d\n",
-		 efiSysTableP->Hdr.Revision >> 16,
-		 efiSysTableP->Hdr.Revision & 0xffff);
-	rsP = (efi_runtime_services_t*)
-		__va(efiSysTableP->RuntimeServices);
-	mdcnt = ia64BootParamG.efi_memmap_size /
-		ia64BootParamG.efi_memdesc_size;
-	memdP = (efi_memory_descriptor_t*) __va(ia64BootParamG.efi_memmap);
-
-	PRINT_BV("EFI-Memorydescriptors: %d\n", mdcnt);
-
-	for (i = numConvMem = 0, mdP = memdP; i < mdcnt; i++,
-	     mdP = NextMemoryDescriptor(mdP, ia64BootParamG.efi_memdesc_size)) {
-		/* Relocate runtime memory segments for firmware. */
-		PRINT_BV("  %d. Type: %x  Attributes: 0x%lx\n",
-			 i, mdP->Type, mdP->Attribute);
-		PRINT_BV("     PhysStart: 0x%lx  NumPages: 0x%lx\n",
-			 mdP->PhysicalStart, mdP->NumberOfPages);
-		switch (mdP->Type) {
-			case EfiRuntimeServicesData:
-				PRINT_BV("     -> EfiRuntimeServicesData\n");
-				break;
-			case EfiACPIReclaimMemory:
-				PRINT_BV("     -> EfiACPIReclaimMemory\n");
-				break;
-			case EfiACPIMemoryNVS:
-				PRINT_BV("     -> EfiACPIMemoryNVS\n");
-				break;
-			case EfiConventionalMemory:
-				PRINT_BV("     -> EfiConventionalMemory\n");
-				PRINT_BV("        start: 0x%lx end: 0x%lx\n",
-					mdP->PhysicalStart,
-					mdP->PhysicalStart +
-					mdP->NumberOfPages * EFI_PAGE_SIZE);
-				if (numConvMem) {
-					printk("     Currently only one efi "
-						"memory chunk supported !!!\n");
-					break;
-				}
-				machineFwG.mach_mem_start = mdP->PhysicalStart;
-				machineFwG.mach_mem_size =
-					mdP->NumberOfPages * EFI_PAGE_SIZE;
-				numConvMem++;
-				break;
-			case EfiMemoryMappedIOPortSpace:
-				PRINT_BV("     -> EfiMemMappedIOPortSpace\n");
-				break;
-			case EfiPalCode:
-                       		machineFwG.ia64_pal_base =
-					__va(mdP->PhysicalStart);
-				PRINT_BV("     -> EfiPalCode\n"
-					 "        start : %p\n",
-					 machineFwG.ia64_pal_base);
-				break;
-		}
-		/* I have to setup the VirtualStart address of every
-		 * RUNTIME-area in preparing the later call of
-		 * SetVirtualAddressMap() therewidth the efi stuff uses
-		 * virtual addressing and the efi runtime functions
-		 * may be called directly.
-		 */
-		if (mdP->Attribute & EFI_MEMORY_RUNTIME) {
-			if (mdP->Attribute & EFI_MEMORY_WB)
-				mdP->VirtualStart = __va(mdP->PhysicalStart);
-			else {
-				if (mdP->Attribute & EFI_MEMORY_UC)
-					printk("efi_init: RuntimeMemory with "
-						"UC attribute !!!!!!\n");
-					/*
-					mdP->VirtualStart =
-					IA64_PHYS_TO_RR6(mdP->PhysicalStart);
-					*/
-			}
-		}
-	}
-	/* Now switch efi runtime stuff to virtual addressing. */
-	status = ia64_call_efi_physical(
-			(void*)__va((uint64_t)rsP->SetVirtualAddressMap),
-			ia64BootParamG.efi_memmap_size,
-			ia64BootParamG.efi_memdesc_size,
-			ia64BootParamG.efi_memdesc_version,
-			ia64BootParamG.efi_memmap);
-	status = EFI_SUCCESS;
-	if (status != EFI_SUCCESS) {
-		printk("warning: unable to switch EFI into virtual "
-		       "(status=%lu)\n", status);
-		return;
-	}
-	/* Getting efi function pointer for getEfiTime. */
-	machineFwG.efi.getTimeF =
-		(efi_get_time_t)__va((uint64_t)rsP->GetTime);
-	/* Getting efi function pointer for resetSystem. */
-	machineFwG.efi.resetSystemF =
-		(efi_reset_system_t)__va((uint64_t)rsP->ResetSystem);
-
-	/* Scanning the Configuration table of the EfiSystemTable. */
-	PRINT_BV("NumberOfConfigTableEntries: %ld\n",
-		 efiSysTableP->NumberOfTableEntries);
-
-	confP = (efi_configuration_table_t*)
-			__va(efiSysTableP->ConfigurationTable);
-	for (i = 0; i < efiSysTableP->NumberOfTableEntries; i++) {
-		if (!efi_guid_cmp(&confP[i].VendorGuid, &sal)) {
-			machineFwG.ia64_sal_tableP = (sal_system_table_t*)
-				__va((uint64_t) confP[i].VendorTable);
-			PRINT_BV("  Found SalSystemTable at: 0x%lx\n",
-				 (uint64_t) machineFwG.ia64_sal_tableP);
-			continue;
-		}
-		if (!efi_guid_cmp(&confP[i].VendorGuid, &acpi)) {
-			machineFwG.ia64_efi_acpi_table =
-				__va((uint64_t) confP[i].VendorTable);
-			PRINT_BV("  Found AcpiTable at:      0x%lx\n",
-				 (uint64_t) machineFwG.ia64_efi_acpi_table);
-			continue;
-		}
-		if (!efi_guid_cmp(&confP[i].VendorGuid, &acpi20)) {
-			machineFwG.ia64_efi_acpi20_table =
-				__va((uint64_t) confP[i].VendorTable);
-			PRINT_BV("  Found Acpi20Table at:    0x%lx\n",
-				 (uint64_t) machineFwG.ia64_efi_acpi20_table);
-			continue;
-		}
-	}
-}
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/arch/ia64/fw.S
--- a/extras/mini-os/arch/ia64/fw.S	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,499 +0,0 @@
-/*
- * Done by Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
- * Parts taken from FreeBSD.
- *
- ***************************************************************************
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- */
-
-
-#include <mini-os/asm.h>
-#include <mini-os/page.h>
-#include <mini-os/ia64_cpu.h>
-#include <mini-os/ia64_fpu.h>
-#include <mini-os/offsets.h>
-#include <mini-os/xen/xen.h>
-
-
-/*
- * ia64_change_mode:	change mode to/from physical mode
- *
- * Arguments:
- *	r14	psr for desired mode
- *
- * Modifies:
- *	r15-r20	scratch
- *	ar.bsp	translated to new mode
- *	sp	translated to new mode
- *	iip	translated to new mode
- */
-ENTRY(ia64_change_mode)
-	rsm	psr.i | psr.ic
-	mov	r19=ar.rsc		// save rsc while we change mode
-	tbit.nz	p8,p9=r14,17		// Uses psr.dt-physical or virtual ?
-			// p8 == true: switch to virtual
-			// p9 == true: switch to physical
-	;;
-	mov	ar.rsc=IA64_RSE_LAZY	// turn off RSE
-	mov	r16=rp
-	;;
-	flushrs				// clean the rse
-	srlz.i
-	;;
-1:	mov	r15=ip
-	mov	r17=ar.bsp
-	mov	r18=ar.rnat
-	;;
-	add	r15=2f-1b,r15		// address to rfi to
-		/* !!! must be the same like in  minios-ia64.lds */
-(p8)	movl	r20=(KERNEL_START - (1<<KERNEL_PHYS_START_SHIFT))
-	;;
-			// (p8): switch to virtual
-			// (p9): switch to physical
-
-		// from virtual to physical
-(p9)	tpa	r15=r15			// ip
-(p9)	tpa	r16=r16			// rp
-(p9)	tpa	r17=r17			// ar.bsp
-(p9)	tpa	sp=sp			// sp
-	;;		/* Needed only for assembler violate ... warnings. */
-		// from physical to virtual
-(p8)	add	r15=r20,r15		// ip
-(p8)	add	r16=r20,r16		// rp
-(p8)	add	r17=r20,r17		// ar.bsp
-(p8)	add	sp=r20,sp		// sp
-	;;
-	mov	ar.bspstore=r17
-	mov	rp=r16
-	;;
-	mov	ar.rnat=r18
-	mov	cr.iip=r15
-	mov	cr.ipsr=r14		// psr for new mode
-	mov	cr.ifs=r0
-	;;
-	rfi
-	;;
-2:	mov	ar.rsc=r19		// restore ar.rsc
-	;;
-	br.ret.sptk.few rp		// now in new mode
-END(ia64_change_mode)
-
-/*
- * ia64_physical_mode:  change mode to physical mode
- *
- * Return:
- *  ret0  psr to restore
- *
- * Modifies:
- *  r15-r18 scratch
- *  ar.bsp  tranlated to physical mode
- *  psr.i cleared
- */
-ENTRY(ia64_physical_mode)
-	mov	r14=psr
-	movl	r15=(IA64_PSR_I|IA64_PSR_IT|IA64_PSR_DT|	\
-			IA64_PSR_RT|IA64_PSR_DFL|IA64_PSR_DFH)
-	;;
-	mov	ret0=r14
-	movl	r16=IA64_PSR_BN
-	;;
-	andcm	r14=r14,r15	// clear various xT bits
-	;;
-	or	r14=r14,r16	// make sure BN=1
-	or	ret0=ret0,r16	// make sure BN=1
-	;;
-	br.cond.sptk.many ia64_change_mode
-END(ia64_physical_mode)
-
-/*
- * ia64_call_efi_physical:	call an EFI procedure in physical mode
- *
- * Arguments:
- *	in0		Address of EFI procedure descriptor
- *	in1-in5		Arguments to EFI procedure
- *
- * Return:
- *	ret0-ret3	return values from EFI
- *
- */
-ENTRY(ia64_call_efi_physical)
-	.prologue
-	.regstk	6,4,5,0
-	.save	ar.pfs,loc0
-	alloc	loc0=ar.pfs,6,4,5,0
-	;;
-	.save	rp,loc1
-	mov	loc1=rp
-	;;
-	.body
-	br.call.sptk.many rp=ia64_physical_mode
-	;;
-
-	mov	loc2=r8			// psr to restore mode
-	mov	loc3=gp			// save kernel gp
-	ld8	r14=[in0],8		// function address
-	;;
-	ld8	gp=[in0]		// function gp value
-	mov	out0=in1
-	mov	out1=in2
-	mov	out2=in3
-	mov	out3=in4
-	mov	out4=in5
-	mov	b6=r14
-	;;
-	br.call.sptk.many rp=b6		// call EFI procedure
-	mov	gp=loc3			// restore kernel gp
-	mov	r14=loc2		// psr to restore mode
-	;;
-	br.call.sptk.many rp=ia64_change_mode
-	;;
-	mov	rp=loc1
-	mov	ar.pfs=loc0
-	;;
-	br.ret.sptk.many rp
-END(ia64_call_efi_physical)
-	
-
-/*
- * struct ia64_pal_result ia64_call_pal_static(uint64_t proc,
- *	uint64_t arg1, uint64_t arg2, uint64_t arg3)
- */
-ENTRY(ia64_call_pal_static)
-	
-	.regstk	4,5,0,0
-palret	=	loc0
-entry	=	loc1
-rpsave	=	loc2
-pfssave =	loc3
-psrsave	=	loc4
-
-	alloc	pfssave=ar.pfs,4,5,0,0
-	;; 
-	mov	rpsave=rp
-
-	movl	entry=@gprel(ia64_pal_entry)
-1:	mov	palret=ip		// for return address
-	;;
-	add	entry=entry,gp
-	mov	psrsave=psr
-	mov	r28=in0			// procedure number
-	;;
-	ld8	entry=[entry]		// read entry point
-	mov	r29=in1			// copy arguments
-	mov	r30=in2
-	mov	r31=in3
-	;;
-	mov	b6=entry
-	add	palret=2f-1b,palret	// calculate return address
-	;;
-	mov	b0=palret
-	rsm	psr.i			// disable interrupts
-	;;
-	br.cond.sptk b6			// call into firmware
-	;;
-	ssm	psr.i			// enable interrupts
-	;;
-2:	mov	psr.l=psrsave
-	mov	rp=rpsave
-	mov	ar.pfs=pfssave
-	;;
-	srlz.d
-	br.ret.sptk rp
-
-END(ia64_call_pal_static)
-
-/*
- * Call a efi function.
- * in0: func descriptor
- * in1: param1
- * ...
- * in5: param5
- */
-ENTRY(ia64_call_efi_func)
-	alloc	loc0=ar.pfs,6,3,5,0
-
-	mov	loc1=gp
-	mov	loc2=rp
-
-	mov	out0=in1
-	mov	out1=in2
-	mov	out2=in3
-	mov	out3=in4
-	mov	out4=in5
-
-	ld8	r14=[in0],8		// get function address
-	;;
-	ld8	gp=[in0]		// function gp value
-	;;
-	mov	b6=r14
-	br.call.sptk.many rp=b6		// call EFI procedure
-	
-	mov	ar.pfs=loc0
-	mov	gp=loc1
-	mov	rp=loc2
-	br.ret.sptk rp
-
-END(ia64_call_efi_func)
-
-
-/* Restore the context from the thread context.
- */
-ENTRY(restore_context)
-{	.mmi
-	invala
-	mov	ar.rsc=IA64_RSE_LAZY
-	add	r29=SW_SP,in0
-}
-	add	r30=SW_RP,in0
-	add	r31=SW_PR,in0
-	;;
-	ld8	r12=[r29],SW_LC-SW_SP		// load sp
-	ld8	r16=[r30],SW_BSP-SW_RP		// load rp
-	;;
-	ld8	r17=[r31],SW_RNAT-SW_PR		// load pr
-	ld8	r18=[r30],SW_PFS-SW_BSP		// load bsp
-	mov	rp=r16
-	;;
-	ld8	r16=[r31],SW_R4-SW_RNAT		// load rnat
-	mov	pr=r17,-1			// set pr
-	mov	ar.bspstore=r18
-	;;
-	ld8	r18=[r30],SW_UNATA-SW_PFS	// load pfs
-	ld8	r17=[r29],SW_UNATB-SW_LC	// load lc
-	mov	ar.rnat=r16
-	;;
-	ld8	r16=[r30],SW_R5-SW_UNATA	// load unat_a
-	mov	ar.pfs=r18
-	mov	ar.lc=r17
-	;;
-	ld8.fill r4=[r31],SW_R6-SW_R4		// load r4
-	mov	ar.unat=r16
-	;;
-	ld8.fill r5=[r30],SW_R7-SW_R5		// load r5
-	ld8	r16=[r29],SW_B3-SW_UNATB	// load unat_b
-	mov	ar.rsc=IA64_RSE_EAGER
-	;;
-	ld8.fill r6=[r31],SW_B1-SW_R6		// load r6
-	ld8.fill r7=[r30],SW_B2-SW_R7		// load r7
-	;;
-	ld8	r17=[r31],SW_B4-SW_B1		// load b1
-	ld8	r18=[r30],SW_B5-SW_B2		// load b2
-	mov	ar.unat=r16			// unat_b
-	;;
-	ld8	r16=[r29],SW_F2-SW_B3		// load b3
-	mov	b1=r17
-	mov	b2=r18
-	;;
-	ld8	r17=[r31],SW_F3-SW_B4		// load b4
-	ld8	r18=[r30],SW_F4-SW_B5		// load b5
-	mov	b3=r16
-	;;
-	ldf.fill f2=[r29]			// load f2
-	mov	b4=r17
-	mov	b5=r18
-	;;
-	ldf.fill f3=[r31],SW_F5-SW_F3		// load f3
-	ldf.fill f4=[r30],SW_F4-SW_F2		// load f4
-	;;
-	ldf.fill f5=[r31],SW_F5-SW_F3		// load f5
-	ldf.fill f16=[r30],SW_F4-SW_F2		// load f16
-	;;
-	ldf.fill f17=[r31],SW_F5-SW_F3		// load f17
-	ldf.fill f18=[r30],SW_F4-SW_F2		// load f18
-	;;
-	ldf.fill f19=[r31],SW_F5-SW_F3		// load f19
-	ldf.fill f20=[r30],SW_F4-SW_F2		// load f20
-	;;
-	ldf.fill f21=[r31],SW_F5-SW_F3		// load f21
-	ldf.fill f22=[r30],SW_F4-SW_F2		// load f22
-	;;
-	ldf.fill f23=[r31],SW_F5-SW_F3		// load f23
-	ldf.fill f24=[r30],SW_F4-SW_F2		// load f24
-	;;
-	ldf.fill f25=[r31],SW_F5-SW_F3		// load f25
-	ldf.fill f26=[r30],SW_F4-SW_F2		// load f26
-	;;
-	ldf.fill f27=[r31],SW_F5-SW_F3		// load f27
-	ldf.fill f28=[r30],SW_F4-SW_F2		// load f28
-	;;
-	ldf.fill f29=[r31],SW_F5-SW_F3		// load f29
-	ldf.fill f30=[r30],SW_F4-SW_F2		// load f30
-	;;
-	ldf.fill f31=[r30],SW_F4-SW_F2		// load f31
-	add		r8=1,r0
-	br.ret.sptk	rp
-	;;
-END(restore_context)
-
-/*
- * void switch_context(struct thread* old, struct thread* new)
- */
-ENTRY(switch_context)
-
-	mov	ar.rsc=IA64_RSE_LAZY
-	mov	r16=ar.unat
-	add	r31=SW_UNATB,in0
-	add	r30=SW_SP,in0
-	;;
-{	.mmi
-	flushrs
-	st8	[r30]=sp,SW_RP-SW_SP		// sp
-	mov	r17=rp
-	;;
-}
-	st8	[r31]=r16,SW_PR-SW_UNATB	// unat (before)
-	st8	[r30]=r17,SW_BSP-SW_RP		// rp
-	mov	r16=pr
-	;;
-	st8	[r31]=r16,SW_PFS-SW_PR		// pr
-	mov	r17=ar.bsp
-	mov	r16=ar.pfs
-	;;
-	st8	[r31]=r16,SW_RNAT-SW_PFS	// save pfs
-	st8	[r30]=r17,SW_R4-SW_BSP		// save bsp
-	mov	r16=ar.rnat
-	;;
-	st8	[r31]=r16,SW_R5-SW_RNAT		// save rnat
-	mov	ar.rsc=IA64_RSE_EAGER
-	;;
-{	.mmi
-	.mem.offset	8,0
-	st8.spill	[r30]=r4,SW_R6-SW_R4	// r4
-	.mem.offset	16,0
-	st8.spill	[r31]=r5,SW_R7-SW_R5	// r5
-	mov		r16=b1
-	;;
-}
-{	.mmi
-	.mem.offset	8,0
-	st8.spill	[r30]=r4,SW_B1-SW_R6	// r6
-	.mem.offset	16,0
-	st8.spill	[r31]=r5,SW_B2-SW_R7	// r7
-	mov		r17=b2
-	;;
-}
-	st8	[r30]=r16,SW_UNATA-SW_B1	// b1
-	st8	[r31]=r17,SW_B3-SW_B2		// b2
-	mov	r18=ar.unat
-	mov	r19=b3
-	mov	r20=b4
-	mov	r21=b5
-	;;
-	st8	[r30]=r18,SW_B4-SW_UNATA	// unat (after)
-	st8	[r31]=r19,SW_B5-SW_B3		// b3
-	;;
-	st8	[r30]=r20,SW_LC-SW_B4		// b4
-	st8	[r31]=r21,SW_F2-SW_B5		// b5
-	mov	r17=ar.lc
-	;;
-	st8		[r30]=r17,SW_F3-SW_LC	// ar.lc
-	stf.spill	[r31]=f2,SW_F4-SW_F2
-	;;
-	stf.spill	[r30]=f3,SW_F5-SW_F3
-	stf.spill	[r31]=f4,SW_F4-SW_F2
-	;;
-	stf.spill	[r30]=f5,SW_F5-SW_F3
-	stf.spill	[r31]=f16,SW_F4-SW_F2
-	;;
-	stf.spill	[r30]=f17,SW_F5-SW_F3
-	stf.spill	[r31]=f18,SW_F4-SW_F2
-	;;
-	stf.spill	[r30]=f19,SW_F5-SW_F3
-	stf.spill	[r31]=f20,SW_F4-SW_F2
-	;;
-	stf.spill	[r30]=f21,SW_F5-SW_F3
-	stf.spill	[r31]=f22,SW_F4-SW_F2
-	;;
-	stf.spill	[r30]=f23,SW_F5-SW_F3
-	stf.spill	[r31]=f24,SW_F4-SW_F2
-	;;
-	stf.spill	[r30]=f25,SW_F5-SW_F3
-	stf.spill	[r31]=f26,SW_F4-SW_F2
-	;;
-	stf.spill	[r30]=f27,SW_F5-SW_F3
-	stf.spill	[r31]=f28,SW_F4-SW_F2
-	;;
-	stf.spill	[r30]=f29,SW_F4-SW_F2
-	stf.spill	[r31]=f30
-	;;
-	stf.spill	[r30]=f31
-	add		r8=0,r0
-	mf
-//	br.ret.sptk	rp
-
-{	.mfb
-	mov		r32=r33
-	nop		0
-	br.sptk		restore_context
-	;;
-}
-
-END(switch_context)
-
-/*
- * The function is used to start a new thread.
- */
-ENTRY(thread_starter)
-
-	.prologue
-	.save	ar.pfs,loc0
-	alloc	loc0=ar.pfs,0,1,1,0
-	;;
-	.body
-	;;
-	mov	b7=r4			// the function pointer
-	mov	out0=r6			// the argument
-	;;
-	br.call.sptk.many rp=b7		// Call the thread function
-	;;
-	br.call.sptk.many rp=exit_thread	// call exit_thread
-	;;
-END(thread_starter)
-
-ENTRY(__hypercall)
-	mov r2=r37
-	break 0x1000
-	br.ret.sptk.many b0
-	;;
-END(__hypercall)
-
-/*
- * Stub for suspend.
- * Just force the stacked registers to be written in memory.
- */
-ENTRY(xencomm_arch_hypercall_suspend)
-	;;
-	alloc	r20=ar.pfs,0,0,6,0
-	mov	r2=__HYPERVISOR_sched_op
-	;;
-	/* We don't want to deal with RSE.  */
-	flushrs
-	mov	r33=r32
-	mov	r32=2		// SCHEDOP_shutdown
-	;;
-	break	0x1000
-	;;
-	br.ret.sptk.many b0
-END(xencomm_arch_hypercall_suspend)
-
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/arch/ia64/gen_off.c
--- a/extras/mini-os/arch/ia64/gen_off.c	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,141 +0,0 @@
-/*
- * Copyright (c) 2007 Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
- *
- ******************************************************************************
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- */
-#include <mini-os/types.h>
-#include <mini-os/sched.h>
-#include <xen/xen.h>
-#include <xen/arch-ia64.h>
-
-#define DEFINE(sym, val)					\
-  asm volatile("\n->" sym " %0 /* " #val " */": : "i" (val))
-#define DEFINE_STR2(sym, pfx, val)				\
-  asm volatile("\n->" sym " " pfx "%0" : : "i"(val));
-
-#define SZ(st,e) sizeof(((st *)0)->e)
-#define OFF(st,e,d,o)				\
-  DEFINE(#d, offsetof(st, e) + o);		\
-  DEFINE(#d "_sz", SZ(st,e ));			\
-  DEFINE_STR2(#d "_ld", "ld", SZ(st, e));	\
-  DEFINE_STR2(#d "_st", "st", SZ(st, e));			
-
-#define TFOFF(e,d) OFF(trap_frame_t, e, d, 0)
-#define SIZE(st,d) DEFINE(#d, sizeof(st))
-
-#define SWOFF(e,d) OFF(struct thread, e, d, 0)
-
-/* shared_info_t from xen/xen.h */
-#define SI_OFF(e, d) OFF(shared_info_t, e, d,0)
-/* mapped_regs_t from xen/arch-ia64.h */
-#define MR_OFF(e, d) OFF(mapped_regs_t, e, d, XMAPPEDREGS_OFS)
-
-int
-main(int argc, char ** argv)
-{
-	TFOFF(cfm, TF_CFM);
-	TFOFF(pfs, TF_PFS);
-	TFOFF(bsp, TF_BSP);
-	TFOFF(rnat, TF_RNAT);
-	TFOFF(csd, TF_CSD);
-	TFOFF(ccv, TF_CCV);
-	TFOFF(unat, TF_UNAT);
-	TFOFF(fpsr, TF_FPSR);
-	TFOFF(pr, TF_PR);	
-
-	TFOFF(sp, TF_SP);
-	TFOFF(gp, TF_GP);
-	TFOFF(tp, TF_TP);
-
-	TFOFF(r2, TF_GREG2);
-	TFOFF(r3, TF_GREG3);
-	TFOFF(r16, TF_GREG16);
-	TFOFF(r17, TF_GREG17);
-
-	TFOFF(b0, TF_BREG0);
-	TFOFF(b6, TF_BREG6);
-	TFOFF(b7, TF_BREG7);
-
-	TFOFF(f6, TF_FREG6);
-	TFOFF(f7, TF_FREG7);
-
-	TFOFF(rsc, TF_RSC);
-	TFOFF(ndirty, TF_NDIRTY);
-	TFOFF(ssd, TF_SSD);
-	TFOFF(iip, TF_IIP);
-	TFOFF(ipsr, TF_IPSR);
-	TFOFF(ifs, TF_IFS);
-	TFOFF(trap_num, TF_TRAP_NUM);
-
-	TFOFF(ifa, TF_IFA);
-	TFOFF(isr, TF_ISR);
-	TFOFF(iim, TF_IIM);
-
-	SIZE(trap_frame_t, TF_SIZE);
-
-	SIZE(struct thread, SW_SIZE);
-	SWOFF(regs.unat_b, SW_UNATB);
-	SWOFF(regs.sp, SW_SP);
-	SWOFF(regs.rp, SW_RP);
-	SWOFF(regs.pr, SW_PR);
-	SWOFF(regs.pfs, SW_PFS);
-	SWOFF(regs.bsp, SW_BSP);
-	SWOFF(regs.rnat, SW_RNAT);
-	SWOFF(regs.lc, SW_LC);
-	//SWOFF(regs.fpsr, SW_FPSR);
-	//SWOFF(regs.psr, SW_PSR);
-	//SWOFF(regs.gp, SW_GP);
-	SWOFF(regs.unat_a, SW_UNATA);
-        SWOFF(regs.r4, SW_R4);
-        SWOFF(regs.r5, SW_R5);
-        SWOFF(regs.r6, SW_R6);
-        SWOFF(regs.r7, SW_R7);
-        SWOFF(regs.b1, SW_B1);
-        SWOFF(regs.b2, SW_B2);
-        SWOFF(regs.b3, SW_B3);
-        SWOFF(regs.b4, SW_B4);
-        SWOFF(regs.b5, SW_B5);
-        SWOFF(regs.f2, SW_F2);
-        SWOFF(regs.f3, SW_F3);
-        SWOFF(regs.f4, SW_F4);
-        SWOFF(regs.f5, SW_F5);
-
-	SI_OFF(arch.start_info_pfn, START_INFO_PFN);
-	MR_OFF(interrupt_mask_addr, XSI_PSR_I_ADDR_OFS);
-	MR_OFF(interrupt_collection_enabled, XSI_PSR_IC_OFS);
-	MR_OFF(ipsr, XSI_IPSR_OFS);
-	MR_OFF(iip, XSI_IIP_OFS);
-	MR_OFF(ifs, XSI_IFS_OFS);
-	MR_OFF(ifa, XSI_IFA_OFS);
-	MR_OFF(iim, XSI_IIM_OFS);
-	MR_OFF(iim, XSI_IIM_OFS);
-	MR_OFF(iipa, XSI_IIPA_OFS);
-	MR_OFF(isr, XSI_ISR_OFS);
-	MR_OFF(banknum, XSI_BANKNUM_OFS);
-	MR_OFF(bank1_regs[0], XSI_BANK1_R16_OFS);
-	MR_OFF(precover_ifs, XSI_PRECOVER_IFS_OFS);
-
-	return 0;
-}
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/arch/ia64/ia64.S
--- a/extras/mini-os/arch/ia64/ia64.S	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,233 +0,0 @@
-/*
- * Copyright (c) 2007 Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
- *
- *****************************************************************************
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- * 
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
- * DEALINGS IN THE SOFTWARE.
- */
-
-
-
-#include <mini-os/asm.h>
-#include <mini-os/page.h>
-#include <mini-os/ia64_cpu.h>
-#include <mini-os/ia64_fpu.h>
-#include <mini-os/privop.h>
-#include <mini-os/offsets.h>
-
-
-
-	/*
-	 * Allocate kernel stack area.
-	 * This is used for stack pointer (goes down from kstack+PAGE_SIZE) and
-	 * RSE (goes up from kstack).
-	 */
-	.section .data.start,"aw"
-	.global	kstack
-	.align	PAGE_SIZE
-kstack:	.space KSTACK_PAGES * PAGE_SIZE
-
-	.text
-
-	/*
-	 * Start the kernel.
-	 * r28 points to the address of the boot parameter area, given
-	 * from the bootloader.
-	 * Execution reaches here in physical mode.
-	 */
-ENTRY(_start)
-	.prologue
-	.save rp, r0		// terminate unwind chain with a NULL rp
-	.body
-
-	alloc	loc0=ar.pfs,0,1,1,0
-
-	rsm psr.i | psr.ic
-	;;
-	srlz.i
-	;;
-
-	/*
-	 * Initialize mini-os region registers:
-	 * Currently only region registers 5 and 7 are used for addressing.
-	 * rr[5] : virtual kernel address space
-	 * rr[7] : directly mapped physically addresses.
-	 */
-	movl	r2=0<<IA64_RR_IDX_POS
-	movl	r3=1<<IA64_RR_IDX_POS
-	;;
-	mov	rr[r2]=r0
-	mov	rr[r3]=r0
-	;;
-	movl	r2=2<<IA64_RR_IDX_POS
-	movl	r3=3<<IA64_RR_IDX_POS
-	;;
-	mov	rr[r2]=r0
-	mov	rr[r3]=r0
-	;;
-	movl	r2=4<<IA64_RR_IDX_POS
-	movl	r3=6<<IA64_RR_IDX_POS
-	;;
-	mov	rr[r2]=r0
-	mov	rr[r3]=r0
-	;;
-	// Wired memory for kernel data and text.
-	movl	r2=IA64_RR_VAL(KERNEL_TR_PAGE_SIZE,0)
-	movl	r3=5<<IA64_RR_IDX_POS		// region 5
-	;;
-	mov	rr[r3]=r2
-	;;
-	/*
-	 * Region 7 addresses are only for directly mapped physically
-	 * addresses.
-	 */
-	movl	r2=IA64_RR_VAL(PTE_PS_16K,0)
-	movl	r3=7<<IA64_RR_IDX_POS		// region 7
-	;;
-	mov	rr[r3]=r2
-	;;
-	/*
-	 * Setup protection keys for region 5 and 7.
-	 */
-	mov	r2=(IA64_KEY_REG5 << IA64_PKR_KEY) | IA64_PKR_VALID
-	mov	r3=(IA64_KEY_REG7 << IA64_PKR_KEY) | IA64_PKR_VALID
-	mov	r14=0x1
-	;;
-	mov	pkr[r0]=r2	/* Region 5 */
-	mov	pkr[r14]=r3	/* Region 7 */
-	;;
-	/*
-	 * Now pin mappings into the TLB for kernel text and data
-	 */
-	mov	r18=(KERNEL_TR_PAGE_SIZE<<IA64_ITIR_PS)| \
-			(IA64_KEY_REG5<<IA64_ITIR_KEY)
-	movl	r17=KERNEL_START
-	;;
-	mov	cr.itir=r18
-	mov	cr.ifa=r17
-	mov	r16=IA64_TR_KERNEL
-	mov	r3=ip
-	movl	r18=PTE_KERNEL_ATTR
-	;;
-	dep	r2=0,r3,0,KERNEL_TR_PAGE_SIZE
-	;;
-	or	r18=r2,r18
-	;;
-	srlz.i
-	;;
-	itr.i	itr[r16]=r18
-	;;
-	itr.d	dtr[r16]=r18
-	;;
-	srlz.i
-
-	/*  Switch into virtual mode */
-	movl	r16=STARTUP_PSR
-	;;
-	mov	cr.ipsr=r16
-	movl	r17=1f
-	;;
-	mov	cr.iip=r17
-	mov	cr.ifs=r0
-	;;
-	rfi
-	;;
-1:	/* now we are in virtual mode */
-
-	movl	r3=ia64_trap_table
-	;;
-	mov	cr.iva=r3
-	;;
-
-	movl	r2=IA64_FPSR_DEFAULT
-	movl	r3=IA64_DCR_DEFAULT
-	;;
-	srlz.i
-	movl	gp=__gp
-
-	mov	ar.fpsr=r2
-	mov	cr.dcr=r3
-	;;
-	movl	r2=kstack
-	movl	r5=KSTACK_PAGES * PAGE_SIZE - 16
-	mov	ar.rsc=0	// place RSE in enforced lazy mode
-	;;
-	loadrs			// clear the dirty partition
-	;;
-	mov	ar.bspstore=r2	// establish the new RSE stack
-	add	sp=r2,r5
-	;;
-	mov	ar.rsc=IA64_RSE_EAGER	// place RSE in eager mode
-
-	;;
-	movl	r2=ia64_boot_paramP
-	mov	r3=7		// make address virtual region 7.
-	;;
-	dep	r28=r3,r28,61,3
-	;;
-				// save the address of the boot param area
-				// passed by the bootloader
-	st8	[r2]=r28
-	;;
-
-	/* Set xsi base. I use here XSI_BASE. */
-#define FW_HYPERCALL_SET_SHARED_INFO_VA                 0x600
-	mov r2=FW_HYPERCALL_SET_SHARED_INFO_VA
-	movl r28=XSI_BASE
-	;;
-	break 0x1000
-	;;
-	/*
-	 * I set up here the pointer to the global start_info structure.
-	 * This structure will be initialized in arch_init().
-	 */
-	movl	out0=start_info_union
-		// Prepare out0 - the pointer to start_info_t.
-	movl	r14=XSI_BASE
-	;;
-	add	r15=START_INFO_PFN,r14	// add offset to XSI_BASE
-	;;
-	START_INFO_PFN_ld	r14=[r15]	// load the start_info_pfn
-	add	r16=7, r0
-	;;
-	shl	r15=r14,PAGE_SHIFT_XEN_16K	// pfn << PAGE_SHIFT_XEN_16K
-	shl	r16=r16,IA64_RR_IDX_POS		// (7<<IA64_RR_IDX_POS)
-	;;
-	or	out0=r16, r15			// make a region 7 address
-	;;
-	ssm	psr.i | psr.ic
-	;;
-	srlz.i
-	;;
-	br.call.sptk.many rp=start_kernel
-	;;
-	add	r2=3,r0
-	;;
-	ld8	r3=[r2]
-	;;
-
-self:	hint @pause
-	br.sptk.many self		// endless loop
-END(_start)
-
-
-ENTRY(do_nop)
-	nop	0x01
-	add	r15=1,r15
-	br.ret.sptk.many rp
-END(do_nop)
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/arch/ia64/ivt.S
--- a/extras/mini-os/arch/ia64/ivt.S	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,774 +0,0 @@
-/*
- * Copyright (c) 2007 Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
- * Description: ia64 specific trap handling.
- *
- ****************************************************************************
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- * 
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
- * DEALINGS IN THE SOFTWARE.
- *
- */
-
-
-#include <mini-os/asm.h>
-#include <mini-os/page.h>
-#include <mini-os/ia64_cpu.h>
-#include <mini-os/privop.h>
-#include <mini-os/offsets.h>
-
-
-/* General register usage in interrupt handling:
- *	r16, r17, ... are used for input parameters of sub-routines
- *	r29:	used to access memory which may raise nested TLB fault
- *	r30:	b0 save register
- *	r31:	predicates save register
- *	p30,p31:	used for TLB stuff: (0,1)=data, (1,0)=instruction
- */
-
-
-#define FILL_FP_PAIR(f1, f2, b1, b2)	\
-	ldf.fill	f1=[b1],32	;\
-	ldf.fill	f2=[b2],32	;\
-	;;
-
-#define SPILL_FP_PAIR(f1, f2, b1, b2)	\
-	stf.spill	[b1]=f1,32	;\
-	stf.spill	[b2]=f2,32	;\
-	;;
-
-#define FILL_REG_PAIR(r1, r2, b1, b2)	\
-	ld8.fill	r1=[b1],16	;\
-	ld8.fill	r2=[b2],16	;\
-	;;
-
-#define SPILL_REG_PAIR(r1, r2, b1, b2)	\
-	.mem.offset 0,0			;\
-	st8.spill	[b1]=r1,16	;\
-	.mem.offset 8,0			;\
-	st8.spill	[b2]=r2,16	;\
-	;;
-
-
-/**
- *	The function does a store of the current processor context
- *	to the given exception frame address.
- *	These are some special and the scratch registers for calling
- *	C-functions later.
- *	The bspstore will be the same. A clean RSE is made with the
- *	cover instruction.
- *	
- *	The return is done through a jump to the next bundle after ip (r16).
- *
- *	Used register: r16, r18, r19, r20, r21, r22 of bank 0
- *
- * 	@param: r16 ip of the bundle with the jump.
- *	@param: r18 pointer to the trap frame.
- *	@param: r23 trap number/err val
- *
- */
-
-ENTRY(save_tf_rse_switch)
-	movl	r21=XSI_IPSR		// XEN !!
-	movl	r22=XSI_IIP		// XEN !!
-	;;
-	ld8	r21=[r21]		// XEN.ipsr
-	ld8	r22=[r22];;		// XEN.iip
-	add	r19=TF_IPSR,r18
-	add	r20=TF_IIP,r18
-	;;
-	st8	[r19]=r21		// store cr.ipsr
-	st8	[r20]=r22		// store cr.iip
-	;;
-	//// r16 return jump pointer, r18 - trap frame base, 
-	add	r19=TF_UNAT,r18
-	mov	r20=ar.unat
-	;;
-	st8	[r19]=r20		// store scratch unat
-	;;
-
-	add	r19=TF_GP,r18
-	add	r20=TF_SP,r18
-	;;
-	st8	[r19]=gp,TF_TP-TF_GP	// store gp
-	st8	[r20]=sp,TF_PR-TF_SP	// store sp
-	mov	r21=pr
-	;;
-	st8	[r19]=r13		// store tp
-	st8	[r20]=r21		// store pr
-	;;
-	add	r19=TF_GREG2,r18	// Now first general regs.
-	add	r20=TF_GREG3,r18
-	;;
-	SPILL_REG_PAIR( r2, r3,r19,r20)
-	SPILL_REG_PAIR( r8, r9,r19,r20)
-	SPILL_REG_PAIR(r10,r11,r19,r20)
-	SPILL_REG_PAIR(r14,r15,r19,r20)
-	;;
-	mov	r14=r18		// move trap frame base for bsw
-	mov	r15=r16		// save return address
-	;;
-	//bsw.1		// switch to bank 1 for saving these registers.
-	movl r30=XSI_BANKNUM		// Switch to bank 1.
-	mov r31=1;;
-	st4 [r30]=r31
-	;;
-	/*
-	 * On XEN the hypervisor has stored the bank 1 registers
-	 * r16-r31. I must reload these registers here to get
-	 * access.
-	 */
-	movl r30=XSI_BANK1_R16;
-	movl r31=XSI_BANK1_R16+8;; 
-	ld8 r16=[r30],16; ld8 r17=[r31],16;;
-	ld8 r18=[r30],16; ld8 r19=[r31],16;;
-	ld8 r20=[r30],16; ld8 r21=[r31],16;;
-	ld8 r22=[r30],16; ld8 r23=[r31],16;;
-	ld8 r24=[r30],16; ld8 r25=[r31],16;;
-	ld8 r26=[r30],16; ld8 r27=[r31],16;;
-	ld8 r28=[r30],16; ld8 r29=[r31],16;;
-	ld8 r30=[r30]; ld8 r31=[r31];;
-	add	r2=TF_GREG16,r14
-	add	r3=TF_GREG17,r14
-	;;
-	SPILL_REG_PAIR(r16,r17,r2,r3)
-	SPILL_REG_PAIR(r18,r19,r2,r3)
-	SPILL_REG_PAIR(r20,r21,r2,r3)
-	SPILL_REG_PAIR(r22,r23,r2,r3)
-	SPILL_REG_PAIR(r24,r25,r2,r3)
-	SPILL_REG_PAIR(r26,r27,r2,r3)
-	SPILL_REG_PAIR(r28,r29,r2,r3)
-	SPILL_REG_PAIR(r30,r31,r2,r3)
-	;;
-	//bsw.0				// back to interrupt bank 0
-	movl r2=XSI_BANKNUM;;
-	st4 [r2]=r0
-	;;
-	mov	r18=r14			// restore context pointer
-	mov	r16=r15			// restore return address
-	;;
-	//// r16 return jump pointer, r18 - trap frame base, 
-	add	r19=TF_CCV,r18
-	add	r20=TF_CSD,r18
-	mov	r21=ar.ccv
-	mov	r22=ar.csd
-	;;
-	st8	[r19]=r21		// ar.ccv
-	st8	[r20]=r22		// ar.csd
-	;;
-	add	r19=TF_SSD,r18
-	mov	r21=ar.ssd
-	;;
-	st8	[r19]=r21		// ar.ssd
-	;;
-	add	r19=TF_FREG6,r18
-	add	r20=TF_FREG7,r18
-	;;
-	SPILL_FP_PAIR(f6, f7, r19, r20)
-	SPILL_FP_PAIR(f8, f9, r19, r20)
-	SPILL_FP_PAIR(f10, f11, r19, r20)
-
-	add	r19=TF_BREG0,r18	// b0, b6, b7
-	add	r20=TF_BREG6,r18
-	mov	r21=b0
-	mov	r22=b6
-	;;
-	st8	[r19]=r21,TF_BREG7-TF_BREG0	// store b0
-	st8	[r20]=r22,16		// store b6
-	;;
-	mov	r21=b7
-	;;
-	st8	[r19]=r21		// store b7
-
-	//// r16 return jump pointer, r18 - trap frame base, 
-
-		// Read and save RSC, PFS
-	add	r19=TF_PFS,r18
-	add	r20=TF_RSC,r18
-	mov	r21=ar.pfs
-	mov	r22=ar.rsc
-	;;
-{	.mmb
-	st8	[r19]=r21		// store ar.pfs
-	st8	[r20]=r22		// store ar.rsc
-		// Issue cover instruction
-	cover		// must be the last instruction in bundle
-	//XEN_HYPER_COVER
-	;;
-}
-		// Read and save IFS
-	add	r19=TF_IFS,r18
-	add	r20=TF_CFM,r18
-		/* xen special handling for possibly lazy cover */
-	movl	r8=XSI_PRECOVER_IFS;
-	;;
-	ld8	r21=[r8]
-	;;
-	st8	[r19]=r21		// store cr.ifs
-	dep.z	r22=r21,0,38		// copy ifm part from ifs.ifm
-	;;
-	st8	[r20]=r22		// store cfm
-		// RSE in enforced lazy mode
-	mov	ar.rsc=IA64_RSE_LAZY
-	;;
-		// Read and save BSPSTORE and RNAT
-	add	r19=TF_BSP,r18
-	add	r20=TF_RNAT,r18
-	mov	r21=ar.bspstore
-	mov	r22=ar.rnat
-	;;
-	st8	[r19]=r21	                // store ar.bspstore
-	st8	[r20]=r22			// store ar.rnat
-	;;
-		// Write new BSPSTORE
-	//mov	r21=ar.bsp
-	//;;
-	mov	r22=r21			// new bspstore equal to old
-	;;
-	mov	ar.bspstore=r22		// the new bspstore
-	;;
-		// Read and save the new BSP for calculating number of dirty regs.
-	mov	r21=ar.bsp
-	;;
-	sub	r21=r21,r22		// r21 -> ndirty
-	add     r19=TF_NDIRTY-TF_BSP,r19        // TF_NDIRTY pos in r19
-	;;
-	st8	[r19]=r21		// store ndirty
-	;;
-	mov	ar.rsc=IA64_RSE_EAGER	// RSE on again
-	;;
-	add	r19=TF_FPSR,r18
-	;;
-	mov	r21=ar.fpsr
-	;;
-	st8	[r19]=r21		// ar.fpsr
-	;;
-	//// r16 return jump pointer, r18 - trap frame base, 
-		// Load the gp with our module __gp
-	movl	gp=__gp
-	;;
-	add	r16=16,r16	// for jump to next bundle
-	;;
-	mov	b7=r16
-	;;
-
-{	.mfb
-	srlz.d
-	nop	0
-	br.sptk	b7
-	;;
-}
-
-END(save_tf_rse_switch)
-
-
-/**
- *	The function reloads the processor context stored in
- *	save_tf_rse_switch().
- *	
- *	On calling the function the bank 0 must be activ.
- *	The return is done through a rfi.
- *	Used register: b7, r16, r18, r19, r20, r21, r22 of bank 0
- *
- *	@param: r18 pointer to the exception frame
- *
- */
-ENTRY(restore_tf_rse_switch) 
-	add	r19=TF_IPSR,r18
-	add	r20=TF_IIP,r18
-	;;
-	ld8	r21=[r19]		// load cr.ipsr
-	ld8	r22=[r20]		// load cr.iip
-	movl	r16=XSI_IPSR		// XEN !!
-	;;
-	st8	[r16]=r21,XSI_IIP_OFS-XSI_IPSR_OFS	// XEN.ipsr
-	mov	r2=r21			// save for fp stuff below
-	;;
-	st8	[r16]=r22		// XEN.iip
-	;;
-	//// r18 - trap frame base 
-		// Allocate a zero sized frame
-	alloc	r30=ar.pfs,0,0,0,0	// discard current frame
-	;;
-		// calc number of dirty regs and put this into rsc.loardrs
-	add	r19=TF_NDIRTY,r18
-	;;
-	ld8	r22=[r19]		// ndirty
-	;;
-	shl	r21=r22,16		// value for ar.rsc
-	;;
-	mov	ar.rsc=r21		// setup for loadrs
-	;;
-		// Issue a loadrs instruction
-{	.mmi
-	loadrs		// must be the first instruction
-	;;
-	nop 0x0
-	nop 0x0
-}
-		// Restore BSPSTORE from interrupted context
-	add	r19=TF_BSP,r18
-	add	r20=TF_RNAT,r18
-	;;	
-	ld8	r21=[r19]		// load ar.bspstore
-	ld8	r22=[r20]		// load ar.rnat
-	;;
-	mov	ar.bspstore=r21		// set ar.bspstore
-	;;
-		// Restore RNAT
-	mov	ar.rnat=r22		// set ar.rnat
-	;;
-		// Restore PFS and IFS
-	add	r19=TF_PFS,r18
-	add	r20=TF_IFS,r18
-	movl	r16=XSI_IFS		// XEN !!
-	;;
-	ld8	r21=[r19]		// load ar.pfs
-	ld8	r22=[r20]		// load cr.ifs
-	;;
-	add	r19=TF_RSC,r18
-	mov	ar.pfs=r21
-	st8	[r16]=r22		// XEN.ifs
-	;;
-		// Restore RSC
-	ld8	r21=[r19]		// load ar.rsc
-	;;
-	mov	ar.rsc=r21		// set ar.rsc
-	//// r18 - trap frame base
-	add	r19=TF_GP,r18
-	add	r20=TF_SP,r18
-	;;
-	ld8	gp=[r19],TF_TP-TF_GP	// load gp
-	ld8	sp=[r20],TF_PR-TF_SP	// load sp
-	;;
-	ld8	r13=[r19]		// load tp
-	ld8	r21=[r20]		// load pr
-	;;
-	mov	pr=r21,-1		// set pr
-	;;
-	add	r19=TF_BREG0,r18
-	add	r20=TF_BREG6,r18
-	;;
-	ld8	r21=[r19],TF_BREG7-TF_BREG0	// load b0
-	ld8	r22=[r20],16		// load b6
-	;;
-	mov	b0=r21
-	mov	b6=r22
-	;;
-	ld8	r21=[r19]		// load b7
-	ld8	r22=[r20],16		// load b3
-	;;
-	mov	b7=r21
-	//// r18 - trap frame base
-	mov	r14=r18			// Save the context pointer
-	;;
-	// bsw.1
-	movl r30=XSI_BANKNUM		// Switch to bank 1.
-	mov r31=1;;
-	st4 [r30]=r31
-	;;
-	add	r2=TF_GREG16,r14
-	add	r3=TF_GREG17,r14
-	;;
-	FILL_REG_PAIR(r16,r17,r2,r3)
-	FILL_REG_PAIR(r18,r19,r2,r3)
-	FILL_REG_PAIR(r20,r21,r2,r3)
-	FILL_REG_PAIR(r22,r23,r2,r3)
-	FILL_REG_PAIR(r24,r25,r2,r3)
-	FILL_REG_PAIR(r26,r27,r2,r3)
-	FILL_REG_PAIR(r28,r29,r2,r3)
-	FILL_REG_PAIR(r30,r31,r2,r3)
-
-	/*
-	 * On XEN I have to store the bank 1 register into the
-	 * global XSI_... area.
-	 */
-		// r16-r31 all now hold bank1 values
-	movl r2=XSI_BANK1_R16
-	movl r3=XSI_BANK1_R16+8
-	;;
-	.mem.offset 0,0; st8.spill [r2]=r16,16
-	.mem.offset 8,0; st8.spill [r3]=r17,16
-	;;
-	.mem.offset 0,0; st8.spill [r2]=r18,16
-	.mem.offset 8,0; st8.spill [r3]=r19,16
-	;;
-	.mem.offset 0,0; st8.spill [r2]=r20,16
-	.mem.offset 8,0; st8.spill [r3]=r21,16
-	;;
-	.mem.offset 0,0; st8.spill [r2]=r22,16
-	.mem.offset 8,0; st8.spill [r3]=r23,16
-	;;
-	.mem.offset 0,0; st8.spill [r2]=r24,16
-	.mem.offset 8,0; st8.spill [r3]=r25,16
-	;;
-	.mem.offset 0,0; st8.spill [r2]=r26,16
-	.mem.offset 8,0; st8.spill [r3]=r27,16
-	;;
-	.mem.offset 0,0; st8.spill [r2]=r28,16
-	.mem.offset 8,0; st8.spill [r3]=r29,16
-	;;
-	.mem.offset 0,0; st8.spill [r2]=r30,16
-	.mem.offset 8,0; st8.spill [r3]=r31,16
-	;;
-	// bsw.0
-	movl r2=XSI_BANKNUM;;
-	st4 [r2]=r0;
-
-	mov	r18=r14			// Move back the context pointer
-	;;
-	add	r19=TF_GREG2,r18
-	add	r20=TF_GREG3,r18
-	;;
-	FILL_REG_PAIR( r2, r3,r19,r20)
-	FILL_REG_PAIR( r8, r9,r19,r20)
-	FILL_REG_PAIR(r10,r11,r19,r20)
-	FILL_REG_PAIR(r14,r15,r19,r20)
-
-	//// r18 - trap frame base, 
-
-	add	r19=TF_CCV,r18
-	add	r20=TF_CSD,r18
-	;;
-	ld8	r21=[r19]		// ar.ccv
-	ld8	r22=[r20]		// ar.csd
-	;;
-	mov	ar.ccv=r21
-	mov	ar.csd=r22
-	add	r19=TF_SSD,r18
-	;;
-	ld8	r21=[r19]		// ar.ssd
-	;;
-	mov	ar.ssd=r21
-	add	r19=TF_FREG6,r18
-	add	r20=TF_FREG7,r18
-	;;
-	FILL_FP_PAIR(f6, f7, r19, r20)
-	FILL_FP_PAIR(f8, f9, r19, r20)
-	FILL_FP_PAIR(f10, f11, r19, r20)
-	add	r19=TF_FPSR,r18
-	;;
-	ld8	r21=[r19]		// ar.fpsr
-	;;
-	mov	ar.fpsr=r21
-	add	r19=TF_UNAT,r18
-	;;
-	ld8	r21=[r19]
-	;;
-	mov	ar.unat=r21
-	;;
-	srlz.i
-	;;
-	//rfi
-	XEN_HYPER_RFI;
-	;;
-END(restore_tf_rse_switch)
-
-
-ENTRY(save_special_regs)
-	alloc	loc0=ar.pfs,1,7,0,0
-	movl	loc1=XSI_IFA		// XEN !!
-	movl	loc2=XSI_ISR		// XEN !!
-	;;
-	ld8	loc3=[loc1],XSI_IIM_OFS-XSI_IFA_OFS	// load XEN.ifa
-	ld8	loc4=[loc2],XSI_IIPA_OFS-XSI_ISR_OFS	// load XEN.isr
-	add	loc5=TF_IFA,in0
-	add	loc6=TF_ISR,in0
-	;;
-	st8	[loc5]=loc3,TF_IIM-TF_IFA	// store cr.ifa
-	st8	[loc6]=loc4			// store cr.isr
-	;;
-	ld8	loc3=[loc1]			// load XEN.iim
-	;;
-	st8	[loc5]=loc3			// store cr.iim
-	;;
-	mov	ar.pfs=loc0
-	;;
-	br.ret.sptk.few rp
-END(save_special_regs)
-
-
-ENTRY(hypervisor_callback)
-	/*
-	 * Use the thread stack here for storing the trap frame.
-	 * It's not wired mapped, so nested data tlb faults may occur!
-	 */
-	add	r18=-TF_SIZE,sp
-	;;
-{	.mib
-	nop	0x02
-	mov	r16=ip		// for jump back from save_tf_rse_switch
-	br.sptk	save_tf_rse_switch
-	;;
-}
-	add	sp=-16,r18		// the new stack
-	alloc	r15=ar.pfs,0,0,1,0	// 1 out for do_hypervisor_callback
-	;;
-	mov	out0=r18		// the trap frame
-	movl	r22=XSI_PSR_IC
-	mov	r23=1;;
-	st8	[r22]=r23		// ssm psr.ic
-	;;
-	br.call.sptk.few rp = do_hypervisor_callback
-
-	movl	r22=XSI_PSR_IC
-	;;
-	st4	[r22]=r0		// rsm psr.ic
-	add	r18=16,sp		// load EF-pointer again
-	;;
-			// must have r18-efp, calls rfi at the end.
-	br.sptk	restore_tf_rse_switch
-	;;
-END(hypervisor_callback)
-
-	/*
-	 * In: r30 - trap number
-	 */
-ENTRY(trap_error)
-		// Calculate the stack address for storing.
-	add	r18=-TF_SIZE,sp
-	;;
-	add	r20=TF_TRAP_NUM,r18
-	;;
-	st2	[r20]=r30	// save trap number
-	;;
-
-{	.mib
-	nop	0x02
-	mov	r16=ip		// for jumping back from save_tf_rse_switch
-		// Used register: r16, r18, r19, r20, r21, r22 of bank 0
-	br.sptk	save_tf_rse_switch
-	;;
-}
-
-	alloc	r15=ar.pfs,0,0,1,0	// 1 out for do_trap_error
-	;;
-	mov	out0=r18		// the trap frame
-	add	sp=-16,r18		// C-call abi
-	;;
-	movl r30=XSI_BANKNUM		// bsw.1
-	mov r31=1;;
-	st4 [r30]=r31;;
-
-		/* Save extra interrupt registers to the trap frame. */
-	br.call.sptk.few rp = save_special_regs
-	;;
-
-	movl	r22=XSI_PSR_IC
-	movl	r23=XSI_PSR_I_ADDR
-	;;
-	ld8	r23=[r23]
-	mov	r25=1
-	;;
-	st4	[r22]=r25		// ssm psr.ic
-	st1	[r23]=r0		// ssm psr.i
-	;;
-
-	br.call.sptk.few rp = do_trap_error
-	;;
-		// --> currently not reached!!!
-	movl r23=XSI_PSR_I_ADDR
-	movl r22=XSI_PSR_IC
-	;;
-	ld8 r23=[r23]
-	mov r25=1
-	;;
-	st1 [r23]=r25
-	st4 [r22]=r0            // note: clears both vpsr.i and vpsr.ic!
-	;;
-	bsw.0
-	;;
-	add	r18=16,sp		// load EF-pointer again
-	;;
-	mov	sp=r18
-			// must have r18-efp, calls rfi at the end.
-	br.sptk	restore_tf_rse_switch
-	;;
-END(trap_error)
-
-
-/*
- * The trap handler stuff.
- */
-
-#define TRAP_ERR(num)			\
-	mov	r30 = num;		\
-	;;		;		\
-	br.sptk	trap_error		\
-	;;
-
-#define	IVT_ENTRY(name, offset)			\
-	.org	ia64_trap_table + offset;	\
-	.global	hivt_##name;			\
-	.proc	hivt_##name;			\
-	.prologue;				\
-	.body;					\
-hivt_##name:
-
-#define	IVT_END(name)				\
-	.endp	hivt_##name;			\
-	.align	0x100
-
-#define IVT_ERR(name, num, offset)		\
-	IVT_ENTRY(name, offset);		\
-	TRAP_ERR(num);				\
-	IVT_END(name)
-/*
- * The IA64 Interrupt Vector Table (IVT) contains 20 slots with 64
- * bundles per vector and 48 slots with 16 bundles per vector.
- */
-
-	.section .text.hivt,"ax"
-	.align	32768
-	.global ia64_trap_table
-	.size	ia64_trap_table, 32768
-ia64_trap_table:
-
-IVT_ERR(VHPT_Translation, 0, 0x0)
-IVT_ERR(Instruction_TLB, 1, 0x0400)
-IVT_ERR(Data_TLB, 2, 0x0800)
-IVT_ERR(Alternate_Instruction_TLB, 3, 0x0c00)
-
-
-IVT_ENTRY(Alternate_Data_TLB, 0x1000)
-	mov	r30=4			// trap number
-adt_common:
-	mov	r16=cr.ifa		// where did it happen
-	mov	r31=pr			// save predicates
-	;;
-	extr.u	r17=r16,IA64_RR_IDX_POS,3	// get region number
-	;;
-	cmp.eq	p14,p15=7,r17
-	;;
-//(p14)	br.sptk adt_regf_addr		// Check for region 7 - phys addresses
-//	;;
-//	br.sptk	trap_error
-//		// No return
-//
-//adt_regf_addr:
-//	extr.u	r17=r16,60,4		// get region number
-//	;;
-//	cmp.eq	p14,p15=0xf,r17
-//	;;
-(p14)	br.sptk adt_reg7_addr		// Check for region 7 - phys addresses
-	;;
-	br.sptk	trap_error
-
-adt_reg7_addr:
-	/*
-	 * region 7 addresses are only directly mapped physically
-	 * addresses. Currently I don't do a check.
-	 */
-	movl	r20=~((7 << IA64_RR_IDX_POS) | 0xfff)
-	movl	r18=((PTE_PS_16K<<IA64_ITIR_PS)|(IA64_KEY_REG7<<IA64_ITIR_KEY))
-	;;
-	movl	r19=	((1<<PTE_OFF_P) | (PTE_MA_WB<<PTE_OFF_MA) | \
-			 (1<<PTE_OFF_A) | (1<<PTE_OFF_D) | \
-			 (PTE_PL_KERN<<PTE_OFF_PL) | (PTE_AR_RW<<PTE_OFF_AR))
-			// clear the region bits and 0-11
-			// extract the pfn from the ifa
-	mov	cr.itir=r18
-	and	r20=r20, r16
-	;;
-	or	r20=r20,r19		// put pfn into pte
-	;;
-	mov	pr=r31,-1		// restore predicates
-	itc.d	r20
-	;;
-	XEN_HYPER_RFI;
-	;;
-
-IVT_END(Alternate_Data_TLB)
-
-/*
- * Handling of nested data tlb is needed, because in hypervisor_callback()
- * the stack is used to store the register trap frame. This stack is allocated
- * dynamically (as identity mapped address) and therewidth no tr mapped page!
- */
-IVT_ENTRY(Data_Nested_TLB, 0x1400)
-
-	mov	r30=5			// trap number
-	add	r28=-TF_SIZE,sp		// r28 is never used in trap handling
-	;;
-	mov	cr.ifa=r28
-	;;
-	br.sptk	adt_common
-IVT_END(Data_Nested_TLB)
-
-
-
-IVT_ERR(Instruction_Key_Miss, 6, 0x1800)
-IVT_ERR(Data_Key_Miss, 7, 0x1c00)
-IVT_ERR(Dirty_Bit, 8, 0x2000)
-IVT_ERR(Instruction_Access_Bit, 9, 0x2400)
-IVT_ERR(Data_Access_Bit, 10, 0x2800)
-IVT_ERR(Break_Instruction, 11, 0x2c00)
-IVT_ERR(External_Interrupt, 12, 0x3000)
-IVT_ERR(Reserved_3400, 13, 0x3400)
-IVT_ERR(Reserved_3800, 14, 0x3800)
-IVT_ERR(Reserved_3c00, 15, 0x3c00)
-IVT_ERR(Reserved_4000, 16, 0x4000)
-IVT_ERR(Reserved_4400, 17, 0x4400)
-IVT_ERR(Reserved_4800, 18, 0x4800)
-IVT_ERR(Reserved_4c00, 19, 0x4c00)
-IVT_ERR(Page_Not_Present, 20, 0x5000)
-IVT_ERR(Key_Permission, 21, 0x5100)
-IVT_ERR(Instruction_Access_Rights, 22, 0x5200)
-IVT_ERR(Data_Access_Rights, 23, 0x5300)
-IVT_ERR(General_Exception, 24, 0x5400)
-IVT_ERR(Disabled_FP_Register, 25, 0x5500)
-IVT_ERR(NaT_Consumption, 26, 0x5600)
-IVT_ERR(Speculation, 27, 0x5700)
-IVT_ERR(Reserved_5800, 28, 0x5800)
-IVT_ERR(Debug, 29, 0x5900)
-IVT_ERR(Unaligned_Reference, 30, 0x5a00)
-IVT_ERR(Unsupported_Data_Reference, 31, 0x5b00)
-IVT_ERR(Floating_Point_Fault, 32, 0x5c00)
-IVT_ERR(Floating_Point_Trap, 33, 0x5d00)
-IVT_ERR(Lower_Privilege_Transfer_Trap, 34, 0x5e00)
-IVT_ERR(Taken_Branch_Trap, 35, 0x5f00)
-IVT_ERR(Single_Step_Trap, 36, 0x6000)
-IVT_ERR(Reserved_6100, 37, 0x6100)
-IVT_ERR(Reserved_6200, 38, 0x6200)
-IVT_ERR(Reserved_6300, 39, 0x6300)
-IVT_ERR(Reserved_6400, 40, 0x6400)
-IVT_ERR(Reserved_6500, 41, 0x6500)
-IVT_ERR(Reserved_6600, 42, 0x6600)
-IVT_ERR(Reserved_6700, 43, 0x6700)
-IVT_ERR(Reserved_6800, 44, 0x6800)
-IVT_ERR(IA_32_Exception, 45, 0x6900)
-IVT_ERR(IA_32_Intercept, 46, 0x6a00)
-IVT_ERR(IA_32_Interrupt, 47, 0x6b00)
-IVT_ERR(Reserved_6c00, 48, 0x6c00)
-IVT_ERR(Reserved_6d00, 49, 0x6d00)
-IVT_ERR(Reserved_6e00, 50, 0x6e00)
-IVT_ERR(Reserved_6f00, 51, 0x6f00)
-IVT_ERR(Reserved_7000, 52, 0x7000)
-IVT_ERR(Reserved_7100, 53, 0x7100)
-IVT_ERR(Reserved_7200, 54, 0x7200)
-IVT_ERR(Reserved_7300, 55, 0x7300)
-IVT_ERR(Reserved_7400, 56, 0x7400)
-IVT_ERR(Reserved_7500, 57, 0x7500)
-IVT_ERR(Reserved_7600, 58, 0x7600)
-IVT_ERR(Reserved_7700, 59, 0x7700)
-IVT_ERR(Reserved_7800, 60, 0x7800)
-IVT_ERR(Reserved_7900, 61, 0x7900)
-IVT_ERR(Reserved_7a00, 62, 0x7a00)
-IVT_ERR(Reserved_7b00, 63, 0x7b00)
-IVT_ERR(Reserved_7c00, 64, 0x7c00)
-IVT_ERR(Reserved_7d00, 65, 0x7d00)
-IVT_ERR(Reserved_7e00, 66, 0x7e00)
-IVT_ERR(Reserved_7f00, 67, 0x7f00)
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/arch/ia64/minios-ia64.lds
--- a/extras/mini-os/arch/ia64/minios-ia64.lds	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-OUTPUT_FORMAT("elf64-ia64-little")
-OUTPUT_ARCH(ia64)
-
-ENTRY(phys_start)
-
-PHDRS
-{
-  code PT_LOAD;
-  data PT_LOAD;
-}
-
-SECTIONS
-{
-
-  phys_start = _start - (((5<<(61))+0x100000000) - (1 << 20));
-
-  code : { } :code
-  . = ((5<<(61))+0x100000000);
-
-  _text = .;
-
-  .text : AT(ADDR(.text) - (((5<<(61))+0x100000000) - (1 << 20)))
-  {
-    *(.text)
-  }
-
-  _etext = .;
-
-  data : { } :data
-  .data : AT(ADDR(.data) - (((5<<(61))+0x100000000) - (1 << 20)))
-  { *(.data) 
-  }
-
-  .sdata : AT(ADDR(.sdata) - (((5<<(61))+0x100000000) - (1 << 20)))
-        { *(.sdata) *(.sdata1) *(.srdata) }
-
-  .rodata : AT(ADDR(.rodata) - (((5<<(61))+0x100000000) - (1 << 20)))
-  { *(.rodata) }
-
-  .rodata.str1.8 : AT(ADDR(.rodata.str1.8) - (((5<<(61))+0x100000000) - (1 << 20)))
-  { *(.rodata.str1.8) }
-
-  /* newlib initialization functions */
-  . = ALIGN(64 / 8);
-  PROVIDE (__preinit_array_start = .);
-  .preinit_array     : { *(.preinit_array) }
-  PROVIDE (__preinit_array_end = .);
-  PROVIDE (__init_array_start = .);
-  .init_array     : { *(.init_array) }
-  PROVIDE (__init_array_end = .);
-  PROVIDE (__fini_array_start = .);
-  .fini_array     : { *(.fini_array) }
-  PROVIDE (__fini_array_end = .);
-
-  .ctors : AT(ADDR(.ctors) - (((5<<(61))+0x100000000) - (1 << 20)))
-	{
-        __CTOR_LIST__ = .;
-        *(.ctors)
-	CONSTRUCTORS
-        QUAD(0)
-        __CTOR_END__ = .;
-        }
-
-  .dtors : AT(ADDR(.dtors) - (((5<<(61))+0x100000000) - (1 << 20)))
-        {
-        __DTOR_LIST__ = .;
-        *(.dtors)
-        QUAD(0)
-        __DTOR_END__ = .;
-        }
-
-  .IA_64.unwind_info : AT(ADDR(.IA_64.unwind_info) - (((5<<(61))+0x100000000) - (1 << 20)))
-  { *(.IA_64.unwind_info) }
-
-  .IA_64.unwind : AT(ADDR(.IA_64.unwind) - (((5<<(61))+0x100000000) - (1 << 20)))
-  { *(.IA_64.unwind) }
-
-  .bss : AT(ADDR(.bss) - (((5<<(61))+0x100000000) - (1 << 20)))
-  {
-    *(.bss)
-    *(.app.bss)
-  }
-
-  _end = .;
-
-}
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/arch/ia64/mm.c
--- a/extras/mini-os/arch/ia64/mm.c	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,174 +0,0 @@
-/*
- * Done by Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
- *
- * Description: Special ia64 memory management.
- * Parts are taken from FreeBSD.
- *
- ****************************************************************************
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- * 
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
- * DEALINGS IN THE SOFTWARE.
- */
-
-
-#include <mini-os/os.h>
-#include <mini-os/mm.h>
-
-
-#define MAX_MEM_AREA	5
-paddr_t phys_avail[MAX_MEM_AREA * 2];
-int	phys_avail_cnt;
-uint64_t physmem;
-
-/*
- * These variables are defined in the linker script minios_ia64.lds
- * to get the size of the kernel.
- */
-extern uint64_t _text[], _etext[], _end[], kstack[], phys_start[];
-
-uint64_t kernstart, kernend, kernsize, kernpstart, kernpend;
-
-#ifdef HAVE_LIBC
-uint8_t _heap[512 * 1024];
-unsigned long heap = (unsigned long)_heap,
-              brk = (unsigned long)_heap,
-              heap_mapped = (unsigned long)_heap + sizeof(_heap),
-              heap_end = (unsigned long)_heap + sizeof(_heap);
-#endif
-
-/* Print the available memory chunks. */
-static void
-print_phys_avail(void)
-{
-	int i;
-
-	printk("Physical memory chunk(s):\n");
-	for (i = 0; phys_avail[i + 1] != 0; i += 2) {
-		int size = phys_avail[i + 1] - phys_avail[i];
-		printk("0x%08lx - 0x%08lx, %d bytes (%d pages)\n",
-			phys_avail[i], phys_avail[i + 1] - 1,
-			size, size / PAGE_SIZE);
-	}
-}
-
-void
-arch_init_mm(unsigned long* start_pfn_p, unsigned long* max_pfn_p)
-{
-	uint64_t ms, me;
-	int i, j;
-	uint64_t m, n;
-
-	kernstart = trunc_page(_text);
-	kernend  = roundup_page(_end);
-
-	kernpstart = trunc_page(ia64_tpa(kernstart));
-	kernpend = roundup_page(kernpstart + (kernend - kernstart));
-	kernsize = kernpend - kernpstart;
-
-	ms = roundup_page(machineFwG.mach_mem_start);
-	me = trunc_page(machineFwG.mach_mem_start+machineFwG.mach_mem_size);
-	memset((void*)phys_avail, 0, sizeof(phys_avail));
-	/* 1. Check where the kernel lies in physical memory. */
-	physmem = me - ms;
-	if ((ms <= kernpend) && (kernpstart <= me)) {
-		if (ms < kernpstart) {	/* There is a part before the kernel. */
-			PRINT_BV("  Found chunk before kernel: 0x%lx - 0x%lx\n",
-				 ms, kernpstart);
-			phys_avail[phys_avail_cnt] = ms;
-			phys_avail[phys_avail_cnt+1] = kernpstart;
-			phys_avail_cnt += 2;
-		}
-		if (kernpend < me) {	/* There is a part behind the kernel. */
-			PRINT_BV("  Found chunk behind kernel: 0x%lx - 0x%lx\n",
-				 kernpend, me);
-			phys_avail[phys_avail_cnt] = kernpend;
-			phys_avail[phys_avail_cnt+1] = me;
-			phys_avail_cnt += 2;
-		}
-	} else {	/* One big chunk */
-		PRINT_BV("  Found big chunk: 0x%lx - 0x%lx\n", ms, me);
-		phys_avail[phys_avail_cnt] = ms;
-		phys_avail[phys_avail_cnt + 1] = me;
-		phys_avail_cnt += 2;
-	}
-	phys_avail[phys_avail_cnt] = 0;
-
-	print_phys_avail();
-	/*
-	 * In this first version I only look for the biggest mem area.
-	 */
-	for (i = j = m = n = 0; i < phys_avail_cnt; i += 2) {
-		n = page_to_pfn(phys_avail[i + 1]) - page_to_pfn(phys_avail[i]);
-		if (n > m) {
-			m = n;
-			j = i;
-		}
-	}
-	*start_pfn_p = page_to_pfn(phys_avail[j]);
-	*max_pfn_p   = page_to_pfn(phys_avail[j +1 ]);
-}
-
-/* Currently only a dummy function. */
-void
-arch_init_demand_mapping_area(unsigned long max_pfn)
-{
-	max_pfn = max_pfn;
-}
-
-unsigned long allocate_ondemand(unsigned long n, unsigned long alignment)
-{
-        return 0;
-}
-
-/* Helper function used in gnttab.c. */
-void do_map_frames(unsigned long addr,
-    const unsigned long *f, unsigned long n, unsigned long stride,
-	unsigned long increment, domid_t id, int *err, unsigned long prot)
-{
-	/* TODO */
-	ASSERT(0);
-}
-
-void*
-map_frames_ex(const unsigned long* frames, unsigned long n, unsigned long stride,
-	unsigned long increment, unsigned long alignment, domid_t id,
-	int *err, unsigned long prot)
-{
-        /* TODO: incomplete! */
-        ASSERT(n == 1 || (stride == 0 && increment == 1));
-        ASSERT(id == DOMID_SELF);
-        ASSERT(prot == 0);
-	return (void*) __va(frames[0] << PAGE_SHIFT);
-}
-
-int unmap_frames(unsigned long virt_addr, unsigned long num_frames)
-{  
-    /* TODO */
-    ASSERT(0);
-}
-
-unsigned long alloc_contig_pages(int order, unsigned int addr_bits)
-{
-    /* TODO */
-    ASSERT(0);
-}
-
-void arch_init_p2m(unsigned long max_pfn)
-{
-    printk("Warn: p2m map not implemented.\n");
-}
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/arch/ia64/sal.c
--- a/extras/mini-os/arch/ia64/sal.c	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +0,0 @@
-/*
- * Done by Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
- * Mostly taken from FreeBSD.
- *
- ****************************************************************************
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- */
-
-#include <mini-os/os.h>
-#include <mini-os/lib.h>
-#include <mini-os/console.h>
-#include <mini-os/page.h>
-
-
-static struct ia64_fdesc sal_fdesc;
-uint64_t ia64_pal_entry;	/* PAL_PROC entrypoint */
-
-
-struct ia64_sal_result
-ia64_sal_call(uint64_t a1, uint64_t a2, uint64_t a3, uint64_t a4,
-	      uint64_t a5, uint64_t a6, uint64_t a7, uint64_t a8)
-{
-	return ia64_sal_entry(a1, a2, a3, a4, a5, a6, a7, a8);
-}
-
-static struct ia64_sal_result
-fake_sal(uint64_t a1, uint64_t a2, uint64_t a3, uint64_t a4,
-	 uint64_t a5, uint64_t a6, uint64_t a7, uint64_t a8)
-{
-	struct ia64_sal_result res;
-	res.sal_status = -3;
-	res.sal_result[0] = 0;
-	res.sal_result[1] = 0;
-	res.sal_result[2] = 0;
-	return res;
-}
-
-/*
- * Currently only the SAL_DESC_ENTRYPOINT is checked to get
- * the entry points the pal and sal functions.
- */
-void
-ia64_sal_init(struct sal_system_table *saltab)
-{
-	static int sizes[6] = { 48, 32, 16, 32, 16, 16 };
-	uint8_t *p;
-	int i;
-
-	PRINT_BV("Reading SALtable:\n");
-	ia64_sal_entry = fake_sal;
-
-	if (memcmp((void*)(uint64_t)(saltab->sal_signature), SAL_SIGNATURE, 4))
-	{
-		printk("Bad signature for SAL System Table\n");
-		return;
-	}
-	p = (uint8_t *) (saltab + 1);
-	for (i = 0; i < saltab->sal_entry_count; i++) {
-		switch (*p) {
-		case SAL_DESC_ENTRYPOINT:		// 0
-		{
-			struct sal_entrypoint_descriptor *dp;
-
-			dp = (struct sal_entrypoint_descriptor*)p;
-			ia64_pal_entry =
-				IA64_PHYS_TO_RR7(dp->sale_pal_proc);
-			PRINT_BV("  PAL Proc at 0x%lx\n", ia64_pal_entry);
-			sal_fdesc.func =
-				IA64_PHYS_TO_RR7(dp->sale_sal_proc);
-			sal_fdesc.gp = IA64_PHYS_TO_RR7(dp->sale_sal_gp);
-			PRINT_BV("  SAL Proc at 0x%lx, GP at 0x%lx\n",
-				 sal_fdesc.func, sal_fdesc.gp);
-			ia64_sal_entry = (sal_entry_t *) &sal_fdesc;
-			break;
-		}
-		default:
-			break;
-		}
-		p += sizes[*p];
-	}
-}
-
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/arch/ia64/sched.c
--- a/extras/mini-os/arch/ia64/sched.c	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/* 
- * Done by Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com
- *
- * Description: ia64 specific part of the scheduler for mini-os
- *
- ****************************************************************************
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- * 
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
- * DEALINGS IN THE SOFTWARE.
- */
-
-
-#include <mini-os/types.h>
-#include <mini-os/sched.h>
-#include <mini-os/lib.h>
-#include <mini-os/xmalloc.h>
-#include <mini-os/mm.h>
-
-/* The function is implemented in fw.S */
-extern void thread_starter(void);
-
-void stack_walk(void)
-{
-    /* TODO */
-}
-
-struct thread*
-arch_create_thread(char *name, void (*function)(void *), void *data)
-{
-	struct thread* _thread;
-
-	_thread = (struct thread*)_xmalloc(sizeof(struct thread), 16);
-	/* Allocate pages for stack, stack will be aligned */
-	_thread->stack = (char *)alloc_pages(STACK_SIZE_PAGE_ORDER);
-	_thread->name = name;
-	memset((void*)&(_thread->regs), 0, sizeof(_thread->regs));
-	_thread->regs.sp = ((uint64_t)_thread->stack) + STACK_SIZE - 16;
-	_thread->regs.bsp = ((uint64_t)_thread->stack) + 0x10;
-	_thread->regs.rp = FDESC_FUNC(thread_starter);
-	_thread->regs.pfs = 0x82;
-	_thread->regs.r4 = FDESC_FUNC(function);
-	_thread->regs.r6 = (uint64_t)data;
-	return _thread;
-}
-
-extern void restore_context(struct thread*);
-extern int switch_context(struct thread*, struct thread*);
-
-void
-arch_switch_threads(struct thread* prev, struct thread* next)
-{
-	ia64_set_r13((uint64_t)next);
-	switch_context(prev, next);
-}
-
-/* Everything initialised, start idle thread */
-void
-run_idle_thread(void)
-{
-	//do_busy_loop();
-	ia64_set_r13((uint64_t)idle_thread);
-	restore_context(idle_thread);
-	printk("%s: restore_context() returned - bad!\n", __func__);
-}
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/arch/ia64/time.c
--- a/extras/mini-os/arch/ia64/time.c	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,289 +0,0 @@
-/* 
- * Done by Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
- * Description: simple ia64 specific time handling
- * Parts are taken from FreeBSD.
- *
- ****************************************************************************
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <mini-os/os.h>
-#include <mini-os/console.h>
-#include <mini-os/time.h>
-#include <mini-os/efi.h>
-#include <mini-os/events.h>
-
-struct timespec os_time;
-static uint64_t itc_alt;		/* itc on last update. */
-static uint64_t itc_at_boot;		/* itc on boot */
-static uint64_t itc_frequency;
-static uint64_t processor_frequency;
-static uint64_t itm_val;
-
-static int is_leap_year(int year)
-{
-	if( year % 4 == 0 )
-	{
-		if( year % 100 == 0 )
-		{
-			if( year % 400 == 0 ) return 1;
-			else return 0;
-		}
-		return 1;
-	}
-	return 0;
-}
-
-static int count_leap_years(int epoch, int year)
-{
-	int i, result = 0;
-	for( i = epoch ; i < year ; i++ ) if( is_leap_year(i) ) result++;
-	return result;
-}
-
-static int get_day(int year, int mon, int day) {
-	int result;
-	switch(mon)
-	{
-		case 0: result = 0; break;
-		case 1: result = 31; break; /* 1: 31 */
-		case 2: result = 59; break; /* 2: 31+28 */
-		case 3: result = 90; break; /* 3: 59+31 */
-		case 4: result = 120;break; /* 4: 90+30 */
-		case 5: result = 151;break; /* 5: 120+31 */
-		case 6: result = 181;break; /* 6: 151+30 */
-		case 7: result = 212;break; /* 7: 181+31 */
-		case 8: result = 243;break; /* 8: 212+31 */
-		case 9: result = 273;break; /* 9: 243+30 */
-		case 10:result = 304;break; /* 10:273+31 */
-		case 11:result = 334;break; /* 11:304+30 */
-		default: break;
-	}
-	if( is_leap_year(year) && mon > 2 ) result++;
-	result += day - 1;
-	return result;
-}
-
-/*
- * Converts Gregorian date to seconds since 1970-01-01 00:00:00.
- * Assumes input in normal date format, i.e. 1980-12-31 23:59:59
- * => year=1980, mon=12, day=31, hour=23, min=59, sec=59.
- *
- * WARNING: this function will overflow on 2106-02-07 06:28:16 on
- * machines were long is 32-bit! (However, as time_t is signed, we
- * will already get problems at other places on 2038-01-19 03:14:08)
- */
-static unsigned long _mktime(const unsigned int year, const unsigned int mon,
-			    const unsigned int day, const unsigned int hour,
-		            const unsigned int min, const unsigned int sec)
-{
-	unsigned long result = 0;
-
-	result = sec;
-	result += min * 60;
-	result += hour * 3600;
-	result += get_day(year, mon - 1, day) * 86400;
-	result += (year - 1970) * 31536000;
-	result += count_leap_years(1970, year) * 86400;
-
-	return result;
-}
-
-static inline uint64_t
-ns_from_cycles(uint64_t cycles)
-{
-	return (cycles * (1000000000 / itc_frequency));
-}
-
-static inline uint64_t
-ns_to_cycles(uint64_t ns)
-{
-	return (ns * (itc_frequency / 1000000000));
-}
-
-/*
- * Block the domain until until(nanoseconds) is over.
- * If block is called no timerinterrupts are delivered from xen!
- */
-void
-block_domain(s_time_t until)
-{
-	struct ia64_pal_result pal_res;
-	uint64_t c, new;
-
-	c = ns_to_cycles(until);
-	new = ia64_get_itc() + c - NOW();
-	ia64_set_itm(new);		/* Reload cr.itm */
-	/*
-	 * PAL_HALT_LIGHT returns on every external interrupt,
-	 * including timer interrupts.
-	 */
-	pal_res = ia64_call_pal_static(PAL_HALT_LIGHT, 0, 0, 0);
-	if (pal_res.pal_status != 0)
-		printk("%s: PAL_HALT_LIGHT returns an error\n");
-	/* Reload the normal timer interrupt match. */
-	new = ia64_get_itc() + itm_val;
-	ia64_set_itm(new);
-}
-
-static void
-calculate_time(void)
-{
-	uint64_t itc_new, new;
-
-	itc_new = ia64_get_itc();
-	if (itc_new < itc_alt)
-		new = ~0 - itc_alt + itc_new;
-	else
-		new = itc_new - itc_alt;
-	itc_alt = itc_new;
-	new = ns_from_cycles(new);
-	os_time.tv_nsec += new;
-	if (os_time.tv_nsec > 1000000000) {	/* On overflow. */
-		os_time.tv_sec++;
-		os_time.tv_nsec -= 1000000000;
-	}
-}
-
-void
-timer_interrupt(evtchn_port_t port, struct pt_regs* regsP, void *data)
-{
-	uint64_t new;
-
-	calculate_time();
-	new = ia64_get_itc() + itm_val;
-	ia64_set_itm(new);
-}
-
-/*
- * monotonic_clock(): returns # of nanoseconds passed since time_init()
- */
-uint64_t
-monotonic_clock(void)
-{
-	uint64_t delta;
-
-	delta = ia64_get_itc() - itc_at_boot;
-	delta = ns_from_cycles(delta);
-	return delta;
-}
-
-int
-gettimeofday(struct timeval *tv, void *tz)
-{
-	calculate_time();
-	tv->tv_sec = os_time.tv_sec;			/* seconds */
-	tv->tv_usec = NSEC_TO_USEC(os_time.tv_nsec);	/* microseconds */
-        return 0;
-};
-
-/*
- * Read the clock frequencies from pal and sal for calculating
- * the clock interrupt.
- */
-static void
-calculate_frequencies(void)
-{
-	struct ia64_sal_result sal_res;
-	struct ia64_pal_result pal_res;
-
-	pal_res = ia64_call_pal_static(PAL_FREQ_RATIOS, 0, 0, 0);
-	sal_res = ia64_sal_entry(SAL_FREQ_BASE, 0, 0, 0, 0, 0, 0, 0);
-
-	if (sal_res.sal_status == 0 && pal_res.pal_status == 0) {
-		processor_frequency =
-			sal_res.sal_result[0] * (pal_res.pal_result[0] >> 32)
-				/ (pal_res.pal_result[0] & ((1L << 32) - 1));
-		itc_frequency =
-			sal_res.sal_result[0] * (pal_res.pal_result[2] >> 32)
-				/ (pal_res.pal_result[2] & ((1L << 32) - 1));
-		PRINT_BV("Reading clock frequencies:\n");
-		PRINT_BV("  Platform clock frequency %ld Hz\n",
-			       sal_res.sal_result[0]);
-		PRINT_BV("  Processor ratio %ld/%ld, Bus ratio %ld/%ld, "
-			       "  ITC ratio %ld/%ld\n",
-			       pal_res.pal_result[0] >> 32,
-			       pal_res.pal_result[0] & ((1L << 32) - 1),
-			       pal_res.pal_result[1] >> 32,
-			       pal_res.pal_result[1] & ((1L << 32) - 1),
-			       pal_res.pal_result[2] >> 32,
-			       pal_res.pal_result[2] & ((1L << 32) - 1));
-
-		printk("  ITC frequency %ld\n", itc_frequency);
-	} else {
-		itc_frequency = 1000000000;
-		processor_frequency = 0;
-		printk("Reading clock frequencies failed!!! Using: %ld\n",
-		       itc_frequency);
-	}
-}
-
-
-//#define HZ 1
-#define HZ 1000		// 1000 clock ticks per sec
-#define IA64_TIMER_VECTOR 0xef
-
-void
-init_time(void)
-{
-	uint64_t new;
-	efi_time_t tm;
-	evtchn_port_t port = 0;
-
-	printk("Initialising time\n");
-	calculate_frequencies();
-
-	itm_val = (itc_frequency + HZ/2) / HZ;
-	printk("  itm_val: %ld\n", itm_val);
-
-	os_time.tv_sec = 0;
-	os_time.tv_nsec = 0;
-
-	if (efi_get_time(&tm)) {
-		printk("  EFI-Time: %d.%d.%d   %d:%d:%d\n", tm.Day,
-		       tm.Month, tm.Year, tm.Hour, tm.Minute, tm.Second);
-		os_time.tv_sec = _mktime(tm.Year, tm.Month,
-					tm.Day, tm.Hour, tm.Minute, tm.Second);
-		os_time.tv_nsec = tm.Nanosecond;
-	} else
-		printk("efi_get_time() failed\n");
-
-	port = bind_virq(VIRQ_ITC, timer_interrupt, NULL);
-	if (port == -1) {
-		printk("XEN timer request chn bind failed %i\n", port);
-		return;
-	}
-        unmask_evtchn(port);
-	itc_alt = ia64_get_itc();
-	itc_at_boot = itc_alt;
-	new = ia64_get_itc() + itm_val;
-	ia64_set_itv(IA64_TIMER_VECTOR);
-	ia64_set_itm(new);
-	ia64_srlz_d();
-}
-
-void
-fini_time(void)
-{
-	/* TODO */
-}
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/arch/ia64/xencomm.c
--- a/extras/mini-os/arch/ia64/xencomm.c	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,394 +0,0 @@
-/*
- * Copyright (C) 2006 Hollis Blanchard <hollisb@us.ibm.com>, IBM Corporation
- * Tristan Gingold <tristan.gingold@bull.net>
- *
- * 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
- */
-
-/*
- * This code is mostly taken from ia64-xen files xcom_mini.c and xencomm.c.
- * Changes: Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com
- */
-
-
-#include <mini-os/os.h>
-#include <mini-os/errno.h>
-#include <mini-os/lib.h>
-#include <mini-os/hypervisor.h>
-#include <xen/xencomm.h>
-#include <xen/grant_table.h>
-
-
-#define XENCOMM_MINI_ADDRS 3
-struct xencomm_mini
-{
-	struct xencomm_desc _desc;
-	uint64_t address[XENCOMM_MINI_ADDRS];
-};
-
-#define xen_guest_handle(hnd)  ((hnd).p)
-
-struct xencomm_handle;
-
-/* Translate virtual address to physical address.  */
-uint64_t
-xencomm_vaddr_to_paddr(uint64_t vaddr)
-{
-	if (IA64_RR_EXTR(vaddr) == 5)
-		return KERN_VIRT_2_PHYS(vaddr);
-
-	if (IA64_RR_EXTR(vaddr) == 7)
-		return __pa(vaddr);
-
-	return 0;
-}
-
-/* Inline version.  To be used only on linear space (kernel space).  */
-static struct xencomm_handle *
-xencomm_create_inline(void *buffer)
-{
-	unsigned long paddr;
-
-	paddr = xencomm_vaddr_to_paddr((unsigned long)buffer);
-	return (struct xencomm_handle *)(paddr | XENCOMM_INLINE_FLAG);
-}
-
-#define min(a,b) (((a) < (b)) ? (a) : (b))
-static int
-xencomm_init_desc(struct xencomm_desc *desc, void *buffer, unsigned long bytes)
-{
-	unsigned long recorded = 0;
-	int i = 0;
-
-	if ((buffer == NULL) && (bytes > 0))
-		BUG();
-
-	/* record the physical pages used */
-	if (buffer == NULL)
-		desc->nr_addrs = 0;
-
-	while ((recorded < bytes) && (i < desc->nr_addrs)) {
-		unsigned long vaddr = (unsigned long)buffer + recorded;
-		unsigned long paddr;
-		int offset;
-		int chunksz;
-
-		offset = vaddr % PAGE_SIZE; /* handle partial pages */
-		chunksz = min(PAGE_SIZE - offset, bytes - recorded);
-
-		paddr = xencomm_vaddr_to_paddr(vaddr);
-		if (paddr == ~0UL) {
-			printk("%s: couldn't translate vaddr %lx\n",
-			       __func__, vaddr);
-			return -EINVAL;
-		}
-
-		desc->address[i++] = paddr;
-		recorded += chunksz;
-	}
-	if (recorded < bytes) {
-		printk("%s: could only translate %ld of %ld bytes\n",
-		       __func__, recorded, bytes);
-		return -ENOSPC;
-	}
-
-	/* mark remaining addresses invalid (just for safety) */
-	while (i < desc->nr_addrs)
-		desc->address[i++] = XENCOMM_INVALID;
-	desc->magic = XENCOMM_MAGIC;
-	return 0;
-}
-
-static void *
-xencomm_alloc_mini(struct xencomm_mini *area, int *nbr_area)
-{
-	unsigned long base;
-	unsigned int pageoffset;
-
-	while (*nbr_area >= 0) {
-		/* Allocate an area.  */
-		(*nbr_area)--;
-
-		base = (unsigned long)(area + *nbr_area);
-		pageoffset = base % PAGE_SIZE; 
-
-		/* If the area does not cross a page, use it.  */
-		if ((PAGE_SIZE - pageoffset) >= sizeof(struct xencomm_mini))
-			return &area[*nbr_area];
-	}
-	/* No more area.  */
-	return NULL;
-}
-
-int
-xencomm_create_mini(struct xencomm_mini *area, int *nbr_area,
-                    void *buffer, unsigned long bytes,
-                    struct xencomm_handle **ret)
-{
-	struct xencomm_desc *desc;
-	int rc;
-	unsigned long res;
-
-	desc = xencomm_alloc_mini(area, nbr_area);
-	if (!desc)
-		return -ENOMEM;
-	desc->nr_addrs = XENCOMM_MINI_ADDRS;
-
-	rc = xencomm_init_desc(desc, buffer, bytes);
-	if (rc)
-		return rc;
-
-	res = xencomm_vaddr_to_paddr((unsigned long)desc);
-	if (res == ~0UL)
-		return -EINVAL;
-
-	*ret = (struct xencomm_handle*)res;
-	return 0;
-}
-
-static int
-xencommize_mini_grant_table_op(struct xencomm_mini *xc_area, int *nbr_area,
-                               unsigned int cmd, void *op, unsigned int count,
-                               struct xencomm_handle **desc)
-{
-	struct xencomm_handle *desc1;
-	unsigned int argsize=0;
-	int rc;
-
-	switch (cmd) {
-	case GNTTABOP_map_grant_ref:
-		argsize = sizeof(struct gnttab_map_grant_ref);
-		break;
-	case GNTTABOP_unmap_grant_ref:
-		argsize = sizeof(struct gnttab_unmap_grant_ref);
-		break;
-	case GNTTABOP_setup_table:
-	{
-		struct gnttab_setup_table *setup = op;
-
-		argsize = sizeof(*setup);
-
-		if (count != 1)
-			return -EINVAL;
-		rc = xencomm_create_mini
-		        (xc_area, nbr_area,
-		         (void*)(uint64_t) xen_guest_handle(setup->frame_list),
-		         setup->nr_frames
-		         * sizeof(*xen_guest_handle(setup->frame_list)),
-		         &desc1);
-		if (rc)
-			return rc;
-		set_xen_guest_handle(setup->frame_list,
-				     (void *)(uint64_t)desc1);
-		break;
-	}
-	case GNTTABOP_dump_table:
-		argsize = sizeof(struct gnttab_dump_table);
-		break;
-	case GNTTABOP_transfer:
-		argsize = sizeof(struct gnttab_transfer);
-		break;
-	case GNTTABOP_copy:
-		argsize = sizeof(struct gnttab_copy);
-		break;
-	default:
-		printk("%s: unknown mini grant table op %d\n", __func__, cmd);
-		BUG();
-	}
-
-	rc = xencomm_create_mini(xc_area, nbr_area, op, count * argsize, desc);
-
-	return rc;
-}
-
-static inline int
-xencomm_arch_hypercall_grant_table_op(unsigned int cmd,
-                                      struct xencomm_handle *uop,
-                                      unsigned int count)
-{
-	return _hypercall3(int, grant_table_op, cmd, uop, count);
-}
-
-int
-xencomm_mini_hypercall_grant_table_op(unsigned int cmd, void *op,
-                                      unsigned int count)
-{
-	int rc;
-	struct xencomm_handle *desc;
-	int nbr_area = 2;
-	struct xencomm_mini xc_area[2];
-
-	rc = xencommize_mini_grant_table_op(xc_area, &nbr_area,
-					    cmd, op, count, &desc);
-	if (rc)
-		return rc;
-	return xencomm_arch_hypercall_grant_table_op(cmd, desc, count);
-}
-
-static void
-gnttab_map_grant_ref_pre(struct gnttab_map_grant_ref *uop)
-{
-	uint32_t flags;
-
-	flags = uop->flags;
-
-	if (flags & GNTMAP_host_map) {
-		if (flags & GNTMAP_application_map) {
-			printk("GNTMAP_application_map is not supported yet: "
-			       "flags 0x%x\n", flags);
-			BUG();
-		}
-		if (flags & GNTMAP_contains_pte) {
-			printk("GNTMAP_contains_pte is not supported yet flags "
-			       "0x%x\n", flags);
-			BUG();
-		}
-	} else if (flags & GNTMAP_device_map) {
-		printk("GNTMAP_device_map is not supported yet 0x%x\n", flags);
-		BUG();//XXX not yet. actually this flag is not used.
-	} else {
-		BUG();
-	}
-}
-
-int
-HYPERVISOR_grant_table_op(unsigned int cmd, void *uop, unsigned int count)
-{
-	if (cmd == GNTTABOP_map_grant_ref) {
-		unsigned int i;
-		for (i = 0; i < count; i++) {
-			gnttab_map_grant_ref_pre(
-			        (struct gnttab_map_grant_ref*)uop + i);
-		}
-	}
-	return xencomm_mini_hypercall_grant_table_op(cmd, uop, count);
-}
-
-	/* In fw.S */
-extern int xencomm_arch_hypercall_suspend(struct xencomm_handle *arg);
-int
-HYPERVISOR_suspend(unsigned long srec)
-{
-        struct sched_shutdown arg;
-
-        arg.reason = (uint32_t)SHUTDOWN_suspend;
-
-        return xencomm_arch_hypercall_suspend(xencomm_create_inline(&arg));
-}
-
-int
-HYPERVISOR_event_channel_op(int cmd, void *arg)
-{
-	int rc;
-	struct xencomm_handle *newArg;
-
-	newArg = xencomm_create_inline(arg);
-	rc = _hypercall2(int, event_channel_op, cmd, newArg);
-	if (unlikely(rc == -ENOSYS)) {
-		struct evtchn_op op;
-
-		op.cmd = cmd;
-		memcpy(&op.u, arg, sizeof(op.u));
-		rc = _hypercall1(int, event_channel_op_compat, &op);
-	}
-	return rc;
-}
-
-static int
-xencomm_arch_xen_version(int cmd, struct xencomm_handle *arg)
-{
-	return _hypercall2(int, xen_version, cmd, arg);
-}
-
-static int
-xencomm_arch_xen_feature(int cmd, struct xencomm_handle *arg)
-{
-	struct xencomm_handle *newArg;
-
-	newArg = xencomm_create_inline(arg);
-	return _hypercall2(int, xen_version, cmd, newArg);
-}
-
-int
-HYPERVISOR_xen_version(int cmd, void *arg)
-{
-	switch(cmd) {
-		case XENVER_version:
-			return xencomm_arch_xen_version(cmd, 0);
-		case XENVER_get_features:
-			return xencomm_arch_xen_feature(cmd, arg);
-		default:
-			return -1;
-	}
-}
-
-int
-HYPERVISOR_console_io(int cmd, int count, char *str)
-{
-	struct xencomm_handle *newStr;
-
-	newStr = xencomm_create_inline(str);
-	return _hypercall3(int, console_io, cmd, count, newStr);
-}
-
-int
-HYPERVISOR_sched_op_compat(int cmd, unsigned long arg)
-{
-	return _hypercall2(int, sched_op_compat, cmd, arg);
-}
-
-int
-HYPERVISOR_sched_op(int cmd, void *arg)
-{
-	struct xencomm_handle *newArg;
-
-	newArg = xencomm_create_inline(arg);
-	return _hypercall2(int, sched_op, cmd, newArg);
-}
-
-int
-HYPERVISOR_callback_op(int cmd, void *arg)
-{
-	struct xencomm_handle *newArg;
-
-	newArg = xencomm_create_inline(arg);
-	return _hypercall2(int, callback_op, cmd, newArg);
-}
-
-int
-HYPERVISOR_opt_feature(void *arg)
-{
-	struct xencomm_handle *new_arg;
-
-	new_arg = xencomm_create_inline(arg);
-
-	return _hypercall1(int, opt_feature, new_arg);
-}
-
-int
-HYPERVISOR_shutdown(unsigned int reason)
-{
-	struct sched_shutdown sched_shutdown = {
-		.reason = reason
-	};
-
-	int rc = HYPERVISOR_sched_op(SCHEDOP_shutdown, &sched_shutdown);
-
-	if (rc == -ENOSYS)
-		rc = HYPERVISOR_sched_op_compat(SCHEDOP_shutdown, reason);
-
-	return rc;
-}
-
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/gnttab.c
--- a/extras/mini-os/gnttab.c	Wed Sep 12 16:12:42 2012 +0100
+++ b/extras/mini-os/gnttab.c	Wed Sep 12 17:55:27 2012 +0100
@@ -23,11 +23,7 @@
 #define NR_RESERVED_ENTRIES 8
 
 /* NR_GRANT_FRAMES must be less than or equal to that configured in Xen */
-#ifdef __ia64__
-#define NR_GRANT_FRAMES 1
-#else
 #define NR_GRANT_FRAMES 4
-#endif
 #define NR_GRANT_ENTRIES (NR_GRANT_FRAMES * PAGE_SIZE / sizeof(grant_entry_t))
 
 static grant_entry_t *gnttab_table;
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/include/hypervisor.h
--- a/extras/mini-os/include/hypervisor.h	Wed Sep 12 16:12:42 2012 +0100
+++ b/extras/mini-os/include/hypervisor.h	Wed Sep 12 17:55:27 2012 +0100
@@ -7,7 +7,6 @@
  * Copyright (c) 2002, K A Fraser
  * Copyright (c) 2005, Grzegorz Milos
  * Updates: Aravindh Puthiyaparambil <aravindh.puthiyaparambil@unisys.com>
- * Updates: Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com> for ia64
  */
 
 #ifndef _HYPERVISOR_H_
@@ -19,8 +18,6 @@
 #include <hypercall-x86_32.h>
 #elif defined(__x86_64__)
 #include <hypercall-x86_64.h>
-#elif defined(__ia64__)
-#include <hypercall-ia64.h>
 #else
 #error "Unsupported architecture"
 #endif
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/include/ia64/arch_limits.h
--- a/extras/mini-os/include/ia64/arch_limits.h	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-
-#ifndef __ARCH_LIMITS_H__
-#define __ARCH_LIMITS_H__
-
-/* Commonly 16K pages are used. */
-#define __PAGE_SHIFT	14	/* 16K pages */
-#define __PAGE_SIZE	(1<<(__PAGE_SHIFT))
-
-#define __STACK_SIZE_PAGE_ORDER   2
-#define __STACK_SIZE              (__PAGE_SIZE * (1 << __STACK_SIZE_PAGE_ORDER))
-          
-#endif /* __ARCH_LIMITS_H__ */
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/include/ia64/arch_mm.h
--- a/extras/mini-os/include/ia64/arch_mm.h	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2007 - Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
- *
- ****************************************************************************
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- * 
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
- * DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef __ARCH_MM_H__
-#define __ARCH_MM_H__
-
-#include "page.h"
-#include "ia64_cpu.h"
-
-#define PFN_PHYS(x)	(pfn_to_page(x))
-#define PHYS_PFN(x)	(page_to_pfn(x))
-#define to_virt(x)	__va(x)
-#define to_phys(x)	__pa(x)
-
-#define virt_to_mfn(x)	virt_to_pfn(x)
-#define virtual_to_mfn(x)      (ia64_tpa((uint64_t)(x)) >> PAGE_SHIFT)
-
-#define map_frames(f, n) map_frames_ex(f, n, 1, 0, 1, DOMID_SELF, NULL, 0)
-/* TODO */
-#define map_zero(n, a) map_frames_ex(NULL, n, 0, 0, a, DOMID_SELF, NULL, 0)
-#define do_map_zero(start, n) ASSERT(n == 0)
-
-#endif /* __ARCH_MM_H__ */
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/include/ia64/arch_sched.h
--- a/extras/mini-os/include/ia64/arch_sched.h	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 2006 Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
- * All rights reserved.
- *
- * The file contains ia64 specific scheduler declarations.
- *
- ****************************************************************************
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- * 
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
- * DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef __ARCH_SCHED_H__
-#define __ARCH_SCHED_H__
-
-#include "os.h"
-
-struct thread;				/* Only declaration */
-
-struct thread_regs
-{
-	unsigned long	unat_b;		/* NaT before spilling */
-	unsigned long	sp;
-	unsigned long	rp;
-	unsigned long	pr;
-	unsigned long	bsp;
-	unsigned long	pfs;
-	unsigned long	rnat;
-	unsigned long	lc;
-
-	unsigned long	unat_a;		/* NaT after spilling. */
-	unsigned long	r4;
-	unsigned long	r5;
-	unsigned long	r6;
-	unsigned long	r7;
-
-	unsigned long	b1;
-	unsigned long	b2;
-	unsigned long	b3;
-	unsigned long	b4;
-	unsigned long	b5;
-
-	ia64_fpreg_t	f2;
-	ia64_fpreg_t	f3;
-	ia64_fpreg_t	f4;
-	ia64_fpreg_t	f5;
-	ia64_fpreg_t	f16;
-	ia64_fpreg_t	f17;
-	ia64_fpreg_t	f18;
-	ia64_fpreg_t	f19;
-	ia64_fpreg_t	f20;
-	ia64_fpreg_t	f21;
-	ia64_fpreg_t	f22;
-	ia64_fpreg_t	f23;
-	ia64_fpreg_t	f24;
-	ia64_fpreg_t	f25;
-	ia64_fpreg_t	f26;
-	ia64_fpreg_t	f27;
-	ia64_fpreg_t	f28;
-	ia64_fpreg_t	f29;
-	ia64_fpreg_t	f30;
-	ia64_fpreg_t	f31;
-};
-
-typedef struct thread_regs thread_regs_t;
-
-void arch_switch_threads(struct thread* prev, struct thread* next);
-
-static inline struct thread* get_current(void)
-{
-	register struct thread *current asm("r13");
-	return current;
-}
-
-
-#endif /* __ARCH_SCHED_H__ */
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/include/ia64/arch_spinlock.h
--- a/extras/mini-os/include/ia64/arch_spinlock.h	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
- * Done by Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com
- * The file contains ia64 special spinlock stuff.
- *
- ****************************************************************************
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- * 
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
- * DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _ARCH_SPINLOCK_H_
-#define _ARCH_SPINLOCK_H_
-
-#include "atomic.h"
-
-#define ARCH_SPIN_LOCK_UNLOCKED { 0 }
-
-#define SPIN_LOCK_UNUSED	0
-#define SPIN_LOCK_USED		1
-
-
-static inline void
-_raw_spin_lock(spinlock_t* lck)
-{
-	uint32_t ret;
-	do {
-		ret = ia64_cmpxchg_acq_32(&(lck->slock),
-					  SPIN_LOCK_UNUSED, SPIN_LOCK_USED);
-	} while (ret == SPIN_LOCK_USED);
-}
-
-static inline void
-_raw_spin_unlock(spinlock_t *lck)
-{
-	asm volatile ("st4.rel.nta [%0] = r0\n\t" :: "r"(&(lck->slock))
-							: "memory" );
-}
-
-static inline uint32_t
-_raw_spin_trylock(spinlock_t* lck)
-{
-	uint32_t ret;
-	ret = ia64_cmpxchg_acq_32(&(lck->slock), SPIN_LOCK_USED, SPIN_LOCK_USED);
-	return (ret == SPIN_LOCK_USED);
-}
-
-#endif /* _ARCH_SPINLOCK_H_ */
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/include/ia64/asm.h
--- a/extras/mini-os/include/ia64/asm.h	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-/*
- * Done by Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com
- */
-
-#if !defined(_ASM_H_)
-#define _ASM_H_
-
-#define	ENTRY(_name_)				\
-	.global	_name_;				\
-	.align	16;				\
-	.proc	_name_;				\
-_name_:;					\
-
-
-#define	END(_name_)						\
-	.endp	_name_
-
-#endif /* !defined(_ASM_H_) */
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/include/ia64/atomic.h
--- a/extras/mini-os/include/ia64/atomic.h	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,504 +0,0 @@
-/*
- * This code is mostly taken from FreeBSD machine/atomic.h
- * Changes: Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
- *
- ****************************************************************************
- * Copyright (c) 1998 Doug Rabson
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef _MACHINE_ATOMIC_H_
-#define _MACHINE_ATOMIC_H_
-
-/*
- * Various simple arithmetic on memory which is atomic in the presence
- * of interrupts and SMP safe.
- */
-
-#if !defined(__ASSEMBLY__)
-
-#include <mini-os/types.h>
-
-
-/*
- * Everything is built out of cmpxchg.
- */
-#define IA64_CMPXCHG(sz, sem, p, cmpval, newval, ret)		\
-	__asm __volatile (					\
-		"mov ar.ccv=%2;;\n\t"				\
-		"cmpxchg" #sz "." #sem " %0=%4,%3,ar.ccv\n\t"	\
-		: "=r" (ret), "=m" (*p)				\
-		: "r" (cmpval), "r" (newval), "m" (*p)		\
-		: "memory")
-
-
-/*
- * Some common forms of cmpxch.
- */
-
-static __inline uint8_t
-ia64_cmpxchg_acq_8(volatile uint8_t* p, uint8_t cmpval, uint8_t newval)
-{
-	uint8_t ret;
-
-	IA64_CMPXCHG(1, acq, p, cmpval, newval, ret);
-	return (ret);
-}
-
-static __inline uint16_t
-ia64_cmpxchg_acq_16(volatile uint16_t* p, uint16_t cmpval, uint16_t newval)
-{
-	uint16_t ret;
-
-	IA64_CMPXCHG(2, acq, p, cmpval, newval, ret);
-	return (ret);
-}
-
-static __inline uint32_t
-ia64_cmpxchg_acq_32(volatile uint32_t* p, uint32_t cmpval, uint32_t newval)
-{
-	uint32_t ret;
-
-	IA64_CMPXCHG(4, acq, p, cmpval, newval, ret);
-	return (ret);
-}
-
-static __inline uint32_t
-ia64_cmpxchg_rel_32(volatile uint32_t* p, uint32_t cmpval, uint32_t newval)
-{
-	uint32_t ret;
-
-	IA64_CMPXCHG(4, rel, p, cmpval, newval, ret);
-	return (ret);
-}
-
-static __inline uint64_t
-ia64_cmpxchg_acq_64(volatile uint64_t* p, uint64_t cmpval, uint64_t newval)
-{
-	uint64_t ret;
-
-	IA64_CMPXCHG(8, acq, p, cmpval, newval, ret);
-	return (ret);
-}
-
-static __inline uint64_t
-ia64_cmpxchg_rel_64(volatile uint64_t* p, uint64_t cmpval, uint64_t newval)
-{
-	uint64_t ret;
-
-	IA64_CMPXCHG(8, rel, p, cmpval, newval, ret);
-	return (ret);
-}
-
-#define ATOMIC_STORE_LOAD(type, width, size)			\
-static __inline uint##width##_t				\
-ia64_ld_acq_##width(volatile uint##width##_t* p)		\
-{								\
-	uint##width##_t v;					\
-								\
-	__asm __volatile ("ld" size ".acq %0=%1"		\
-			  : "=r" (v)				\
-			  : "m" (*p)				\
-			  : "memory");				\
-	return (v);						\
-}								\
-								\
-static __inline uint##width##_t				\
-atomic_load_acq_##width(volatile uint##width##_t* p)		\
-{								\
-	uint##width##_t v;					\
-								\
-	__asm __volatile ("ld" size ".acq %0=%1"		\
-			  : "=r" (v)				\
-			  : "m" (*p)				\
-			  : "memory");				\
-	return (v);						\
-}								\
-								\
-static __inline uint##width##_t				\
-atomic_load_acq_##type(volatile uint##width##_t* p)		\
-{								\
-	uint##width##_t v;					\
-								\
-	__asm __volatile ("ld" size ".acq %0=%1"		\
-			  : "=r" (v)				\
-			  : "m" (*p)				\
-			  : "memory");				\
-	return (v);						\
-}								\
-							       	\
-static __inline void						\
-ia64_st_rel_##width(volatile uint##width##_t* p, uint##width##_t v)\
-{								\
-	__asm __volatile ("st" size ".rel %0=%1"		\
-			  : "=m" (*p)				\
-			  : "r" (v)				\
-			  : "memory");				\
-}								\
-							       	\
-static __inline void						\
-atomic_store_rel_##width(volatile uint##width##_t* p, uint##width##_t v)\
-{								\
-	__asm __volatile ("st" size ".rel %0=%1"		\
-			  : "=m" (*p)				\
-			  : "r" (v)				\
-			  : "memory");				\
-}								\
-							       	\
-static __inline void						\
-atomic_store_rel_##type(volatile uint##width##_t* p, uint##width##_t v)\
-{								\
-	__asm __volatile ("st" size ".rel %0=%1"		\
-			  : "=m" (*p)				\
-			  : "r" (v)				\
-			  : "memory");				\
-}
-
-ATOMIC_STORE_LOAD(char, 8, "1")
-ATOMIC_STORE_LOAD(short, 16, "2")
-ATOMIC_STORE_LOAD(int, 32, "4")
-ATOMIC_STORE_LOAD(long, 64, "8")
-
-#undef ATOMIC_STORE_LOAD
-
-#define IA64_ATOMIC(sz, type, name, width, op)			\
-									\
-static __inline type							\
-atomic_##name##_acq_##width(volatile type *p, type v)		\
-{									\
-	type old, ret;							\
-	do {								\
-		old = *p;						\
-		IA64_CMPXCHG(sz, acq, p, old, old op v, ret);	\
-	} while (ret != old);						\
-	return(ret);							\
-}									\
-									\
-static __inline type							\
-atomic_##name##_rel_##width(volatile type *p, type v)		\
-{									\
-	type old, ret;							\
-	do {								\
-		old = *p;						\
-		IA64_CMPXCHG(sz, rel, p, old, old op v, ret);	\
-	} while (ret != old);						\
-	return(ret);							\
-}
-
-IA64_ATOMIC(1, uint8_t,  set,	8,	|)
-IA64_ATOMIC(2, uint16_t, set,	16,	|)
-IA64_ATOMIC(4, uint32_t, set,	32,	|)
-IA64_ATOMIC(8, uint64_t, set,	64,	|)
-
-IA64_ATOMIC(1, uint8_t,  clear,	8,	&~)
-IA64_ATOMIC(2, uint16_t, clear,	16,	&~)
-IA64_ATOMIC(4, uint32_t, clear,	32,	&~)
-IA64_ATOMIC(8, uint64_t, clear,	64,	&~)
-
-IA64_ATOMIC(1, uint8_t,  add,	8,	+)
-IA64_ATOMIC(2, uint16_t, add,	16,	+)
-IA64_ATOMIC(4, uint32_t, add,	32,	+)
-IA64_ATOMIC(8, uint64_t, add,	64,	+)
-
-IA64_ATOMIC(1, uint8_t,  subtract,	8,	-)
-IA64_ATOMIC(2, uint16_t, subtract,	16,	-)
-IA64_ATOMIC(4, uint32_t, subtract,	32,	-)
-IA64_ATOMIC(8, uint64_t, subtract,	64,	-)
-
-#undef IA64_ATOMIC
-#undef IA64_CMPXCHG
-
-#define atomic_set_8			atomic_set_acq_8
-#define	atomic_clear_8			atomic_clear_acq_8
-#define atomic_add_8			atomic_add_acq_8
-#define	atomic_subtract_8		atomic_subtract_acq_8
-
-#define atomic_set_16			atomic_set_acq_16
-#define	atomic_clear_16			atomic_clear_acq_16
-#define atomic_add_16			atomic_add_acq_16
-#define	atomic_subtract_16		atomic_subtract_acq_16
-
-#define atomic_set_32			atomic_set_acq_32
-#define	atomic_clear_32			atomic_clear_acq_32
-#define atomic_add_32			atomic_add_acq_32
-#define	atomic_subtract_32		atomic_subtract_acq_32
-
-#define atomic_set_64			atomic_set_acq_64
-#define	atomic_clear_64			atomic_clear_acq_64
-#define atomic_add_64			atomic_add_acq_64
-#define	atomic_subtract_64		atomic_subtract_acq_64
-
-#define atomic_set_char			atomic_set_8
-#define atomic_clear_char		atomic_clear_8
-#define atomic_add_char			atomic_add_8
-#define atomic_subtract_char		atomic_subtract_8
-#define atomic_set_acq_char		atomic_set_acq_8
-#define atomic_clear_acq_char		atomic_clear_acq_8
-#define atomic_add_acq_char		atomic_add_acq_8
-#define atomic_subtract_acq_char	atomic_subtract_acq_8
-#define atomic_set_rel_char		atomic_set_rel_8
-#define atomic_clear_rel_char		atomic_clear_rel_8
-#define atomic_add_rel_char		atomic_add_rel_8
-#define atomic_subtract_rel_char	atomic_subtract_rel_8
-
-#define atomic_set_short		atomic_set_16
-#define atomic_clear_short		atomic_clear_16
-#define atomic_add_short		atomic_add_16
-#define atomic_subtract_short		atomic_subtract_16
-#define atomic_set_acq_short		atomic_set_acq_16
-#define atomic_clear_acq_short		atomic_clear_acq_16
-#define atomic_add_acq_short		atomic_add_acq_16
-#define atomic_subtract_acq_short	atomic_subtract_acq_16
-#define atomic_set_rel_short		atomic_set_rel_16
-#define atomic_clear_rel_short		atomic_clear_rel_16
-#define atomic_add_rel_short		atomic_add_rel_16
-#define atomic_subtract_rel_short	atomic_subtract_rel_16
-
-#define atomic_set_int			atomic_set_32
-#define atomic_clear_int		atomic_clear_32
-#define atomic_add_int			atomic_add_32
-#define atomic_subtract_int		atomic_subtract_32
-#define atomic_set_acq_int		atomic_set_acq_32
-#define atomic_clear_acq_int		atomic_clear_acq_32
-#define atomic_add_acq_int		atomic_add_acq_32
-#define atomic_subtract_acq_int		atomic_subtract_acq_32
-#define atomic_set_rel_int		atomic_set_rel_32
-#define atomic_clear_rel_int		atomic_clear_rel_32
-#define atomic_add_rel_int		atomic_add_rel_32
-#define atomic_subtract_rel_int		atomic_subtract_rel_32
-
-#define atomic_set_long			atomic_set_64
-#define atomic_clear_long		atomic_clear_64
-#define atomic_add_long			atomic_add_64
-#define atomic_subtract_long		atomic_subtract_64
-#define atomic_set_acq_long		atomic_set_acq_64
-#define atomic_clear_acq_long		atomic_clear_acq_64
-#define atomic_add_acq_long		atomic_add_acq_64
-#define atomic_subtract_acq_long	atomic_subtract_acq_64
-#define atomic_set_rel_long		atomic_set_rel_64
-#define atomic_clear_rel_long		atomic_clear_rel_64
-#define atomic_add_rel_long		atomic_add_rel_64
-#define atomic_subtract_rel_long	atomic_subtract_rel_64
-
-/*
- * Atomically compare the value stored at *p with cmpval and if the
- * two values are equal, update the value of *p with newval. Returns
- * zero if the compare failed, nonzero otherwise.
- */
-static __inline int
-atomic_cmpset_acq_32(volatile uint32_t* p, uint32_t cmpval, uint32_t newval)
-{
-	return ia64_cmpxchg_acq_32(p, cmpval, newval) == cmpval;
-}
-
-static __inline int
-atomic_cmpset_rel_32(volatile uint32_t* p, uint32_t cmpval, uint32_t newval)
-{
-	return ia64_cmpxchg_rel_32(p, cmpval, newval) == cmpval;
-}
-
-/*
- * Atomically compare the value stored at *p with cmpval and if the
- * two values are equal, update the value of *p with newval. Returns
- * zero if the compare failed, nonzero otherwise.
- */
-static __inline int
-atomic_cmpset_acq_64(volatile uint64_t* p, uint64_t cmpval, uint64_t newval)
-{
-	return ia64_cmpxchg_acq_64(p, cmpval, newval) == cmpval;
-}
-
-static __inline int
-atomic_cmpset_rel_64(volatile uint64_t* p, uint64_t cmpval, uint64_t newval)
-{
-	return ia64_cmpxchg_rel_64(p, cmpval, newval) == cmpval;
-}
-
-#define atomic_cmpset_32		atomic_cmpset_acq_32
-#define atomic_cmpset_64		atomic_cmpset_acq_64
-#define	atomic_cmpset_int		atomic_cmpset_32
-#define	atomic_cmpset_long		atomic_cmpset_64
-#define atomic_cmpset_acq_int		atomic_cmpset_acq_32
-#define atomic_cmpset_rel_int		atomic_cmpset_rel_32
-#define atomic_cmpset_acq_long		atomic_cmpset_acq_64
-#define atomic_cmpset_rel_long		atomic_cmpset_rel_64
-
-static __inline int
-atomic_cmpset_acq_ptr(volatile void *dst, void *exp, void *src)
-{
-        return atomic_cmpset_acq_long((volatile u_long *)dst,
-				      (u_long)exp, (u_long)src);
-}
-
-static __inline int
-atomic_cmpset_rel_ptr(volatile void *dst, void *exp, void *src)
-{
-        return atomic_cmpset_rel_long((volatile u_long *)dst,
-				      (u_long)exp, (u_long)src);
-}
-
-#define	atomic_cmpset_ptr	atomic_cmpset_acq_ptr
-
-static __inline void *
-atomic_load_acq_ptr(volatile void *p)
-{
-	return (void *)atomic_load_acq_long((volatile u_long *)p);
-}
-
-static __inline void
-atomic_store_rel_ptr(volatile void *p, void *v)
-{
-	atomic_store_rel_long((volatile u_long *)p, (u_long)v);
-}
-
-#define IA64_ATOMIC_PTR(NAME)				\
-static __inline void					\
-atomic_##NAME##_ptr(volatile void *p, uintptr_t v)	\
-{							\
-	atomic_##NAME##_long((volatile u_long *)p, v);	\
-}							\
-							\
-static __inline void					\
-atomic_##NAME##_acq_ptr(volatile void *p, uintptr_t v)	\
-{							\
-	atomic_##NAME##_acq_long((volatile u_long *)p, v);\
-}							\
-							\
-static __inline void					\
-atomic_##NAME##_rel_ptr(volatile void *p, uintptr_t v)	\
-{							\
-	atomic_##NAME##_rel_long((volatile u_long *)p, v);\
-}
-
-IA64_ATOMIC_PTR(set)
-IA64_ATOMIC_PTR(clear)
-IA64_ATOMIC_PTR(add)
-IA64_ATOMIC_PTR(subtract)
-
-#undef IA64_ATOMIC_PTR
-
-static __inline uint32_t
-atomic_readandclear_32(volatile uint32_t* p)
-{
-	uint32_t val;
-	do {
-		val = *p;
-	} while (!atomic_cmpset_32(p, val, 0));
-	return val;
-}
-
-static __inline uint64_t
-atomic_readandclear_64(volatile uint64_t* p)
-{
-	uint64_t val;
-	do {
-		val = *p;
-	} while (!atomic_cmpset_64(p, val, 0));
-	return val;
-}
-
-#define atomic_readandclear_int	atomic_readandclear_32
-#define atomic_readandclear_long	atomic_readandclear_64
-
-
-/* Some bit operations */
-
-static inline void
-set_bit(int num, volatile void *addr)
-{
-	uint32_t bit, old, new;
-	volatile uint32_t *p;
-	p = (volatile uint32_t *) addr + (num >> 5);
-	bit = 1 << (num & 31);
-	do
-	{
-		old = *p;
-		new = old | bit;
-	} while(ia64_cmpxchg_acq_32(p, old, new) != old);
-}
-
-static __inline__ void
-clear_bit(int num, volatile void *addr)
-{
-	uint32_t mask, old, new;
-	volatile uint32_t *p;
-	p = (volatile uint32_t *) addr + (num >> 5);
-	mask = ~(1 << (num & 31));
-	do {
-		old = *p;
-		new = old & mask;
-	} while (ia64_cmpxchg_acq_32(p, old, new) != old);
-}
-
-static __inline__ int
-test_bit(int num, const volatile void *addr)
-{
-	uint32_t val = 1;
-        return val & (((const volatile uint32_t *) addr)[num >> 5] >> (num & 31));
-}
-
-/*
- * test_and_set_bit - Set a bit and return its old value
- * num: Bit to set
- * addr: Address to count from
- */
-static inline int
-test_and_set_bit (int num, volatile void *addr)
-{
-        uint32_t bit, old, new;
-        volatile uint32_t *m;
-
-        m = (volatile uint32_t *) addr + (num >> 5);
-        bit = 1 << (num & 31);
-        do {
-                old = *m;
-                new = old | bit;
-        } while (ia64_cmpxchg_acq_32(m, old, new) != old);
-        return (old & bit) != 0;
-}
-
-/*
- * test_and_clear_bit - Clear a bit and return its old value
- * num: Bit to set
- * addr: Address to count from
- */
-static
-inline int test_and_clear_bit(int num, volatile unsigned long * addr)
-{
-        uint32_t bit, old, new;
-        volatile uint32_t* a;
-
-        a = (volatile uint32_t *) addr + (num >> 5);
-        bit = ~(1 << (num & 31));
-        do {
-                old = *a;
-                new = old & bit;
-        } while (ia64_cmpxchg_acq_32(a, old, new) != old);
-        return (old & ~bit) != 0;
-}
-
-
-#endif /* !defined(__ASSEMBLY__) */
-
-#endif /* ! _MACHINE_ATOMIC_H_ */
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/include/ia64/efi.h
--- a/extras/mini-os/include/ia64/efi.h	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,396 +0,0 @@
-/*
- * This is a short summary of declarations and definitions from different
- * efi header files of Intels' EFI_Toolkit_1.10.14.62 
- * used for the minimal implementation in mini-os.
- * Changes: Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
- *
- ****************************************************************************
- * Copyright (C) 2001-2004, Intel Corporation.
- * THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO WARRANTIES WHATSOEVER,
- * INCLUDING ANY WARRANTY OF MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR
- * ANY PARTICULAR PURPOSE, OR ANY WARRANTY OTHERWISE ARISING OUT OF ANY
- * PROPOSAL, SPECIFICATION OR SAMPLE. Except for a limited copyright license
- * to copy this specification for internal use only, no license, express or
- * implied, by estoppel or otherwise, to any intellectual property rights is
- * granted herein.  Intel disclaims all liability, including liability for
- * infringement of any proprietary rights, relating to implementation of
- * information in this specification. Intel does not warrant or represent
- * that such implementation(s) will not infringe such rights.  Designers must
- * not rely on the absence or characteristics of any features or instructions
- * marked "reserved" or "undefined." Intel reserves these for future
- * definition and shall have no responsibility whatsoever for conflicts or
- * incompatibilities arising from future changes to them.
- * This document is an intermediate draft for comment only and is subject to
- * change without notice. Readers should not design products based on this
- * document.
- * Intel, the Intel logo, and Itanium are trademarks or registered trademarks
- * of Intel Corporation or its subsidiaries in the United States and other
- * countries.
- * Other names and brands may be claimed as the property of others.
- */
-
-#ifndef _EFI_H_
-#define _EFI_H_
-
-#include <mini-os/types.h>
-
-
-#define EFIWARN(a)                      (a)
-#define EFI_ERROR(a)                    (((int64_t) a) < 0)
-
-
-#define EFI_SUCCESS                     0
-#define EFI_LOAD_ERROR                  EFIERR(1)
-#define EFI_INVALID_PARAMETER           EFIERR(2)
-#define EFI_UNSUPPORTED                 EFIERR(3)
-#define EFI_BAD_BUFFER_SIZE             EFIERR(4)
-#define EFI_BUFFER_TOO_SMALL            EFIERR(5)
-#define EFI_NOT_READY                   EFIERR(6)
-#define EFI_DEVICE_ERROR                EFIERR(7)
-#define EFI_WRITE_PROTECTED             EFIERR(8)
-#define EFI_OUT_OF_RESOURCES            EFIERR(9)
-#define EFI_VOLUME_CORRUPTED            EFIERR(10)
-#define EFI_VOLUME_FULL                 EFIERR(11)
-#define EFI_NO_MEDIA                    EFIERR(12)
-#define EFI_MEDIA_CHANGED               EFIERR(13)
-#define EFI_NOT_FOUND                   EFIERR(14)
-#define EFI_ACCESS_DENIED               EFIERR(15)
-#define EFI_NO_RESPONSE                 EFIERR(16)
-#define EFI_NO_MAPPING                  EFIERR(17)
-#define EFI_TIMEOUT                     EFIERR(18)
-#define EFI_NOT_STARTED                 EFIERR(19)
-#define EFI_ALREADY_STARTED             EFIERR(20)
-#define EFI_ABORTED                     EFIERR(21)
-#define EFI_ICMP_ERROR                  EFIERR(22)
-#define EFI_TFTP_ERROR                  EFIERR(23)
-#define EFI_PROTOCOL_ERROR              EFIERR(24)
-
-#define EFI_WARN_UNKOWN_GLYPH           EFIWARN(1)
-#define EFI_WARN_DELETE_FAILURE         EFIWARN(2)
-#define EFI_WARN_WRITE_FAILURE          EFIWARN(3)
-#define EFI_WARN_BUFFER_TOO_SMALL       EFIWARN(4)
-
-
-typedef uint64_t	efi_status_t;
-typedef void*		efi_handle_t;
-typedef void*		efi_event_t;
-typedef uint16_t	efi_char16_t;
-
-
-/*
- * Standard EFI table header
- */
-
-struct efi_table_header
-{
-	uint64_t	Signature;
-	// Revision of EFI table specification,
-	// upper 16 bit - major revision number
-	// lower 16 bit - minor revision number
-	uint32_t	Revision;
-	uint32_t	HeaderSize;
-	uint32_t	CRC32;
-	uint32_t	Reserved;
-};
-typedef struct efi_table_header efi_table_header_t;
-
-/*
- * EFI Time
- */
-typedef struct
-{          
-	uint16_t	Year;       /* 1998 - 20XX */
-	uint8_t		Month;      /* 1 - 12 */
-	uint8_t		Day;        /* 1 - 31 */
-	uint8_t		Hour;       /* 0 - 23 */
-	uint8_t		Minute;     /* 0 - 59 */
-	uint8_t		Second;     /* 0 - 59 */
-	uint8_t		Pad1;
-	uint32_t	Nanosecond; /* 0 - 999,999,999 */
-	int16_t		TimeZone;   /* -1440 to 1440 or 2047 */
-	uint8_t		Daylight;
-	uint8_t		Pad2;
-} efi_time_t;
-
-/* Bit definitions for efi_time_t.Daylight */
-#define EFI_TIME_ADJUST_DAYLIGHT    0x01
-#define EFI_TIME_IN_DAYLIGHT        0x02
-
-/* Value definition for efi_time_t.TimeZone */
-#define EFI_UNSPECIFIED_TIMEZONE    0x07FF
-
-
-
-typedef struct
-{
-	uint32_t	Resolution;     /* 1e-6 parts per million */
-	uint32_t	Accuracy;       /* hertz */
-	uint8_t		SetsToZero;     /* Set clears sub-second time */
-} efi_time_capabilities_t;
-
-
-typedef efi_status_t (*efi_get_time_t) (efi_time_t*, efi_time_capabilities_t*);
-typedef efi_status_t (*efi_set_time_t) (efi_time_t*);
-typedef efi_status_t (*efi_get_wakeup_time_t) (uint8_t*, uint8_t*, efi_time_t*);
-typedef efi_status_t (*efi_set_wakeup_time_t) (uint8_t, efi_time_t*);
-
-/*
- * Memory
- * Preseve the attr on any range supplied.
- * ConventialMemory must have WB,SR,SW when supplied.
- * When allocating from ConventialMemory always make it WB,SR,SW
- * When returning to ConventialMemory always make it WB,SR,SW
- * When getting the memory map, or on RT for runtime types
- */
-
-typedef enum {
-	EfiReservedMemoryType,		/* 0 */
-	EfiLoaderCode,
-	EfiLoaderData,
-	EfiBootServicesCode,
-	EfiBootServicesData,
-	EfiRuntimeServicesCode,
-	EfiRuntimeServicesData,		/* 6 */
-	EfiConventionalMemory,		/* 7 */
-	EfiUnusableMemory,
-	EfiACPIReclaimMemory,		/* 9 */
-	EfiACPIMemoryNVS,		/* 10, a */
-	EfiMemoryMappedIO,
-	EfiMemoryMappedIOPortSpace,	/* 12, c */
-	EfiPalCode,			/* 13, d */
-	EfiMaxMemoryType		/* 14, e */
-} efi_memory_type_t;
-
-/* possible caching types for the memory range */
-#define EFI_MEMORY_UC		0x0000000000000001
-#define EFI_MEMORY_WC		0x0000000000000002
-#define EFI_MEMORY_WT		0x0000000000000004
-#define EFI_MEMORY_WB		0x0000000000000008
-#define EFI_MEMORY_UCE		0x0000000000000010  
-/* physical memory protection on range */
-#define EFI_MEMORY_WP		0x0000000000001000
-#define EFI_MEMORY_RP		0x0000000000002000
-#define EFI_MEMORY_XP		0x0000000000004000
-/* range requires a runtime mapping */
-#define EFI_MEMORY_RUNTIME	0x8000000000000000
-
-#define EFI_MEMORY_DESCRIPTOR_VERSION  1
-
-typedef uint64_t efi_phys_addr_t;
-typedef uint64_t efi_virt_addr_t;
-
-typedef struct
-{
-	uint32_t	Type;           /* 32 bit padding */
-	efi_phys_addr_t	PhysicalStart;
-	efi_virt_addr_t	VirtualStart;
-	uint64_t	NumberOfPages;
-	uint64_t	Attribute;
-} efi_memory_descriptor_t;
-
-#define NextMemoryDescriptor(Ptr,Size)  ((efi_memory_descriptor_t*) (((uint8_t*) Ptr) + Size))
-
-
-typedef efi_status_t (*efi_set_virtual_address_map_t)
-	(
-		uint64_t MemoryMapSize,
-		uint64_t DescriptorSize,
-		uint32_t DescriptorVersion,
-		efi_memory_descriptor_t* VirtualMap
-	);
-
-typedef efi_status_t (*efi_convert_pointer_t)
-	(
-		uint64_t DebugDisposition,
-		void** Address
-	);
-
-/*
- * A GUID
- */
-
-typedef struct
-{          
-	uint32_t	Data1;
-	uint16_t	Data2;
-	uint16_t	Data3;
-	uint8_t		Data4[8]; 
-} efi_guid_t;
-
-/*
- * EFI Configuration Table and GUID definitions
- */
-
-#define MPS_TABLE_GUID			\
-	{ 0xeb9d2d2f, 0x2d88, 0x11d3,	\
-		{ 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } }
-
-#define ACPI_TABLE_GUID			\
-	{ 0xeb9d2d30, 0x2d88, 0x11d3,	\
-		{ 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } }
-
-#define ACPI_20_TABLE_GUID  \
-	{ 0x8868e871, 0xe4f1, 0x11d3,	\
-		{ 0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } }
-
-#define SMBIOS_TABLE_GUID    \
-	{ 0xeb9d2d31, 0x2d88, 0x11d3,	\
-		{ 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } }
-
-#define SAL_SYSTEM_TABLE_GUID    \
-	{ 0xeb9d2d32, 0x2d88, 0x11d3,	\
-		{ 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } }
-
-/* DIG64 Headless Console & Debug Port Table. */
-#define	HCDP_TABLE_GUID		\
-	{0xf951938d, 0x620b, 0x42ef,	\
-		{0x82, 0x79, 0xa8, 0x4b, 0x79, 0x61, 0x78, 0x98 } }
-
-
-typedef struct efi_configuration_table
-{
-	efi_guid_t	VendorGuid;
-	void*		VendorTable;
-} efi_configuration_table_t;
-
-
-/*
- * EFI platform variables
- */
-
-#define EFI_GLOBAL_VARIABLE     \
-    {	0x8BE4DF61, 0x93CA, 0x11d2, 0xAA, 0x0D, 0x00,	\
-	0xE0, 0x98, 0x03, 0x2B, 0x8C }
-
-/* Variable attributes */
-#define EFI_VARIABLE_NON_VOLATILE           0x00000001
-#define EFI_VARIABLE_BOOTSERVICE_ACCESS     0x00000002
-#define EFI_VARIABLE_RUNTIME_ACCESS         0x00000004
-
-/* Variable size limitation */
-#define EFI_MAXIMUM_VARIABLE_SIZE           1024
-
-typedef efi_status_t (*efi_get_variable_t)
-	(
-		efi_char16_t*	VariableName,
-		efi_guid_t	*VendorGuid,
-		uint32_t*	Attributes,
-		uint64_t*	DataSize,
-		void*		Data
-	);
-
-typedef
-efi_status_t (*efi_get_next_variable_name_t)
-	(
-		uint64_t*	VariableNameSize,
-		efi_char16_t*	VariableName,
-		efi_guid_t*	VendorGuid
-	);
-
-typedef efi_status_t (*efi_set_variable_t)
-	(
-		efi_char16_t*	VariableName,
-		efi_guid_t*	VendorGuid,
-		uint32_t	Attributes,
-		uint64_t	DataSize,
-		void*		Data
-	);
-
-/*
- * Misc
- */
-
-typedef enum
-{
-	EfiResetCold,
-	EfiResetWarm,
-	EfiResetShutdown
-} efi_reset_type_t;
-
-
-typedef efi_status_t (*efi_reset_system_t)
-	(
-		efi_reset_type_t	ResetType,
-		efi_status_t		ResetStatus,
-		uint64_t		DataSize,
-		efi_char16_t*		ResetData
-	);
-
-typedef efi_status_t (*efi_get_next_high_mono_count_t) (uint32_t* HighCount);
-
-
-/*
- * EFI Runtime Serivces Table
- */
-
-#define EFI_RUNTIME_SERVICES_SIGNATURE  0x5652453544e5552ULL
-#define EFI_RUNTIME_SERVICES_REVISION ((EFI_SPECIFICATION_MAJOR_REVISION<<16) \
-					| (EFI_SPECIFICATION_MINOR_REVISION))
-
-typedef struct
-{
-	efi_table_header_t		Hdr;
-	/* Time services */
-	efi_get_time_t			GetTime;
-	efi_set_time_t			SetTime;
-	efi_get_wakeup_time_t		GetWakeupTime;
-	efi_set_wakeup_time_t		SetWakeupTime;
-	/* Virtual memory services */
-	efi_set_virtual_address_map_t	SetVirtualAddressMap;
-	efi_convert_pointer_t		ConvertPointer;
-	/* Variable serviers */
-	efi_get_variable_t		GetVariable;
-	efi_get_next_variable_name_t	GetNextVariableName;
-	efi_set_variable_t		SetVariable;
-	/* Misc */
-	efi_get_next_high_mono_count_t	GetNextHighMonotonicCount;
-	efi_reset_system_t		ResetSystem;
-
-} efi_runtime_services_t;
-
-
-#define EFI_SPECIFICATION_MAJOR_REVISION 1
-#define EFI_SYSTEM_TABLE_SIGNATURE      0x5453595320494249
-#define EFI_SYSTEM_TABLE_REVISION  ((EFI_SPECIFICATION_MAJOR_REVISION<<16) \
-					| (EFI_SPECIFICATION_MINOR_REVISION))
-
-struct efi_system_table
-{
-	efi_table_header_t	Hdr;
-
-	uint64_t	FirmwareVendor;		// phys addr of CHAR16
-	uint32_t	FirmwareRevision;	// Firmware vendor specific
-
-	efi_handle_t	ConsoleInHandle;
-	uint64_t	ConIn;
-
-	efi_handle_t	ConsoleOutHandle;
-	uint64_t	ConOut;
-
-	efi_handle_t	StandardErrorHandle;
-	uint64_t	StdErr;
-
-	uint64_t	RuntimeServices;	// phys addr
-	uint64_t	BootServices;		// phys addr
-
-	uint64_t	NumberOfTableEntries;	// Number of entries in Config
-	uint64_t	ConfigurationTable;	// phys addr of ConfigTable
-};
-
-typedef struct efi_system_table efi_system_table_t;
-
-
-#define EFI_PAGE_SIZE   4096
-#define EFI_PAGE_MASK   0xFFF
-#define EFI_PAGE_SHIFT  12
-
-#define EFI_SIZE_TO_PAGES(a)  \
-    ( ((a) >> EFI_PAGE_SHIFT) + ((a) & EFI_PAGE_MASK ? 1 : 0) )
-
-
-void init_efi(void);
-int efi_get_time(efi_time_t* tmP);
-efi_status_t ia64_call_efi_physical(void *, ...);
-
-
-#endif /* _EFI_H_ */
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/include/ia64/hypercall-ia64.h
--- a/extras/mini-os/include/ia64/hypercall-ia64.h	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,135 +0,0 @@
-/******************************************************************************
- * hypercall.h
- * 
- * Mini-OS-specific hypervisor handling for ia64.
- * 
- * Copyright (c) 2002-2004, K A Fraser
- * Changes: Dietmar Hahn <dietmar.hahn@fujiti-siemens.com>
- * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License version 2
- * as published by the Free Software Foundation; or, when distributed
- * separately from the Linux kernel or incorporated into other
- * software packages, subject to the following license:
- * 
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this source file (the "Software"), to deal in the Software without
- * restriction, including without limitation the rights to use, copy, modify,
- * merge, publish, distribute, sublicense, and/or sell copies of the Software,
- * and to permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- * 
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-#ifndef __HYPERCALL_H__
-#define __HYPERCALL_H__
-
-#include <xen/event_channel.h>
-#include <xen/sched.h>
-#include <xen/version.h>
-
-#ifndef _HYPERVISOR_H_
-# error "please don't include this file directly"
-#endif
-
-// See linux/compiler.h
-#define likely(x)       __builtin_expect(!!(x), 1)
-#define unlikely(x)     __builtin_expect(!!(x), 0)
-
-extern unsigned long __hypercall(unsigned long a1, unsigned long a2,
-                                 unsigned long a3, unsigned long a4,
-                                 unsigned long a5, unsigned long cmd);
-/*
- * Assembler stubs for hyper-calls.
- */
-
-#define _hypercall0(type, name)					\
-({								\
-	long __res;						\
-	__res = __hypercall(0, 0, 0, 0, 0,			\
-			    __HYPERVISOR_##name);		\
-	(type)__res;						\
-})
-
-#define _hypercall1(type, name, a1)				\
-({								\
-	long __res;						\
-	__res = __hypercall((unsigned long)a1,			\
-			    0, 0, 0, 0, __HYPERVISOR_##name);	\
-	(type)__res;						\
-})
-
-#define _hypercall2(type, name, a1, a2)				\
-({								\
-	long __res;						\
-	__res = __hypercall((unsigned long)a1,			\
-			    (unsigned long)a2,			\
-			    0, 0, 0, __HYPERVISOR_##name);	\
-	(type)__res;						\
-})
-
-#define _hypercall3(type, name, a1, a2, a3)			\
-({								\
-	long __res;						\
-	__res = __hypercall((unsigned long)a1,			\
-			    (unsigned long)a2,			\
-			    (unsigned long)a3,			\
-			    0, 0, __HYPERVISOR_##name);		\
-	(type)__res;						\
-})
-
-#define _hypercall4(type, name, a1, a2, a3, a4)			\
-({								\
-	long __res;						\
-	__res = __hypercall((unsigned long)a1,			\
-			    (unsigned long)a2,			\
-			    (unsigned long)a3,			\
-			    (unsigned long)a4,			\
-			    0, __HYPERVISOR_##name);		\
-	(type)__res;						\
-})
-
-#define _hypercall5(type, name, a1, a2, a3, a4, a5)		\
-({								\
-	long __res;						\
-	__res = __hypercall((unsigned long)a1,			\
-			    (unsigned long)a2,			\
-			    (unsigned long)a3,			\
-			    (unsigned long)a4,			\
-			    (unsigned long)a5,			\
-			    __HYPERVISOR_##name);		\
-	(type)__res;						\
-})
-
-
-int HYPERVISOR_event_channel_op(int cmd, void *arg);
-
-int HYPERVISOR_xen_version(int cmd, void *arg);
-
-int HYPERVISOR_console_io(int cmd, int count, char *str);
-
-int HYPERVISOR_sched_op_compat(int cmd, unsigned long arg);
-
-int HYPERVISOR_sched_op(int cmd, void *arg);
-
-int HYPERVISOR_callback_op(int cmd, void *arg);
-
-int HYPERVISOR_grant_table_op(unsigned int cmd, void *uop, unsigned int count);
-
-int HYPERVISOR_opt_feature(void *arg);
-
-int HYPERVISOR_suspend(unsigned long srec);
-
-int HYPERVISOR_shutdown(unsigned int reason);
-
-#endif /* __HYPERCALL_H__ */
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/include/ia64/ia64_cpu.h
--- a/extras/mini-os/include/ia64/ia64_cpu.h	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,738 +0,0 @@
-/*
- * Done by Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
- * This code is mostly taken from FreeBSD.
- *
- *
- ****************************************************************************
- * Copyright (c) 2000 Doug Rabson
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- */
-
-#ifndef _IA64_CPU_H_
-#define _IA64_CPU_H_
-
-#include "ia64_fpu.h"
-
-/*
- * Definition of Region Register bits (RR)
- *
- * RR bit field positions
- */
-#define IA64_RR_VE		0
-#define IA64_RR_MBZ0		1
-#define IA64_RR_PS		2
-#define IA64_RR_PS_LEN		6
-#define IA64_RR_RID		8
-#define IA64_RR_RID_LEN		24
-#define IA64_RR_MBZ1		32
-
-#define IA64_RR_IDX_POS		61
-
-#define IA64_RR_VAL(size,rid) (((size) << IA64_RR_PS) | ((rid) << IA64_RR_RID))
-
-/*
- * Define Protection Key Register (PKR)
- *
- * PKR bit field positions
- */
-#define IA64_PKR_V		0
-#define IA64_PKR_WD		1
-#define IA64_PKR_RD		2
-#define IA64_PKR_XD		3
-#define IA64_PKR_MBZ0		4
-#define IA64_PKR_KEY		8
-#define IA64_PKR_KEY_LEN	24
-#define IA64_PKR_MBZ1		32
-
-#define IA64_PKR_VALID		(1 << IA64_PKR_V)
-
-
-/*
- * ITIR bit field positions
- */
-
-#define	IA64_ITIR_MBZ0		0
-#define	IA64_ITIR_PS		2
-#define	IA64_ITIR_PS_LEN	6
-#define	IA64_ITIR_KEY		8
-#define	IA64_ITIR_KEY_LEN	24
-#define	IA64_ITIR_MBZ1		32
-#define	IA64_ITIR_MBZ1_LEN	16
-#define	IA64_ITIR_PPN		48
-#define	IA64_ITIR_PPN_LEN	15
-#define	IA64_ITIR_MBZ2		63
-
-/*
- * Definition of PSR and IPSR bits.
- */
-#define IA64_PSR_BE		0x0000000000000002
-#define IA64_PSR_UP		0x0000000000000004
-#define IA64_PSR_AC		0x0000000000000008
-#define IA64_PSR_MFL		0x0000000000000010
-#define IA64_PSR_MFH_BIT	5
-#define IA64_PSR_MFH		(1 << IA64_PSR_MFH_BIT)
-#define IA64_PSR_UMASK		(IA64_PSR_BE | IA64_PSR_UP |	\
-				IA64_PSR_AC | IA64_PSR_MFL |	\
-				IA64_PSR_MFH)
-#define IA64_PSR_IC_BIT		13
-#define IA64_PSR_IC		(1<<IA64_PSR_IC_BIT) /*0x0000000000002000*/
-#define IA64_PSR_I_BIT		14
-#define IA64_PSR_I		(1<<IA64_PSR_I_BIT) /*0x0000000000004000*/
-#define IA64_PSR_PK		0x0000000000008000
-#define IA64_PSR_DT		0x0000000000020000
-#define IA64_PSR_DFL		0x0000000000040000
-#define IA64_PSR_DFH		0x0000000000080000
-#define IA64_PSR_SP		0x0000000000100000
-#define IA64_PSR_PP		0x0000000000200000
-#define IA64_PSR_DI		0x0000000000400000
-#define IA64_PSR_SI		0x0000000000800000
-#define IA64_PSR_DB		0x0000000001000000
-#define IA64_PSR_LP		0x0000000002000000
-#define IA64_PSR_TB		0x0000000004000000
-#define IA64_PSR_RT		0x0000000008000000
-#define IA64_PSR_CPL		0x0000000300000000
-#define IA64_PSR_CPL_KERN	0x0000000000000000
-#define IA64_PSR_CPL_1		0x0000000100000000
-#define IA64_PSR_CPL_2		0x0000000200000000
-#define IA64_PSR_CPL_USER	0x0000000300000000
-#define IA64_PSR_IS		0x0000000400000000
-#define IA64_PSR_MC		0x0000000800000000
-#define IA64_PSR_IT		0x0000001000000000
-#define IA64_PSR_ID		0x0000002000000000
-#define IA64_PSR_DA		0x0000004000000000
-#define IA64_PSR_DD		0x0000008000000000
-#define IA64_PSR_SS		0x0000010000000000
-#define IA64_PSR_RI		0x0000060000000000
-#define IA64_PSR_RI_0		0x0000000000000000
-#define IA64_PSR_RI_1		0x0000020000000000
-#define IA64_PSR_RI_2		0x0000040000000000
-#define IA64_PSR_RI_SHIFT	41
-#define IA64_PSR_ED		0x0000080000000000
-#define IA64_PSR_BN		0x0000100000000000
-#define IA64_PSR_IA		0x0000200000000000
-
-
-#define STARTUP_PSR (IA64_PSR_IT | IA64_PSR_PK | \
-            	     IA64_PSR_DT | IA64_PSR_RT | \
-		     IA64_PSR_BN | IA64_PSR_CPL_KERN | IA64_PSR_AC)
-
-#define MOS_SYS_PSR (IA64_PSR_IC | IA64_PSR_I | IA64_PSR_IT | \
-            	     IA64_PSR_DT | IA64_PSR_RT | \
-		     IA64_PSR_BN | IA64_PSR_CPL_KERN | IA64_PSR_AC)
-
-#define MOS_USR_PSR (IA64_PSR_IC | IA64_PSR_I | IA64_PSR_IT | \
-            	     IA64_PSR_DT | IA64_PSR_RT | \
-		     IA64_PSR_BN | IA64_PSR_CPL_USER | IA64_PSR_AC)
-
-/*
- * Definition of ISR bits.
- */
-#define IA64_ISR_CODE	0x000000000000ffff
-#define IA64_ISR_VECTOR	0x0000000000ff0000
-#define IA64_ISR_X	0x0000000100000000
-#define IA64_ISR_W	0x0000000200000000
-#define IA64_ISR_R	0x0000000400000000
-#define IA64_ISR_NA	0x0000000800000000
-#define IA64_ISR_SP	0x0000001000000000
-#define IA64_ISR_RS	0x0000002000000000
-#define IA64_ISR_IR	0x0000004000000000
-#define IA64_ISR_NI	0x0000008000000000
-#define IA64_ISR_SO	0x0000010000000000
-#define IA64_ISR_EI	0x0000060000000000
-#define IA64_ISR_EI_0	0x0000000000000000
-#define IA64_ISR_EI_1	0x0000020000000000
-#define IA64_ISR_EI_2	0x0000040000000000
-#define IA64_ISR_ED	0x0000080000000000
-
-/*
- * DCR bit positions
- */
-#define IA64_DCR_PP		0
-#define IA64_DCR_BE		1
-#define IA64_DCR_LC		2
-#define IA64_DCR_MBZ0		4
-#define IA64_DCR_MBZ0_V		0xf
-#define IA64_DCR_DM		8
-#define IA64_DCR_DP		9
-#define IA64_DCR_DK		10
-#define IA64_DCR_DX		11
-#define IA64_DCR_DR		12
-#define IA64_DCR_DA		13
-#define IA64_DCR_DD		14
-#define IA64_DCR_DEFER_ALL	0x7f00
-#define IA64_DCR_MBZ1		2
-#define IA64_DCR_MBZ1_V		0xffffffffffffULL
-
-
-#define IA64_DCR_DEFAULT (IA64_DCR_BE)
-
-/*
- * Vector numbers for various ia64 interrupts.
- */
-#define IA64_VEC_VHPT				0
-#define IA64_VEC_ITLB				1
-#define IA64_VEC_DTLB				2
-#define IA64_VEC_ALT_ITLB			3
-#define IA64_VEC_ALT_DTLB			4
-#define IA64_VEC_NESTED_DTLB			5
-#define IA64_VEC_IKEY_MISS			6
-#define IA64_VEC_DKEY_MISS			7
-#define IA64_VEC_DIRTY_BIT			8
-#define IA64_VEC_INST_ACCESS			9
-#define IA64_VEC_DATA_ACCESS			10
-#define IA64_VEC_BREAK				11
-#define IA64_VEC_EXT_INTR			12
-#define IA64_VEC_PAGE_NOT_PRESENT		20
-#define IA64_VEC_KEY_PERMISSION			21
-#define IA64_VEC_INST_ACCESS_RIGHTS		22
-#define IA64_VEC_DATA_ACCESS_RIGHTS		23
-#define IA64_VEC_GENERAL_EXCEPTION		24
-#define IA64_VEC_DISABLED_FP			25
-#define IA64_VEC_NAT_CONSUMPTION		26
-#define IA64_VEC_SPECULATION			27
-#define IA64_VEC_DEBUG				29
-#define IA64_VEC_UNALIGNED_REFERENCE		30
-#define IA64_VEC_UNSUPP_DATA_REFERENCE		31
-#define IA64_VEC_FLOATING_POINT_FAULT		32
-#define IA64_VEC_FLOATING_POINT_TRAP		33
-#define IA64_VEC_LOWER_PRIVILEGE_TRANSFER 	34
-#define IA64_VEC_TAKEN_BRANCH_TRAP		35
-#define IA64_VEC_SINGLE_STEP_TRAP		36
-#define IA64_VEC_IA32_EXCEPTION			45
-#define IA64_VEC_IA32_INTERCEPT			46
-#define IA64_VEC_IA32_INTERRUPT			47
-
-/*
- * Define hardware RSE Configuration Register
- *
- * RS Configuration (RSC) bit field positions
- */
-
-#define IA64_RSC_MODE       0
-#define IA64_RSC_PL         2
-#define IA64_RSC_BE         4
-#define IA64_RSC_MBZ0       5
-#define IA64_RSC_MBZ0_V     0x3ff
-#define IA64_RSC_LOADRS     16
-#define IA64_RSC_LOADRS_LEN 14
-#define IA64_RSC_MBZ1       30
-#define IA64_RSC_MBZ1_V     0x3ffffffffULL
-
-/*
- * RSC modes
- */
-#define IA64_RSC_MODE_LY (0x0) 		/* Lazy */
-#define IA64_RSC_MODE_SI (0x1) 		/* Store intensive */
-#define IA64_RSC_MODE_LI (0x2) 		/* Load intensive */
-#define IA64_RSC_MODE_EA (0x3) 		/* Eager */
-
-#define IA64_RSE_EAGER (IA64_RSC_MODE_EA<<IA64_RSC_MODE)
-#define IA64_RSE_LAZY (IA64_RSC_MODE_LY<<IA64_RSC_MODE)
-
-
-
-#ifndef __ASSEMBLY__
-
-/* ia64 function descriptor and global pointer */
-struct ia64_fdesc
-{
-	uint64_t	func;
-	uint64_t	gp;
-};
-typedef struct ia64_fdesc ia64_fdesc_t;
-
-#define FDESC_FUNC(fn)  (((struct ia64_fdesc *) fn)->func)
-#define FDESC_GP(fn)    (((struct ia64_fdesc *) fn)->gp)
-
-
-/*
- * Various special ia64 instructions.
- */
-
-/*
- * Memory Fence.
- */
-static __inline void
-ia64_mf(void)
-{
-	__asm __volatile("mf" ::: "memory");
-}
-
-static __inline void
-ia64_mf_a(void)
-{
-	__asm __volatile("mf.a");
-}
-
-/*
- * Flush Cache.
- */
-static __inline void
-ia64_fc(uint64_t va)
-{
-	__asm __volatile("fc %0" :: "r"(va));
-}
-
-/*
- * Sync instruction stream.
- */
-static __inline void
-ia64_sync_i(void)
-{
-	__asm __volatile("sync.i");
-}
-
-/*
- * Calculate address in VHPT for va.
- */
-static __inline uint64_t
-ia64_thash(uint64_t va)
-{
-	uint64_t result;
-	__asm __volatile("thash %0=%1" : "=r" (result) : "r" (va));
-	return result;
-}
-
-/*
- * Calculate VHPT tag for va.
- */
-static __inline uint64_t
-ia64_ttag(uint64_t va)
-{
-	uint64_t result;
-	__asm __volatile("ttag %0=%1" : "=r" (result) : "r" (va));
-	return result;
-}
-
-/*
- * Convert virtual address to physical.
- */
-static __inline uint64_t
-ia64_tpa(uint64_t va)
-{
-	uint64_t result;
-	__asm __volatile("tpa %0=%1" : "=r" (result) : "r" (va));
-	return result;
-}
-
-/*
- * Generate a ptc.e instruction.
- */
-static __inline void
-ia64_ptc_e(uint64_t v)
-{
-	__asm __volatile("ptc.e %0;; srlz.d;;" :: "r"(v));
-}
-
-/*
- * Generate a ptc.g instruction.
- */
-static __inline void
-ia64_ptc_g(uint64_t va, uint64_t size)
-{
-	__asm __volatile("ptc.g %0,%1;; srlz.d;;" :: "r"(va), "r"(size<<2));
-}
-
-/*
- * Generate a ptc.ga instruction.
- */
-static __inline void
-ia64_ptc_ga(uint64_t va, uint64_t size)
-{
-	__asm __volatile("ptc.ga %0,%1;; srlz.d;;" :: "r"(va), "r"(size<<2));
-}
-
-/*
- * Generate a ptc.l instruction.
- */
-static __inline void
-ia64_ptc_l(uint64_t va, uint64_t size)
-{
-	__asm __volatile("ptc.l %0,%1;; srlz.d;;" :: "r"(va), "r"(size<<2));
-}
-
-/*
- * Read the value of psr.
- */
-static __inline uint64_t
-ia64_get_psr(void)
-{
-	uint64_t result;
-	__asm __volatile("mov %0=psr;;" : "=r" (result));
-	return result;
-}
-
-static __inline void
-ia64_set_psr(uint64_t v)
-{
-	__asm __volatile("mov psr.l=%0" :: "r" (v));
-}
-
-static __inline void
-ia64_srlz_d(void)
-{
-	__asm __volatile("srlz.d;;");
-}
-
-static __inline void
-disable_intr(void)
-{
-	__asm __volatile ("rsm psr.ic|psr.i");
-}
-
-static __inline void
-enable_intr(void)
-{
-	__asm __volatile ("ssm psr.ic|psr.i");
-}
-
-/*
- * Define accessors for application registers.
- */
-
-#define IA64_AR(name)							\
-									\
-static __inline uint64_t						\
-ia64_get_##name(void)							\
-{									\
-	uint64_t result;						\
-	__asm __volatile(";;mov %0=ar." #name ";;" : "=r" (result));	\
-	return result;							\
-}									\
-									\
-static __inline void							\
-ia64_set_##name(uint64_t v)						\
-{									\
-	__asm __volatile("mov ar." #name "=%0" :: "r" (v));		\
-}
-
-IA64_AR(k0)
-IA64_AR(k1)
-IA64_AR(k2)
-IA64_AR(k3)
-IA64_AR(k4)
-IA64_AR(k5)
-IA64_AR(k6)
-IA64_AR(k7)
-
-IA64_AR(rsc)
-IA64_AR(bsp)
-IA64_AR(bspstore)
-IA64_AR(rnat)
-
-IA64_AR(fcr)
-
-IA64_AR(eflag)
-IA64_AR(csd)
-IA64_AR(ssd)
-IA64_AR(cflg)
-IA64_AR(fsr)
-IA64_AR(fir)
-IA64_AR(fdr)
-
-IA64_AR(ccv)
-
-IA64_AR(unat)
-
-IA64_AR(fpsr)
-
-IA64_AR(itc)
-
-IA64_AR(pfs)
-IA64_AR(lc)
-IA64_AR(ec)
-
-/*
- * Define accessors for control registers.
- */
-
-#define IA64_CR(name)						\
-								\
-static __inline uint64_t					\
-ia64_get_##name(void)						\
-{								\
-	uint64_t result;					\
-	__asm __volatile("mov %0=cr." #name : "=r" (result));	\
-	return result;						\
-}								\
-								\
-static __inline void						\
-ia64_set_##name(uint64_t v)					\
-{								\
-	__asm __volatile("mov cr." #name "=%0" :: "r" (v));	\
-}
-
-IA64_CR(dcr)
-IA64_CR(itm)
-IA64_CR(iva)
-
-IA64_CR(pta)
-
-IA64_CR(ipsr)
-IA64_CR(isr)
-
-IA64_CR(iip)
-IA64_CR(ifa)
-IA64_CR(itir)
-IA64_CR(iipa)
-IA64_CR(ifs)
-IA64_CR(iim)
-IA64_CR(iha)
-
-IA64_CR(lid)
-IA64_CR(ivr)
-IA64_CR(tpr)
-IA64_CR(eoi)
-IA64_CR(irr0)
-IA64_CR(irr1)
-IA64_CR(irr2)
-IA64_CR(irr3)
-IA64_CR(itv)
-IA64_CR(pmv)
-IA64_CR(cmcv)
-
-IA64_CR(lrr0)
-IA64_CR(lrr1)
-
-#define IA64_GR(name)						\
-								\
-static __inline uint64_t					\
-ia64_get_##name(void)						\
-{								\
-	uint64_t result;					\
-	__asm __volatile("mov %0=" #name : "=r" (result));	\
-	return result;						\
-}								\
-								\
-static __inline void						\
-ia64_set_##name(uint64_t v)					\
-{								\
-	__asm __volatile("mov " #name "=%0" :: "r" (v));	\
-}
-
-IA64_GR(sp)
-IA64_GR(b0)
-IA64_GR(r13)	// tp
-
-
-/*
- * Write a region register.
- */
-static __inline void
-ia64_set_rr(uint64_t rrbase, uint64_t v)
-{
-	__asm __volatile("mov rr[%0]=%1;; srlz.d;;"
-			 :: "r"(rrbase), "r"(v) : "memory");
-}
-
-/*
- * Read a region register.
- */
-static __inline uint64_t
-ia64_get_rr(uint64_t rrbase)
-{
-	uint64_t v;
-	__asm __volatile("mov %1=rr[%0];;"
-			 : "=r" (v) : "r"(rrbase) : "memory");
-	return v;
-}
-
-
-/*
- * Read a CPUID register.
- */
-static __inline uint64_t
-ia64_get_cpuid(int i)
-{
-	uint64_t result;
-	__asm __volatile("mov %0=cpuid[%1]"
-			 : "=r" (result) : "r"(i));
-	return result;
-}
-
-
-struct trap_frame
-{
-	uint64_t	rsc;
-	uint64_t	ndirty;		/* number of dirty regs */
-	uint64_t	ssd;
-	uint64_t	iip;		/* interrupted ip */
-	uint64_t	ipsr;		/* interrupted psr */
-	uint64_t	ifs;		/* interruption func status register */
-
-	uint16_t	trap_num;	/* Trap num, index in trap_vec */
-	uint64_t	cfm;		/* current frame marker */
-	uint64_t	pfs;		/* previous function state ar64 */
-	uint64_t	bsp;		/* backing store pointer ar17 */
-	uint64_t	rnat;		/* rse nat collection ar19 */
-	uint64_t	csd;		/* comp and store data reg ar25 */
-	uint64_t	ccv;		/* comp and xchange val reg ar32 */
-	uint64_t	unat;		/* */
-	uint64_t	fpsr;		/* floating point state reg ar40 */
-	uint64_t	pr;		/* predicate regs 0-63 */
-
-	uint64_t	gp;		/* the gp pointer */
-	uint64_t	sp;		/* stack pointer */
-	uint64_t	tp;		/* thread pointer */
-
-	uint64_t	r2;		/* global reg 2 */
-	uint64_t	r3;
-	uint64_t	r8;
-	uint64_t	r9;
-	uint64_t	r10;
-	uint64_t	r11;
-	uint64_t	r14;
-	uint64_t	r15;
-	uint64_t	r16;
-	uint64_t	r17;
-	uint64_t	r18;
-	uint64_t	r19;
-	uint64_t	r20;
-	uint64_t	r21;
-	uint64_t	r22;
-	uint64_t	r23;
-	uint64_t	r24;
-	uint64_t	r25;
-	uint64_t	r26;
-	uint64_t	r27;
-	uint64_t	r28;
-	uint64_t	r29;
-	uint64_t	r30;
-	uint64_t	r31;
-
-	uint64_t	b0;
-	uint64_t	b6;
-	uint64_t	b7;
-
-	ia64_fpreg_t	f6;           /* floating point register 6 */
-	ia64_fpreg_t	f7;
-	ia64_fpreg_t	f8;
-	ia64_fpreg_t	f9;
-	ia64_fpreg_t	f10;
-	ia64_fpreg_t	f11;
-
-	uint64_t	ifa;		/* interruption faulting address */
-	uint64_t	isr;		/* interruption status register */
-	uint64_t	iim;		/* interruption immediate register */
-};
-
-typedef struct trap_frame trap_frame_t;
-
-
-#endif  /* __ASSEMBLY__ */
-
-/* Page access parameters. */
-#define PTE_P_SHIFT	0
-#define PTE_P		1
-
-#define PTE_MA_SHIFT	2
-#define PTE_MA_WB	0
-
-#define PTE_A_SHIFT	5
-#define PTE_A		1
-#define PTE_D_SHIFT	6
-#define PTE_D		1
-
-#define PTE_AR_SHIFT	9
-#define PTE_AR_R	0
-#define PTE_AR_RX	1
-#define PTE_AR_RW	2
-#define PTE_AR_RWX	3
-#define PTE_AR_R_RW	4
-#define PTE_AR_RX_RWX	5
-#define PTE_AR_RWX_RW	6
-/* privilege level */
-#define PTE_PL_SHIFT	7
-#define PTE_PL_KERN	0	/* used for kernel */
-/* page size */
-#define PTE_PS_4K	12
-#define PTE_PS_8K	13
-#define PTE_PS_16K	14
-#define PTE_PS_64K	16
-#define PTE_PS_256K	18
-#define PTE_PS_1M	20
-#define PTE_PS_4M	22
-#define PTE_PS_16M	24
-#define PTE_PS_64M	26
-#define PTE_PS_256M	28
-
-
-	/* Some offsets for ia64_pte_t. */
-#define PTE_OFF_P	0
-#define PTE_OFF_MA	3
-#define PTE_OFF_A	5
-#define PTE_OFF_D	6
-#define PTE_OFF_PL	7
-#define PTE_OFF_AR	9
-#define PTE_OFF_PPN	12
-#define PTE_OFF_ED	52
-
-#if !defined(_ASM) && !defined(__ASSEMBLY__)
-/*
- * A short-format VHPT entry. Also matches the TLB insertion format.
- */
-typedef struct
-{
-	uint64_t pte_p	:1;	/* bits 0..0 */
-	uint64_t pte_rv1:1;	/* bits 1..1 */
-	uint64_t pte_ma	:3;	/* bits 2..4 */
-	uint64_t pte_a	:1;	/* bits 5..5 */
-	uint64_t pte_d	:1;	/* bits 6..6 */
-	uint64_t pte_pl	:2;	/* bits 7..8 */
-	uint64_t pte_ar	:3;	/* bits 9..11 */
-	uint64_t pte_ppn:38;	/* bits 12..49 */
-	uint64_t pte_rv2:2;	/* bits 50..51 */
-	uint64_t pte_ed	:1;	/* bits 52..52 */
-	uint64_t pte_ig	:11;	/* bits 53..63 */
-} ia64_pte_t;
-
-
-/*
- * A long-format VHPT entry.
- */
-typedef struct
-{
-	uint64_t pte_p		:1;	/* bits 0..0 */
-	uint64_t pte_rv1	:1;	/* bits 1..1 */
-	uint64_t pte_ma		:3;	/* bits 2..4 */
-	uint64_t pte_a		:1;	/* bits 5..5 */
-	uint64_t pte_d		:1;	/* bits 6..6 */
-	uint64_t pte_pl		:2;	/* bits 7..8 */
-	uint64_t pte_ar		:3;	/* bits 9..11 */
-	uint64_t pte_ppn	:38;	/* bits 12..49 */
-	uint64_t pte_rv2	:2;	/* bits 50..51 */
-	uint64_t pte_ed		:1;	/* bits 52..52 */
-	uint64_t pte_ig		:11;	/* bits 53..63 */
-	uint64_t pte_rv3	:2;	/* bits 0..1 */
-	uint64_t pte_ps		:6;	/* bits 2..7 */
-	uint64_t pte_key	:24;	/* bits 8..31 */
-	uint64_t pte_rv4	:32;	/* bits 32..63 */
-	uint64_t pte_tag;		/* includes ti */
-	uint64_t pte_chain;		/* pa of collision chain */
-} ia64_lpte_t;
-
-#endif /* __ASSEMBLY__ */
-
-#endif /* _IA64_CPU_H_ */
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/include/ia64/ia64_fpu.h
--- a/extras/mini-os/include/ia64/ia64_fpu.h	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +0,0 @@
-/*
- * Done by Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
- * This code is mostly taken from FreeBSD.
- *
- ****************************************************************************
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- */
-
-#ifndef _IA64_FPU_H_
-#define _IA64_FPU_H_
-
-#include "os.h"
-
-/*
- * Floating point status register bits.
- */
-#define IA64_FPSR_TRAP_VD	UL_CONST(0x0000000000000001)
-#define IA64_FPSR_TRAP_DD	UL_CONST(0x0000000000000002)
-#define IA64_FPSR_TRAP_ZD	UL_CONST(0x0000000000000004)
-#define IA64_FPSR_TRAP_OD	UL_CONST(0x0000000000000008)
-#define IA64_FPSR_TRAP_UD	UL_CONST(0x0000000000000010)
-#define IA64_FPSR_TRAP_ID	UL_CONST(0x0000000000000020)
-#define IA64_FPSR_SF(i,v)	((v) << ((i)*13+6))
-
-#define IA64_SF_FTZ		UL_CONST(0x0001)
-#define IA64_SF_WRE		UL_CONST(0x0002)
-#define IA64_SF_PC		UL_CONST(0x000c)
-#define IA64_SF_PC_0		UL_CONST(0x0000)
-#define IA64_SF_PC_1		UL_CONST(0x0004)
-#define IA64_SF_PC_2		UL_CONST(0x0008)
-#define IA64_SF_PC_3		UL_CONST(0x000c)
-#define IA64_SF_RC		UL_CONST(0x0030)
-#define IA64_SF_RC_NEAREST	UL_CONST(0x0000)
-#define IA64_SF_RC_NEGINF	UL_CONST(0x0010)
-#define IA64_SF_RC_POSINF	UL_CONST(0x0020)
-#define IA64_SF_RC_TRUNC	UL_CONST(0x0030)
-#define IA64_SF_TD		UL_CONST(0x0040)
-#define IA64_SF_V		UL_CONST(0x0080)
-#define IA64_SF_D		UL_CONST(0x0100)
-#define IA64_SF_Z		UL_CONST(0x0200)
-#define IA64_SF_O		UL_CONST(0x0400)
-#define IA64_SF_U		UL_CONST(0x0800)
-#define IA64_SF_I		UL_CONST(0x1000)
-
-#define IA64_SF_DEFAULT	(IA64_SF_PC_3 | IA64_SF_RC_NEAREST)
-
-#define IA64_FPSR_DEFAULT	(IA64_FPSR_TRAP_VD			\
-				 | IA64_FPSR_TRAP_DD			\
-				 | IA64_FPSR_TRAP_ZD			\
-				 | IA64_FPSR_TRAP_OD			\
-				 | IA64_FPSR_TRAP_UD			\
-				 | IA64_FPSR_TRAP_ID			\
-				 | IA64_FPSR_SF(0, IA64_SF_DEFAULT)	\
-				 | IA64_FPSR_SF(1, (IA64_SF_DEFAULT	\
-						    | IA64_SF_TD	\
-						    | IA64_SF_WRE))	\
-				 | IA64_FPSR_SF(2, (IA64_SF_DEFAULT	\
-						    | IA64_SF_TD))	\
-				 | IA64_FPSR_SF(3, (IA64_SF_DEFAULT	\
-						    | IA64_SF_TD)))
-
-
-#ifndef __ASSEMBLY__
-
-	/* This is from sys/cdefs.h in FreeBSD */
-#define __aligned(x)    __attribute__((__aligned__(x)))
-
-	/* A single Floating Point register. */
-struct ia64_fpreg
-{
-	uint8_t	fpr_bits[16];
-} __aligned(16);
-
-typedef struct ia64_fpreg ia64_fpreg_t;
-
-#endif /* __ASSEMBLY__ */
-
-#endif /* _IA64_FPU_H_ */
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/include/ia64/os.h
--- a/extras/mini-os/include/ia64/os.h	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,295 +0,0 @@
-/*
- * Copyright (C) 2007 - Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
- *
- ****************************************************************************
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- * 
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
- * DEALINGS IN THE SOFTWARE.
- */
-
-
-#if !defined(__OS_H__)
-#define __OS_H__
-
-#if !defined(__ASSEMBLY__)
-
-#include <mini-os/types.h>
-#include "ia64_cpu.h"
-#include "atomic.h"
-#include "efi.h"
-#include "sal.h"
-#include "pal.h"
-#include <mini-os/hypervisor.h>
-#include <mini-os/kernel.h>
-
-
-typedef uint64_t paddr_t;		/* Physical address. */
-#ifndef HAVE_LIBC
-typedef uint64_t caddr_t;		/* rr7/kernel memory address. */
-#endif
-
-#include "page.h"
-#include "mm.h"
-
-
-void arch_init(start_info_t *si);	/* in common.c */
-void arch_print_info(void);		/* in common.c */
-void arch_fini(void);
-
-
-/* Size of xen_ia64_boot_param.command_line */
-#define COMMAND_LINE_SIZE       512
-
-extern struct xen_ia64_boot_param* ia64_boot_paramP;
-extern struct xen_ia64_boot_param ia64BootParamG;
-extern char boot_cmd_line[];
-extern efi_system_table_t* efiSysTableP;
-extern int bootverbose;
-
-extern void ia64_probe_sapics(void);
-
-
-
-/* Contains the needed stuff from efi. */
-struct efi
-{
-
-	efi_system_table_t*		efiSysTableP;
-	efi_set_virtual_address_map_t	setVirtAddrMapF;
-	efi_get_time_t			getTimeF;
-	efi_reset_system_t		resetSystemF;
-
-};
-
-struct machine_fw
-{
-	struct efi efi;
-
-	uint64_t ia64_port_base;	/* physical address */
-	uint64_t ia64_pal_base;		/* virtual rr7 address */
-
-	sal_system_table_t* ia64_sal_tableP;
-	sal_entry_t* ia64_sal_entryP;	/* SAL_PROC entrypoint */
-
-	uint64_t ia64_efi_acpi_table;	/* physical address */
-	uint64_t ia64_efi_acpi20_table;	/* physical address */
-
-	uint64_t mach_mem_start;	/* phys start addr of machine memory */
-	uint64_t mach_mem_size;		/* size of machine memory */
-
-	uint64_t kernstart;		/* virt address of kern text start */
-	uint64_t kernend;
-	uint64_t kernpstart;		/* phys address of kern text start */
-	uint64_t kernpend;
-};
-
-extern struct machine_fw machineFwG;
-
-#define ia64_sal_entry machineFwG.ia64_sal_entryP
-
-#define smp_processor_id() 0
-
-static inline uint64_t
-xchg8(uint64_t* ptr, uint64_t x)                                               \
-{
-        uint64_t oldVal;
-        asm volatile ("xchg8 %0=[%1],%2" : "=r" (oldVal)
-                      : "r" (ptr), "r" (x) : "memory");
-        return oldVal;
-}
-#define xchg xchg8
-
-// Counts the number of 1-bits in x.
-#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-# define get_popcnt(x)         __builtin_popcountl(x)
-#else
-# define get_popcnt(x)					\
-  ({							\
-	uint64_t num;					\
-	asm ("popcnt %0=%1" : "=r" (num) : "r" (x));	\
-	num;						\
-  })
-#endif
-
-/**
- * __ffs - find first bit in word.
- * @x: The word to search
- *
- * Undefined if no bit exists, so code should check against 0 first.
- */
-static inline unsigned long
-__ffs (unsigned long x)
-{
-	unsigned long result;
-
-	result = get_popcnt((x-1) & ~x);
-	return result;
-}
-
-
-static inline void
-synch_clear_bit(int num, volatile void *addr)
-{
-	clear_bit(num, addr);
-}
-
-static inline void
-synch_set_bit(int num, volatile void *addr)
-{
-	set_bit(num, addr);
-}
-
-static inline int
-synch_test_bit(int nr, const volatile void *addr)
-{
-	return test_bit(nr, addr);
-}
-
-static inline int
-synch_test_and_set_bit(int num, volatile void * addr)
-{
-	return test_and_set_bit(num, addr);
-}
-
-
-#define synch_cmpxchg(ptr, old, new) \
-((__typeof__(*(ptr)))__synch_cmpxchg((ptr),\
-                                     (unsigned long)(old), \
-                                     (unsigned long)(new), \
-                                     sizeof(*(ptr))))
-
-static inline unsigned long
-__synch_cmpxchg(volatile void *ptr, uint64_t old, uint64_t new, int size)
-{
-	switch (size)
-	{
-		case 1:
-			return ia64_cmpxchg_acq_8(ptr, old, new);
-		case 2:
-			return ia64_cmpxchg_acq_16(ptr, old, new);
-		case 4:
-			return ia64_cmpxchg_acq_32(ptr, old, new);
-		case 8:
-			return ia64_cmpxchg_acq_64(ptr, old, new);
-	}
-	return ia64_cmpxchg_acq_64(ptr, old, new);
-}
-
-extern shared_info_t *HYPERVISOR_shared_info;
-
-
-/*
- * This code is from the originally os.h and should be put in a
- * common header file!
- */
-
-/* 
- * The use of 'barrier' in the following reflects their use as local-lock
- * operations. Reentrancy must be prevented (e.g., __cli()) /before/ following
- * critical operations are executed. All critical operations must complete
- * /before/ reentrancy is permitted (e.g., __sti()). Alpha architecture also
- * includes these barriers, for example.
- */
-
-#define __cli()								\
-do {									\
-	vcpu_info_t *_vcpu;						\
-	_vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()];	\
-	_vcpu->evtchn_upcall_mask = 1;					\
-	barrier();							\
-} while (0)
-
-#define __sti()								\
-do {									\
-	vcpu_info_t *_vcpu;						\
-	barrier();							\
-	_vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()];	\
-	_vcpu->evtchn_upcall_mask = 0;					\
-	barrier(); /* unmask then check (avoid races) */		\
-	if (unlikely(_vcpu->evtchn_upcall_pending))			\
-		force_evtchn_callback();				\
-} while (0)
-
-#define __save_flags(x)							\
-do {									\
-	vcpu_info_t *_vcpu;						\
-	_vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()];	\
-	(x) = _vcpu->evtchn_upcall_mask;				\
-} while (0)
-
-#define __restore_flags(x)						\
-do {									\
-	vcpu_info_t *_vcpu;						\
-	barrier();							\
-	_vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()];	\
-	if ((_vcpu->evtchn_upcall_mask = (x)) == 0) {			\
-		barrier(); /* unmask then check (avoid races) */	\
-		if ( unlikely(_vcpu->evtchn_upcall_pending) )		\
-			force_evtchn_callback();			\
-	}\
-} while (0)
-
-#define safe_halt()		((void)0)
-
-#define __save_and_cli(x)						\
-do {									\
-	vcpu_info_t *_vcpu;						\
-	_vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()];	\
-	(x) = _vcpu->evtchn_upcall_mask;				\
-	_vcpu->evtchn_upcall_mask = 1;					\
-	barrier();							\
-} while (0)
-
-#define local_irq_save(x)	__save_and_cli(x)
-#define local_irq_restore(x)	__restore_flags(x)
-#define local_save_flags(x)	__save_flags(x)
-#define local_irq_disable()	__cli()
-#define local_irq_enable()	__sti()
-
-#define irqs_disabled()			\
-	(HYPERVISOR_shared_info->vcpu_info[smp_processor_id()].evtchn_upcall_mask)
-
-/* This is a barrier for the compiler only, NOT the processor! */
-#define barrier() __asm__ __volatile__("": : :"memory")
-
-#define mb()	ia64_mf()
-#define rmb()	mb()
-#define wmb()	mb()
-
-
-#define BUG()	\
-	{ printk("mini-os BUG at %s:%d!\n", __FILE__, __LINE__); do_exit(); }
-
-#define PRINT_BV(_fmt, _params...)		\
-	if (bootverbose)			\
-		printk(_fmt , ## _params)
-
-#endif /* !defined(__ASSEMBLY__) */
-
-#if defined(__ASSEMBLY__)
-
-#define UL_CONST(x)	x
-#define UL_TYPE(x)	x
-
-#else /* defined(__ASSEMBLY__) */
-
-#define UL_CONST(x)	x##UL
-#define UL_TYPE(x)	((uint64_t)x)
-
-#endif /* defined(__ASSEMBLY__) */
-
-#endif /* !defined(__OS_H__) */
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/include/ia64/page.h
--- a/extras/mini-os/include/ia64/page.h	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-/*
- * Done by Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
- * Common stuff for memory and page handling.
- * Parts are taken from FreeBSD.
- *
- ****************************************************************************
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- * 
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
- * DEALINGS IN THE SOFTWARE.
- */
-
-
-#if !defined(_PAGE_H_)
-#define _PAGE_H_
-
-#include "os.h"
-#include "ia64_cpu.h"
-
-#define PTE_KERNEL_ATTR ((PTE_P<<PTE_P_SHIFT)		|\
-			(PTE_MA_WB<<PTE_MA_SHIFT)	|\
-			(PTE_D<<PTE_D_SHIFT)		|\
-			(PTE_A<<PTE_A_SHIFT)		|\
-			(PTE_PL_KERN<<PTE_PL_SHIFT)	|\
-			(PTE_AR_RWX<<PTE_AR_SHIFT))
-
-
-/* The kernel tr page size for text and data. */
-#define KERNEL_TR_PAGE_SIZE	PTE_PS_1M
-/* The efi-pal page size for text and data. */
-#define PAL_TR_PAGE_SIZE	PTE_PS_1M
-
-#include "arch_limits.h"
-#define PAGE_SHIFT	__PAGE_SHIFT
-#define PAGE_SIZE	__PAGE_SIZE
-#define PAGE_MASK	(~(PAGE_SIZE-1))
-
-#define KSTACK_PAGES	4	/* 4 pages for the kernel stack + bsp */
-
-#define IA64_TR_KERNEL	0       /* itr0, dtr0: maps kernel image (code) */
-#define IA64_TR_PAL	1       /* itr1: maps pal code */
-
-/*
- * Manipulating region bits of an address.
- */
-#define IA64_RR_BASE(n)		((UL_TYPE(n)) << 61)
-#define IA64_RR_MASK(x)		((UL_TYPE(x)) & ((1L << 61) - 1))
-#define IA64_RR_EXTR(x)		((x) >> 61)
-
-#define IA64_PHYS_TO_RR5(x)	((x) | IA64_RR_BASE(5))
-#define IA64_PHYS_TO_RR7(x)	((x) | IA64_RR_BASE(7))
-
-#define __pa(x)	IA64_RR_MASK(x)
-#define __va(x)	IA64_PHYS_TO_RR7(x)
-
-#define roundup_page(x)	((((unsigned long)(x)) + PAGE_SIZE -1) & PAGE_MASK)
-#define trunc_page(x)	((unsigned long)(x) & PAGE_MASK)
-
-
-#if !defined(__ASSEMBLY__)
-
-/* Contains the parts of the physically memory. */
-extern paddr_t phys_avail[];
-
-#define page_to_pfn(page)	((uint64_t)(page) >> PAGE_SHIFT)
-#define pfn_to_page(pfn)	((uint64_t)pfn << PAGE_SHIFT)
-/* Get phyiscal address of page of virtual address. */
-#define virt_to_page(addr)	((uint64_t)__pa(addr) & PAGE_MASK)
-#define virt_to_pfn(addr)	(page_to_pfn(virt_to_page(addr)))
-
-
-#endif /* __ASSEMBLY__ */
-
-
-/* For both see minios-ia64.lds. */
-/* This is where the kernel virtually starts. */
-#define KERNEL_START	IA64_PHYS_TO_RR5(0x100000000)
-/* !!!!!
- * For physical start of kernel
- * Currently used in arch/ia64/fw.S.
- * !!!!!
- */
-#define KERNEL_PHYS_START_SHIFT	20
-
-/* A region 5 address to physical address */
-#define KERN_VIRT_2_PHYS(x) (((x) - KERNEL_START) + \
-				(1 << KERNEL_PHYS_START_SHIFT))
-
-/* Some protection keys for region 5 and 7 addresses. */
-#define IA64_KEY_REG7	0x234	/* Region 7 - identity mapped addresses */
-#define IA64_KEY_REG5	0x89a	/* Region 5 - kernel addresses */
-
-// This is xen specific !
-#define PAGE_SHIFT_XEN_16K	14	// For 16KB page size
-#define mfn_to_virt(mfn)	((void*)__va((mfn) << PAGE_SHIFT_XEN_16K))
-
-#endif /* !defined(_PAGE_H_) */
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/include/ia64/pal.h
--- a/extras/mini-os/include/ia64/pal.h	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-/*
- * Done by Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
- * The code is mostly taken from FreeBSD.
- *
- ****************************************************************************
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- */
-
-#ifndef _PAL_H_
-#define _PAL_H_
-
-/*
- * Architected static calling convention procedures.
- */
-#define PAL_CACHE_FLUSH		1
-#define PAL_CACHE_INFO		2
-#define PAL_CACHE_INIT		3
-#define PAL_CACHE_SUMMARY	4
-#define PAL_MEM_ATTRIB		5
-#define PAL_PTCE_INFO		6
-#define PAL_VM_INFO		7
-#define PAL_VM_SUMMARY		8
-#define PAL_BUS_GET_FEATURES	9
-#define PAL_BUS_SET_FEATURES	10
-#define PAL_DEBUG_INFO		11
-#define PAL_FIXED_ADDR		12
-#define PAL_FREQ_BASE		13
-#define PAL_FREQ_RATIOS		14
-#define PAL_PERF_MON_INFO	15
-#define PAL_PLATFORM_ADDR	16
-#define PAL_PROC_GET_FEATURE	17
-#define PAL_PROC_SET_FEATURE	18
-#define PAL_RSE_INFO		19
-#define PAL_VERSION		20
-#define PAL_MC_CLEAR_LOG	21
-#define PAL_MC_DRAIN		22
-#define PAL_MC_DYNAMIC_STATE	24
-#define PAL_MC_ERROR_INFO	25
-#define PAL_MC_EXPECTED		23
-#define PAL_MC_REGISTER_MEM	27
-#define PAL_MC_RESUME		26
-#define PAL_HALT		28
-#define PAL_HALT_LIGHT		29
-#define PAL_COPY_INFO		30
-#define PAL_CACHE_LINE_INIT	31
-#define PAL_PMI_ENTRYPOINT	32
-#define PAL_ENTER_IA_32_ENV	33
-#define PAL_VM_PAGE_SIZE	34
-#define PAL_MEM_FOR_TEST	37
-#define PAL_CACHE_PROT_INFO	38
-#define PAL_REGISTER_INFO	39
-#define PAL_SHUTDOWN		40
-#define PAL_PREFETCH_VISIBILITY	41
-
-
-struct ia64_pal_result
-{
-	int64_t		pal_status;
-	uint64_t	pal_result[3];
-};
-
-extern struct ia64_pal_result
-	ia64_call_pal_static(uint64_t proc, uint64_t arg1,
-			     uint64_t arg2, uint64_t arg3);
-
-#endif /* _PAL_H_ */
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/include/ia64/privop.h
--- a/extras/mini-os/include/ia64/privop.h	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,97 +0,0 @@
-
-/*
- * Copyright (C) 2005 Hewlett-Packard Co
- *	Dan Magenheimer <dan.magenheimer@hp.com>
- *
- * Paravirtualizations of privileged operations for Xen/ia64
- *
- */
-
-#ifndef _PRIVOP_H_
-#define _PRIVOP_H_
-
-#include <xen/arch-ia64.h>
-
-#define IA64_PARAVIRTUALIZED
-
-/* At 1 MB, before per-cpu space but still addressable using addl instead
-   of movl. */
-#define XSI_BASE		0xfffffffffff00000
-
-/* Address of mapped regs.  */
-#define XMAPPEDREGS_BASE	(XSI_BASE + XSI_SIZE)
-
-#ifdef __ASSEMBLY__
-#define	XEN_HYPER_RFI		break HYPERPRIVOP_RFI
-#define	XEN_HYPER_RSM_PSR_DT	break HYPERPRIVOP_RSM_DT
-#define	XEN_HYPER_SSM_PSR_DT	break HYPERPRIVOP_SSM_DT
-#define	XEN_HYPER_COVER		break HYPERPRIVOP_COVER
-#define	XEN_HYPER_ITC_D		break HYPERPRIVOP_ITC_D
-#define	XEN_HYPER_ITC_I		break HYPERPRIVOP_ITC_I
-#define	XEN_HYPER_SSM_I		break HYPERPRIVOP_SSM_I
-#define	XEN_HYPER_GET_IVR	break HYPERPRIVOP_GET_IVR
-#define	XEN_HYPER_GET_TPR	break HYPERPRIVOP_GET_TPR
-#define	XEN_HYPER_SET_TPR	break HYPERPRIVOP_SET_TPR
-#define	XEN_HYPER_EOI		break HYPERPRIVOP_EOI
-#define	XEN_HYPER_SET_ITM	break HYPERPRIVOP_SET_ITM
-#define	XEN_HYPER_THASH		break HYPERPRIVOP_THASH
-#define	XEN_HYPER_PTC_GA	break HYPERPRIVOP_PTC_GA
-#define	XEN_HYPER_ITR_D		break HYPERPRIVOP_ITR_D
-#define	XEN_HYPER_GET_RR	break HYPERPRIVOP_GET_RR
-#define	XEN_HYPER_SET_RR	break HYPERPRIVOP_SET_RR
-#define	XEN_HYPER_SET_KR	break HYPERPRIVOP_SET_KR
-#define	XEN_HYPER_FC		break HYPERPRIVOP_FC
-#define	XEN_HYPER_GET_CPUID	break HYPERPRIVOP_GET_CPUID
-#define	XEN_HYPER_GET_PMD	break HYPERPRIVOP_GET_PMD
-#define	XEN_HYPER_GET_EFLAG	break HYPERPRIVOP_GET_EFLAG
-#define	XEN_HYPER_SET_EFLAG	break HYPERPRIVOP_SET_EFLAG
-#define	XEN_HYPER_RSM_BE	break HYPERPRIVOP_RSM_BE
-#define	XEN_HYPER_GET_PSR	break HYPERPRIVOP_GET_PSR
-
-#define XSI_IFS			(XSI_BASE + XSI_IFS_OFS)
-#define XSI_PRECOVER_IFS	(XSI_BASE + XSI_PRECOVER_IFS_OFS)
-#define XSI_INCOMPL_REGFR	(XSI_BASE + XSI_INCOMPL_REGFR_OFS)
-#define XSI_IFA			(XSI_BASE + XSI_IFA_OFS)
-#define XSI_ISR			(XSI_BASE + XSI_ISR_OFS)
-#define XSI_IIM			(XSI_BASE + XSI_IIM_OFS)
-#define XSI_ITIR		(XSI_BASE + XSI_ITIR_OFS)
-#define XSI_PSR_I_ADDR		(XSI_BASE + XSI_PSR_I_ADDR_OFS)
-#define XSI_PSR_IC		(XSI_BASE + XSI_PSR_IC_OFS)
-#define XSI_IPSR		(XSI_BASE + XSI_IPSR_OFS)
-#define XSI_IIP			(XSI_BASE + XSI_IIP_OFS)
-#define XSI_BANK1_R16		(XSI_BASE + XSI_BANK1_R16_OFS)
-#define XSI_BANKNUM		(XSI_BASE + XSI_BANKNUM_OFS)
-#define XSI_IHA			(XSI_BASE + XSI_IHA_OFS)
-#endif
-
-#ifndef __ASSEMBLY__
-#define	XEN_HYPER_SSM_I		asm("break %0" : : "i" (HYPERPRIVOP_SSM_I))
-#define	XEN_HYPER_GET_IVR	asm("break %0" : : "i" (HYPERPRIVOP_GET_IVR))
-
-/************************************************/
-/* Instructions paravirtualized for performance */
-/************************************************/
-
-/* Xen uses memory-mapped virtual privileged registers for access to many
- * performance-sensitive privileged registers.  Some, like the processor
- * status register (psr), are broken up into multiple memory locations.
- * Others, like "pend", are abstractions based on privileged registers.
- * "Pend" is guaranteed to be set if reading cr.ivr would return a
- * (non-spurious) interrupt. */
-#define XEN_MAPPEDREGS ((struct mapped_regs *)XMAPPEDREGS_BASE)
-#define XSI_PSR_I			\
-	(*XEN_MAPPEDREGS->interrupt_mask_addr)
-#define xen_get_virtual_psr_i()		\
-	(!XSI_PSR_I)
-#define xen_set_virtual_psr_i(_val)	\
-	({ XSI_PSR_I = (uint8_t)(_val) ? 0 : 1; })
-#define xen_get_virtual_psr_ic()	\
-	( XEN_MAPPEDREGS->interrupt_collection_enabled )
-#define xen_set_virtual_psr_ic(_val)	\
-	({ XEN_MAPPEDREGS->interrupt_collection_enabled = _val ? 1 : 0; })
-#define xen_get_virtual_pend()		(XEN_MAPPEDREGS->pending_interruption)
-
-#endif /* __ASSEMBLY__ */
-
-#endif /* _PRIVOP_H_ */
-
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/include/ia64/sal.h
--- a/extras/mini-os/include/ia64/sal.h	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,188 +0,0 @@
-/*
- * Done by Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
- * The code is mostly taken from FreeBSD.
- *
- ****************************************************************************
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
- *
- */
-
-
-/*
- * The SAL System Table starts with a header which is described in
- * sal_system_table_t.
- * Table header will be followed by a variable number of variable length
- * entries. The first byte of each entry will identify the entry type and
- * the entries shall be in ascending order by the entry type. Each entry
- * type will have a known fixed length. The total length of this table
- * depends upon the configuration of the system. Operating system software
- * must step through each entry until it reaches the ENTRY_COUNT. The entries
- * are sorted on entry type in ascending order.
- * Unless otherwise stated, there is one entry per entry type.
- */
-
-#ifndef _SAL_H_
-#define _SAL_H_
-
-typedef uint64_t u_int64_t;
-typedef uint32_t u_int32_t;
-typedef uint16_t u_int16_t;
-typedef uint8_t u_int8_t;
-
-struct sal_system_table {
-	char		sal_signature[4];
-#define	SAL_SIGNATURE	"SST_"
-	uint32_t	sal_length;
-	uint8_t		sal_rev[2];	/* Byte 8 - Minor, Byte 0 - Major */
-	uint16_t	sal_entry_count;	// num entries in var part
-	uint8_t		sal_checksum;
-	uint8_t		sal_reserved1[7];
-	uint8_t		sal_a_version[2];	// like sal_rev
-	uint8_t		sal_b_version[2];	// like sal_rev
-	char		sal_oem_id[32];		// Ascii - manufacturer of HW
-	char		sal_product_id[32];	// ascii - identification
-	uint8_t		sal_reserved2[8];
-};
-
-typedef struct sal_system_table sal_system_table_t;
-
-#define SAL_DESC_ENTRYPOINT		0
-#define SAL_DESC_ENTRYPOINT_LENGTH	48
-#define SAL_DESC_MEMORY			1
-#define SAL_DESC_MEMORY_LENGTH		32
-#define SAL_DESC_PLATFORM		2
-#define SAL_DESC_PLATFORM_LENGT		16
-#define SAL_DESC_TR_REG			3
-#define SAL_DESC_TR_REG_LENGTH		32
-#define SAL_DESC_PURGE_TR_CACHE		4
-#define SAL_DESC_PURGE_TR_CACHE_LENGTH	16
-#define SAL_DESC_AP_WAKEUP		5
-#define SAL_DESC_AP_WAKEUP_LENGTH	16
-
-
-struct sal_entrypoint_descriptor
-{
-	uint8_t		sale_type;		/* == 0 */
-	uint8_t		sale_reserved1[7];
-	uint64_t	sale_pal_proc;		/* PAL_PROC entry point */
-	uint64_t	sale_sal_proc;		/* SAL_PROC entry point */
-	uint64_t	sale_sal_gp;		/* gp for SAL_PROC, PAL_PROC */
-	uint8_t		sale_reserved2[16];
-};
-
-struct sal_memory_descriptor
-{
-	uint8_t		sale_type;	/* == 1 */
-	uint8_t		sale_need_virtual;
-	uint8_t		sale_current_attribute;
-	uint8_t		sale_access_rights;
-	uint8_t		sale_supported_attributes;
-	uint8_t		sale_reserved1;
-	uint8_t		sale_memory_type[2];
-	uint64_t	sale_physical_address;
-	uint32_t	sale_length;
-	uint8_t		sale_reserved2[12];
-};
-
-struct sal_platform_descriptor
-{
-	uint8_t		sale_type;	/* == 2 */
-	uint8_t		sale_features;
-	uint8_t		sale_reserved[14];
-};
-
-struct sal_tr_descriptor
-{
-	u_int8_t	sale_type;	/* == 3 */
-	u_int8_t	sale_register_type;
-	u_int8_t	sale_register_number;
-	u_int8_t	sale_reserved1[5];
-	u_int64_t	sale_virtual_address;
-	u_int64_t	sale_page_size;
-	u_int8_t	sale_reserved2[8];
-};
-
-struct sal_ptc_cache_descriptor
-{
-	uint8_t		sale_type;	/* == 4 */
-	uint8_t		sale_reserved[3];
-	uint32_t	sale_domains;
-	uint64_t	sale_address;
-};
-
-struct sal_ap_wakeup_descriptor
-{
-	uint8_t		sale_type;	/* == 5 */
-	uint8_t		sale_mechanism;
-	uint8_t		sale_reserved[6];
-	uint64_t	sale_vector;
-};
-
-/*
- * SAL Procedure numbers.
- */
-
-#define SAL_SET_VECTORS			0x01000000
-#define SAL_GET_STATE_INFO		0x01000001
-#define SAL_GET_STATE_INFO_SIZE		0x01000002
-#define SAL_CLEAR_STATE_INFO		0x01000003
-#define SAL_MC_RENDEZ			0x01000004
-#define SAL_MC_SET_PARAMS		0x01000005
-#define SAL_REGISTER_PHYSICAL_ADDR	0x01000006
-#define SAL_CACHE_FLUSH			0x01000008
-#define SAL_CACHE_INIT			0x01000009
-#define SAL_PCI_CONFIG_READ		0x01000010
-#define SAL_PCI_CONFIG_WRITE		0x01000011
-#define SAL_FREQ_BASE			0x01000012
-#define SAL_UPDATE_PAL			0x01000020
-
-/* SAL_SET_VECTORS event handler types */
-#define	SAL_OS_MCA		0
-#define	SAL_OS_INIT		1
-#define	SAL_OS_BOOT_RENDEZ	2
-
-/* SAL_GET_STATE_INFO, SAL_GET_STATE_INFO_SIZE types */
-#define	SAL_INFO_MCA		0
-#define	SAL_INFO_INIT		1
-#define	SAL_INFO_CMC		2
-#define	SAL_INFO_CPE		3
-#define	SAL_INFO_TYPES		4	/* number of types we know about */
-
-struct ia64_sal_result
-{
-	int64_t		sal_status;
-	uint64_t	sal_result[3];
-};
-typedef struct ia64_sal_result ia64_sal_result_t;
-
-typedef ia64_sal_result_t sal_entry_t
-	(	uint64_t, uint64_t, uint64_t, uint64_t,
-	 	uint64_t, uint64_t, uint64_t, uint64_t
-	);
-
-extern ia64_sal_result_t ia64_sal_call(uint64_t, uint64_t, uint64_t, uint64_t,
-	 				uint64_t, uint64_t, uint64_t, uint64_t);
-
-extern void ia64_sal_init(sal_system_table_t *saltab);
-
-#endif /* _SAL_H_ */
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/include/ia64/traps.h
--- a/extras/mini-os/include/ia64/traps.h	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
- * Done by Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
- *
- ****************************************************************************
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- * 
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
- * DEALINGS IN THE SOFTWARE.
- */
-
-#if !defined(_TRAPS_H_)
-#define _TRAPS_H_
-
-#if !defined(__ASSEMBLY__)
-
-/* See ia64_cpu.h */
-struct trap_frame;
-
-#define pt_regs trap_frame
-
-/*
- * A dummy function, which is currently not supported.
- */
-inline static void trap_init(void)
-{
-	//printk("trap_init() until now not needed!\n");
-}
-inline static void trap_fini(void)
-{
-	//printk("trap_fini() until now not needed!\n");
-}
-
-
-#endif /* !defined(__ASSEMBLY__) */
-
-#include "ia64_cpu.h"
-
-void stack_walk(void);
-
-#endif /* !defined(_TRAPS_H_) */
-
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/include/mm.h
--- a/extras/mini-os/include/mm.h	Wed Sep 12 16:12:42 2012 +0100
+++ b/extras/mini-os/include/mm.h	Wed Sep 12 17:55:27 2012 +0100
@@ -29,8 +29,6 @@
 #include <xen/arch-x86_32.h>
 #elif defined(__x86_64__)
 #include <xen/arch-x86_64.h>
-#elif defined(__ia64__)
-#include <xen/arch-ia64.h>
 #else
 #error "Unsupported architecture"
 #endif
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/include/posix/limits.h
--- a/extras/mini-os/include/posix/limits.h	Wed Sep 12 16:12:42 2012 +0100
+++ b/extras/mini-os/include/posix/limits.h	Wed Sep 12 17:55:27 2012 +0100
@@ -25,7 +25,7 @@
 #define SHRT_MAX        0x7fff
 #define USHRT_MAX       0xffff
 
-#if defined(__x86_64__) || defined(__ia64__)
+#if defined(__x86_64__)
 # define LONG_MAX       0x7fffffffffffffffL
 # define ULONG_MAX      0xffffffffffffffffUL
 #else
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/include/sched.h
--- a/extras/mini-os/include/sched.h	Wed Sep 12 16:12:42 2012 +0100
+++ b/extras/mini-os/include/sched.h	Wed Sep 12 17:55:27 2012 +0100
@@ -12,13 +12,9 @@ struct thread
 {
     char *name;
     char *stack;
-#if !defined(__ia64__)
     /* keep in that order */
     unsigned long sp;  /* Stack pointer */
     unsigned long ip;  /* Instruction pointer */
-#else /* !defined(__ia64__) */
-    thread_regs_t regs;
-#endif /* !defined(__ia64__) */
     MINIOS_TAILQ_ENTRY(struct thread) thread_list;
     uint32_t flags;
     s_time_t wakeup_time;
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/include/types.h
--- a/extras/mini-os/include/types.h	Wed Sep 12 16:12:42 2012 +0100
+++ b/extras/mini-os/include/types.h	Wed Sep 12 17:55:27 2012 +0100
@@ -33,7 +33,7 @@ typedef unsigned long long  u_quad_t;
 
 typedef struct { unsigned long pte_low, pte_high; } pte_t;
 
-#elif defined(__x86_64__) || defined(__ia64__)
+#elif defined(__x86_64__)
 typedef long                quad_t;
 typedef unsigned long       u_quad_t;
 
@@ -54,7 +54,7 @@ typedef struct { unsigned long pte; } pt
 #ifdef __i386__
 typedef unsigned int        uintptr_t;
 typedef int                 intptr_t;
-#elif defined(__x86_64__) || defined(__ia64__)
+#elif defined(__x86_64__)
 typedef unsigned long       uintptr_t;
 typedef long                intptr_t;
 #endif /* __i386__ || __x86_64__ */
@@ -67,7 +67,7 @@ typedef   signed int int32_t;
 #ifdef __i386__
 typedef   signed long long int64_t;
 typedef unsigned long long uint64_t;
-#elif defined(__x86_64__) || defined(__ia64__)
+#elif defined(__x86_64__)
 typedef   signed long int64_t;
 typedef unsigned long uint64_t;
 #endif
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/lib/math.c
--- a/extras/mini-os/lib/math.c	Wed Sep 12 16:12:42 2012 +0100
+++ b/extras/mini-os/lib/math.c	Wed Sep 12 17:55:27 2012 +0100
@@ -50,10 +50,6 @@
 #include <mini-os/lib.h>
 #include <mini-os/time.h>
 
-	/* On ia64 these functions lead to crashes. These are replaced by
-	 * assembler functions. */
-#if !defined(__ia64__)
-
 /* XXX RN: Yuck hardcoded endianess :) */
 #define _QUAD_HIGHWORD 1
 #define _QUAD_LOWWORD 0
@@ -428,7 +424,6 @@ __moddi3(quad_t a, quad_t b)
 	(void)__qdivrem(ua, ub, &ur);
 	return (neg ? -ur : ur);
 }
-#endif /* !defined(__ia64__) */
 
 #ifndef HAVE_LIBC
 /* Should be random enough for our uses */
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/mm.c
--- a/extras/mini-os/mm.c	Wed Sep 12 16:12:42 2012 +0100
+++ b/extras/mini-os/mm.c	Wed Sep 12 17:55:27 2012 +0100
@@ -361,7 +361,6 @@ void free_pages(void *pointer, int order
    
 }
 
-#ifndef __ia64__
 int free_physical_pages(xen_pfn_t *mfns, int n)
 {
     struct xen_memory_reservation reservation;
@@ -372,7 +371,6 @@ int free_physical_pages(xen_pfn_t *mfns,
     reservation.domid = DOMID_SELF;
     return HYPERVISOR_memory_op(XENMEM_decrease_reservation, &reservation);
 }
-#endif
 
 #ifdef HAVE_LIBC
 void *sbrk(ptrdiff_t increment)
diff -r a1bd69b08e9e -r 485e6db28b93 tools/debugger/xenitp/Makefile
--- a/tools/debugger/xenitp/Makefile	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-XEN_ROOT=$(CURDIR)/../../..
-include $(XEN_ROOT)/tools/Rules.mk
-
-#CFLAGS  += -Werror -g -O0
-
-CFLAGS  += $(CFLAGS_libxenctrl)
-
-LIBBIN   = 
-
-ifeq ($(XEN_TARGET_ARCH),ia64)
-LIBBIN  += xenitp
-endif
-
-.PHONY: all
-all: build
-
-.PHONY: build
-build: $(LIBBIN)
-
-.PHONY: install
-install: build
-	[ -z "$(LIBBIN)" ] || $(INSTALL_DIR) $(DESTDIR)$(PRIVATE_BINDIR)
-	[ -z "$(LIBBIN)" ] || $(INSTALL_PROG) $(LIBBIN) $(DESTDIR)$(PRIVATE_BINDIR)
-
-.PHONY: clean
-clean:
-	$(RM) *.a *.so *.o *.rpm $(LIBBIN)
-
-XENITP_OBJS=xenitp.o ia64-dis.o ia64-opc.o cpu-ia64-opc.o
-
-xenitp: $(XENITP_OBJS)
-	$(CC) $(CFLAGS) -o $@ $(XENITP_OBJS) $(LDLIBS_libxenctrl)
diff -r a1bd69b08e9e -r 485e6db28b93 tools/debugger/xenitp/README
--- a/tools/debugger/xenitp/README	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-xenitp README
-*************
-
-
-Xenitp is a low-level, non-symbolic debugger.  It only works on ia64.
-
-* Building xenitp
-First do 'make tools' at the top level to build libxc and includes.  Then
-cd to tools/debugger/xenitp and do make.
-
-* Using xenitp
-Usage is: xenitp DOM
-DOM is a domain number.
-'help' shows all the command available.
-When the domain is running, C-c stops it.
-
-* Source origin
-All these files come from binutils:
-cpu-ia64-opc.c
-dis-asm.h
-ia64-asmtab.c
-ia64-asmtab.h
-ia64-dis.c
-ia64-gen.c
-ia64.h
-ia64-opc-a.c
-ia64-opc-b.c
-ia64-opc.c
-ia64-opc-d.c
-ia64-opc-f.c
-ia64-opc.h
-ia64-opc-i.c
-ia64-opc-m.c
-ia64-opc-x.c
-
-xenitp.c is based on xenctxt.c
diff -r a1bd69b08e9e -r 485e6db28b93 tools/debugger/xenitp/cpu-ia64-opc.c
--- a/tools/debugger/xenitp/cpu-ia64-opc.c	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,615 +0,0 @@
-/* Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006
-   Free Software Foundation, Inc.
-   Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
-
-This file is part of BFD, the Binary File Descriptor library.
-
-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., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
-
-/* Logically, this code should be part of libopcode but since some of
-   the operand insertion/extraction functions help bfd to implement
-   relocations, this code is included as part of cpu-ia64.c.  This
-   avoids circular dependencies between libopcode and libbfd and also
-   obviates the need for applications to link in libopcode when all
-   they really want is libbfd.
-
-   --davidm Mon Apr 13 22:14:02 1998 */
-
-#include "ia64-opc.h"
-
-#define NELEMS(a)  ((int) (sizeof (a) / sizeof ((a)[0])))
-
-static const char*
-ins_rsvd (const struct ia64_operand *self ATTRIBUTE_UNUSED,
-	  ia64_insn value ATTRIBUTE_UNUSED, ia64_insn *code ATTRIBUTE_UNUSED)
-{
-  return "internal error---this shouldn't happen";
-}
-
-static const char*
-ext_rsvd (const struct ia64_operand *self ATTRIBUTE_UNUSED,
-	  ia64_insn code ATTRIBUTE_UNUSED, ia64_insn *valuep ATTRIBUTE_UNUSED)
-{
-  return "internal error---this shouldn't happen";
-}
-
-static const char*
-ins_const (const struct ia64_operand *self ATTRIBUTE_UNUSED,
-	   ia64_insn value ATTRIBUTE_UNUSED, ia64_insn *code ATTRIBUTE_UNUSED)
-{
-  return 0;
-}
-
-static const char*
-ext_const (const struct ia64_operand *self ATTRIBUTE_UNUSED,
-	   ia64_insn code ATTRIBUTE_UNUSED, ia64_insn *valuep ATTRIBUTE_UNUSED)
-{
-  return 0;
-}
-
-static const char*
-ins_reg (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
-{
-  if (value >= 1u << self->field[0].bits)
-    return "register number out of range";
-
-  *code |= value << self->field[0].shift;
-  return 0;
-}
-
-static const char*
-ext_reg (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
-{
-  *valuep = ((code >> self->field[0].shift)
-	     & ((1u << self->field[0].bits) - 1));
-  return 0;
-}
-
-static const char*
-ins_immu (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
-{
-  ia64_insn new = 0;
-  int i;
-
-  for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i)
-    {
-      new |= ((value & ((((ia64_insn) 1) << self->field[i].bits) - 1))
-	      << self->field[i].shift);
-      value >>= self->field[i].bits;
-    }
-  if (value)
-    return "integer operand out of range";
-
-  *code |= new;
-  return 0;
-}
-
-static const char*
-ext_immu (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
-{
-  BFD_HOST_U_64_BIT value = 0;
-  int i, bits = 0, total = 0;
-
-  for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i)
-    {
-      bits = self->field[i].bits;
-      value |= ((code >> self->field[i].shift)
-		& ((((BFD_HOST_U_64_BIT) 1) << bits) - 1)) << total;
-      total += bits;
-    }
-  *valuep = value;
-  return 0;
-}
-
-static const char*
-ins_immu5b (const struct ia64_operand *self, ia64_insn value,
-	    ia64_insn *code)
-{
-  if (value < 32 || value > 63)
-    return "value must be between 32 and 63";
-  return ins_immu (self, value - 32, code);
-}
-
-static const char*
-ext_immu5b (const struct ia64_operand *self, ia64_insn code,
-	    ia64_insn *valuep)
-{
-  const char *result;
-
-  result = ext_immu (self, code, valuep);
-  if (result)
-    return result;
-
-  *valuep = *valuep + 32;
-  return 0;
-}
-
-static const char*
-ins_immus8 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
-{
-  if (value & 0x7)
-    return "value not an integer multiple of 8";
-  return ins_immu (self, value >> 3, code);
-}
-
-static const char*
-ext_immus8 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
-{
-  const char *result;
-
-  result = ext_immu (self, code, valuep);
-  if (result)
-    return result;
-
-  *valuep = *valuep << 3;
-  return 0;
-}
-
-static const char*
-ins_imms_scaled (const struct ia64_operand *self, ia64_insn value,
-		 ia64_insn *code, int scale)
-{
-  BFD_HOST_64_BIT svalue = value, sign_bit = 0;
-  ia64_insn new = 0;
-  int i;
-
-  svalue >>= scale;
-
-  for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i)
-    {
-      new |= ((svalue & ((((ia64_insn) 1) << self->field[i].bits) - 1))
-	      << self->field[i].shift);
-      sign_bit = (svalue >> (self->field[i].bits - 1)) & 1;
-      svalue >>= self->field[i].bits;
-    }
-  if ((!sign_bit && svalue != 0) || (sign_bit && svalue != -1))
-    return "integer operand out of range";
-
-  *code |= new;
-  return 0;
-}
-
-static const char*
-ext_imms_scaled (const struct ia64_operand *self, ia64_insn code,
-		 ia64_insn *valuep, int scale)
-{
-  int i, bits = 0, total = 0;
-  BFD_HOST_64_BIT val = 0, sign;
-
-  for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i)
-    {
-      bits = self->field[i].bits;
-      val |= ((code >> self->field[i].shift)
-	      & ((((BFD_HOST_U_64_BIT) 1) << bits) - 1)) << total;
-      total += bits;
-    }
-  /* sign extend: */
-  sign = (BFD_HOST_64_BIT) 1 << (total - 1);
-  val = (val ^ sign) - sign;
-
-  *valuep = (val << scale);
-  return 0;
-}
-
-static const char*
-ins_imms (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
-{
-  return ins_imms_scaled (self, value, code, 0);
-}
-
-static const char*
-ins_immsu4 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
-{
-  value = ((value & 0xffffffff) ^ 0x80000000) - 0x80000000;
-
-  return ins_imms_scaled (self, value, code, 0);
-}
-
-static const char*
-ext_imms (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
-{
-  return ext_imms_scaled (self, code, valuep, 0);
-}
-
-static const char*
-ins_immsm1 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
-{
-  --value;
-  return ins_imms_scaled (self, value, code, 0);
-}
-
-static const char*
-ins_immsm1u4 (const struct ia64_operand *self, ia64_insn value,
-	      ia64_insn *code)
-{
-  value = ((value & 0xffffffff) ^ 0x80000000) - 0x80000000;
-
-  --value;
-  return ins_imms_scaled (self, value, code, 0);
-}
-
-static const char*
-ext_immsm1 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
-{
-  const char *res = ext_imms_scaled (self, code, valuep, 0);
-
-  ++*valuep;
-  return res;
-}
-
-static const char*
-ins_imms1 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
-{
-  return ins_imms_scaled (self, value, code, 1);
-}
-
-static const char*
-ext_imms1 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
-{
-  return ext_imms_scaled (self, code, valuep, 1);
-}
-
-static const char*
-ins_imms4 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
-{
-  return ins_imms_scaled (self, value, code, 4);
-}
-
-static const char*
-ext_imms4 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
-{
-  return ext_imms_scaled (self, code, valuep, 4);
-}
-
-static const char*
-ins_imms16 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
-{
-  return ins_imms_scaled (self, value, code, 16);
-}
-
-static const char*
-ext_imms16 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
-{
-  return ext_imms_scaled (self, code, valuep, 16);
-}
-
-static const char*
-ins_cimmu (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
-{
-  ia64_insn mask = (((ia64_insn) 1) << self->field[0].bits) - 1;
-  return ins_immu (self, value ^ mask, code);
-}
-
-static const char*
-ext_cimmu (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
-{
-  const char *result;
-  ia64_insn mask;
-
-  mask = (((ia64_insn) 1) << self->field[0].bits) - 1;
-  result = ext_immu (self, code, valuep);
-  if (!result)
-    {
-      mask = (((ia64_insn) 1) << self->field[0].bits) - 1;
-      *valuep ^= mask;
-    }
-  return result;
-}
-
-static const char*
-ins_cnt (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
-{
-  --value;
-  if (value >= ((BFD_HOST_U_64_BIT) 1) << self->field[0].bits)
-    return "count out of range";
-
-  *code |= value << self->field[0].shift;
-  return 0;
-}
-
-static const char*
-ext_cnt (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
-{
-  *valuep = ((code >> self->field[0].shift)
-	     & ((((BFD_HOST_U_64_BIT) 1) << self->field[0].bits) - 1)) + 1;
-  return 0;
-}
-
-static const char*
-ins_cnt2b (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
-{
-  --value;
-
-  if (value > 2)
-    return "count must be in range 1..3";
-
-  *code |= value << self->field[0].shift;
-  return 0;
-}
-
-static const char*
-ext_cnt2b (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
-{
-  *valuep = ((code >> self->field[0].shift) & 0x3) + 1;
-  return 0;
-}
-
-static const char*
-ins_cnt2c (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
-{
-  switch (value)
-    {
-    case 0:	value = 0; break;
-    case 7:	value = 1; break;
-    case 15:	value = 2; break;
-    case 16:	value = 3; break;
-    default:	return "count must be 0, 7, 15, or 16";
-    }
-  *code |= value << self->field[0].shift;
-  return 0;
-}
-
-static const char*
-ext_cnt2c (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
-{
-  ia64_insn value;
-
-  value = (code >> self->field[0].shift) & 0x3;
-  switch (value)
-    {
-    case 0: value =  0; break;
-    case 1: value =  7; break;
-    case 2: value = 15; break;
-    case 3: value = 16; break;
-    }
-  *valuep = value;
-  return 0;
-}
-
-static const char*
-ins_inc3 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
-{
-  BFD_HOST_64_BIT val = value;
-  BFD_HOST_U_64_BIT sign = 0;
-
-  if (val < 0)
-    {
-      sign = 0x4;
-      value = -value;
-    }
-  switch (value)
-    {
-    case  1:	value = 3; break;
-    case  4:	value = 2; break;
-    case  8:	value = 1; break;
-    case 16:	value = 0; break;
-    default:	return "count must be +/- 1, 4, 8, or 16";
-    }
-  *code |= (sign | value) << self->field[0].shift;
-  return 0;
-}
-
-static const char*
-ext_inc3 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
-{
-  BFD_HOST_64_BIT val;
-  int negate;
-
-  val = (code >> self->field[0].shift) & 0x7;
-  negate = val & 0x4;
-  switch (val & 0x3)
-    {
-    case 0: val = 16; break;
-    case 1: val =  8; break;
-    case 2: val =  4; break;
-    case 3: val =  1; break;
-    }
-  if (negate)
-    val = -val;
-
-  *valuep = val;
-  return 0;
-}
-
-#define CST	IA64_OPND_CLASS_CST
-#define REG	IA64_OPND_CLASS_REG
-#define IND	IA64_OPND_CLASS_IND
-#define ABS	IA64_OPND_CLASS_ABS
-#define REL	IA64_OPND_CLASS_REL
-
-#define SDEC	IA64_OPND_FLAG_DECIMAL_SIGNED
-#define UDEC	IA64_OPND_FLAG_DECIMAL_UNSIGNED
-
-const struct ia64_operand elf64_ia64_operands[IA64_OPND_COUNT] =
-  {
-    /* constants: */
-    { CST, ins_const, ext_const, "NIL",		{{ 0, 0}}, 0, "<none>" },
-    { CST, ins_const, ext_const, "ar.csd",	{{ 0, 0}}, 0, "ar.csd" },
-    { CST, ins_const, ext_const, "ar.ccv",	{{ 0, 0}}, 0, "ar.ccv" },
-    { CST, ins_const, ext_const, "ar.pfs",	{{ 0, 0}}, 0, "ar.pfs" },
-    { CST, ins_const, ext_const, "1",		{{ 0, 0}}, 0, "1" },
-    { CST, ins_const, ext_const, "8",		{{ 0, 0}}, 0, "8" },
-    { CST, ins_const, ext_const, "16",		{{ 0, 0}}, 0, "16" },
-    { CST, ins_const, ext_const, "r0",		{{ 0, 0}}, 0, "r0" },
-    { CST, ins_const, ext_const, "ip",		{{ 0, 0}}, 0, "ip" },
-    { CST, ins_const, ext_const, "pr",		{{ 0, 0}}, 0, "pr" },
-    { CST, ins_const, ext_const, "pr.rot",	{{ 0, 0}}, 0, "pr.rot" },
-    { CST, ins_const, ext_const, "psr",		{{ 0, 0}}, 0, "psr" },
-    { CST, ins_const, ext_const, "psr.l",	{{ 0, 0}}, 0, "psr.l" },
-    { CST, ins_const, ext_const, "psr.um",	{{ 0, 0}}, 0, "psr.um" },
-
-    /* register operands: */
-    { REG, ins_reg,   ext_reg,	"ar", {{ 7, 20}}, 0,		/* AR3 */
-      "an application register" },
-    { REG, ins_reg,   ext_reg,	 "b", {{ 3,  6}}, 0,		/* B1 */
-      "a branch register" },
-    { REG, ins_reg,   ext_reg,	 "b", {{ 3, 13}}, 0,		/* B2 */
-      "a branch register"},
-    { REG, ins_reg,   ext_reg,	"cr", {{ 7, 20}}, 0,		/* CR */
-      "a control register"},
-    { REG, ins_reg,   ext_reg,	 "f", {{ 7,  6}}, 0,		/* F1 */
-      "a floating-point register" },
-    { REG, ins_reg,   ext_reg,	 "f", {{ 7, 13}}, 0,		/* F2 */
-      "a floating-point register" },
-    { REG, ins_reg,   ext_reg,	 "f", {{ 7, 20}}, 0,		/* F3 */
-      "a floating-point register" },
-    { REG, ins_reg,   ext_reg,	 "f", {{ 7, 27}}, 0,		/* F4 */
-      "a floating-point register" },
-    { REG, ins_reg,   ext_reg,	 "p", {{ 6,  6}}, 0,		/* P1 */
-      "a predicate register" },
-    { REG, ins_reg,   ext_reg,	 "p", {{ 6, 27}}, 0,		/* P2 */
-      "a predicate register" },
-    { REG, ins_reg,   ext_reg,	 "r", {{ 7,  6}}, 0,		/* R1 */
-      "a general register" },
-    { REG, ins_reg,   ext_reg,	 "r", {{ 7, 13}}, 0,		/* R2 */
-      "a general register" },
-    { REG, ins_reg,   ext_reg,	 "r", {{ 7, 20}}, 0,		/* R3 */
-      "a general register" },
-    { REG, ins_reg,   ext_reg,	 "r", {{ 2, 20}}, 0,		/* R3_2 */
-      "a general register r0-r3" },
-
-    /* memory operands: */
-    { IND, ins_reg,   ext_reg,	"",      {{7, 20}}, 0,		/* MR3 */
-      "a memory address" },
-
-    /* indirect operands: */
-    { IND, ins_reg,   ext_reg,	"cpuid", {{7, 20}}, 0,		/* CPUID_R3 */
-      "a cpuid register" },
-    { IND, ins_reg,   ext_reg,	"dbr",   {{7, 20}}, 0,		/* DBR_R3 */
-      "a dbr register" },
-    { IND, ins_reg,   ext_reg,	"dtr",   {{7, 20}}, 0,		/* DTR_R3 */
-      "a dtr register" },
-    { IND, ins_reg,   ext_reg,	"itr",   {{7, 20}}, 0,		/* ITR_R3 */
-      "an itr register" },
-    { IND, ins_reg,   ext_reg,	"ibr",   {{7, 20}}, 0,		/* IBR_R3 */
-      "an ibr register" },
-    { IND, ins_reg,   ext_reg,	"msr",   {{7, 20}}, 0,		/* MSR_R3 */
-      "an msr register" },
-    { IND, ins_reg,   ext_reg,	"pkr",   {{7, 20}}, 0,		/* PKR_R3 */
-      "a pkr register" },
-    { IND, ins_reg,   ext_reg,	"pmc",   {{7, 20}}, 0,		/* PMC_R3 */
-      "a pmc register" },
-    { IND, ins_reg,   ext_reg,	"pmd",   {{7, 20}}, 0,		/* PMD_R3 */
-      "a pmd register" },
-    { IND, ins_reg,   ext_reg,	"rr",    {{7, 20}}, 0,		/* RR_R3 */
-      "an rr register" },
-
-    /* immediate operands: */
-    { ABS, ins_cimmu, ext_cimmu, 0, {{ 5, 20 }}, UDEC,		/* CCNT5 */
-      "a 5-bit count (0-31)" },
-    { ABS, ins_cnt,   ext_cnt,   0, {{ 2, 27 }}, UDEC,		/* CNT2a */
-      "a 2-bit count (1-4)" },
-    { ABS, ins_cnt2b, ext_cnt2b, 0, {{ 2, 27 }}, UDEC,		/* CNT2b */
-      "a 2-bit count (1-3)" },
-    { ABS, ins_cnt2c, ext_cnt2c, 0, {{ 2, 30 }}, UDEC,		/* CNT2c */
-      "a count (0, 7, 15, or 16)" },
-    { ABS, ins_immu,  ext_immu,  0, {{ 5, 14}}, UDEC,		/* CNT5 */
-      "a 5-bit count (0-31)" },
-    { ABS, ins_immu,  ext_immu,  0, {{ 6, 27}}, UDEC,		/* CNT6 */
-      "a 6-bit count (0-63)" },
-    { ABS, ins_cimmu, ext_cimmu, 0, {{ 6, 20}}, UDEC,		/* CPOS6a */
-      "a 6-bit bit pos (0-63)" },
-    { ABS, ins_cimmu, ext_cimmu, 0, {{ 6, 14}}, UDEC,		/* CPOS6b */
-      "a 6-bit bit pos (0-63)" },
-    { ABS, ins_cimmu, ext_cimmu, 0, {{ 6, 31}}, UDEC,		/* CPOS6c */
-      "a 6-bit bit pos (0-63)" },
-    { ABS, ins_imms,  ext_imms,  0, {{ 1, 36}}, SDEC,		/* IMM1 */
-      "a 1-bit integer (-1, 0)" },
-    { ABS, ins_immu,  ext_immu,  0, {{ 2, 13}}, UDEC,		/* IMMU2 */
-      "a 2-bit unsigned (0-3)" },
-    { ABS, ins_immu5b,  ext_immu5b,  0, {{ 5, 14}}, UDEC,	/* IMMU5b */
-      "a 5-bit unsigned (32 + (0-31))" },
-    { ABS, ins_immu,  ext_immu,  0, {{ 7, 13}}, 0,		/* IMMU7a */
-      "a 7-bit unsigned (0-127)" },
-    { ABS, ins_immu,  ext_immu,  0, {{ 7, 20}}, 0,		/* IMMU7b */
-      "a 7-bit unsigned (0-127)" },
-    { ABS, ins_immu,  ext_immu,  0, {{ 7, 13}}, UDEC,		/* SOF */
-      "a frame size (register count)" },
-    { ABS, ins_immu,  ext_immu,  0, {{ 7, 20}}, UDEC,		/* SOL */
-      "a local register count" },
-    { ABS, ins_immus8,ext_immus8,0, {{ 4, 27}}, UDEC,		/* SOR */
-      "a rotating register count (integer multiple of 8)" },
-    { ABS, ins_imms,  ext_imms,  0,				/* IMM8 */
-      {{ 7, 13}, { 1, 36}}, SDEC,
-      "an 8-bit integer (-128-127)" },
-    { ABS, ins_immsu4,  ext_imms,  0,				/* IMM8U4 */
-      {{ 7, 13}, { 1, 36}}, SDEC,
-      "an 8-bit signed integer for 32-bit unsigned compare (-128-127)" },
-    { ABS, ins_immsm1,  ext_immsm1,  0,				/* IMM8M1 */
-      {{ 7, 13}, { 1, 36}}, SDEC,
-      "an 8-bit integer (-127-128)" },
-    { ABS, ins_immsm1u4,  ext_immsm1,  0,			/* IMM8M1U4 */
-      {{ 7, 13}, { 1, 36}}, SDEC,
-      "an 8-bit integer for 32-bit unsigned compare (-127-(-1),1-128,0x100000000)" },
-    { ABS, ins_immsm1,  ext_immsm1,  0,				/* IMM8M1U8 */
-      {{ 7, 13}, { 1, 36}}, SDEC,
-      "an 8-bit integer for 64-bit unsigned compare (-127-(-1),1-128,0x10000000000000000)" },
-    { ABS, ins_immu,  ext_immu,  0, {{ 2, 33}, { 7, 20}}, 0,	/* IMMU9 */
-      "a 9-bit unsigned (0-511)" },
-    { ABS, ins_imms,  ext_imms,  0,				/* IMM9a */
-      {{ 7,  6}, { 1, 27}, { 1, 36}}, SDEC,
-      "a 9-bit integer (-256-255)" },
-    { ABS, ins_imms,  ext_imms, 0,				/* IMM9b */
-      {{ 7, 13}, { 1, 27}, { 1, 36}}, SDEC,
-      "a 9-bit integer (-256-255)" },
-    { ABS, ins_imms,  ext_imms, 0,				/* IMM14 */
-      {{ 7, 13}, { 6, 27}, { 1, 36}}, SDEC,
-      "a 14-bit integer (-8192-8191)" },
-    { ABS, ins_imms1, ext_imms1, 0,				/* IMM17 */
-      {{ 7,  6}, { 8, 24}, { 1, 36}}, 0,
-      "a 17-bit integer (-65536-65535)" },
-    { ABS, ins_immu,  ext_immu,  0, {{20,  6}, { 1, 36}}, 0,	/* IMMU21 */
-      "a 21-bit unsigned" },
-    { ABS, ins_imms,  ext_imms,  0,				/* IMM22 */
-      {{ 7, 13}, { 9, 27}, { 5, 22}, { 1, 36}}, SDEC,
-      "a 22-bit signed integer" },
-    { ABS, ins_immu,  ext_immu,  0,				/* IMMU24 */
-      {{21,  6}, { 2, 31}, { 1, 36}}, 0,
-      "a 24-bit unsigned" },
-    { ABS, ins_imms16,ext_imms16,0, {{27,  6}, { 1, 36}}, 0,	/* IMM44 */
-      "a 44-bit unsigned (least 16 bits ignored/zeroes)" },
-    { ABS, ins_rsvd,  ext_rsvd,	0, {{0,  0}}, 0,		/* IMMU62 */
-      "a 62-bit unsigned" },
-    { ABS, ins_rsvd,  ext_rsvd,	0, {{0,  0}}, 0,		/* IMMU64 */
-      "a 64-bit unsigned" },
-    { ABS, ins_inc3,  ext_inc3,  0, {{ 3, 13}}, SDEC,		/* INC3 */
-      "an increment (+/- 1, 4, 8, or 16)" },
-    { ABS, ins_cnt,   ext_cnt,   0, {{ 4, 27}}, UDEC,		/* LEN4 */
-      "a 4-bit length (1-16)" },
-    { ABS, ins_cnt,   ext_cnt,   0, {{ 6, 27}}, UDEC,		/* LEN6 */
-      "a 6-bit length (1-64)" },
-    { ABS, ins_immu,  ext_immu,  0, {{ 4, 20}},	0,		/* MBTYPE4 */
-      "a mix type (@rev, @mix, @shuf, @alt, or @brcst)" },
-    { ABS, ins_immu,  ext_immu,  0, {{ 8, 20}},	0,		/* MBTYPE8 */
-      "an 8-bit mix type" },
-    { ABS, ins_immu,  ext_immu,  0, {{ 6, 14}}, UDEC,		/* POS6 */
-      "a 6-bit bit pos (0-63)" },
-    { REL, ins_imms4, ext_imms4, 0, {{ 7,  6}, { 2, 33}}, 0,	/* TAG13 */
-      "a branch tag" },
-    { REL, ins_imms4, ext_imms4, 0, {{ 9, 24}}, 0,		/* TAG13b */
-      "a branch tag" },
-    { REL, ins_imms4, ext_imms4, 0, {{20,  6}, { 1, 36}}, 0,	/* TGT25 */
-      "a branch target" },
-    { REL, ins_imms4, ext_imms4, 0,				/* TGT25b */
-      {{ 7,  6}, {13, 20}, { 1, 36}}, 0,
-      "a branch target" },
-    { REL, ins_imms4, ext_imms4, 0, {{20, 13}, { 1, 36}}, 0,	/* TGT25c */
-      "a branch target" },
-    { REL, ins_rsvd, ext_rsvd, 0, {{0, 0}}, 0,                  /* TGT64  */
-      "a branch target" },
-
-    { ABS, ins_const, ext_const, 0, {{0, 0}}, 0,		/* LDXMOV */
-      "ldxmov target" },
-  };
diff -r a1bd69b08e9e -r 485e6db28b93 tools/debugger/xenitp/dis-asm.h
--- a/tools/debugger/xenitp/dis-asm.h	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,548 +0,0 @@
-/* Interface between the opcode library and its callers.
-
-   Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005
-   Free Software Foundation, Inc.
-
-   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, 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., 51 Franklin Street - Fifth Floor,
-   Boston, MA 02110-1301, USA.
-
-   Written by Cygnus Support, 1993.
-
-   The opcode library (libopcodes.a) provides instruction decoders for
-   a large variety of instruction sets, callable with an identical
-   interface, for making instruction-processing programs more independent
-   of the instruction set being processed.  */
-
-#ifndef DIS_ASM_H
-#define DIS_ASM_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <inttypes.h>
-
-#define PARAMS(x) x
-typedef void *PTR;
-typedef uint64_t bfd_vma;
-typedef int64_t bfd_signed_vma;
-typedef uint8_t bfd_byte;
-typedef int bfd_boolean;
-#define BFD_HOST_U_64_BIT unsigned long
-#define BFD_HOST_64_BIT long
-#define sprintf_vma(s,x) sprintf (s, "%0" PRIx64, x)
-
-extern unsigned long bfd_getl64 (const bfd_byte *addr);
-
-#define BFD64
-#define ATTRIBUTE_FPTR_PRINTF_2
-#define ATTRIBUTE_UNUSED __attribute__((unused))
-
-enum bfd_flavour {
-  bfd_target_unknown_flavour,
-  bfd_target_aout_flavour,
-  bfd_target_coff_flavour,
-  bfd_target_ecoff_flavour,
-  bfd_target_elf_flavour,
-  bfd_target_ieee_flavour,
-  bfd_target_nlm_flavour,
-  bfd_target_oasys_flavour,
-  bfd_target_tekhex_flavour,
-  bfd_target_srec_flavour,
-  bfd_target_ihex_flavour,
-  bfd_target_som_flavour,
-  bfd_target_os9k_flavour,
-  bfd_target_versados_flavour,
-  bfd_target_msdos_flavour,
-  bfd_target_evax_flavour
-};
-
-enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN };
-
-enum bfd_architecture 
-{
-  bfd_arch_unknown,    /* File arch not known */
-  bfd_arch_obscure,    /* Arch known, not one of these */
-  bfd_arch_m68k,       /* Motorola 68xxx */
-#define bfd_mach_m68000 1
-#define bfd_mach_m68008 2
-#define bfd_mach_m68010 3
-#define bfd_mach_m68020 4
-#define bfd_mach_m68030 5
-#define bfd_mach_m68040 6
-#define bfd_mach_m68060 7
-#define bfd_mach_cpu32  8
-#define bfd_mach_mcf5200  9
-#define bfd_mach_mcf5206e 10
-#define bfd_mach_mcf5307  11
-#define bfd_mach_mcf5407  12
-#define bfd_mach_mcf528x  13
-#define bfd_mach_mcfv4e   14
-#define bfd_mach_mcf521x   15
-#define bfd_mach_mcf5249   16
-#define bfd_mach_mcf547x   17
-#define bfd_mach_mcf548x   18
-  bfd_arch_vax,        /* DEC Vax */   
-  bfd_arch_i960,       /* Intel 960 */
-     /* The order of the following is important.
-       lower number indicates a machine type that 
-       only accepts a subset of the instructions
-       available to machines with higher numbers.
-       The exception is the "ca", which is
-       incompatible with all other machines except 
-       "core". */
-
-#define bfd_mach_i960_core      1
-#define bfd_mach_i960_ka_sa     2
-#define bfd_mach_i960_kb_sb     3
-#define bfd_mach_i960_mc        4
-#define bfd_mach_i960_xa        5
-#define bfd_mach_i960_ca        6
-#define bfd_mach_i960_jx        7
-#define bfd_mach_i960_hx        8
-
-  bfd_arch_a29k,       /* AMD 29000 */
-  bfd_arch_sparc,      /* SPARC */
-#define bfd_mach_sparc                 1
-/* The difference between v8plus and v9 is that v9 is a true 64 bit env.  */
-#define bfd_mach_sparc_sparclet        2
-#define bfd_mach_sparc_sparclite       3
-#define bfd_mach_sparc_v8plus          4
-#define bfd_mach_sparc_v8plusa         5 /* with ultrasparc add'ns.  */
-#define bfd_mach_sparc_sparclite_le    6
-#define bfd_mach_sparc_v9              7
-#define bfd_mach_sparc_v9a             8 /* with ultrasparc add'ns.  */
-#define bfd_mach_sparc_v8plusb         9 /* with cheetah add'ns.  */
-#define bfd_mach_sparc_v9b             10 /* with cheetah add'ns.  */
-/* Nonzero if MACH has the v9 instruction set.  */
-#define bfd_mach_sparc_v9_p(mach) \
-  ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \
-   && (mach) != bfd_mach_sparc_sparclite_le)
-  bfd_arch_mips,       /* MIPS Rxxxx */
-#define bfd_mach_mips3000              3000
-#define bfd_mach_mips3900              3900
-#define bfd_mach_mips4000              4000
-#define bfd_mach_mips4010              4010
-#define bfd_mach_mips4100              4100
-#define bfd_mach_mips4300              4300
-#define bfd_mach_mips4400              4400
-#define bfd_mach_mips4600              4600
-#define bfd_mach_mips4650              4650
-#define bfd_mach_mips5000              5000
-#define bfd_mach_mips6000              6000
-#define bfd_mach_mips8000              8000
-#define bfd_mach_mips10000             10000
-#define bfd_mach_mips16                16
-  bfd_arch_i386,       /* Intel 386 */
-#define bfd_mach_i386_i386 0
-#define bfd_mach_i386_i8086 1
-#define bfd_mach_i386_i386_intel_syntax 2
-#define bfd_mach_x86_64 3
-#define bfd_mach_x86_64_intel_syntax 4
-  bfd_arch_we32k,      /* AT&T WE32xxx */
-  bfd_arch_tahoe,      /* CCI/Harris Tahoe */
-  bfd_arch_i860,       /* Intel 860 */
-  bfd_arch_romp,       /* IBM ROMP PC/RT */
-  bfd_arch_alliant,    /* Alliant */
-  bfd_arch_convex,     /* Convex */
-  bfd_arch_m88k,       /* Motorola 88xxx */
-  bfd_arch_pyramid,    /* Pyramid Technology */
-  bfd_arch_h8300,      /* Hitachi H8/300 */
-#define bfd_mach_h8300   1
-#define bfd_mach_h8300h  2
-#define bfd_mach_h8300s  3
-  bfd_arch_powerpc,    /* PowerPC */
-#define bfd_mach_ppc           0
-#define bfd_mach_ppc64         1
-#define bfd_mach_ppc_403       403
-#define bfd_mach_ppc_403gc     4030
-#define bfd_mach_ppc_505       505
-#define bfd_mach_ppc_601       601
-#define bfd_mach_ppc_602       602
-#define bfd_mach_ppc_603       603
-#define bfd_mach_ppc_ec603e    6031
-#define bfd_mach_ppc_604       604
-#define bfd_mach_ppc_620       620
-#define bfd_mach_ppc_630       630
-#define bfd_mach_ppc_750       750
-#define bfd_mach_ppc_860       860
-#define bfd_mach_ppc_a35       35
-#define bfd_mach_ppc_rs64ii    642
-#define bfd_mach_ppc_rs64iii   643
-#define bfd_mach_ppc_7400      7400
-  bfd_arch_rs6000,     /* IBM RS/6000 */
-  bfd_arch_hppa,       /* HP PA RISC */
-  bfd_arch_d10v,       /* Mitsubishi D10V */
-  bfd_arch_z8k,        /* Zilog Z8000 */
-#define bfd_mach_z8001         1
-#define bfd_mach_z8002         2
-  bfd_arch_h8500,      /* Hitachi H8/500 */
-  bfd_arch_sh,         /* Hitachi SH */
-#define bfd_mach_sh            1
-#define bfd_mach_sh2        0x20
-#define bfd_mach_sh_dsp     0x2d
-#define bfd_mach_sh2a       0x2a
-#define bfd_mach_sh2a_nofpu 0x2b
-#define bfd_mach_sh2e       0x2e
-#define bfd_mach_sh3        0x30
-#define bfd_mach_sh3_nommu  0x31
-#define bfd_mach_sh3_dsp    0x3d
-#define bfd_mach_sh3e       0x3e
-#define bfd_mach_sh4        0x40
-#define bfd_mach_sh4_nofpu  0x41
-#define bfd_mach_sh4_nommu_nofpu  0x42
-#define bfd_mach_sh4a       0x4a
-#define bfd_mach_sh4a_nofpu 0x4b
-#define bfd_mach_sh4al_dsp  0x4d
-#define bfd_mach_sh5        0x50
-  bfd_arch_alpha,      /* Dec Alpha */
-#define bfd_mach_alpha 1
-  bfd_arch_arm,        /* Advanced Risc Machines ARM */
-#define bfd_mach_arm_2         1
-#define bfd_mach_arm_2a                2
-#define bfd_mach_arm_3         3
-#define bfd_mach_arm_3M        4
-#define bfd_mach_arm_4                 5
-#define bfd_mach_arm_4T        6
-  bfd_arch_ns32k,      /* National Semiconductors ns32000 */
-  bfd_arch_w65,        /* WDC 65816 */
-  bfd_arch_tic30,      /* Texas Instruments TMS320C30 */
-  bfd_arch_v850,       /* NEC V850 */
-#define bfd_mach_v850          0
-  bfd_arch_arc,        /* Argonaut RISC Core */
-#define bfd_mach_arc_base 0
-  bfd_arch_m32r,       /* Mitsubishi M32R/D */
-#define bfd_mach_m32r          0  /* backwards compatibility */
-  bfd_arch_mn10200,    /* Matsushita MN10200 */
-  bfd_arch_mn10300,    /* Matsushita MN10300 */
-  bfd_arch_last
-  };
-
-typedef struct symbol_cache_entry
-{
-    const char *name;
-    union
-    {
-        PTR p;
-        bfd_vma i;
-    } udata;
-} asymbol;
-
-typedef int (*fprintf_ftype) (void *, const char*, ...) ATTRIBUTE_FPTR_PRINTF_2;
-
-enum dis_insn_type {
-  dis_noninsn,			/* Not a valid instruction */
-  dis_nonbranch,		/* Not a branch instruction */
-  dis_branch,			/* Unconditional branch */
-  dis_condbranch,		/* Conditional branch */
-  dis_jsr,			/* Jump to subroutine */
-  dis_condjsr,			/* Conditional jump to subroutine */
-  dis_dref,			/* Data reference instruction */
-  dis_dref2			/* Two data references in instruction */
-};
-
-/* This struct is passed into the instruction decoding routine,
-   and is passed back out into each callback.  The various fields are used
-   for conveying information from your main routine into your callbacks,
-   for passing information into the instruction decoders (such as the
-   addresses of the callback functions), or for passing information
-   back from the instruction decoders to their callers.
-
-   It must be initialized before it is first passed; this can be done
-   by hand, or using one of the initialization macros below.  */
-
-typedef struct disassemble_info {
-  fprintf_ftype fprintf_func;
-  void *stream;
-  void *application_data;
-
-  /* Target description.  We could replace this with a pointer to the bfd,
-     but that would require one.  There currently isn't any such requirement
-     so to avoid introducing one we record these explicitly.  */
-  /* The bfd_flavour.  This can be bfd_target_unknown_flavour.  */
-  enum bfd_flavour flavour;
-  /* The bfd_arch value.  */
-  enum bfd_architecture arch;
-  /* The bfd_mach value.  */
-  unsigned long mach;
-  /* Endianness (for bi-endian cpus).  Mono-endian cpus can ignore this.  */
-  enum bfd_endian endian;
-  /* An arch/mach-specific bitmask of selected instruction subsets, mainly
-     for processors with run-time-switchable instruction sets.  The default,
-     zero, means that there is no constraint.  CGEN-based opcodes ports
-     may use ISA_foo masks.  */
-  void *insn_sets;
-
-  /* Some targets need information about the current section to accurately
-     display insns.  If this is NULL, the target disassembler function
-     will have to make its best guess.  */
-  //asection *section;
-
-  /* An array of pointers to symbols either at the location being disassembled
-     or at the start of the function being disassembled.  The array is sorted
-     so that the first symbol is intended to be the one used.  The others are
-     present for any misc. purposes.  This is not set reliably, but if it is
-     not NULL, it is correct.  */
-  asymbol **symbols;
-  /* Number of symbols in array.  */
-  int num_symbols;
-
-  /* For use by the disassembler.
-     The top 16 bits are reserved for public use (and are documented here).
-     The bottom 16 bits are for the internal use of the disassembler.  */
-  unsigned long flags;
-#define INSN_HAS_RELOC	0x80000000
-  void *private_data;
-
-  /* Function used to get bytes to disassemble.  MEMADDR is the
-     address of the stuff to be disassembled, MYADDR is the address to
-     put the bytes in, and LENGTH is the number of bytes to read.
-     INFO is a pointer to this struct.
-     Returns an errno value or 0 for success.  */
-  int (*read_memory_func)
-    (bfd_vma memaddr, bfd_byte *myaddr, unsigned int length,
-     struct disassemble_info *info);
-
-  /* Function which should be called if we get an error that we can't
-     recover from.  STATUS is the errno value from read_memory_func and
-     MEMADDR is the address that we were trying to read.  INFO is a
-     pointer to this struct.  */
-  void (*memory_error_func)
-    (int status, bfd_vma memaddr, struct disassemble_info *info);
-
-  /* Function called to print ADDR.  */
-  void (*print_address_func)
-    (bfd_vma addr, struct disassemble_info *info);
-
-  /* Function called to determine if there is a symbol at the given ADDR.
-     If there is, the function returns 1, otherwise it returns 0.
-     This is used by ports which support an overlay manager where
-     the overlay number is held in the top part of an address.  In
-     some circumstances we want to include the overlay number in the
-     address, (normally because there is a symbol associated with
-     that address), but sometimes we want to mask out the overlay bits.  */
-  int (* symbol_at_address_func)
-    (bfd_vma addr, struct disassemble_info * info);
-
-  /* Function called to check if a SYMBOL is can be displayed to the user.
-     This is used by some ports that want to hide special symbols when
-     displaying debugging outout.  */
-  bfd_boolean (* symbol_is_valid)
-    (asymbol *, struct disassemble_info * info);
-
-  /* These are for buffer_read_memory.  */
-  bfd_byte *buffer;
-  bfd_vma buffer_vma;
-  unsigned int buffer_length;
-
-  /* This variable may be set by the instruction decoder.  It suggests
-      the number of bytes objdump should display on a single line.  If
-      the instruction decoder sets this, it should always set it to
-      the same value in order to get reasonable looking output.  */
-  int bytes_per_line;
-
-  /* The next two variables control the way objdump displays the raw data.  */
-  /* For example, if bytes_per_line is 8 and bytes_per_chunk is 4, the */
-  /* output will look like this:
-     00:   00000000 00000000
-     with the chunks displayed according to "display_endian". */
-  int bytes_per_chunk;
-  enum bfd_endian display_endian;
-
-  /* Number of octets per incremented target address
-     Normally one, but some DSPs have byte sizes of 16 or 32 bits.  */
-  unsigned int octets_per_byte;
-
-  /* The number of zeroes we want to see at the end of a section before we
-     start skipping them.  */
-  unsigned int skip_zeroes;
-
-  /* The number of zeroes to skip at the end of a section.  If the number
-     of zeroes at the end is between SKIP_ZEROES_AT_END and SKIP_ZEROES,
-     they will be disassembled.  If there are fewer than
-     SKIP_ZEROES_AT_END, they will be skipped.  This is a heuristic
-     attempt to avoid disassembling zeroes inserted by section
-     alignment.  */
-  unsigned int skip_zeroes_at_end;
-
-  /* Whether the disassembler always needs the relocations.  */
-  bfd_boolean disassembler_needs_relocs;
-
-  /* Results from instruction decoders.  Not all decoders yet support
-     this information.  This info is set each time an instruction is
-     decoded, and is only valid for the last such instruction.
-
-     To determine whether this decoder supports this information, set
-     insn_info_valid to 0, decode an instruction, then check it.  */
-
-  char insn_info_valid;		/* Branch info has been set. */
-  char branch_delay_insns;	/* How many sequential insn's will run before
-				   a branch takes effect.  (0 = normal) */
-  char data_size;		/* Size of data reference in insn, in bytes */
-  enum dis_insn_type insn_type;	/* Type of instruction */
-  bfd_vma target;		/* Target address of branch or dref, if known;
-				   zero if unknown.  */
-  bfd_vma target2;		/* Second target address for dref2 */
-
-  /* Command line options specific to the target disassembler.  */
-  char * disassembler_options;
-
-} disassemble_info;
-
-
-/* Standard disassemblers.  Disassemble one instruction at the given
-   target address.  Return number of octets processed.  */
-typedef int (*disassembler_ftype) (bfd_vma, disassemble_info *);
-
-extern int print_insn_big_mips		(bfd_vma, disassemble_info *);
-extern int print_insn_little_mips	(bfd_vma, disassemble_info *);
-extern int print_insn_i386		(bfd_vma, disassemble_info *);
-extern int print_insn_i386_att		(bfd_vma, disassemble_info *);
-extern int print_insn_i386_intel	(bfd_vma, disassemble_info *);
-extern int print_insn_ia64		(bfd_vma, disassemble_info *);
-extern int print_insn_i370		(bfd_vma, disassemble_info *);
-extern int print_insn_m68hc11		(bfd_vma, disassemble_info *);
-extern int print_insn_m68hc12		(bfd_vma, disassemble_info *);
-extern int print_insn_m68k		(bfd_vma, disassemble_info *);
-extern int print_insn_z80		(bfd_vma, disassemble_info *);
-extern int print_insn_z8001		(bfd_vma, disassemble_info *);
-extern int print_insn_z8002		(bfd_vma, disassemble_info *);
-extern int print_insn_h8300		(bfd_vma, disassemble_info *);
-extern int print_insn_h8300h		(bfd_vma, disassemble_info *);
-extern int print_insn_h8300s		(bfd_vma, disassemble_info *);
-extern int print_insn_h8500		(bfd_vma, disassemble_info *);
-extern int print_insn_alpha		(bfd_vma, disassemble_info *);
-extern int print_insn_big_arm		(bfd_vma, disassemble_info *);
-extern int print_insn_little_arm	(bfd_vma, disassemble_info *);
-extern int print_insn_sparc		(bfd_vma, disassemble_info *);
-extern int print_insn_avr		(bfd_vma, disassemble_info *);
-extern int print_insn_bfin		(bfd_vma, disassemble_info *);
-extern int print_insn_d10v		(bfd_vma, disassemble_info *);
-extern int print_insn_d30v		(bfd_vma, disassemble_info *);
-extern int print_insn_dlx 		(bfd_vma, disassemble_info *);
-extern int print_insn_fr30		(bfd_vma, disassemble_info *);
-extern int print_insn_hppa		(bfd_vma, disassemble_info *);
-extern int print_insn_i860		(bfd_vma, disassemble_info *);
-extern int print_insn_i960		(bfd_vma, disassemble_info *);
-extern int print_insn_ip2k		(bfd_vma, disassemble_info *);
-extern int print_insn_m32r		(bfd_vma, disassemble_info *);
-extern int print_insn_m88k		(bfd_vma, disassemble_info *);
-extern int print_insn_maxq_little	(bfd_vma, disassemble_info *);
-extern int print_insn_maxq_big		(bfd_vma, disassemble_info *);
-extern int print_insn_mcore		(bfd_vma, disassemble_info *);
-extern int print_insn_mmix		(bfd_vma, disassemble_info *);
-extern int print_insn_mn10200		(bfd_vma, disassemble_info *);
-extern int print_insn_mn10300		(bfd_vma, disassemble_info *);
-extern int print_insn_mt                (bfd_vma, disassemble_info *);
-extern int print_insn_msp430		(bfd_vma, disassemble_info *);
-extern int print_insn_ns32k		(bfd_vma, disassemble_info *);
-extern int print_insn_crx               (bfd_vma, disassemble_info *);
-extern int print_insn_openrisc		(bfd_vma, disassemble_info *);
-extern int print_insn_big_or32		(bfd_vma, disassemble_info *);
-extern int print_insn_little_or32	(bfd_vma, disassemble_info *);
-extern int print_insn_pdp11		(bfd_vma, disassemble_info *);
-extern int print_insn_pj		(bfd_vma, disassemble_info *);
-extern int print_insn_big_powerpc	(bfd_vma, disassemble_info *);
-extern int print_insn_little_powerpc	(bfd_vma, disassemble_info *);
-extern int print_insn_rs6000		(bfd_vma, disassemble_info *);
-extern int print_insn_s390		(bfd_vma, disassemble_info *);
-extern int print_insn_sh		(bfd_vma, disassemble_info *);
-extern int print_insn_tic30		(bfd_vma, disassemble_info *);
-extern int print_insn_tic4x		(bfd_vma, disassemble_info *);
-extern int print_insn_tic54x		(bfd_vma, disassemble_info *);
-extern int print_insn_tic80		(bfd_vma, disassemble_info *);
-extern int print_insn_v850		(bfd_vma, disassemble_info *);
-extern int print_insn_vax		(bfd_vma, disassemble_info *);
-extern int print_insn_w65		(bfd_vma, disassemble_info *);
-extern int print_insn_xstormy16		(bfd_vma, disassemble_info *);
-extern int print_insn_xtensa		(bfd_vma, disassemble_info *);
-extern int print_insn_sh64		(bfd_vma, disassemble_info *);
-extern int print_insn_sh64x_media	(bfd_vma, disassemble_info *);
-extern int print_insn_frv		(bfd_vma, disassemble_info *);
-extern int print_insn_iq2000		(bfd_vma, disassemble_info *);
-extern int print_insn_xc16x		(bfd_vma, disassemble_info *);
-extern int print_insn_m32c	(bfd_vma, disassemble_info *);
-
-extern disassembler_ftype arc_get_disassembler (void *);
-//extern disassembler_ftype cris_get_disassembler (bfd *);
-
-extern void print_mips_disassembler_options (FILE *);
-extern void print_ppc_disassembler_options (FILE *);
-extern void print_arm_disassembler_options (FILE *);
-extern void parse_arm_disassembler_option (char *);
-extern int get_arm_regname_num_options (void);
-extern int set_arm_regname_option (int);
-extern int get_arm_regnames (int, const char **, const char **, const char *const **);
-extern bfd_boolean arm_symbol_is_valid (asymbol *, struct disassemble_info *);
-
-/* Fetch the disassembler for a given BFD, if that support is available.  */
-//extern disassembler_ftype disassembler (bfd *);
-
-/* Amend the disassemble_info structure as necessary for the target architecture.
-   Should only be called after initialising the info->arch field.  */
-extern void disassemble_init_for_target (struct disassemble_info * info);
-
-/* Document any target specific options available from the disassembler.  */
-extern void disassembler_usage (FILE *);
-
-
-/* This block of definitions is for particular callers who read instructions
-   into a buffer before calling the instruction decoder.  */
-
-/* Here is a function which callers may wish to use for read_memory_func.
-   It gets bytes from a buffer.  */
-extern int buffer_read_memory
-  (bfd_vma, bfd_byte *, unsigned int, struct disassemble_info *);
-
-/* This function goes with buffer_read_memory.
-   It prints a message using info->fprintf_func and info->stream.  */
-extern void perror_memory (int, bfd_vma, struct disassemble_info *);
-
-
-/* Just print the address in hex.  This is included for completeness even
-   though both GDB and objdump provide their own (to print symbolic
-   addresses).  */
-extern void generic_print_address
-  (bfd_vma, struct disassemble_info *);
-
-/* Always true.  */
-extern int generic_symbol_at_address
-  (bfd_vma, struct disassemble_info *);
-
-/* Also always true.  */
-extern bfd_boolean generic_symbol_is_valid
-  (asymbol *, struct disassemble_info *);
-
-/* Method to initialize a disassemble_info struct.  This should be
-   called by all applications creating such a struct.  */
-extern void init_disassemble_info (struct disassemble_info *info, void *stream,
-				   fprintf_ftype fprintf_func);
-
-/* For compatibility with existing code.  */
-#define INIT_DISASSEMBLE_INFO(INFO, STREAM, FPRINTF_FUNC) \
-  init_disassemble_info (&(INFO), (STREAM), (fprintf_ftype) (FPRINTF_FUNC))
-#define INIT_DISASSEMBLE_INFO_NO_ARCH(INFO, STREAM, FPRINTF_FUNC) \
-  init_disassemble_info (&(INFO), (STREAM), (fprintf_ftype) (FPRINTF_FUNC))
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* ! defined (DIS_ASM_H) */
diff -r a1bd69b08e9e -r 485e6db28b93 tools/debugger/xenitp/ia64-asmtab.c
--- a/tools/debugger/xenitp/ia64-asmtab.c	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8774 +0,0 @@
-/* This file is automatically generated by ia64-gen.  Do not edit!  */
-static const char * const ia64_strings[] = {
-  "", "0", "1", "a", "acq", "add", "addl", "addp4", "adds", "alloc", "and",
-  "andcm", "b", "bias", "br", "break", "brl", "brp", "bsw", "c", "call",
-  "cexit", "chk", "cloop", "clr", "clrrrb", "cmp", "cmp4", "cmp8xchg16",
-  "cmpxchg1", "cmpxchg2", "cmpxchg4", "cmpxchg8", "cond", "cover", "ctop",
-  "czx1", "czx2", "d", "dep", "dpnt", "dptk", "e", "epc", "eq", "excl",
-  "exit", "exp", "extr", "f", "fabs", "fadd", "famax", "famin", "fand",
-  "fandcm", "fault", "fc", "fchkf", "fclass", "fclrf", "fcmp", "fcvt",
-  "fetchadd4", "fetchadd8", "few", "fill", "flushrs", "fma", "fmax",
-  "fmerge", "fmin", "fmix", "fmpy", "fms", "fneg", "fnegabs", "fnma",
-  "fnmpy", "fnorm", "for", "fpabs", "fpack", "fpamax", "fpamin", "fpcmp",
-  "fpcvt", "fpma", "fpmax", "fpmerge", "fpmin", "fpmpy", "fpms", "fpneg",
-  "fpnegabs", "fpnma", "fpnmpy", "fprcpa", "fprsqrta", "frcpa", "frsqrta",
-  "fselect", "fsetc", "fsub", "fswap", "fsxt", "fwb", "fx", "fxor", "fxu",
-  "g", "ga", "ge", "getf", "geu", "gt", "gtu", "h", "hint", "hu", "i", "ia",
-  "imp", "invala", "itc", "itr", "l", "ld1", "ld16", "ld2", "ld4", "ld8",
-  "ldf", "ldf8", "ldfd", "ldfe", "ldfp8", "ldfpd", "ldfps", "ldfs", "le",
-  "leu", "lfetch", "loadrs", "loop", "lr", "lt", "ltu", "lu", "m", "many",
-  "mf", "mix1", "mix2", "mix4", "mov", "movl", "mux1", "mux2", "nc", "ne",
-  "neq", "nge", "ngt", "nl", "nle", "nlt", "nm", "nop", "nr", "ns", "nt1",
-  "nt2", "nta", "nz", "or", "orcm", "ord", "pack2", "pack4", "padd1",
-  "padd2", "padd4", "pavg1", "pavg2", "pavgsub1", "pavgsub2", "pcmp1",
-  "pcmp2", "pcmp4", "pmax1", "pmax2", "pmin1", "pmin2", "pmpy2", "pmpyshr2",
-  "popcnt", "pr", "probe", "psad1", "pshl2", "pshl4", "pshladd2", "pshr2",
-  "pshr4", "pshradd2", "psub1", "psub2", "psub4", "ptc", "ptr", "r", "raz",
-  "rel", "ret", "rfi", "rsm", "rum", "rw", "s", "s0", "s1", "s2", "s3",
-  "sa", "se", "setf", "shl", "shladd", "shladdp4", "shr", "shrp", "sig",
-  "spill", "spnt", "sptk", "srlz", "ssm", "sss", "st1", "st16", "st2",
-  "st4", "st8", "stf", "stf8", "stfd", "stfe", "stfs", "sub", "sum", "sxt1",
-  "sxt2", "sxt4", "sync", "tak", "tbit", "tf", "thash", "tnat", "tpa",
-  "trunc", "ttag", "u", "unc", "unord", "unpack1", "unpack2", "unpack4",
-  "uss", "uus", "uuu", "vmsw", "w", "wexit", "wtop", "x", "xchg1", "xchg2",
-  "xchg4", "xchg8", "xf", "xma", "xmpy", "xor", "xuf", "z", "zxt1", "zxt2",
-  "zxt4",
-};
-
-static const struct ia64_dependency
-dependencies[] = {
-  { "ALAT", 0, 0, 0, -1, NULL, },
-  { "AR[BSP]", 26, 0, 2, 17, NULL, },
-  { "AR[BSPSTORE]", 26, 0, 2, 18, NULL, },
-  { "AR[CCV]", 26, 0, 2, 32, NULL, },
-  { "AR[CFLG]", 26, 0, 2, 27, NULL, },
-  { "AR[CSD]", 26, 0, 2, 25, NULL, },
-  { "AR[EC]", 26, 0, 2, 66, NULL, },
-  { "AR[EFLAG]", 26, 0, 2, 24, NULL, },
-  { "AR[FCR]", 26, 0, 2, 21, NULL, },
-  { "AR[FDR]", 26, 0, 2, 30, NULL, },
-  { "AR[FIR]", 26, 0, 2, 29, NULL, },
-  { "AR[FPSR].sf0.controls", 30, 0, 2, -1, NULL, },
-  { "AR[FPSR].sf1.controls", 30, 0, 2, -1, NULL, },
-  { "AR[FPSR].sf2.controls", 30, 0, 2, -1, NULL, },
-  { "AR[FPSR].sf3.controls", 30, 0, 2, -1, NULL, },
-  { "AR[FPSR].sf0.flags", 30, 0, 2, -1, NULL, },
-  { "AR[FPSR].sf1.flags", 30, 0, 2, -1, NULL, },
-  { "AR[FPSR].sf2.flags", 30, 0, 2, -1, NULL, },
-  { "AR[FPSR].sf3.flags", 30, 0, 2, -1, NULL, },
-  { "AR[FPSR].traps", 30, 0, 2, -1, NULL, },
-  { "AR[FPSR].rv", 30, 0, 2, -1, NULL, },
-  { "AR[FSR]", 26, 0, 2, 28, NULL, },
-  { "AR[ITC]", 26, 0, 2, 44, NULL, },
-  { "AR[K%], % in 0 - 7", 1, 0, 2, -1, NULL, },
-  { "AR[LC]", 26, 0, 2, 65, NULL, },
-  { "AR[PFS]", 26, 0, 2, 64, NULL, },
-  { "AR[PFS]", 26, 0, 2, 64, NULL, },
-  { "AR[PFS]", 26, 0, 0, 64, NULL, },
-  { "AR[RNAT]", 26, 0, 2, 19, NULL, },
-  { "AR[RSC]", 26, 0, 2, 16, NULL, },
-  { "AR[SSD]", 26, 0, 2, 26, NULL, },
-  { "AR[UNAT]{%}, % in 0 - 63", 2, 0, 2, -1, NULL, },
-  { "AR%, % in 8-15, 20, 22-23, 31, 33-35, 37-39, 41-43, 45-47, 67-111", 3, 0, 0, -1, NULL, },
-  { "AR%, % in 48-63, 112-127", 4, 0, 2, -1, NULL, },
-  { "BR%, % in 0 - 7", 5, 0, 2, -1, NULL, },
-  { "BR%, % in 0 - 7", 5, 0, 0, -1, NULL, },
-  { "BR%, % in 0 - 7", 5, 0, 2, -1, NULL, },
-  { "CFM", 6, 0, 2, -1, NULL, },
-  { "CFM", 6, 0, 2, -1, NULL, },
-  { "CFM", 6, 0, 2, -1, NULL, },
-  { "CFM", 6, 0, 2, -1, NULL, },
-  { "CFM", 6, 0, 0, -1, NULL, },
-  { "CPUID#", 7, 0, 5, -1, NULL, },
-  { "CR[CMCV]", 27, 0, 3, 74, NULL, },
-  { "CR[DCR]", 27, 0, 3, 0, NULL, },
-  { "CR[EOI]", 27, 0, 7, 67, "SC Section 5.8.3.4, \"End of External Interrupt Register (EOI Ð CR67)\" on page 2:119", },
-  { "CR[GPTA]", 27, 0, 3, 9, NULL, },
-  { "CR[IFA]", 27, 0, 1, 20, NULL, },
-  { "CR[IFA]", 27, 0, 3, 20, NULL, },
-  { "CR[IFS]", 27, 0, 3, 23, NULL, },
-  { "CR[IFS]", 27, 0, 1, 23, NULL, },
-  { "CR[IFS]", 27, 0, 1, 23, NULL, },
-  { "CR[IHA]", 27, 0, 3, 25, NULL, },
-  { "CR[IIM]", 27, 0, 3, 24, NULL, },
-  { "CR[IIP]", 27, 0, 3, 19, NULL, },
-  { "CR[IIP]", 27, 0, 1, 19, NULL, },
-  { "CR[IIPA]", 27, 0, 3, 22, NULL, },
-  { "CR[IPSR]", 27, 0, 3, 16, NULL, },
-  { "CR[IPSR]", 27, 0, 1, 16, NULL, },
-  { "CR[IRR%], % in 0 - 3", 8, 0, 3, -1, NULL, },
-  { "CR[ISR]", 27, 0, 3, 17, NULL, },
-  { "CR[ITIR]", 27, 0, 3, 21, NULL, },
-  { "CR[ITIR]", 27, 0, 1, 21, NULL, },
-  { "CR[ITM]", 27, 0, 3, 1, NULL, },
-  { "CR[ITV]", 27, 0, 3, 72, NULL, },
-  { "CR[IVA]", 27, 0, 4, 2, NULL, },
-  { "CR[IVR]", 27, 0, 7, 65, "SC Section 5.8.3.2, \"External Interrupt Vector Register (IVR Ð CR65)\" on page 2:118", },
-  { "CR[LID]", 27, 0, 7, 64, "SC Section 5.8.3.1, \"Local ID (LID Ð CR64)\" on page 2:117", },
-  { "CR[LRR%], % in 0 - 1", 9, 0, 3, -1, NULL, },
-  { "CR[PMV]", 27, 0, 3, 73, NULL, },
-  { "CR[PTA]", 27, 0, 3, 8, NULL, },
-  { "CR[TPR]", 27, 0, 3, 66, NULL, },
-  { "CR[TPR]", 27, 0, 7, 66, "SC Section 5.8.3.3, \"Task Priority Register (TPR Ð CR66)\" on page 2:119", },
-  { "CR[TPR]", 27, 0, 1, 66, NULL, },
-  { "CR%, % in 3-7, 10-15, 18, 26-63, 75-79, 82-127", 10, 0, 0, -1, NULL, },
-  { "DBR#", 11, 0, 2, -1, NULL, },
-  { "DBR#", 11, 0, 3, -1, NULL, },
-  { "DTC", 0, 0, 3, -1, NULL, },
-  { "DTC", 0, 0, 2, -1, NULL, },
-  { "DTC", 0, 0, 0, -1, NULL, },
-  { "DTC", 0, 0, 2, -1, NULL, },
-  { "DTC_LIMIT*", 0, 0, 2, -1, NULL, },
-  { "DTR", 0, 0, 3, -1, NULL, },
-  { "DTR", 0, 0, 2, -1, NULL, },
-  { "DTR", 0, 0, 3, -1, NULL, },
-  { "DTR", 0, 0, 0, -1, NULL, },
-  { "DTR", 0, 0, 2, -1, NULL, },
-  { "FR%, % in 0 - 1", 12, 0, 0, -1, NULL, },
-  { "FR%, % in 2 - 127", 13, 0, 2, -1, NULL, },
-  { "FR%, % in 2 - 127", 13, 0, 0, -1, NULL, },
-  { "GR0", 14, 0, 0, -1, NULL, },
-  { "GR%, % in 1 - 127", 15, 0, 0, -1, NULL, },
-  { "GR%, % in 1 - 127", 15, 0, 2, -1, NULL, },
-  { "IBR#", 16, 0, 2, -1, NULL, },
-  { "InService*", 17, 0, 3, -1, NULL, },
-  { "InService*", 17, 0, 2, -1, NULL, },
-  { "InService*", 17, 0, 2, -1, NULL, },
-  { "IP", 0, 0, 0, -1, NULL, },
-  { "ITC", 0, 0, 4, -1, NULL, },
-  { "ITC", 0, 0, 2, -1, NULL, },
-  { "ITC", 0, 0, 0, -1, NULL, },
-  { "ITC", 0, 0, 4, -1, NULL, },
-  { "ITC", 0, 0, 2, -1, NULL, },
-  { "ITC_LIMIT*", 0, 0, 2, -1, NULL, },
-  { "ITR", 0, 0, 2, -1, NULL, },
-  { "ITR", 0, 0, 4, -1, NULL, },
-  { "ITR", 0, 0, 2, -1, NULL, },
-  { "ITR", 0, 0, 0, -1, NULL, },
-  { "ITR", 0, 0, 4, -1, NULL, },
-  { "memory", 0, 0, 0, -1, NULL, },
-  { "MSR#", 18, 0, 5, -1, NULL, },
-  { "PKR#", 19, 0, 3, -1, NULL, },
-  { "PKR#", 19, 0, 0, -1, NULL, },
-  { "PKR#", 19, 0, 2, -1, NULL, },
-  { "PKR#", 19, 0, 2, -1, NULL, },
-  { "PMC#", 20, 0, 2, -1, NULL, },
-  { "PMC#", 20, 0, 7, -1, "SC Section 7.2.1, \"Generic Performance Counter Registers\" for PMC[0].fr on page 2:150", },
-  { "PMD#", 21, 0, 2, -1, NULL, },
-  { "PR0", 0, 0, 0, -1, NULL, },
-  { "PR%, % in 1 - 15", 22, 0, 2, -1, NULL, },
-  { "PR%, % in 1 - 15", 22, 0, 2, -1, NULL, },
-  { "PR%, % in 1 - 15", 22, 0, 0, -1, NULL, },
-  { "PR%, % in 16 - 62", 23, 0, 2, -1, NULL, },
-  { "PR%, % in 16 - 62", 23, 0, 2, -1, NULL, },
-  { "PR%, % in 16 - 62", 23, 0, 0, -1, NULL, },
-  { "PR63", 24, 0, 2, -1, NULL, },
-  { "PR63", 24, 0, 2, -1, NULL, },
-  { "PR63", 24, 0, 0, -1, NULL, },
-  { "PSR.ac", 28, 0, 1, 3, NULL, },
-  { "PSR.ac", 28, 0, 3, 3, NULL, },
-  { "PSR.ac", 28, 0, 2, 3, NULL, },
-  { "PSR.ac", 28, 0, 2, 3, NULL, },
-  { "PSR.be", 28, 0, 1, 1, NULL, },
-  { "PSR.be", 28, 0, 3, 1, NULL, },
-  { "PSR.be", 28, 0, 2, 1, NULL, },
-  { "PSR.be", 28, 0, 2, 1, NULL, },
-  { "PSR.bn", 28, 0, 2, 44, NULL, },
-  { "PSR.cpl", 28, 0, 1, 32, NULL, },
-  { "PSR.cpl", 28, 0, 2, 32, NULL, },
-  { "PSR.da", 28, 0, 2, 38, NULL, },
-  { "PSR.db", 28, 0, 3, 24, NULL, },
-  { "PSR.db", 28, 0, 2, 24, NULL, },
-  { "PSR.db", 28, 0, 2, 24, NULL, },
-  { "PSR.dd", 28, 0, 2, 39, NULL, },
-  { "PSR.dfh", 28, 0, 3, 19, NULL, },
-  { "PSR.dfh", 28, 0, 2, 19, NULL, },
-  { "PSR.dfh", 28, 0, 2, 19, NULL, },
-  { "PSR.dfl", 28, 0, 3, 18, NULL, },
-  { "PSR.dfl", 28, 0, 2, 18, NULL, },
-  { "PSR.dfl", 28, 0, 2, 18, NULL, },
-  { "PSR.di", 28, 0, 3, 22, NULL, },
-  { "PSR.di", 28, 0, 2, 22, NULL, },
-  { "PSR.di", 28, 0, 2, 22, NULL, },
-  { "PSR.dt", 28, 0, 3, 17, NULL, },
-  { "PSR.dt", 28, 0, 2, 17, NULL, },
-  { "PSR.dt", 28, 0, 2, 17, NULL, },
-  { "PSR.ed", 28, 0, 2, 43, NULL, },
-  { "PSR.i", 28, 0, 2, 14, NULL, },
-  { "PSR.ia", 28, 0, 0, 14, NULL, },
-  { "PSR.ic", 28, 0, 2, 13, NULL, },
-  { "PSR.ic", 28, 0, 3, 13, NULL, },
-  { "PSR.ic", 28, 0, 2, 13, NULL, },
-  { "PSR.id", 28, 0, 0, 14, NULL, },
-  { "PSR.is", 28, 0, 0, 14, NULL, },
-  { "PSR.it", 28, 0, 2, 14, NULL, },
-  { "PSR.lp", 28, 0, 2, 25, NULL, },
-  { "PSR.lp", 28, 0, 3, 25, NULL, },
-  { "PSR.lp", 28, 0, 2, 25, NULL, },
-  { "PSR.mc", 28, 0, 2, 35, NULL, },
-  { "PSR.mfh", 28, 0, 2, 5, NULL, },
-  { "PSR.mfl", 28, 0, 2, 4, NULL, },
-  { "PSR.pk", 28, 0, 3, 15, NULL, },
-  { "PSR.pk", 28, 0, 2, 15, NULL, },
-  { "PSR.pk", 28, 0, 2, 15, NULL, },
-  { "PSR.pp", 28, 0, 2, 21, NULL, },
-  { "PSR.ri", 28, 0, 0, 41, NULL, },
-  { "PSR.rt", 28, 0, 2, 27, NULL, },
-  { "PSR.rt", 28, 0, 3, 27, NULL, },
-  { "PSR.rt", 28, 0, 2, 27, NULL, },
-  { "PSR.si", 28, 0, 2, 23, NULL, },
-  { "PSR.si", 28, 0, 3, 23, NULL, },
-  { "PSR.si", 28, 0, 2, 23, NULL, },
-  { "PSR.sp", 28, 0, 2, 20, NULL, },
-  { "PSR.sp", 28, 0, 3, 20, NULL, },
-  { "PSR.sp", 28, 0, 2, 20, NULL, },
-  { "PSR.ss", 28, 0, 2, 40, NULL, },
-  { "PSR.tb", 28, 0, 3, 26, NULL, },
-  { "PSR.tb", 28, 0, 2, 26, NULL, },
-  { "PSR.tb", 28, 0, 2, 26, NULL, },
-  { "PSR.up", 28, 0, 2, 2, NULL, },
-  { "PSR.vm", 28, 0, 1, 46, NULL, },
-  { "PSR.vm", 28, 0, 2, 46, NULL, },
-  { "RR#", 25, 0, 3, -1, NULL, },
-  { "RR#", 25, 0, 2, -1, NULL, },
-  { "RSE", 29, 0, 2, -1, NULL, },
-  { "ALAT", 0, 1, 0, -1, NULL, },
-  { "AR[BSP]", 26, 1, 2, 17, NULL, },
-  { "AR[BSPSTORE]", 26, 1, 2, 18, NULL, },
-  { "AR[CCV]", 26, 1, 2, 32, NULL, },
-  { "AR[CFLG]", 26, 1, 2, 27, NULL, },
-  { "AR[CSD]", 26, 1, 2, 25, NULL, },
-  { "AR[EC]", 26, 1, 2, 66, NULL, },
-  { "AR[EFLAG]", 26, 1, 2, 24, NULL, },
-  { "AR[FCR]", 26, 1, 2, 21, NULL, },
-  { "AR[FDR]", 26, 1, 2, 30, NULL, },
-  { "AR[FIR]", 26, 1, 2, 29, NULL, },
-  { "AR[FPSR].sf0.controls", 30, 1, 2, -1, NULL, },
-  { "AR[FPSR].sf1.controls", 30, 1, 2, -1, NULL, },
-  { "AR[FPSR].sf2.controls", 30, 1, 2, -1, NULL, },
-  { "AR[FPSR].sf3.controls", 30, 1, 2, -1, NULL, },
-  { "AR[FPSR].sf0.flags", 30, 1, 0, -1, NULL, },
-  { "AR[FPSR].sf0.flags", 30, 1, 2, -1, NULL, },
-  { "AR[FPSR].sf0.flags", 30, 1, 2, -1, NULL, },
-  { "AR[FPSR].sf1.flags", 30, 1, 0, -1, NULL, },
-  { "AR[FPSR].sf1.flags", 30, 1, 2, -1, NULL, },
-  { "AR[FPSR].sf1.flags", 30, 1, 2, -1, NULL, },
-  { "AR[FPSR].sf2.flags", 30, 1, 0, -1, NULL, },
-  { "AR[FPSR].sf2.flags", 30, 1, 2, -1, NULL, },
-  { "AR[FPSR].sf2.flags", 30, 1, 2, -1, NULL, },
-  { "AR[FPSR].sf3.flags", 30, 1, 0, -1, NULL, },
-  { "AR[FPSR].sf3.flags", 30, 1, 2, -1, NULL, },
-  { "AR[FPSR].sf3.flags", 30, 1, 2, -1, NULL, },
-  { "AR[FPSR].rv", 30, 1, 2, -1, NULL, },
-  { "AR[FPSR].traps", 30, 1, 2, -1, NULL, },
-  { "AR[FSR]", 26, 1, 2, 28, NULL, },
-  { "AR[ITC]", 26, 1, 2, 44, NULL, },
-  { "AR[K%], % in 0 - 7", 1, 1, 2, -1, NULL, },
-  { "AR[LC]", 26, 1, 2, 65, NULL, },
-  { "AR[PFS]", 26, 1, 0, 64, NULL, },
-  { "AR[PFS]", 26, 1, 2, 64, NULL, },
-  { "AR[PFS]", 26, 1, 2, 64, NULL, },
-  { "AR[RNAT]", 26, 1, 2, 19, NULL, },
-  { "AR[RSC]", 26, 1, 2, 16, NULL, },
-  { "AR[SSD]", 26, 1, 2, 26, NULL, },
-  { "AR[UNAT]{%}, % in 0 - 63", 2, 1, 2, -1, NULL, },
-  { "AR%, % in 8-15, 20, 22-23, 31, 33-35, 37-39, 41-43, 45-47, 67-111", 3, 1, 0, -1, NULL, },
-  { "AR%, % in 48 - 63, 112-127", 4, 1, 2, -1, NULL, },
-  { "BR%, % in 0 - 7", 5, 1, 2, -1, NULL, },
-  { "BR%, % in 0 - 7", 5, 1, 2, -1, NULL, },
-  { "BR%, % in 0 - 7", 5, 1, 2, -1, NULL, },
-  { "BR%, % in 0 - 7", 5, 1, 0, -1, NULL, },
-  { "CFM", 6, 1, 2, -1, NULL, },
-  { "CPUID#", 7, 1, 0, -1, NULL, },
-  { "CR[CMCV]", 27, 1, 2, 74, NULL, },
-  { "CR[DCR]", 27, 1, 2, 0, NULL, },
-  { "CR[EOI]", 27, 1, 7, 67, "SC Section 5.8.3.4, \"End of External Interrupt Register (EOI Ð CR67)\" on page 2:119", },
-  { "CR[GPTA]", 27, 1, 2, 9, NULL, },
-  { "CR[IFA]", 27, 1, 2, 20, NULL, },
-  { "CR[IFS]", 27, 1, 2, 23, NULL, },
-  { "CR[IHA]", 27, 1, 2, 25, NULL, },
-  { "CR[IIM]", 27, 1, 2, 24, NULL, },
-  { "CR[IIP]", 27, 1, 2, 19, NULL, },
-  { "CR[IIPA]", 27, 1, 2, 22, NULL, },
-  { "CR[IPSR]", 27, 1, 2, 16, NULL, },
-  { "CR[IRR%], % in 0 - 3", 8, 1, 2, -1, NULL, },
-  { "CR[ISR]", 27, 1, 2, 17, NULL, },
-  { "CR[ITIR]", 27, 1, 2, 21, NULL, },
-  { "CR[ITM]", 27, 1, 2, 1, NULL, },
-  { "CR[ITV]", 27, 1, 2, 72, NULL, },
-  { "CR[IVA]", 27, 1, 2, 2, NULL, },
-  { "CR[IVR]", 27, 1, 7, 65, "SC", },
-  { "CR[LID]", 27, 1, 7, 64, "SC", },
-  { "CR[LRR%], % in 0 - 1", 9, 1, 2, -1, NULL, },
-  { "CR[PMV]", 27, 1, 2, 73, NULL, },
-  { "CR[PTA]", 27, 1, 2, 8, NULL, },
-  { "CR[TPR]", 27, 1, 2, 66, NULL, },
-  { "CR%, % in 3-7, 10-15, 18, 26-63, 75-79, 82-127", 10, 1, 0, -1, NULL, },
-  { "DBR#", 11, 1, 2, -1, NULL, },
-  { "DTC", 0, 1, 0, -1, NULL, },
-  { "DTC", 0, 1, 2, -1, NULL, },
-  { "DTC", 0, 1, 2, -1, NULL, },
-  { "DTC_LIMIT*", 0, 1, 2, -1, NULL, },
-  { "DTR", 0, 1, 2, -1, NULL, },
-  { "DTR", 0, 1, 2, -1, NULL, },
-  { "DTR", 0, 1, 2, -1, NULL, },
-  { "DTR", 0, 1, 0, -1, NULL, },
-  { "FR%, % in 0 - 1", 12, 1, 0, -1, NULL, },
-  { "FR%, % in 2 - 127", 13, 1, 2, -1, NULL, },
-  { "GR0", 14, 1, 0, -1, NULL, },
-  { "GR%, % in 1 - 127", 15, 1, 2, -1, NULL, },
-  { "IBR#", 16, 1, 2, -1, NULL, },
-  { "InService*", 17, 1, 7, -1, "SC", },
-  { "IP", 0, 1, 0, -1, NULL, },
-  { "ITC", 0, 1, 0, -1, NULL, },
-  { "ITC", 0, 1, 2, -1, NULL, },
-  { "ITC", 0, 1, 2, -1, NULL, },
-  { "ITR", 0, 1, 2, -1, NULL, },
-  { "ITR", 0, 1, 2, -1, NULL, },
-  { "ITR", 0, 1, 0, -1, NULL, },
-  { "memory", 0, 1, 0, -1, NULL, },
-  { "MSR#", 18, 1, 7, -1, "SC", },
-  { "PKR#", 19, 1, 0, -1, NULL, },
-  { "PKR#", 19, 1, 0, -1, NULL, },
-  { "PKR#", 19, 1, 2, -1, NULL, },
-  { "PMC#", 20, 1, 2, -1, NULL, },
-  { "PMD#", 21, 1, 2, -1, NULL, },
-  { "PR0", 0, 1, 0, -1, NULL, },
-  { "PR%, % in 1 - 15", 22, 1, 0, -1, NULL, },
-  { "PR%, % in 1 - 15", 22, 1, 0, -1, NULL, },
-  { "PR%, % in 1 - 15", 22, 1, 2, -1, NULL, },
-  { "PR%, % in 1 - 15", 22, 1, 2, -1, NULL, },
-  { "PR%, % in 16 - 62", 23, 1, 0, -1, NULL, },
-  { "PR%, % in 16 - 62", 23, 1, 0, -1, NULL, },
-  { "PR%, % in 16 - 62", 23, 1, 2, -1, NULL, },
-  { "PR%, % in 16 - 62", 23, 1, 2, -1, NULL, },
-  { "PR63", 24, 1, 0, -1, NULL, },
-  { "PR63", 24, 1, 0, -1, NULL, },
-  { "PR63", 24, 1, 2, -1, NULL, },
-  { "PR63", 24, 1, 2, -1, NULL, },
-  { "PSR.ac", 28, 1, 2, 3, NULL, },
-  { "PSR.be", 28, 1, 2, 1, NULL, },
-  { "PSR.bn", 28, 1, 2, 44, NULL, },
-  { "PSR.cpl", 28, 1, 2, 32, NULL, },
-  { "PSR.da", 28, 1, 2, 38, NULL, },
-  { "PSR.db", 28, 1, 2, 24, NULL, },
-  { "PSR.dd", 28, 1, 2, 39, NULL, },
-  { "PSR.dfh", 28, 1, 2, 19, NULL, },
-  { "PSR.dfl", 28, 1, 2, 18, NULL, },
-  { "PSR.di", 28, 1, 2, 22, NULL, },
-  { "PSR.dt", 28, 1, 2, 17, NULL, },
-  { "PSR.ed", 28, 1, 2, 43, NULL, },
-  { "PSR.i", 28, 1, 2, 14, NULL, },
-  { "PSR.ia", 28, 1, 2, 14, NULL, },
-  { "PSR.ic", 28, 1, 2, 13, NULL, },
-  { "PSR.id", 28, 1, 2, 14, NULL, },
-  { "PSR.is", 28, 1, 2, 14, NULL, },
-  { "PSR.it", 28, 1, 2, 14, NULL, },
-  { "PSR.lp", 28, 1, 2, 25, NULL, },
-  { "PSR.mc", 28, 1, 2, 35, NULL, },
-  { "PSR.mfh", 28, 1, 0, 5, NULL, },
-  { "PSR.mfh", 28, 1, 2, 5, NULL, },
-  { "PSR.mfh", 28, 1, 2, 5, NULL, },
-  { "PSR.mfl", 28, 1, 0, 4, NULL, },
-  { "PSR.mfl", 28, 1, 2, 4, NULL, },
-  { "PSR.mfl", 28, 1, 2, 4, NULL, },
-  { "PSR.pk", 28, 1, 2, 15, NULL, },
-  { "PSR.pp", 28, 1, 2, 21, NULL, },
-  { "PSR.ri", 28, 1, 2, 41, NULL, },
-  { "PSR.rt", 28, 1, 2, 27, NULL, },
-  { "PSR.si", 28, 1, 2, 23, NULL, },
-  { "PSR.sp", 28, 1, 2, 20, NULL, },
-  { "PSR.ss", 28, 1, 2, 40, NULL, },
-  { "PSR.tb", 28, 1, 2, 26, NULL, },
-  { "PSR.up", 28, 1, 2, 2, NULL, },
-  { "PSR.vm", 28, 1, 2, 46, NULL, },
-  { "RR#", 25, 1, 2, -1, NULL, },
-  { "RSE", 29, 1, 2, -1, NULL, },
-  { "PR63", 24, 2, 6, -1, NULL, },
-};
-
-static const unsigned short dep0[] = {
-  97, 282, 2140, 2327, 
-};
-
-static const unsigned short dep1[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 2138, 2139, 2140, 2166, 2167, 2170, 2173, 
-  2327, 4135, 20616, 
-};
-
-static const unsigned short dep2[] = {
-  97, 282, 2166, 2167, 2169, 2170, 2172, 2173, 2175, 2344, 2347, 2348, 2351, 
-  2352, 2355, 2356, 
-};
-
-static const unsigned short dep3[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 2138, 2139, 2140, 2166, 2167, 2170, 2173, 
-  2344, 2347, 2348, 2351, 2352, 2355, 2356, 4135, 20616, 
-};
-
-static const unsigned short dep4[] = {
-  97, 282, 22646, 22647, 22649, 22650, 22652, 22653, 22655, 22824, 22827, 22828, 
-  22831, 22832, 22835, 22836, 
-};
-
-static const unsigned short dep5[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 2138, 2139, 2140, 2166, 2167, 2170, 2173, 
-  4135, 20616, 22824, 22827, 22828, 22831, 22832, 22835, 22836, 
-};
-
-static const unsigned short dep6[] = {
-  97, 282, 2166, 2167, 2169, 2170, 2172, 2173, 2175, 2344, 2345, 2347, 2349, 
-  2351, 2353, 2355, 
-};
-
-static const unsigned short dep7[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 2138, 2139, 2140, 2166, 2167, 2170, 2173, 
-  2344, 2345, 2348, 2349, 2352, 2353, 2356, 4135, 20616, 
-};
-
-static const unsigned short dep8[] = {
-  97, 282, 2166, 2167, 2169, 2170, 2172, 2173, 2175, 2344, 2346, 2348, 2350, 
-  2352, 2354, 2356, 
-};
-
-static const unsigned short dep9[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 2138, 2139, 2140, 2166, 2167, 2170, 2173, 
-  2344, 2346, 2347, 2350, 2351, 2354, 2355, 4135, 20616, 
-};
-
-static const unsigned short dep10[] = {
-  97, 282, 2166, 2167, 2169, 2170, 2172, 2173, 2175, 2344, 2345, 2346, 2347, 
-  2348, 2349, 2350, 2351, 2352, 2353, 2354, 2355, 2356, 
-};
-
-static const unsigned short dep11[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 2138, 2139, 2140, 2166, 2167, 2170, 2173, 
-  2344, 2345, 2346, 2347, 2348, 2349, 2350, 2351, 2352, 2353, 2354, 2355, 2356, 
-  4135, 20616, 
-};
-
-static const unsigned short dep12[] = {
-  97, 282, 2395, 
-};
-
-static const unsigned short dep13[] = {
-  40, 41, 97, 158, 162, 164, 175, 185, 186, 188, 282, 2082, 2083, 2166, 2168, 
-  2169, 2171, 2172, 2174, 2175, 4135, 
-};
-
-static const unsigned short dep14[] = {
-  97, 163, 282, 325, 2395, 28866, 29018, 
-};
-
-static const unsigned short dep15[] = {
-  1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 
-  22, 23, 24, 25, 26, 28, 29, 30, 31, 32, 33, 40, 41, 97, 150, 152, 158, 162, 
-  164, 175, 185, 186, 188, 282, 325, 2082, 2083, 2166, 2168, 2169, 2171, 2172, 
-  2174, 2175, 4135, 28866, 29018, 
-};
-
-static const unsigned short dep16[] = {
-  1, 6, 40, 97, 137, 196, 201, 241, 282, 312, 2395, 28866, 29018, 
-};
-
-static const unsigned short dep17[] = {
-  1, 25, 27, 38, 40, 41, 97, 158, 162, 164, 166, 167, 175, 185, 186, 188, 196, 
-  201, 241, 282, 312, 2082, 2083, 2166, 2168, 2169, 2171, 2172, 2174, 2175, 
-  4135, 28866, 29018, 
-};
-
-static const unsigned short dep18[] = {
-  1, 40, 51, 97, 196, 241, 248, 282, 28866, 29018, 
-};
-
-static const unsigned short dep19[] = {
-  1, 38, 40, 41, 97, 158, 160, 161, 162, 175, 185, 190, 191, 196, 241, 248, 
-  282, 4135, 28866, 29018, 
-};
-
-static const unsigned short dep20[] = {
-  40, 97, 241, 282, 
-};
-
-static const unsigned short dep21[] = {
-  97, 158, 162, 175, 185, 241, 282, 
-};
-
-static const unsigned short dep22[] = {
-  1, 40, 97, 131, 135, 136, 138, 139, 142, 143, 146, 149, 152, 155, 156, 157, 
-  158, 161, 162, 163, 164, 167, 168, 169, 170, 173, 174, 175, 178, 181, 184, 
-  185, 188, 189, 191, 196, 241, 282, 309, 310, 311, 312, 313, 314, 315, 316, 
-  317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 330, 331, 333, 
-  334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 28866, 29018, 
-};
-
-static const unsigned short dep23[] = {
-  1, 38, 40, 41, 50, 51, 55, 58, 73, 97, 137, 138, 158, 162, 175, 185, 190, 
-  191, 196, 241, 282, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 
-  320, 321, 322, 323, 324, 325, 326, 327, 328, 330, 331, 333, 334, 335, 336, 
-  337, 338, 339, 340, 341, 342, 343, 344, 4135, 28866, 29018, 
-};
-
-static const unsigned short dep24[] = {
-  97, 136, 282, 311, 
-};
-
-static const unsigned short dep25[] = {
-  97, 137, 138, 158, 162, 175, 185, 190, 191, 282, 311, 
-};
-
-static const unsigned short dep26[] = {
-  97, 137, 282, 312, 
-};
-
-static const unsigned short dep27[] = {
-  25, 26, 97, 98, 101, 105, 108, 137, 138, 158, 162, 164, 175, 185, 282, 312, 
-  
-};
-
-static const unsigned short dep28[] = {
-  97, 190, 282, 344, 
-};
-
-static const unsigned short dep29[] = {
-  97, 98, 101, 105, 108, 137, 138, 158, 162, 164, 175, 185, 282, 344, 
-};
-
-static const unsigned short dep30[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 2166, 2168, 2169, 2171, 2172, 2174, 2175, 
-  4135, 
-};
-
-static const unsigned short dep31[] = {
-  1, 25, 40, 97, 196, 228, 229, 241, 282, 2082, 2285, 2288, 2395, 28866, 29018, 
-  
-};
-
-static const unsigned short dep32[] = {
-  1, 6, 38, 40, 41, 97, 137, 138, 158, 162, 164, 175, 185, 186, 188, 196, 228, 
-  230, 241, 282, 2082, 2083, 2166, 2168, 2169, 2171, 2172, 2174, 2175, 2286, 
-  2288, 4135, 28866, 29018, 
-};
-
-static const unsigned short dep33[] = {
-  97, 282, 
-};
-
-static const unsigned short dep34[] = {
-  97, 158, 162, 175, 185, 282, 2082, 2084, 
-};
-
-static const unsigned short dep35[] = {
-  40, 41, 97, 158, 162, 164, 175, 185, 186, 188, 282, 2166, 2168, 2169, 2171, 
-  2172, 2174, 2175, 4135, 
-};
-
-static const unsigned short dep36[] = {
-  6, 37, 38, 39, 97, 125, 126, 201, 241, 282, 307, 308, 2395, 
-};
-
-static const unsigned short dep37[] = {
-  6, 37, 40, 41, 97, 158, 162, 164, 175, 185, 186, 188, 201, 241, 282, 307, 
-  308, 347, 2166, 2168, 2169, 2171, 2172, 2174, 2175, 4135, 
-};
-
-static const unsigned short dep38[] = {
-  24, 97, 227, 282, 2395, 
-};
-
-static const unsigned short dep39[] = {
-  24, 40, 41, 97, 158, 162, 164, 175, 185, 186, 188, 227, 282, 2166, 2168, 2169, 
-  2171, 2172, 2174, 2175, 4135, 
-};
-
-static const unsigned short dep40[] = {
-  6, 24, 37, 38, 39, 97, 125, 126, 201, 227, 241, 282, 307, 308, 2395, 
-};
-
-static const unsigned short dep41[] = {
-  6, 24, 37, 40, 41, 97, 158, 162, 164, 175, 185, 186, 188, 201, 227, 241, 282, 
-  307, 308, 347, 2166, 2168, 2169, 2171, 2172, 2174, 2175, 4135, 
-};
-
-static const unsigned short dep42[] = {
-  1, 6, 38, 40, 41, 97, 137, 138, 158, 162, 164, 175, 185, 186, 188, 196, 228, 
-  230, 241, 282, 2166, 2168, 2169, 2171, 2172, 2174, 2175, 2286, 2288, 4135, 
-  28866, 29018, 
-};
-
-static const unsigned short dep43[] = {
-  97, 158, 162, 175, 185, 282, 
-};
-
-static const unsigned short dep44[] = {
-  15, 97, 210, 211, 282, 2136, 2325, 18601, 18602, 18761, 18762, 18764, 18765, 
-  22646, 22647, 22648, 22650, 22651, 22653, 22654, 22824, 22827, 22828, 22831, 
-  22832, 22835, 22836, 
-};
-
-static const unsigned short dep45[] = {
-  11, 19, 20, 40, 41, 97, 158, 162, 175, 185, 210, 212, 282, 2135, 2136, 2137, 
-  2166, 2167, 2170, 2173, 2325, 4135, 16528, 16530, 16531, 16533, 18761, 18763, 
-  18764, 18766, 22824, 22827, 22828, 22831, 22832, 22835, 22836, 
-};
-
-static const unsigned short dep46[] = {
-  15, 16, 17, 18, 97, 210, 211, 213, 214, 216, 217, 219, 220, 282, 2136, 2325, 
-  18601, 18602, 18761, 18762, 18764, 18765, 22646, 22647, 22648, 22650, 22651, 
-  22653, 22654, 22824, 22827, 22828, 22831, 22832, 22835, 22836, 
-};
-
-static const unsigned short dep47[] = {
-  11, 12, 13, 14, 19, 20, 40, 41, 97, 158, 162, 175, 185, 210, 212, 213, 215, 
-  216, 218, 219, 221, 282, 2135, 2136, 2137, 2166, 2167, 2170, 2173, 2325, 4135, 
-  16528, 16530, 16531, 16533, 18761, 18763, 18764, 18766, 22824, 22827, 22828, 
-  22831, 22832, 22835, 22836, 
-};
-
-static const unsigned short dep48[] = {
-  16, 97, 213, 214, 282, 2136, 2325, 18601, 18602, 18761, 18762, 18764, 18765, 
-  22646, 22647, 22648, 22650, 22651, 22653, 22654, 22824, 22827, 22828, 22831, 
-  22832, 22835, 22836, 
-};
-
-static const unsigned short dep49[] = {
-  12, 19, 20, 40, 41, 97, 158, 162, 175, 185, 213, 215, 282, 2135, 2136, 2137, 
-  2166, 2167, 2170, 2173, 2325, 4135, 16528, 16530, 16531, 16533, 18761, 18763, 
-  18764, 18766, 22824, 22827, 22828, 22831, 22832, 22835, 22836, 
-};
-
-static const unsigned short dep50[] = {
-  17, 97, 216, 217, 282, 2136, 2325, 18601, 18602, 18761, 18762, 18764, 18765, 
-  22646, 22647, 22648, 22650, 22651, 22653, 22654, 22824, 22827, 22828, 22831, 
-  22832, 22835, 22836, 
-};
-
-static const unsigned short dep51[] = {
-  13, 19, 20, 40, 41, 97, 158, 162, 175, 185, 216, 218, 282, 2135, 2136, 2137, 
-  2166, 2167, 2170, 2173, 2325, 4135, 16528, 16530, 16531, 16533, 18761, 18763, 
-  18764, 18766, 22824, 22827, 22828, 22831, 22832, 22835, 22836, 
-};
-
-static const unsigned short dep52[] = {
-  18, 97, 219, 220, 282, 2136, 2325, 18601, 18602, 18761, 18762, 18764, 18765, 
-  22646, 22647, 22648, 22650, 22651, 22653, 22654, 22824, 22827, 22828, 22831, 
-  22832, 22835, 22836, 
-};
-
-static const unsigned short dep53[] = {
-  14, 19, 20, 40, 41, 97, 158, 162, 175, 185, 219, 221, 282, 2135, 2136, 2137, 
-  2166, 2167, 2170, 2173, 2325, 4135, 16528, 16530, 16531, 16533, 18761, 18763, 
-  18764, 18766, 22824, 22827, 22828, 22831, 22832, 22835, 22836, 
-};
-
-static const unsigned short dep54[] = {
-  15, 97, 210, 211, 282, 2136, 2325, 18601, 18602, 18761, 18762, 18764, 18765, 
-  
-};
-
-static const unsigned short dep55[] = {
-  11, 19, 20, 40, 41, 97, 158, 162, 175, 185, 210, 212, 282, 2135, 2136, 2137, 
-  2166, 2167, 2170, 2173, 2325, 4135, 16528, 16530, 16531, 16533, 18761, 18763, 
-  18764, 18766, 
-};
-
-static const unsigned short dep56[] = {
-  15, 16, 17, 18, 97, 210, 211, 213, 214, 216, 217, 219, 220, 282, 2136, 2325, 
-  18601, 18602, 18761, 18762, 18764, 18765, 
-};
-
-static const unsigned short dep57[] = {
-  11, 12, 13, 14, 19, 20, 40, 41, 97, 158, 162, 175, 185, 210, 212, 213, 215, 
-  216, 218, 219, 221, 282, 2135, 2136, 2137, 2166, 2167, 2170, 2173, 2325, 4135, 
-  16528, 16530, 16531, 16533, 18761, 18763, 18764, 18766, 
-};
-
-static const unsigned short dep58[] = {
-  16, 97, 213, 214, 282, 2136, 2325, 18601, 18602, 18761, 18762, 18764, 18765, 
-  
-};
-
-static const unsigned short dep59[] = {
-  12, 19, 20, 40, 41, 97, 158, 162, 175, 185, 213, 215, 282, 2135, 2136, 2137, 
-  2166, 2167, 2170, 2173, 2325, 4135, 16528, 16530, 16531, 16533, 18761, 18763, 
-  18764, 18766, 
-};
-
-static const unsigned short dep60[] = {
-  17, 97, 216, 217, 282, 2136, 2325, 18601, 18602, 18761, 18762, 18764, 18765, 
-  
-};
-
-static const unsigned short dep61[] = {
-  13, 19, 20, 40, 41, 97, 158, 162, 175, 185, 216, 218, 282, 2135, 2136, 2137, 
-  2166, 2167, 2170, 2173, 2325, 4135, 16528, 16530, 16531, 16533, 18761, 18763, 
-  18764, 18766, 
-};
-
-static const unsigned short dep62[] = {
-  18, 97, 219, 220, 282, 2136, 2325, 18601, 18602, 18761, 18762, 18764, 18765, 
-  
-};
-
-static const unsigned short dep63[] = {
-  14, 19, 20, 40, 41, 97, 158, 162, 175, 185, 219, 221, 282, 2135, 2136, 2137, 
-  2166, 2167, 2170, 2173, 2325, 4135, 16528, 16530, 16531, 16533, 18761, 18763, 
-  18764, 18766, 
-};
-
-static const unsigned short dep64[] = {
-  97, 282, 2136, 2325, 18601, 18602, 18761, 18762, 18764, 18765, 
-};
-
-static const unsigned short dep65[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 2135, 2136, 2137, 2166, 2167, 2170, 2173, 
-  2325, 4135, 16528, 16530, 16531, 16533, 18761, 18763, 18764, 18766, 
-};
-
-static const unsigned short dep66[] = {
-  11, 97, 206, 282, 
-};
-
-static const unsigned short dep67[] = {
-  11, 40, 41, 97, 158, 162, 175, 185, 206, 282, 2166, 2167, 2170, 2173, 4135, 
-  
-};
-
-static const unsigned short dep68[] = {
-  11, 40, 41, 97, 158, 162, 175, 185, 282, 2166, 2167, 2170, 2173, 4135, 
-};
-
-static const unsigned short dep69[] = {
-  12, 97, 207, 282, 
-};
-
-static const unsigned short dep70[] = {
-  11, 40, 41, 97, 158, 162, 175, 185, 207, 282, 2166, 2167, 2170, 2173, 4135, 
-  
-};
-
-static const unsigned short dep71[] = {
-  13, 97, 208, 282, 
-};
-
-static const unsigned short dep72[] = {
-  11, 40, 41, 97, 158, 162, 175, 185, 208, 282, 2166, 2167, 2170, 2173, 4135, 
-  
-};
-
-static const unsigned short dep73[] = {
-  14, 97, 209, 282, 
-};
-
-static const unsigned short dep74[] = {
-  11, 40, 41, 97, 158, 162, 175, 185, 209, 282, 2166, 2167, 2170, 2173, 4135, 
-  
-};
-
-static const unsigned short dep75[] = {
-  15, 97, 211, 212, 282, 
-};
-
-static const unsigned short dep76[] = {
-  40, 41, 97, 158, 162, 175, 185, 211, 212, 282, 2166, 2167, 2170, 2173, 4135, 
-  
-};
-
-static const unsigned short dep77[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 2166, 2167, 2170, 2173, 4135, 
-};
-
-static const unsigned short dep78[] = {
-  16, 97, 214, 215, 282, 
-};
-
-static const unsigned short dep79[] = {
-  40, 41, 97, 158, 162, 175, 185, 214, 215, 282, 2166, 2167, 2170, 2173, 4135, 
-  
-};
-
-static const unsigned short dep80[] = {
-  17, 97, 217, 218, 282, 
-};
-
-static const unsigned short dep81[] = {
-  40, 41, 97, 158, 162, 175, 185, 217, 218, 282, 2166, 2167, 2170, 2173, 4135, 
-  
-};
-
-static const unsigned short dep82[] = {
-  18, 97, 220, 221, 282, 
-};
-
-static const unsigned short dep83[] = {
-  40, 41, 97, 158, 162, 175, 185, 220, 221, 282, 2166, 2167, 2170, 2173, 4135, 
-  
-};
-
-static const unsigned short dep84[] = {
-  15, 19, 20, 40, 41, 97, 158, 162, 164, 175, 185, 186, 188, 282, 2166, 2167, 
-  2170, 2173, 4135, 
-};
-
-static const unsigned short dep85[] = {
-  15, 16, 19, 20, 40, 41, 97, 158, 162, 164, 175, 185, 186, 188, 282, 2166, 
-  2167, 2170, 2173, 4135, 
-};
-
-static const unsigned short dep86[] = {
-  15, 17, 19, 20, 40, 41, 97, 158, 162, 164, 175, 185, 186, 188, 282, 2166, 
-  2167, 2170, 2173, 4135, 
-};
-
-static const unsigned short dep87[] = {
-  15, 18, 19, 20, 40, 41, 97, 158, 162, 164, 175, 185, 186, 188, 282, 2166, 
-  2167, 2170, 2173, 4135, 
-};
-
-static const unsigned short dep88[] = {
-  15, 97, 210, 211, 282, 
-};
-
-static const unsigned short dep89[] = {
-  11, 19, 20, 40, 41, 97, 158, 162, 175, 185, 210, 212, 282, 2166, 2167, 2170, 
-  2173, 4135, 
-};
-
-static const unsigned short dep90[] = {
-  15, 16, 17, 18, 97, 210, 211, 213, 214, 216, 217, 219, 220, 282, 
-};
-
-static const unsigned short dep91[] = {
-  11, 12, 13, 14, 19, 20, 40, 41, 97, 158, 162, 175, 185, 210, 212, 213, 215, 
-  216, 218, 219, 221, 282, 2166, 2167, 2170, 2173, 4135, 
-};
-
-static const unsigned short dep92[] = {
-  16, 97, 213, 214, 282, 
-};
-
-static const unsigned short dep93[] = {
-  12, 19, 20, 40, 41, 97, 158, 162, 175, 185, 213, 215, 282, 2166, 2167, 2170, 
-  2173, 4135, 
-};
-
-static const unsigned short dep94[] = {
-  17, 97, 216, 217, 282, 
-};
-
-static const unsigned short dep95[] = {
-  13, 19, 20, 40, 41, 97, 158, 162, 175, 185, 216, 218, 282, 2166, 2167, 2170, 
-  2173, 4135, 
-};
-
-static const unsigned short dep96[] = {
-  18, 97, 219, 220, 282, 
-};
-
-static const unsigned short dep97[] = {
-  14, 19, 20, 40, 41, 97, 158, 162, 175, 185, 219, 221, 282, 2166, 2167, 2170, 
-  2173, 4135, 
-};
-
-static const unsigned short dep98[] = {
-  15, 97, 210, 211, 282, 2166, 2167, 2168, 2170, 2171, 2173, 2174, 2344, 2347, 
-  2348, 2351, 2352, 2355, 2356, 
-};
-
-static const unsigned short dep99[] = {
-  11, 19, 20, 40, 41, 97, 158, 162, 175, 185, 210, 212, 282, 2135, 2136, 2137, 
-  2166, 2167, 2170, 2173, 2344, 2347, 2348, 2351, 2352, 2355, 2356, 4135, 16528, 
-  16530, 16531, 16533, 
-};
-
-static const unsigned short dep100[] = {
-  15, 16, 17, 18, 97, 210, 211, 213, 214, 216, 217, 219, 220, 282, 2166, 2167, 
-  2168, 2170, 2171, 2173, 2174, 2344, 2347, 2348, 2351, 2352, 2355, 2356, 
-};
-
-static const unsigned short dep101[] = {
-  11, 12, 13, 14, 19, 20, 40, 41, 97, 158, 162, 175, 185, 210, 212, 213, 215, 
-  216, 218, 219, 221, 282, 2135, 2136, 2137, 2166, 2167, 2170, 2173, 2344, 2347, 
-  2348, 2351, 2352, 2355, 2356, 4135, 16528, 16530, 16531, 16533, 
-};
-
-static const unsigned short dep102[] = {
-  16, 97, 213, 214, 282, 2166, 2167, 2168, 2170, 2171, 2173, 2174, 2344, 2347, 
-  2348, 2351, 2352, 2355, 2356, 
-};
-
-static const unsigned short dep103[] = {
-  12, 19, 20, 40, 41, 97, 158, 162, 175, 185, 213, 215, 282, 2135, 2136, 2137, 
-  2166, 2167, 2170, 2173, 2344, 2347, 2348, 2351, 2352, 2355, 2356, 4135, 16528, 
-  16530, 16531, 16533, 
-};
-
-static const unsigned short dep104[] = {
-  17, 97, 216, 217, 282, 2166, 2167, 2168, 2170, 2171, 2173, 2174, 2344, 2347, 
-  2348, 2351, 2352, 2355, 2356, 
-};
-
-static const unsigned short dep105[] = {
-  13, 19, 20, 40, 41, 97, 158, 162, 175, 185, 216, 218, 282, 2135, 2136, 2137, 
-  2166, 2167, 2170, 2173, 2344, 2347, 2348, 2351, 2352, 2355, 2356, 4135, 16528, 
-  16530, 16531, 16533, 
-};
-
-static const unsigned short dep106[] = {
-  18, 97, 219, 220, 282, 2166, 2167, 2168, 2170, 2171, 2173, 2174, 2344, 2347, 
-  2348, 2351, 2352, 2355, 2356, 
-};
-
-static const unsigned short dep107[] = {
-  14, 19, 20, 40, 41, 97, 158, 162, 175, 185, 219, 221, 282, 2135, 2136, 2137, 
-  2166, 2167, 2170, 2173, 2344, 2347, 2348, 2351, 2352, 2355, 2356, 4135, 16528, 
-  16530, 16531, 16533, 
-};
-
-static const unsigned short dep108[] = {
-  15, 97, 210, 211, 282, 22646, 22647, 22648, 22650, 22651, 22653, 22654, 22824, 
-  22827, 22828, 22831, 22832, 22835, 22836, 
-};
-
-static const unsigned short dep109[] = {
-  11, 19, 20, 40, 41, 97, 158, 162, 175, 185, 210, 212, 282, 2135, 2136, 2137, 
-  2166, 2167, 2170, 2173, 4135, 16528, 16530, 16531, 16533, 22824, 22827, 22828, 
-  22831, 22832, 22835, 22836, 
-};
-
-static const unsigned short dep110[] = {
-  15, 16, 17, 18, 97, 210, 211, 213, 214, 216, 217, 219, 220, 282, 22646, 22647, 
-  22648, 22650, 22651, 22653, 22654, 22824, 22827, 22828, 22831, 22832, 22835, 
-  22836, 
-};
-
-static const unsigned short dep111[] = {
-  11, 12, 13, 14, 19, 20, 40, 41, 97, 158, 162, 175, 185, 210, 212, 213, 215, 
-  216, 218, 219, 221, 282, 2135, 2136, 2137, 2166, 2167, 2170, 2173, 4135, 16528, 
-  16530, 16531, 16533, 22824, 22827, 22828, 22831, 22832, 22835, 22836, 
-};
-
-static const unsigned short dep112[] = {
-  16, 97, 213, 214, 282, 22646, 22647, 22648, 22650, 22651, 22653, 22654, 22824, 
-  22827, 22828, 22831, 22832, 22835, 22836, 
-};
-
-static const unsigned short dep113[] = {
-  12, 19, 20, 40, 41, 97, 158, 162, 175, 185, 213, 215, 282, 2135, 2136, 2137, 
-  2166, 2167, 2170, 2173, 4135, 16528, 16530, 16531, 16533, 22824, 22827, 22828, 
-  22831, 22832, 22835, 22836, 
-};
-
-static const unsigned short dep114[] = {
-  17, 97, 216, 217, 282, 22646, 22647, 22648, 22650, 22651, 22653, 22654, 22824, 
-  22827, 22828, 22831, 22832, 22835, 22836, 
-};
-
-static const unsigned short dep115[] = {
-  13, 19, 20, 40, 41, 97, 158, 162, 175, 185, 216, 218, 282, 2135, 2136, 2137, 
-  2166, 2167, 2170, 2173, 4135, 16528, 16530, 16531, 16533, 22824, 22827, 22828, 
-  22831, 22832, 22835, 22836, 
-};
-
-static const unsigned short dep116[] = {
-  18, 97, 219, 220, 282, 22646, 22647, 22648, 22650, 22651, 22653, 22654, 22824, 
-  22827, 22828, 22831, 22832, 22835, 22836, 
-};
-
-static const unsigned short dep117[] = {
-  14, 19, 20, 40, 41, 97, 158, 162, 175, 185, 219, 221, 282, 2135, 2136, 2137, 
-  2166, 2167, 2170, 2173, 4135, 16528, 16530, 16531, 16533, 22824, 22827, 22828, 
-  22831, 22832, 22835, 22836, 
-};
-
-static const unsigned short dep118[] = {
-  97, 282, 2166, 2167, 2168, 2170, 2171, 2173, 2174, 2344, 2347, 2348, 2351, 
-  2352, 2355, 2356, 
-};
-
-static const unsigned short dep119[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 2135, 2136, 2137, 2166, 2167, 2170, 2173, 
-  2344, 2347, 2348, 2351, 2352, 2355, 2356, 4135, 16528, 16530, 16531, 16533, 
-  
-};
-
-static const unsigned short dep120[] = {
-  97, 282, 22646, 22647, 22648, 22650, 22651, 22653, 22654, 22824, 22827, 22828, 
-  22831, 22832, 22835, 22836, 
-};
-
-static const unsigned short dep121[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 2135, 2136, 2137, 2166, 2167, 2170, 2173, 
-  4135, 16528, 16530, 16531, 16533, 22824, 22827, 22828, 22831, 22832, 22835, 
-  22836, 
-};
-
-static const unsigned short dep122[] = {
-  19, 20, 40, 41, 97, 158, 162, 175, 185, 282, 2135, 2136, 2137, 2166, 2167, 
-  2170, 2173, 2325, 4135, 16528, 16530, 16531, 16533, 18761, 18763, 18764, 18766, 
-  
-};
-
-static const unsigned short dep123[] = {
-  40, 41, 97, 158, 162, 164, 175, 185, 186, 188, 282, 2138, 2139, 2140, 2166, 
-  2167, 2170, 2173, 4135, 20616, 
-};
-
-static const unsigned short dep124[] = {
-  97, 282, 2083, 2084, 2286, 2287, 
-};
-
-static const unsigned short dep125[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 2138, 2139, 2140, 2166, 2167, 2170, 2173, 
-  2285, 2287, 4135, 20616, 
-};
-
-static const unsigned short dep126[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 2082, 2084, 2166, 2167, 2170, 2173, 2327, 
-  4135, 20616, 
-};
-
-static const unsigned short dep127[] = {
-  97, 282, 14455, 14457, 14458, 14460, 14461, 14463, 14635, 14636, 14639, 14640, 
-  14643, 14644, 
-};
-
-static const unsigned short dep128[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 2138, 2139, 2140, 4135, 14635, 14636, 
-  14639, 14640, 14643, 14644, 20616, 24694, 24695, 24698, 24701, 
-};
-
-static const unsigned short dep129[] = {
-  97, 122, 124, 125, 127, 282, 303, 304, 307, 308, 
-};
-
-static const unsigned short dep130[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 303, 304, 307, 308, 4135, 24694, 24695, 
-  24698, 24701, 
-};
-
-static const unsigned short dep131[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 2166, 2167, 2170, 2173, 2327, 4135, 20616, 
-  
-};
-
-static const unsigned short dep132[] = {
-  40, 41, 97, 119, 122, 125, 158, 162, 175, 185, 282, 2327, 4135, 20616, 24694, 
-  
-};
-
-static const unsigned short dep133[] = {
-  6, 24, 26, 27, 97, 201, 227, 230, 282, 2081, 2284, 
-};
-
-static const unsigned short dep134[] = {
-  40, 41, 97, 158, 162, 175, 185, 201, 227, 229, 282, 2138, 2139, 2140, 2166, 
-  2167, 2170, 2173, 2284, 4135, 20616, 
-};
-
-static const unsigned short dep135[] = {
-  6, 24, 25, 26, 40, 41, 97, 158, 162, 175, 185, 282, 2081, 2166, 2167, 2170, 
-  2173, 2327, 4135, 20616, 
-};
-
-static const unsigned short dep136[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 2166, 2167, 2170, 2173, 2344, 2347, 2348, 
-  2351, 2352, 2355, 2356, 4135, 
-};
-
-static const unsigned short dep137[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 2166, 2167, 2170, 2173, 4135, 22824, 
-  22827, 22828, 22831, 22832, 22835, 22836, 
-};
-
-static const unsigned short dep138[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 2166, 2167, 2170, 2173, 2344, 2345, 2348, 
-  2349, 2352, 2353, 2356, 4135, 
-};
-
-static const unsigned short dep139[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 2166, 2167, 2170, 2173, 2344, 2346, 2347, 
-  2350, 2351, 2354, 2355, 4135, 
-};
-
-static const unsigned short dep140[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 2166, 2167, 2170, 2173, 2344, 2345, 2346, 
-  2347, 2348, 2349, 2350, 2351, 2352, 2353, 2354, 2355, 2356, 4135, 
-};
-
-static const unsigned short dep141[] = {
-  0, 40, 41, 97, 158, 162, 164, 175, 185, 186, 188, 282, 2166, 2167, 2170, 2173, 
-  4135, 
-};
-
-static const unsigned short dep142[] = {
-  0, 97, 195, 282, 
-};
-
-static const unsigned short dep143[] = {
-  0, 40, 41, 97, 158, 162, 164, 175, 185, 186, 188, 195, 282, 2166, 2167, 2170, 
-  2173, 4135, 
-};
-
-static const unsigned short dep144[] = {
-  40, 41, 97, 158, 162, 175, 185, 195, 282, 2166, 2167, 2170, 2173, 4135, 
-};
-
-static const unsigned short dep145[] = {
-  2, 28, 97, 197, 231, 282, 28866, 29018, 
-};
-
-static const unsigned short dep146[] = {
-  1, 2, 28, 29, 97, 158, 162, 175, 177, 178, 185, 197, 231, 282, 28866, 29018, 
-  
-};
-
-static const unsigned short dep147[] = {
-  1, 28, 29, 38, 40, 41, 97, 158, 162, 175, 177, 178, 185, 197, 231, 282, 4135, 
-  28866, 29018, 
-};
-
-static const unsigned short dep148[] = {
-  0, 40, 41, 97, 158, 162, 175, 185, 195, 282, 2166, 2167, 2170, 2173, 4135, 
-  
-};
-
-static const unsigned short dep149[] = {
-  1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 
-  28, 29, 30, 31, 97, 196, 197, 198, 199, 200, 202, 203, 204, 205, 206, 207, 
-  208, 209, 211, 212, 214, 215, 217, 218, 220, 221, 222, 223, 224, 225, 231, 
-  232, 233, 234, 282, 2071, 2081, 2274, 2284, 28866, 29018, 
-};
-
-static const unsigned short dep150[] = {
-  29, 40, 41, 97, 137, 138, 158, 162, 175, 185, 190, 191, 196, 197, 198, 199, 
-  200, 202, 203, 204, 205, 206, 207, 208, 209, 211, 212, 214, 215, 217, 218, 
-  220, 221, 222, 223, 224, 225, 231, 232, 233, 234, 282, 2138, 2139, 2140, 2166, 
-  2167, 2170, 2173, 2274, 2284, 4135, 20616, 28866, 29018, 
-};
-
-static const unsigned short dep151[] = {
-  97, 282, 14464, 14466, 14468, 14470, 14505, 14506, 14525, 14645, 14646, 14666, 
-  14667, 14669, 14670, 14679, 
-};
-
-static const unsigned short dep152[] = {
-  40, 41, 97, 158, 162, 175, 183, 184, 185, 282, 2166, 2167, 2170, 2173, 4135, 
-  14645, 14646, 14666, 14667, 14669, 14670, 14679, 
-};
-
-static const unsigned short dep153[] = {
-  14464, 14466, 14468, 14470, 14505, 14506, 14525, 14645, 14646, 14666, 14667, 
-  14669, 14670, 14679, 
-};
-
-static const unsigned short dep154[] = {
-  183, 184, 14645, 14646, 14666, 14667, 14669, 14670, 14679, 
-};
-
-static const unsigned short dep155[] = {
-  97, 282, 14465, 14466, 14469, 14470, 14480, 14481, 14483, 14484, 14486, 14487, 
-  14489, 14490, 14493, 14495, 14496, 14505, 14506, 14507, 14508, 14510, 14515, 
-  14516, 14518, 14519, 14525, 14645, 14646, 14652, 14653, 14654, 14655, 14657, 
-  14659, 14666, 14667, 14669, 14670, 14671, 14672, 14675, 14676, 14679, 
-};
-
-static const unsigned short dep156[] = {
-  40, 41, 97, 137, 138, 158, 162, 175, 185, 190, 191, 282, 2166, 2167, 2170, 
-  2173, 4135, 14645, 14646, 14652, 14653, 14654, 14655, 14657, 14659, 14666, 
-  14667, 14669, 14670, 14671, 14672, 14675, 14676, 14679, 34888, 
-};
-
-static const unsigned short dep157[] = {
-  40, 41, 97, 137, 138, 158, 162, 175, 185, 190, 191, 282, 2166, 2167, 2170, 
-  2173, 4135, 14645, 14646, 14652, 14653, 14654, 14655, 14657, 14659, 14666, 
-  14667, 14669, 14670, 14671, 14672, 14675, 14676, 14679, 
-};
-
-static const unsigned short dep158[] = {
-  1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 
-  28, 29, 30, 31, 40, 41, 97, 137, 138, 158, 162, 175, 180, 181, 185, 190, 191, 
-  282, 2071, 2081, 2166, 2167, 2170, 2173, 2327, 4135, 20616, 28866, 
-};
-
-static const unsigned short dep159[] = {
-  43, 44, 45, 46, 47, 48, 49, 50, 52, 53, 54, 55, 56, 57, 58, 60, 61, 62, 63, 
-  64, 65, 67, 69, 70, 71, 72, 73, 94, 96, 97, 243, 244, 245, 246, 247, 248, 
-  249, 250, 251, 252, 253, 255, 256, 257, 258, 259, 261, 263, 264, 265, 281, 
-  282, 2116, 2310, 
-};
-
-static const unsigned short dep160[] = {
-  40, 41, 96, 97, 137, 138, 158, 160, 161, 162, 175, 185, 190, 191, 243, 244, 
-  245, 246, 247, 248, 249, 250, 251, 252, 253, 255, 256, 257, 258, 259, 261, 
-  263, 264, 265, 281, 282, 2138, 2139, 2140, 2166, 2167, 2170, 2173, 2310, 4135, 
-  20616, 
-};
-
-static const unsigned short dep161[] = {
-  59, 95, 97, 254, 281, 282, 2140, 2327, 
-};
-
-static const unsigned short dep162[] = {
-  40, 41, 43, 44, 46, 48, 49, 51, 52, 53, 54, 56, 57, 60, 61, 63, 64, 65, 66, 
-  67, 69, 70, 71, 94, 95, 97, 137, 138, 158, 160, 161, 162, 175, 185, 190, 191, 
-  254, 281, 282, 2107, 2116, 2166, 2167, 2170, 2173, 2327, 4135, 20616, 
-};
-
-static const unsigned short dep163[] = {
-  2, 28, 41, 97, 197, 231, 241, 282, 2140, 2327, 28866, 29018, 
-};
-
-static const unsigned short dep164[] = {
-  2, 25, 26, 28, 29, 38, 40, 41, 97, 158, 162, 175, 177, 178, 185, 197, 231, 
-  241, 282, 2327, 4135, 20616, 28866, 29018, 
-};
-
-static const unsigned short dep165[] = {
-  97, 129, 130, 133, 134, 140, 141, 144, 145, 147, 148, 150, 151, 153, 154, 
-  157, 159, 160, 165, 166, 169, 170, 171, 172, 174, 176, 177, 179, 180, 182, 
-  183, 186, 187, 189, 282, 309, 310, 314, 316, 317, 318, 319, 321, 323, 327, 
-  330, 331, 333, 334, 335, 336, 338, 339, 340, 342, 343, 
-};
-
-static const unsigned short dep166[] = {
-  40, 41, 97, 137, 138, 158, 162, 175, 185, 190, 191, 282, 309, 310, 314, 316, 
-  317, 318, 319, 321, 323, 327, 330, 331, 333, 334, 335, 336, 338, 339, 340, 
-  342, 343, 2138, 2139, 2140, 2166, 2167, 2170, 2173, 4135, 20616, 34888, 
-};
-
-static const unsigned short dep167[] = {
-  97, 128, 130, 132, 134, 169, 170, 189, 282, 309, 310, 330, 331, 333, 334, 
-  343, 
-};
-
-static const unsigned short dep168[] = {
-  40, 41, 97, 158, 162, 175, 183, 184, 185, 282, 309, 310, 330, 331, 333, 334, 
-  343, 2138, 2139, 2140, 2166, 2167, 2170, 2173, 4135, 20616, 
-};
-
-static const unsigned short dep169[] = {
-  40, 41, 97, 130, 131, 134, 135, 137, 138, 141, 142, 145, 146, 148, 149, 151, 
-  152, 154, 155, 157, 158, 159, 161, 162, 164, 165, 167, 168, 169, 170, 172, 
-  173, 174, 175, 176, 178, 179, 181, 182, 184, 185, 187, 188, 189, 190, 191, 
-  282, 2166, 2167, 2170, 2173, 2327, 4135, 20616, 
-};
-
-static const unsigned short dep170[] = {
-  40, 41, 97, 130, 131, 134, 135, 158, 162, 169, 170, 175, 185, 189, 282, 2166, 
-  2167, 2170, 2173, 2327, 4135, 20616, 
-};
-
-static const unsigned short dep171[] = {
-  40, 41, 70, 76, 77, 82, 84, 97, 111, 137, 138, 153, 155, 158, 162, 171, 173, 
-  175, 185, 192, 282, 2138, 2139, 2140, 2166, 2167, 2170, 2173, 2327, 4135, 
-  20616, 
-};
-
-static const unsigned short dep172[] = {
-  40, 41, 70, 76, 77, 82, 84, 97, 111, 137, 138, 139, 140, 142, 143, 153, 155, 
-  158, 162, 171, 173, 175, 185, 192, 282, 2138, 2139, 2140, 2166, 2167, 2170, 
-  2173, 4135, 20616, 
-};
-
-static const unsigned short dep173[] = {
-  77, 78, 97, 101, 102, 269, 270, 282, 284, 285, 
-};
-
-static const unsigned short dep174[] = {
-  40, 41, 47, 62, 78, 80, 86, 97, 99, 102, 137, 138, 158, 160, 161, 162, 175, 
-  185, 190, 191, 192, 269, 270, 282, 284, 285, 2138, 2139, 2140, 2166, 2167, 
-  2170, 2173, 4135, 20616, 
-};
-
-static const unsigned short dep175[] = {
-  40, 41, 47, 62, 78, 80, 97, 99, 102, 104, 106, 137, 138, 158, 160, 161, 162, 
-  175, 185, 190, 191, 192, 269, 270, 282, 284, 285, 2138, 2139, 2140, 2166, 
-  2167, 2170, 2173, 4135, 20616, 
-};
-
-static const unsigned short dep176[] = {
-  97, 282, 12480, 12481, 12633, 
-};
-
-static const unsigned short dep177[] = {
-  40, 41, 97, 137, 138, 158, 162, 175, 185, 190, 191, 282, 2138, 2139, 2140, 
-  2166, 2167, 2170, 2173, 4135, 12633, 20616, 
-};
-
-static const unsigned short dep178[] = {
-  97, 282, 6219, 6220, 6411, 
-};
-
-static const unsigned short dep179[] = {
-  40, 41, 97, 137, 138, 158, 162, 175, 185, 190, 191, 282, 2138, 2139, 2140, 
-  2166, 2167, 2170, 2173, 4135, 6411, 20616, 
-};
-
-static const unsigned short dep180[] = {
-  97, 282, 6237, 6424, 
-};
-
-static const unsigned short dep181[] = {
-  40, 41, 97, 137, 138, 158, 162, 175, 185, 190, 191, 282, 2138, 2139, 2140, 
-  2166, 2167, 2170, 2173, 4135, 6424, 20616, 
-};
-
-static const unsigned short dep182[] = {
-  97, 282, 6255, 6256, 6257, 6258, 6435, 6437, 8484, 
-};
-
-static const unsigned short dep183[] = {
-  40, 41, 97, 137, 138, 158, 162, 175, 185, 190, 191, 282, 2138, 2139, 2140, 
-  2166, 2167, 2170, 2173, 4135, 6258, 6436, 6437, 8304, 8483, 20616, 
-};
-
-static const unsigned short dep184[] = {
-  97, 282, 6259, 6260, 6438, 
-};
-
-static const unsigned short dep185[] = {
-  40, 41, 97, 137, 138, 158, 162, 175, 185, 190, 191, 282, 2138, 2139, 2140, 
-  2166, 2167, 2170, 2173, 4135, 6438, 20616, 
-};
-
-static const unsigned short dep186[] = {
-  97, 282, 6261, 6439, 
-};
-
-static const unsigned short dep187[] = {
-  40, 41, 97, 137, 138, 158, 162, 175, 185, 190, 191, 282, 2138, 2139, 2140, 
-  2166, 2167, 2170, 2173, 4135, 6439, 20616, 
-};
-
-static const unsigned short dep188[] = {
-  97, 282, 10350, 10530, 
-};
-
-static const unsigned short dep189[] = {
-  40, 41, 97, 137, 138, 158, 162, 175, 185, 190, 191, 282, 2138, 2139, 2140, 
-  2166, 2167, 2170, 2173, 4135, 10530, 20616, 
-};
-
-static const unsigned short dep190[] = {
-  77, 78, 82, 83, 97, 101, 102, 269, 270, 272, 273, 282, 284, 285, 
-};
-
-static const unsigned short dep191[] = {
-  40, 41, 47, 62, 78, 80, 83, 86, 97, 99, 102, 137, 138, 158, 160, 161, 162, 
-  175, 185, 190, 191, 192, 269, 270, 272, 274, 282, 284, 285, 2138, 2139, 2140, 
-  2166, 2167, 2170, 2173, 4135, 20616, 
-};
-
-static const unsigned short dep192[] = {
-  77, 78, 97, 101, 102, 104, 105, 269, 270, 282, 284, 285, 286, 287, 
-};
-
-static const unsigned short dep193[] = {
-  40, 41, 47, 62, 78, 80, 97, 99, 102, 104, 106, 137, 138, 158, 160, 161, 162, 
-  175, 185, 190, 191, 192, 269, 270, 282, 284, 285, 286, 287, 2138, 2139, 2140, 
-  2166, 2167, 2170, 2173, 4135, 20616, 
-};
-
-static const unsigned short dep194[] = {
-  40, 41, 97, 137, 138, 158, 162, 175, 185, 190, 191, 282, 2138, 2139, 2140, 
-  2166, 2167, 2170, 2173, 2327, 4135, 12481, 20616, 
-};
-
-static const unsigned short dep195[] = {
-  40, 41, 97, 137, 138, 158, 162, 175, 185, 190, 191, 282, 2138, 2139, 2140, 
-  2166, 2167, 2170, 2173, 2327, 4135, 6219, 20616, 
-};
-
-static const unsigned short dep196[] = {
-  40, 41, 97, 137, 138, 158, 162, 175, 185, 190, 191, 282, 2138, 2139, 2140, 
-  2166, 2167, 2170, 2173, 2327, 4135, 6237, 20616, 
-};
-
-static const unsigned short dep197[] = {
-  40, 41, 97, 137, 138, 158, 162, 175, 185, 190, 191, 282, 2138, 2139, 2140, 
-  2166, 2167, 2170, 2173, 2327, 4135, 6257, 8303, 20616, 
-};
-
-static const unsigned short dep198[] = {
-  40, 41, 97, 137, 138, 158, 162, 175, 185, 190, 191, 282, 2138, 2139, 2140, 
-  2166, 2167, 2170, 2173, 2327, 4135, 6259, 20616, 
-};
-
-static const unsigned short dep199[] = {
-  40, 41, 97, 137, 138, 158, 162, 175, 183, 184, 185, 282, 2138, 2139, 2140, 
-  2166, 2167, 2170, 2173, 2327, 4135, 6260, 6261, 20616, 
-};
-
-static const unsigned short dep200[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 2138, 2139, 2140, 2166, 2167, 2170, 2173, 
-  2327, 4135, 10350, 20616, 
-};
-
-static const unsigned short dep201[] = {
-  40, 41, 97, 158, 162, 175, 185, 190, 191, 282, 2138, 2139, 2140, 2166, 2167, 
-  2170, 2173, 2327, 4135, 6186, 20616, 
-};
-
-static const unsigned short dep202[] = {
-  77, 79, 80, 97, 98, 99, 100, 268, 269, 282, 283, 284, 
-};
-
-static const unsigned short dep203[] = {
-  40, 41, 78, 79, 83, 85, 97, 100, 102, 104, 107, 137, 138, 158, 162, 175, 185, 
-  190, 191, 192, 268, 270, 282, 283, 285, 2138, 2139, 2140, 2166, 2167, 2170, 
-  2173, 4135, 20616, 
-};
-
-static const unsigned short dep204[] = {
-  77, 79, 80, 81, 97, 98, 99, 100, 103, 268, 269, 271, 282, 283, 284, 
-};
-
-static const unsigned short dep205[] = {
-  40, 41, 78, 79, 81, 83, 85, 97, 100, 102, 103, 104, 107, 137, 138, 158, 162, 
-  175, 185, 190, 191, 192, 268, 270, 271, 282, 283, 285, 2138, 2139, 2140, 2166, 
-  2167, 2170, 2173, 4135, 20616, 
-};
-
-static const unsigned short dep206[] = {
-  77, 79, 80, 84, 85, 86, 97, 98, 99, 100, 268, 269, 274, 275, 282, 283, 284, 
-  
-};


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

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:52 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYu-00043G-MD; Fri, 14 Sep 2012 10:55:52 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYr-0003yh-PL
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:50 +0000
Received: from [85.158.143.99:61946] by server-1.bemta-4.messagelabs.com id
	0C/18-12504-53D03505; Fri, 14 Sep 2012 10:55:49 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-216.messagelabs.com!1347620135!20564898!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24804 invoked from network); 14 Sep 2012 10:55:36 -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;
	14 Sep 2012 10:55:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYd-00015i-9h
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYd-0000pD-6V
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:35 +0000
Message-Id: <E1TCTYd-0000pD-6V@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:34 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools: drop ia64 support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============4968845350088557548=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============4968845350088557548==
Content-Type: text/plain

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1347468927 -3600
# Node ID 485e6db28b93d69e33628635eb562ea6f5179c90
# Parent  a1bd69b08e9eb4a5dca1b0408e34d49fda767b81
tools: drop ia64 support

Removed support from libxc and mini-os.

This also took me under xen/include/public via various symlinks.

Dropped tools/debugger/xenitp entirely, it was described upon commit
as:
"Xenitp is a low-level debugger for ia64" and doesn't appear to be
linked into the build anywhere.

 99 files changed, 14 insertions(+), 32361 deletions(-)

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/Config.mk
--- a/extras/mini-os/Config.mk	Wed Sep 12 16:12:42 2012 +0100
+++ b/extras/mini-os/Config.mk	Wed Sep 12 17:55:27 2012 +0100
@@ -9,7 +9,7 @@ export XEN_INTERFACE_VERSION
 
 # Try to find out the architecture family TARGET_ARCH_FAM.
 # First check whether x86_... is contained (for x86_32, x86_32y, x86_64).
-# If not x86 then use $(XEN_TARGET_ARCH) -> for ia64, ...
+# If not x86 then use $(XEN_TARGET_ARCH)
 ifeq ($(findstring x86_,$(XEN_TARGET_ARCH)),x86_)
 TARGET_ARCH_FAM = x86
 else
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/arch/ia64/Makefile
--- a/extras/mini-os/arch/ia64/Makefile	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-#
-# Special makefile for ia64.
-#
-
-XEN_ROOT = $(CURDIR)/../../../..
-include $(XEN_ROOT)/Config.mk
-
-include ../../Config.mk
-
-include arch.mk
-include ../../minios.mk
-
-ARCH_SRCS := sal.c
-ARCH_SRCS += efi.c
-ARCH_SRCS += time.c
-ARCH_SRCS += ivt.S
-ARCH_SRCS += fw.S
-ARCH_SRCS += common.c
-ARCH_SRCS += time.c
-ARCH_SRCS += mm.c
-ARCH_SRCS += debug.c
-ARCH_SRCS += sched.c
-ARCH_SRCS += xencomm.c
-ARCH_SRCS += __umoddi3.S
-ARCH_SRCS += __udivdi3.S
-ARCH_SRCS += __divdi3.S
-
-ARCH_OBJS := sal.o
-ARCH_OBJS += efi.o
-ARCH_OBJS += time.o
-ARCH_OBJS += ivt.o
-ARCH_OBJS += fw.o
-ARCH_OBJS += common.o
-ARCH_OBJS += time.o
-ARCH_OBJS += mm.o
-ARCH_OBJS += debug.o
-ARCH_OBJS += sched.o
-ARCH_OBJS += xencomm.o
-ARCH_OBJS += __umoddi3.o
-ARCH_OBJS += __udivdi3.o
-ARCH_OBJS += __udivsi3.o
-ARCH_OBJS += __divdi3.o
-ARCH_OBJS := $(addprefix $(OBJ_DIR)/,$(ARCH_OBJS))
-
-GEN_OFF_SRC := gen_off.c
-GEN_OFF_ASM := gen_off.s
-GEN_OFF_H   := $(MINI-OS_ROOT)/include/$(ARCH_INC)/offsets.h
-
-all: $(OBJ_DIR)/$(ARCH_LIB)
-
-$(GEN_OFF_ASM): $(GEN_OFF_SRC)
-	$(CC) -S -o $@ $(CPPFLAGS) $<
-
-$(GEN_OFF_H): $(GEN_OFF_ASM)
-	sed -ne "/^->/ {s/->/#define /; p}" < $< > $@
-
-$(OBJ_DIR)/$(ARCH_LIB): $(GEN_OFF_H) $(ARCH_OBJS) $(OBJ_DIR)/$(HEAD_ARCH_OBJ)
-	$(AR) rv $(ARCH_LIB) $(ARCH_OBJS)
-
-clean:
-	rm -f $(OBJ_DIR)/$(ARCH_LIB) $(ARCH_OBJS) $(OBJ_DIR)/$(HEAD_ARCH_OBJ)
-	rm -f $(GEN_OFF_ASM)
-	rm -f $(GEN_OFF_H)
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/arch/ia64/__divdi3.S
--- a/extras/mini-os/arch/ia64/__divdi3.S	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,141 +0,0 @@
-.file "__divdi3.s"
-
-// $FreeBSD: src/sys/libkern/ia64/__divdi3.S,v 1.1 2000/10/04 17:53:03 dfr Exp $
-//  
-// Copyright (c) 2000, Intel Corporation
-// All rights reserved.
-//
-// Contributed 2/15/2000 by Marius Cornea, John Harrison, Cristina Iordache, 
-// Ted Kubaska, Bob Norin, and Shane Story of the Computational Software Lab, 
-// Intel Corporation.
-//
-// WARRANTY DISCLAIMER
-//
-// 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 INTEL OR ITS 
-// 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.
-//
-// Intel Corporation is the author of this code, and requests that all
-// problem reports or change requests be submitted to it directly at
-// http://developer.intel.com/opensource.
-//
-
-.section .text
-.proc __divdi3#
-.align 32
-.global __divdi3#
-.align 32
-
-// 64-bit signed integer divide
-
-__divdi3:
-
-{ .mii
-  alloc r31=ar.pfs,2,0,0,0
-  nop.i 0
-  nop.i 0;;
-} { .mmi
-
-  // 64-BIT SIGNED INTEGER DIVIDE BEGINS HERE
-
-  setf.sig f8=r32
-  setf.sig f9=r33
-  nop.i 0;;
-} { .mfb
-  nop.m 0
-  fcvt.xf f6=f8
-  nop.b 0
-} { .mfb
-  nop.m 0
-  fcvt.xf f7=f9
-  nop.b 0;;
-} { .mfi
-  nop.m 0
-  // Step (1)
-  // y0 = 1 / b in f8
-  frcpa.s1 f8,p6=f6,f7
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // Step (2)
-  // e0 = 1 - b * y0 in f9
-  (p6) fnma.s1 f9=f7,f8,f1
-  nop.i 0
-} { .mfi
-  nop.m 0
-  // Step (3)
-  // q0 = a * y0 in f10
-  (p6) fma.s1 f10=f6,f8,f0
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // Step (4)
-  // e1 = e0 * e0 in f11
-  (p6) fma.s1 f11=f9,f9,f0
-  nop.i 0
-} { .mfi
-  nop.m 0
-  // Step (5)
-  // q1 = q0 + e0 * q0 in f10
-  (p6) fma.s1 f10=f9,f10,f10
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // Step (6)
-  // y1 = y0 + e0 * y0 in f8
-  (p6) fma.s1 f8=f9,f8,f8
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // Step (7)
-  // q2 = q1 + e1 * q1 in f9
-  (p6) fma.s1 f9=f11,f10,f10
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // Step (8)
-  // y2 = y1 + e1 * y1 in f8
-  (p6) fma.s1 f8=f11,f8,f8
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // Step (9)
-  // r2 = a - b * q2 in f10
-  (p6) fnma.s1 f10=f7,f9,f6
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // Step (10)
-  // q3 = q2 + r2 * y2 in f8
-  (p6) fma.s1 f8=f10,f8,f9
-  nop.i 0;;
-} { .mfb
-  nop.m 0
-  // Step (11)
-  // q = trunc (q3)
-  fcvt.fx.trunc.s1 f8=f8
-  nop.b 0;;
-} { .mmi
-  // quotient will be in r8 (if b != 0)
-  getf.sig r8=f8
-  nop.m 0
-  nop.i 0;;
-}
-
-  // 64-BIT SIGNED INTEGER DIVIDE ENDS HERE
-
-{ .mmb
-  nop.m 0
-  nop.m 0
-  br.ret.sptk b0;;
-}
-
-.endp __divdi3
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/arch/ia64/__udivdi3.S
--- a/extras/mini-os/arch/ia64/__udivdi3.S	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,142 +0,0 @@
-.file "__udivdi3.s"
-
-// $FreeBSD: src/sys/libkern/ia64/__udivdi3.S,v 1.1 2000/10/04 17:53:03 dfr Exp $
-//  
-// Copyright (c) 2000, Intel Corporation
-// All rights reserved.
-//
-// Contributed 2/15/2000 by Marius Cornea, John Harrison, Cristina Iordache, 
-// Ted Kubaska, Bob Norin, and Shane Story of the Computational Software Lab, 
-// Intel Corporation.
-//
-// WARRANTY DISCLAIMER
-//
-// 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 INTEL OR ITS 
-// 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.
-//
-// Intel Corporation is the author of this code, and requests that all
-// problem reports or change requests be submitted to it directly at
-// http://developer.intel.com/opensource.
-//
-
-.section .text
-.proc __udivdi3#
-.align 32
-.global __udivdi3#
-.align 32
-
-// 64-bit unsigned integer divide
-
-__udivdi3:
-
-{ .mii
-  alloc r31=ar.pfs,2,0,0,0
-  nop.i 0
-  nop.i 0;;
-}
-
-{ .mmi
-
-  // 64-BIT UNSIGNED INTEGER DIVIDE BEGINS HERE
-
-  setf.sig f8=r32
-  setf.sig f9=r33
-  nop.i 0;;
-} { .mfb
-  nop.m 0
-  fma.s1 f6=f8,f1,f0
-  nop.b 0
-} { .mfb
-  nop.m 0
-  fma.s1 f7=f9,f1,f0
-  nop.b 0;;
-} { .mfi
-  nop.m 0
-  // Step (1)
-  // y0 = 1 / b in f8
-  frcpa.s1 f8,p6=f6,f7
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // Step (2)
-  // e0 = 1 - b * y0 in f9
-  (p6) fnma.s1 f9=f7,f8,f1
-  nop.i 0
-} { .mfi
-  nop.m 0
-  // Step (3)
-  // q0 = a * y0 in f10
-  (p6) fma.s1 f10=f6,f8,f0
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // Step (4)
-  // e1 = e0 * e0 in f11
-  (p6) fma.s1 f11=f9,f9,f0
-  nop.i 0
-} { .mfi
-  nop.m 0
-  // Step (5)
-  // q1 = q0 + e0 * q0 in f10
-  (p6) fma.s1 f10=f9,f10,f10
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // Step (6)
-  // y1 = y0 + e0 * y0 in f8
-  (p6) fma.s1 f8=f9,f8,f8
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // Step (7)
-  // q2 = q1 + e1 * q1 in f9
-  (p6) fma.s1 f9=f11,f10,f10
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // Step (8)
-  // y2 = y1 + e1 * y1 in f8
-  (p6) fma.s1 f8=f11,f8,f8
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // Step (9)
-  // r2 = a - b * q2 in f10
-  (p6) fnma.s1 f10=f7,f9,f6
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // Step (10)
-  // q3 = q2 + r2 * y2 in f8
-  (p6) fma.s1 f8=f10,f8,f9
-  nop.i 0;;
-} { .mfb
-  nop.m 0
-  // (11) q = trunc(q3)
-  fcvt.fxu.trunc.s1 f8=f8
-  nop.b 0;;
-} { .mmi
-  // quotient will be in r8 (if b != 0)
-  getf.sig r8=f8
-  nop.m 0
-  nop.i 0;;
-}
-
-  // 64-BIT UNSIGNED INTEGER DIVIDE ENDS HERE
-
-{ .mmb
-  nop.m 0
-  nop.m 0
-  br.ret.sptk b0;;
-}
-
-.endp __udivdi3
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/arch/ia64/__udivsi3.S
--- a/extras/mini-os/arch/ia64/__udivsi3.S	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,124 +0,0 @@
-.file "__udivsi3.s"
-
-// $FreeBSD: src/sys/libkern/ia64/__udivsi3.S,v 1.1.8.1 2005/01/31 23:26:21 imp Exp $
-
-//-
-// Copyright (c) 2000, Intel Corporation
-// All rights reserved.
-//
-// Contributed 2/15/2000 by Marius Cornea, John Harrison, Cristina Iordache, 
-// Ted Kubaska, Bob Norin, and Shane Story of the Computational Software Lab, 
-// Intel Corporation.
-//
-// WARRANTY DISCLAIMER
-//
-// 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 INTEL OR ITS 
-// 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.
-//
-// Intel Corporation is the author of this code, and requests that all
-// problem reports or change requests be submitted to it directly at
-// http://developer.intel.com/opensource.
-//
-
-.section .text
-
-// 32-bit unsigned integer divide
-
-.proc __udivsi3#
-.align 32
-.global __udivsi3#
-.align 32
-
-__udivsi3:
-
-{ .mii
-  alloc r31=ar.pfs,2,0,0,0
-  nop.i 0
-  nop.i 0;;
-} { .mii
-  nop.m 0
-
-  // 32-BIT UNSIGNED INTEGER DIVIDE BEGINS HERE
-
-  // general register used:
-  //    r32 - 32-bit unsigned integer dividend
-  //    r33 - 32-bit unsigned integer divisor
-  //    r8 - 32-bit unsigned integer result
-  //    r2 - scratch register
-  // floating-point registers used: f6, f7, f8, f9
-  // predicate registers used: p6
-
-  zxt4 r32=r32
-  zxt4 r33=r33;;
-} { .mmb
-  setf.sig f6=r32
-  setf.sig f7=r33
-  nop.b 0;;
-} { .mfi
-  nop.m 0
-  fcvt.xf f6=f6
-  nop.i 0
-} { .mfi
-  nop.m 0
-  fcvt.xf f7=f7
-  mov r2 = 0x0ffdd;;
-} { .mfi
-  setf.exp f9 = r2
-  // (1) y0
-  frcpa.s1 f8,p6=f6,f7
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // (2) q0 = a * y0
-  (p6) fma.s1 f6=f6,f8,f0
-  nop.i 0
-} { .mfi
-  nop.m 0
-  // (3) e0 = 1 - b * y0
-  (p6) fnma.s1 f7=f7,f8,f1
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // (4) q1 = q0 + e0 * q0
-  (p6) fma.s1 f6=f7,f6,f6
-  nop.i 0
-} { .mfi
-  nop.m 0
-  // (5) e1 = e0 * e0 + 2^-34
-  (p6) fma.s1 f7=f7,f7,f9
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // (6) q2 = q1 + e1 * q1
-  (p6) fma.s1 f8=f7,f6,f6
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // (7) q = trunc(q2)
-  fcvt.fxu.trunc.s1 f8=f8
-  nop.i 0;;
-} { .mmi
-  // quotient will be in the least significant 32 bits of r8 (if b != 0)
-  getf.sig r8=f8
-  nop.m 0
-  nop.i 0;;
-}
-
-  // 32-BIT UNSIGNED INTEGER DIVIDE ENDS HERE
-
-{ .mmb
-  nop.m 0
-  nop.m 0
-  br.ret.sptk b0;;
-}
-
-.endp __udivsi3
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/arch/ia64/__umoddi3.S
--- a/extras/mini-os/arch/ia64/__umoddi3.S	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,154 +0,0 @@
-.file "__umoddi3.s"
-
-// $FreeBSD: src/sys/libkern/ia64/__umoddi3.S,v 1.3 2003/02/11 20:15:11 schweikh Exp $
-//  
-// Copyright (c) 2000, Intel Corporation
-// All rights reserved.
-//
-// Contributed 2/15/2000 by Marius Cornea, John Harrison, Cristina Iordache, 
-// Ted Kubaska, Bob Norin, and Shane Story of the Computational Software Lab, 
-// Intel Corporation.
-//
-// WARRANTY DISCLAIMER
-//
-// 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 INTEL OR ITS 
-// 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.
-//
-// Intel Corporation is the author of this code, and requests that all
-// problem reports or change requests be submitted to it directly at
-// http://developer.intel.com/opensource.
-//
-
-.section .text
-
-  // 64-bit unsigned integer remainder
-
-.proc __umoddi3#
-.align 32
-.global __umoddi3#
-.align 32
-
-__umoddi3:
-
-{ .mii
-  alloc r31=ar.pfs,3,0,0,0
-  nop.i 0
-  nop.i 0
-} { .mmb
-
-  // 64-BIT UNSIGNED INTEGER REMAINDER BEGINS HERE
-
-  // general register used:
-  //    r32 - 64-bit unsigned integer dividend, called a below
-  //    r33 - 64-bit unsigned integer divisor, called b below
-  //    r8 - 64-bit unsigned integer result
-  // floating-point registers used: f6, f7, f8, f9, f10, f11, f12
-  // predicate registers used: p6
-
-  setf.sig f12=r32  // holds a in integer form
-  setf.sig f7=r33
-  nop.b 0;;
-} { .mfi
-  // get 2s complement of b
-  sub r33=r0,r33
-  fcvt.xuf.s1 f6=f12
-  nop.i 0
-} { .mfi
-  nop.m 0
-  fcvt.xuf.s1 f7=f7
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // Step (1)
-  // y0 = 1 / b in f8
-  frcpa.s1 f8,p6=f6,f7
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // Step (2)
-  // q0 = a * y0 in f10
-  (p6) fma.s1 f10=f6,f8,f0
-  nop.i 0
-} { .mfi
-  nop.m 0
-  // Step (3)
-  // e0 = 1 - b * y0 in f9
-  (p6) fnma.s1 f9=f7,f8,f1
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // Step (4)
-  // q1 = q0 + e0 * q0 in f10
-  (p6) fma.s1 f10=f9,f10,f10
-  nop.i 0
-} { .mfi
-  nop.m 0
-  // Step (5)
-  // e1 = e0 * e0 in f11
-  (p6) fma.s1 f11=f9,f9,f0
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // Step (6)
-  // y1 = y0 + e0 * y0 in f8
-  (p6) fma.s1 f8=f9,f8,f8
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // Step (7)
-  // q2 = q1 + e1 * q1 in f9
-  (p6) fma.s1 f9=f11,f10,f10
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // Step (8)
-  // y2 = y1 + e1 * y1 in f8
-  (p6) fma.s1 f8=f11,f8,f8
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // Step (9)
-  // r2 = a - b * q2 in f10
-  (p6) fnma.s1 f10=f7,f9,f6
-  nop.i 0;;
-} { .mfi
-  // f7=-b
-  setf.sig f7=r33
-  // Step (10)
-  // q3 = q2 + r2 * y2 in f8
-  (p6) fma.s1 f8=f10,f8,f9
-  nop.i 0;;
-} { .mfi
-  nop.m 0
-  // (11) q = trunc(q3)
-  fcvt.fxu.trunc.s1 f8=f8
-  nop.i 0;;
-}  { .mfi
-  nop.m 0
-  // (12) r = a + (-b) * q
-  xma.l f8=f8,f7,f12
-  nop.i 0;;
-}  { .mib
-  getf.sig r8=f8
-  nop.i 0
-  nop.b 0
-}
-
-  // 64-BIT UNSIGNED INTEGER REMAINDER ENDS HERE
-
-{ .mib
-  nop.m 0
-  nop.i 0
-  br.ret.sptk b0;;
-}
-
-.endp __umoddi3
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/arch/ia64/arch.mk
--- a/extras/mini-os/arch/ia64/arch.mk	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-
-ARCH_CFLAGS := -mfixed-range=f2-f5,f12-f15,f32-f127 -mconstant-gp
-ARCH_CFLAGS += -O2
-ARCH_ASFLAGS := -x assembler-with-cpp
-ARCH_ASFLAGS += -mfixed-range=f2-f5,f12-f15,f32-f127 -fomit-frame-pointer
-ARCH_ASFLAGS += -fno-builtin -fno-common -fno-strict-aliasing -mconstant-gp
-
-ARCH_LDFLAGS = -warn-common
-
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/arch/ia64/common.c
--- a/extras/mini-os/arch/ia64/common.c	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,266 +0,0 @@
-/*
- * Done by Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
- *
- ****************************************************************************
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
- *
- ****************************************************************************
- *
- * Parts are taken from FreeBSD.
- *
- */
-
-
-#include <mini-os/os.h>
-#include <mini-os/types.h>
-#include <mini-os/lib.h>
-#include <mini-os/page.h>
-#include <xen/xen.h>
-#include <mini-os/privop.h>
-#include <xen/callback.h>
-#include <mini-os/ia64_cpu.h>
-#include <mini-os/hypervisor.h>
-#include <mini-os/events.h>
-#include <mini-os/console.h>
-#include <mini-os/time.h>
-#include <mini-os/xmalloc.h>
-
-
-/* For more console boot messages. */
-int bootverbose;
-
-/*
- * This structure contains start-of-day info, such as pagetable base pointer,
- * address of the shared_info structure, and things like that.
- */
-union start_info_union start_info_union;
-
-shared_info_t *HYPERVISOR_shared_info = (shared_info_t *)XSI_BASE;
-
-struct machine_fw machineFwG;
-
-/* This pointer is initialized in ia64.S with the address of the boot param
- * area passed by the bootloader. */
-struct xen_ia64_boot_param* ia64_boot_paramP;
-
-struct xen_ia64_boot_param ia64BootParamG;
-char boot_cmd_line[COMMAND_LINE_SIZE+1];
-
-
-void
-ia64_write_itr_i(ia64_pte_t* pteP, uint32_t reg, uint64_t vAddr,
-		  uint64_t ps, uint64_t pk)
-{
-	/* The virtual address. */
-	__asm __volatile("mov	cr.ifa=%0" :: "r"(vAddr));
-	/* The page size */
-	__asm __volatile("mov	cr.itir=%0;;" :: "r"((ps << IA64_ITIR_PS)|(pk << IA64_ITIR_KEY)));
-	/* Put pte into instruction translation register. */ 
-	__asm __volatile("itr.i	itr[%0]=%1" :: "r"(reg), "r"(*(uint64_t*)pteP));
-	/* Serialization */
-	__asm __volatile("srlz.i");
-}
-
-void
-map_pal_code(void)
-{
-	ia64_pte_t pte;
-
-	xen_set_virtual_psr_ic(0);
-	memset(&pte, 0, sizeof(pte));		/* Prepare the pte */
-	pte.pte_p = 1;				/* present bit */
-	pte.pte_ma = PTE_MA_WB;			/* memory attribute */
-	pte.pte_a = 1;				/* accessed bit */
-	pte.pte_d = 1;				/* dirty bit */
-	pte.pte_pl = PTE_PL_KERN;		/* privilege level */
-	pte.pte_ar = PTE_AR_RWX;		/* access rights */
-	pte.pte_ppn = ((uint64_t) __pa(machineFwG.ia64_pal_base)) >> 14;
-	pte.pte_ed = 0;				/* exception deferral */
-
-	/*
-	 * Must purge here because a itc/dtc with the same address
-	 * may be in the tlb!
-	 */
-	ia64_ptc_l(machineFwG.ia64_pal_base, PTE_PS_16K);
-	ia64_write_itr_i(&pte, IA64_TR_PAL,
-			 (uint64_t)machineFwG.ia64_pal_base,
-			 PTE_PS_16K, IA64_KEY_REG7);
-	xen_set_virtual_psr_ic(1);
-}
-
-/* In ivt.S */
-extern char hypervisor_callback;
-
-static void
-registerCallback(void)
-{
-	struct callback_register event =
-	{
-		.type = CALLBACKTYPE_event,
-		.address = (unsigned long)&hypervisor_callback,
-	};
-	HYPERVISOR_callback_op(CALLBACKOP_register, &event);
-}
-
-static void
-init_start_info(start_info_t* xen_start_info)
-{
-	/* Make a copy of the start_info structure */
-	start_info.nr_pages = xen_start_info->nr_pages;
-	start_info.shared_info = xen_start_info->shared_info;
-	start_info.flags = xen_start_info->flags;
-	start_info.store_mfn = xen_start_info->store_mfn;
-	start_info.store_evtchn	= xen_start_info->store_evtchn;
-	start_info.console.domU.mfn = xen_start_info->console.domU.mfn;
-	start_info.console.domU.evtchn =
-				xen_start_info->console.domU.evtchn;
-	start_info.pt_base = xen_start_info->pt_base;
-	start_info.nr_pt_frames	= xen_start_info->nr_pt_frames;
-	start_info.mfn_list = xen_start_info->mfn_list;
-	start_info.mod_start = xen_start_info->mod_start;
-	start_info.mod_len = xen_start_info->mod_len;
-}
-
-static void
-init_boot_params(void)
-{
-	ia64BootParamG.command_line = ia64_boot_paramP->command_line;
-	ia64BootParamG.efi_systab = ia64_boot_paramP->efi_systab;
-	ia64BootParamG.efi_memmap = ia64_boot_paramP->efi_memmap;
-	ia64BootParamG.efi_memmap_size = ia64_boot_paramP->efi_memmap_size;
-	ia64BootParamG.efi_memdesc_size	= ia64_boot_paramP->efi_memdesc_size;
-	ia64BootParamG.efi_memdesc_version =
-				ia64_boot_paramP->efi_memdesc_version;
-	ia64BootParamG.console_info.num_cols =
-				ia64_boot_paramP->console_info.num_cols;
-	ia64BootParamG.console_info.num_rows =
-				ia64_boot_paramP->console_info.num_rows;
-	ia64BootParamG.console_info.orig_x =
-				ia64_boot_paramP->console_info.orig_x;
-	ia64BootParamG.console_info.orig_y =
-				ia64_boot_paramP->console_info.orig_y;
-	ia64BootParamG.fpswa = ia64_boot_paramP->fpswa;
-	ia64BootParamG.initrd_start = ia64_boot_paramP->initrd_start;
-	ia64BootParamG.initrd_size = ia64_boot_paramP->initrd_size;
-	ia64BootParamG.domain_start = ia64_boot_paramP->domain_start;
-	ia64BootParamG.domain_size = ia64_boot_paramP->domain_size;
-
-	/*
-	 * Copy and parse the boot command line.
-	 * Currently only a check of bootverbose is done.
-	 */
-	memset(boot_cmd_line, 0, sizeof(boot_cmd_line));
-	strncpy(boot_cmd_line,
-		(char*)__va(ia64BootParamG.command_line), COMMAND_LINE_SIZE);
-	boot_cmd_line[COMMAND_LINE_SIZE - 1] = '\0';
-
-	/* Look for bootverbose. */
-	if (strstr(boot_cmd_line, "bootverbose"))
-		bootverbose = 1;
-}
-
-static void
-set_opt_feature(void)
-{
-	struct xen_ia64_opt_feature optf;
-
-	optf.cmd = XEN_IA64_OPTF_IDENT_MAP_REG7;
-	optf.on = XEN_IA64_OPTF_ON;
-	optf.pgprot = ((1 << PTE_OFF_P) | (1 << PTE_OFF_A) | (1 << PTE_OFF_D) |
-		       (PTE_MA_WB << PTE_OFF_MA) |
-		       (PTE_PL_KERN << PTE_OFF_PL) |
-		       (PTE_AR_RW << PTE_OFF_AR));
-	optf.key = IA64_KEY_REG7;
-	HYPERVISOR_opt_feature(&optf);
-}
-
-void
-arch_init(start_info_t *si)
-{
-	efi_time_t tm;
-	static int initialized;
-
-	if (initialized)
-		return;
-
-	init_start_info(si);
-
-	init_boot_params();
-
-	init_efi();
-
-	map_pal_code();
-
-	ia64_sal_init(machineFwG.ia64_sal_tableP);
-
-	if (efi_get_time(&tm)) {
-		printk("EFI-SystemTime: %d.%d.%d   %d:%d:%d",
-		       tm.Day, tm.Month, tm.Year,
-		       tm.Hour, tm.Minute, tm.Second);
-
-		if (tm.TimeZone == EFI_UNSPECIFIED_TIMEZONE)
-			printk("   Timezone not specified!\n");
-		else
-			printk("   TimeZone: %d Daylight: 0x%x\n",
-			       tm.TimeZone, tm.Daylight);
-	} else 
-		printk("efi_get_time() failed\n");
-
-	registerCallback();
-
-	set_opt_feature();
-
-	initialized = 1;
-}
-
-void
-arch_fini(void)
-{
-	/* TODO */
-}
-
-void
-arch_print_info(void)
-{
-	int major, minor;
-
-	minor = HYPERVISOR_xen_version(XENVER_version, 0);
-	major = minor >> 16;
-	minor &= ~0xffffffff;
-	printk("Running on Xen version: %d.%d\n", major, minor);
-#if 0
-	printk("machine addr of shared_info_t  : 0x%lx\n",
-	       start_info.shared_info);
-	printk("machine page number of shared page: 0x%lx\n",
-	       start_info.store_mfn);
-	printk("evtchn for store communication : %d\n",
-	       start_info.store_evtchn);
-	printk("MACHINE address of console page: 0x%lx\n",
-	       start_info.console.domU.mfn);
-	printk("evtchn for console messages    : %d\n",
-	       start_info.console.domU.evtchn);
-#endif
-	if(strlen(boot_cmd_line) > 0)
-		printk("xen_guest_cmdline              : %s\n", boot_cmd_line);
-}
-
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/arch/ia64/debug.c
--- a/extras/mini-os/arch/ia64/debug.c	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,168 +0,0 @@
-/* 
- ****************************************************************************
- * Done by Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com
- *
- * Description:	ia64 specific part of the mini-os
- * 		Prints debug information on a crash of mini-os
- *
- * Parts are taken from FreeBSD.
- *
- ****************************************************************************
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- * 
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
- * DEALINGS IN THE SOFTWARE.
- */
-
-#include <mini-os/os.h>
-
-static const char *ia64_vector_names[] = {
-	"VHPT Translation",			/* 0 */
-	"Instruction TLB",			/* 1 */
-	"Data TLB",				/* 2 */
-	"Alternate Instruction TLB",		/* 3 */
-	"Alternate Data TLB",			/* 4 */
-	"Data Nested TLB",			/* 5 */
-	"Instruction Key Miss",			/* 6 */
-	"Data Key Miss",			/* 7 */
-	"Dirty-Bit",				/* 8 */
-	"Instruction Access-Bit",		/* 9 */
-	"Data Access-Bit",			/* 10 */
-	"Break Instruction",			/* 11 */
-	"External Interrupt",			/* 12 */
-	"Reserved 13",				/* 13 */
-	"Reserved 14",				/* 14 */
-	"Reserved 15",				/* 15 */
-	"Reserved 16",				/* 16 */
-	"Reserved 17",				/* 17 */
-	"Reserved 18",				/* 18 */
-	"Reserved 19",				/* 19 */
-	"Page Not Present",			/* 20 */
-	"Key Permission",			/* 21 */
-	"Instruction Access Rights",		/* 22 */
-	"Data Access Rights",			/* 23 */
-	"General Exception",			/* 24 */
-	"Disabled FP-Register",			/* 25 */
-	"NaT Consumption",			/* 26 */
-	"Speculation",				/* 27 */
-	"Reserved 28",				/* 28 */
-	"Debug",				/* 29 */
-	"Unaligned Reference",			/* 30 */
-	"Unsupported Data Reference",		/* 31 */
-	"Floating-point Fault",			/* 32 */
-	"Floating-point Trap",			/* 33 */
-	"Lower-Privilege Transfer Trap",	/* 34 */
-	"Taken Branch Trap",			/* 35 */
-	"Single Step Trap",			/* 36 */
-	"Reserved 37",				/* 37 */
-	"Reserved 38",				/* 38 */
-	"Reserved 39",				/* 39 */
-	"Reserved 40",				/* 40 */
-	"Reserved 41",				/* 41 */
-	"Reserved 42",				/* 42 */
-	"Reserved 43",				/* 43 */
-	"Reserved 44",				/* 44 */
-	"IA-32 Exception",			/* 45 */
-	"IA-32 Intercept",			/* 46 */
-	"IA-32 Interrupt",			/* 47 */
-	"Reserved 48",				/* 48 */
-	"Reserved 49",				/* 49 */
-	"Reserved 50",				/* 50 */
-	"Reserved 51",				/* 51 */
-	"Reserved 52",				/* 52 */
-	"Reserved 53",				/* 53 */
-	"Reserved 54",				/* 54 */
-	"Reserved 55",				/* 55 */
-	"Reserved 56",				/* 56 */
-	"Reserved 57",				/* 57 */
-	"Reserved 58",				/* 58 */
-	"Reserved 59",				/* 59 */
-	"Reserved 60",				/* 60 */
-	"Reserved 61",				/* 61 */
-	"Reserved 62",				/* 62 */
-	"Reserved 63",				/* 63 */
-	"Reserved 64",				/* 64 */
-	"Reserved 65",				/* 65 */
-	"Reserved 66",				/* 66 */
-	"Reserved 67",				/* 67 */
-};
-
-typedef struct
-{
-	uint64_t sof	:7;	/* 0-6 size of frame */
-	uint64_t sol	:7;	/* 7-13 size of locals (in + loc) */
-	uint64_t sor	:4;
-	uint64_t rrb_gr	:7;
-	uint64_t rrb_fr	:7;
-	uint64_t rrb_pr	:6;
-	uint64_t res	:25;	/* reserved */
-	uint64_t v	:1;	/* The v bit */
-} ifs_t;
-
-void
-do_trap_error(trap_frame_t* tf)
-{
-	ifs_t curIfs;
-
-	printk("TRAP in mini-os:\n");
-	printk("  trap: %d (%s)\n", tf->trap_num,
-	       ia64_vector_names[tf->trap_num]);
-	printk("  iip : 0x%.16lx  ifa: 0x%.16lx\n", tf->iip, tf->ifa);
-	printk("  ipsr: 0x%.16lx  ifs: 0x%.16lx\n", tf->ipsr, tf->ifs);
-	printk("  isr : 0x%.16lx\n", tf->isr);
-	printk("  gp  : 0x%.16lx  sp : 0x%.16lx\n", tf->gp, tf->sp);
-	printk("  rp  : 0x%.16lx  tp : 0x%.16lx\n", tf->b0, tf->tp);
-	printk("  b6  : 0x%.16lx  b7 : 0x%.16lx\n", tf->b6, tf->b7);
-	printk("  r8  : 0x%.16lx\n", tf->r8);
-	printk("  bsp : 0x%.16lx  rsc: 0x%.16lx\n", tf->bsp, tf->rsc);
-	printk("  r14 : 0x%.16lx  r15: 0x%.16lx\n", tf->r14, tf->r15);
-	printk("  r16 : 0x%.16lx  r17: 0x%.16lx\n", tf->r16, tf->r17);
-	printk("  r18 : 0x%.16lx  r19: 0x%.16lx\n", tf->r18, tf->r19);
-	printk("  r20 : 0x%.16lx  r21: 0x%.16lx\n", tf->r20, tf->r21);
-	printk("  r22 : 0x%.16lx  r23: 0x%.16lx\n", tf->r22, tf->r23);
-	printk("  r24 : 0x%.16lx  r25: 0x%.16lx\n", tf->r24, tf->r25);
-	printk("  r26 : 0x%.16lx  r27: 0x%.16lx\n", tf->r26, tf->r27);
-	printk("  r28 : 0x%.16lx  r29: 0x%.16lx\n", tf->r28, tf->r29);
-	printk("  r30 : 0x%.16lx  r31: 0x%.16lx\n", tf->r30, tf->r31);
-
-	__asm __volatile("flushrs;;");
-	curIfs = *((ifs_t*)((void*)(&tf->ifs)));
-	if (!curIfs.v)
-		printk(" ifs.v = 0");
-	else {
-		uint64_t* regP;
-		uint32_t  i;
-
-		printk("  cfm.sof: %d  cfm.sol: %d\n", curIfs.sof, curIfs.sol);
-		regP = (uint64_t *)(tf->bsp + tf->ndirty);
-		for (i = curIfs.sof; i != 0; ) {
-			if (i <= (((uint64_t)regP & 0x000001f8) >> 3)) {
-				regP -= i;
-				i = 0;
-				break;
-			}
-			i -= ((uint64_t)regP & 0x000001f8) >> 3;
-			regP = (uint64_t *)((uint64_t)regP & ~0x000001ff) - 1;
-		}
-		for (i = 0; i < curIfs.sof; i++) {
-			if (((uint64_t)regP & 0x000001f8) == 0x000001f8)
-				regP++;
-			printk("  r%d: 0x%lx\n",  i+32, *regP);
-			regP++;
-		}
-	}
-	HYPERVISOR_shutdown(SHUTDOWN_poweroff);
-}
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/arch/ia64/efi.c
--- a/extras/mini-os/arch/ia64/efi.c	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,218 +0,0 @@
-/*
- * Done by Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
- * The code is partly taken from FreeBSD.
- *
- ***************************************************************************
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- */
-
-
-#include <mini-os/os.h>
-#include <mini-os/efi.h>
-#include <mini-os/page.h>
-#include <mini-os/lib.h>
-#include <mini-os/console.h>
-
-
-/* The implementation is in fw.S. */
-extern uint64_t
-ia64_call_efi_func(uint64_t funcP,uint64_t a,uint64_t b,uint64_t c,uint64_t d);
-
-int
-efi_get_time(efi_time_t* tmP)
-{
-	memset(tmP, 0, sizeof(efi_time_t));
-	if (ia64_call_efi_func((uint64_t)machineFwG.efi.getTimeF,
-			       (uint64_t)tmP,
-			       (uint64_t)NULL, 0, 0) != EFI_SUCCESS) {
-		printk("efi.getTime() failed\n");
-		return 0;
-	}
-	return 1;
-}
-
-/*
- * The function compares two efi_guid_t and returns 0 on equality, otherwise 1.
- */
-static int
-efi_guid_cmp(efi_guid_t* a_le, efi_guid_t* b)
-{
-	return memcmp(a_le, b, sizeof(efi_guid_t));
-}
-
-void
-init_efi(void)
-{
-	efi_system_table_t* efiSysTableP;
-	int mdcnt, i, numConvMem;
-	efi_memory_descriptor_t *memdP, *mdP;
-	efi_status_t status;
-	char fwVendor[100] = "unknown";
-	efi_char16_t* fwP;
-	efi_runtime_services_t* rsP;
-
-	efi_configuration_table_t* confP = (efi_configuration_table_t*)0;
-	efi_guid_t sal = SAL_SYSTEM_TABLE_GUID;
-	efi_guid_t acpi = ACPI_TABLE_GUID;
-	efi_guid_t acpi20 = ACPI_20_TABLE_GUID;
-	
-	memset(&machineFwG, 0, sizeof(machineFwG));
-	/* Read the efi_system_table.  */
-	efiSysTableP = (efi_system_table_t*)__va(ia64BootParamG.efi_systab);
-	machineFwG.efi.efiSysTableP = efiSysTableP;
-	PRINT_BV("EfiSystemTable at: %p\n", efiSysTableP);
-	fwP = (uint16_t*) __va(efiSysTableP->FirmwareVendor);
-	if (fwP) {
-		for (i = 0; i < (int)sizeof(fwVendor) - 1 && *fwP; ++i)
-			fwVendor[i] = *fwP++;
-		fwVendor[i] = '\0';
-	}
-	PRINT_BV("  EFI-FirmwareVendor        : %s\n", fwVendor);
-	PRINT_BV("  EFI-FirmwareRevision      : %d\n",
-		 efiSysTableP->FirmwareRevision);
-	PRINT_BV("  EFI-SystemTable-Revision  : %d.%d\n",
-		 efiSysTableP->Hdr.Revision >> 16,
-		 efiSysTableP->Hdr.Revision & 0xffff);
-	rsP = (efi_runtime_services_t*)
-		__va(efiSysTableP->RuntimeServices);
-	mdcnt = ia64BootParamG.efi_memmap_size /
-		ia64BootParamG.efi_memdesc_size;
-	memdP = (efi_memory_descriptor_t*) __va(ia64BootParamG.efi_memmap);
-
-	PRINT_BV("EFI-Memorydescriptors: %d\n", mdcnt);
-
-	for (i = numConvMem = 0, mdP = memdP; i < mdcnt; i++,
-	     mdP = NextMemoryDescriptor(mdP, ia64BootParamG.efi_memdesc_size)) {
-		/* Relocate runtime memory segments for firmware. */
-		PRINT_BV("  %d. Type: %x  Attributes: 0x%lx\n",
-			 i, mdP->Type, mdP->Attribute);
-		PRINT_BV("     PhysStart: 0x%lx  NumPages: 0x%lx\n",
-			 mdP->PhysicalStart, mdP->NumberOfPages);
-		switch (mdP->Type) {
-			case EfiRuntimeServicesData:
-				PRINT_BV("     -> EfiRuntimeServicesData\n");
-				break;
-			case EfiACPIReclaimMemory:
-				PRINT_BV("     -> EfiACPIReclaimMemory\n");
-				break;
-			case EfiACPIMemoryNVS:
-				PRINT_BV("     -> EfiACPIMemoryNVS\n");
-				break;
-			case EfiConventionalMemory:
-				PRINT_BV("     -> EfiConventionalMemory\n");
-				PRINT_BV("        start: 0x%lx end: 0x%lx\n",
-					mdP->PhysicalStart,
-					mdP->PhysicalStart +
-					mdP->NumberOfPages * EFI_PAGE_SIZE);
-				if (numConvMem) {
-					printk("     Currently only one efi "
-						"memory chunk supported !!!\n");
-					break;
-				}
-				machineFwG.mach_mem_start = mdP->PhysicalStart;
-				machineFwG.mach_mem_size =
-					mdP->NumberOfPages * EFI_PAGE_SIZE;
-				numConvMem++;
-				break;
-			case EfiMemoryMappedIOPortSpace:
-				PRINT_BV("     -> EfiMemMappedIOPortSpace\n");
-				break;
-			case EfiPalCode:
-                       		machineFwG.ia64_pal_base =
-					__va(mdP->PhysicalStart);
-				PRINT_BV("     -> EfiPalCode\n"
-					 "        start : %p\n",
-					 machineFwG.ia64_pal_base);
-				break;
-		}
-		/* I have to setup the VirtualStart address of every
-		 * RUNTIME-area in preparing the later call of
-		 * SetVirtualAddressMap() therewidth the efi stuff uses
-		 * virtual addressing and the efi runtime functions
-		 * may be called directly.
-		 */
-		if (mdP->Attribute & EFI_MEMORY_RUNTIME) {
-			if (mdP->Attribute & EFI_MEMORY_WB)
-				mdP->VirtualStart = __va(mdP->PhysicalStart);
-			else {
-				if (mdP->Attribute & EFI_MEMORY_UC)
-					printk("efi_init: RuntimeMemory with "
-						"UC attribute !!!!!!\n");
-					/*
-					mdP->VirtualStart =
-					IA64_PHYS_TO_RR6(mdP->PhysicalStart);
-					*/
-			}
-		}
-	}
-	/* Now switch efi runtime stuff to virtual addressing. */
-	status = ia64_call_efi_physical(
-			(void*)__va((uint64_t)rsP->SetVirtualAddressMap),
-			ia64BootParamG.efi_memmap_size,
-			ia64BootParamG.efi_memdesc_size,
-			ia64BootParamG.efi_memdesc_version,
-			ia64BootParamG.efi_memmap);
-	status = EFI_SUCCESS;
-	if (status != EFI_SUCCESS) {
-		printk("warning: unable to switch EFI into virtual "
-		       "(status=%lu)\n", status);
-		return;
-	}
-	/* Getting efi function pointer for getEfiTime. */
-	machineFwG.efi.getTimeF =
-		(efi_get_time_t)__va((uint64_t)rsP->GetTime);
-	/* Getting efi function pointer for resetSystem. */
-	machineFwG.efi.resetSystemF =
-		(efi_reset_system_t)__va((uint64_t)rsP->ResetSystem);
-
-	/* Scanning the Configuration table of the EfiSystemTable. */
-	PRINT_BV("NumberOfConfigTableEntries: %ld\n",
-		 efiSysTableP->NumberOfTableEntries);
-
-	confP = (efi_configuration_table_t*)
-			__va(efiSysTableP->ConfigurationTable);
-	for (i = 0; i < efiSysTableP->NumberOfTableEntries; i++) {
-		if (!efi_guid_cmp(&confP[i].VendorGuid, &sal)) {
-			machineFwG.ia64_sal_tableP = (sal_system_table_t*)
-				__va((uint64_t) confP[i].VendorTable);
-			PRINT_BV("  Found SalSystemTable at: 0x%lx\n",
-				 (uint64_t) machineFwG.ia64_sal_tableP);
-			continue;
-		}
-		if (!efi_guid_cmp(&confP[i].VendorGuid, &acpi)) {
-			machineFwG.ia64_efi_acpi_table =
-				__va((uint64_t) confP[i].VendorTable);
-			PRINT_BV("  Found AcpiTable at:      0x%lx\n",
-				 (uint64_t) machineFwG.ia64_efi_acpi_table);
-			continue;
-		}
-		if (!efi_guid_cmp(&confP[i].VendorGuid, &acpi20)) {
-			machineFwG.ia64_efi_acpi20_table =
-				__va((uint64_t) confP[i].VendorTable);
-			PRINT_BV("  Found Acpi20Table at:    0x%lx\n",
-				 (uint64_t) machineFwG.ia64_efi_acpi20_table);
-			continue;
-		}
-	}
-}
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/arch/ia64/fw.S
--- a/extras/mini-os/arch/ia64/fw.S	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,499 +0,0 @@
-/*
- * Done by Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
- * Parts taken from FreeBSD.
- *
- ***************************************************************************
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- */
-
-
-#include <mini-os/asm.h>
-#include <mini-os/page.h>
-#include <mini-os/ia64_cpu.h>
-#include <mini-os/ia64_fpu.h>
-#include <mini-os/offsets.h>
-#include <mini-os/xen/xen.h>
-
-
-/*
- * ia64_change_mode:	change mode to/from physical mode
- *
- * Arguments:
- *	r14	psr for desired mode
- *
- * Modifies:
- *	r15-r20	scratch
- *	ar.bsp	translated to new mode
- *	sp	translated to new mode
- *	iip	translated to new mode
- */
-ENTRY(ia64_change_mode)
-	rsm	psr.i | psr.ic
-	mov	r19=ar.rsc		// save rsc while we change mode
-	tbit.nz	p8,p9=r14,17		// Uses psr.dt-physical or virtual ?
-			// p8 == true: switch to virtual
-			// p9 == true: switch to physical
-	;;
-	mov	ar.rsc=IA64_RSE_LAZY	// turn off RSE
-	mov	r16=rp
-	;;
-	flushrs				// clean the rse
-	srlz.i
-	;;
-1:	mov	r15=ip
-	mov	r17=ar.bsp
-	mov	r18=ar.rnat
-	;;
-	add	r15=2f-1b,r15		// address to rfi to
-		/* !!! must be the same like in  minios-ia64.lds */
-(p8)	movl	r20=(KERNEL_START - (1<<KERNEL_PHYS_START_SHIFT))
-	;;
-			// (p8): switch to virtual
-			// (p9): switch to physical
-
-		// from virtual to physical
-(p9)	tpa	r15=r15			// ip
-(p9)	tpa	r16=r16			// rp
-(p9)	tpa	r17=r17			// ar.bsp
-(p9)	tpa	sp=sp			// sp
-	;;		/* Needed only for assembler violate ... warnings. */
-		// from physical to virtual
-(p8)	add	r15=r20,r15		// ip
-(p8)	add	r16=r20,r16		// rp
-(p8)	add	r17=r20,r17		// ar.bsp
-(p8)	add	sp=r20,sp		// sp
-	;;
-	mov	ar.bspstore=r17
-	mov	rp=r16
-	;;
-	mov	ar.rnat=r18
-	mov	cr.iip=r15
-	mov	cr.ipsr=r14		// psr for new mode
-	mov	cr.ifs=r0
-	;;
-	rfi
-	;;
-2:	mov	ar.rsc=r19		// restore ar.rsc
-	;;
-	br.ret.sptk.few rp		// now in new mode
-END(ia64_change_mode)
-
-/*
- * ia64_physical_mode:  change mode to physical mode
- *
- * Return:
- *  ret0  psr to restore
- *
- * Modifies:
- *  r15-r18 scratch
- *  ar.bsp  tranlated to physical mode
- *  psr.i cleared
- */
-ENTRY(ia64_physical_mode)
-	mov	r14=psr
-	movl	r15=(IA64_PSR_I|IA64_PSR_IT|IA64_PSR_DT|	\
-			IA64_PSR_RT|IA64_PSR_DFL|IA64_PSR_DFH)
-	;;
-	mov	ret0=r14
-	movl	r16=IA64_PSR_BN
-	;;
-	andcm	r14=r14,r15	// clear various xT bits
-	;;
-	or	r14=r14,r16	// make sure BN=1
-	or	ret0=ret0,r16	// make sure BN=1
-	;;
-	br.cond.sptk.many ia64_change_mode
-END(ia64_physical_mode)
-
-/*
- * ia64_call_efi_physical:	call an EFI procedure in physical mode
- *
- * Arguments:
- *	in0		Address of EFI procedure descriptor
- *	in1-in5		Arguments to EFI procedure
- *
- * Return:
- *	ret0-ret3	return values from EFI
- *
- */
-ENTRY(ia64_call_efi_physical)
-	.prologue
-	.regstk	6,4,5,0
-	.save	ar.pfs,loc0
-	alloc	loc0=ar.pfs,6,4,5,0
-	;;
-	.save	rp,loc1
-	mov	loc1=rp
-	;;
-	.body
-	br.call.sptk.many rp=ia64_physical_mode
-	;;
-
-	mov	loc2=r8			// psr to restore mode
-	mov	loc3=gp			// save kernel gp
-	ld8	r14=[in0],8		// function address
-	;;
-	ld8	gp=[in0]		// function gp value
-	mov	out0=in1
-	mov	out1=in2
-	mov	out2=in3
-	mov	out3=in4
-	mov	out4=in5
-	mov	b6=r14
-	;;
-	br.call.sptk.many rp=b6		// call EFI procedure
-	mov	gp=loc3			// restore kernel gp
-	mov	r14=loc2		// psr to restore mode
-	;;
-	br.call.sptk.many rp=ia64_change_mode
-	;;
-	mov	rp=loc1
-	mov	ar.pfs=loc0
-	;;
-	br.ret.sptk.many rp
-END(ia64_call_efi_physical)
-	
-
-/*
- * struct ia64_pal_result ia64_call_pal_static(uint64_t proc,
- *	uint64_t arg1, uint64_t arg2, uint64_t arg3)
- */
-ENTRY(ia64_call_pal_static)
-	
-	.regstk	4,5,0,0
-palret	=	loc0
-entry	=	loc1
-rpsave	=	loc2
-pfssave =	loc3
-psrsave	=	loc4
-
-	alloc	pfssave=ar.pfs,4,5,0,0
-	;; 
-	mov	rpsave=rp
-
-	movl	entry=@gprel(ia64_pal_entry)
-1:	mov	palret=ip		// for return address
-	;;
-	add	entry=entry,gp
-	mov	psrsave=psr
-	mov	r28=in0			// procedure number
-	;;
-	ld8	entry=[entry]		// read entry point
-	mov	r29=in1			// copy arguments
-	mov	r30=in2
-	mov	r31=in3
-	;;
-	mov	b6=entry
-	add	palret=2f-1b,palret	// calculate return address
-	;;
-	mov	b0=palret
-	rsm	psr.i			// disable interrupts
-	;;
-	br.cond.sptk b6			// call into firmware
-	;;
-	ssm	psr.i			// enable interrupts
-	;;
-2:	mov	psr.l=psrsave
-	mov	rp=rpsave
-	mov	ar.pfs=pfssave
-	;;
-	srlz.d
-	br.ret.sptk rp
-
-END(ia64_call_pal_static)
-
-/*
- * Call a efi function.
- * in0: func descriptor
- * in1: param1
- * ...
- * in5: param5
- */
-ENTRY(ia64_call_efi_func)
-	alloc	loc0=ar.pfs,6,3,5,0
-
-	mov	loc1=gp
-	mov	loc2=rp
-
-	mov	out0=in1
-	mov	out1=in2
-	mov	out2=in3
-	mov	out3=in4
-	mov	out4=in5
-
-	ld8	r14=[in0],8		// get function address
-	;;
-	ld8	gp=[in0]		// function gp value
-	;;
-	mov	b6=r14
-	br.call.sptk.many rp=b6		// call EFI procedure
-	
-	mov	ar.pfs=loc0
-	mov	gp=loc1
-	mov	rp=loc2
-	br.ret.sptk rp
-
-END(ia64_call_efi_func)
-
-
-/* Restore the context from the thread context.
- */
-ENTRY(restore_context)
-{	.mmi
-	invala
-	mov	ar.rsc=IA64_RSE_LAZY
-	add	r29=SW_SP,in0
-}
-	add	r30=SW_RP,in0
-	add	r31=SW_PR,in0
-	;;
-	ld8	r12=[r29],SW_LC-SW_SP		// load sp
-	ld8	r16=[r30],SW_BSP-SW_RP		// load rp
-	;;
-	ld8	r17=[r31],SW_RNAT-SW_PR		// load pr
-	ld8	r18=[r30],SW_PFS-SW_BSP		// load bsp
-	mov	rp=r16
-	;;
-	ld8	r16=[r31],SW_R4-SW_RNAT		// load rnat
-	mov	pr=r17,-1			// set pr
-	mov	ar.bspstore=r18
-	;;
-	ld8	r18=[r30],SW_UNATA-SW_PFS	// load pfs
-	ld8	r17=[r29],SW_UNATB-SW_LC	// load lc
-	mov	ar.rnat=r16
-	;;
-	ld8	r16=[r30],SW_R5-SW_UNATA	// load unat_a
-	mov	ar.pfs=r18
-	mov	ar.lc=r17
-	;;
-	ld8.fill r4=[r31],SW_R6-SW_R4		// load r4
-	mov	ar.unat=r16
-	;;
-	ld8.fill r5=[r30],SW_R7-SW_R5		// load r5
-	ld8	r16=[r29],SW_B3-SW_UNATB	// load unat_b
-	mov	ar.rsc=IA64_RSE_EAGER
-	;;
-	ld8.fill r6=[r31],SW_B1-SW_R6		// load r6
-	ld8.fill r7=[r30],SW_B2-SW_R7		// load r7
-	;;
-	ld8	r17=[r31],SW_B4-SW_B1		// load b1
-	ld8	r18=[r30],SW_B5-SW_B2		// load b2
-	mov	ar.unat=r16			// unat_b
-	;;
-	ld8	r16=[r29],SW_F2-SW_B3		// load b3
-	mov	b1=r17
-	mov	b2=r18
-	;;
-	ld8	r17=[r31],SW_F3-SW_B4		// load b4
-	ld8	r18=[r30],SW_F4-SW_B5		// load b5
-	mov	b3=r16
-	;;
-	ldf.fill f2=[r29]			// load f2
-	mov	b4=r17
-	mov	b5=r18
-	;;
-	ldf.fill f3=[r31],SW_F5-SW_F3		// load f3
-	ldf.fill f4=[r30],SW_F4-SW_F2		// load f4
-	;;
-	ldf.fill f5=[r31],SW_F5-SW_F3		// load f5
-	ldf.fill f16=[r30],SW_F4-SW_F2		// load f16
-	;;
-	ldf.fill f17=[r31],SW_F5-SW_F3		// load f17
-	ldf.fill f18=[r30],SW_F4-SW_F2		// load f18
-	;;
-	ldf.fill f19=[r31],SW_F5-SW_F3		// load f19
-	ldf.fill f20=[r30],SW_F4-SW_F2		// load f20
-	;;
-	ldf.fill f21=[r31],SW_F5-SW_F3		// load f21
-	ldf.fill f22=[r30],SW_F4-SW_F2		// load f22
-	;;
-	ldf.fill f23=[r31],SW_F5-SW_F3		// load f23
-	ldf.fill f24=[r30],SW_F4-SW_F2		// load f24
-	;;
-	ldf.fill f25=[r31],SW_F5-SW_F3		// load f25
-	ldf.fill f26=[r30],SW_F4-SW_F2		// load f26
-	;;
-	ldf.fill f27=[r31],SW_F5-SW_F3		// load f27
-	ldf.fill f28=[r30],SW_F4-SW_F2		// load f28
-	;;
-	ldf.fill f29=[r31],SW_F5-SW_F3		// load f29
-	ldf.fill f30=[r30],SW_F4-SW_F2		// load f30
-	;;
-	ldf.fill f31=[r30],SW_F4-SW_F2		// load f31
-	add		r8=1,r0
-	br.ret.sptk	rp
-	;;
-END(restore_context)
-
-/*
- * void switch_context(struct thread* old, struct thread* new)
- */
-ENTRY(switch_context)
-
-	mov	ar.rsc=IA64_RSE_LAZY
-	mov	r16=ar.unat
-	add	r31=SW_UNATB,in0
-	add	r30=SW_SP,in0
-	;;
-{	.mmi
-	flushrs
-	st8	[r30]=sp,SW_RP-SW_SP		// sp
-	mov	r17=rp
-	;;
-}
-	st8	[r31]=r16,SW_PR-SW_UNATB	// unat (before)
-	st8	[r30]=r17,SW_BSP-SW_RP		// rp
-	mov	r16=pr
-	;;
-	st8	[r31]=r16,SW_PFS-SW_PR		// pr
-	mov	r17=ar.bsp
-	mov	r16=ar.pfs
-	;;
-	st8	[r31]=r16,SW_RNAT-SW_PFS	// save pfs
-	st8	[r30]=r17,SW_R4-SW_BSP		// save bsp
-	mov	r16=ar.rnat
-	;;
-	st8	[r31]=r16,SW_R5-SW_RNAT		// save rnat
-	mov	ar.rsc=IA64_RSE_EAGER
-	;;
-{	.mmi
-	.mem.offset	8,0
-	st8.spill	[r30]=r4,SW_R6-SW_R4	// r4
-	.mem.offset	16,0
-	st8.spill	[r31]=r5,SW_R7-SW_R5	// r5
-	mov		r16=b1
-	;;
-}
-{	.mmi
-	.mem.offset	8,0
-	st8.spill	[r30]=r4,SW_B1-SW_R6	// r6
-	.mem.offset	16,0
-	st8.spill	[r31]=r5,SW_B2-SW_R7	// r7
-	mov		r17=b2
-	;;
-}
-	st8	[r30]=r16,SW_UNATA-SW_B1	// b1
-	st8	[r31]=r17,SW_B3-SW_B2		// b2
-	mov	r18=ar.unat
-	mov	r19=b3
-	mov	r20=b4
-	mov	r21=b5
-	;;
-	st8	[r30]=r18,SW_B4-SW_UNATA	// unat (after)
-	st8	[r31]=r19,SW_B5-SW_B3		// b3
-	;;
-	st8	[r30]=r20,SW_LC-SW_B4		// b4
-	st8	[r31]=r21,SW_F2-SW_B5		// b5
-	mov	r17=ar.lc
-	;;
-	st8		[r30]=r17,SW_F3-SW_LC	// ar.lc
-	stf.spill	[r31]=f2,SW_F4-SW_F2
-	;;
-	stf.spill	[r30]=f3,SW_F5-SW_F3
-	stf.spill	[r31]=f4,SW_F4-SW_F2
-	;;
-	stf.spill	[r30]=f5,SW_F5-SW_F3
-	stf.spill	[r31]=f16,SW_F4-SW_F2
-	;;
-	stf.spill	[r30]=f17,SW_F5-SW_F3
-	stf.spill	[r31]=f18,SW_F4-SW_F2
-	;;
-	stf.spill	[r30]=f19,SW_F5-SW_F3
-	stf.spill	[r31]=f20,SW_F4-SW_F2
-	;;
-	stf.spill	[r30]=f21,SW_F5-SW_F3
-	stf.spill	[r31]=f22,SW_F4-SW_F2
-	;;
-	stf.spill	[r30]=f23,SW_F5-SW_F3
-	stf.spill	[r31]=f24,SW_F4-SW_F2
-	;;
-	stf.spill	[r30]=f25,SW_F5-SW_F3
-	stf.spill	[r31]=f26,SW_F4-SW_F2
-	;;
-	stf.spill	[r30]=f27,SW_F5-SW_F3
-	stf.spill	[r31]=f28,SW_F4-SW_F2
-	;;
-	stf.spill	[r30]=f29,SW_F4-SW_F2
-	stf.spill	[r31]=f30
-	;;
-	stf.spill	[r30]=f31
-	add		r8=0,r0
-	mf
-//	br.ret.sptk	rp
-
-{	.mfb
-	mov		r32=r33
-	nop		0
-	br.sptk		restore_context
-	;;
-}
-
-END(switch_context)
-
-/*
- * The function is used to start a new thread.
- */
-ENTRY(thread_starter)
-
-	.prologue
-	.save	ar.pfs,loc0
-	alloc	loc0=ar.pfs,0,1,1,0
-	;;
-	.body
-	;;
-	mov	b7=r4			// the function pointer
-	mov	out0=r6			// the argument
-	;;
-	br.call.sptk.many rp=b7		// Call the thread function
-	;;
-	br.call.sptk.many rp=exit_thread	// call exit_thread
-	;;
-END(thread_starter)
-
-ENTRY(__hypercall)
-	mov r2=r37
-	break 0x1000
-	br.ret.sptk.many b0
-	;;
-END(__hypercall)
-
-/*
- * Stub for suspend.
- * Just force the stacked registers to be written in memory.
- */
-ENTRY(xencomm_arch_hypercall_suspend)
-	;;
-	alloc	r20=ar.pfs,0,0,6,0
-	mov	r2=__HYPERVISOR_sched_op
-	;;
-	/* We don't want to deal with RSE.  */
-	flushrs
-	mov	r33=r32
-	mov	r32=2		// SCHEDOP_shutdown
-	;;
-	break	0x1000
-	;;
-	br.ret.sptk.many b0
-END(xencomm_arch_hypercall_suspend)
-
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/arch/ia64/gen_off.c
--- a/extras/mini-os/arch/ia64/gen_off.c	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,141 +0,0 @@
-/*
- * Copyright (c) 2007 Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
- *
- ******************************************************************************
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- */
-#include <mini-os/types.h>
-#include <mini-os/sched.h>
-#include <xen/xen.h>
-#include <xen/arch-ia64.h>
-
-#define DEFINE(sym, val)					\
-  asm volatile("\n->" sym " %0 /* " #val " */": : "i" (val))
-#define DEFINE_STR2(sym, pfx, val)				\
-  asm volatile("\n->" sym " " pfx "%0" : : "i"(val));
-
-#define SZ(st,e) sizeof(((st *)0)->e)
-#define OFF(st,e,d,o)				\
-  DEFINE(#d, offsetof(st, e) + o);		\
-  DEFINE(#d "_sz", SZ(st,e ));			\
-  DEFINE_STR2(#d "_ld", "ld", SZ(st, e));	\
-  DEFINE_STR2(#d "_st", "st", SZ(st, e));			
-
-#define TFOFF(e,d) OFF(trap_frame_t, e, d, 0)
-#define SIZE(st,d) DEFINE(#d, sizeof(st))
-
-#define SWOFF(e,d) OFF(struct thread, e, d, 0)
-
-/* shared_info_t from xen/xen.h */
-#define SI_OFF(e, d) OFF(shared_info_t, e, d,0)
-/* mapped_regs_t from xen/arch-ia64.h */
-#define MR_OFF(e, d) OFF(mapped_regs_t, e, d, XMAPPEDREGS_OFS)
-
-int
-main(int argc, char ** argv)
-{
-	TFOFF(cfm, TF_CFM);
-	TFOFF(pfs, TF_PFS);
-	TFOFF(bsp, TF_BSP);
-	TFOFF(rnat, TF_RNAT);
-	TFOFF(csd, TF_CSD);
-	TFOFF(ccv, TF_CCV);
-	TFOFF(unat, TF_UNAT);
-	TFOFF(fpsr, TF_FPSR);
-	TFOFF(pr, TF_PR);	
-
-	TFOFF(sp, TF_SP);
-	TFOFF(gp, TF_GP);
-	TFOFF(tp, TF_TP);
-
-	TFOFF(r2, TF_GREG2);
-	TFOFF(r3, TF_GREG3);
-	TFOFF(r16, TF_GREG16);
-	TFOFF(r17, TF_GREG17);
-
-	TFOFF(b0, TF_BREG0);
-	TFOFF(b6, TF_BREG6);
-	TFOFF(b7, TF_BREG7);
-
-	TFOFF(f6, TF_FREG6);
-	TFOFF(f7, TF_FREG7);
-
-	TFOFF(rsc, TF_RSC);
-	TFOFF(ndirty, TF_NDIRTY);
-	TFOFF(ssd, TF_SSD);
-	TFOFF(iip, TF_IIP);
-	TFOFF(ipsr, TF_IPSR);
-	TFOFF(ifs, TF_IFS);
-	TFOFF(trap_num, TF_TRAP_NUM);
-
-	TFOFF(ifa, TF_IFA);
-	TFOFF(isr, TF_ISR);
-	TFOFF(iim, TF_IIM);
-
-	SIZE(trap_frame_t, TF_SIZE);
-
-	SIZE(struct thread, SW_SIZE);
-	SWOFF(regs.unat_b, SW_UNATB);
-	SWOFF(regs.sp, SW_SP);
-	SWOFF(regs.rp, SW_RP);
-	SWOFF(regs.pr, SW_PR);
-	SWOFF(regs.pfs, SW_PFS);
-	SWOFF(regs.bsp, SW_BSP);
-	SWOFF(regs.rnat, SW_RNAT);
-	SWOFF(regs.lc, SW_LC);
-	//SWOFF(regs.fpsr, SW_FPSR);
-	//SWOFF(regs.psr, SW_PSR);
-	//SWOFF(regs.gp, SW_GP);
-	SWOFF(regs.unat_a, SW_UNATA);
-        SWOFF(regs.r4, SW_R4);
-        SWOFF(regs.r5, SW_R5);
-        SWOFF(regs.r6, SW_R6);
-        SWOFF(regs.r7, SW_R7);
-        SWOFF(regs.b1, SW_B1);
-        SWOFF(regs.b2, SW_B2);
-        SWOFF(regs.b3, SW_B3);
-        SWOFF(regs.b4, SW_B4);
-        SWOFF(regs.b5, SW_B5);
-        SWOFF(regs.f2, SW_F2);
-        SWOFF(regs.f3, SW_F3);
-        SWOFF(regs.f4, SW_F4);
-        SWOFF(regs.f5, SW_F5);
-
-	SI_OFF(arch.start_info_pfn, START_INFO_PFN);
-	MR_OFF(interrupt_mask_addr, XSI_PSR_I_ADDR_OFS);
-	MR_OFF(interrupt_collection_enabled, XSI_PSR_IC_OFS);
-	MR_OFF(ipsr, XSI_IPSR_OFS);
-	MR_OFF(iip, XSI_IIP_OFS);
-	MR_OFF(ifs, XSI_IFS_OFS);
-	MR_OFF(ifa, XSI_IFA_OFS);
-	MR_OFF(iim, XSI_IIM_OFS);
-	MR_OFF(iim, XSI_IIM_OFS);
-	MR_OFF(iipa, XSI_IIPA_OFS);
-	MR_OFF(isr, XSI_ISR_OFS);
-	MR_OFF(banknum, XSI_BANKNUM_OFS);
-	MR_OFF(bank1_regs[0], XSI_BANK1_R16_OFS);
-	MR_OFF(precover_ifs, XSI_PRECOVER_IFS_OFS);
-
-	return 0;
-}
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/arch/ia64/ia64.S
--- a/extras/mini-os/arch/ia64/ia64.S	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,233 +0,0 @@
-/*
- * Copyright (c) 2007 Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
- *
- *****************************************************************************
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- * 
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
- * DEALINGS IN THE SOFTWARE.
- */
-
-
-
-#include <mini-os/asm.h>
-#include <mini-os/page.h>
-#include <mini-os/ia64_cpu.h>
-#include <mini-os/ia64_fpu.h>
-#include <mini-os/privop.h>
-#include <mini-os/offsets.h>
-
-
-
-	/*
-	 * Allocate kernel stack area.
-	 * This is used for stack pointer (goes down from kstack+PAGE_SIZE) and
-	 * RSE (goes up from kstack).
-	 */
-	.section .data.start,"aw"
-	.global	kstack
-	.align	PAGE_SIZE
-kstack:	.space KSTACK_PAGES * PAGE_SIZE
-
-	.text
-
-	/*
-	 * Start the kernel.
-	 * r28 points to the address of the boot parameter area, given
-	 * from the bootloader.
-	 * Execution reaches here in physical mode.
-	 */
-ENTRY(_start)
-	.prologue
-	.save rp, r0		// terminate unwind chain with a NULL rp
-	.body
-
-	alloc	loc0=ar.pfs,0,1,1,0
-
-	rsm psr.i | psr.ic
-	;;
-	srlz.i
-	;;
-
-	/*
-	 * Initialize mini-os region registers:
-	 * Currently only region registers 5 and 7 are used for addressing.
-	 * rr[5] : virtual kernel address space
-	 * rr[7] : directly mapped physically addresses.
-	 */
-	movl	r2=0<<IA64_RR_IDX_POS
-	movl	r3=1<<IA64_RR_IDX_POS
-	;;
-	mov	rr[r2]=r0
-	mov	rr[r3]=r0
-	;;
-	movl	r2=2<<IA64_RR_IDX_POS
-	movl	r3=3<<IA64_RR_IDX_POS
-	;;
-	mov	rr[r2]=r0
-	mov	rr[r3]=r0
-	;;
-	movl	r2=4<<IA64_RR_IDX_POS
-	movl	r3=6<<IA64_RR_IDX_POS
-	;;
-	mov	rr[r2]=r0
-	mov	rr[r3]=r0
-	;;
-	// Wired memory for kernel data and text.
-	movl	r2=IA64_RR_VAL(KERNEL_TR_PAGE_SIZE,0)
-	movl	r3=5<<IA64_RR_IDX_POS		// region 5
-	;;
-	mov	rr[r3]=r2
-	;;
-	/*
-	 * Region 7 addresses are only for directly mapped physically
-	 * addresses.
-	 */
-	movl	r2=IA64_RR_VAL(PTE_PS_16K,0)
-	movl	r3=7<<IA64_RR_IDX_POS		// region 7
-	;;
-	mov	rr[r3]=r2
-	;;
-	/*
-	 * Setup protection keys for region 5 and 7.
-	 */
-	mov	r2=(IA64_KEY_REG5 << IA64_PKR_KEY) | IA64_PKR_VALID
-	mov	r3=(IA64_KEY_REG7 << IA64_PKR_KEY) | IA64_PKR_VALID
-	mov	r14=0x1
-	;;
-	mov	pkr[r0]=r2	/* Region 5 */
-	mov	pkr[r14]=r3	/* Region 7 */
-	;;
-	/*
-	 * Now pin mappings into the TLB for kernel text and data
-	 */
-	mov	r18=(KERNEL_TR_PAGE_SIZE<<IA64_ITIR_PS)| \
-			(IA64_KEY_REG5<<IA64_ITIR_KEY)
-	movl	r17=KERNEL_START
-	;;
-	mov	cr.itir=r18
-	mov	cr.ifa=r17
-	mov	r16=IA64_TR_KERNEL
-	mov	r3=ip
-	movl	r18=PTE_KERNEL_ATTR
-	;;
-	dep	r2=0,r3,0,KERNEL_TR_PAGE_SIZE
-	;;
-	or	r18=r2,r18
-	;;
-	srlz.i
-	;;
-	itr.i	itr[r16]=r18
-	;;
-	itr.d	dtr[r16]=r18
-	;;
-	srlz.i
-
-	/*  Switch into virtual mode */
-	movl	r16=STARTUP_PSR
-	;;
-	mov	cr.ipsr=r16
-	movl	r17=1f
-	;;
-	mov	cr.iip=r17
-	mov	cr.ifs=r0
-	;;
-	rfi
-	;;
-1:	/* now we are in virtual mode */
-
-	movl	r3=ia64_trap_table
-	;;
-	mov	cr.iva=r3
-	;;
-
-	movl	r2=IA64_FPSR_DEFAULT
-	movl	r3=IA64_DCR_DEFAULT
-	;;
-	srlz.i
-	movl	gp=__gp
-
-	mov	ar.fpsr=r2
-	mov	cr.dcr=r3
-	;;
-	movl	r2=kstack
-	movl	r5=KSTACK_PAGES * PAGE_SIZE - 16
-	mov	ar.rsc=0	// place RSE in enforced lazy mode
-	;;
-	loadrs			// clear the dirty partition
-	;;
-	mov	ar.bspstore=r2	// establish the new RSE stack
-	add	sp=r2,r5
-	;;
-	mov	ar.rsc=IA64_RSE_EAGER	// place RSE in eager mode
-
-	;;
-	movl	r2=ia64_boot_paramP
-	mov	r3=7		// make address virtual region 7.
-	;;
-	dep	r28=r3,r28,61,3
-	;;
-				// save the address of the boot param area
-				// passed by the bootloader
-	st8	[r2]=r28
-	;;
-
-	/* Set xsi base. I use here XSI_BASE. */
-#define FW_HYPERCALL_SET_SHARED_INFO_VA                 0x600
-	mov r2=FW_HYPERCALL_SET_SHARED_INFO_VA
-	movl r28=XSI_BASE
-	;;
-	break 0x1000
-	;;
-	/*
-	 * I set up here the pointer to the global start_info structure.
-	 * This structure will be initialized in arch_init().
-	 */
-	movl	out0=start_info_union
-		// Prepare out0 - the pointer to start_info_t.
-	movl	r14=XSI_BASE
-	;;
-	add	r15=START_INFO_PFN,r14	// add offset to XSI_BASE
-	;;
-	START_INFO_PFN_ld	r14=[r15]	// load the start_info_pfn
-	add	r16=7, r0
-	;;
-	shl	r15=r14,PAGE_SHIFT_XEN_16K	// pfn << PAGE_SHIFT_XEN_16K
-	shl	r16=r16,IA64_RR_IDX_POS		// (7<<IA64_RR_IDX_POS)
-	;;
-	or	out0=r16, r15			// make a region 7 address
-	;;
-	ssm	psr.i | psr.ic
-	;;
-	srlz.i
-	;;
-	br.call.sptk.many rp=start_kernel
-	;;
-	add	r2=3,r0
-	;;
-	ld8	r3=[r2]
-	;;
-
-self:	hint @pause
-	br.sptk.many self		// endless loop
-END(_start)
-
-
-ENTRY(do_nop)
-	nop	0x01
-	add	r15=1,r15
-	br.ret.sptk.many rp
-END(do_nop)
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/arch/ia64/ivt.S
--- a/extras/mini-os/arch/ia64/ivt.S	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,774 +0,0 @@
-/*
- * Copyright (c) 2007 Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
- * Description: ia64 specific trap handling.
- *
- ****************************************************************************
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- * 
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
- * DEALINGS IN THE SOFTWARE.
- *
- */
-
-
-#include <mini-os/asm.h>
-#include <mini-os/page.h>
-#include <mini-os/ia64_cpu.h>
-#include <mini-os/privop.h>
-#include <mini-os/offsets.h>
-
-
-/* General register usage in interrupt handling:
- *	r16, r17, ... are used for input parameters of sub-routines
- *	r29:	used to access memory which may raise nested TLB fault
- *	r30:	b0 save register
- *	r31:	predicates save register
- *	p30,p31:	used for TLB stuff: (0,1)=data, (1,0)=instruction
- */
-
-
-#define FILL_FP_PAIR(f1, f2, b1, b2)	\
-	ldf.fill	f1=[b1],32	;\
-	ldf.fill	f2=[b2],32	;\
-	;;
-
-#define SPILL_FP_PAIR(f1, f2, b1, b2)	\
-	stf.spill	[b1]=f1,32	;\
-	stf.spill	[b2]=f2,32	;\
-	;;
-
-#define FILL_REG_PAIR(r1, r2, b1, b2)	\
-	ld8.fill	r1=[b1],16	;\
-	ld8.fill	r2=[b2],16	;\
-	;;
-
-#define SPILL_REG_PAIR(r1, r2, b1, b2)	\
-	.mem.offset 0,0			;\
-	st8.spill	[b1]=r1,16	;\
-	.mem.offset 8,0			;\
-	st8.spill	[b2]=r2,16	;\
-	;;
-
-
-/**
- *	The function does a store of the current processor context
- *	to the given exception frame address.
- *	These are some special and the scratch registers for calling
- *	C-functions later.
- *	The bspstore will be the same. A clean RSE is made with the
- *	cover instruction.
- *	
- *	The return is done through a jump to the next bundle after ip (r16).
- *
- *	Used register: r16, r18, r19, r20, r21, r22 of bank 0
- *
- * 	@param: r16 ip of the bundle with the jump.
- *	@param: r18 pointer to the trap frame.
- *	@param: r23 trap number/err val
- *
- */
-
-ENTRY(save_tf_rse_switch)
-	movl	r21=XSI_IPSR		// XEN !!
-	movl	r22=XSI_IIP		// XEN !!
-	;;
-	ld8	r21=[r21]		// XEN.ipsr
-	ld8	r22=[r22];;		// XEN.iip
-	add	r19=TF_IPSR,r18
-	add	r20=TF_IIP,r18
-	;;
-	st8	[r19]=r21		// store cr.ipsr
-	st8	[r20]=r22		// store cr.iip
-	;;
-	//// r16 return jump pointer, r18 - trap frame base, 
-	add	r19=TF_UNAT,r18
-	mov	r20=ar.unat
-	;;
-	st8	[r19]=r20		// store scratch unat
-	;;
-
-	add	r19=TF_GP,r18
-	add	r20=TF_SP,r18
-	;;
-	st8	[r19]=gp,TF_TP-TF_GP	// store gp
-	st8	[r20]=sp,TF_PR-TF_SP	// store sp
-	mov	r21=pr
-	;;
-	st8	[r19]=r13		// store tp
-	st8	[r20]=r21		// store pr
-	;;
-	add	r19=TF_GREG2,r18	// Now first general regs.
-	add	r20=TF_GREG3,r18
-	;;
-	SPILL_REG_PAIR( r2, r3,r19,r20)
-	SPILL_REG_PAIR( r8, r9,r19,r20)
-	SPILL_REG_PAIR(r10,r11,r19,r20)
-	SPILL_REG_PAIR(r14,r15,r19,r20)
-	;;
-	mov	r14=r18		// move trap frame base for bsw
-	mov	r15=r16		// save return address
-	;;
-	//bsw.1		// switch to bank 1 for saving these registers.
-	movl r30=XSI_BANKNUM		// Switch to bank 1.
-	mov r31=1;;
-	st4 [r30]=r31
-	;;
-	/*
-	 * On XEN the hypervisor has stored the bank 1 registers
-	 * r16-r31. I must reload these registers here to get
-	 * access.
-	 */
-	movl r30=XSI_BANK1_R16;
-	movl r31=XSI_BANK1_R16+8;; 
-	ld8 r16=[r30],16; ld8 r17=[r31],16;;
-	ld8 r18=[r30],16; ld8 r19=[r31],16;;
-	ld8 r20=[r30],16; ld8 r21=[r31],16;;
-	ld8 r22=[r30],16; ld8 r23=[r31],16;;
-	ld8 r24=[r30],16; ld8 r25=[r31],16;;
-	ld8 r26=[r30],16; ld8 r27=[r31],16;;
-	ld8 r28=[r30],16; ld8 r29=[r31],16;;
-	ld8 r30=[r30]; ld8 r31=[r31];;
-	add	r2=TF_GREG16,r14
-	add	r3=TF_GREG17,r14
-	;;
-	SPILL_REG_PAIR(r16,r17,r2,r3)
-	SPILL_REG_PAIR(r18,r19,r2,r3)
-	SPILL_REG_PAIR(r20,r21,r2,r3)
-	SPILL_REG_PAIR(r22,r23,r2,r3)
-	SPILL_REG_PAIR(r24,r25,r2,r3)
-	SPILL_REG_PAIR(r26,r27,r2,r3)
-	SPILL_REG_PAIR(r28,r29,r2,r3)
-	SPILL_REG_PAIR(r30,r31,r2,r3)
-	;;
-	//bsw.0				// back to interrupt bank 0
-	movl r2=XSI_BANKNUM;;
-	st4 [r2]=r0
-	;;
-	mov	r18=r14			// restore context pointer
-	mov	r16=r15			// restore return address
-	;;
-	//// r16 return jump pointer, r18 - trap frame base, 
-	add	r19=TF_CCV,r18
-	add	r20=TF_CSD,r18
-	mov	r21=ar.ccv
-	mov	r22=ar.csd
-	;;
-	st8	[r19]=r21		// ar.ccv
-	st8	[r20]=r22		// ar.csd
-	;;
-	add	r19=TF_SSD,r18
-	mov	r21=ar.ssd
-	;;
-	st8	[r19]=r21		// ar.ssd
-	;;
-	add	r19=TF_FREG6,r18
-	add	r20=TF_FREG7,r18
-	;;
-	SPILL_FP_PAIR(f6, f7, r19, r20)
-	SPILL_FP_PAIR(f8, f9, r19, r20)
-	SPILL_FP_PAIR(f10, f11, r19, r20)
-
-	add	r19=TF_BREG0,r18	// b0, b6, b7
-	add	r20=TF_BREG6,r18
-	mov	r21=b0
-	mov	r22=b6
-	;;
-	st8	[r19]=r21,TF_BREG7-TF_BREG0	// store b0
-	st8	[r20]=r22,16		// store b6
-	;;
-	mov	r21=b7
-	;;
-	st8	[r19]=r21		// store b7
-
-	//// r16 return jump pointer, r18 - trap frame base, 
-
-		// Read and save RSC, PFS
-	add	r19=TF_PFS,r18
-	add	r20=TF_RSC,r18
-	mov	r21=ar.pfs
-	mov	r22=ar.rsc
-	;;
-{	.mmb
-	st8	[r19]=r21		// store ar.pfs
-	st8	[r20]=r22		// store ar.rsc
-		// Issue cover instruction
-	cover		// must be the last instruction in bundle
-	//XEN_HYPER_COVER
-	;;
-}
-		// Read and save IFS
-	add	r19=TF_IFS,r18
-	add	r20=TF_CFM,r18
-		/* xen special handling for possibly lazy cover */
-	movl	r8=XSI_PRECOVER_IFS;
-	;;
-	ld8	r21=[r8]
-	;;
-	st8	[r19]=r21		// store cr.ifs
-	dep.z	r22=r21,0,38		// copy ifm part from ifs.ifm
-	;;
-	st8	[r20]=r22		// store cfm
-		// RSE in enforced lazy mode
-	mov	ar.rsc=IA64_RSE_LAZY
-	;;
-		// Read and save BSPSTORE and RNAT
-	add	r19=TF_BSP,r18
-	add	r20=TF_RNAT,r18
-	mov	r21=ar.bspstore
-	mov	r22=ar.rnat
-	;;
-	st8	[r19]=r21	                // store ar.bspstore
-	st8	[r20]=r22			// store ar.rnat
-	;;
-		// Write new BSPSTORE
-	//mov	r21=ar.bsp
-	//;;
-	mov	r22=r21			// new bspstore equal to old
-	;;
-	mov	ar.bspstore=r22		// the new bspstore
-	;;
-		// Read and save the new BSP for calculating number of dirty regs.
-	mov	r21=ar.bsp
-	;;
-	sub	r21=r21,r22		// r21 -> ndirty
-	add     r19=TF_NDIRTY-TF_BSP,r19        // TF_NDIRTY pos in r19
-	;;
-	st8	[r19]=r21		// store ndirty
-	;;
-	mov	ar.rsc=IA64_RSE_EAGER	// RSE on again
-	;;
-	add	r19=TF_FPSR,r18
-	;;
-	mov	r21=ar.fpsr
-	;;
-	st8	[r19]=r21		// ar.fpsr
-	;;
-	//// r16 return jump pointer, r18 - trap frame base, 
-		// Load the gp with our module __gp
-	movl	gp=__gp
-	;;
-	add	r16=16,r16	// for jump to next bundle
-	;;
-	mov	b7=r16
-	;;
-
-{	.mfb
-	srlz.d
-	nop	0
-	br.sptk	b7
-	;;
-}
-
-END(save_tf_rse_switch)
-
-
-/**
- *	The function reloads the processor context stored in
- *	save_tf_rse_switch().
- *	
- *	On calling the function the bank 0 must be activ.
- *	The return is done through a rfi.
- *	Used register: b7, r16, r18, r19, r20, r21, r22 of bank 0
- *
- *	@param: r18 pointer to the exception frame
- *
- */
-ENTRY(restore_tf_rse_switch) 
-	add	r19=TF_IPSR,r18
-	add	r20=TF_IIP,r18
-	;;
-	ld8	r21=[r19]		// load cr.ipsr
-	ld8	r22=[r20]		// load cr.iip
-	movl	r16=XSI_IPSR		// XEN !!
-	;;
-	st8	[r16]=r21,XSI_IIP_OFS-XSI_IPSR_OFS	// XEN.ipsr
-	mov	r2=r21			// save for fp stuff below
-	;;
-	st8	[r16]=r22		// XEN.iip
-	;;
-	//// r18 - trap frame base 
-		// Allocate a zero sized frame
-	alloc	r30=ar.pfs,0,0,0,0	// discard current frame
-	;;
-		// calc number of dirty regs and put this into rsc.loardrs
-	add	r19=TF_NDIRTY,r18
-	;;
-	ld8	r22=[r19]		// ndirty
-	;;
-	shl	r21=r22,16		// value for ar.rsc
-	;;
-	mov	ar.rsc=r21		// setup for loadrs
-	;;
-		// Issue a loadrs instruction
-{	.mmi
-	loadrs		// must be the first instruction
-	;;
-	nop 0x0
-	nop 0x0
-}
-		// Restore BSPSTORE from interrupted context
-	add	r19=TF_BSP,r18
-	add	r20=TF_RNAT,r18
-	;;	
-	ld8	r21=[r19]		// load ar.bspstore
-	ld8	r22=[r20]		// load ar.rnat
-	;;
-	mov	ar.bspstore=r21		// set ar.bspstore
-	;;
-		// Restore RNAT
-	mov	ar.rnat=r22		// set ar.rnat
-	;;
-		// Restore PFS and IFS
-	add	r19=TF_PFS,r18
-	add	r20=TF_IFS,r18
-	movl	r16=XSI_IFS		// XEN !!
-	;;
-	ld8	r21=[r19]		// load ar.pfs
-	ld8	r22=[r20]		// load cr.ifs
-	;;
-	add	r19=TF_RSC,r18
-	mov	ar.pfs=r21
-	st8	[r16]=r22		// XEN.ifs
-	;;
-		// Restore RSC
-	ld8	r21=[r19]		// load ar.rsc
-	;;
-	mov	ar.rsc=r21		// set ar.rsc
-	//// r18 - trap frame base
-	add	r19=TF_GP,r18
-	add	r20=TF_SP,r18
-	;;
-	ld8	gp=[r19],TF_TP-TF_GP	// load gp
-	ld8	sp=[r20],TF_PR-TF_SP	// load sp
-	;;
-	ld8	r13=[r19]		// load tp
-	ld8	r21=[r20]		// load pr
-	;;
-	mov	pr=r21,-1		// set pr
-	;;
-	add	r19=TF_BREG0,r18
-	add	r20=TF_BREG6,r18
-	;;
-	ld8	r21=[r19],TF_BREG7-TF_BREG0	// load b0
-	ld8	r22=[r20],16		// load b6
-	;;
-	mov	b0=r21
-	mov	b6=r22
-	;;
-	ld8	r21=[r19]		// load b7
-	ld8	r22=[r20],16		// load b3
-	;;
-	mov	b7=r21
-	//// r18 - trap frame base
-	mov	r14=r18			// Save the context pointer
-	;;
-	// bsw.1
-	movl r30=XSI_BANKNUM		// Switch to bank 1.
-	mov r31=1;;
-	st4 [r30]=r31
-	;;
-	add	r2=TF_GREG16,r14
-	add	r3=TF_GREG17,r14
-	;;
-	FILL_REG_PAIR(r16,r17,r2,r3)
-	FILL_REG_PAIR(r18,r19,r2,r3)
-	FILL_REG_PAIR(r20,r21,r2,r3)
-	FILL_REG_PAIR(r22,r23,r2,r3)
-	FILL_REG_PAIR(r24,r25,r2,r3)
-	FILL_REG_PAIR(r26,r27,r2,r3)
-	FILL_REG_PAIR(r28,r29,r2,r3)
-	FILL_REG_PAIR(r30,r31,r2,r3)
-
-	/*
-	 * On XEN I have to store the bank 1 register into the
-	 * global XSI_... area.
-	 */
-		// r16-r31 all now hold bank1 values
-	movl r2=XSI_BANK1_R16
-	movl r3=XSI_BANK1_R16+8
-	;;
-	.mem.offset 0,0; st8.spill [r2]=r16,16
-	.mem.offset 8,0; st8.spill [r3]=r17,16
-	;;
-	.mem.offset 0,0; st8.spill [r2]=r18,16
-	.mem.offset 8,0; st8.spill [r3]=r19,16
-	;;
-	.mem.offset 0,0; st8.spill [r2]=r20,16
-	.mem.offset 8,0; st8.spill [r3]=r21,16
-	;;
-	.mem.offset 0,0; st8.spill [r2]=r22,16
-	.mem.offset 8,0; st8.spill [r3]=r23,16
-	;;
-	.mem.offset 0,0; st8.spill [r2]=r24,16
-	.mem.offset 8,0; st8.spill [r3]=r25,16
-	;;
-	.mem.offset 0,0; st8.spill [r2]=r26,16
-	.mem.offset 8,0; st8.spill [r3]=r27,16
-	;;
-	.mem.offset 0,0; st8.spill [r2]=r28,16
-	.mem.offset 8,0; st8.spill [r3]=r29,16
-	;;
-	.mem.offset 0,0; st8.spill [r2]=r30,16
-	.mem.offset 8,0; st8.spill [r3]=r31,16
-	;;
-	// bsw.0
-	movl r2=XSI_BANKNUM;;
-	st4 [r2]=r0;
-
-	mov	r18=r14			// Move back the context pointer
-	;;
-	add	r19=TF_GREG2,r18
-	add	r20=TF_GREG3,r18
-	;;
-	FILL_REG_PAIR( r2, r3,r19,r20)
-	FILL_REG_PAIR( r8, r9,r19,r20)
-	FILL_REG_PAIR(r10,r11,r19,r20)
-	FILL_REG_PAIR(r14,r15,r19,r20)
-
-	//// r18 - trap frame base, 
-
-	add	r19=TF_CCV,r18
-	add	r20=TF_CSD,r18
-	;;
-	ld8	r21=[r19]		// ar.ccv
-	ld8	r22=[r20]		// ar.csd
-	;;
-	mov	ar.ccv=r21
-	mov	ar.csd=r22
-	add	r19=TF_SSD,r18
-	;;
-	ld8	r21=[r19]		// ar.ssd
-	;;
-	mov	ar.ssd=r21
-	add	r19=TF_FREG6,r18
-	add	r20=TF_FREG7,r18
-	;;
-	FILL_FP_PAIR(f6, f7, r19, r20)
-	FILL_FP_PAIR(f8, f9, r19, r20)
-	FILL_FP_PAIR(f10, f11, r19, r20)
-	add	r19=TF_FPSR,r18
-	;;
-	ld8	r21=[r19]		// ar.fpsr
-	;;
-	mov	ar.fpsr=r21
-	add	r19=TF_UNAT,r18
-	;;
-	ld8	r21=[r19]
-	;;
-	mov	ar.unat=r21
-	;;
-	srlz.i
-	;;
-	//rfi
-	XEN_HYPER_RFI;
-	;;
-END(restore_tf_rse_switch)
-
-
-ENTRY(save_special_regs)
-	alloc	loc0=ar.pfs,1,7,0,0
-	movl	loc1=XSI_IFA		// XEN !!
-	movl	loc2=XSI_ISR		// XEN !!
-	;;
-	ld8	loc3=[loc1],XSI_IIM_OFS-XSI_IFA_OFS	// load XEN.ifa
-	ld8	loc4=[loc2],XSI_IIPA_OFS-XSI_ISR_OFS	// load XEN.isr
-	add	loc5=TF_IFA,in0
-	add	loc6=TF_ISR,in0
-	;;
-	st8	[loc5]=loc3,TF_IIM-TF_IFA	// store cr.ifa
-	st8	[loc6]=loc4			// store cr.isr
-	;;
-	ld8	loc3=[loc1]			// load XEN.iim
-	;;
-	st8	[loc5]=loc3			// store cr.iim
-	;;
-	mov	ar.pfs=loc0
-	;;
-	br.ret.sptk.few rp
-END(save_special_regs)
-
-
-ENTRY(hypervisor_callback)
-	/*
-	 * Use the thread stack here for storing the trap frame.
-	 * It's not wired mapped, so nested data tlb faults may occur!
-	 */
-	add	r18=-TF_SIZE,sp
-	;;
-{	.mib
-	nop	0x02
-	mov	r16=ip		// for jump back from save_tf_rse_switch
-	br.sptk	save_tf_rse_switch
-	;;
-}
-	add	sp=-16,r18		// the new stack
-	alloc	r15=ar.pfs,0,0,1,0	// 1 out for do_hypervisor_callback
-	;;
-	mov	out0=r18		// the trap frame
-	movl	r22=XSI_PSR_IC
-	mov	r23=1;;
-	st8	[r22]=r23		// ssm psr.ic
-	;;
-	br.call.sptk.few rp = do_hypervisor_callback
-
-	movl	r22=XSI_PSR_IC
-	;;
-	st4	[r22]=r0		// rsm psr.ic
-	add	r18=16,sp		// load EF-pointer again
-	;;
-			// must have r18-efp, calls rfi at the end.
-	br.sptk	restore_tf_rse_switch
-	;;
-END(hypervisor_callback)
-
-	/*
-	 * In: r30 - trap number
-	 */
-ENTRY(trap_error)
-		// Calculate the stack address for storing.
-	add	r18=-TF_SIZE,sp
-	;;
-	add	r20=TF_TRAP_NUM,r18
-	;;
-	st2	[r20]=r30	// save trap number
-	;;
-
-{	.mib
-	nop	0x02
-	mov	r16=ip		// for jumping back from save_tf_rse_switch
-		// Used register: r16, r18, r19, r20, r21, r22 of bank 0
-	br.sptk	save_tf_rse_switch
-	;;
-}
-
-	alloc	r15=ar.pfs,0,0,1,0	// 1 out for do_trap_error
-	;;
-	mov	out0=r18		// the trap frame
-	add	sp=-16,r18		// C-call abi
-	;;
-	movl r30=XSI_BANKNUM		// bsw.1
-	mov r31=1;;
-	st4 [r30]=r31;;
-
-		/* Save extra interrupt registers to the trap frame. */
-	br.call.sptk.few rp = save_special_regs
-	;;
-
-	movl	r22=XSI_PSR_IC
-	movl	r23=XSI_PSR_I_ADDR
-	;;
-	ld8	r23=[r23]
-	mov	r25=1
-	;;
-	st4	[r22]=r25		// ssm psr.ic
-	st1	[r23]=r0		// ssm psr.i
-	;;
-
-	br.call.sptk.few rp = do_trap_error
-	;;
-		// --> currently not reached!!!
-	movl r23=XSI_PSR_I_ADDR
-	movl r22=XSI_PSR_IC
-	;;
-	ld8 r23=[r23]
-	mov r25=1
-	;;
-	st1 [r23]=r25
-	st4 [r22]=r0            // note: clears both vpsr.i and vpsr.ic!
-	;;
-	bsw.0
-	;;
-	add	r18=16,sp		// load EF-pointer again
-	;;
-	mov	sp=r18
-			// must have r18-efp, calls rfi at the end.
-	br.sptk	restore_tf_rse_switch
-	;;
-END(trap_error)
-
-
-/*
- * The trap handler stuff.
- */
-
-#define TRAP_ERR(num)			\
-	mov	r30 = num;		\
-	;;		;		\
-	br.sptk	trap_error		\
-	;;
-
-#define	IVT_ENTRY(name, offset)			\
-	.org	ia64_trap_table + offset;	\
-	.global	hivt_##name;			\
-	.proc	hivt_##name;			\
-	.prologue;				\
-	.body;					\
-hivt_##name:
-
-#define	IVT_END(name)				\
-	.endp	hivt_##name;			\
-	.align	0x100
-
-#define IVT_ERR(name, num, offset)		\
-	IVT_ENTRY(name, offset);		\
-	TRAP_ERR(num);				\
-	IVT_END(name)
-/*
- * The IA64 Interrupt Vector Table (IVT) contains 20 slots with 64
- * bundles per vector and 48 slots with 16 bundles per vector.
- */
-
-	.section .text.hivt,"ax"
-	.align	32768
-	.global ia64_trap_table
-	.size	ia64_trap_table, 32768
-ia64_trap_table:
-
-IVT_ERR(VHPT_Translation, 0, 0x0)
-IVT_ERR(Instruction_TLB, 1, 0x0400)
-IVT_ERR(Data_TLB, 2, 0x0800)
-IVT_ERR(Alternate_Instruction_TLB, 3, 0x0c00)
-
-
-IVT_ENTRY(Alternate_Data_TLB, 0x1000)
-	mov	r30=4			// trap number
-adt_common:
-	mov	r16=cr.ifa		// where did it happen
-	mov	r31=pr			// save predicates
-	;;
-	extr.u	r17=r16,IA64_RR_IDX_POS,3	// get region number
-	;;
-	cmp.eq	p14,p15=7,r17
-	;;
-//(p14)	br.sptk adt_regf_addr		// Check for region 7 - phys addresses
-//	;;
-//	br.sptk	trap_error
-//		// No return
-//
-//adt_regf_addr:
-//	extr.u	r17=r16,60,4		// get region number
-//	;;
-//	cmp.eq	p14,p15=0xf,r17
-//	;;
-(p14)	br.sptk adt_reg7_addr		// Check for region 7 - phys addresses
-	;;
-	br.sptk	trap_error
-
-adt_reg7_addr:
-	/*
-	 * region 7 addresses are only directly mapped physically
-	 * addresses. Currently I don't do a check.
-	 */
-	movl	r20=~((7 << IA64_RR_IDX_POS) | 0xfff)
-	movl	r18=((PTE_PS_16K<<IA64_ITIR_PS)|(IA64_KEY_REG7<<IA64_ITIR_KEY))
-	;;
-	movl	r19=	((1<<PTE_OFF_P) | (PTE_MA_WB<<PTE_OFF_MA) | \
-			 (1<<PTE_OFF_A) | (1<<PTE_OFF_D) | \
-			 (PTE_PL_KERN<<PTE_OFF_PL) | (PTE_AR_RW<<PTE_OFF_AR))
-			// clear the region bits and 0-11
-			// extract the pfn from the ifa
-	mov	cr.itir=r18
-	and	r20=r20, r16
-	;;
-	or	r20=r20,r19		// put pfn into pte
-	;;
-	mov	pr=r31,-1		// restore predicates
-	itc.d	r20
-	;;
-	XEN_HYPER_RFI;
-	;;
-
-IVT_END(Alternate_Data_TLB)
-
-/*
- * Handling of nested data tlb is needed, because in hypervisor_callback()
- * the stack is used to store the register trap frame. This stack is allocated
- * dynamically (as identity mapped address) and therewidth no tr mapped page!
- */
-IVT_ENTRY(Data_Nested_TLB, 0x1400)
-
-	mov	r30=5			// trap number
-	add	r28=-TF_SIZE,sp		// r28 is never used in trap handling
-	;;
-	mov	cr.ifa=r28
-	;;
-	br.sptk	adt_common
-IVT_END(Data_Nested_TLB)
-
-
-
-IVT_ERR(Instruction_Key_Miss, 6, 0x1800)
-IVT_ERR(Data_Key_Miss, 7, 0x1c00)
-IVT_ERR(Dirty_Bit, 8, 0x2000)
-IVT_ERR(Instruction_Access_Bit, 9, 0x2400)
-IVT_ERR(Data_Access_Bit, 10, 0x2800)
-IVT_ERR(Break_Instruction, 11, 0x2c00)
-IVT_ERR(External_Interrupt, 12, 0x3000)
-IVT_ERR(Reserved_3400, 13, 0x3400)
-IVT_ERR(Reserved_3800, 14, 0x3800)
-IVT_ERR(Reserved_3c00, 15, 0x3c00)
-IVT_ERR(Reserved_4000, 16, 0x4000)
-IVT_ERR(Reserved_4400, 17, 0x4400)
-IVT_ERR(Reserved_4800, 18, 0x4800)
-IVT_ERR(Reserved_4c00, 19, 0x4c00)
-IVT_ERR(Page_Not_Present, 20, 0x5000)
-IVT_ERR(Key_Permission, 21, 0x5100)
-IVT_ERR(Instruction_Access_Rights, 22, 0x5200)
-IVT_ERR(Data_Access_Rights, 23, 0x5300)
-IVT_ERR(General_Exception, 24, 0x5400)
-IVT_ERR(Disabled_FP_Register, 25, 0x5500)
-IVT_ERR(NaT_Consumption, 26, 0x5600)
-IVT_ERR(Speculation, 27, 0x5700)
-IVT_ERR(Reserved_5800, 28, 0x5800)
-IVT_ERR(Debug, 29, 0x5900)
-IVT_ERR(Unaligned_Reference, 30, 0x5a00)
-IVT_ERR(Unsupported_Data_Reference, 31, 0x5b00)
-IVT_ERR(Floating_Point_Fault, 32, 0x5c00)
-IVT_ERR(Floating_Point_Trap, 33, 0x5d00)
-IVT_ERR(Lower_Privilege_Transfer_Trap, 34, 0x5e00)
-IVT_ERR(Taken_Branch_Trap, 35, 0x5f00)
-IVT_ERR(Single_Step_Trap, 36, 0x6000)
-IVT_ERR(Reserved_6100, 37, 0x6100)
-IVT_ERR(Reserved_6200, 38, 0x6200)
-IVT_ERR(Reserved_6300, 39, 0x6300)
-IVT_ERR(Reserved_6400, 40, 0x6400)
-IVT_ERR(Reserved_6500, 41, 0x6500)
-IVT_ERR(Reserved_6600, 42, 0x6600)
-IVT_ERR(Reserved_6700, 43, 0x6700)
-IVT_ERR(Reserved_6800, 44, 0x6800)
-IVT_ERR(IA_32_Exception, 45, 0x6900)
-IVT_ERR(IA_32_Intercept, 46, 0x6a00)
-IVT_ERR(IA_32_Interrupt, 47, 0x6b00)
-IVT_ERR(Reserved_6c00, 48, 0x6c00)
-IVT_ERR(Reserved_6d00, 49, 0x6d00)
-IVT_ERR(Reserved_6e00, 50, 0x6e00)
-IVT_ERR(Reserved_6f00, 51, 0x6f00)
-IVT_ERR(Reserved_7000, 52, 0x7000)
-IVT_ERR(Reserved_7100, 53, 0x7100)
-IVT_ERR(Reserved_7200, 54, 0x7200)
-IVT_ERR(Reserved_7300, 55, 0x7300)
-IVT_ERR(Reserved_7400, 56, 0x7400)
-IVT_ERR(Reserved_7500, 57, 0x7500)
-IVT_ERR(Reserved_7600, 58, 0x7600)
-IVT_ERR(Reserved_7700, 59, 0x7700)
-IVT_ERR(Reserved_7800, 60, 0x7800)
-IVT_ERR(Reserved_7900, 61, 0x7900)
-IVT_ERR(Reserved_7a00, 62, 0x7a00)
-IVT_ERR(Reserved_7b00, 63, 0x7b00)
-IVT_ERR(Reserved_7c00, 64, 0x7c00)
-IVT_ERR(Reserved_7d00, 65, 0x7d00)
-IVT_ERR(Reserved_7e00, 66, 0x7e00)
-IVT_ERR(Reserved_7f00, 67, 0x7f00)
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/arch/ia64/minios-ia64.lds
--- a/extras/mini-os/arch/ia64/minios-ia64.lds	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-OUTPUT_FORMAT("elf64-ia64-little")
-OUTPUT_ARCH(ia64)
-
-ENTRY(phys_start)
-
-PHDRS
-{
-  code PT_LOAD;
-  data PT_LOAD;
-}
-
-SECTIONS
-{
-
-  phys_start = _start - (((5<<(61))+0x100000000) - (1 << 20));
-
-  code : { } :code
-  . = ((5<<(61))+0x100000000);
-
-  _text = .;
-
-  .text : AT(ADDR(.text) - (((5<<(61))+0x100000000) - (1 << 20)))
-  {
-    *(.text)
-  }
-
-  _etext = .;
-
-  data : { } :data
-  .data : AT(ADDR(.data) - (((5<<(61))+0x100000000) - (1 << 20)))
-  { *(.data) 
-  }
-
-  .sdata : AT(ADDR(.sdata) - (((5<<(61))+0x100000000) - (1 << 20)))
-        { *(.sdata) *(.sdata1) *(.srdata) }
-
-  .rodata : AT(ADDR(.rodata) - (((5<<(61))+0x100000000) - (1 << 20)))
-  { *(.rodata) }
-
-  .rodata.str1.8 : AT(ADDR(.rodata.str1.8) - (((5<<(61))+0x100000000) - (1 << 20)))
-  { *(.rodata.str1.8) }
-
-  /* newlib initialization functions */
-  . = ALIGN(64 / 8);
-  PROVIDE (__preinit_array_start = .);
-  .preinit_array     : { *(.preinit_array) }
-  PROVIDE (__preinit_array_end = .);
-  PROVIDE (__init_array_start = .);
-  .init_array     : { *(.init_array) }
-  PROVIDE (__init_array_end = .);
-  PROVIDE (__fini_array_start = .);
-  .fini_array     : { *(.fini_array) }
-  PROVIDE (__fini_array_end = .);
-
-  .ctors : AT(ADDR(.ctors) - (((5<<(61))+0x100000000) - (1 << 20)))
-	{
-        __CTOR_LIST__ = .;
-        *(.ctors)
-	CONSTRUCTORS
-        QUAD(0)
-        __CTOR_END__ = .;
-        }
-
-  .dtors : AT(ADDR(.dtors) - (((5<<(61))+0x100000000) - (1 << 20)))
-        {
-        __DTOR_LIST__ = .;
-        *(.dtors)
-        QUAD(0)
-        __DTOR_END__ = .;
-        }
-
-  .IA_64.unwind_info : AT(ADDR(.IA_64.unwind_info) - (((5<<(61))+0x100000000) - (1 << 20)))
-  { *(.IA_64.unwind_info) }
-
-  .IA_64.unwind : AT(ADDR(.IA_64.unwind) - (((5<<(61))+0x100000000) - (1 << 20)))
-  { *(.IA_64.unwind) }
-
-  .bss : AT(ADDR(.bss) - (((5<<(61))+0x100000000) - (1 << 20)))
-  {
-    *(.bss)
-    *(.app.bss)
-  }
-
-  _end = .;
-
-}
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/arch/ia64/mm.c
--- a/extras/mini-os/arch/ia64/mm.c	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,174 +0,0 @@
-/*
- * Done by Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
- *
- * Description: Special ia64 memory management.
- * Parts are taken from FreeBSD.
- *
- ****************************************************************************
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- * 
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
- * DEALINGS IN THE SOFTWARE.
- */
-
-
-#include <mini-os/os.h>
-#include <mini-os/mm.h>
-
-
-#define MAX_MEM_AREA	5
-paddr_t phys_avail[MAX_MEM_AREA * 2];
-int	phys_avail_cnt;
-uint64_t physmem;
-
-/*
- * These variables are defined in the linker script minios_ia64.lds
- * to get the size of the kernel.
- */
-extern uint64_t _text[], _etext[], _end[], kstack[], phys_start[];
-
-uint64_t kernstart, kernend, kernsize, kernpstart, kernpend;
-
-#ifdef HAVE_LIBC
-uint8_t _heap[512 * 1024];
-unsigned long heap = (unsigned long)_heap,
-              brk = (unsigned long)_heap,
-              heap_mapped = (unsigned long)_heap + sizeof(_heap),
-              heap_end = (unsigned long)_heap + sizeof(_heap);
-#endif
-
-/* Print the available memory chunks. */
-static void
-print_phys_avail(void)
-{
-	int i;
-
-	printk("Physical memory chunk(s):\n");
-	for (i = 0; phys_avail[i + 1] != 0; i += 2) {
-		int size = phys_avail[i + 1] - phys_avail[i];
-		printk("0x%08lx - 0x%08lx, %d bytes (%d pages)\n",
-			phys_avail[i], phys_avail[i + 1] - 1,
-			size, size / PAGE_SIZE);
-	}
-}
-
-void
-arch_init_mm(unsigned long* start_pfn_p, unsigned long* max_pfn_p)
-{
-	uint64_t ms, me;
-	int i, j;
-	uint64_t m, n;
-
-	kernstart = trunc_page(_text);
-	kernend  = roundup_page(_end);
-
-	kernpstart = trunc_page(ia64_tpa(kernstart));
-	kernpend = roundup_page(kernpstart + (kernend - kernstart));
-	kernsize = kernpend - kernpstart;
-
-	ms = roundup_page(machineFwG.mach_mem_start);
-	me = trunc_page(machineFwG.mach_mem_start+machineFwG.mach_mem_size);
-	memset((void*)phys_avail, 0, sizeof(phys_avail));
-	/* 1. Check where the kernel lies in physical memory. */
-	physmem = me - ms;
-	if ((ms <= kernpend) && (kernpstart <= me)) {
-		if (ms < kernpstart) {	/* There is a part before the kernel. */
-			PRINT_BV("  Found chunk before kernel: 0x%lx - 0x%lx\n",
-				 ms, kernpstart);
-			phys_avail[phys_avail_cnt] = ms;
-			phys_avail[phys_avail_cnt+1] = kernpstart;
-			phys_avail_cnt += 2;
-		}
-		if (kernpend < me) {	/* There is a part behind the kernel. */
-			PRINT_BV("  Found chunk behind kernel: 0x%lx - 0x%lx\n",
-				 kernpend, me);
-			phys_avail[phys_avail_cnt] = kernpend;
-			phys_avail[phys_avail_cnt+1] = me;
-			phys_avail_cnt += 2;
-		}
-	} else {	/* One big chunk */
-		PRINT_BV("  Found big chunk: 0x%lx - 0x%lx\n", ms, me);
-		phys_avail[phys_avail_cnt] = ms;
-		phys_avail[phys_avail_cnt + 1] = me;
-		phys_avail_cnt += 2;
-	}
-	phys_avail[phys_avail_cnt] = 0;
-
-	print_phys_avail();
-	/*
-	 * In this first version I only look for the biggest mem area.
-	 */
-	for (i = j = m = n = 0; i < phys_avail_cnt; i += 2) {
-		n = page_to_pfn(phys_avail[i + 1]) - page_to_pfn(phys_avail[i]);
-		if (n > m) {
-			m = n;
-			j = i;
-		}
-	}
-	*start_pfn_p = page_to_pfn(phys_avail[j]);
-	*max_pfn_p   = page_to_pfn(phys_avail[j +1 ]);
-}
-
-/* Currently only a dummy function. */
-void
-arch_init_demand_mapping_area(unsigned long max_pfn)
-{
-	max_pfn = max_pfn;
-}
-
-unsigned long allocate_ondemand(unsigned long n, unsigned long alignment)
-{
-        return 0;
-}
-
-/* Helper function used in gnttab.c. */
-void do_map_frames(unsigned long addr,
-    const unsigned long *f, unsigned long n, unsigned long stride,
-	unsigned long increment, domid_t id, int *err, unsigned long prot)
-{
-	/* TODO */
-	ASSERT(0);
-}
-
-void*
-map_frames_ex(const unsigned long* frames, unsigned long n, unsigned long stride,
-	unsigned long increment, unsigned long alignment, domid_t id,
-	int *err, unsigned long prot)
-{
-        /* TODO: incomplete! */
-        ASSERT(n == 1 || (stride == 0 && increment == 1));
-        ASSERT(id == DOMID_SELF);
-        ASSERT(prot == 0);
-	return (void*) __va(frames[0] << PAGE_SHIFT);
-}
-
-int unmap_frames(unsigned long virt_addr, unsigned long num_frames)
-{  
-    /* TODO */
-    ASSERT(0);
-}
-
-unsigned long alloc_contig_pages(int order, unsigned int addr_bits)
-{
-    /* TODO */
-    ASSERT(0);
-}
-
-void arch_init_p2m(unsigned long max_pfn)
-{
-    printk("Warn: p2m map not implemented.\n");
-}
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/arch/ia64/sal.c
--- a/extras/mini-os/arch/ia64/sal.c	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +0,0 @@
-/*
- * Done by Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
- * Mostly taken from FreeBSD.
- *
- ****************************************************************************
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- */
-
-#include <mini-os/os.h>
-#include <mini-os/lib.h>
-#include <mini-os/console.h>
-#include <mini-os/page.h>
-
-
-static struct ia64_fdesc sal_fdesc;
-uint64_t ia64_pal_entry;	/* PAL_PROC entrypoint */
-
-
-struct ia64_sal_result
-ia64_sal_call(uint64_t a1, uint64_t a2, uint64_t a3, uint64_t a4,
-	      uint64_t a5, uint64_t a6, uint64_t a7, uint64_t a8)
-{
-	return ia64_sal_entry(a1, a2, a3, a4, a5, a6, a7, a8);
-}
-
-static struct ia64_sal_result
-fake_sal(uint64_t a1, uint64_t a2, uint64_t a3, uint64_t a4,
-	 uint64_t a5, uint64_t a6, uint64_t a7, uint64_t a8)
-{
-	struct ia64_sal_result res;
-	res.sal_status = -3;
-	res.sal_result[0] = 0;
-	res.sal_result[1] = 0;
-	res.sal_result[2] = 0;
-	return res;
-}
-
-/*
- * Currently only the SAL_DESC_ENTRYPOINT is checked to get
- * the entry points the pal and sal functions.
- */
-void
-ia64_sal_init(struct sal_system_table *saltab)
-{
-	static int sizes[6] = { 48, 32, 16, 32, 16, 16 };
-	uint8_t *p;
-	int i;
-
-	PRINT_BV("Reading SALtable:\n");
-	ia64_sal_entry = fake_sal;
-
-	if (memcmp((void*)(uint64_t)(saltab->sal_signature), SAL_SIGNATURE, 4))
-	{
-		printk("Bad signature for SAL System Table\n");
-		return;
-	}
-	p = (uint8_t *) (saltab + 1);
-	for (i = 0; i < saltab->sal_entry_count; i++) {
-		switch (*p) {
-		case SAL_DESC_ENTRYPOINT:		// 0
-		{
-			struct sal_entrypoint_descriptor *dp;
-
-			dp = (struct sal_entrypoint_descriptor*)p;
-			ia64_pal_entry =
-				IA64_PHYS_TO_RR7(dp->sale_pal_proc);
-			PRINT_BV("  PAL Proc at 0x%lx\n", ia64_pal_entry);
-			sal_fdesc.func =
-				IA64_PHYS_TO_RR7(dp->sale_sal_proc);
-			sal_fdesc.gp = IA64_PHYS_TO_RR7(dp->sale_sal_gp);
-			PRINT_BV("  SAL Proc at 0x%lx, GP at 0x%lx\n",
-				 sal_fdesc.func, sal_fdesc.gp);
-			ia64_sal_entry = (sal_entry_t *) &sal_fdesc;
-			break;
-		}
-		default:
-			break;
-		}
-		p += sizes[*p];
-	}
-}
-
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/arch/ia64/sched.c
--- a/extras/mini-os/arch/ia64/sched.c	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/* 
- * Done by Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com
- *
- * Description: ia64 specific part of the scheduler for mini-os
- *
- ****************************************************************************
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- * 
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
- * DEALINGS IN THE SOFTWARE.
- */
-
-
-#include <mini-os/types.h>
-#include <mini-os/sched.h>
-#include <mini-os/lib.h>
-#include <mini-os/xmalloc.h>
-#include <mini-os/mm.h>
-
-/* The function is implemented in fw.S */
-extern void thread_starter(void);
-
-void stack_walk(void)
-{
-    /* TODO */
-}
-
-struct thread*
-arch_create_thread(char *name, void (*function)(void *), void *data)
-{
-	struct thread* _thread;
-
-	_thread = (struct thread*)_xmalloc(sizeof(struct thread), 16);
-	/* Allocate pages for stack, stack will be aligned */
-	_thread->stack = (char *)alloc_pages(STACK_SIZE_PAGE_ORDER);
-	_thread->name = name;
-	memset((void*)&(_thread->regs), 0, sizeof(_thread->regs));
-	_thread->regs.sp = ((uint64_t)_thread->stack) + STACK_SIZE - 16;
-	_thread->regs.bsp = ((uint64_t)_thread->stack) + 0x10;
-	_thread->regs.rp = FDESC_FUNC(thread_starter);
-	_thread->regs.pfs = 0x82;
-	_thread->regs.r4 = FDESC_FUNC(function);
-	_thread->regs.r6 = (uint64_t)data;
-	return _thread;
-}
-
-extern void restore_context(struct thread*);
-extern int switch_context(struct thread*, struct thread*);
-
-void
-arch_switch_threads(struct thread* prev, struct thread* next)
-{
-	ia64_set_r13((uint64_t)next);
-	switch_context(prev, next);
-}
-
-/* Everything initialised, start idle thread */
-void
-run_idle_thread(void)
-{
-	//do_busy_loop();
-	ia64_set_r13((uint64_t)idle_thread);
-	restore_context(idle_thread);
-	printk("%s: restore_context() returned - bad!\n", __func__);
-}
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/arch/ia64/time.c
--- a/extras/mini-os/arch/ia64/time.c	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,289 +0,0 @@
-/* 
- * Done by Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
- * Description: simple ia64 specific time handling
- * Parts are taken from FreeBSD.
- *
- ****************************************************************************
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <mini-os/os.h>
-#include <mini-os/console.h>
-#include <mini-os/time.h>
-#include <mini-os/efi.h>
-#include <mini-os/events.h>
-
-struct timespec os_time;
-static uint64_t itc_alt;		/* itc on last update. */
-static uint64_t itc_at_boot;		/* itc on boot */
-static uint64_t itc_frequency;
-static uint64_t processor_frequency;
-static uint64_t itm_val;
-
-static int is_leap_year(int year)
-{
-	if( year % 4 == 0 )
-	{
-		if( year % 100 == 0 )
-		{
-			if( year % 400 == 0 ) return 1;
-			else return 0;
-		}
-		return 1;
-	}
-	return 0;
-}
-
-static int count_leap_years(int epoch, int year)
-{
-	int i, result = 0;
-	for( i = epoch ; i < year ; i++ ) if( is_leap_year(i) ) result++;
-	return result;
-}
-
-static int get_day(int year, int mon, int day) {
-	int result;
-	switch(mon)
-	{
-		case 0: result = 0; break;
-		case 1: result = 31; break; /* 1: 31 */
-		case 2: result = 59; break; /* 2: 31+28 */
-		case 3: result = 90; break; /* 3: 59+31 */
-		case 4: result = 120;break; /* 4: 90+30 */
-		case 5: result = 151;break; /* 5: 120+31 */
-		case 6: result = 181;break; /* 6: 151+30 */
-		case 7: result = 212;break; /* 7: 181+31 */
-		case 8: result = 243;break; /* 8: 212+31 */
-		case 9: result = 273;break; /* 9: 243+30 */
-		case 10:result = 304;break; /* 10:273+31 */
-		case 11:result = 334;break; /* 11:304+30 */
-		default: break;
-	}
-	if( is_leap_year(year) && mon > 2 ) result++;
-	result += day - 1;
-	return result;
-}
-
-/*
- * Converts Gregorian date to seconds since 1970-01-01 00:00:00.
- * Assumes input in normal date format, i.e. 1980-12-31 23:59:59
- * => year=1980, mon=12, day=31, hour=23, min=59, sec=59.
- *
- * WARNING: this function will overflow on 2106-02-07 06:28:16 on
- * machines were long is 32-bit! (However, as time_t is signed, we
- * will already get problems at other places on 2038-01-19 03:14:08)
- */
-static unsigned long _mktime(const unsigned int year, const unsigned int mon,
-			    const unsigned int day, const unsigned int hour,
-		            const unsigned int min, const unsigned int sec)
-{
-	unsigned long result = 0;
-
-	result = sec;
-	result += min * 60;
-	result += hour * 3600;
-	result += get_day(year, mon - 1, day) * 86400;
-	result += (year - 1970) * 31536000;
-	result += count_leap_years(1970, year) * 86400;
-
-	return result;
-}
-
-static inline uint64_t
-ns_from_cycles(uint64_t cycles)
-{
-	return (cycles * (1000000000 / itc_frequency));
-}
-
-static inline uint64_t
-ns_to_cycles(uint64_t ns)
-{
-	return (ns * (itc_frequency / 1000000000));
-}
-
-/*
- * Block the domain until until(nanoseconds) is over.
- * If block is called no timerinterrupts are delivered from xen!
- */
-void
-block_domain(s_time_t until)
-{
-	struct ia64_pal_result pal_res;
-	uint64_t c, new;
-
-	c = ns_to_cycles(until);
-	new = ia64_get_itc() + c - NOW();
-	ia64_set_itm(new);		/* Reload cr.itm */
-	/*
-	 * PAL_HALT_LIGHT returns on every external interrupt,
-	 * including timer interrupts.
-	 */
-	pal_res = ia64_call_pal_static(PAL_HALT_LIGHT, 0, 0, 0);
-	if (pal_res.pal_status != 0)
-		printk("%s: PAL_HALT_LIGHT returns an error\n");
-	/* Reload the normal timer interrupt match. */
-	new = ia64_get_itc() + itm_val;
-	ia64_set_itm(new);
-}
-
-static void
-calculate_time(void)
-{
-	uint64_t itc_new, new;
-
-	itc_new = ia64_get_itc();
-	if (itc_new < itc_alt)
-		new = ~0 - itc_alt + itc_new;
-	else
-		new = itc_new - itc_alt;
-	itc_alt = itc_new;
-	new = ns_from_cycles(new);
-	os_time.tv_nsec += new;
-	if (os_time.tv_nsec > 1000000000) {	/* On overflow. */
-		os_time.tv_sec++;
-		os_time.tv_nsec -= 1000000000;
-	}
-}
-
-void
-timer_interrupt(evtchn_port_t port, struct pt_regs* regsP, void *data)
-{
-	uint64_t new;
-
-	calculate_time();
-	new = ia64_get_itc() + itm_val;
-	ia64_set_itm(new);
-}
-
-/*
- * monotonic_clock(): returns # of nanoseconds passed since time_init()
- */
-uint64_t
-monotonic_clock(void)
-{
-	uint64_t delta;
-
-	delta = ia64_get_itc() - itc_at_boot;
-	delta = ns_from_cycles(delta);
-	return delta;
-}
-
-int
-gettimeofday(struct timeval *tv, void *tz)
-{
-	calculate_time();
-	tv->tv_sec = os_time.tv_sec;			/* seconds */
-	tv->tv_usec = NSEC_TO_USEC(os_time.tv_nsec);	/* microseconds */
-        return 0;
-};
-
-/*
- * Read the clock frequencies from pal and sal for calculating
- * the clock interrupt.
- */
-static void
-calculate_frequencies(void)
-{
-	struct ia64_sal_result sal_res;
-	struct ia64_pal_result pal_res;
-
-	pal_res = ia64_call_pal_static(PAL_FREQ_RATIOS, 0, 0, 0);
-	sal_res = ia64_sal_entry(SAL_FREQ_BASE, 0, 0, 0, 0, 0, 0, 0);
-
-	if (sal_res.sal_status == 0 && pal_res.pal_status == 0) {
-		processor_frequency =
-			sal_res.sal_result[0] * (pal_res.pal_result[0] >> 32)
-				/ (pal_res.pal_result[0] & ((1L << 32) - 1));
-		itc_frequency =
-			sal_res.sal_result[0] * (pal_res.pal_result[2] >> 32)
-				/ (pal_res.pal_result[2] & ((1L << 32) - 1));
-		PRINT_BV("Reading clock frequencies:\n");
-		PRINT_BV("  Platform clock frequency %ld Hz\n",
-			       sal_res.sal_result[0]);
-		PRINT_BV("  Processor ratio %ld/%ld, Bus ratio %ld/%ld, "
-			       "  ITC ratio %ld/%ld\n",
-			       pal_res.pal_result[0] >> 32,
-			       pal_res.pal_result[0] & ((1L << 32) - 1),
-			       pal_res.pal_result[1] >> 32,
-			       pal_res.pal_result[1] & ((1L << 32) - 1),
-			       pal_res.pal_result[2] >> 32,
-			       pal_res.pal_result[2] & ((1L << 32) - 1));
-
-		printk("  ITC frequency %ld\n", itc_frequency);
-	} else {
-		itc_frequency = 1000000000;
-		processor_frequency = 0;
-		printk("Reading clock frequencies failed!!! Using: %ld\n",
-		       itc_frequency);
-	}
-}
-
-
-//#define HZ 1
-#define HZ 1000		// 1000 clock ticks per sec
-#define IA64_TIMER_VECTOR 0xef
-
-void
-init_time(void)
-{
-	uint64_t new;
-	efi_time_t tm;
-	evtchn_port_t port = 0;
-
-	printk("Initialising time\n");
-	calculate_frequencies();
-
-	itm_val = (itc_frequency + HZ/2) / HZ;
-	printk("  itm_val: %ld\n", itm_val);
-
-	os_time.tv_sec = 0;
-	os_time.tv_nsec = 0;
-
-	if (efi_get_time(&tm)) {
-		printk("  EFI-Time: %d.%d.%d   %d:%d:%d\n", tm.Day,
-		       tm.Month, tm.Year, tm.Hour, tm.Minute, tm.Second);
-		os_time.tv_sec = _mktime(tm.Year, tm.Month,
-					tm.Day, tm.Hour, tm.Minute, tm.Second);
-		os_time.tv_nsec = tm.Nanosecond;
-	} else
-		printk("efi_get_time() failed\n");
-
-	port = bind_virq(VIRQ_ITC, timer_interrupt, NULL);
-	if (port == -1) {
-		printk("XEN timer request chn bind failed %i\n", port);
-		return;
-	}
-        unmask_evtchn(port);
-	itc_alt = ia64_get_itc();
-	itc_at_boot = itc_alt;
-	new = ia64_get_itc() + itm_val;
-	ia64_set_itv(IA64_TIMER_VECTOR);
-	ia64_set_itm(new);
-	ia64_srlz_d();
-}
-
-void
-fini_time(void)
-{
-	/* TODO */
-}
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/arch/ia64/xencomm.c
--- a/extras/mini-os/arch/ia64/xencomm.c	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,394 +0,0 @@
-/*
- * Copyright (C) 2006 Hollis Blanchard <hollisb@us.ibm.com>, IBM Corporation
- * Tristan Gingold <tristan.gingold@bull.net>
- *
- * 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
- */
-
-/*
- * This code is mostly taken from ia64-xen files xcom_mini.c and xencomm.c.
- * Changes: Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com
- */
-
-
-#include <mini-os/os.h>
-#include <mini-os/errno.h>
-#include <mini-os/lib.h>
-#include <mini-os/hypervisor.h>
-#include <xen/xencomm.h>
-#include <xen/grant_table.h>
-
-
-#define XENCOMM_MINI_ADDRS 3
-struct xencomm_mini
-{
-	struct xencomm_desc _desc;
-	uint64_t address[XENCOMM_MINI_ADDRS];
-};
-
-#define xen_guest_handle(hnd)  ((hnd).p)
-
-struct xencomm_handle;
-
-/* Translate virtual address to physical address.  */
-uint64_t
-xencomm_vaddr_to_paddr(uint64_t vaddr)
-{
-	if (IA64_RR_EXTR(vaddr) == 5)
-		return KERN_VIRT_2_PHYS(vaddr);
-
-	if (IA64_RR_EXTR(vaddr) == 7)
-		return __pa(vaddr);
-
-	return 0;
-}
-
-/* Inline version.  To be used only on linear space (kernel space).  */
-static struct xencomm_handle *
-xencomm_create_inline(void *buffer)
-{
-	unsigned long paddr;
-
-	paddr = xencomm_vaddr_to_paddr((unsigned long)buffer);
-	return (struct xencomm_handle *)(paddr | XENCOMM_INLINE_FLAG);
-}
-
-#define min(a,b) (((a) < (b)) ? (a) : (b))
-static int
-xencomm_init_desc(struct xencomm_desc *desc, void *buffer, unsigned long bytes)
-{
-	unsigned long recorded = 0;
-	int i = 0;
-
-	if ((buffer == NULL) && (bytes > 0))
-		BUG();
-
-	/* record the physical pages used */
-	if (buffer == NULL)
-		desc->nr_addrs = 0;
-
-	while ((recorded < bytes) && (i < desc->nr_addrs)) {
-		unsigned long vaddr = (unsigned long)buffer + recorded;
-		unsigned long paddr;
-		int offset;
-		int chunksz;
-
-		offset = vaddr % PAGE_SIZE; /* handle partial pages */
-		chunksz = min(PAGE_SIZE - offset, bytes - recorded);
-
-		paddr = xencomm_vaddr_to_paddr(vaddr);
-		if (paddr == ~0UL) {
-			printk("%s: couldn't translate vaddr %lx\n",
-			       __func__, vaddr);
-			return -EINVAL;
-		}
-
-		desc->address[i++] = paddr;
-		recorded += chunksz;
-	}
-	if (recorded < bytes) {
-		printk("%s: could only translate %ld of %ld bytes\n",
-		       __func__, recorded, bytes);
-		return -ENOSPC;
-	}
-
-	/* mark remaining addresses invalid (just for safety) */
-	while (i < desc->nr_addrs)
-		desc->address[i++] = XENCOMM_INVALID;
-	desc->magic = XENCOMM_MAGIC;
-	return 0;
-}
-
-static void *
-xencomm_alloc_mini(struct xencomm_mini *area, int *nbr_area)
-{
-	unsigned long base;
-	unsigned int pageoffset;
-
-	while (*nbr_area >= 0) {
-		/* Allocate an area.  */
-		(*nbr_area)--;
-
-		base = (unsigned long)(area + *nbr_area);
-		pageoffset = base % PAGE_SIZE; 
-
-		/* If the area does not cross a page, use it.  */
-		if ((PAGE_SIZE - pageoffset) >= sizeof(struct xencomm_mini))
-			return &area[*nbr_area];
-	}
-	/* No more area.  */
-	return NULL;
-}
-
-int
-xencomm_create_mini(struct xencomm_mini *area, int *nbr_area,
-                    void *buffer, unsigned long bytes,
-                    struct xencomm_handle **ret)
-{
-	struct xencomm_desc *desc;
-	int rc;
-	unsigned long res;
-
-	desc = xencomm_alloc_mini(area, nbr_area);
-	if (!desc)
-		return -ENOMEM;
-	desc->nr_addrs = XENCOMM_MINI_ADDRS;
-
-	rc = xencomm_init_desc(desc, buffer, bytes);
-	if (rc)
-		return rc;
-
-	res = xencomm_vaddr_to_paddr((unsigned long)desc);
-	if (res == ~0UL)
-		return -EINVAL;
-
-	*ret = (struct xencomm_handle*)res;
-	return 0;
-}
-
-static int
-xencommize_mini_grant_table_op(struct xencomm_mini *xc_area, int *nbr_area,
-                               unsigned int cmd, void *op, unsigned int count,
-                               struct xencomm_handle **desc)
-{
-	struct xencomm_handle *desc1;
-	unsigned int argsize=0;
-	int rc;
-
-	switch (cmd) {
-	case GNTTABOP_map_grant_ref:
-		argsize = sizeof(struct gnttab_map_grant_ref);
-		break;
-	case GNTTABOP_unmap_grant_ref:
-		argsize = sizeof(struct gnttab_unmap_grant_ref);
-		break;
-	case GNTTABOP_setup_table:
-	{
-		struct gnttab_setup_table *setup = op;
-
-		argsize = sizeof(*setup);
-
-		if (count != 1)
-			return -EINVAL;
-		rc = xencomm_create_mini
-		        (xc_area, nbr_area,
-		         (void*)(uint64_t) xen_guest_handle(setup->frame_list),
-		         setup->nr_frames
-		         * sizeof(*xen_guest_handle(setup->frame_list)),
-		         &desc1);
-		if (rc)
-			return rc;
-		set_xen_guest_handle(setup->frame_list,
-				     (void *)(uint64_t)desc1);
-		break;
-	}
-	case GNTTABOP_dump_table:
-		argsize = sizeof(struct gnttab_dump_table);
-		break;
-	case GNTTABOP_transfer:
-		argsize = sizeof(struct gnttab_transfer);
-		break;
-	case GNTTABOP_copy:
-		argsize = sizeof(struct gnttab_copy);
-		break;
-	default:
-		printk("%s: unknown mini grant table op %d\n", __func__, cmd);
-		BUG();
-	}
-
-	rc = xencomm_create_mini(xc_area, nbr_area, op, count * argsize, desc);
-
-	return rc;
-}
-
-static inline int
-xencomm_arch_hypercall_grant_table_op(unsigned int cmd,
-                                      struct xencomm_handle *uop,
-                                      unsigned int count)
-{
-	return _hypercall3(int, grant_table_op, cmd, uop, count);
-}
-
-int
-xencomm_mini_hypercall_grant_table_op(unsigned int cmd, void *op,
-                                      unsigned int count)
-{
-	int rc;
-	struct xencomm_handle *desc;
-	int nbr_area = 2;
-	struct xencomm_mini xc_area[2];
-
-	rc = xencommize_mini_grant_table_op(xc_area, &nbr_area,
-					    cmd, op, count, &desc);
-	if (rc)
-		return rc;
-	return xencomm_arch_hypercall_grant_table_op(cmd, desc, count);
-}
-
-static void
-gnttab_map_grant_ref_pre(struct gnttab_map_grant_ref *uop)
-{
-	uint32_t flags;
-
-	flags = uop->flags;
-
-	if (flags & GNTMAP_host_map) {
-		if (flags & GNTMAP_application_map) {
-			printk("GNTMAP_application_map is not supported yet: "
-			       "flags 0x%x\n", flags);
-			BUG();
-		}
-		if (flags & GNTMAP_contains_pte) {
-			printk("GNTMAP_contains_pte is not supported yet flags "
-			       "0x%x\n", flags);
-			BUG();
-		}
-	} else if (flags & GNTMAP_device_map) {
-		printk("GNTMAP_device_map is not supported yet 0x%x\n", flags);
-		BUG();//XXX not yet. actually this flag is not used.
-	} else {
-		BUG();
-	}
-}
-
-int
-HYPERVISOR_grant_table_op(unsigned int cmd, void *uop, unsigned int count)
-{
-	if (cmd == GNTTABOP_map_grant_ref) {
-		unsigned int i;
-		for (i = 0; i < count; i++) {
-			gnttab_map_grant_ref_pre(
-			        (struct gnttab_map_grant_ref*)uop + i);
-		}
-	}
-	return xencomm_mini_hypercall_grant_table_op(cmd, uop, count);
-}
-
-	/* In fw.S */
-extern int xencomm_arch_hypercall_suspend(struct xencomm_handle *arg);
-int
-HYPERVISOR_suspend(unsigned long srec)
-{
-        struct sched_shutdown arg;
-
-        arg.reason = (uint32_t)SHUTDOWN_suspend;
-
-        return xencomm_arch_hypercall_suspend(xencomm_create_inline(&arg));
-}
-
-int
-HYPERVISOR_event_channel_op(int cmd, void *arg)
-{
-	int rc;
-	struct xencomm_handle *newArg;
-
-	newArg = xencomm_create_inline(arg);
-	rc = _hypercall2(int, event_channel_op, cmd, newArg);
-	if (unlikely(rc == -ENOSYS)) {
-		struct evtchn_op op;
-
-		op.cmd = cmd;
-		memcpy(&op.u, arg, sizeof(op.u));
-		rc = _hypercall1(int, event_channel_op_compat, &op);
-	}
-	return rc;
-}
-
-static int
-xencomm_arch_xen_version(int cmd, struct xencomm_handle *arg)
-{
-	return _hypercall2(int, xen_version, cmd, arg);
-}
-
-static int
-xencomm_arch_xen_feature(int cmd, struct xencomm_handle *arg)
-{
-	struct xencomm_handle *newArg;
-
-	newArg = xencomm_create_inline(arg);
-	return _hypercall2(int, xen_version, cmd, newArg);
-}
-
-int
-HYPERVISOR_xen_version(int cmd, void *arg)
-{
-	switch(cmd) {
-		case XENVER_version:
-			return xencomm_arch_xen_version(cmd, 0);
-		case XENVER_get_features:
-			return xencomm_arch_xen_feature(cmd, arg);
-		default:
-			return -1;
-	}
-}
-
-int
-HYPERVISOR_console_io(int cmd, int count, char *str)
-{
-	struct xencomm_handle *newStr;
-
-	newStr = xencomm_create_inline(str);
-	return _hypercall3(int, console_io, cmd, count, newStr);
-}
-
-int
-HYPERVISOR_sched_op_compat(int cmd, unsigned long arg)
-{
-	return _hypercall2(int, sched_op_compat, cmd, arg);
-}
-
-int
-HYPERVISOR_sched_op(int cmd, void *arg)
-{
-	struct xencomm_handle *newArg;
-
-	newArg = xencomm_create_inline(arg);
-	return _hypercall2(int, sched_op, cmd, newArg);
-}
-
-int
-HYPERVISOR_callback_op(int cmd, void *arg)
-{
-	struct xencomm_handle *newArg;
-
-	newArg = xencomm_create_inline(arg);
-	return _hypercall2(int, callback_op, cmd, newArg);
-}
-
-int
-HYPERVISOR_opt_feature(void *arg)
-{
-	struct xencomm_handle *new_arg;
-
-	new_arg = xencomm_create_inline(arg);
-
-	return _hypercall1(int, opt_feature, new_arg);
-}
-
-int
-HYPERVISOR_shutdown(unsigned int reason)
-{
-	struct sched_shutdown sched_shutdown = {
-		.reason = reason
-	};
-
-	int rc = HYPERVISOR_sched_op(SCHEDOP_shutdown, &sched_shutdown);
-
-	if (rc == -ENOSYS)
-		rc = HYPERVISOR_sched_op_compat(SCHEDOP_shutdown, reason);
-
-	return rc;
-}
-
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/gnttab.c
--- a/extras/mini-os/gnttab.c	Wed Sep 12 16:12:42 2012 +0100
+++ b/extras/mini-os/gnttab.c	Wed Sep 12 17:55:27 2012 +0100
@@ -23,11 +23,7 @@
 #define NR_RESERVED_ENTRIES 8
 
 /* NR_GRANT_FRAMES must be less than or equal to that configured in Xen */
-#ifdef __ia64__
-#define NR_GRANT_FRAMES 1
-#else
 #define NR_GRANT_FRAMES 4
-#endif
 #define NR_GRANT_ENTRIES (NR_GRANT_FRAMES * PAGE_SIZE / sizeof(grant_entry_t))
 
 static grant_entry_t *gnttab_table;
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/include/hypervisor.h
--- a/extras/mini-os/include/hypervisor.h	Wed Sep 12 16:12:42 2012 +0100
+++ b/extras/mini-os/include/hypervisor.h	Wed Sep 12 17:55:27 2012 +0100
@@ -7,7 +7,6 @@
  * Copyright (c) 2002, K A Fraser
  * Copyright (c) 2005, Grzegorz Milos
  * Updates: Aravindh Puthiyaparambil <aravindh.puthiyaparambil@unisys.com>
- * Updates: Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com> for ia64
  */
 
 #ifndef _HYPERVISOR_H_
@@ -19,8 +18,6 @@
 #include <hypercall-x86_32.h>
 #elif defined(__x86_64__)
 #include <hypercall-x86_64.h>
-#elif defined(__ia64__)
-#include <hypercall-ia64.h>
 #else
 #error "Unsupported architecture"
 #endif
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/include/ia64/arch_limits.h
--- a/extras/mini-os/include/ia64/arch_limits.h	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-
-#ifndef __ARCH_LIMITS_H__
-#define __ARCH_LIMITS_H__
-
-/* Commonly 16K pages are used. */
-#define __PAGE_SHIFT	14	/* 16K pages */
-#define __PAGE_SIZE	(1<<(__PAGE_SHIFT))
-
-#define __STACK_SIZE_PAGE_ORDER   2
-#define __STACK_SIZE              (__PAGE_SIZE * (1 << __STACK_SIZE_PAGE_ORDER))
-          
-#endif /* __ARCH_LIMITS_H__ */
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/include/ia64/arch_mm.h
--- a/extras/mini-os/include/ia64/arch_mm.h	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2007 - Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
- *
- ****************************************************************************
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- * 
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
- * DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef __ARCH_MM_H__
-#define __ARCH_MM_H__
-
-#include "page.h"
-#include "ia64_cpu.h"
-
-#define PFN_PHYS(x)	(pfn_to_page(x))
-#define PHYS_PFN(x)	(page_to_pfn(x))
-#define to_virt(x)	__va(x)
-#define to_phys(x)	__pa(x)
-
-#define virt_to_mfn(x)	virt_to_pfn(x)
-#define virtual_to_mfn(x)      (ia64_tpa((uint64_t)(x)) >> PAGE_SHIFT)
-
-#define map_frames(f, n) map_frames_ex(f, n, 1, 0, 1, DOMID_SELF, NULL, 0)
-/* TODO */
-#define map_zero(n, a) map_frames_ex(NULL, n, 0, 0, a, DOMID_SELF, NULL, 0)
-#define do_map_zero(start, n) ASSERT(n == 0)
-
-#endif /* __ARCH_MM_H__ */
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/include/ia64/arch_sched.h
--- a/extras/mini-os/include/ia64/arch_sched.h	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 2006 Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
- * All rights reserved.
- *
- * The file contains ia64 specific scheduler declarations.
- *
- ****************************************************************************
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- * 
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
- * DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef __ARCH_SCHED_H__
-#define __ARCH_SCHED_H__
-
-#include "os.h"
-
-struct thread;				/* Only declaration */
-
-struct thread_regs
-{
-	unsigned long	unat_b;		/* NaT before spilling */
-	unsigned long	sp;
-	unsigned long	rp;
-	unsigned long	pr;
-	unsigned long	bsp;
-	unsigned long	pfs;
-	unsigned long	rnat;
-	unsigned long	lc;
-
-	unsigned long	unat_a;		/* NaT after spilling. */
-	unsigned long	r4;
-	unsigned long	r5;
-	unsigned long	r6;
-	unsigned long	r7;
-
-	unsigned long	b1;
-	unsigned long	b2;
-	unsigned long	b3;
-	unsigned long	b4;
-	unsigned long	b5;
-
-	ia64_fpreg_t	f2;
-	ia64_fpreg_t	f3;
-	ia64_fpreg_t	f4;
-	ia64_fpreg_t	f5;
-	ia64_fpreg_t	f16;
-	ia64_fpreg_t	f17;
-	ia64_fpreg_t	f18;
-	ia64_fpreg_t	f19;
-	ia64_fpreg_t	f20;
-	ia64_fpreg_t	f21;
-	ia64_fpreg_t	f22;
-	ia64_fpreg_t	f23;
-	ia64_fpreg_t	f24;
-	ia64_fpreg_t	f25;
-	ia64_fpreg_t	f26;
-	ia64_fpreg_t	f27;
-	ia64_fpreg_t	f28;
-	ia64_fpreg_t	f29;
-	ia64_fpreg_t	f30;
-	ia64_fpreg_t	f31;
-};
-
-typedef struct thread_regs thread_regs_t;
-
-void arch_switch_threads(struct thread* prev, struct thread* next);
-
-static inline struct thread* get_current(void)
-{
-	register struct thread *current asm("r13");
-	return current;
-}
-
-
-#endif /* __ARCH_SCHED_H__ */
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/include/ia64/arch_spinlock.h
--- a/extras/mini-os/include/ia64/arch_spinlock.h	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
- * Done by Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com
- * The file contains ia64 special spinlock stuff.
- *
- ****************************************************************************
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- * 
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
- * DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _ARCH_SPINLOCK_H_
-#define _ARCH_SPINLOCK_H_
-
-#include "atomic.h"
-
-#define ARCH_SPIN_LOCK_UNLOCKED { 0 }
-
-#define SPIN_LOCK_UNUSED	0
-#define SPIN_LOCK_USED		1
-
-
-static inline void
-_raw_spin_lock(spinlock_t* lck)
-{
-	uint32_t ret;
-	do {
-		ret = ia64_cmpxchg_acq_32(&(lck->slock),
-					  SPIN_LOCK_UNUSED, SPIN_LOCK_USED);
-	} while (ret == SPIN_LOCK_USED);
-}
-
-static inline void
-_raw_spin_unlock(spinlock_t *lck)
-{
-	asm volatile ("st4.rel.nta [%0] = r0\n\t" :: "r"(&(lck->slock))
-							: "memory" );
-}
-
-static inline uint32_t
-_raw_spin_trylock(spinlock_t* lck)
-{
-	uint32_t ret;
-	ret = ia64_cmpxchg_acq_32(&(lck->slock), SPIN_LOCK_USED, SPIN_LOCK_USED);
-	return (ret == SPIN_LOCK_USED);
-}
-
-#endif /* _ARCH_SPINLOCK_H_ */
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/include/ia64/asm.h
--- a/extras/mini-os/include/ia64/asm.h	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-/*
- * Done by Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com
- */
-
-#if !defined(_ASM_H_)
-#define _ASM_H_
-
-#define	ENTRY(_name_)				\
-	.global	_name_;				\
-	.align	16;				\
-	.proc	_name_;				\
-_name_:;					\
-
-
-#define	END(_name_)						\
-	.endp	_name_
-
-#endif /* !defined(_ASM_H_) */
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/include/ia64/atomic.h
--- a/extras/mini-os/include/ia64/atomic.h	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,504 +0,0 @@
-/*
- * This code is mostly taken from FreeBSD machine/atomic.h
- * Changes: Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
- *
- ****************************************************************************
- * Copyright (c) 1998 Doug Rabson
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef _MACHINE_ATOMIC_H_
-#define _MACHINE_ATOMIC_H_
-
-/*
- * Various simple arithmetic on memory which is atomic in the presence
- * of interrupts and SMP safe.
- */
-
-#if !defined(__ASSEMBLY__)
-
-#include <mini-os/types.h>
-
-
-/*
- * Everything is built out of cmpxchg.
- */
-#define IA64_CMPXCHG(sz, sem, p, cmpval, newval, ret)		\
-	__asm __volatile (					\
-		"mov ar.ccv=%2;;\n\t"				\
-		"cmpxchg" #sz "." #sem " %0=%4,%3,ar.ccv\n\t"	\
-		: "=r" (ret), "=m" (*p)				\
-		: "r" (cmpval), "r" (newval), "m" (*p)		\
-		: "memory")
-
-
-/*
- * Some common forms of cmpxch.
- */
-
-static __inline uint8_t
-ia64_cmpxchg_acq_8(volatile uint8_t* p, uint8_t cmpval, uint8_t newval)
-{
-	uint8_t ret;
-
-	IA64_CMPXCHG(1, acq, p, cmpval, newval, ret);
-	return (ret);
-}
-
-static __inline uint16_t
-ia64_cmpxchg_acq_16(volatile uint16_t* p, uint16_t cmpval, uint16_t newval)
-{
-	uint16_t ret;
-
-	IA64_CMPXCHG(2, acq, p, cmpval, newval, ret);
-	return (ret);
-}
-
-static __inline uint32_t
-ia64_cmpxchg_acq_32(volatile uint32_t* p, uint32_t cmpval, uint32_t newval)
-{
-	uint32_t ret;
-
-	IA64_CMPXCHG(4, acq, p, cmpval, newval, ret);
-	return (ret);
-}
-
-static __inline uint32_t
-ia64_cmpxchg_rel_32(volatile uint32_t* p, uint32_t cmpval, uint32_t newval)
-{
-	uint32_t ret;
-
-	IA64_CMPXCHG(4, rel, p, cmpval, newval, ret);
-	return (ret);
-}
-
-static __inline uint64_t
-ia64_cmpxchg_acq_64(volatile uint64_t* p, uint64_t cmpval, uint64_t newval)
-{
-	uint64_t ret;
-
-	IA64_CMPXCHG(8, acq, p, cmpval, newval, ret);
-	return (ret);
-}
-
-static __inline uint64_t
-ia64_cmpxchg_rel_64(volatile uint64_t* p, uint64_t cmpval, uint64_t newval)
-{
-	uint64_t ret;
-
-	IA64_CMPXCHG(8, rel, p, cmpval, newval, ret);
-	return (ret);
-}
-
-#define ATOMIC_STORE_LOAD(type, width, size)			\
-static __inline uint##width##_t				\
-ia64_ld_acq_##width(volatile uint##width##_t* p)		\
-{								\
-	uint##width##_t v;					\
-								\
-	__asm __volatile ("ld" size ".acq %0=%1"		\
-			  : "=r" (v)				\
-			  : "m" (*p)				\
-			  : "memory");				\
-	return (v);						\
-}								\
-								\
-static __inline uint##width##_t				\
-atomic_load_acq_##width(volatile uint##width##_t* p)		\
-{								\
-	uint##width##_t v;					\
-								\
-	__asm __volatile ("ld" size ".acq %0=%1"		\
-			  : "=r" (v)				\
-			  : "m" (*p)				\
-			  : "memory");				\
-	return (v);						\
-}								\
-								\
-static __inline uint##width##_t				\
-atomic_load_acq_##type(volatile uint##width##_t* p)		\
-{								\
-	uint##width##_t v;					\
-								\
-	__asm __volatile ("ld" size ".acq %0=%1"		\
-			  : "=r" (v)				\
-			  : "m" (*p)				\
-			  : "memory");				\
-	return (v);						\
-}								\
-							       	\
-static __inline void						\
-ia64_st_rel_##width(volatile uint##width##_t* p, uint##width##_t v)\
-{								\
-	__asm __volatile ("st" size ".rel %0=%1"		\
-			  : "=m" (*p)				\
-			  : "r" (v)				\
-			  : "memory");				\
-}								\
-							       	\
-static __inline void						\
-atomic_store_rel_##width(volatile uint##width##_t* p, uint##width##_t v)\
-{								\
-	__asm __volatile ("st" size ".rel %0=%1"		\
-			  : "=m" (*p)				\
-			  : "r" (v)				\
-			  : "memory");				\
-}								\
-							       	\
-static __inline void						\
-atomic_store_rel_##type(volatile uint##width##_t* p, uint##width##_t v)\
-{								\
-	__asm __volatile ("st" size ".rel %0=%1"		\
-			  : "=m" (*p)				\
-			  : "r" (v)				\
-			  : "memory");				\
-}
-
-ATOMIC_STORE_LOAD(char, 8, "1")
-ATOMIC_STORE_LOAD(short, 16, "2")
-ATOMIC_STORE_LOAD(int, 32, "4")
-ATOMIC_STORE_LOAD(long, 64, "8")
-
-#undef ATOMIC_STORE_LOAD
-
-#define IA64_ATOMIC(sz, type, name, width, op)			\
-									\
-static __inline type							\
-atomic_##name##_acq_##width(volatile type *p, type v)		\
-{									\
-	type old, ret;							\
-	do {								\
-		old = *p;						\
-		IA64_CMPXCHG(sz, acq, p, old, old op v, ret);	\
-	} while (ret != old);						\
-	return(ret);							\
-}									\
-									\
-static __inline type							\
-atomic_##name##_rel_##width(volatile type *p, type v)		\
-{									\
-	type old, ret;							\
-	do {								\
-		old = *p;						\
-		IA64_CMPXCHG(sz, rel, p, old, old op v, ret);	\
-	} while (ret != old);						\
-	return(ret);							\
-}
-
-IA64_ATOMIC(1, uint8_t,  set,	8,	|)
-IA64_ATOMIC(2, uint16_t, set,	16,	|)
-IA64_ATOMIC(4, uint32_t, set,	32,	|)
-IA64_ATOMIC(8, uint64_t, set,	64,	|)
-
-IA64_ATOMIC(1, uint8_t,  clear,	8,	&~)
-IA64_ATOMIC(2, uint16_t, clear,	16,	&~)
-IA64_ATOMIC(4, uint32_t, clear,	32,	&~)
-IA64_ATOMIC(8, uint64_t, clear,	64,	&~)
-
-IA64_ATOMIC(1, uint8_t,  add,	8,	+)
-IA64_ATOMIC(2, uint16_t, add,	16,	+)
-IA64_ATOMIC(4, uint32_t, add,	32,	+)
-IA64_ATOMIC(8, uint64_t, add,	64,	+)
-
-IA64_ATOMIC(1, uint8_t,  subtract,	8,	-)
-IA64_ATOMIC(2, uint16_t, subtract,	16,	-)
-IA64_ATOMIC(4, uint32_t, subtract,	32,	-)
-IA64_ATOMIC(8, uint64_t, subtract,	64,	-)
-
-#undef IA64_ATOMIC
-#undef IA64_CMPXCHG
-
-#define atomic_set_8			atomic_set_acq_8
-#define	atomic_clear_8			atomic_clear_acq_8
-#define atomic_add_8			atomic_add_acq_8
-#define	atomic_subtract_8		atomic_subtract_acq_8
-
-#define atomic_set_16			atomic_set_acq_16
-#define	atomic_clear_16			atomic_clear_acq_16
-#define atomic_add_16			atomic_add_acq_16
-#define	atomic_subtract_16		atomic_subtract_acq_16
-
-#define atomic_set_32			atomic_set_acq_32
-#define	atomic_clear_32			atomic_clear_acq_32
-#define atomic_add_32			atomic_add_acq_32
-#define	atomic_subtract_32		atomic_subtract_acq_32
-
-#define atomic_set_64			atomic_set_acq_64
-#define	atomic_clear_64			atomic_clear_acq_64
-#define atomic_add_64			atomic_add_acq_64
-#define	atomic_subtract_64		atomic_subtract_acq_64
-
-#define atomic_set_char			atomic_set_8
-#define atomic_clear_char		atomic_clear_8
-#define atomic_add_char			atomic_add_8
-#define atomic_subtract_char		atomic_subtract_8
-#define atomic_set_acq_char		atomic_set_acq_8
-#define atomic_clear_acq_char		atomic_clear_acq_8
-#define atomic_add_acq_char		atomic_add_acq_8
-#define atomic_subtract_acq_char	atomic_subtract_acq_8
-#define atomic_set_rel_char		atomic_set_rel_8
-#define atomic_clear_rel_char		atomic_clear_rel_8
-#define atomic_add_rel_char		atomic_add_rel_8
-#define atomic_subtract_rel_char	atomic_subtract_rel_8
-
-#define atomic_set_short		atomic_set_16
-#define atomic_clear_short		atomic_clear_16
-#define atomic_add_short		atomic_add_16
-#define atomic_subtract_short		atomic_subtract_16
-#define atomic_set_acq_short		atomic_set_acq_16
-#define atomic_clear_acq_short		atomic_clear_acq_16
-#define atomic_add_acq_short		atomic_add_acq_16
-#define atomic_subtract_acq_short	atomic_subtract_acq_16
-#define atomic_set_rel_short		atomic_set_rel_16
-#define atomic_clear_rel_short		atomic_clear_rel_16
-#define atomic_add_rel_short		atomic_add_rel_16
-#define atomic_subtract_rel_short	atomic_subtract_rel_16
-
-#define atomic_set_int			atomic_set_32
-#define atomic_clear_int		atomic_clear_32
-#define atomic_add_int			atomic_add_32
-#define atomic_subtract_int		atomic_subtract_32
-#define atomic_set_acq_int		atomic_set_acq_32
-#define atomic_clear_acq_int		atomic_clear_acq_32
-#define atomic_add_acq_int		atomic_add_acq_32
-#define atomic_subtract_acq_int		atomic_subtract_acq_32
-#define atomic_set_rel_int		atomic_set_rel_32
-#define atomic_clear_rel_int		atomic_clear_rel_32
-#define atomic_add_rel_int		atomic_add_rel_32
-#define atomic_subtract_rel_int		atomic_subtract_rel_32
-
-#define atomic_set_long			atomic_set_64
-#define atomic_clear_long		atomic_clear_64
-#define atomic_add_long			atomic_add_64
-#define atomic_subtract_long		atomic_subtract_64
-#define atomic_set_acq_long		atomic_set_acq_64
-#define atomic_clear_acq_long		atomic_clear_acq_64
-#define atomic_add_acq_long		atomic_add_acq_64
-#define atomic_subtract_acq_long	atomic_subtract_acq_64
-#define atomic_set_rel_long		atomic_set_rel_64
-#define atomic_clear_rel_long		atomic_clear_rel_64
-#define atomic_add_rel_long		atomic_add_rel_64
-#define atomic_subtract_rel_long	atomic_subtract_rel_64
-
-/*
- * Atomically compare the value stored at *p with cmpval and if the
- * two values are equal, update the value of *p with newval. Returns
- * zero if the compare failed, nonzero otherwise.
- */
-static __inline int
-atomic_cmpset_acq_32(volatile uint32_t* p, uint32_t cmpval, uint32_t newval)
-{
-	return ia64_cmpxchg_acq_32(p, cmpval, newval) == cmpval;
-}
-
-static __inline int
-atomic_cmpset_rel_32(volatile uint32_t* p, uint32_t cmpval, uint32_t newval)
-{
-	return ia64_cmpxchg_rel_32(p, cmpval, newval) == cmpval;
-}
-
-/*
- * Atomically compare the value stored at *p with cmpval and if the
- * two values are equal, update the value of *p with newval. Returns
- * zero if the compare failed, nonzero otherwise.
- */
-static __inline int
-atomic_cmpset_acq_64(volatile uint64_t* p, uint64_t cmpval, uint64_t newval)
-{
-	return ia64_cmpxchg_acq_64(p, cmpval, newval) == cmpval;
-}
-
-static __inline int
-atomic_cmpset_rel_64(volatile uint64_t* p, uint64_t cmpval, uint64_t newval)
-{
-	return ia64_cmpxchg_rel_64(p, cmpval, newval) == cmpval;
-}
-
-#define atomic_cmpset_32		atomic_cmpset_acq_32
-#define atomic_cmpset_64		atomic_cmpset_acq_64
-#define	atomic_cmpset_int		atomic_cmpset_32
-#define	atomic_cmpset_long		atomic_cmpset_64
-#define atomic_cmpset_acq_int		atomic_cmpset_acq_32
-#define atomic_cmpset_rel_int		atomic_cmpset_rel_32
-#define atomic_cmpset_acq_long		atomic_cmpset_acq_64
-#define atomic_cmpset_rel_long		atomic_cmpset_rel_64
-
-static __inline int
-atomic_cmpset_acq_ptr(volatile void *dst, void *exp, void *src)
-{
-        return atomic_cmpset_acq_long((volatile u_long *)dst,
-				      (u_long)exp, (u_long)src);
-}
-
-static __inline int
-atomic_cmpset_rel_ptr(volatile void *dst, void *exp, void *src)
-{
-        return atomic_cmpset_rel_long((volatile u_long *)dst,
-				      (u_long)exp, (u_long)src);
-}
-
-#define	atomic_cmpset_ptr	atomic_cmpset_acq_ptr
-
-static __inline void *
-atomic_load_acq_ptr(volatile void *p)
-{
-	return (void *)atomic_load_acq_long((volatile u_long *)p);
-}
-
-static __inline void
-atomic_store_rel_ptr(volatile void *p, void *v)
-{
-	atomic_store_rel_long((volatile u_long *)p, (u_long)v);
-}
-
-#define IA64_ATOMIC_PTR(NAME)				\
-static __inline void					\
-atomic_##NAME##_ptr(volatile void *p, uintptr_t v)	\
-{							\
-	atomic_##NAME##_long((volatile u_long *)p, v);	\
-}							\
-							\
-static __inline void					\
-atomic_##NAME##_acq_ptr(volatile void *p, uintptr_t v)	\
-{							\
-	atomic_##NAME##_acq_long((volatile u_long *)p, v);\
-}							\
-							\
-static __inline void					\
-atomic_##NAME##_rel_ptr(volatile void *p, uintptr_t v)	\
-{							\
-	atomic_##NAME##_rel_long((volatile u_long *)p, v);\
-}
-
-IA64_ATOMIC_PTR(set)
-IA64_ATOMIC_PTR(clear)
-IA64_ATOMIC_PTR(add)
-IA64_ATOMIC_PTR(subtract)
-
-#undef IA64_ATOMIC_PTR
-
-static __inline uint32_t
-atomic_readandclear_32(volatile uint32_t* p)
-{
-	uint32_t val;
-	do {
-		val = *p;
-	} while (!atomic_cmpset_32(p, val, 0));
-	return val;
-}
-
-static __inline uint64_t
-atomic_readandclear_64(volatile uint64_t* p)
-{
-	uint64_t val;
-	do {
-		val = *p;
-	} while (!atomic_cmpset_64(p, val, 0));
-	return val;
-}
-
-#define atomic_readandclear_int	atomic_readandclear_32
-#define atomic_readandclear_long	atomic_readandclear_64
-
-
-/* Some bit operations */
-
-static inline void
-set_bit(int num, volatile void *addr)
-{
-	uint32_t bit, old, new;
-	volatile uint32_t *p;
-	p = (volatile uint32_t *) addr + (num >> 5);
-	bit = 1 << (num & 31);
-	do
-	{
-		old = *p;
-		new = old | bit;
-	} while(ia64_cmpxchg_acq_32(p, old, new) != old);
-}
-
-static __inline__ void
-clear_bit(int num, volatile void *addr)
-{
-	uint32_t mask, old, new;
-	volatile uint32_t *p;
-	p = (volatile uint32_t *) addr + (num >> 5);
-	mask = ~(1 << (num & 31));
-	do {
-		old = *p;
-		new = old & mask;
-	} while (ia64_cmpxchg_acq_32(p, old, new) != old);
-}
-
-static __inline__ int
-test_bit(int num, const volatile void *addr)
-{
-	uint32_t val = 1;
-        return val & (((const volatile uint32_t *) addr)[num >> 5] >> (num & 31));
-}
-
-/*
- * test_and_set_bit - Set a bit and return its old value
- * num: Bit to set
- * addr: Address to count from
- */
-static inline int
-test_and_set_bit (int num, volatile void *addr)
-{
-        uint32_t bit, old, new;
-        volatile uint32_t *m;
-
-        m = (volatile uint32_t *) addr + (num >> 5);
-        bit = 1 << (num & 31);
-        do {
-                old = *m;
-                new = old | bit;
-        } while (ia64_cmpxchg_acq_32(m, old, new) != old);
-        return (old & bit) != 0;
-}
-
-/*
- * test_and_clear_bit - Clear a bit and return its old value
- * num: Bit to set
- * addr: Address to count from
- */
-static
-inline int test_and_clear_bit(int num, volatile unsigned long * addr)
-{
-        uint32_t bit, old, new;
-        volatile uint32_t* a;
-
-        a = (volatile uint32_t *) addr + (num >> 5);
-        bit = ~(1 << (num & 31));
-        do {
-                old = *a;
-                new = old & bit;
-        } while (ia64_cmpxchg_acq_32(a, old, new) != old);
-        return (old & ~bit) != 0;
-}
-
-
-#endif /* !defined(__ASSEMBLY__) */
-
-#endif /* ! _MACHINE_ATOMIC_H_ */
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/include/ia64/efi.h
--- a/extras/mini-os/include/ia64/efi.h	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,396 +0,0 @@
-/*
- * This is a short summary of declarations and definitions from different
- * efi header files of Intels' EFI_Toolkit_1.10.14.62 
- * used for the minimal implementation in mini-os.
- * Changes: Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
- *
- ****************************************************************************
- * Copyright (C) 2001-2004, Intel Corporation.
- * THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO WARRANTIES WHATSOEVER,
- * INCLUDING ANY WARRANTY OF MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR
- * ANY PARTICULAR PURPOSE, OR ANY WARRANTY OTHERWISE ARISING OUT OF ANY
- * PROPOSAL, SPECIFICATION OR SAMPLE. Except for a limited copyright license
- * to copy this specification for internal use only, no license, express or
- * implied, by estoppel or otherwise, to any intellectual property rights is
- * granted herein.  Intel disclaims all liability, including liability for
- * infringement of any proprietary rights, relating to implementation of
- * information in this specification. Intel does not warrant or represent
- * that such implementation(s) will not infringe such rights.  Designers must
- * not rely on the absence or characteristics of any features or instructions
- * marked "reserved" or "undefined." Intel reserves these for future
- * definition and shall have no responsibility whatsoever for conflicts or
- * incompatibilities arising from future changes to them.
- * This document is an intermediate draft for comment only and is subject to
- * change without notice. Readers should not design products based on this
- * document.
- * Intel, the Intel logo, and Itanium are trademarks or registered trademarks
- * of Intel Corporation or its subsidiaries in the United States and other
- * countries.
- * Other names and brands may be claimed as the property of others.
- */
-
-#ifndef _EFI_H_
-#define _EFI_H_
-
-#include <mini-os/types.h>
-
-
-#define EFIWARN(a)                      (a)
-#define EFI_ERROR(a)                    (((int64_t) a) < 0)
-
-
-#define EFI_SUCCESS                     0
-#define EFI_LOAD_ERROR                  EFIERR(1)
-#define EFI_INVALID_PARAMETER           EFIERR(2)
-#define EFI_UNSUPPORTED                 EFIERR(3)
-#define EFI_BAD_BUFFER_SIZE             EFIERR(4)
-#define EFI_BUFFER_TOO_SMALL            EFIERR(5)
-#define EFI_NOT_READY                   EFIERR(6)
-#define EFI_DEVICE_ERROR                EFIERR(7)
-#define EFI_WRITE_PROTECTED             EFIERR(8)
-#define EFI_OUT_OF_RESOURCES            EFIERR(9)
-#define EFI_VOLUME_CORRUPTED            EFIERR(10)
-#define EFI_VOLUME_FULL                 EFIERR(11)
-#define EFI_NO_MEDIA                    EFIERR(12)
-#define EFI_MEDIA_CHANGED               EFIERR(13)
-#define EFI_NOT_FOUND                   EFIERR(14)
-#define EFI_ACCESS_DENIED               EFIERR(15)
-#define EFI_NO_RESPONSE                 EFIERR(16)
-#define EFI_NO_MAPPING                  EFIERR(17)
-#define EFI_TIMEOUT                     EFIERR(18)
-#define EFI_NOT_STARTED                 EFIERR(19)
-#define EFI_ALREADY_STARTED             EFIERR(20)
-#define EFI_ABORTED                     EFIERR(21)
-#define EFI_ICMP_ERROR                  EFIERR(22)
-#define EFI_TFTP_ERROR                  EFIERR(23)
-#define EFI_PROTOCOL_ERROR              EFIERR(24)
-
-#define EFI_WARN_UNKOWN_GLYPH           EFIWARN(1)
-#define EFI_WARN_DELETE_FAILURE         EFIWARN(2)
-#define EFI_WARN_WRITE_FAILURE          EFIWARN(3)
-#define EFI_WARN_BUFFER_TOO_SMALL       EFIWARN(4)
-
-
-typedef uint64_t	efi_status_t;
-typedef void*		efi_handle_t;
-typedef void*		efi_event_t;
-typedef uint16_t	efi_char16_t;
-
-
-/*
- * Standard EFI table header
- */
-
-struct efi_table_header
-{
-	uint64_t	Signature;
-	// Revision of EFI table specification,
-	// upper 16 bit - major revision number
-	// lower 16 bit - minor revision number
-	uint32_t	Revision;
-	uint32_t	HeaderSize;
-	uint32_t	CRC32;
-	uint32_t	Reserved;
-};
-typedef struct efi_table_header efi_table_header_t;
-
-/*
- * EFI Time
- */
-typedef struct
-{          
-	uint16_t	Year;       /* 1998 - 20XX */
-	uint8_t		Month;      /* 1 - 12 */
-	uint8_t		Day;        /* 1 - 31 */
-	uint8_t		Hour;       /* 0 - 23 */
-	uint8_t		Minute;     /* 0 - 59 */
-	uint8_t		Second;     /* 0 - 59 */
-	uint8_t		Pad1;
-	uint32_t	Nanosecond; /* 0 - 999,999,999 */
-	int16_t		TimeZone;   /* -1440 to 1440 or 2047 */
-	uint8_t		Daylight;
-	uint8_t		Pad2;
-} efi_time_t;
-
-/* Bit definitions for efi_time_t.Daylight */
-#define EFI_TIME_ADJUST_DAYLIGHT    0x01
-#define EFI_TIME_IN_DAYLIGHT        0x02
-
-/* Value definition for efi_time_t.TimeZone */
-#define EFI_UNSPECIFIED_TIMEZONE    0x07FF
-
-
-
-typedef struct
-{
-	uint32_t	Resolution;     /* 1e-6 parts per million */
-	uint32_t	Accuracy;       /* hertz */
-	uint8_t		SetsToZero;     /* Set clears sub-second time */
-} efi_time_capabilities_t;
-
-
-typedef efi_status_t (*efi_get_time_t) (efi_time_t*, efi_time_capabilities_t*);
-typedef efi_status_t (*efi_set_time_t) (efi_time_t*);
-typedef efi_status_t (*efi_get_wakeup_time_t) (uint8_t*, uint8_t*, efi_time_t*);
-typedef efi_status_t (*efi_set_wakeup_time_t) (uint8_t, efi_time_t*);
-
-/*
- * Memory
- * Preseve the attr on any range supplied.
- * ConventialMemory must have WB,SR,SW when supplied.
- * When allocating from ConventialMemory always make it WB,SR,SW
- * When returning to ConventialMemory always make it WB,SR,SW
- * When getting the memory map, or on RT for runtime types
- */
-
-typedef enum {
-	EfiReservedMemoryType,		/* 0 */
-	EfiLoaderCode,
-	EfiLoaderData,
-	EfiBootServicesCode,
-	EfiBootServicesData,
-	EfiRuntimeServicesCode,
-	EfiRuntimeServicesData,		/* 6 */
-	EfiConventionalMemory,		/* 7 */
-	EfiUnusableMemory,
-	EfiACPIReclaimMemory,		/* 9 */
-	EfiACPIMemoryNVS,		/* 10, a */
-	EfiMemoryMappedIO,
-	EfiMemoryMappedIOPortSpace,	/* 12, c */
-	EfiPalCode,			/* 13, d */
-	EfiMaxMemoryType		/* 14, e */
-} efi_memory_type_t;
-
-/* possible caching types for the memory range */
-#define EFI_MEMORY_UC		0x0000000000000001
-#define EFI_MEMORY_WC		0x0000000000000002
-#define EFI_MEMORY_WT		0x0000000000000004
-#define EFI_MEMORY_WB		0x0000000000000008
-#define EFI_MEMORY_UCE		0x0000000000000010  
-/* physical memory protection on range */
-#define EFI_MEMORY_WP		0x0000000000001000
-#define EFI_MEMORY_RP		0x0000000000002000
-#define EFI_MEMORY_XP		0x0000000000004000
-/* range requires a runtime mapping */
-#define EFI_MEMORY_RUNTIME	0x8000000000000000
-
-#define EFI_MEMORY_DESCRIPTOR_VERSION  1
-
-typedef uint64_t efi_phys_addr_t;
-typedef uint64_t efi_virt_addr_t;
-
-typedef struct
-{
-	uint32_t	Type;           /* 32 bit padding */
-	efi_phys_addr_t	PhysicalStart;
-	efi_virt_addr_t	VirtualStart;
-	uint64_t	NumberOfPages;
-	uint64_t	Attribute;
-} efi_memory_descriptor_t;
-
-#define NextMemoryDescriptor(Ptr,Size)  ((efi_memory_descriptor_t*) (((uint8_t*) Ptr) + Size))
-
-
-typedef efi_status_t (*efi_set_virtual_address_map_t)
-	(
-		uint64_t MemoryMapSize,
-		uint64_t DescriptorSize,
-		uint32_t DescriptorVersion,
-		efi_memory_descriptor_t* VirtualMap
-	);
-
-typedef efi_status_t (*efi_convert_pointer_t)
-	(
-		uint64_t DebugDisposition,
-		void** Address
-	);
-
-/*
- * A GUID
- */
-
-typedef struct
-{          
-	uint32_t	Data1;
-	uint16_t	Data2;
-	uint16_t	Data3;
-	uint8_t		Data4[8]; 
-} efi_guid_t;
-
-/*
- * EFI Configuration Table and GUID definitions
- */
-
-#define MPS_TABLE_GUID			\
-	{ 0xeb9d2d2f, 0x2d88, 0x11d3,	\
-		{ 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } }
-
-#define ACPI_TABLE_GUID			\
-	{ 0xeb9d2d30, 0x2d88, 0x11d3,	\
-		{ 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } }
-
-#define ACPI_20_TABLE_GUID  \
-	{ 0x8868e871, 0xe4f1, 0x11d3,	\
-		{ 0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } }
-
-#define SMBIOS_TABLE_GUID    \
-	{ 0xeb9d2d31, 0x2d88, 0x11d3,	\
-		{ 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } }
-
-#define SAL_SYSTEM_TABLE_GUID    \
-	{ 0xeb9d2d32, 0x2d88, 0x11d3,	\
-		{ 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } }
-
-/* DIG64 Headless Console & Debug Port Table. */
-#define	HCDP_TABLE_GUID		\
-	{0xf951938d, 0x620b, 0x42ef,	\
-		{0x82, 0x79, 0xa8, 0x4b, 0x79, 0x61, 0x78, 0x98 } }
-
-
-typedef struct efi_configuration_table
-{
-	efi_guid_t	VendorGuid;
-	void*		VendorTable;
-} efi_configuration_table_t;
-
-
-/*
- * EFI platform variables
- */
-
-#define EFI_GLOBAL_VARIABLE     \
-    {	0x8BE4DF61, 0x93CA, 0x11d2, 0xAA, 0x0D, 0x00,	\
-	0xE0, 0x98, 0x03, 0x2B, 0x8C }
-
-/* Variable attributes */
-#define EFI_VARIABLE_NON_VOLATILE           0x00000001
-#define EFI_VARIABLE_BOOTSERVICE_ACCESS     0x00000002
-#define EFI_VARIABLE_RUNTIME_ACCESS         0x00000004
-
-/* Variable size limitation */
-#define EFI_MAXIMUM_VARIABLE_SIZE           1024
-
-typedef efi_status_t (*efi_get_variable_t)
-	(
-		efi_char16_t*	VariableName,
-		efi_guid_t	*VendorGuid,
-		uint32_t*	Attributes,
-		uint64_t*	DataSize,
-		void*		Data
-	);
-
-typedef
-efi_status_t (*efi_get_next_variable_name_t)
-	(
-		uint64_t*	VariableNameSize,
-		efi_char16_t*	VariableName,
-		efi_guid_t*	VendorGuid
-	);
-
-typedef efi_status_t (*efi_set_variable_t)
-	(
-		efi_char16_t*	VariableName,
-		efi_guid_t*	VendorGuid,
-		uint32_t	Attributes,
-		uint64_t	DataSize,
-		void*		Data
-	);
-
-/*
- * Misc
- */
-
-typedef enum
-{
-	EfiResetCold,
-	EfiResetWarm,
-	EfiResetShutdown
-} efi_reset_type_t;
-
-
-typedef efi_status_t (*efi_reset_system_t)
-	(
-		efi_reset_type_t	ResetType,
-		efi_status_t		ResetStatus,
-		uint64_t		DataSize,
-		efi_char16_t*		ResetData
-	);
-
-typedef efi_status_t (*efi_get_next_high_mono_count_t) (uint32_t* HighCount);
-
-
-/*
- * EFI Runtime Serivces Table
- */
-
-#define EFI_RUNTIME_SERVICES_SIGNATURE  0x5652453544e5552ULL
-#define EFI_RUNTIME_SERVICES_REVISION ((EFI_SPECIFICATION_MAJOR_REVISION<<16) \
-					| (EFI_SPECIFICATION_MINOR_REVISION))
-
-typedef struct
-{
-	efi_table_header_t		Hdr;
-	/* Time services */
-	efi_get_time_t			GetTime;
-	efi_set_time_t			SetTime;
-	efi_get_wakeup_time_t		GetWakeupTime;
-	efi_set_wakeup_time_t		SetWakeupTime;
-	/* Virtual memory services */
-	efi_set_virtual_address_map_t	SetVirtualAddressMap;
-	efi_convert_pointer_t		ConvertPointer;
-	/* Variable serviers */
-	efi_get_variable_t		GetVariable;
-	efi_get_next_variable_name_t	GetNextVariableName;
-	efi_set_variable_t		SetVariable;
-	/* Misc */
-	efi_get_next_high_mono_count_t	GetNextHighMonotonicCount;
-	efi_reset_system_t		ResetSystem;
-
-} efi_runtime_services_t;
-
-
-#define EFI_SPECIFICATION_MAJOR_REVISION 1
-#define EFI_SYSTEM_TABLE_SIGNATURE      0x5453595320494249
-#define EFI_SYSTEM_TABLE_REVISION  ((EFI_SPECIFICATION_MAJOR_REVISION<<16) \
-					| (EFI_SPECIFICATION_MINOR_REVISION))
-
-struct efi_system_table
-{
-	efi_table_header_t	Hdr;
-
-	uint64_t	FirmwareVendor;		// phys addr of CHAR16
-	uint32_t	FirmwareRevision;	// Firmware vendor specific
-
-	efi_handle_t	ConsoleInHandle;
-	uint64_t	ConIn;
-
-	efi_handle_t	ConsoleOutHandle;
-	uint64_t	ConOut;
-
-	efi_handle_t	StandardErrorHandle;
-	uint64_t	StdErr;
-
-	uint64_t	RuntimeServices;	// phys addr
-	uint64_t	BootServices;		// phys addr
-
-	uint64_t	NumberOfTableEntries;	// Number of entries in Config
-	uint64_t	ConfigurationTable;	// phys addr of ConfigTable
-};
-
-typedef struct efi_system_table efi_system_table_t;
-
-
-#define EFI_PAGE_SIZE   4096
-#define EFI_PAGE_MASK   0xFFF
-#define EFI_PAGE_SHIFT  12
-
-#define EFI_SIZE_TO_PAGES(a)  \
-    ( ((a) >> EFI_PAGE_SHIFT) + ((a) & EFI_PAGE_MASK ? 1 : 0) )
-
-
-void init_efi(void);
-int efi_get_time(efi_time_t* tmP);
-efi_status_t ia64_call_efi_physical(void *, ...);
-
-
-#endif /* _EFI_H_ */
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/include/ia64/hypercall-ia64.h
--- a/extras/mini-os/include/ia64/hypercall-ia64.h	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,135 +0,0 @@
-/******************************************************************************
- * hypercall.h
- * 
- * Mini-OS-specific hypervisor handling for ia64.
- * 
- * Copyright (c) 2002-2004, K A Fraser
- * Changes: Dietmar Hahn <dietmar.hahn@fujiti-siemens.com>
- * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License version 2
- * as published by the Free Software Foundation; or, when distributed
- * separately from the Linux kernel or incorporated into other
- * software packages, subject to the following license:
- * 
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this source file (the "Software"), to deal in the Software without
- * restriction, including without limitation the rights to use, copy, modify,
- * merge, publish, distribute, sublicense, and/or sell copies of the Software,
- * and to permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- * 
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-#ifndef __HYPERCALL_H__
-#define __HYPERCALL_H__
-
-#include <xen/event_channel.h>
-#include <xen/sched.h>
-#include <xen/version.h>
-
-#ifndef _HYPERVISOR_H_
-# error "please don't include this file directly"
-#endif
-
-// See linux/compiler.h
-#define likely(x)       __builtin_expect(!!(x), 1)
-#define unlikely(x)     __builtin_expect(!!(x), 0)
-
-extern unsigned long __hypercall(unsigned long a1, unsigned long a2,
-                                 unsigned long a3, unsigned long a4,
-                                 unsigned long a5, unsigned long cmd);
-/*
- * Assembler stubs for hyper-calls.
- */
-
-#define _hypercall0(type, name)					\
-({								\
-	long __res;						\
-	__res = __hypercall(0, 0, 0, 0, 0,			\
-			    __HYPERVISOR_##name);		\
-	(type)__res;						\
-})
-
-#define _hypercall1(type, name, a1)				\
-({								\
-	long __res;						\
-	__res = __hypercall((unsigned long)a1,			\
-			    0, 0, 0, 0, __HYPERVISOR_##name);	\
-	(type)__res;						\
-})
-
-#define _hypercall2(type, name, a1, a2)				\
-({								\
-	long __res;						\
-	__res = __hypercall((unsigned long)a1,			\
-			    (unsigned long)a2,			\
-			    0, 0, 0, __HYPERVISOR_##name);	\
-	(type)__res;						\
-})
-
-#define _hypercall3(type, name, a1, a2, a3)			\
-({								\
-	long __res;						\
-	__res = __hypercall((unsigned long)a1,			\
-			    (unsigned long)a2,			\
-			    (unsigned long)a3,			\
-			    0, 0, __HYPERVISOR_##name);		\
-	(type)__res;						\
-})
-
-#define _hypercall4(type, name, a1, a2, a3, a4)			\
-({								\
-	long __res;						\
-	__res = __hypercall((unsigned long)a1,			\
-			    (unsigned long)a2,			\
-			    (unsigned long)a3,			\
-			    (unsigned long)a4,			\
-			    0, __HYPERVISOR_##name);		\
-	(type)__res;						\
-})
-
-#define _hypercall5(type, name, a1, a2, a3, a4, a5)		\
-({								\
-	long __res;						\
-	__res = __hypercall((unsigned long)a1,			\
-			    (unsigned long)a2,			\
-			    (unsigned long)a3,			\
-			    (unsigned long)a4,			\
-			    (unsigned long)a5,			\
-			    __HYPERVISOR_##name);		\
-	(type)__res;						\
-})
-
-
-int HYPERVISOR_event_channel_op(int cmd, void *arg);
-
-int HYPERVISOR_xen_version(int cmd, void *arg);
-
-int HYPERVISOR_console_io(int cmd, int count, char *str);
-
-int HYPERVISOR_sched_op_compat(int cmd, unsigned long arg);
-
-int HYPERVISOR_sched_op(int cmd, void *arg);
-
-int HYPERVISOR_callback_op(int cmd, void *arg);
-
-int HYPERVISOR_grant_table_op(unsigned int cmd, void *uop, unsigned int count);
-
-int HYPERVISOR_opt_feature(void *arg);
-
-int HYPERVISOR_suspend(unsigned long srec);
-
-int HYPERVISOR_shutdown(unsigned int reason);
-
-#endif /* __HYPERCALL_H__ */
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/include/ia64/ia64_cpu.h
--- a/extras/mini-os/include/ia64/ia64_cpu.h	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,738 +0,0 @@
-/*
- * Done by Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
- * This code is mostly taken from FreeBSD.
- *
- *
- ****************************************************************************
- * Copyright (c) 2000 Doug Rabson
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- */
-
-#ifndef _IA64_CPU_H_
-#define _IA64_CPU_H_
-
-#include "ia64_fpu.h"
-
-/*
- * Definition of Region Register bits (RR)
- *
- * RR bit field positions
- */
-#define IA64_RR_VE		0
-#define IA64_RR_MBZ0		1
-#define IA64_RR_PS		2
-#define IA64_RR_PS_LEN		6
-#define IA64_RR_RID		8
-#define IA64_RR_RID_LEN		24
-#define IA64_RR_MBZ1		32
-
-#define IA64_RR_IDX_POS		61
-
-#define IA64_RR_VAL(size,rid) (((size) << IA64_RR_PS) | ((rid) << IA64_RR_RID))
-
-/*
- * Define Protection Key Register (PKR)
- *
- * PKR bit field positions
- */
-#define IA64_PKR_V		0
-#define IA64_PKR_WD		1
-#define IA64_PKR_RD		2
-#define IA64_PKR_XD		3
-#define IA64_PKR_MBZ0		4
-#define IA64_PKR_KEY		8
-#define IA64_PKR_KEY_LEN	24
-#define IA64_PKR_MBZ1		32
-
-#define IA64_PKR_VALID		(1 << IA64_PKR_V)
-
-
-/*
- * ITIR bit field positions
- */
-
-#define	IA64_ITIR_MBZ0		0
-#define	IA64_ITIR_PS		2
-#define	IA64_ITIR_PS_LEN	6
-#define	IA64_ITIR_KEY		8
-#define	IA64_ITIR_KEY_LEN	24
-#define	IA64_ITIR_MBZ1		32
-#define	IA64_ITIR_MBZ1_LEN	16
-#define	IA64_ITIR_PPN		48
-#define	IA64_ITIR_PPN_LEN	15
-#define	IA64_ITIR_MBZ2		63
-
-/*
- * Definition of PSR and IPSR bits.
- */
-#define IA64_PSR_BE		0x0000000000000002
-#define IA64_PSR_UP		0x0000000000000004
-#define IA64_PSR_AC		0x0000000000000008
-#define IA64_PSR_MFL		0x0000000000000010
-#define IA64_PSR_MFH_BIT	5
-#define IA64_PSR_MFH		(1 << IA64_PSR_MFH_BIT)
-#define IA64_PSR_UMASK		(IA64_PSR_BE | IA64_PSR_UP |	\
-				IA64_PSR_AC | IA64_PSR_MFL |	\
-				IA64_PSR_MFH)
-#define IA64_PSR_IC_BIT		13
-#define IA64_PSR_IC		(1<<IA64_PSR_IC_BIT) /*0x0000000000002000*/
-#define IA64_PSR_I_BIT		14
-#define IA64_PSR_I		(1<<IA64_PSR_I_BIT) /*0x0000000000004000*/
-#define IA64_PSR_PK		0x0000000000008000
-#define IA64_PSR_DT		0x0000000000020000
-#define IA64_PSR_DFL		0x0000000000040000
-#define IA64_PSR_DFH		0x0000000000080000
-#define IA64_PSR_SP		0x0000000000100000
-#define IA64_PSR_PP		0x0000000000200000
-#define IA64_PSR_DI		0x0000000000400000
-#define IA64_PSR_SI		0x0000000000800000
-#define IA64_PSR_DB		0x0000000001000000
-#define IA64_PSR_LP		0x0000000002000000
-#define IA64_PSR_TB		0x0000000004000000
-#define IA64_PSR_RT		0x0000000008000000
-#define IA64_PSR_CPL		0x0000000300000000
-#define IA64_PSR_CPL_KERN	0x0000000000000000
-#define IA64_PSR_CPL_1		0x0000000100000000
-#define IA64_PSR_CPL_2		0x0000000200000000
-#define IA64_PSR_CPL_USER	0x0000000300000000
-#define IA64_PSR_IS		0x0000000400000000
-#define IA64_PSR_MC		0x0000000800000000
-#define IA64_PSR_IT		0x0000001000000000
-#define IA64_PSR_ID		0x0000002000000000
-#define IA64_PSR_DA		0x0000004000000000
-#define IA64_PSR_DD		0x0000008000000000
-#define IA64_PSR_SS		0x0000010000000000
-#define IA64_PSR_RI		0x0000060000000000
-#define IA64_PSR_RI_0		0x0000000000000000
-#define IA64_PSR_RI_1		0x0000020000000000
-#define IA64_PSR_RI_2		0x0000040000000000
-#define IA64_PSR_RI_SHIFT	41
-#define IA64_PSR_ED		0x0000080000000000
-#define IA64_PSR_BN		0x0000100000000000
-#define IA64_PSR_IA		0x0000200000000000
-
-
-#define STARTUP_PSR (IA64_PSR_IT | IA64_PSR_PK | \
-            	     IA64_PSR_DT | IA64_PSR_RT | \
-		     IA64_PSR_BN | IA64_PSR_CPL_KERN | IA64_PSR_AC)
-
-#define MOS_SYS_PSR (IA64_PSR_IC | IA64_PSR_I | IA64_PSR_IT | \
-            	     IA64_PSR_DT | IA64_PSR_RT | \
-		     IA64_PSR_BN | IA64_PSR_CPL_KERN | IA64_PSR_AC)
-
-#define MOS_USR_PSR (IA64_PSR_IC | IA64_PSR_I | IA64_PSR_IT | \
-            	     IA64_PSR_DT | IA64_PSR_RT | \
-		     IA64_PSR_BN | IA64_PSR_CPL_USER | IA64_PSR_AC)
-
-/*
- * Definition of ISR bits.
- */
-#define IA64_ISR_CODE	0x000000000000ffff
-#define IA64_ISR_VECTOR	0x0000000000ff0000
-#define IA64_ISR_X	0x0000000100000000
-#define IA64_ISR_W	0x0000000200000000
-#define IA64_ISR_R	0x0000000400000000
-#define IA64_ISR_NA	0x0000000800000000
-#define IA64_ISR_SP	0x0000001000000000
-#define IA64_ISR_RS	0x0000002000000000
-#define IA64_ISR_IR	0x0000004000000000
-#define IA64_ISR_NI	0x0000008000000000
-#define IA64_ISR_SO	0x0000010000000000
-#define IA64_ISR_EI	0x0000060000000000
-#define IA64_ISR_EI_0	0x0000000000000000
-#define IA64_ISR_EI_1	0x0000020000000000
-#define IA64_ISR_EI_2	0x0000040000000000
-#define IA64_ISR_ED	0x0000080000000000
-
-/*
- * DCR bit positions
- */
-#define IA64_DCR_PP		0
-#define IA64_DCR_BE		1
-#define IA64_DCR_LC		2
-#define IA64_DCR_MBZ0		4
-#define IA64_DCR_MBZ0_V		0xf
-#define IA64_DCR_DM		8
-#define IA64_DCR_DP		9
-#define IA64_DCR_DK		10
-#define IA64_DCR_DX		11
-#define IA64_DCR_DR		12
-#define IA64_DCR_DA		13
-#define IA64_DCR_DD		14
-#define IA64_DCR_DEFER_ALL	0x7f00
-#define IA64_DCR_MBZ1		2
-#define IA64_DCR_MBZ1_V		0xffffffffffffULL
-
-
-#define IA64_DCR_DEFAULT (IA64_DCR_BE)
-
-/*
- * Vector numbers for various ia64 interrupts.
- */
-#define IA64_VEC_VHPT				0
-#define IA64_VEC_ITLB				1
-#define IA64_VEC_DTLB				2
-#define IA64_VEC_ALT_ITLB			3
-#define IA64_VEC_ALT_DTLB			4
-#define IA64_VEC_NESTED_DTLB			5
-#define IA64_VEC_IKEY_MISS			6
-#define IA64_VEC_DKEY_MISS			7
-#define IA64_VEC_DIRTY_BIT			8
-#define IA64_VEC_INST_ACCESS			9
-#define IA64_VEC_DATA_ACCESS			10
-#define IA64_VEC_BREAK				11
-#define IA64_VEC_EXT_INTR			12
-#define IA64_VEC_PAGE_NOT_PRESENT		20
-#define IA64_VEC_KEY_PERMISSION			21
-#define IA64_VEC_INST_ACCESS_RIGHTS		22
-#define IA64_VEC_DATA_ACCESS_RIGHTS		23
-#define IA64_VEC_GENERAL_EXCEPTION		24
-#define IA64_VEC_DISABLED_FP			25
-#define IA64_VEC_NAT_CONSUMPTION		26
-#define IA64_VEC_SPECULATION			27
-#define IA64_VEC_DEBUG				29
-#define IA64_VEC_UNALIGNED_REFERENCE		30
-#define IA64_VEC_UNSUPP_DATA_REFERENCE		31
-#define IA64_VEC_FLOATING_POINT_FAULT		32
-#define IA64_VEC_FLOATING_POINT_TRAP		33
-#define IA64_VEC_LOWER_PRIVILEGE_TRANSFER 	34
-#define IA64_VEC_TAKEN_BRANCH_TRAP		35
-#define IA64_VEC_SINGLE_STEP_TRAP		36
-#define IA64_VEC_IA32_EXCEPTION			45
-#define IA64_VEC_IA32_INTERCEPT			46
-#define IA64_VEC_IA32_INTERRUPT			47
-
-/*
- * Define hardware RSE Configuration Register
- *
- * RS Configuration (RSC) bit field positions
- */
-
-#define IA64_RSC_MODE       0
-#define IA64_RSC_PL         2
-#define IA64_RSC_BE         4
-#define IA64_RSC_MBZ0       5
-#define IA64_RSC_MBZ0_V     0x3ff
-#define IA64_RSC_LOADRS     16
-#define IA64_RSC_LOADRS_LEN 14
-#define IA64_RSC_MBZ1       30
-#define IA64_RSC_MBZ1_V     0x3ffffffffULL
-
-/*
- * RSC modes
- */
-#define IA64_RSC_MODE_LY (0x0) 		/* Lazy */
-#define IA64_RSC_MODE_SI (0x1) 		/* Store intensive */
-#define IA64_RSC_MODE_LI (0x2) 		/* Load intensive */
-#define IA64_RSC_MODE_EA (0x3) 		/* Eager */
-
-#define IA64_RSE_EAGER (IA64_RSC_MODE_EA<<IA64_RSC_MODE)
-#define IA64_RSE_LAZY (IA64_RSC_MODE_LY<<IA64_RSC_MODE)
-
-
-
-#ifndef __ASSEMBLY__
-
-/* ia64 function descriptor and global pointer */
-struct ia64_fdesc
-{
-	uint64_t	func;
-	uint64_t	gp;
-};
-typedef struct ia64_fdesc ia64_fdesc_t;
-
-#define FDESC_FUNC(fn)  (((struct ia64_fdesc *) fn)->func)
-#define FDESC_GP(fn)    (((struct ia64_fdesc *) fn)->gp)
-
-
-/*
- * Various special ia64 instructions.
- */
-
-/*
- * Memory Fence.
- */
-static __inline void
-ia64_mf(void)
-{
-	__asm __volatile("mf" ::: "memory");
-}
-
-static __inline void
-ia64_mf_a(void)
-{
-	__asm __volatile("mf.a");
-}
-
-/*
- * Flush Cache.
- */
-static __inline void
-ia64_fc(uint64_t va)
-{
-	__asm __volatile("fc %0" :: "r"(va));
-}
-
-/*
- * Sync instruction stream.
- */
-static __inline void
-ia64_sync_i(void)
-{
-	__asm __volatile("sync.i");
-}
-
-/*
- * Calculate address in VHPT for va.
- */
-static __inline uint64_t
-ia64_thash(uint64_t va)
-{
-	uint64_t result;
-	__asm __volatile("thash %0=%1" : "=r" (result) : "r" (va));
-	return result;
-}
-
-/*
- * Calculate VHPT tag for va.
- */
-static __inline uint64_t
-ia64_ttag(uint64_t va)
-{
-	uint64_t result;
-	__asm __volatile("ttag %0=%1" : "=r" (result) : "r" (va));
-	return result;
-}
-
-/*
- * Convert virtual address to physical.
- */
-static __inline uint64_t
-ia64_tpa(uint64_t va)
-{
-	uint64_t result;
-	__asm __volatile("tpa %0=%1" : "=r" (result) : "r" (va));
-	return result;
-}
-
-/*
- * Generate a ptc.e instruction.
- */
-static __inline void
-ia64_ptc_e(uint64_t v)
-{
-	__asm __volatile("ptc.e %0;; srlz.d;;" :: "r"(v));
-}
-
-/*
- * Generate a ptc.g instruction.
- */
-static __inline void
-ia64_ptc_g(uint64_t va, uint64_t size)
-{
-	__asm __volatile("ptc.g %0,%1;; srlz.d;;" :: "r"(va), "r"(size<<2));
-}
-
-/*
- * Generate a ptc.ga instruction.
- */
-static __inline void
-ia64_ptc_ga(uint64_t va, uint64_t size)
-{
-	__asm __volatile("ptc.ga %0,%1;; srlz.d;;" :: "r"(va), "r"(size<<2));
-}
-
-/*
- * Generate a ptc.l instruction.
- */
-static __inline void
-ia64_ptc_l(uint64_t va, uint64_t size)
-{
-	__asm __volatile("ptc.l %0,%1;; srlz.d;;" :: "r"(va), "r"(size<<2));
-}
-
-/*
- * Read the value of psr.
- */
-static __inline uint64_t
-ia64_get_psr(void)
-{
-	uint64_t result;
-	__asm __volatile("mov %0=psr;;" : "=r" (result));
-	return result;
-}
-
-static __inline void
-ia64_set_psr(uint64_t v)
-{
-	__asm __volatile("mov psr.l=%0" :: "r" (v));
-}
-
-static __inline void
-ia64_srlz_d(void)
-{
-	__asm __volatile("srlz.d;;");
-}
-
-static __inline void
-disable_intr(void)
-{
-	__asm __volatile ("rsm psr.ic|psr.i");
-}
-
-static __inline void
-enable_intr(void)
-{
-	__asm __volatile ("ssm psr.ic|psr.i");
-}
-
-/*
- * Define accessors for application registers.
- */
-
-#define IA64_AR(name)							\
-									\
-static __inline uint64_t						\
-ia64_get_##name(void)							\
-{									\
-	uint64_t result;						\
-	__asm __volatile(";;mov %0=ar." #name ";;" : "=r" (result));	\
-	return result;							\
-}									\
-									\
-static __inline void							\
-ia64_set_##name(uint64_t v)						\
-{									\
-	__asm __volatile("mov ar." #name "=%0" :: "r" (v));		\
-}
-
-IA64_AR(k0)
-IA64_AR(k1)
-IA64_AR(k2)
-IA64_AR(k3)
-IA64_AR(k4)
-IA64_AR(k5)
-IA64_AR(k6)
-IA64_AR(k7)
-
-IA64_AR(rsc)
-IA64_AR(bsp)
-IA64_AR(bspstore)
-IA64_AR(rnat)
-
-IA64_AR(fcr)
-
-IA64_AR(eflag)
-IA64_AR(csd)
-IA64_AR(ssd)
-IA64_AR(cflg)
-IA64_AR(fsr)
-IA64_AR(fir)
-IA64_AR(fdr)
-
-IA64_AR(ccv)
-
-IA64_AR(unat)
-
-IA64_AR(fpsr)
-
-IA64_AR(itc)
-
-IA64_AR(pfs)
-IA64_AR(lc)
-IA64_AR(ec)
-
-/*
- * Define accessors for control registers.
- */
-
-#define IA64_CR(name)						\
-								\
-static __inline uint64_t					\
-ia64_get_##name(void)						\
-{								\
-	uint64_t result;					\
-	__asm __volatile("mov %0=cr." #name : "=r" (result));	\
-	return result;						\
-}								\
-								\
-static __inline void						\
-ia64_set_##name(uint64_t v)					\
-{								\
-	__asm __volatile("mov cr." #name "=%0" :: "r" (v));	\
-}
-
-IA64_CR(dcr)
-IA64_CR(itm)
-IA64_CR(iva)
-
-IA64_CR(pta)
-
-IA64_CR(ipsr)
-IA64_CR(isr)
-
-IA64_CR(iip)
-IA64_CR(ifa)
-IA64_CR(itir)
-IA64_CR(iipa)
-IA64_CR(ifs)
-IA64_CR(iim)
-IA64_CR(iha)
-
-IA64_CR(lid)
-IA64_CR(ivr)
-IA64_CR(tpr)
-IA64_CR(eoi)
-IA64_CR(irr0)
-IA64_CR(irr1)
-IA64_CR(irr2)
-IA64_CR(irr3)
-IA64_CR(itv)
-IA64_CR(pmv)
-IA64_CR(cmcv)
-
-IA64_CR(lrr0)
-IA64_CR(lrr1)
-
-#define IA64_GR(name)						\
-								\
-static __inline uint64_t					\
-ia64_get_##name(void)						\
-{								\
-	uint64_t result;					\
-	__asm __volatile("mov %0=" #name : "=r" (result));	\
-	return result;						\
-}								\
-								\
-static __inline void						\
-ia64_set_##name(uint64_t v)					\
-{								\
-	__asm __volatile("mov " #name "=%0" :: "r" (v));	\
-}
-
-IA64_GR(sp)
-IA64_GR(b0)
-IA64_GR(r13)	// tp
-
-
-/*
- * Write a region register.
- */
-static __inline void
-ia64_set_rr(uint64_t rrbase, uint64_t v)
-{
-	__asm __volatile("mov rr[%0]=%1;; srlz.d;;"
-			 :: "r"(rrbase), "r"(v) : "memory");
-}
-
-/*
- * Read a region register.
- */
-static __inline uint64_t
-ia64_get_rr(uint64_t rrbase)
-{
-	uint64_t v;
-	__asm __volatile("mov %1=rr[%0];;"
-			 : "=r" (v) : "r"(rrbase) : "memory");
-	return v;
-}
-
-
-/*
- * Read a CPUID register.
- */
-static __inline uint64_t
-ia64_get_cpuid(int i)
-{
-	uint64_t result;
-	__asm __volatile("mov %0=cpuid[%1]"
-			 : "=r" (result) : "r"(i));
-	return result;
-}
-
-
-struct trap_frame
-{
-	uint64_t	rsc;
-	uint64_t	ndirty;		/* number of dirty regs */
-	uint64_t	ssd;
-	uint64_t	iip;		/* interrupted ip */
-	uint64_t	ipsr;		/* interrupted psr */
-	uint64_t	ifs;		/* interruption func status register */
-
-	uint16_t	trap_num;	/* Trap num, index in trap_vec */
-	uint64_t	cfm;		/* current frame marker */
-	uint64_t	pfs;		/* previous function state ar64 */
-	uint64_t	bsp;		/* backing store pointer ar17 */
-	uint64_t	rnat;		/* rse nat collection ar19 */
-	uint64_t	csd;		/* comp and store data reg ar25 */
-	uint64_t	ccv;		/* comp and xchange val reg ar32 */
-	uint64_t	unat;		/* */
-	uint64_t	fpsr;		/* floating point state reg ar40 */
-	uint64_t	pr;		/* predicate regs 0-63 */
-
-	uint64_t	gp;		/* the gp pointer */
-	uint64_t	sp;		/* stack pointer */
-	uint64_t	tp;		/* thread pointer */
-
-	uint64_t	r2;		/* global reg 2 */
-	uint64_t	r3;
-	uint64_t	r8;
-	uint64_t	r9;
-	uint64_t	r10;
-	uint64_t	r11;
-	uint64_t	r14;
-	uint64_t	r15;
-	uint64_t	r16;
-	uint64_t	r17;
-	uint64_t	r18;
-	uint64_t	r19;
-	uint64_t	r20;
-	uint64_t	r21;
-	uint64_t	r22;
-	uint64_t	r23;
-	uint64_t	r24;
-	uint64_t	r25;
-	uint64_t	r26;
-	uint64_t	r27;
-	uint64_t	r28;
-	uint64_t	r29;
-	uint64_t	r30;
-	uint64_t	r31;
-
-	uint64_t	b0;
-	uint64_t	b6;
-	uint64_t	b7;
-
-	ia64_fpreg_t	f6;           /* floating point register 6 */
-	ia64_fpreg_t	f7;
-	ia64_fpreg_t	f8;
-	ia64_fpreg_t	f9;
-	ia64_fpreg_t	f10;
-	ia64_fpreg_t	f11;
-
-	uint64_t	ifa;		/* interruption faulting address */
-	uint64_t	isr;		/* interruption status register */
-	uint64_t	iim;		/* interruption immediate register */
-};
-
-typedef struct trap_frame trap_frame_t;
-
-
-#endif  /* __ASSEMBLY__ */
-
-/* Page access parameters. */
-#define PTE_P_SHIFT	0
-#define PTE_P		1
-
-#define PTE_MA_SHIFT	2
-#define PTE_MA_WB	0
-
-#define PTE_A_SHIFT	5
-#define PTE_A		1
-#define PTE_D_SHIFT	6
-#define PTE_D		1
-
-#define PTE_AR_SHIFT	9
-#define PTE_AR_R	0
-#define PTE_AR_RX	1
-#define PTE_AR_RW	2
-#define PTE_AR_RWX	3
-#define PTE_AR_R_RW	4
-#define PTE_AR_RX_RWX	5
-#define PTE_AR_RWX_RW	6
-/* privilege level */
-#define PTE_PL_SHIFT	7
-#define PTE_PL_KERN	0	/* used for kernel */
-/* page size */
-#define PTE_PS_4K	12
-#define PTE_PS_8K	13
-#define PTE_PS_16K	14
-#define PTE_PS_64K	16
-#define PTE_PS_256K	18
-#define PTE_PS_1M	20
-#define PTE_PS_4M	22
-#define PTE_PS_16M	24
-#define PTE_PS_64M	26
-#define PTE_PS_256M	28
-
-
-	/* Some offsets for ia64_pte_t. */
-#define PTE_OFF_P	0
-#define PTE_OFF_MA	3
-#define PTE_OFF_A	5
-#define PTE_OFF_D	6
-#define PTE_OFF_PL	7
-#define PTE_OFF_AR	9
-#define PTE_OFF_PPN	12
-#define PTE_OFF_ED	52
-
-#if !defined(_ASM) && !defined(__ASSEMBLY__)
-/*
- * A short-format VHPT entry. Also matches the TLB insertion format.
- */
-typedef struct
-{
-	uint64_t pte_p	:1;	/* bits 0..0 */
-	uint64_t pte_rv1:1;	/* bits 1..1 */
-	uint64_t pte_ma	:3;	/* bits 2..4 */
-	uint64_t pte_a	:1;	/* bits 5..5 */
-	uint64_t pte_d	:1;	/* bits 6..6 */
-	uint64_t pte_pl	:2;	/* bits 7..8 */
-	uint64_t pte_ar	:3;	/* bits 9..11 */
-	uint64_t pte_ppn:38;	/* bits 12..49 */
-	uint64_t pte_rv2:2;	/* bits 50..51 */
-	uint64_t pte_ed	:1;	/* bits 52..52 */
-	uint64_t pte_ig	:11;	/* bits 53..63 */
-} ia64_pte_t;
-
-
-/*
- * A long-format VHPT entry.
- */
-typedef struct
-{
-	uint64_t pte_p		:1;	/* bits 0..0 */
-	uint64_t pte_rv1	:1;	/* bits 1..1 */
-	uint64_t pte_ma		:3;	/* bits 2..4 */
-	uint64_t pte_a		:1;	/* bits 5..5 */
-	uint64_t pte_d		:1;	/* bits 6..6 */
-	uint64_t pte_pl		:2;	/* bits 7..8 */
-	uint64_t pte_ar		:3;	/* bits 9..11 */
-	uint64_t pte_ppn	:38;	/* bits 12..49 */
-	uint64_t pte_rv2	:2;	/* bits 50..51 */
-	uint64_t pte_ed		:1;	/* bits 52..52 */
-	uint64_t pte_ig		:11;	/* bits 53..63 */
-	uint64_t pte_rv3	:2;	/* bits 0..1 */
-	uint64_t pte_ps		:6;	/* bits 2..7 */
-	uint64_t pte_key	:24;	/* bits 8..31 */
-	uint64_t pte_rv4	:32;	/* bits 32..63 */
-	uint64_t pte_tag;		/* includes ti */
-	uint64_t pte_chain;		/* pa of collision chain */
-} ia64_lpte_t;
-
-#endif /* __ASSEMBLY__ */
-
-#endif /* _IA64_CPU_H_ */
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/include/ia64/ia64_fpu.h
--- a/extras/mini-os/include/ia64/ia64_fpu.h	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +0,0 @@
-/*
- * Done by Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
- * This code is mostly taken from FreeBSD.
- *
- ****************************************************************************
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- */
-
-#ifndef _IA64_FPU_H_
-#define _IA64_FPU_H_
-
-#include "os.h"
-
-/*
- * Floating point status register bits.
- */
-#define IA64_FPSR_TRAP_VD	UL_CONST(0x0000000000000001)
-#define IA64_FPSR_TRAP_DD	UL_CONST(0x0000000000000002)
-#define IA64_FPSR_TRAP_ZD	UL_CONST(0x0000000000000004)
-#define IA64_FPSR_TRAP_OD	UL_CONST(0x0000000000000008)
-#define IA64_FPSR_TRAP_UD	UL_CONST(0x0000000000000010)
-#define IA64_FPSR_TRAP_ID	UL_CONST(0x0000000000000020)
-#define IA64_FPSR_SF(i,v)	((v) << ((i)*13+6))
-
-#define IA64_SF_FTZ		UL_CONST(0x0001)
-#define IA64_SF_WRE		UL_CONST(0x0002)
-#define IA64_SF_PC		UL_CONST(0x000c)
-#define IA64_SF_PC_0		UL_CONST(0x0000)
-#define IA64_SF_PC_1		UL_CONST(0x0004)
-#define IA64_SF_PC_2		UL_CONST(0x0008)
-#define IA64_SF_PC_3		UL_CONST(0x000c)
-#define IA64_SF_RC		UL_CONST(0x0030)
-#define IA64_SF_RC_NEAREST	UL_CONST(0x0000)
-#define IA64_SF_RC_NEGINF	UL_CONST(0x0010)
-#define IA64_SF_RC_POSINF	UL_CONST(0x0020)
-#define IA64_SF_RC_TRUNC	UL_CONST(0x0030)
-#define IA64_SF_TD		UL_CONST(0x0040)
-#define IA64_SF_V		UL_CONST(0x0080)
-#define IA64_SF_D		UL_CONST(0x0100)
-#define IA64_SF_Z		UL_CONST(0x0200)
-#define IA64_SF_O		UL_CONST(0x0400)
-#define IA64_SF_U		UL_CONST(0x0800)
-#define IA64_SF_I		UL_CONST(0x1000)
-
-#define IA64_SF_DEFAULT	(IA64_SF_PC_3 | IA64_SF_RC_NEAREST)
-
-#define IA64_FPSR_DEFAULT	(IA64_FPSR_TRAP_VD			\
-				 | IA64_FPSR_TRAP_DD			\
-				 | IA64_FPSR_TRAP_ZD			\
-				 | IA64_FPSR_TRAP_OD			\
-				 | IA64_FPSR_TRAP_UD			\
-				 | IA64_FPSR_TRAP_ID			\
-				 | IA64_FPSR_SF(0, IA64_SF_DEFAULT)	\
-				 | IA64_FPSR_SF(1, (IA64_SF_DEFAULT	\
-						    | IA64_SF_TD	\
-						    | IA64_SF_WRE))	\
-				 | IA64_FPSR_SF(2, (IA64_SF_DEFAULT	\
-						    | IA64_SF_TD))	\
-				 | IA64_FPSR_SF(3, (IA64_SF_DEFAULT	\
-						    | IA64_SF_TD)))
-
-
-#ifndef __ASSEMBLY__
-
-	/* This is from sys/cdefs.h in FreeBSD */
-#define __aligned(x)    __attribute__((__aligned__(x)))
-
-	/* A single Floating Point register. */
-struct ia64_fpreg
-{
-	uint8_t	fpr_bits[16];
-} __aligned(16);
-
-typedef struct ia64_fpreg ia64_fpreg_t;
-
-#endif /* __ASSEMBLY__ */
-
-#endif /* _IA64_FPU_H_ */
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/include/ia64/os.h
--- a/extras/mini-os/include/ia64/os.h	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,295 +0,0 @@
-/*
- * Copyright (C) 2007 - Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
- *
- ****************************************************************************
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- * 
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
- * DEALINGS IN THE SOFTWARE.
- */
-
-
-#if !defined(__OS_H__)
-#define __OS_H__
-
-#if !defined(__ASSEMBLY__)
-
-#include <mini-os/types.h>
-#include "ia64_cpu.h"
-#include "atomic.h"
-#include "efi.h"
-#include "sal.h"
-#include "pal.h"
-#include <mini-os/hypervisor.h>
-#include <mini-os/kernel.h>
-
-
-typedef uint64_t paddr_t;		/* Physical address. */
-#ifndef HAVE_LIBC
-typedef uint64_t caddr_t;		/* rr7/kernel memory address. */
-#endif
-
-#include "page.h"
-#include "mm.h"
-
-
-void arch_init(start_info_t *si);	/* in common.c */
-void arch_print_info(void);		/* in common.c */
-void arch_fini(void);
-
-
-/* Size of xen_ia64_boot_param.command_line */
-#define COMMAND_LINE_SIZE       512
-
-extern struct xen_ia64_boot_param* ia64_boot_paramP;
-extern struct xen_ia64_boot_param ia64BootParamG;
-extern char boot_cmd_line[];
-extern efi_system_table_t* efiSysTableP;
-extern int bootverbose;
-
-extern void ia64_probe_sapics(void);
-
-
-
-/* Contains the needed stuff from efi. */
-struct efi
-{
-
-	efi_system_table_t*		efiSysTableP;
-	efi_set_virtual_address_map_t	setVirtAddrMapF;
-	efi_get_time_t			getTimeF;
-	efi_reset_system_t		resetSystemF;
-
-};
-
-struct machine_fw
-{
-	struct efi efi;
-
-	uint64_t ia64_port_base;	/* physical address */
-	uint64_t ia64_pal_base;		/* virtual rr7 address */
-
-	sal_system_table_t* ia64_sal_tableP;
-	sal_entry_t* ia64_sal_entryP;	/* SAL_PROC entrypoint */
-
-	uint64_t ia64_efi_acpi_table;	/* physical address */
-	uint64_t ia64_efi_acpi20_table;	/* physical address */
-
-	uint64_t mach_mem_start;	/* phys start addr of machine memory */
-	uint64_t mach_mem_size;		/* size of machine memory */
-
-	uint64_t kernstart;		/* virt address of kern text start */
-	uint64_t kernend;
-	uint64_t kernpstart;		/* phys address of kern text start */
-	uint64_t kernpend;
-};
-
-extern struct machine_fw machineFwG;
-
-#define ia64_sal_entry machineFwG.ia64_sal_entryP
-
-#define smp_processor_id() 0
-
-static inline uint64_t
-xchg8(uint64_t* ptr, uint64_t x)                                               \
-{
-        uint64_t oldVal;
-        asm volatile ("xchg8 %0=[%1],%2" : "=r" (oldVal)
-                      : "r" (ptr), "r" (x) : "memory");
-        return oldVal;
-}
-#define xchg xchg8
-
-// Counts the number of 1-bits in x.
-#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-# define get_popcnt(x)         __builtin_popcountl(x)
-#else
-# define get_popcnt(x)					\
-  ({							\
-	uint64_t num;					\
-	asm ("popcnt %0=%1" : "=r" (num) : "r" (x));	\
-	num;						\
-  })
-#endif
-
-/**
- * __ffs - find first bit in word.
- * @x: The word to search
- *
- * Undefined if no bit exists, so code should check against 0 first.
- */
-static inline unsigned long
-__ffs (unsigned long x)
-{
-	unsigned long result;
-
-	result = get_popcnt((x-1) & ~x);
-	return result;
-}
-
-
-static inline void
-synch_clear_bit(int num, volatile void *addr)
-{
-	clear_bit(num, addr);
-}
-
-static inline void
-synch_set_bit(int num, volatile void *addr)
-{
-	set_bit(num, addr);
-}
-
-static inline int
-synch_test_bit(int nr, const volatile void *addr)
-{
-	return test_bit(nr, addr);
-}
-
-static inline int
-synch_test_and_set_bit(int num, volatile void * addr)
-{
-	return test_and_set_bit(num, addr);
-}
-
-
-#define synch_cmpxchg(ptr, old, new) \
-((__typeof__(*(ptr)))__synch_cmpxchg((ptr),\
-                                     (unsigned long)(old), \
-                                     (unsigned long)(new), \
-                                     sizeof(*(ptr))))
-
-static inline unsigned long
-__synch_cmpxchg(volatile void *ptr, uint64_t old, uint64_t new, int size)
-{
-	switch (size)
-	{
-		case 1:
-			return ia64_cmpxchg_acq_8(ptr, old, new);
-		case 2:
-			return ia64_cmpxchg_acq_16(ptr, old, new);
-		case 4:
-			return ia64_cmpxchg_acq_32(ptr, old, new);
-		case 8:
-			return ia64_cmpxchg_acq_64(ptr, old, new);
-	}
-	return ia64_cmpxchg_acq_64(ptr, old, new);
-}
-
-extern shared_info_t *HYPERVISOR_shared_info;
-
-
-/*
- * This code is from the originally os.h and should be put in a
- * common header file!
- */
-
-/* 
- * The use of 'barrier' in the following reflects their use as local-lock
- * operations. Reentrancy must be prevented (e.g., __cli()) /before/ following
- * critical operations are executed. All critical operations must complete
- * /before/ reentrancy is permitted (e.g., __sti()). Alpha architecture also
- * includes these barriers, for example.
- */
-
-#define __cli()								\
-do {									\
-	vcpu_info_t *_vcpu;						\
-	_vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()];	\
-	_vcpu->evtchn_upcall_mask = 1;					\
-	barrier();							\
-} while (0)
-
-#define __sti()								\
-do {									\
-	vcpu_info_t *_vcpu;						\
-	barrier();							\
-	_vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()];	\
-	_vcpu->evtchn_upcall_mask = 0;					\
-	barrier(); /* unmask then check (avoid races) */		\
-	if (unlikely(_vcpu->evtchn_upcall_pending))			\
-		force_evtchn_callback();				\
-} while (0)
-
-#define __save_flags(x)							\
-do {									\
-	vcpu_info_t *_vcpu;						\
-	_vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()];	\
-	(x) = _vcpu->evtchn_upcall_mask;				\
-} while (0)
-
-#define __restore_flags(x)						\
-do {									\
-	vcpu_info_t *_vcpu;						\
-	barrier();							\
-	_vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()];	\
-	if ((_vcpu->evtchn_upcall_mask = (x)) == 0) {			\
-		barrier(); /* unmask then check (avoid races) */	\
-		if ( unlikely(_vcpu->evtchn_upcall_pending) )		\
-			force_evtchn_callback();			\
-	}\
-} while (0)
-
-#define safe_halt()		((void)0)
-
-#define __save_and_cli(x)						\
-do {									\
-	vcpu_info_t *_vcpu;						\
-	_vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()];	\
-	(x) = _vcpu->evtchn_upcall_mask;				\
-	_vcpu->evtchn_upcall_mask = 1;					\
-	barrier();							\
-} while (0)
-
-#define local_irq_save(x)	__save_and_cli(x)
-#define local_irq_restore(x)	__restore_flags(x)
-#define local_save_flags(x)	__save_flags(x)
-#define local_irq_disable()	__cli()
-#define local_irq_enable()	__sti()
-
-#define irqs_disabled()			\
-	(HYPERVISOR_shared_info->vcpu_info[smp_processor_id()].evtchn_upcall_mask)
-
-/* This is a barrier for the compiler only, NOT the processor! */
-#define barrier() __asm__ __volatile__("": : :"memory")
-
-#define mb()	ia64_mf()
-#define rmb()	mb()
-#define wmb()	mb()
-
-
-#define BUG()	\
-	{ printk("mini-os BUG at %s:%d!\n", __FILE__, __LINE__); do_exit(); }
-
-#define PRINT_BV(_fmt, _params...)		\
-	if (bootverbose)			\
-		printk(_fmt , ## _params)
-
-#endif /* !defined(__ASSEMBLY__) */
-
-#if defined(__ASSEMBLY__)
-
-#define UL_CONST(x)	x
-#define UL_TYPE(x)	x
-
-#else /* defined(__ASSEMBLY__) */
-
-#define UL_CONST(x)	x##UL
-#define UL_TYPE(x)	((uint64_t)x)
-
-#endif /* defined(__ASSEMBLY__) */
-
-#endif /* !defined(__OS_H__) */
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/include/ia64/page.h
--- a/extras/mini-os/include/ia64/page.h	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-/*
- * Done by Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
- * Common stuff for memory and page handling.
- * Parts are taken from FreeBSD.
- *
- ****************************************************************************
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- * 
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
- * DEALINGS IN THE SOFTWARE.
- */
-
-
-#if !defined(_PAGE_H_)
-#define _PAGE_H_
-
-#include "os.h"
-#include "ia64_cpu.h"
-
-#define PTE_KERNEL_ATTR ((PTE_P<<PTE_P_SHIFT)		|\
-			(PTE_MA_WB<<PTE_MA_SHIFT)	|\
-			(PTE_D<<PTE_D_SHIFT)		|\
-			(PTE_A<<PTE_A_SHIFT)		|\
-			(PTE_PL_KERN<<PTE_PL_SHIFT)	|\
-			(PTE_AR_RWX<<PTE_AR_SHIFT))
-
-
-/* The kernel tr page size for text and data. */
-#define KERNEL_TR_PAGE_SIZE	PTE_PS_1M
-/* The efi-pal page size for text and data. */
-#define PAL_TR_PAGE_SIZE	PTE_PS_1M
-
-#include "arch_limits.h"
-#define PAGE_SHIFT	__PAGE_SHIFT
-#define PAGE_SIZE	__PAGE_SIZE
-#define PAGE_MASK	(~(PAGE_SIZE-1))
-
-#define KSTACK_PAGES	4	/* 4 pages for the kernel stack + bsp */
-
-#define IA64_TR_KERNEL	0       /* itr0, dtr0: maps kernel image (code) */
-#define IA64_TR_PAL	1       /* itr1: maps pal code */
-
-/*
- * Manipulating region bits of an address.
- */
-#define IA64_RR_BASE(n)		((UL_TYPE(n)) << 61)
-#define IA64_RR_MASK(x)		((UL_TYPE(x)) & ((1L << 61) - 1))
-#define IA64_RR_EXTR(x)		((x) >> 61)
-
-#define IA64_PHYS_TO_RR5(x)	((x) | IA64_RR_BASE(5))
-#define IA64_PHYS_TO_RR7(x)	((x) | IA64_RR_BASE(7))
-
-#define __pa(x)	IA64_RR_MASK(x)
-#define __va(x)	IA64_PHYS_TO_RR7(x)
-
-#define roundup_page(x)	((((unsigned long)(x)) + PAGE_SIZE -1) & PAGE_MASK)
-#define trunc_page(x)	((unsigned long)(x) & PAGE_MASK)
-
-
-#if !defined(__ASSEMBLY__)
-
-/* Contains the parts of the physically memory. */
-extern paddr_t phys_avail[];
-
-#define page_to_pfn(page)	((uint64_t)(page) >> PAGE_SHIFT)
-#define pfn_to_page(pfn)	((uint64_t)pfn << PAGE_SHIFT)
-/* Get phyiscal address of page of virtual address. */
-#define virt_to_page(addr)	((uint64_t)__pa(addr) & PAGE_MASK)
-#define virt_to_pfn(addr)	(page_to_pfn(virt_to_page(addr)))
-
-
-#endif /* __ASSEMBLY__ */
-
-
-/* For both see minios-ia64.lds. */
-/* This is where the kernel virtually starts. */
-#define KERNEL_START	IA64_PHYS_TO_RR5(0x100000000)
-/* !!!!!
- * For physical start of kernel
- * Currently used in arch/ia64/fw.S.
- * !!!!!
- */
-#define KERNEL_PHYS_START_SHIFT	20
-
-/* A region 5 address to physical address */
-#define KERN_VIRT_2_PHYS(x) (((x) - KERNEL_START) + \
-				(1 << KERNEL_PHYS_START_SHIFT))
-
-/* Some protection keys for region 5 and 7 addresses. */
-#define IA64_KEY_REG7	0x234	/* Region 7 - identity mapped addresses */
-#define IA64_KEY_REG5	0x89a	/* Region 5 - kernel addresses */
-
-// This is xen specific !
-#define PAGE_SHIFT_XEN_16K	14	// For 16KB page size
-#define mfn_to_virt(mfn)	((void*)__va((mfn) << PAGE_SHIFT_XEN_16K))
-
-#endif /* !defined(_PAGE_H_) */
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/include/ia64/pal.h
--- a/extras/mini-os/include/ia64/pal.h	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-/*
- * Done by Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
- * The code is mostly taken from FreeBSD.
- *
- ****************************************************************************
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- */
-
-#ifndef _PAL_H_
-#define _PAL_H_
-
-/*
- * Architected static calling convention procedures.
- */
-#define PAL_CACHE_FLUSH		1
-#define PAL_CACHE_INFO		2
-#define PAL_CACHE_INIT		3
-#define PAL_CACHE_SUMMARY	4
-#define PAL_MEM_ATTRIB		5
-#define PAL_PTCE_INFO		6
-#define PAL_VM_INFO		7
-#define PAL_VM_SUMMARY		8
-#define PAL_BUS_GET_FEATURES	9
-#define PAL_BUS_SET_FEATURES	10
-#define PAL_DEBUG_INFO		11
-#define PAL_FIXED_ADDR		12
-#define PAL_FREQ_BASE		13
-#define PAL_FREQ_RATIOS		14
-#define PAL_PERF_MON_INFO	15
-#define PAL_PLATFORM_ADDR	16
-#define PAL_PROC_GET_FEATURE	17
-#define PAL_PROC_SET_FEATURE	18
-#define PAL_RSE_INFO		19
-#define PAL_VERSION		20
-#define PAL_MC_CLEAR_LOG	21
-#define PAL_MC_DRAIN		22
-#define PAL_MC_DYNAMIC_STATE	24
-#define PAL_MC_ERROR_INFO	25
-#define PAL_MC_EXPECTED		23
-#define PAL_MC_REGISTER_MEM	27
-#define PAL_MC_RESUME		26
-#define PAL_HALT		28
-#define PAL_HALT_LIGHT		29
-#define PAL_COPY_INFO		30
-#define PAL_CACHE_LINE_INIT	31
-#define PAL_PMI_ENTRYPOINT	32
-#define PAL_ENTER_IA_32_ENV	33
-#define PAL_VM_PAGE_SIZE	34
-#define PAL_MEM_FOR_TEST	37
-#define PAL_CACHE_PROT_INFO	38
-#define PAL_REGISTER_INFO	39
-#define PAL_SHUTDOWN		40
-#define PAL_PREFETCH_VISIBILITY	41
-
-
-struct ia64_pal_result
-{
-	int64_t		pal_status;
-	uint64_t	pal_result[3];
-};
-
-extern struct ia64_pal_result
-	ia64_call_pal_static(uint64_t proc, uint64_t arg1,
-			     uint64_t arg2, uint64_t arg3);
-
-#endif /* _PAL_H_ */
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/include/ia64/privop.h
--- a/extras/mini-os/include/ia64/privop.h	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,97 +0,0 @@
-
-/*
- * Copyright (C) 2005 Hewlett-Packard Co
- *	Dan Magenheimer <dan.magenheimer@hp.com>
- *
- * Paravirtualizations of privileged operations for Xen/ia64
- *
- */
-
-#ifndef _PRIVOP_H_
-#define _PRIVOP_H_
-
-#include <xen/arch-ia64.h>
-
-#define IA64_PARAVIRTUALIZED
-
-/* At 1 MB, before per-cpu space but still addressable using addl instead
-   of movl. */
-#define XSI_BASE		0xfffffffffff00000
-
-/* Address of mapped regs.  */
-#define XMAPPEDREGS_BASE	(XSI_BASE + XSI_SIZE)
-
-#ifdef __ASSEMBLY__
-#define	XEN_HYPER_RFI		break HYPERPRIVOP_RFI
-#define	XEN_HYPER_RSM_PSR_DT	break HYPERPRIVOP_RSM_DT
-#define	XEN_HYPER_SSM_PSR_DT	break HYPERPRIVOP_SSM_DT
-#define	XEN_HYPER_COVER		break HYPERPRIVOP_COVER
-#define	XEN_HYPER_ITC_D		break HYPERPRIVOP_ITC_D
-#define	XEN_HYPER_ITC_I		break HYPERPRIVOP_ITC_I
-#define	XEN_HYPER_SSM_I		break HYPERPRIVOP_SSM_I
-#define	XEN_HYPER_GET_IVR	break HYPERPRIVOP_GET_IVR
-#define	XEN_HYPER_GET_TPR	break HYPERPRIVOP_GET_TPR
-#define	XEN_HYPER_SET_TPR	break HYPERPRIVOP_SET_TPR
-#define	XEN_HYPER_EOI		break HYPERPRIVOP_EOI
-#define	XEN_HYPER_SET_ITM	break HYPERPRIVOP_SET_ITM
-#define	XEN_HYPER_THASH		break HYPERPRIVOP_THASH
-#define	XEN_HYPER_PTC_GA	break HYPERPRIVOP_PTC_GA
-#define	XEN_HYPER_ITR_D		break HYPERPRIVOP_ITR_D
-#define	XEN_HYPER_GET_RR	break HYPERPRIVOP_GET_RR
-#define	XEN_HYPER_SET_RR	break HYPERPRIVOP_SET_RR
-#define	XEN_HYPER_SET_KR	break HYPERPRIVOP_SET_KR
-#define	XEN_HYPER_FC		break HYPERPRIVOP_FC
-#define	XEN_HYPER_GET_CPUID	break HYPERPRIVOP_GET_CPUID
-#define	XEN_HYPER_GET_PMD	break HYPERPRIVOP_GET_PMD
-#define	XEN_HYPER_GET_EFLAG	break HYPERPRIVOP_GET_EFLAG
-#define	XEN_HYPER_SET_EFLAG	break HYPERPRIVOP_SET_EFLAG
-#define	XEN_HYPER_RSM_BE	break HYPERPRIVOP_RSM_BE
-#define	XEN_HYPER_GET_PSR	break HYPERPRIVOP_GET_PSR
-
-#define XSI_IFS			(XSI_BASE + XSI_IFS_OFS)
-#define XSI_PRECOVER_IFS	(XSI_BASE + XSI_PRECOVER_IFS_OFS)
-#define XSI_INCOMPL_REGFR	(XSI_BASE + XSI_INCOMPL_REGFR_OFS)
-#define XSI_IFA			(XSI_BASE + XSI_IFA_OFS)
-#define XSI_ISR			(XSI_BASE + XSI_ISR_OFS)
-#define XSI_IIM			(XSI_BASE + XSI_IIM_OFS)
-#define XSI_ITIR		(XSI_BASE + XSI_ITIR_OFS)
-#define XSI_PSR_I_ADDR		(XSI_BASE + XSI_PSR_I_ADDR_OFS)
-#define XSI_PSR_IC		(XSI_BASE + XSI_PSR_IC_OFS)
-#define XSI_IPSR		(XSI_BASE + XSI_IPSR_OFS)
-#define XSI_IIP			(XSI_BASE + XSI_IIP_OFS)
-#define XSI_BANK1_R16		(XSI_BASE + XSI_BANK1_R16_OFS)
-#define XSI_BANKNUM		(XSI_BASE + XSI_BANKNUM_OFS)
-#define XSI_IHA			(XSI_BASE + XSI_IHA_OFS)
-#endif
-
-#ifndef __ASSEMBLY__
-#define	XEN_HYPER_SSM_I		asm("break %0" : : "i" (HYPERPRIVOP_SSM_I))
-#define	XEN_HYPER_GET_IVR	asm("break %0" : : "i" (HYPERPRIVOP_GET_IVR))
-
-/************************************************/
-/* Instructions paravirtualized for performance */
-/************************************************/
-
-/* Xen uses memory-mapped virtual privileged registers for access to many
- * performance-sensitive privileged registers.  Some, like the processor
- * status register (psr), are broken up into multiple memory locations.
- * Others, like "pend", are abstractions based on privileged registers.
- * "Pend" is guaranteed to be set if reading cr.ivr would return a
- * (non-spurious) interrupt. */
-#define XEN_MAPPEDREGS ((struct mapped_regs *)XMAPPEDREGS_BASE)
-#define XSI_PSR_I			\
-	(*XEN_MAPPEDREGS->interrupt_mask_addr)
-#define xen_get_virtual_psr_i()		\
-	(!XSI_PSR_I)
-#define xen_set_virtual_psr_i(_val)	\
-	({ XSI_PSR_I = (uint8_t)(_val) ? 0 : 1; })
-#define xen_get_virtual_psr_ic()	\
-	( XEN_MAPPEDREGS->interrupt_collection_enabled )
-#define xen_set_virtual_psr_ic(_val)	\
-	({ XEN_MAPPEDREGS->interrupt_collection_enabled = _val ? 1 : 0; })
-#define xen_get_virtual_pend()		(XEN_MAPPEDREGS->pending_interruption)
-
-#endif /* __ASSEMBLY__ */
-
-#endif /* _PRIVOP_H_ */
-
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/include/ia64/sal.h
--- a/extras/mini-os/include/ia64/sal.h	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,188 +0,0 @@
-/*
- * Done by Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
- * The code is mostly taken from FreeBSD.
- *
- ****************************************************************************
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
- *
- */
-
-
-/*
- * The SAL System Table starts with a header which is described in
- * sal_system_table_t.
- * Table header will be followed by a variable number of variable length
- * entries. The first byte of each entry will identify the entry type and
- * the entries shall be in ascending order by the entry type. Each entry
- * type will have a known fixed length. The total length of this table
- * depends upon the configuration of the system. Operating system software
- * must step through each entry until it reaches the ENTRY_COUNT. The entries
- * are sorted on entry type in ascending order.
- * Unless otherwise stated, there is one entry per entry type.
- */
-
-#ifndef _SAL_H_
-#define _SAL_H_
-
-typedef uint64_t u_int64_t;
-typedef uint32_t u_int32_t;
-typedef uint16_t u_int16_t;
-typedef uint8_t u_int8_t;
-
-struct sal_system_table {
-	char		sal_signature[4];
-#define	SAL_SIGNATURE	"SST_"
-	uint32_t	sal_length;
-	uint8_t		sal_rev[2];	/* Byte 8 - Minor, Byte 0 - Major */
-	uint16_t	sal_entry_count;	// num entries in var part
-	uint8_t		sal_checksum;
-	uint8_t		sal_reserved1[7];
-	uint8_t		sal_a_version[2];	// like sal_rev
-	uint8_t		sal_b_version[2];	// like sal_rev
-	char		sal_oem_id[32];		// Ascii - manufacturer of HW
-	char		sal_product_id[32];	// ascii - identification
-	uint8_t		sal_reserved2[8];
-};
-
-typedef struct sal_system_table sal_system_table_t;
-
-#define SAL_DESC_ENTRYPOINT		0
-#define SAL_DESC_ENTRYPOINT_LENGTH	48
-#define SAL_DESC_MEMORY			1
-#define SAL_DESC_MEMORY_LENGTH		32
-#define SAL_DESC_PLATFORM		2
-#define SAL_DESC_PLATFORM_LENGT		16
-#define SAL_DESC_TR_REG			3
-#define SAL_DESC_TR_REG_LENGTH		32
-#define SAL_DESC_PURGE_TR_CACHE		4
-#define SAL_DESC_PURGE_TR_CACHE_LENGTH	16
-#define SAL_DESC_AP_WAKEUP		5
-#define SAL_DESC_AP_WAKEUP_LENGTH	16
-
-
-struct sal_entrypoint_descriptor
-{
-	uint8_t		sale_type;		/* == 0 */
-	uint8_t		sale_reserved1[7];
-	uint64_t	sale_pal_proc;		/* PAL_PROC entry point */
-	uint64_t	sale_sal_proc;		/* SAL_PROC entry point */
-	uint64_t	sale_sal_gp;		/* gp for SAL_PROC, PAL_PROC */
-	uint8_t		sale_reserved2[16];
-};
-
-struct sal_memory_descriptor
-{
-	uint8_t		sale_type;	/* == 1 */
-	uint8_t		sale_need_virtual;
-	uint8_t		sale_current_attribute;
-	uint8_t		sale_access_rights;
-	uint8_t		sale_supported_attributes;
-	uint8_t		sale_reserved1;
-	uint8_t		sale_memory_type[2];
-	uint64_t	sale_physical_address;
-	uint32_t	sale_length;
-	uint8_t		sale_reserved2[12];
-};
-
-struct sal_platform_descriptor
-{
-	uint8_t		sale_type;	/* == 2 */
-	uint8_t		sale_features;
-	uint8_t		sale_reserved[14];
-};
-
-struct sal_tr_descriptor
-{
-	u_int8_t	sale_type;	/* == 3 */
-	u_int8_t	sale_register_type;
-	u_int8_t	sale_register_number;
-	u_int8_t	sale_reserved1[5];
-	u_int64_t	sale_virtual_address;
-	u_int64_t	sale_page_size;
-	u_int8_t	sale_reserved2[8];
-};
-
-struct sal_ptc_cache_descriptor
-{
-	uint8_t		sale_type;	/* == 4 */
-	uint8_t		sale_reserved[3];
-	uint32_t	sale_domains;
-	uint64_t	sale_address;
-};
-
-struct sal_ap_wakeup_descriptor
-{
-	uint8_t		sale_type;	/* == 5 */
-	uint8_t		sale_mechanism;
-	uint8_t		sale_reserved[6];
-	uint64_t	sale_vector;
-};
-
-/*
- * SAL Procedure numbers.
- */
-
-#define SAL_SET_VECTORS			0x01000000
-#define SAL_GET_STATE_INFO		0x01000001
-#define SAL_GET_STATE_INFO_SIZE		0x01000002
-#define SAL_CLEAR_STATE_INFO		0x01000003
-#define SAL_MC_RENDEZ			0x01000004
-#define SAL_MC_SET_PARAMS		0x01000005
-#define SAL_REGISTER_PHYSICAL_ADDR	0x01000006
-#define SAL_CACHE_FLUSH			0x01000008
-#define SAL_CACHE_INIT			0x01000009
-#define SAL_PCI_CONFIG_READ		0x01000010
-#define SAL_PCI_CONFIG_WRITE		0x01000011
-#define SAL_FREQ_BASE			0x01000012
-#define SAL_UPDATE_PAL			0x01000020
-
-/* SAL_SET_VECTORS event handler types */
-#define	SAL_OS_MCA		0
-#define	SAL_OS_INIT		1
-#define	SAL_OS_BOOT_RENDEZ	2
-
-/* SAL_GET_STATE_INFO, SAL_GET_STATE_INFO_SIZE types */
-#define	SAL_INFO_MCA		0
-#define	SAL_INFO_INIT		1
-#define	SAL_INFO_CMC		2
-#define	SAL_INFO_CPE		3
-#define	SAL_INFO_TYPES		4	/* number of types we know about */
-
-struct ia64_sal_result
-{
-	int64_t		sal_status;
-	uint64_t	sal_result[3];
-};
-typedef struct ia64_sal_result ia64_sal_result_t;
-
-typedef ia64_sal_result_t sal_entry_t
-	(	uint64_t, uint64_t, uint64_t, uint64_t,
-	 	uint64_t, uint64_t, uint64_t, uint64_t
-	);
-
-extern ia64_sal_result_t ia64_sal_call(uint64_t, uint64_t, uint64_t, uint64_t,
-	 				uint64_t, uint64_t, uint64_t, uint64_t);
-
-extern void ia64_sal_init(sal_system_table_t *saltab);
-
-#endif /* _SAL_H_ */
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/include/ia64/traps.h
--- a/extras/mini-os/include/ia64/traps.h	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
- * Done by Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
- *
- ****************************************************************************
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- * 
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
- * DEALINGS IN THE SOFTWARE.
- */
-
-#if !defined(_TRAPS_H_)
-#define _TRAPS_H_
-
-#if !defined(__ASSEMBLY__)
-
-/* See ia64_cpu.h */
-struct trap_frame;
-
-#define pt_regs trap_frame
-
-/*
- * A dummy function, which is currently not supported.
- */
-inline static void trap_init(void)
-{
-	//printk("trap_init() until now not needed!\n");
-}
-inline static void trap_fini(void)
-{
-	//printk("trap_fini() until now not needed!\n");
-}
-
-
-#endif /* !defined(__ASSEMBLY__) */
-
-#include "ia64_cpu.h"
-
-void stack_walk(void);
-
-#endif /* !defined(_TRAPS_H_) */
-
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/include/mm.h
--- a/extras/mini-os/include/mm.h	Wed Sep 12 16:12:42 2012 +0100
+++ b/extras/mini-os/include/mm.h	Wed Sep 12 17:55:27 2012 +0100
@@ -29,8 +29,6 @@
 #include <xen/arch-x86_32.h>
 #elif defined(__x86_64__)
 #include <xen/arch-x86_64.h>
-#elif defined(__ia64__)
-#include <xen/arch-ia64.h>
 #else
 #error "Unsupported architecture"
 #endif
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/include/posix/limits.h
--- a/extras/mini-os/include/posix/limits.h	Wed Sep 12 16:12:42 2012 +0100
+++ b/extras/mini-os/include/posix/limits.h	Wed Sep 12 17:55:27 2012 +0100
@@ -25,7 +25,7 @@
 #define SHRT_MAX        0x7fff
 #define USHRT_MAX       0xffff
 
-#if defined(__x86_64__) || defined(__ia64__)
+#if defined(__x86_64__)
 # define LONG_MAX       0x7fffffffffffffffL
 # define ULONG_MAX      0xffffffffffffffffUL
 #else
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/include/sched.h
--- a/extras/mini-os/include/sched.h	Wed Sep 12 16:12:42 2012 +0100
+++ b/extras/mini-os/include/sched.h	Wed Sep 12 17:55:27 2012 +0100
@@ -12,13 +12,9 @@ struct thread
 {
     char *name;
     char *stack;
-#if !defined(__ia64__)
     /* keep in that order */
     unsigned long sp;  /* Stack pointer */
     unsigned long ip;  /* Instruction pointer */
-#else /* !defined(__ia64__) */
-    thread_regs_t regs;
-#endif /* !defined(__ia64__) */
     MINIOS_TAILQ_ENTRY(struct thread) thread_list;
     uint32_t flags;
     s_time_t wakeup_time;
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/include/types.h
--- a/extras/mini-os/include/types.h	Wed Sep 12 16:12:42 2012 +0100
+++ b/extras/mini-os/include/types.h	Wed Sep 12 17:55:27 2012 +0100
@@ -33,7 +33,7 @@ typedef unsigned long long  u_quad_t;
 
 typedef struct { unsigned long pte_low, pte_high; } pte_t;
 
-#elif defined(__x86_64__) || defined(__ia64__)
+#elif defined(__x86_64__)
 typedef long                quad_t;
 typedef unsigned long       u_quad_t;
 
@@ -54,7 +54,7 @@ typedef struct { unsigned long pte; } pt
 #ifdef __i386__
 typedef unsigned int        uintptr_t;
 typedef int                 intptr_t;
-#elif defined(__x86_64__) || defined(__ia64__)
+#elif defined(__x86_64__)
 typedef unsigned long       uintptr_t;
 typedef long                intptr_t;
 #endif /* __i386__ || __x86_64__ */
@@ -67,7 +67,7 @@ typedef   signed int int32_t;
 #ifdef __i386__
 typedef   signed long long int64_t;
 typedef unsigned long long uint64_t;
-#elif defined(__x86_64__) || defined(__ia64__)
+#elif defined(__x86_64__)
 typedef   signed long int64_t;
 typedef unsigned long uint64_t;
 #endif
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/lib/math.c
--- a/extras/mini-os/lib/math.c	Wed Sep 12 16:12:42 2012 +0100
+++ b/extras/mini-os/lib/math.c	Wed Sep 12 17:55:27 2012 +0100
@@ -50,10 +50,6 @@
 #include <mini-os/lib.h>
 #include <mini-os/time.h>
 
-	/* On ia64 these functions lead to crashes. These are replaced by
-	 * assembler functions. */
-#if !defined(__ia64__)
-
 /* XXX RN: Yuck hardcoded endianess :) */
 #define _QUAD_HIGHWORD 1
 #define _QUAD_LOWWORD 0
@@ -428,7 +424,6 @@ __moddi3(quad_t a, quad_t b)
 	(void)__qdivrem(ua, ub, &ur);
 	return (neg ? -ur : ur);
 }
-#endif /* !defined(__ia64__) */
 
 #ifndef HAVE_LIBC
 /* Should be random enough for our uses */
diff -r a1bd69b08e9e -r 485e6db28b93 extras/mini-os/mm.c
--- a/extras/mini-os/mm.c	Wed Sep 12 16:12:42 2012 +0100
+++ b/extras/mini-os/mm.c	Wed Sep 12 17:55:27 2012 +0100
@@ -361,7 +361,6 @@ void free_pages(void *pointer, int order
    
 }
 
-#ifndef __ia64__
 int free_physical_pages(xen_pfn_t *mfns, int n)
 {
     struct xen_memory_reservation reservation;
@@ -372,7 +371,6 @@ int free_physical_pages(xen_pfn_t *mfns,
     reservation.domid = DOMID_SELF;
     return HYPERVISOR_memory_op(XENMEM_decrease_reservation, &reservation);
 }
-#endif
 
 #ifdef HAVE_LIBC
 void *sbrk(ptrdiff_t increment)
diff -r a1bd69b08e9e -r 485e6db28b93 tools/debugger/xenitp/Makefile
--- a/tools/debugger/xenitp/Makefile	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-XEN_ROOT=$(CURDIR)/../../..
-include $(XEN_ROOT)/tools/Rules.mk
-
-#CFLAGS  += -Werror -g -O0
-
-CFLAGS  += $(CFLAGS_libxenctrl)
-
-LIBBIN   = 
-
-ifeq ($(XEN_TARGET_ARCH),ia64)
-LIBBIN  += xenitp
-endif
-
-.PHONY: all
-all: build
-
-.PHONY: build
-build: $(LIBBIN)
-
-.PHONY: install
-install: build
-	[ -z "$(LIBBIN)" ] || $(INSTALL_DIR) $(DESTDIR)$(PRIVATE_BINDIR)
-	[ -z "$(LIBBIN)" ] || $(INSTALL_PROG) $(LIBBIN) $(DESTDIR)$(PRIVATE_BINDIR)
-
-.PHONY: clean
-clean:
-	$(RM) *.a *.so *.o *.rpm $(LIBBIN)
-
-XENITP_OBJS=xenitp.o ia64-dis.o ia64-opc.o cpu-ia64-opc.o
-
-xenitp: $(XENITP_OBJS)
-	$(CC) $(CFLAGS) -o $@ $(XENITP_OBJS) $(LDLIBS_libxenctrl)
diff -r a1bd69b08e9e -r 485e6db28b93 tools/debugger/xenitp/README
--- a/tools/debugger/xenitp/README	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-xenitp README
-*************
-
-
-Xenitp is a low-level, non-symbolic debugger.  It only works on ia64.
-
-* Building xenitp
-First do 'make tools' at the top level to build libxc and includes.  Then
-cd to tools/debugger/xenitp and do make.
-
-* Using xenitp
-Usage is: xenitp DOM
-DOM is a domain number.
-'help' shows all the command available.
-When the domain is running, C-c stops it.
-
-* Source origin
-All these files come from binutils:
-cpu-ia64-opc.c
-dis-asm.h
-ia64-asmtab.c
-ia64-asmtab.h
-ia64-dis.c
-ia64-gen.c
-ia64.h
-ia64-opc-a.c
-ia64-opc-b.c
-ia64-opc.c
-ia64-opc-d.c
-ia64-opc-f.c
-ia64-opc.h
-ia64-opc-i.c
-ia64-opc-m.c
-ia64-opc-x.c
-
-xenitp.c is based on xenctxt.c
diff -r a1bd69b08e9e -r 485e6db28b93 tools/debugger/xenitp/cpu-ia64-opc.c
--- a/tools/debugger/xenitp/cpu-ia64-opc.c	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,615 +0,0 @@
-/* Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006
-   Free Software Foundation, Inc.
-   Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
-
-This file is part of BFD, the Binary File Descriptor library.
-
-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., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
-
-/* Logically, this code should be part of libopcode but since some of
-   the operand insertion/extraction functions help bfd to implement
-   relocations, this code is included as part of cpu-ia64.c.  This
-   avoids circular dependencies between libopcode and libbfd and also
-   obviates the need for applications to link in libopcode when all
-   they really want is libbfd.
-
-   --davidm Mon Apr 13 22:14:02 1998 */
-
-#include "ia64-opc.h"
-
-#define NELEMS(a)  ((int) (sizeof (a) / sizeof ((a)[0])))
-
-static const char*
-ins_rsvd (const struct ia64_operand *self ATTRIBUTE_UNUSED,
-	  ia64_insn value ATTRIBUTE_UNUSED, ia64_insn *code ATTRIBUTE_UNUSED)
-{
-  return "internal error---this shouldn't happen";
-}
-
-static const char*
-ext_rsvd (const struct ia64_operand *self ATTRIBUTE_UNUSED,
-	  ia64_insn code ATTRIBUTE_UNUSED, ia64_insn *valuep ATTRIBUTE_UNUSED)
-{
-  return "internal error---this shouldn't happen";
-}
-
-static const char*
-ins_const (const struct ia64_operand *self ATTRIBUTE_UNUSED,
-	   ia64_insn value ATTRIBUTE_UNUSED, ia64_insn *code ATTRIBUTE_UNUSED)
-{
-  return 0;
-}
-
-static const char*
-ext_const (const struct ia64_operand *self ATTRIBUTE_UNUSED,
-	   ia64_insn code ATTRIBUTE_UNUSED, ia64_insn *valuep ATTRIBUTE_UNUSED)
-{
-  return 0;
-}
-
-static const char*
-ins_reg (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
-{
-  if (value >= 1u << self->field[0].bits)
-    return "register number out of range";
-
-  *code |= value << self->field[0].shift;
-  return 0;
-}
-
-static const char*
-ext_reg (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
-{
-  *valuep = ((code >> self->field[0].shift)
-	     & ((1u << self->field[0].bits) - 1));
-  return 0;
-}
-
-static const char*
-ins_immu (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
-{
-  ia64_insn new = 0;
-  int i;
-
-  for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i)
-    {
-      new |= ((value & ((((ia64_insn) 1) << self->field[i].bits) - 1))
-	      << self->field[i].shift);
-      value >>= self->field[i].bits;
-    }
-  if (value)
-    return "integer operand out of range";
-
-  *code |= new;
-  return 0;
-}
-
-static const char*
-ext_immu (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
-{
-  BFD_HOST_U_64_BIT value = 0;
-  int i, bits = 0, total = 0;
-
-  for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i)
-    {
-      bits = self->field[i].bits;
-      value |= ((code >> self->field[i].shift)
-		& ((((BFD_HOST_U_64_BIT) 1) << bits) - 1)) << total;
-      total += bits;
-    }
-  *valuep = value;
-  return 0;
-}
-
-static const char*
-ins_immu5b (const struct ia64_operand *self, ia64_insn value,
-	    ia64_insn *code)
-{
-  if (value < 32 || value > 63)
-    return "value must be between 32 and 63";
-  return ins_immu (self, value - 32, code);
-}
-
-static const char*
-ext_immu5b (const struct ia64_operand *self, ia64_insn code,
-	    ia64_insn *valuep)
-{
-  const char *result;
-
-  result = ext_immu (self, code, valuep);
-  if (result)
-    return result;
-
-  *valuep = *valuep + 32;
-  return 0;
-}
-
-static const char*
-ins_immus8 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
-{
-  if (value & 0x7)
-    return "value not an integer multiple of 8";
-  return ins_immu (self, value >> 3, code);
-}
-
-static const char*
-ext_immus8 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
-{
-  const char *result;
-
-  result = ext_immu (self, code, valuep);
-  if (result)
-    return result;
-
-  *valuep = *valuep << 3;
-  return 0;
-}
-
-static const char*
-ins_imms_scaled (const struct ia64_operand *self, ia64_insn value,
-		 ia64_insn *code, int scale)
-{
-  BFD_HOST_64_BIT svalue = value, sign_bit = 0;
-  ia64_insn new = 0;
-  int i;
-
-  svalue >>= scale;
-
-  for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i)
-    {
-      new |= ((svalue & ((((ia64_insn) 1) << self->field[i].bits) - 1))
-	      << self->field[i].shift);
-      sign_bit = (svalue >> (self->field[i].bits - 1)) & 1;
-      svalue >>= self->field[i].bits;
-    }
-  if ((!sign_bit && svalue != 0) || (sign_bit && svalue != -1))
-    return "integer operand out of range";
-
-  *code |= new;
-  return 0;
-}
-
-static const char*
-ext_imms_scaled (const struct ia64_operand *self, ia64_insn code,
-		 ia64_insn *valuep, int scale)
-{
-  int i, bits = 0, total = 0;
-  BFD_HOST_64_BIT val = 0, sign;
-
-  for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i)
-    {
-      bits = self->field[i].bits;
-      val |= ((code >> self->field[i].shift)
-	      & ((((BFD_HOST_U_64_BIT) 1) << bits) - 1)) << total;
-      total += bits;
-    }
-  /* sign extend: */
-  sign = (BFD_HOST_64_BIT) 1 << (total - 1);
-  val = (val ^ sign) - sign;
-
-  *valuep = (val << scale);
-  return 0;
-}
-
-static const char*
-ins_imms (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
-{
-  return ins_imms_scaled (self, value, code, 0);
-}
-
-static const char*
-ins_immsu4 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
-{
-  value = ((value & 0xffffffff) ^ 0x80000000) - 0x80000000;
-
-  return ins_imms_scaled (self, value, code, 0);
-}
-
-static const char*
-ext_imms (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
-{
-  return ext_imms_scaled (self, code, valuep, 0);
-}
-
-static const char*
-ins_immsm1 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
-{
-  --value;
-  return ins_imms_scaled (self, value, code, 0);
-}
-
-static const char*
-ins_immsm1u4 (const struct ia64_operand *self, ia64_insn value,
-	      ia64_insn *code)
-{
-  value = ((value & 0xffffffff) ^ 0x80000000) - 0x80000000;
-
-  --value;
-  return ins_imms_scaled (self, value, code, 0);
-}
-
-static const char*
-ext_immsm1 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
-{
-  const char *res = ext_imms_scaled (self, code, valuep, 0);
-
-  ++*valuep;
-  return res;
-}
-
-static const char*
-ins_imms1 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
-{
-  return ins_imms_scaled (self, value, code, 1);
-}
-
-static const char*
-ext_imms1 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
-{
-  return ext_imms_scaled (self, code, valuep, 1);
-}
-
-static const char*
-ins_imms4 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
-{
-  return ins_imms_scaled (self, value, code, 4);
-}
-
-static const char*
-ext_imms4 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
-{
-  return ext_imms_scaled (self, code, valuep, 4);
-}
-
-static const char*
-ins_imms16 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
-{
-  return ins_imms_scaled (self, value, code, 16);
-}
-
-static const char*
-ext_imms16 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
-{
-  return ext_imms_scaled (self, code, valuep, 16);
-}
-
-static const char*
-ins_cimmu (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
-{
-  ia64_insn mask = (((ia64_insn) 1) << self->field[0].bits) - 1;
-  return ins_immu (self, value ^ mask, code);
-}
-
-static const char*
-ext_cimmu (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
-{
-  const char *result;
-  ia64_insn mask;
-
-  mask = (((ia64_insn) 1) << self->field[0].bits) - 1;
-  result = ext_immu (self, code, valuep);
-  if (!result)
-    {
-      mask = (((ia64_insn) 1) << self->field[0].bits) - 1;
-      *valuep ^= mask;
-    }
-  return result;
-}
-
-static const char*
-ins_cnt (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
-{
-  --value;
-  if (value >= ((BFD_HOST_U_64_BIT) 1) << self->field[0].bits)
-    return "count out of range";
-
-  *code |= value << self->field[0].shift;
-  return 0;
-}
-
-static const char*
-ext_cnt (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
-{
-  *valuep = ((code >> self->field[0].shift)
-	     & ((((BFD_HOST_U_64_BIT) 1) << self->field[0].bits) - 1)) + 1;
-  return 0;
-}
-
-static const char*
-ins_cnt2b (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
-{
-  --value;
-
-  if (value > 2)
-    return "count must be in range 1..3";
-
-  *code |= value << self->field[0].shift;
-  return 0;
-}
-
-static const char*
-ext_cnt2b (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
-{
-  *valuep = ((code >> self->field[0].shift) & 0x3) + 1;
-  return 0;
-}
-
-static const char*
-ins_cnt2c (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
-{
-  switch (value)
-    {
-    case 0:	value = 0; break;
-    case 7:	value = 1; break;
-    case 15:	value = 2; break;
-    case 16:	value = 3; break;
-    default:	return "count must be 0, 7, 15, or 16";
-    }
-  *code |= value << self->field[0].shift;
-  return 0;
-}
-
-static const char*
-ext_cnt2c (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
-{
-  ia64_insn value;
-
-  value = (code >> self->field[0].shift) & 0x3;
-  switch (value)
-    {
-    case 0: value =  0; break;
-    case 1: value =  7; break;
-    case 2: value = 15; break;
-    case 3: value = 16; break;
-    }
-  *valuep = value;
-  return 0;
-}
-
-static const char*
-ins_inc3 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
-{
-  BFD_HOST_64_BIT val = value;
-  BFD_HOST_U_64_BIT sign = 0;
-
-  if (val < 0)
-    {
-      sign = 0x4;
-      value = -value;
-    }
-  switch (value)
-    {
-    case  1:	value = 3; break;
-    case  4:	value = 2; break;
-    case  8:	value = 1; break;
-    case 16:	value = 0; break;
-    default:	return "count must be +/- 1, 4, 8, or 16";
-    }
-  *code |= (sign | value) << self->field[0].shift;
-  return 0;
-}
-
-static const char*
-ext_inc3 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
-{
-  BFD_HOST_64_BIT val;
-  int negate;
-
-  val = (code >> self->field[0].shift) & 0x7;
-  negate = val & 0x4;
-  switch (val & 0x3)
-    {
-    case 0: val = 16; break;
-    case 1: val =  8; break;
-    case 2: val =  4; break;
-    case 3: val =  1; break;
-    }
-  if (negate)
-    val = -val;
-
-  *valuep = val;
-  return 0;
-}
-
-#define CST	IA64_OPND_CLASS_CST
-#define REG	IA64_OPND_CLASS_REG
-#define IND	IA64_OPND_CLASS_IND
-#define ABS	IA64_OPND_CLASS_ABS
-#define REL	IA64_OPND_CLASS_REL
-
-#define SDEC	IA64_OPND_FLAG_DECIMAL_SIGNED
-#define UDEC	IA64_OPND_FLAG_DECIMAL_UNSIGNED
-
-const struct ia64_operand elf64_ia64_operands[IA64_OPND_COUNT] =
-  {
-    /* constants: */
-    { CST, ins_const, ext_const, "NIL",		{{ 0, 0}}, 0, "<none>" },
-    { CST, ins_const, ext_const, "ar.csd",	{{ 0, 0}}, 0, "ar.csd" },
-    { CST, ins_const, ext_const, "ar.ccv",	{{ 0, 0}}, 0, "ar.ccv" },
-    { CST, ins_const, ext_const, "ar.pfs",	{{ 0, 0}}, 0, "ar.pfs" },
-    { CST, ins_const, ext_const, "1",		{{ 0, 0}}, 0, "1" },
-    { CST, ins_const, ext_const, "8",		{{ 0, 0}}, 0, "8" },
-    { CST, ins_const, ext_const, "16",		{{ 0, 0}}, 0, "16" },
-    { CST, ins_const, ext_const, "r0",		{{ 0, 0}}, 0, "r0" },
-    { CST, ins_const, ext_const, "ip",		{{ 0, 0}}, 0, "ip" },
-    { CST, ins_const, ext_const, "pr",		{{ 0, 0}}, 0, "pr" },
-    { CST, ins_const, ext_const, "pr.rot",	{{ 0, 0}}, 0, "pr.rot" },
-    { CST, ins_const, ext_const, "psr",		{{ 0, 0}}, 0, "psr" },
-    { CST, ins_const, ext_const, "psr.l",	{{ 0, 0}}, 0, "psr.l" },
-    { CST, ins_const, ext_const, "psr.um",	{{ 0, 0}}, 0, "psr.um" },
-
-    /* register operands: */
-    { REG, ins_reg,   ext_reg,	"ar", {{ 7, 20}}, 0,		/* AR3 */
-      "an application register" },
-    { REG, ins_reg,   ext_reg,	 "b", {{ 3,  6}}, 0,		/* B1 */
-      "a branch register" },
-    { REG, ins_reg,   ext_reg,	 "b", {{ 3, 13}}, 0,		/* B2 */
-      "a branch register"},
-    { REG, ins_reg,   ext_reg,	"cr", {{ 7, 20}}, 0,		/* CR */
-      "a control register"},
-    { REG, ins_reg,   ext_reg,	 "f", {{ 7,  6}}, 0,		/* F1 */
-      "a floating-point register" },
-    { REG, ins_reg,   ext_reg,	 "f", {{ 7, 13}}, 0,		/* F2 */
-      "a floating-point register" },
-    { REG, ins_reg,   ext_reg,	 "f", {{ 7, 20}}, 0,		/* F3 */
-      "a floating-point register" },
-    { REG, ins_reg,   ext_reg,	 "f", {{ 7, 27}}, 0,		/* F4 */
-      "a floating-point register" },
-    { REG, ins_reg,   ext_reg,	 "p", {{ 6,  6}}, 0,		/* P1 */
-      "a predicate register" },
-    { REG, ins_reg,   ext_reg,	 "p", {{ 6, 27}}, 0,		/* P2 */
-      "a predicate register" },
-    { REG, ins_reg,   ext_reg,	 "r", {{ 7,  6}}, 0,		/* R1 */
-      "a general register" },
-    { REG, ins_reg,   ext_reg,	 "r", {{ 7, 13}}, 0,		/* R2 */
-      "a general register" },
-    { REG, ins_reg,   ext_reg,	 "r", {{ 7, 20}}, 0,		/* R3 */
-      "a general register" },
-    { REG, ins_reg,   ext_reg,	 "r", {{ 2, 20}}, 0,		/* R3_2 */
-      "a general register r0-r3" },
-
-    /* memory operands: */
-    { IND, ins_reg,   ext_reg,	"",      {{7, 20}}, 0,		/* MR3 */
-      "a memory address" },
-
-    /* indirect operands: */
-    { IND, ins_reg,   ext_reg,	"cpuid", {{7, 20}}, 0,		/* CPUID_R3 */
-      "a cpuid register" },
-    { IND, ins_reg,   ext_reg,	"dbr",   {{7, 20}}, 0,		/* DBR_R3 */
-      "a dbr register" },
-    { IND, ins_reg,   ext_reg,	"dtr",   {{7, 20}}, 0,		/* DTR_R3 */
-      "a dtr register" },
-    { IND, ins_reg,   ext_reg,	"itr",   {{7, 20}}, 0,		/* ITR_R3 */
-      "an itr register" },
-    { IND, ins_reg,   ext_reg,	"ibr",   {{7, 20}}, 0,		/* IBR_R3 */
-      "an ibr register" },
-    { IND, ins_reg,   ext_reg,	"msr",   {{7, 20}}, 0,		/* MSR_R3 */
-      "an msr register" },
-    { IND, ins_reg,   ext_reg,	"pkr",   {{7, 20}}, 0,		/* PKR_R3 */
-      "a pkr register" },
-    { IND, ins_reg,   ext_reg,	"pmc",   {{7, 20}}, 0,		/* PMC_R3 */
-      "a pmc register" },
-    { IND, ins_reg,   ext_reg,	"pmd",   {{7, 20}}, 0,		/* PMD_R3 */
-      "a pmd register" },
-    { IND, ins_reg,   ext_reg,	"rr",    {{7, 20}}, 0,		/* RR_R3 */
-      "an rr register" },
-
-    /* immediate operands: */
-    { ABS, ins_cimmu, ext_cimmu, 0, {{ 5, 20 }}, UDEC,		/* CCNT5 */
-      "a 5-bit count (0-31)" },
-    { ABS, ins_cnt,   ext_cnt,   0, {{ 2, 27 }}, UDEC,		/* CNT2a */
-      "a 2-bit count (1-4)" },
-    { ABS, ins_cnt2b, ext_cnt2b, 0, {{ 2, 27 }}, UDEC,		/* CNT2b */
-      "a 2-bit count (1-3)" },
-    { ABS, ins_cnt2c, ext_cnt2c, 0, {{ 2, 30 }}, UDEC,		/* CNT2c */
-      "a count (0, 7, 15, or 16)" },
-    { ABS, ins_immu,  ext_immu,  0, {{ 5, 14}}, UDEC,		/* CNT5 */
-      "a 5-bit count (0-31)" },
-    { ABS, ins_immu,  ext_immu,  0, {{ 6, 27}}, UDEC,		/* CNT6 */
-      "a 6-bit count (0-63)" },
-    { ABS, ins_cimmu, ext_cimmu, 0, {{ 6, 20}}, UDEC,		/* CPOS6a */
-      "a 6-bit bit pos (0-63)" },
-    { ABS, ins_cimmu, ext_cimmu, 0, {{ 6, 14}}, UDEC,		/* CPOS6b */
-      "a 6-bit bit pos (0-63)" },
-    { ABS, ins_cimmu, ext_cimmu, 0, {{ 6, 31}}, UDEC,		/* CPOS6c */
-      "a 6-bit bit pos (0-63)" },
-    { ABS, ins_imms,  ext_imms,  0, {{ 1, 36}}, SDEC,		/* IMM1 */
-      "a 1-bit integer (-1, 0)" },
-    { ABS, ins_immu,  ext_immu,  0, {{ 2, 13}}, UDEC,		/* IMMU2 */
-      "a 2-bit unsigned (0-3)" },
-    { ABS, ins_immu5b,  ext_immu5b,  0, {{ 5, 14}}, UDEC,	/* IMMU5b */
-      "a 5-bit unsigned (32 + (0-31))" },
-    { ABS, ins_immu,  ext_immu,  0, {{ 7, 13}}, 0,		/* IMMU7a */
-      "a 7-bit unsigned (0-127)" },
-    { ABS, ins_immu,  ext_immu,  0, {{ 7, 20}}, 0,		/* IMMU7b */
-      "a 7-bit unsigned (0-127)" },
-    { ABS, ins_immu,  ext_immu,  0, {{ 7, 13}}, UDEC,		/* SOF */
-      "a frame size (register count)" },
-    { ABS, ins_immu,  ext_immu,  0, {{ 7, 20}}, UDEC,		/* SOL */
-      "a local register count" },
-    { ABS, ins_immus8,ext_immus8,0, {{ 4, 27}}, UDEC,		/* SOR */
-      "a rotating register count (integer multiple of 8)" },
-    { ABS, ins_imms,  ext_imms,  0,				/* IMM8 */
-      {{ 7, 13}, { 1, 36}}, SDEC,
-      "an 8-bit integer (-128-127)" },
-    { ABS, ins_immsu4,  ext_imms,  0,				/* IMM8U4 */
-      {{ 7, 13}, { 1, 36}}, SDEC,
-      "an 8-bit signed integer for 32-bit unsigned compare (-128-127)" },
-    { ABS, ins_immsm1,  ext_immsm1,  0,				/* IMM8M1 */
-      {{ 7, 13}, { 1, 36}}, SDEC,
-      "an 8-bit integer (-127-128)" },
-    { ABS, ins_immsm1u4,  ext_immsm1,  0,			/* IMM8M1U4 */
-      {{ 7, 13}, { 1, 36}}, SDEC,
-      "an 8-bit integer for 32-bit unsigned compare (-127-(-1),1-128,0x100000000)" },
-    { ABS, ins_immsm1,  ext_immsm1,  0,				/* IMM8M1U8 */
-      {{ 7, 13}, { 1, 36}}, SDEC,
-      "an 8-bit integer for 64-bit unsigned compare (-127-(-1),1-128,0x10000000000000000)" },
-    { ABS, ins_immu,  ext_immu,  0, {{ 2, 33}, { 7, 20}}, 0,	/* IMMU9 */
-      "a 9-bit unsigned (0-511)" },
-    { ABS, ins_imms,  ext_imms,  0,				/* IMM9a */
-      {{ 7,  6}, { 1, 27}, { 1, 36}}, SDEC,
-      "a 9-bit integer (-256-255)" },
-    { ABS, ins_imms,  ext_imms, 0,				/* IMM9b */
-      {{ 7, 13}, { 1, 27}, { 1, 36}}, SDEC,
-      "a 9-bit integer (-256-255)" },
-    { ABS, ins_imms,  ext_imms, 0,				/* IMM14 */
-      {{ 7, 13}, { 6, 27}, { 1, 36}}, SDEC,
-      "a 14-bit integer (-8192-8191)" },
-    { ABS, ins_imms1, ext_imms1, 0,				/* IMM17 */
-      {{ 7,  6}, { 8, 24}, { 1, 36}}, 0,
-      "a 17-bit integer (-65536-65535)" },
-    { ABS, ins_immu,  ext_immu,  0, {{20,  6}, { 1, 36}}, 0,	/* IMMU21 */
-      "a 21-bit unsigned" },
-    { ABS, ins_imms,  ext_imms,  0,				/* IMM22 */
-      {{ 7, 13}, { 9, 27}, { 5, 22}, { 1, 36}}, SDEC,
-      "a 22-bit signed integer" },
-    { ABS, ins_immu,  ext_immu,  0,				/* IMMU24 */
-      {{21,  6}, { 2, 31}, { 1, 36}}, 0,
-      "a 24-bit unsigned" },
-    { ABS, ins_imms16,ext_imms16,0, {{27,  6}, { 1, 36}}, 0,	/* IMM44 */
-      "a 44-bit unsigned (least 16 bits ignored/zeroes)" },
-    { ABS, ins_rsvd,  ext_rsvd,	0, {{0,  0}}, 0,		/* IMMU62 */
-      "a 62-bit unsigned" },
-    { ABS, ins_rsvd,  ext_rsvd,	0, {{0,  0}}, 0,		/* IMMU64 */
-      "a 64-bit unsigned" },
-    { ABS, ins_inc3,  ext_inc3,  0, {{ 3, 13}}, SDEC,		/* INC3 */
-      "an increment (+/- 1, 4, 8, or 16)" },
-    { ABS, ins_cnt,   ext_cnt,   0, {{ 4, 27}}, UDEC,		/* LEN4 */
-      "a 4-bit length (1-16)" },
-    { ABS, ins_cnt,   ext_cnt,   0, {{ 6, 27}}, UDEC,		/* LEN6 */
-      "a 6-bit length (1-64)" },
-    { ABS, ins_immu,  ext_immu,  0, {{ 4, 20}},	0,		/* MBTYPE4 */
-      "a mix type (@rev, @mix, @shuf, @alt, or @brcst)" },
-    { ABS, ins_immu,  ext_immu,  0, {{ 8, 20}},	0,		/* MBTYPE8 */
-      "an 8-bit mix type" },
-    { ABS, ins_immu,  ext_immu,  0, {{ 6, 14}}, UDEC,		/* POS6 */
-      "a 6-bit bit pos (0-63)" },
-    { REL, ins_imms4, ext_imms4, 0, {{ 7,  6}, { 2, 33}}, 0,	/* TAG13 */
-      "a branch tag" },
-    { REL, ins_imms4, ext_imms4, 0, {{ 9, 24}}, 0,		/* TAG13b */
-      "a branch tag" },
-    { REL, ins_imms4, ext_imms4, 0, {{20,  6}, { 1, 36}}, 0,	/* TGT25 */
-      "a branch target" },
-    { REL, ins_imms4, ext_imms4, 0,				/* TGT25b */
-      {{ 7,  6}, {13, 20}, { 1, 36}}, 0,
-      "a branch target" },
-    { REL, ins_imms4, ext_imms4, 0, {{20, 13}, { 1, 36}}, 0,	/* TGT25c */
-      "a branch target" },
-    { REL, ins_rsvd, ext_rsvd, 0, {{0, 0}}, 0,                  /* TGT64  */
-      "a branch target" },
-
-    { ABS, ins_const, ext_const, 0, {{0, 0}}, 0,		/* LDXMOV */
-      "ldxmov target" },
-  };
diff -r a1bd69b08e9e -r 485e6db28b93 tools/debugger/xenitp/dis-asm.h
--- a/tools/debugger/xenitp/dis-asm.h	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,548 +0,0 @@
-/* Interface between the opcode library and its callers.
-
-   Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005
-   Free Software Foundation, Inc.
-
-   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, 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., 51 Franklin Street - Fifth Floor,
-   Boston, MA 02110-1301, USA.
-
-   Written by Cygnus Support, 1993.
-
-   The opcode library (libopcodes.a) provides instruction decoders for
-   a large variety of instruction sets, callable with an identical
-   interface, for making instruction-processing programs more independent
-   of the instruction set being processed.  */
-
-#ifndef DIS_ASM_H
-#define DIS_ASM_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <inttypes.h>
-
-#define PARAMS(x) x
-typedef void *PTR;
-typedef uint64_t bfd_vma;
-typedef int64_t bfd_signed_vma;
-typedef uint8_t bfd_byte;
-typedef int bfd_boolean;
-#define BFD_HOST_U_64_BIT unsigned long
-#define BFD_HOST_64_BIT long
-#define sprintf_vma(s,x) sprintf (s, "%0" PRIx64, x)
-
-extern unsigned long bfd_getl64 (const bfd_byte *addr);
-
-#define BFD64
-#define ATTRIBUTE_FPTR_PRINTF_2
-#define ATTRIBUTE_UNUSED __attribute__((unused))
-
-enum bfd_flavour {
-  bfd_target_unknown_flavour,
-  bfd_target_aout_flavour,
-  bfd_target_coff_flavour,
-  bfd_target_ecoff_flavour,
-  bfd_target_elf_flavour,
-  bfd_target_ieee_flavour,
-  bfd_target_nlm_flavour,
-  bfd_target_oasys_flavour,
-  bfd_target_tekhex_flavour,
-  bfd_target_srec_flavour,
-  bfd_target_ihex_flavour,
-  bfd_target_som_flavour,
-  bfd_target_os9k_flavour,
-  bfd_target_versados_flavour,
-  bfd_target_msdos_flavour,
-  bfd_target_evax_flavour
-};
-
-enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN };
-
-enum bfd_architecture 
-{
-  bfd_arch_unknown,    /* File arch not known */
-  bfd_arch_obscure,    /* Arch known, not one of these */
-  bfd_arch_m68k,       /* Motorola 68xxx */
-#define bfd_mach_m68000 1
-#define bfd_mach_m68008 2
-#define bfd_mach_m68010 3
-#define bfd_mach_m68020 4
-#define bfd_mach_m68030 5
-#define bfd_mach_m68040 6
-#define bfd_mach_m68060 7
-#define bfd_mach_cpu32  8
-#define bfd_mach_mcf5200  9
-#define bfd_mach_mcf5206e 10
-#define bfd_mach_mcf5307  11
-#define bfd_mach_mcf5407  12
-#define bfd_mach_mcf528x  13
-#define bfd_mach_mcfv4e   14
-#define bfd_mach_mcf521x   15
-#define bfd_mach_mcf5249   16
-#define bfd_mach_mcf547x   17
-#define bfd_mach_mcf548x   18
-  bfd_arch_vax,        /* DEC Vax */   
-  bfd_arch_i960,       /* Intel 960 */
-     /* The order of the following is important.
-       lower number indicates a machine type that 
-       only accepts a subset of the instructions
-       available to machines with higher numbers.
-       The exception is the "ca", which is
-       incompatible with all other machines except 
-       "core". */
-
-#define bfd_mach_i960_core      1
-#define bfd_mach_i960_ka_sa     2
-#define bfd_mach_i960_kb_sb     3
-#define bfd_mach_i960_mc        4
-#define bfd_mach_i960_xa        5
-#define bfd_mach_i960_ca        6
-#define bfd_mach_i960_jx        7
-#define bfd_mach_i960_hx        8
-
-  bfd_arch_a29k,       /* AMD 29000 */
-  bfd_arch_sparc,      /* SPARC */
-#define bfd_mach_sparc                 1
-/* The difference between v8plus and v9 is that v9 is a true 64 bit env.  */
-#define bfd_mach_sparc_sparclet        2
-#define bfd_mach_sparc_sparclite       3
-#define bfd_mach_sparc_v8plus          4
-#define bfd_mach_sparc_v8plusa         5 /* with ultrasparc add'ns.  */
-#define bfd_mach_sparc_sparclite_le    6
-#define bfd_mach_sparc_v9              7
-#define bfd_mach_sparc_v9a             8 /* with ultrasparc add'ns.  */
-#define bfd_mach_sparc_v8plusb         9 /* with cheetah add'ns.  */
-#define bfd_mach_sparc_v9b             10 /* with cheetah add'ns.  */
-/* Nonzero if MACH has the v9 instruction set.  */
-#define bfd_mach_sparc_v9_p(mach) \
-  ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \
-   && (mach) != bfd_mach_sparc_sparclite_le)
-  bfd_arch_mips,       /* MIPS Rxxxx */
-#define bfd_mach_mips3000              3000
-#define bfd_mach_mips3900              3900
-#define bfd_mach_mips4000              4000
-#define bfd_mach_mips4010              4010
-#define bfd_mach_mips4100              4100
-#define bfd_mach_mips4300              4300
-#define bfd_mach_mips4400              4400
-#define bfd_mach_mips4600              4600
-#define bfd_mach_mips4650              4650
-#define bfd_mach_mips5000              5000
-#define bfd_mach_mips6000              6000
-#define bfd_mach_mips8000              8000
-#define bfd_mach_mips10000             10000
-#define bfd_mach_mips16                16
-  bfd_arch_i386,       /* Intel 386 */
-#define bfd_mach_i386_i386 0
-#define bfd_mach_i386_i8086 1
-#define bfd_mach_i386_i386_intel_syntax 2
-#define bfd_mach_x86_64 3
-#define bfd_mach_x86_64_intel_syntax 4
-  bfd_arch_we32k,      /* AT&T WE32xxx */
-  bfd_arch_tahoe,      /* CCI/Harris Tahoe */
-  bfd_arch_i860,       /* Intel 860 */
-  bfd_arch_romp,       /* IBM ROMP PC/RT */
-  bfd_arch_alliant,    /* Alliant */
-  bfd_arch_convex,     /* Convex */
-  bfd_arch_m88k,       /* Motorola 88xxx */
-  bfd_arch_pyramid,    /* Pyramid Technology */
-  bfd_arch_h8300,      /* Hitachi H8/300 */
-#define bfd_mach_h8300   1
-#define bfd_mach_h8300h  2
-#define bfd_mach_h8300s  3
-  bfd_arch_powerpc,    /* PowerPC */
-#define bfd_mach_ppc           0
-#define bfd_mach_ppc64         1
-#define bfd_mach_ppc_403       403
-#define bfd_mach_ppc_403gc     4030
-#define bfd_mach_ppc_505       505
-#define bfd_mach_ppc_601       601
-#define bfd_mach_ppc_602       602
-#define bfd_mach_ppc_603       603
-#define bfd_mach_ppc_ec603e    6031
-#define bfd_mach_ppc_604       604
-#define bfd_mach_ppc_620       620
-#define bfd_mach_ppc_630       630
-#define bfd_mach_ppc_750       750
-#define bfd_mach_ppc_860       860
-#define bfd_mach_ppc_a35       35
-#define bfd_mach_ppc_rs64ii    642
-#define bfd_mach_ppc_rs64iii   643
-#define bfd_mach_ppc_7400      7400
-  bfd_arch_rs6000,     /* IBM RS/6000 */
-  bfd_arch_hppa,       /* HP PA RISC */
-  bfd_arch_d10v,       /* Mitsubishi D10V */
-  bfd_arch_z8k,        /* Zilog Z8000 */
-#define bfd_mach_z8001         1
-#define bfd_mach_z8002         2
-  bfd_arch_h8500,      /* Hitachi H8/500 */
-  bfd_arch_sh,         /* Hitachi SH */
-#define bfd_mach_sh            1
-#define bfd_mach_sh2        0x20
-#define bfd_mach_sh_dsp     0x2d
-#define bfd_mach_sh2a       0x2a
-#define bfd_mach_sh2a_nofpu 0x2b
-#define bfd_mach_sh2e       0x2e
-#define bfd_mach_sh3        0x30
-#define bfd_mach_sh3_nommu  0x31
-#define bfd_mach_sh3_dsp    0x3d
-#define bfd_mach_sh3e       0x3e
-#define bfd_mach_sh4        0x40
-#define bfd_mach_sh4_nofpu  0x41
-#define bfd_mach_sh4_nommu_nofpu  0x42
-#define bfd_mach_sh4a       0x4a
-#define bfd_mach_sh4a_nofpu 0x4b
-#define bfd_mach_sh4al_dsp  0x4d
-#define bfd_mach_sh5        0x50
-  bfd_arch_alpha,      /* Dec Alpha */
-#define bfd_mach_alpha 1
-  bfd_arch_arm,        /* Advanced Risc Machines ARM */
-#define bfd_mach_arm_2         1
-#define bfd_mach_arm_2a                2
-#define bfd_mach_arm_3         3
-#define bfd_mach_arm_3M        4
-#define bfd_mach_arm_4                 5
-#define bfd_mach_arm_4T        6
-  bfd_arch_ns32k,      /* National Semiconductors ns32000 */
-  bfd_arch_w65,        /* WDC 65816 */
-  bfd_arch_tic30,      /* Texas Instruments TMS320C30 */
-  bfd_arch_v850,       /* NEC V850 */
-#define bfd_mach_v850          0
-  bfd_arch_arc,        /* Argonaut RISC Core */
-#define bfd_mach_arc_base 0
-  bfd_arch_m32r,       /* Mitsubishi M32R/D */
-#define bfd_mach_m32r          0  /* backwards compatibility */
-  bfd_arch_mn10200,    /* Matsushita MN10200 */
-  bfd_arch_mn10300,    /* Matsushita MN10300 */
-  bfd_arch_last
-  };
-
-typedef struct symbol_cache_entry
-{
-    const char *name;
-    union
-    {
-        PTR p;
-        bfd_vma i;
-    } udata;
-} asymbol;
-
-typedef int (*fprintf_ftype) (void *, const char*, ...) ATTRIBUTE_FPTR_PRINTF_2;
-
-enum dis_insn_type {
-  dis_noninsn,			/* Not a valid instruction */
-  dis_nonbranch,		/* Not a branch instruction */
-  dis_branch,			/* Unconditional branch */
-  dis_condbranch,		/* Conditional branch */
-  dis_jsr,			/* Jump to subroutine */
-  dis_condjsr,			/* Conditional jump to subroutine */
-  dis_dref,			/* Data reference instruction */
-  dis_dref2			/* Two data references in instruction */
-};
-
-/* This struct is passed into the instruction decoding routine,
-   and is passed back out into each callback.  The various fields are used
-   for conveying information from your main routine into your callbacks,
-   for passing information into the instruction decoders (such as the
-   addresses of the callback functions), or for passing information
-   back from the instruction decoders to their callers.
-
-   It must be initialized before it is first passed; this can be done
-   by hand, or using one of the initialization macros below.  */
-
-typedef struct disassemble_info {
-  fprintf_ftype fprintf_func;
-  void *stream;
-  void *application_data;
-
-  /* Target description.  We could replace this with a pointer to the bfd,
-     but that would require one.  There currently isn't any such requirement
-     so to avoid introducing one we record these explicitly.  */
-  /* The bfd_flavour.  This can be bfd_target_unknown_flavour.  */
-  enum bfd_flavour flavour;
-  /* The bfd_arch value.  */
-  enum bfd_architecture arch;
-  /* The bfd_mach value.  */
-  unsigned long mach;
-  /* Endianness (for bi-endian cpus).  Mono-endian cpus can ignore this.  */
-  enum bfd_endian endian;
-  /* An arch/mach-specific bitmask of selected instruction subsets, mainly
-     for processors with run-time-switchable instruction sets.  The default,
-     zero, means that there is no constraint.  CGEN-based opcodes ports
-     may use ISA_foo masks.  */
-  void *insn_sets;
-
-  /* Some targets need information about the current section to accurately
-     display insns.  If this is NULL, the target disassembler function
-     will have to make its best guess.  */
-  //asection *section;
-
-  /* An array of pointers to symbols either at the location being disassembled
-     or at the start of the function being disassembled.  The array is sorted
-     so that the first symbol is intended to be the one used.  The others are
-     present for any misc. purposes.  This is not set reliably, but if it is
-     not NULL, it is correct.  */
-  asymbol **symbols;
-  /* Number of symbols in array.  */
-  int num_symbols;
-
-  /* For use by the disassembler.
-     The top 16 bits are reserved for public use (and are documented here).
-     The bottom 16 bits are for the internal use of the disassembler.  */
-  unsigned long flags;
-#define INSN_HAS_RELOC	0x80000000
-  void *private_data;
-
-  /* Function used to get bytes to disassemble.  MEMADDR is the
-     address of the stuff to be disassembled, MYADDR is the address to
-     put the bytes in, and LENGTH is the number of bytes to read.
-     INFO is a pointer to this struct.
-     Returns an errno value or 0 for success.  */
-  int (*read_memory_func)
-    (bfd_vma memaddr, bfd_byte *myaddr, unsigned int length,
-     struct disassemble_info *info);
-
-  /* Function which should be called if we get an error that we can't
-     recover from.  STATUS is the errno value from read_memory_func and
-     MEMADDR is the address that we were trying to read.  INFO is a
-     pointer to this struct.  */
-  void (*memory_error_func)
-    (int status, bfd_vma memaddr, struct disassemble_info *info);
-
-  /* Function called to print ADDR.  */
-  void (*print_address_func)
-    (bfd_vma addr, struct disassemble_info *info);
-
-  /* Function called to determine if there is a symbol at the given ADDR.
-     If there is, the function returns 1, otherwise it returns 0.
-     This is used by ports which support an overlay manager where
-     the overlay number is held in the top part of an address.  In
-     some circumstances we want to include the overlay number in the
-     address, (normally because there is a symbol associated with
-     that address), but sometimes we want to mask out the overlay bits.  */
-  int (* symbol_at_address_func)
-    (bfd_vma addr, struct disassemble_info * info);
-
-  /* Function called to check if a SYMBOL is can be displayed to the user.
-     This is used by some ports that want to hide special symbols when
-     displaying debugging outout.  */
-  bfd_boolean (* symbol_is_valid)
-    (asymbol *, struct disassemble_info * info);
-
-  /* These are for buffer_read_memory.  */
-  bfd_byte *buffer;
-  bfd_vma buffer_vma;
-  unsigned int buffer_length;
-
-  /* This variable may be set by the instruction decoder.  It suggests
-      the number of bytes objdump should display on a single line.  If
-      the instruction decoder sets this, it should always set it to
-      the same value in order to get reasonable looking output.  */
-  int bytes_per_line;
-
-  /* The next two variables control the way objdump displays the raw data.  */
-  /* For example, if bytes_per_line is 8 and bytes_per_chunk is 4, the */
-  /* output will look like this:
-     00:   00000000 00000000
-     with the chunks displayed according to "display_endian". */
-  int bytes_per_chunk;
-  enum bfd_endian display_endian;
-
-  /* Number of octets per incremented target address
-     Normally one, but some DSPs have byte sizes of 16 or 32 bits.  */
-  unsigned int octets_per_byte;
-
-  /* The number of zeroes we want to see at the end of a section before we
-     start skipping them.  */
-  unsigned int skip_zeroes;
-
-  /* The number of zeroes to skip at the end of a section.  If the number
-     of zeroes at the end is between SKIP_ZEROES_AT_END and SKIP_ZEROES,
-     they will be disassembled.  If there are fewer than
-     SKIP_ZEROES_AT_END, they will be skipped.  This is a heuristic
-     attempt to avoid disassembling zeroes inserted by section
-     alignment.  */
-  unsigned int skip_zeroes_at_end;
-
-  /* Whether the disassembler always needs the relocations.  */
-  bfd_boolean disassembler_needs_relocs;
-
-  /* Results from instruction decoders.  Not all decoders yet support
-     this information.  This info is set each time an instruction is
-     decoded, and is only valid for the last such instruction.
-
-     To determine whether this decoder supports this information, set
-     insn_info_valid to 0, decode an instruction, then check it.  */
-
-  char insn_info_valid;		/* Branch info has been set. */
-  char branch_delay_insns;	/* How many sequential insn's will run before
-				   a branch takes effect.  (0 = normal) */
-  char data_size;		/* Size of data reference in insn, in bytes */
-  enum dis_insn_type insn_type;	/* Type of instruction */
-  bfd_vma target;		/* Target address of branch or dref, if known;
-				   zero if unknown.  */
-  bfd_vma target2;		/* Second target address for dref2 */
-
-  /* Command line options specific to the target disassembler.  */
-  char * disassembler_options;
-
-} disassemble_info;
-
-
-/* Standard disassemblers.  Disassemble one instruction at the given
-   target address.  Return number of octets processed.  */
-typedef int (*disassembler_ftype) (bfd_vma, disassemble_info *);
-
-extern int print_insn_big_mips		(bfd_vma, disassemble_info *);
-extern int print_insn_little_mips	(bfd_vma, disassemble_info *);
-extern int print_insn_i386		(bfd_vma, disassemble_info *);
-extern int print_insn_i386_att		(bfd_vma, disassemble_info *);
-extern int print_insn_i386_intel	(bfd_vma, disassemble_info *);
-extern int print_insn_ia64		(bfd_vma, disassemble_info *);
-extern int print_insn_i370		(bfd_vma, disassemble_info *);
-extern int print_insn_m68hc11		(bfd_vma, disassemble_info *);
-extern int print_insn_m68hc12		(bfd_vma, disassemble_info *);
-extern int print_insn_m68k		(bfd_vma, disassemble_info *);
-extern int print_insn_z80		(bfd_vma, disassemble_info *);
-extern int print_insn_z8001		(bfd_vma, disassemble_info *);
-extern int print_insn_z8002		(bfd_vma, disassemble_info *);
-extern int print_insn_h8300		(bfd_vma, disassemble_info *);
-extern int print_insn_h8300h		(bfd_vma, disassemble_info *);
-extern int print_insn_h8300s		(bfd_vma, disassemble_info *);
-extern int print_insn_h8500		(bfd_vma, disassemble_info *);
-extern int print_insn_alpha		(bfd_vma, disassemble_info *);
-extern int print_insn_big_arm		(bfd_vma, disassemble_info *);
-extern int print_insn_little_arm	(bfd_vma, disassemble_info *);
-extern int print_insn_sparc		(bfd_vma, disassemble_info *);
-extern int print_insn_avr		(bfd_vma, disassemble_info *);
-extern int print_insn_bfin		(bfd_vma, disassemble_info *);
-extern int print_insn_d10v		(bfd_vma, disassemble_info *);
-extern int print_insn_d30v		(bfd_vma, disassemble_info *);
-extern int print_insn_dlx 		(bfd_vma, disassemble_info *);
-extern int print_insn_fr30		(bfd_vma, disassemble_info *);
-extern int print_insn_hppa		(bfd_vma, disassemble_info *);
-extern int print_insn_i860		(bfd_vma, disassemble_info *);
-extern int print_insn_i960		(bfd_vma, disassemble_info *);
-extern int print_insn_ip2k		(bfd_vma, disassemble_info *);
-extern int print_insn_m32r		(bfd_vma, disassemble_info *);
-extern int print_insn_m88k		(bfd_vma, disassemble_info *);
-extern int print_insn_maxq_little	(bfd_vma, disassemble_info *);
-extern int print_insn_maxq_big		(bfd_vma, disassemble_info *);
-extern int print_insn_mcore		(bfd_vma, disassemble_info *);
-extern int print_insn_mmix		(bfd_vma, disassemble_info *);
-extern int print_insn_mn10200		(bfd_vma, disassemble_info *);
-extern int print_insn_mn10300		(bfd_vma, disassemble_info *);
-extern int print_insn_mt                (bfd_vma, disassemble_info *);
-extern int print_insn_msp430		(bfd_vma, disassemble_info *);
-extern int print_insn_ns32k		(bfd_vma, disassemble_info *);
-extern int print_insn_crx               (bfd_vma, disassemble_info *);
-extern int print_insn_openrisc		(bfd_vma, disassemble_info *);
-extern int print_insn_big_or32		(bfd_vma, disassemble_info *);
-extern int print_insn_little_or32	(bfd_vma, disassemble_info *);
-extern int print_insn_pdp11		(bfd_vma, disassemble_info *);
-extern int print_insn_pj		(bfd_vma, disassemble_info *);
-extern int print_insn_big_powerpc	(bfd_vma, disassemble_info *);
-extern int print_insn_little_powerpc	(bfd_vma, disassemble_info *);
-extern int print_insn_rs6000		(bfd_vma, disassemble_info *);
-extern int print_insn_s390		(bfd_vma, disassemble_info *);
-extern int print_insn_sh		(bfd_vma, disassemble_info *);
-extern int print_insn_tic30		(bfd_vma, disassemble_info *);
-extern int print_insn_tic4x		(bfd_vma, disassemble_info *);
-extern int print_insn_tic54x		(bfd_vma, disassemble_info *);
-extern int print_insn_tic80		(bfd_vma, disassemble_info *);
-extern int print_insn_v850		(bfd_vma, disassemble_info *);
-extern int print_insn_vax		(bfd_vma, disassemble_info *);
-extern int print_insn_w65		(bfd_vma, disassemble_info *);
-extern int print_insn_xstormy16		(bfd_vma, disassemble_info *);
-extern int print_insn_xtensa		(bfd_vma, disassemble_info *);
-extern int print_insn_sh64		(bfd_vma, disassemble_info *);
-extern int print_insn_sh64x_media	(bfd_vma, disassemble_info *);
-extern int print_insn_frv		(bfd_vma, disassemble_info *);
-extern int print_insn_iq2000		(bfd_vma, disassemble_info *);
-extern int print_insn_xc16x		(bfd_vma, disassemble_info *);
-extern int print_insn_m32c	(bfd_vma, disassemble_info *);
-
-extern disassembler_ftype arc_get_disassembler (void *);
-//extern disassembler_ftype cris_get_disassembler (bfd *);
-
-extern void print_mips_disassembler_options (FILE *);
-extern void print_ppc_disassembler_options (FILE *);
-extern void print_arm_disassembler_options (FILE *);
-extern void parse_arm_disassembler_option (char *);
-extern int get_arm_regname_num_options (void);
-extern int set_arm_regname_option (int);
-extern int get_arm_regnames (int, const char **, const char **, const char *const **);
-extern bfd_boolean arm_symbol_is_valid (asymbol *, struct disassemble_info *);
-
-/* Fetch the disassembler for a given BFD, if that support is available.  */
-//extern disassembler_ftype disassembler (bfd *);
-
-/* Amend the disassemble_info structure as necessary for the target architecture.
-   Should only be called after initialising the info->arch field.  */
-extern void disassemble_init_for_target (struct disassemble_info * info);
-
-/* Document any target specific options available from the disassembler.  */
-extern void disassembler_usage (FILE *);
-
-
-/* This block of definitions is for particular callers who read instructions
-   into a buffer before calling the instruction decoder.  */
-
-/* Here is a function which callers may wish to use for read_memory_func.
-   It gets bytes from a buffer.  */
-extern int buffer_read_memory
-  (bfd_vma, bfd_byte *, unsigned int, struct disassemble_info *);
-
-/* This function goes with buffer_read_memory.
-   It prints a message using info->fprintf_func and info->stream.  */
-extern void perror_memory (int, bfd_vma, struct disassemble_info *);
-
-
-/* Just print the address in hex.  This is included for completeness even
-   though both GDB and objdump provide their own (to print symbolic
-   addresses).  */
-extern void generic_print_address
-  (bfd_vma, struct disassemble_info *);
-
-/* Always true.  */
-extern int generic_symbol_at_address
-  (bfd_vma, struct disassemble_info *);
-
-/* Also always true.  */
-extern bfd_boolean generic_symbol_is_valid
-  (asymbol *, struct disassemble_info *);
-
-/* Method to initialize a disassemble_info struct.  This should be
-   called by all applications creating such a struct.  */
-extern void init_disassemble_info (struct disassemble_info *info, void *stream,
-				   fprintf_ftype fprintf_func);
-
-/* For compatibility with existing code.  */
-#define INIT_DISASSEMBLE_INFO(INFO, STREAM, FPRINTF_FUNC) \
-  init_disassemble_info (&(INFO), (STREAM), (fprintf_ftype) (FPRINTF_FUNC))
-#define INIT_DISASSEMBLE_INFO_NO_ARCH(INFO, STREAM, FPRINTF_FUNC) \
-  init_disassemble_info (&(INFO), (STREAM), (fprintf_ftype) (FPRINTF_FUNC))
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* ! defined (DIS_ASM_H) */
diff -r a1bd69b08e9e -r 485e6db28b93 tools/debugger/xenitp/ia64-asmtab.c
--- a/tools/debugger/xenitp/ia64-asmtab.c	Wed Sep 12 16:12:42 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8774 +0,0 @@
-/* This file is automatically generated by ia64-gen.  Do not edit!  */
-static const char * const ia64_strings[] = {
-  "", "0", "1", "a", "acq", "add", "addl", "addp4", "adds", "alloc", "and",
-  "andcm", "b", "bias", "br", "break", "brl", "brp", "bsw", "c", "call",
-  "cexit", "chk", "cloop", "clr", "clrrrb", "cmp", "cmp4", "cmp8xchg16",
-  "cmpxchg1", "cmpxchg2", "cmpxchg4", "cmpxchg8", "cond", "cover", "ctop",
-  "czx1", "czx2", "d", "dep", "dpnt", "dptk", "e", "epc", "eq", "excl",
-  "exit", "exp", "extr", "f", "fabs", "fadd", "famax", "famin", "fand",
-  "fandcm", "fault", "fc", "fchkf", "fclass", "fclrf", "fcmp", "fcvt",
-  "fetchadd4", "fetchadd8", "few", "fill", "flushrs", "fma", "fmax",
-  "fmerge", "fmin", "fmix", "fmpy", "fms", "fneg", "fnegabs", "fnma",
-  "fnmpy", "fnorm", "for", "fpabs", "fpack", "fpamax", "fpamin", "fpcmp",
-  "fpcvt", "fpma", "fpmax", "fpmerge", "fpmin", "fpmpy", "fpms", "fpneg",
-  "fpnegabs", "fpnma", "fpnmpy", "fprcpa", "fprsqrta", "frcpa", "frsqrta",
-  "fselect", "fsetc", "fsub", "fswap", "fsxt", "fwb", "fx", "fxor", "fxu",
-  "g", "ga", "ge", "getf", "geu", "gt", "gtu", "h", "hint", "hu", "i", "ia",
-  "imp", "invala", "itc", "itr", "l", "ld1", "ld16", "ld2", "ld4", "ld8",
-  "ldf", "ldf8", "ldfd", "ldfe", "ldfp8", "ldfpd", "ldfps", "ldfs", "le",
-  "leu", "lfetch", "loadrs", "loop", "lr", "lt", "ltu", "lu", "m", "many",
-  "mf", "mix1", "mix2", "mix4", "mov", "movl", "mux1", "mux2", "nc", "ne",
-  "neq", "nge", "ngt", "nl", "nle", "nlt", "nm", "nop", "nr", "ns", "nt1",
-  "nt2", "nta", "nz", "or", "orcm", "ord", "pack2", "pack4", "padd1",
-  "padd2", "padd4", "pavg1", "pavg2", "pavgsub1", "pavgsub2", "pcmp1",
-  "pcmp2", "pcmp4", "pmax1", "pmax2", "pmin1", "pmin2", "pmpy2", "pmpyshr2",
-  "popcnt", "pr", "probe", "psad1", "pshl2", "pshl4", "pshladd2", "pshr2",
-  "pshr4", "pshradd2", "psub1", "psub2", "psub4", "ptc", "ptr", "r", "raz",
-  "rel", "ret", "rfi", "rsm", "rum", "rw", "s", "s0", "s1", "s2", "s3",
-  "sa", "se", "setf", "shl", "shladd", "shladdp4", "shr", "shrp", "sig",
-  "spill", "spnt", "sptk", "srlz", "ssm", "sss", "st1", "st16", "st2",
-  "st4", "st8", "stf", "stf8", "stfd", "stfe", "stfs", "sub", "sum", "sxt1",
-  "sxt2", "sxt4", "sync", "tak", "tbit", "tf", "thash", "tnat", "tpa",
-  "trunc", "ttag", "u", "unc", "unord", "unpack1", "unpack2", "unpack4",
-  "uss", "uus", "uuu", "vmsw", "w", "wexit", "wtop", "x", "xchg1", "xchg2",
-  "xchg4", "xchg8", "xf", "xma", "xmpy", "xor", "xuf", "z", "zxt1", "zxt2",
-  "zxt4",
-};
-
-static const struct ia64_dependency
-dependencies[] = {
-  { "ALAT", 0, 0, 0, -1, NULL, },
-  { "AR[BSP]", 26, 0, 2, 17, NULL, },
-  { "AR[BSPSTORE]", 26, 0, 2, 18, NULL, },
-  { "AR[CCV]", 26, 0, 2, 32, NULL, },
-  { "AR[CFLG]", 26, 0, 2, 27, NULL, },
-  { "AR[CSD]", 26, 0, 2, 25, NULL, },
-  { "AR[EC]", 26, 0, 2, 66, NULL, },
-  { "AR[EFLAG]", 26, 0, 2, 24, NULL, },
-  { "AR[FCR]", 26, 0, 2, 21, NULL, },
-  { "AR[FDR]", 26, 0, 2, 30, NULL, },
-  { "AR[FIR]", 26, 0, 2, 29, NULL, },
-  { "AR[FPSR].sf0.controls", 30, 0, 2, -1, NULL, },
-  { "AR[FPSR].sf1.controls", 30, 0, 2, -1, NULL, },
-  { "AR[FPSR].sf2.controls", 30, 0, 2, -1, NULL, },
-  { "AR[FPSR].sf3.controls", 30, 0, 2, -1, NULL, },
-  { "AR[FPSR].sf0.flags", 30, 0, 2, -1, NULL, },
-  { "AR[FPSR].sf1.flags", 30, 0, 2, -1, NULL, },
-  { "AR[FPSR].sf2.flags", 30, 0, 2, -1, NULL, },
-  { "AR[FPSR].sf3.flags", 30, 0, 2, -1, NULL, },
-  { "AR[FPSR].traps", 30, 0, 2, -1, NULL, },
-  { "AR[FPSR].rv", 30, 0, 2, -1, NULL, },
-  { "AR[FSR]", 26, 0, 2, 28, NULL, },
-  { "AR[ITC]", 26, 0, 2, 44, NULL, },
-  { "AR[K%], % in 0 - 7", 1, 0, 2, -1, NULL, },
-  { "AR[LC]", 26, 0, 2, 65, NULL, },
-  { "AR[PFS]", 26, 0, 2, 64, NULL, },
-  { "AR[PFS]", 26, 0, 2, 64, NULL, },
-  { "AR[PFS]", 26, 0, 0, 64, NULL, },
-  { "AR[RNAT]", 26, 0, 2, 19, NULL, },
-  { "AR[RSC]", 26, 0, 2, 16, NULL, },
-  { "AR[SSD]", 26, 0, 2, 26, NULL, },
-  { "AR[UNAT]{%}, % in 0 - 63", 2, 0, 2, -1, NULL, },
-  { "AR%, % in 8-15, 20, 22-23, 31, 33-35, 37-39, 41-43, 45-47, 67-111", 3, 0, 0, -1, NULL, },
-  { "AR%, % in 48-63, 112-127", 4, 0, 2, -1, NULL, },
-  { "BR%, % in 0 - 7", 5, 0, 2, -1, NULL, },
-  { "BR%, % in 0 - 7", 5, 0, 0, -1, NULL, },
-  { "BR%, % in 0 - 7", 5, 0, 2, -1, NULL, },
-  { "CFM", 6, 0, 2, -1, NULL, },
-  { "CFM", 6, 0, 2, -1, NULL, },
-  { "CFM", 6, 0, 2, -1, NULL, },
-  { "CFM", 6, 0, 2, -1, NULL, },
-  { "CFM", 6, 0, 0, -1, NULL, },
-  { "CPUID#", 7, 0, 5, -1, NULL, },
-  { "CR[CMCV]", 27, 0, 3, 74, NULL, },
-  { "CR[DCR]", 27, 0, 3, 0, NULL, },
-  { "CR[EOI]", 27, 0, 7, 67, "SC Section 5.8.3.4, \"End of External Interrupt Register (EOI Ð CR67)\" on page 2:119", },
-  { "CR[GPTA]", 27, 0, 3, 9, NULL, },
-  { "CR[IFA]", 27, 0, 1, 20, NULL, },
-  { "CR[IFA]", 27, 0, 3, 20, NULL, },
-  { "CR[IFS]", 27, 0, 3, 23, NULL, },
-  { "CR[IFS]", 27, 0, 1, 23, NULL, },
-  { "CR[IFS]", 27, 0, 1, 23, NULL, },
-  { "CR[IHA]", 27, 0, 3, 25, NULL, },
-  { "CR[IIM]", 27, 0, 3, 24, NULL, },
-  { "CR[IIP]", 27, 0, 3, 19, NULL, },
-  { "CR[IIP]", 27, 0, 1, 19, NULL, },
-  { "CR[IIPA]", 27, 0, 3, 22, NULL, },
-  { "CR[IPSR]", 27, 0, 3, 16, NULL, },
-  { "CR[IPSR]", 27, 0, 1, 16, NULL, },
-  { "CR[IRR%], % in 0 - 3", 8, 0, 3, -1, NULL, },
-  { "CR[ISR]", 27, 0, 3, 17, NULL, },
-  { "CR[ITIR]", 27, 0, 3, 21, NULL, },
-  { "CR[ITIR]", 27, 0, 1, 21, NULL, },
-  { "CR[ITM]", 27, 0, 3, 1, NULL, },
-  { "CR[ITV]", 27, 0, 3, 72, NULL, },
-  { "CR[IVA]", 27, 0, 4, 2, NULL, },
-  { "CR[IVR]", 27, 0, 7, 65, "SC Section 5.8.3.2, \"External Interrupt Vector Register (IVR Ð CR65)\" on page 2:118", },
-  { "CR[LID]", 27, 0, 7, 64, "SC Section 5.8.3.1, \"Local ID (LID Ð CR64)\" on page 2:117", },
-  { "CR[LRR%], % in 0 - 1", 9, 0, 3, -1, NULL, },
-  { "CR[PMV]", 27, 0, 3, 73, NULL, },
-  { "CR[PTA]", 27, 0, 3, 8, NULL, },
-  { "CR[TPR]", 27, 0, 3, 66, NULL, },
-  { "CR[TPR]", 27, 0, 7, 66, "SC Section 5.8.3.3, \"Task Priority Register (TPR Ð CR66)\" on page 2:119", },
-  { "CR[TPR]", 27, 0, 1, 66, NULL, },
-  { "CR%, % in 3-7, 10-15, 18, 26-63, 75-79, 82-127", 10, 0, 0, -1, NULL, },
-  { "DBR#", 11, 0, 2, -1, NULL, },
-  { "DBR#", 11, 0, 3, -1, NULL, },
-  { "DTC", 0, 0, 3, -1, NULL, },
-  { "DTC", 0, 0, 2, -1, NULL, },
-  { "DTC", 0, 0, 0, -1, NULL, },
-  { "DTC", 0, 0, 2, -1, NULL, },
-  { "DTC_LIMIT*", 0, 0, 2, -1, NULL, },
-  { "DTR", 0, 0, 3, -1, NULL, },
-  { "DTR", 0, 0, 2, -1, NULL, },
-  { "DTR", 0, 0, 3, -1, NULL, },
-  { "DTR", 0, 0, 0, -1, NULL, },
-  { "DTR", 0, 0, 2, -1, NULL, },
-  { "FR%, % in 0 - 1", 12, 0, 0, -1, NULL, },
-  { "FR%, % in 2 - 127", 13, 0, 2, -1, NULL, },
-  { "FR%, % in 2 - 127", 13, 0, 0, -1, NULL, },
-  { "GR0", 14, 0, 0, -1, NULL, },
-  { "GR%, % in 1 - 127", 15, 0, 0, -1, NULL, },
-  { "GR%, % in 1 - 127", 15, 0, 2, -1, NULL, },
-  { "IBR#", 16, 0, 2, -1, NULL, },
-  { "InService*", 17, 0, 3, -1, NULL, },
-  { "InService*", 17, 0, 2, -1, NULL, },
-  { "InService*", 17, 0, 2, -1, NULL, },
-  { "IP", 0, 0, 0, -1, NULL, },
-  { "ITC", 0, 0, 4, -1, NULL, },
-  { "ITC", 0, 0, 2, -1, NULL, },
-  { "ITC", 0, 0, 0, -1, NULL, },
-  { "ITC", 0, 0, 4, -1, NULL, },
-  { "ITC", 0, 0, 2, -1, NULL, },
-  { "ITC_LIMIT*", 0, 0, 2, -1, NULL, },
-  { "ITR", 0, 0, 2, -1, NULL, },
-  { "ITR", 0, 0, 4, -1, NULL, },
-  { "ITR", 0, 0, 2, -1, NULL, },
-  { "ITR", 0, 0, 0, -1, NULL, },
-  { "ITR", 0, 0, 4, -1, NULL, },
-  { "memory", 0, 0, 0, -1, NULL, },
-  { "MSR#", 18, 0, 5, -1, NULL, },
-  { "PKR#", 19, 0, 3, -1, NULL, },
-  { "PKR#", 19, 0, 0, -1, NULL, },
-  { "PKR#", 19, 0, 2, -1, NULL, },
-  { "PKR#", 19, 0, 2, -1, NULL, },
-  { "PMC#", 20, 0, 2, -1, NULL, },
-  { "PMC#", 20, 0, 7, -1, "SC Section 7.2.1, \"Generic Performance Counter Registers\" for PMC[0].fr on page 2:150", },
-  { "PMD#", 21, 0, 2, -1, NULL, },
-  { "PR0", 0, 0, 0, -1, NULL, },
-  { "PR%, % in 1 - 15", 22, 0, 2, -1, NULL, },
-  { "PR%, % in 1 - 15", 22, 0, 2, -1, NULL, },
-  { "PR%, % in 1 - 15", 22, 0, 0, -1, NULL, },
-  { "PR%, % in 16 - 62", 23, 0, 2, -1, NULL, },
-  { "PR%, % in 16 - 62", 23, 0, 2, -1, NULL, },
-  { "PR%, % in 16 - 62", 23, 0, 0, -1, NULL, },
-  { "PR63", 24, 0, 2, -1, NULL, },
-  { "PR63", 24, 0, 2, -1, NULL, },
-  { "PR63", 24, 0, 0, -1, NULL, },
-  { "PSR.ac", 28, 0, 1, 3, NULL, },
-  { "PSR.ac", 28, 0, 3, 3, NULL, },
-  { "PSR.ac", 28, 0, 2, 3, NULL, },
-  { "PSR.ac", 28, 0, 2, 3, NULL, },
-  { "PSR.be", 28, 0, 1, 1, NULL, },
-  { "PSR.be", 28, 0, 3, 1, NULL, },
-  { "PSR.be", 28, 0, 2, 1, NULL, },
-  { "PSR.be", 28, 0, 2, 1, NULL, },
-  { "PSR.bn", 28, 0, 2, 44, NULL, },
-  { "PSR.cpl", 28, 0, 1, 32, NULL, },
-  { "PSR.cpl", 28, 0, 2, 32, NULL, },
-  { "PSR.da", 28, 0, 2, 38, NULL, },
-  { "PSR.db", 28, 0, 3, 24, NULL, },
-  { "PSR.db", 28, 0, 2, 24, NULL, },
-  { "PSR.db", 28, 0, 2, 24, NULL, },
-  { "PSR.dd", 28, 0, 2, 39, NULL, },
-  { "PSR.dfh", 28, 0, 3, 19, NULL, },
-  { "PSR.dfh", 28, 0, 2, 19, NULL, },
-  { "PSR.dfh", 28, 0, 2, 19, NULL, },
-  { "PSR.dfl", 28, 0, 3, 18, NULL, },
-  { "PSR.dfl", 28, 0, 2, 18, NULL, },
-  { "PSR.dfl", 28, 0, 2, 18, NULL, },
-  { "PSR.di", 28, 0, 3, 22, NULL, },
-  { "PSR.di", 28, 0, 2, 22, NULL, },
-  { "PSR.di", 28, 0, 2, 22, NULL, },
-  { "PSR.dt", 28, 0, 3, 17, NULL, },
-  { "PSR.dt", 28, 0, 2, 17, NULL, },
-  { "PSR.dt", 28, 0, 2, 17, NULL, },
-  { "PSR.ed", 28, 0, 2, 43, NULL, },
-  { "PSR.i", 28, 0, 2, 14, NULL, },
-  { "PSR.ia", 28, 0, 0, 14, NULL, },
-  { "PSR.ic", 28, 0, 2, 13, NULL, },
-  { "PSR.ic", 28, 0, 3, 13, NULL, },
-  { "PSR.ic", 28, 0, 2, 13, NULL, },
-  { "PSR.id", 28, 0, 0, 14, NULL, },
-  { "PSR.is", 28, 0, 0, 14, NULL, },
-  { "PSR.it", 28, 0, 2, 14, NULL, },
-  { "PSR.lp", 28, 0, 2, 25, NULL, },
-  { "PSR.lp", 28, 0, 3, 25, NULL, },
-  { "PSR.lp", 28, 0, 2, 25, NULL, },
-  { "PSR.mc", 28, 0, 2, 35, NULL, },
-  { "PSR.mfh", 28, 0, 2, 5, NULL, },
-  { "PSR.mfl", 28, 0, 2, 4, NULL, },
-  { "PSR.pk", 28, 0, 3, 15, NULL, },
-  { "PSR.pk", 28, 0, 2, 15, NULL, },
-  { "PSR.pk", 28, 0, 2, 15, NULL, },
-  { "PSR.pp", 28, 0, 2, 21, NULL, },
-  { "PSR.ri", 28, 0, 0, 41, NULL, },
-  { "PSR.rt", 28, 0, 2, 27, NULL, },
-  { "PSR.rt", 28, 0, 3, 27, NULL, },
-  { "PSR.rt", 28, 0, 2, 27, NULL, },
-  { "PSR.si", 28, 0, 2, 23, NULL, },
-  { "PSR.si", 28, 0, 3, 23, NULL, },
-  { "PSR.si", 28, 0, 2, 23, NULL, },
-  { "PSR.sp", 28, 0, 2, 20, NULL, },
-  { "PSR.sp", 28, 0, 3, 20, NULL, },
-  { "PSR.sp", 28, 0, 2, 20, NULL, },
-  { "PSR.ss", 28, 0, 2, 40, NULL, },
-  { "PSR.tb", 28, 0, 3, 26, NULL, },
-  { "PSR.tb", 28, 0, 2, 26, NULL, },
-  { "PSR.tb", 28, 0, 2, 26, NULL, },
-  { "PSR.up", 28, 0, 2, 2, NULL, },
-  { "PSR.vm", 28, 0, 1, 46, NULL, },
-  { "PSR.vm", 28, 0, 2, 46, NULL, },
-  { "RR#", 25, 0, 3, -1, NULL, },
-  { "RR#", 25, 0, 2, -1, NULL, },
-  { "RSE", 29, 0, 2, -1, NULL, },
-  { "ALAT", 0, 1, 0, -1, NULL, },
-  { "AR[BSP]", 26, 1, 2, 17, NULL, },
-  { "AR[BSPSTORE]", 26, 1, 2, 18, NULL, },
-  { "AR[CCV]", 26, 1, 2, 32, NULL, },
-  { "AR[CFLG]", 26, 1, 2, 27, NULL, },
-  { "AR[CSD]", 26, 1, 2, 25, NULL, },
-  { "AR[EC]", 26, 1, 2, 66, NULL, },
-  { "AR[EFLAG]", 26, 1, 2, 24, NULL, },
-  { "AR[FCR]", 26, 1, 2, 21, NULL, },
-  { "AR[FDR]", 26, 1, 2, 30, NULL, },
-  { "AR[FIR]", 26, 1, 2, 29, NULL, },
-  { "AR[FPSR].sf0.controls", 30, 1, 2, -1, NULL, },
-  { "AR[FPSR].sf1.controls", 30, 1, 2, -1, NULL, },
-  { "AR[FPSR].sf2.controls", 30, 1, 2, -1, NULL, },
-  { "AR[FPSR].sf3.controls", 30, 1, 2, -1, NULL, },
-  { "AR[FPSR].sf0.flags", 30, 1, 0, -1, NULL, },
-  { "AR[FPSR].sf0.flags", 30, 1, 2, -1, NULL, },
-  { "AR[FPSR].sf0.flags", 30, 1, 2, -1, NULL, },
-  { "AR[FPSR].sf1.flags", 30, 1, 0, -1, NULL, },
-  { "AR[FPSR].sf1.flags", 30, 1, 2, -1, NULL, },
-  { "AR[FPSR].sf1.flags", 30, 1, 2, -1, NULL, },
-  { "AR[FPSR].sf2.flags", 30, 1, 0, -1, NULL, },
-  { "AR[FPSR].sf2.flags", 30, 1, 2, -1, NULL, },
-  { "AR[FPSR].sf2.flags", 30, 1, 2, -1, NULL, },
-  { "AR[FPSR].sf3.flags", 30, 1, 0, -1, NULL, },
-  { "AR[FPSR].sf3.flags", 30, 1, 2, -1, NULL, },
-  { "AR[FPSR].sf3.flags", 30, 1, 2, -1, NULL, },
-  { "AR[FPSR].rv", 30, 1, 2, -1, NULL, },
-  { "AR[FPSR].traps", 30, 1, 2, -1, NULL, },
-  { "AR[FSR]", 26, 1, 2, 28, NULL, },
-  { "AR[ITC]", 26, 1, 2, 44, NULL, },
-  { "AR[K%], % in 0 - 7", 1, 1, 2, -1, NULL, },
-  { "AR[LC]", 26, 1, 2, 65, NULL, },
-  { "AR[PFS]", 26, 1, 0, 64, NULL, },
-  { "AR[PFS]", 26, 1, 2, 64, NULL, },
-  { "AR[PFS]", 26, 1, 2, 64, NULL, },
-  { "AR[RNAT]", 26, 1, 2, 19, NULL, },
-  { "AR[RSC]", 26, 1, 2, 16, NULL, },
-  { "AR[SSD]", 26, 1, 2, 26, NULL, },
-  { "AR[UNAT]{%}, % in 0 - 63", 2, 1, 2, -1, NULL, },
-  { "AR%, % in 8-15, 20, 22-23, 31, 33-35, 37-39, 41-43, 45-47, 67-111", 3, 1, 0, -1, NULL, },
-  { "AR%, % in 48 - 63, 112-127", 4, 1, 2, -1, NULL, },
-  { "BR%, % in 0 - 7", 5, 1, 2, -1, NULL, },
-  { "BR%, % in 0 - 7", 5, 1, 2, -1, NULL, },
-  { "BR%, % in 0 - 7", 5, 1, 2, -1, NULL, },
-  { "BR%, % in 0 - 7", 5, 1, 0, -1, NULL, },
-  { "CFM", 6, 1, 2, -1, NULL, },
-  { "CPUID#", 7, 1, 0, -1, NULL, },
-  { "CR[CMCV]", 27, 1, 2, 74, NULL, },
-  { "CR[DCR]", 27, 1, 2, 0, NULL, },
-  { "CR[EOI]", 27, 1, 7, 67, "SC Section 5.8.3.4, \"End of External Interrupt Register (EOI Ð CR67)\" on page 2:119", },
-  { "CR[GPTA]", 27, 1, 2, 9, NULL, },
-  { "CR[IFA]", 27, 1, 2, 20, NULL, },
-  { "CR[IFS]", 27, 1, 2, 23, NULL, },
-  { "CR[IHA]", 27, 1, 2, 25, NULL, },
-  { "CR[IIM]", 27, 1, 2, 24, NULL, },
-  { "CR[IIP]", 27, 1, 2, 19, NULL, },
-  { "CR[IIPA]", 27, 1, 2, 22, NULL, },
-  { "CR[IPSR]", 27, 1, 2, 16, NULL, },
-  { "CR[IRR%], % in 0 - 3", 8, 1, 2, -1, NULL, },
-  { "CR[ISR]", 27, 1, 2, 17, NULL, },
-  { "CR[ITIR]", 27, 1, 2, 21, NULL, },
-  { "CR[ITM]", 27, 1, 2, 1, NULL, },
-  { "CR[ITV]", 27, 1, 2, 72, NULL, },
-  { "CR[IVA]", 27, 1, 2, 2, NULL, },
-  { "CR[IVR]", 27, 1, 7, 65, "SC", },
-  { "CR[LID]", 27, 1, 7, 64, "SC", },
-  { "CR[LRR%], % in 0 - 1", 9, 1, 2, -1, NULL, },
-  { "CR[PMV]", 27, 1, 2, 73, NULL, },
-  { "CR[PTA]", 27, 1, 2, 8, NULL, },
-  { "CR[TPR]", 27, 1, 2, 66, NULL, },
-  { "CR%, % in 3-7, 10-15, 18, 26-63, 75-79, 82-127", 10, 1, 0, -1, NULL, },
-  { "DBR#", 11, 1, 2, -1, NULL, },
-  { "DTC", 0, 1, 0, -1, NULL, },
-  { "DTC", 0, 1, 2, -1, NULL, },
-  { "DTC", 0, 1, 2, -1, NULL, },
-  { "DTC_LIMIT*", 0, 1, 2, -1, NULL, },
-  { "DTR", 0, 1, 2, -1, NULL, },
-  { "DTR", 0, 1, 2, -1, NULL, },
-  { "DTR", 0, 1, 2, -1, NULL, },
-  { "DTR", 0, 1, 0, -1, NULL, },
-  { "FR%, % in 0 - 1", 12, 1, 0, -1, NULL, },
-  { "FR%, % in 2 - 127", 13, 1, 2, -1, NULL, },
-  { "GR0", 14, 1, 0, -1, NULL, },
-  { "GR%, % in 1 - 127", 15, 1, 2, -1, NULL, },
-  { "IBR#", 16, 1, 2, -1, NULL, },
-  { "InService*", 17, 1, 7, -1, "SC", },
-  { "IP", 0, 1, 0, -1, NULL, },
-  { "ITC", 0, 1, 0, -1, NULL, },
-  { "ITC", 0, 1, 2, -1, NULL, },
-  { "ITC", 0, 1, 2, -1, NULL, },
-  { "ITR", 0, 1, 2, -1, NULL, },
-  { "ITR", 0, 1, 2, -1, NULL, },
-  { "ITR", 0, 1, 0, -1, NULL, },
-  { "memory", 0, 1, 0, -1, NULL, },
-  { "MSR#", 18, 1, 7, -1, "SC", },
-  { "PKR#", 19, 1, 0, -1, NULL, },
-  { "PKR#", 19, 1, 0, -1, NULL, },
-  { "PKR#", 19, 1, 2, -1, NULL, },
-  { "PMC#", 20, 1, 2, -1, NULL, },
-  { "PMD#", 21, 1, 2, -1, NULL, },
-  { "PR0", 0, 1, 0, -1, NULL, },
-  { "PR%, % in 1 - 15", 22, 1, 0, -1, NULL, },
-  { "PR%, % in 1 - 15", 22, 1, 0, -1, NULL, },
-  { "PR%, % in 1 - 15", 22, 1, 2, -1, NULL, },
-  { "PR%, % in 1 - 15", 22, 1, 2, -1, NULL, },
-  { "PR%, % in 16 - 62", 23, 1, 0, -1, NULL, },
-  { "PR%, % in 16 - 62", 23, 1, 0, -1, NULL, },
-  { "PR%, % in 16 - 62", 23, 1, 2, -1, NULL, },
-  { "PR%, % in 16 - 62", 23, 1, 2, -1, NULL, },
-  { "PR63", 24, 1, 0, -1, NULL, },
-  { "PR63", 24, 1, 0, -1, NULL, },
-  { "PR63", 24, 1, 2, -1, NULL, },
-  { "PR63", 24, 1, 2, -1, NULL, },
-  { "PSR.ac", 28, 1, 2, 3, NULL, },
-  { "PSR.be", 28, 1, 2, 1, NULL, },
-  { "PSR.bn", 28, 1, 2, 44, NULL, },
-  { "PSR.cpl", 28, 1, 2, 32, NULL, },
-  { "PSR.da", 28, 1, 2, 38, NULL, },
-  { "PSR.db", 28, 1, 2, 24, NULL, },
-  { "PSR.dd", 28, 1, 2, 39, NULL, },
-  { "PSR.dfh", 28, 1, 2, 19, NULL, },
-  { "PSR.dfl", 28, 1, 2, 18, NULL, },
-  { "PSR.di", 28, 1, 2, 22, NULL, },
-  { "PSR.dt", 28, 1, 2, 17, NULL, },
-  { "PSR.ed", 28, 1, 2, 43, NULL, },
-  { "PSR.i", 28, 1, 2, 14, NULL, },
-  { "PSR.ia", 28, 1, 2, 14, NULL, },
-  { "PSR.ic", 28, 1, 2, 13, NULL, },
-  { "PSR.id", 28, 1, 2, 14, NULL, },
-  { "PSR.is", 28, 1, 2, 14, NULL, },
-  { "PSR.it", 28, 1, 2, 14, NULL, },
-  { "PSR.lp", 28, 1, 2, 25, NULL, },
-  { "PSR.mc", 28, 1, 2, 35, NULL, },
-  { "PSR.mfh", 28, 1, 0, 5, NULL, },
-  { "PSR.mfh", 28, 1, 2, 5, NULL, },
-  { "PSR.mfh", 28, 1, 2, 5, NULL, },
-  { "PSR.mfl", 28, 1, 0, 4, NULL, },
-  { "PSR.mfl", 28, 1, 2, 4, NULL, },
-  { "PSR.mfl", 28, 1, 2, 4, NULL, },
-  { "PSR.pk", 28, 1, 2, 15, NULL, },
-  { "PSR.pp", 28, 1, 2, 21, NULL, },
-  { "PSR.ri", 28, 1, 2, 41, NULL, },
-  { "PSR.rt", 28, 1, 2, 27, NULL, },
-  { "PSR.si", 28, 1, 2, 23, NULL, },
-  { "PSR.sp", 28, 1, 2, 20, NULL, },
-  { "PSR.ss", 28, 1, 2, 40, NULL, },
-  { "PSR.tb", 28, 1, 2, 26, NULL, },
-  { "PSR.up", 28, 1, 2, 2, NULL, },
-  { "PSR.vm", 28, 1, 2, 46, NULL, },
-  { "RR#", 25, 1, 2, -1, NULL, },
-  { "RSE", 29, 1, 2, -1, NULL, },
-  { "PR63", 24, 2, 6, -1, NULL, },
-};
-
-static const unsigned short dep0[] = {
-  97, 282, 2140, 2327, 
-};
-
-static const unsigned short dep1[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 2138, 2139, 2140, 2166, 2167, 2170, 2173, 
-  2327, 4135, 20616, 
-};
-
-static const unsigned short dep2[] = {
-  97, 282, 2166, 2167, 2169, 2170, 2172, 2173, 2175, 2344, 2347, 2348, 2351, 
-  2352, 2355, 2356, 
-};
-
-static const unsigned short dep3[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 2138, 2139, 2140, 2166, 2167, 2170, 2173, 
-  2344, 2347, 2348, 2351, 2352, 2355, 2356, 4135, 20616, 
-};
-
-static const unsigned short dep4[] = {
-  97, 282, 22646, 22647, 22649, 22650, 22652, 22653, 22655, 22824, 22827, 22828, 
-  22831, 22832, 22835, 22836, 
-};
-
-static const unsigned short dep5[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 2138, 2139, 2140, 2166, 2167, 2170, 2173, 
-  4135, 20616, 22824, 22827, 22828, 22831, 22832, 22835, 22836, 
-};
-
-static const unsigned short dep6[] = {
-  97, 282, 2166, 2167, 2169, 2170, 2172, 2173, 2175, 2344, 2345, 2347, 2349, 
-  2351, 2353, 2355, 
-};
-
-static const unsigned short dep7[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 2138, 2139, 2140, 2166, 2167, 2170, 2173, 
-  2344, 2345, 2348, 2349, 2352, 2353, 2356, 4135, 20616, 
-};
-
-static const unsigned short dep8[] = {
-  97, 282, 2166, 2167, 2169, 2170, 2172, 2173, 2175, 2344, 2346, 2348, 2350, 
-  2352, 2354, 2356, 
-};
-
-static const unsigned short dep9[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 2138, 2139, 2140, 2166, 2167, 2170, 2173, 
-  2344, 2346, 2347, 2350, 2351, 2354, 2355, 4135, 20616, 
-};
-
-static const unsigned short dep10[] = {
-  97, 282, 2166, 2167, 2169, 2170, 2172, 2173, 2175, 2344, 2345, 2346, 2347, 
-  2348, 2349, 2350, 2351, 2352, 2353, 2354, 2355, 2356, 
-};
-
-static const unsigned short dep11[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 2138, 2139, 2140, 2166, 2167, 2170, 2173, 
-  2344, 2345, 2346, 2347, 2348, 2349, 2350, 2351, 2352, 2353, 2354, 2355, 2356, 
-  4135, 20616, 
-};
-
-static const unsigned short dep12[] = {
-  97, 282, 2395, 
-};
-
-static const unsigned short dep13[] = {
-  40, 41, 97, 158, 162, 164, 175, 185, 186, 188, 282, 2082, 2083, 2166, 2168, 
-  2169, 2171, 2172, 2174, 2175, 4135, 
-};
-
-static const unsigned short dep14[] = {
-  97, 163, 282, 325, 2395, 28866, 29018, 
-};
-
-static const unsigned short dep15[] = {
-  1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 
-  22, 23, 24, 25, 26, 28, 29, 30, 31, 32, 33, 40, 41, 97, 150, 152, 158, 162, 
-  164, 175, 185, 186, 188, 282, 325, 2082, 2083, 2166, 2168, 2169, 2171, 2172, 
-  2174, 2175, 4135, 28866, 29018, 
-};
-
-static const unsigned short dep16[] = {
-  1, 6, 40, 97, 137, 196, 201, 241, 282, 312, 2395, 28866, 29018, 
-};
-
-static const unsigned short dep17[] = {
-  1, 25, 27, 38, 40, 41, 97, 158, 162, 164, 166, 167, 175, 185, 186, 188, 196, 
-  201, 241, 282, 312, 2082, 2083, 2166, 2168, 2169, 2171, 2172, 2174, 2175, 
-  4135, 28866, 29018, 
-};
-
-static const unsigned short dep18[] = {
-  1, 40, 51, 97, 196, 241, 248, 282, 28866, 29018, 
-};
-
-static const unsigned short dep19[] = {
-  1, 38, 40, 41, 97, 158, 160, 161, 162, 175, 185, 190, 191, 196, 241, 248, 
-  282, 4135, 28866, 29018, 
-};
-
-static const unsigned short dep20[] = {
-  40, 97, 241, 282, 
-};
-
-static const unsigned short dep21[] = {
-  97, 158, 162, 175, 185, 241, 282, 
-};
-
-static const unsigned short dep22[] = {
-  1, 40, 97, 131, 135, 136, 138, 139, 142, 143, 146, 149, 152, 155, 156, 157, 
-  158, 161, 162, 163, 164, 167, 168, 169, 170, 173, 174, 175, 178, 181, 184, 
-  185, 188, 189, 191, 196, 241, 282, 309, 310, 311, 312, 313, 314, 315, 316, 
-  317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 330, 331, 333, 
-  334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 28866, 29018, 
-};
-
-static const unsigned short dep23[] = {
-  1, 38, 40, 41, 50, 51, 55, 58, 73, 97, 137, 138, 158, 162, 175, 185, 190, 
-  191, 196, 241, 282, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 
-  320, 321, 322, 323, 324, 325, 326, 327, 328, 330, 331, 333, 334, 335, 336, 
-  337, 338, 339, 340, 341, 342, 343, 344, 4135, 28866, 29018, 
-};
-
-static const unsigned short dep24[] = {
-  97, 136, 282, 311, 
-};
-
-static const unsigned short dep25[] = {
-  97, 137, 138, 158, 162, 175, 185, 190, 191, 282, 311, 
-};
-
-static const unsigned short dep26[] = {
-  97, 137, 282, 312, 
-};
-
-static const unsigned short dep27[] = {
-  25, 26, 97, 98, 101, 105, 108, 137, 138, 158, 162, 164, 175, 185, 282, 312, 
-  
-};
-
-static const unsigned short dep28[] = {
-  97, 190, 282, 344, 
-};
-
-static const unsigned short dep29[] = {
-  97, 98, 101, 105, 108, 137, 138, 158, 162, 164, 175, 185, 282, 344, 
-};
-
-static const unsigned short dep30[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 2166, 2168, 2169, 2171, 2172, 2174, 2175, 
-  4135, 
-};
-
-static const unsigned short dep31[] = {
-  1, 25, 40, 97, 196, 228, 229, 241, 282, 2082, 2285, 2288, 2395, 28866, 29018, 
-  
-};
-
-static const unsigned short dep32[] = {
-  1, 6, 38, 40, 41, 97, 137, 138, 158, 162, 164, 175, 185, 186, 188, 196, 228, 
-  230, 241, 282, 2082, 2083, 2166, 2168, 2169, 2171, 2172, 2174, 2175, 2286, 
-  2288, 4135, 28866, 29018, 
-};
-
-static const unsigned short dep33[] = {
-  97, 282, 
-};
-
-static const unsigned short dep34[] = {
-  97, 158, 162, 175, 185, 282, 2082, 2084, 
-};
-
-static const unsigned short dep35[] = {
-  40, 41, 97, 158, 162, 164, 175, 185, 186, 188, 282, 2166, 2168, 2169, 2171, 
-  2172, 2174, 2175, 4135, 
-};
-
-static const unsigned short dep36[] = {
-  6, 37, 38, 39, 97, 125, 126, 201, 241, 282, 307, 308, 2395, 
-};
-
-static const unsigned short dep37[] = {
-  6, 37, 40, 41, 97, 158, 162, 164, 175, 185, 186, 188, 201, 241, 282, 307, 
-  308, 347, 2166, 2168, 2169, 2171, 2172, 2174, 2175, 4135, 
-};
-
-static const unsigned short dep38[] = {
-  24, 97, 227, 282, 2395, 
-};
-
-static const unsigned short dep39[] = {
-  24, 40, 41, 97, 158, 162, 164, 175, 185, 186, 188, 227, 282, 2166, 2168, 2169, 
-  2171, 2172, 2174, 2175, 4135, 
-};
-
-static const unsigned short dep40[] = {
-  6, 24, 37, 38, 39, 97, 125, 126, 201, 227, 241, 282, 307, 308, 2395, 
-};
-
-static const unsigned short dep41[] = {
-  6, 24, 37, 40, 41, 97, 158, 162, 164, 175, 185, 186, 188, 201, 227, 241, 282, 
-  307, 308, 347, 2166, 2168, 2169, 2171, 2172, 2174, 2175, 4135, 
-};
-
-static const unsigned short dep42[] = {
-  1, 6, 38, 40, 41, 97, 137, 138, 158, 162, 164, 175, 185, 186, 188, 196, 228, 
-  230, 241, 282, 2166, 2168, 2169, 2171, 2172, 2174, 2175, 2286, 2288, 4135, 
-  28866, 29018, 
-};
-
-static const unsigned short dep43[] = {
-  97, 158, 162, 175, 185, 282, 
-};
-
-static const unsigned short dep44[] = {
-  15, 97, 210, 211, 282, 2136, 2325, 18601, 18602, 18761, 18762, 18764, 18765, 
-  22646, 22647, 22648, 22650, 22651, 22653, 22654, 22824, 22827, 22828, 22831, 
-  22832, 22835, 22836, 
-};
-
-static const unsigned short dep45[] = {
-  11, 19, 20, 40, 41, 97, 158, 162, 175, 185, 210, 212, 282, 2135, 2136, 2137, 
-  2166, 2167, 2170, 2173, 2325, 4135, 16528, 16530, 16531, 16533, 18761, 18763, 
-  18764, 18766, 22824, 22827, 22828, 22831, 22832, 22835, 22836, 
-};
-
-static const unsigned short dep46[] = {
-  15, 16, 17, 18, 97, 210, 211, 213, 214, 216, 217, 219, 220, 282, 2136, 2325, 
-  18601, 18602, 18761, 18762, 18764, 18765, 22646, 22647, 22648, 22650, 22651, 
-  22653, 22654, 22824, 22827, 22828, 22831, 22832, 22835, 22836, 
-};
-
-static const unsigned short dep47[] = {
-  11, 12, 13, 14, 19, 20, 40, 41, 97, 158, 162, 175, 185, 210, 212, 213, 215, 
-  216, 218, 219, 221, 282, 2135, 2136, 2137, 2166, 2167, 2170, 2173, 2325, 4135, 
-  16528, 16530, 16531, 16533, 18761, 18763, 18764, 18766, 22824, 22827, 22828, 
-  22831, 22832, 22835, 22836, 
-};
-
-static const unsigned short dep48[] = {
-  16, 97, 213, 214, 282, 2136, 2325, 18601, 18602, 18761, 18762, 18764, 18765, 
-  22646, 22647, 22648, 22650, 22651, 22653, 22654, 22824, 22827, 22828, 22831, 
-  22832, 22835, 22836, 
-};
-
-static const unsigned short dep49[] = {
-  12, 19, 20, 40, 41, 97, 158, 162, 175, 185, 213, 215, 282, 2135, 2136, 2137, 
-  2166, 2167, 2170, 2173, 2325, 4135, 16528, 16530, 16531, 16533, 18761, 18763, 
-  18764, 18766, 22824, 22827, 22828, 22831, 22832, 22835, 22836, 
-};
-
-static const unsigned short dep50[] = {
-  17, 97, 216, 217, 282, 2136, 2325, 18601, 18602, 18761, 18762, 18764, 18765, 
-  22646, 22647, 22648, 22650, 22651, 22653, 22654, 22824, 22827, 22828, 22831, 
-  22832, 22835, 22836, 
-};
-
-static const unsigned short dep51[] = {
-  13, 19, 20, 40, 41, 97, 158, 162, 175, 185, 216, 218, 282, 2135, 2136, 2137, 
-  2166, 2167, 2170, 2173, 2325, 4135, 16528, 16530, 16531, 16533, 18761, 18763, 
-  18764, 18766, 22824, 22827, 22828, 22831, 22832, 22835, 22836, 
-};
-
-static const unsigned short dep52[] = {
-  18, 97, 219, 220, 282, 2136, 2325, 18601, 18602, 18761, 18762, 18764, 18765, 
-  22646, 22647, 22648, 22650, 22651, 22653, 22654, 22824, 22827, 22828, 22831, 
-  22832, 22835, 22836, 
-};
-
-static const unsigned short dep53[] = {
-  14, 19, 20, 40, 41, 97, 158, 162, 175, 185, 219, 221, 282, 2135, 2136, 2137, 
-  2166, 2167, 2170, 2173, 2325, 4135, 16528, 16530, 16531, 16533, 18761, 18763, 
-  18764, 18766, 22824, 22827, 22828, 22831, 22832, 22835, 22836, 
-};
-
-static const unsigned short dep54[] = {
-  15, 97, 210, 211, 282, 2136, 2325, 18601, 18602, 18761, 18762, 18764, 18765, 
-  
-};
-
-static const unsigned short dep55[] = {
-  11, 19, 20, 40, 41, 97, 158, 162, 175, 185, 210, 212, 282, 2135, 2136, 2137, 
-  2166, 2167, 2170, 2173, 2325, 4135, 16528, 16530, 16531, 16533, 18761, 18763, 
-  18764, 18766, 
-};
-
-static const unsigned short dep56[] = {
-  15, 16, 17, 18, 97, 210, 211, 213, 214, 216, 217, 219, 220, 282, 2136, 2325, 
-  18601, 18602, 18761, 18762, 18764, 18765, 
-};
-
-static const unsigned short dep57[] = {
-  11, 12, 13, 14, 19, 20, 40, 41, 97, 158, 162, 175, 185, 210, 212, 213, 215, 
-  216, 218, 219, 221, 282, 2135, 2136, 2137, 2166, 2167, 2170, 2173, 2325, 4135, 
-  16528, 16530, 16531, 16533, 18761, 18763, 18764, 18766, 
-};
-
-static const unsigned short dep58[] = {
-  16, 97, 213, 214, 282, 2136, 2325, 18601, 18602, 18761, 18762, 18764, 18765, 
-  
-};
-
-static const unsigned short dep59[] = {
-  12, 19, 20, 40, 41, 97, 158, 162, 175, 185, 213, 215, 282, 2135, 2136, 2137, 
-  2166, 2167, 2170, 2173, 2325, 4135, 16528, 16530, 16531, 16533, 18761, 18763, 
-  18764, 18766, 
-};
-
-static const unsigned short dep60[] = {
-  17, 97, 216, 217, 282, 2136, 2325, 18601, 18602, 18761, 18762, 18764, 18765, 
-  
-};
-
-static const unsigned short dep61[] = {
-  13, 19, 20, 40, 41, 97, 158, 162, 175, 185, 216, 218, 282, 2135, 2136, 2137, 
-  2166, 2167, 2170, 2173, 2325, 4135, 16528, 16530, 16531, 16533, 18761, 18763, 
-  18764, 18766, 
-};
-
-static const unsigned short dep62[] = {
-  18, 97, 219, 220, 282, 2136, 2325, 18601, 18602, 18761, 18762, 18764, 18765, 
-  
-};
-
-static const unsigned short dep63[] = {
-  14, 19, 20, 40, 41, 97, 158, 162, 175, 185, 219, 221, 282, 2135, 2136, 2137, 
-  2166, 2167, 2170, 2173, 2325, 4135, 16528, 16530, 16531, 16533, 18761, 18763, 
-  18764, 18766, 
-};
-
-static const unsigned short dep64[] = {
-  97, 282, 2136, 2325, 18601, 18602, 18761, 18762, 18764, 18765, 
-};
-
-static const unsigned short dep65[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 2135, 2136, 2137, 2166, 2167, 2170, 2173, 
-  2325, 4135, 16528, 16530, 16531, 16533, 18761, 18763, 18764, 18766, 
-};
-
-static const unsigned short dep66[] = {
-  11, 97, 206, 282, 
-};
-
-static const unsigned short dep67[] = {
-  11, 40, 41, 97, 158, 162, 175, 185, 206, 282, 2166, 2167, 2170, 2173, 4135, 
-  
-};
-
-static const unsigned short dep68[] = {
-  11, 40, 41, 97, 158, 162, 175, 185, 282, 2166, 2167, 2170, 2173, 4135, 
-};
-
-static const unsigned short dep69[] = {
-  12, 97, 207, 282, 
-};
-
-static const unsigned short dep70[] = {
-  11, 40, 41, 97, 158, 162, 175, 185, 207, 282, 2166, 2167, 2170, 2173, 4135, 
-  
-};
-
-static const unsigned short dep71[] = {
-  13, 97, 208, 282, 
-};
-
-static const unsigned short dep72[] = {
-  11, 40, 41, 97, 158, 162, 175, 185, 208, 282, 2166, 2167, 2170, 2173, 4135, 
-  
-};
-
-static const unsigned short dep73[] = {
-  14, 97, 209, 282, 
-};
-
-static const unsigned short dep74[] = {
-  11, 40, 41, 97, 158, 162, 175, 185, 209, 282, 2166, 2167, 2170, 2173, 4135, 
-  
-};
-
-static const unsigned short dep75[] = {
-  15, 97, 211, 212, 282, 
-};
-
-static const unsigned short dep76[] = {
-  40, 41, 97, 158, 162, 175, 185, 211, 212, 282, 2166, 2167, 2170, 2173, 4135, 
-  
-};
-
-static const unsigned short dep77[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 2166, 2167, 2170, 2173, 4135, 
-};
-
-static const unsigned short dep78[] = {
-  16, 97, 214, 215, 282, 
-};
-
-static const unsigned short dep79[] = {
-  40, 41, 97, 158, 162, 175, 185, 214, 215, 282, 2166, 2167, 2170, 2173, 4135, 
-  
-};
-
-static const unsigned short dep80[] = {
-  17, 97, 217, 218, 282, 
-};
-
-static const unsigned short dep81[] = {
-  40, 41, 97, 158, 162, 175, 185, 217, 218, 282, 2166, 2167, 2170, 2173, 4135, 
-  
-};
-
-static const unsigned short dep82[] = {
-  18, 97, 220, 221, 282, 
-};
-
-static const unsigned short dep83[] = {
-  40, 41, 97, 158, 162, 175, 185, 220, 221, 282, 2166, 2167, 2170, 2173, 4135, 
-  
-};
-
-static const unsigned short dep84[] = {
-  15, 19, 20, 40, 41, 97, 158, 162, 164, 175, 185, 186, 188, 282, 2166, 2167, 
-  2170, 2173, 4135, 
-};
-
-static const unsigned short dep85[] = {
-  15, 16, 19, 20, 40, 41, 97, 158, 162, 164, 175, 185, 186, 188, 282, 2166, 
-  2167, 2170, 2173, 4135, 
-};
-
-static const unsigned short dep86[] = {
-  15, 17, 19, 20, 40, 41, 97, 158, 162, 164, 175, 185, 186, 188, 282, 2166, 
-  2167, 2170, 2173, 4135, 
-};
-
-static const unsigned short dep87[] = {
-  15, 18, 19, 20, 40, 41, 97, 158, 162, 164, 175, 185, 186, 188, 282, 2166, 
-  2167, 2170, 2173, 4135, 
-};
-
-static const unsigned short dep88[] = {
-  15, 97, 210, 211, 282, 
-};
-
-static const unsigned short dep89[] = {
-  11, 19, 20, 40, 41, 97, 158, 162, 175, 185, 210, 212, 282, 2166, 2167, 2170, 
-  2173, 4135, 
-};
-
-static const unsigned short dep90[] = {
-  15, 16, 17, 18, 97, 210, 211, 213, 214, 216, 217, 219, 220, 282, 
-};
-
-static const unsigned short dep91[] = {
-  11, 12, 13, 14, 19, 20, 40, 41, 97, 158, 162, 175, 185, 210, 212, 213, 215, 
-  216, 218, 219, 221, 282, 2166, 2167, 2170, 2173, 4135, 
-};
-
-static const unsigned short dep92[] = {
-  16, 97, 213, 214, 282, 
-};
-
-static const unsigned short dep93[] = {
-  12, 19, 20, 40, 41, 97, 158, 162, 175, 185, 213, 215, 282, 2166, 2167, 2170, 
-  2173, 4135, 
-};
-
-static const unsigned short dep94[] = {
-  17, 97, 216, 217, 282, 
-};
-
-static const unsigned short dep95[] = {
-  13, 19, 20, 40, 41, 97, 158, 162, 175, 185, 216, 218, 282, 2166, 2167, 2170, 
-  2173, 4135, 
-};
-
-static const unsigned short dep96[] = {
-  18, 97, 219, 220, 282, 
-};
-
-static const unsigned short dep97[] = {
-  14, 19, 20, 40, 41, 97, 158, 162, 175, 185, 219, 221, 282, 2166, 2167, 2170, 
-  2173, 4135, 
-};
-
-static const unsigned short dep98[] = {
-  15, 97, 210, 211, 282, 2166, 2167, 2168, 2170, 2171, 2173, 2174, 2344, 2347, 
-  2348, 2351, 2352, 2355, 2356, 
-};
-
-static const unsigned short dep99[] = {
-  11, 19, 20, 40, 41, 97, 158, 162, 175, 185, 210, 212, 282, 2135, 2136, 2137, 
-  2166, 2167, 2170, 2173, 2344, 2347, 2348, 2351, 2352, 2355, 2356, 4135, 16528, 
-  16530, 16531, 16533, 
-};
-
-static const unsigned short dep100[] = {
-  15, 16, 17, 18, 97, 210, 211, 213, 214, 216, 217, 219, 220, 282, 2166, 2167, 
-  2168, 2170, 2171, 2173, 2174, 2344, 2347, 2348, 2351, 2352, 2355, 2356, 
-};
-
-static const unsigned short dep101[] = {
-  11, 12, 13, 14, 19, 20, 40, 41, 97, 158, 162, 175, 185, 210, 212, 213, 215, 
-  216, 218, 219, 221, 282, 2135, 2136, 2137, 2166, 2167, 2170, 2173, 2344, 2347, 
-  2348, 2351, 2352, 2355, 2356, 4135, 16528, 16530, 16531, 16533, 
-};
-
-static const unsigned short dep102[] = {
-  16, 97, 213, 214, 282, 2166, 2167, 2168, 2170, 2171, 2173, 2174, 2344, 2347, 
-  2348, 2351, 2352, 2355, 2356, 
-};
-
-static const unsigned short dep103[] = {
-  12, 19, 20, 40, 41, 97, 158, 162, 175, 185, 213, 215, 282, 2135, 2136, 2137, 
-  2166, 2167, 2170, 2173, 2344, 2347, 2348, 2351, 2352, 2355, 2356, 4135, 16528, 
-  16530, 16531, 16533, 
-};
-
-static const unsigned short dep104[] = {
-  17, 97, 216, 217, 282, 2166, 2167, 2168, 2170, 2171, 2173, 2174, 2344, 2347, 
-  2348, 2351, 2352, 2355, 2356, 
-};
-
-static const unsigned short dep105[] = {
-  13, 19, 20, 40, 41, 97, 158, 162, 175, 185, 216, 218, 282, 2135, 2136, 2137, 
-  2166, 2167, 2170, 2173, 2344, 2347, 2348, 2351, 2352, 2355, 2356, 4135, 16528, 
-  16530, 16531, 16533, 
-};
-
-static const unsigned short dep106[] = {
-  18, 97, 219, 220, 282, 2166, 2167, 2168, 2170, 2171, 2173, 2174, 2344, 2347, 
-  2348, 2351, 2352, 2355, 2356, 
-};
-
-static const unsigned short dep107[] = {
-  14, 19, 20, 40, 41, 97, 158, 162, 175, 185, 219, 221, 282, 2135, 2136, 2137, 
-  2166, 2167, 2170, 2173, 2344, 2347, 2348, 2351, 2352, 2355, 2356, 4135, 16528, 
-  16530, 16531, 16533, 
-};
-
-static const unsigned short dep108[] = {
-  15, 97, 210, 211, 282, 22646, 22647, 22648, 22650, 22651, 22653, 22654, 22824, 
-  22827, 22828, 22831, 22832, 22835, 22836, 
-};
-
-static const unsigned short dep109[] = {
-  11, 19, 20, 40, 41, 97, 158, 162, 175, 185, 210, 212, 282, 2135, 2136, 2137, 
-  2166, 2167, 2170, 2173, 4135, 16528, 16530, 16531, 16533, 22824, 22827, 22828, 
-  22831, 22832, 22835, 22836, 
-};
-
-static const unsigned short dep110[] = {
-  15, 16, 17, 18, 97, 210, 211, 213, 214, 216, 217, 219, 220, 282, 22646, 22647, 
-  22648, 22650, 22651, 22653, 22654, 22824, 22827, 22828, 22831, 22832, 22835, 
-  22836, 
-};
-
-static const unsigned short dep111[] = {
-  11, 12, 13, 14, 19, 20, 40, 41, 97, 158, 162, 175, 185, 210, 212, 213, 215, 
-  216, 218, 219, 221, 282, 2135, 2136, 2137, 2166, 2167, 2170, 2173, 4135, 16528, 
-  16530, 16531, 16533, 22824, 22827, 22828, 22831, 22832, 22835, 22836, 
-};
-
-static const unsigned short dep112[] = {
-  16, 97, 213, 214, 282, 22646, 22647, 22648, 22650, 22651, 22653, 22654, 22824, 
-  22827, 22828, 22831, 22832, 22835, 22836, 
-};
-
-static const unsigned short dep113[] = {
-  12, 19, 20, 40, 41, 97, 158, 162, 175, 185, 213, 215, 282, 2135, 2136, 2137, 
-  2166, 2167, 2170, 2173, 4135, 16528, 16530, 16531, 16533, 22824, 22827, 22828, 
-  22831, 22832, 22835, 22836, 
-};
-
-static const unsigned short dep114[] = {
-  17, 97, 216, 217, 282, 22646, 22647, 22648, 22650, 22651, 22653, 22654, 22824, 
-  22827, 22828, 22831, 22832, 22835, 22836, 
-};
-
-static const unsigned short dep115[] = {
-  13, 19, 20, 40, 41, 97, 158, 162, 175, 185, 216, 218, 282, 2135, 2136, 2137, 
-  2166, 2167, 2170, 2173, 4135, 16528, 16530, 16531, 16533, 22824, 22827, 22828, 
-  22831, 22832, 22835, 22836, 
-};
-
-static const unsigned short dep116[] = {
-  18, 97, 219, 220, 282, 22646, 22647, 22648, 22650, 22651, 22653, 22654, 22824, 
-  22827, 22828, 22831, 22832, 22835, 22836, 
-};
-
-static const unsigned short dep117[] = {
-  14, 19, 20, 40, 41, 97, 158, 162, 175, 185, 219, 221, 282, 2135, 2136, 2137, 
-  2166, 2167, 2170, 2173, 4135, 16528, 16530, 16531, 16533, 22824, 22827, 22828, 
-  22831, 22832, 22835, 22836, 
-};
-
-static const unsigned short dep118[] = {
-  97, 282, 2166, 2167, 2168, 2170, 2171, 2173, 2174, 2344, 2347, 2348, 2351, 
-  2352, 2355, 2356, 
-};
-
-static const unsigned short dep119[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 2135, 2136, 2137, 2166, 2167, 2170, 2173, 
-  2344, 2347, 2348, 2351, 2352, 2355, 2356, 4135, 16528, 16530, 16531, 16533, 
-  
-};
-
-static const unsigned short dep120[] = {
-  97, 282, 22646, 22647, 22648, 22650, 22651, 22653, 22654, 22824, 22827, 22828, 
-  22831, 22832, 22835, 22836, 
-};
-
-static const unsigned short dep121[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 2135, 2136, 2137, 2166, 2167, 2170, 2173, 
-  4135, 16528, 16530, 16531, 16533, 22824, 22827, 22828, 22831, 22832, 22835, 
-  22836, 
-};
-
-static const unsigned short dep122[] = {
-  19, 20, 40, 41, 97, 158, 162, 175, 185, 282, 2135, 2136, 2137, 2166, 2167, 
-  2170, 2173, 2325, 4135, 16528, 16530, 16531, 16533, 18761, 18763, 18764, 18766, 
-  
-};
-
-static const unsigned short dep123[] = {
-  40, 41, 97, 158, 162, 164, 175, 185, 186, 188, 282, 2138, 2139, 2140, 2166, 
-  2167, 2170, 2173, 4135, 20616, 
-};
-
-static const unsigned short dep124[] = {
-  97, 282, 2083, 2084, 2286, 2287, 
-};
-
-static const unsigned short dep125[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 2138, 2139, 2140, 2166, 2167, 2170, 2173, 
-  2285, 2287, 4135, 20616, 
-};
-
-static const unsigned short dep126[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 2082, 2084, 2166, 2167, 2170, 2173, 2327, 
-  4135, 20616, 
-};
-
-static const unsigned short dep127[] = {
-  97, 282, 14455, 14457, 14458, 14460, 14461, 14463, 14635, 14636, 14639, 14640, 
-  14643, 14644, 
-};
-
-static const unsigned short dep128[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 2138, 2139, 2140, 4135, 14635, 14636, 
-  14639, 14640, 14643, 14644, 20616, 24694, 24695, 24698, 24701, 
-};
-
-static const unsigned short dep129[] = {
-  97, 122, 124, 125, 127, 282, 303, 304, 307, 308, 
-};
-
-static const unsigned short dep130[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 303, 304, 307, 308, 4135, 24694, 24695, 
-  24698, 24701, 
-};
-
-static const unsigned short dep131[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 2166, 2167, 2170, 2173, 2327, 4135, 20616, 
-  
-};
-
-static const unsigned short dep132[] = {
-  40, 41, 97, 119, 122, 125, 158, 162, 175, 185, 282, 2327, 4135, 20616, 24694, 
-  
-};
-
-static const unsigned short dep133[] = {
-  6, 24, 26, 27, 97, 201, 227, 230, 282, 2081, 2284, 
-};
-
-static const unsigned short dep134[] = {
-  40, 41, 97, 158, 162, 175, 185, 201, 227, 229, 282, 2138, 2139, 2140, 2166, 
-  2167, 2170, 2173, 2284, 4135, 20616, 
-};
-
-static const unsigned short dep135[] = {
-  6, 24, 25, 26, 40, 41, 97, 158, 162, 175, 185, 282, 2081, 2166, 2167, 2170, 
-  2173, 2327, 4135, 20616, 
-};
-
-static const unsigned short dep136[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 2166, 2167, 2170, 2173, 2344, 2347, 2348, 
-  2351, 2352, 2355, 2356, 4135, 
-};
-
-static const unsigned short dep137[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 2166, 2167, 2170, 2173, 4135, 22824, 
-  22827, 22828, 22831, 22832, 22835, 22836, 
-};
-
-static const unsigned short dep138[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 2166, 2167, 2170, 2173, 2344, 2345, 2348, 
-  2349, 2352, 2353, 2356, 4135, 
-};
-
-static const unsigned short dep139[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 2166, 2167, 2170, 2173, 2344, 2346, 2347, 
-  2350, 2351, 2354, 2355, 4135, 
-};
-
-static const unsigned short dep140[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 2166, 2167, 2170, 2173, 2344, 2345, 2346, 
-  2347, 2348, 2349, 2350, 2351, 2352, 2353, 2354, 2355, 2356, 4135, 
-};
-
-static const unsigned short dep141[] = {
-  0, 40, 41, 97, 158, 162, 164, 175, 185, 186, 188, 282, 2166, 2167, 2170, 2173, 
-  4135, 
-};
-
-static const unsigned short dep142[] = {
-  0, 97, 195, 282, 
-};
-
-static const unsigned short dep143[] = {
-  0, 40, 41, 97, 158, 162, 164, 175, 185, 186, 188, 195, 282, 2166, 2167, 2170, 
-  2173, 4135, 
-};
-
-static const unsigned short dep144[] = {
-  40, 41, 97, 158, 162, 175, 185, 195, 282, 2166, 2167, 2170, 2173, 4135, 
-};
-
-static const unsigned short dep145[] = {
-  2, 28, 97, 197, 231, 282, 28866, 29018, 
-};
-
-static const unsigned short dep146[] = {
-  1, 2, 28, 29, 97, 158, 162, 175, 177, 178, 185, 197, 231, 282, 28866, 29018, 
-  
-};
-
-static const unsigned short dep147[] = {
-  1, 28, 29, 38, 40, 41, 97, 158, 162, 175, 177, 178, 185, 197, 231, 282, 4135, 
-  28866, 29018, 
-};
-
-static const unsigned short dep148[] = {
-  0, 40, 41, 97, 158, 162, 175, 185, 195, 282, 2166, 2167, 2170, 2173, 4135, 
-  
-};
-
-static const unsigned short dep149[] = {
-  1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 
-  28, 29, 30, 31, 97, 196, 197, 198, 199, 200, 202, 203, 204, 205, 206, 207, 
-  208, 209, 211, 212, 214, 215, 217, 218, 220, 221, 222, 223, 224, 225, 231, 
-  232, 233, 234, 282, 2071, 2081, 2274, 2284, 28866, 29018, 
-};
-
-static const unsigned short dep150[] = {
-  29, 40, 41, 97, 137, 138, 158, 162, 175, 185, 190, 191, 196, 197, 198, 199, 
-  200, 202, 203, 204, 205, 206, 207, 208, 209, 211, 212, 214, 215, 217, 218, 
-  220, 221, 222, 223, 224, 225, 231, 232, 233, 234, 282, 2138, 2139, 2140, 2166, 
-  2167, 2170, 2173, 2274, 2284, 4135, 20616, 28866, 29018, 
-};
-
-static const unsigned short dep151[] = {
-  97, 282, 14464, 14466, 14468, 14470, 14505, 14506, 14525, 14645, 14646, 14666, 
-  14667, 14669, 14670, 14679, 
-};
-
-static const unsigned short dep152[] = {
-  40, 41, 97, 158, 162, 175, 183, 184, 185, 282, 2166, 2167, 2170, 2173, 4135, 
-  14645, 14646, 14666, 14667, 14669, 14670, 14679, 
-};
-
-static const unsigned short dep153[] = {
-  14464, 14466, 14468, 14470, 14505, 14506, 14525, 14645, 14646, 14666, 14667, 
-  14669, 14670, 14679, 
-};
-
-static const unsigned short dep154[] = {
-  183, 184, 14645, 14646, 14666, 14667, 14669, 14670, 14679, 
-};
-
-static const unsigned short dep155[] = {
-  97, 282, 14465, 14466, 14469, 14470, 14480, 14481, 14483, 14484, 14486, 14487, 
-  14489, 14490, 14493, 14495, 14496, 14505, 14506, 14507, 14508, 14510, 14515, 
-  14516, 14518, 14519, 14525, 14645, 14646, 14652, 14653, 14654, 14655, 14657, 
-  14659, 14666, 14667, 14669, 14670, 14671, 14672, 14675, 14676, 14679, 
-};
-
-static const unsigned short dep156[] = {
-  40, 41, 97, 137, 138, 158, 162, 175, 185, 190, 191, 282, 2166, 2167, 2170, 
-  2173, 4135, 14645, 14646, 14652, 14653, 14654, 14655, 14657, 14659, 14666, 
-  14667, 14669, 14670, 14671, 14672, 14675, 14676, 14679, 34888, 
-};
-
-static const unsigned short dep157[] = {
-  40, 41, 97, 137, 138, 158, 162, 175, 185, 190, 191, 282, 2166, 2167, 2170, 
-  2173, 4135, 14645, 14646, 14652, 14653, 14654, 14655, 14657, 14659, 14666, 
-  14667, 14669, 14670, 14671, 14672, 14675, 14676, 14679, 
-};
-
-static const unsigned short dep158[] = {
-  1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 
-  28, 29, 30, 31, 40, 41, 97, 137, 138, 158, 162, 175, 180, 181, 185, 190, 191, 
-  282, 2071, 2081, 2166, 2167, 2170, 2173, 2327, 4135, 20616, 28866, 
-};
-
-static const unsigned short dep159[] = {
-  43, 44, 45, 46, 47, 48, 49, 50, 52, 53, 54, 55, 56, 57, 58, 60, 61, 62, 63, 
-  64, 65, 67, 69, 70, 71, 72, 73, 94, 96, 97, 243, 244, 245, 246, 247, 248, 
-  249, 250, 251, 252, 253, 255, 256, 257, 258, 259, 261, 263, 264, 265, 281, 
-  282, 2116, 2310, 
-};
-
-static const unsigned short dep160[] = {
-  40, 41, 96, 97, 137, 138, 158, 160, 161, 162, 175, 185, 190, 191, 243, 244, 
-  245, 246, 247, 248, 249, 250, 251, 252, 253, 255, 256, 257, 258, 259, 261, 
-  263, 264, 265, 281, 282, 2138, 2139, 2140, 2166, 2167, 2170, 2173, 2310, 4135, 
-  20616, 
-};
-
-static const unsigned short dep161[] = {
-  59, 95, 97, 254, 281, 282, 2140, 2327, 
-};
-
-static const unsigned short dep162[] = {
-  40, 41, 43, 44, 46, 48, 49, 51, 52, 53, 54, 56, 57, 60, 61, 63, 64, 65, 66, 
-  67, 69, 70, 71, 94, 95, 97, 137, 138, 158, 160, 161, 162, 175, 185, 190, 191, 
-  254, 281, 282, 2107, 2116, 2166, 2167, 2170, 2173, 2327, 4135, 20616, 
-};
-
-static const unsigned short dep163[] = {
-  2, 28, 41, 97, 197, 231, 241, 282, 2140, 2327, 28866, 29018, 
-};
-
-static const unsigned short dep164[] = {
-  2, 25, 26, 28, 29, 38, 40, 41, 97, 158, 162, 175, 177, 178, 185, 197, 231, 
-  241, 282, 2327, 4135, 20616, 28866, 29018, 
-};
-
-static const unsigned short dep165[] = {
-  97, 129, 130, 133, 134, 140, 141, 144, 145, 147, 148, 150, 151, 153, 154, 
-  157, 159, 160, 165, 166, 169, 170, 171, 172, 174, 176, 177, 179, 180, 182, 
-  183, 186, 187, 189, 282, 309, 310, 314, 316, 317, 318, 319, 321, 323, 327, 
-  330, 331, 333, 334, 335, 336, 338, 339, 340, 342, 343, 
-};
-
-static const unsigned short dep166[] = {
-  40, 41, 97, 137, 138, 158, 162, 175, 185, 190, 191, 282, 309, 310, 314, 316, 
-  317, 318, 319, 321, 323, 327, 330, 331, 333, 334, 335, 336, 338, 339, 340, 
-  342, 343, 2138, 2139, 2140, 2166, 2167, 2170, 2173, 4135, 20616, 34888, 
-};
-
-static const unsigned short dep167[] = {
-  97, 128, 130, 132, 134, 169, 170, 189, 282, 309, 310, 330, 331, 333, 334, 
-  343, 
-};
-
-static const unsigned short dep168[] = {
-  40, 41, 97, 158, 162, 175, 183, 184, 185, 282, 309, 310, 330, 331, 333, 334, 
-  343, 2138, 2139, 2140, 2166, 2167, 2170, 2173, 4135, 20616, 
-};
-
-static const unsigned short dep169[] = {
-  40, 41, 97, 130, 131, 134, 135, 137, 138, 141, 142, 145, 146, 148, 149, 151, 
-  152, 154, 155, 157, 158, 159, 161, 162, 164, 165, 167, 168, 169, 170, 172, 
-  173, 174, 175, 176, 178, 179, 181, 182, 184, 185, 187, 188, 189, 190, 191, 
-  282, 2166, 2167, 2170, 2173, 2327, 4135, 20616, 
-};
-
-static const unsigned short dep170[] = {
-  40, 41, 97, 130, 131, 134, 135, 158, 162, 169, 170, 175, 185, 189, 282, 2166, 
-  2167, 2170, 2173, 2327, 4135, 20616, 
-};
-
-static const unsigned short dep171[] = {
-  40, 41, 70, 76, 77, 82, 84, 97, 111, 137, 138, 153, 155, 158, 162, 171, 173, 
-  175, 185, 192, 282, 2138, 2139, 2140, 2166, 2167, 2170, 2173, 2327, 4135, 
-  20616, 
-};
-
-static const unsigned short dep172[] = {
-  40, 41, 70, 76, 77, 82, 84, 97, 111, 137, 138, 139, 140, 142, 143, 153, 155, 
-  158, 162, 171, 173, 175, 185, 192, 282, 2138, 2139, 2140, 2166, 2167, 2170, 
-  2173, 4135, 20616, 
-};
-
-static const unsigned short dep173[] = {
-  77, 78, 97, 101, 102, 269, 270, 282, 284, 285, 
-};
-
-static const unsigned short dep174[] = {
-  40, 41, 47, 62, 78, 80, 86, 97, 99, 102, 137, 138, 158, 160, 161, 162, 175, 
-  185, 190, 191, 192, 269, 270, 282, 284, 285, 2138, 2139, 2140, 2166, 2167, 
-  2170, 2173, 4135, 20616, 
-};
-
-static const unsigned short dep175[] = {
-  40, 41, 47, 62, 78, 80, 97, 99, 102, 104, 106, 137, 138, 158, 160, 161, 162, 
-  175, 185, 190, 191, 192, 269, 270, 282, 284, 285, 2138, 2139, 2140, 2166, 
-  2167, 2170, 2173, 4135, 20616, 
-};
-
-static const unsigned short dep176[] = {
-  97, 282, 12480, 12481, 12633, 
-};
-
-static const unsigned short dep177[] = {
-  40, 41, 97, 137, 138, 158, 162, 175, 185, 190, 191, 282, 2138, 2139, 2140, 
-  2166, 2167, 2170, 2173, 4135, 12633, 20616, 
-};
-
-static const unsigned short dep178[] = {
-  97, 282, 6219, 6220, 6411, 
-};
-
-static const unsigned short dep179[] = {
-  40, 41, 97, 137, 138, 158, 162, 175, 185, 190, 191, 282, 2138, 2139, 2140, 
-  2166, 2167, 2170, 2173, 4135, 6411, 20616, 
-};
-
-static const unsigned short dep180[] = {
-  97, 282, 6237, 6424, 
-};
-
-static const unsigned short dep181[] = {
-  40, 41, 97, 137, 138, 158, 162, 175, 185, 190, 191, 282, 2138, 2139, 2140, 
-  2166, 2167, 2170, 2173, 4135, 6424, 20616, 
-};
-
-static const unsigned short dep182[] = {
-  97, 282, 6255, 6256, 6257, 6258, 6435, 6437, 8484, 
-};
-
-static const unsigned short dep183[] = {
-  40, 41, 97, 137, 138, 158, 162, 175, 185, 190, 191, 282, 2138, 2139, 2140, 
-  2166, 2167, 2170, 2173, 4135, 6258, 6436, 6437, 8304, 8483, 20616, 
-};
-
-static const unsigned short dep184[] = {
-  97, 282, 6259, 6260, 6438, 
-};
-
-static const unsigned short dep185[] = {
-  40, 41, 97, 137, 138, 158, 162, 175, 185, 190, 191, 282, 2138, 2139, 2140, 
-  2166, 2167, 2170, 2173, 4135, 6438, 20616, 
-};
-
-static const unsigned short dep186[] = {
-  97, 282, 6261, 6439, 
-};
-
-static const unsigned short dep187[] = {
-  40, 41, 97, 137, 138, 158, 162, 175, 185, 190, 191, 282, 2138, 2139, 2140, 
-  2166, 2167, 2170, 2173, 4135, 6439, 20616, 
-};
-
-static const unsigned short dep188[] = {
-  97, 282, 10350, 10530, 
-};
-
-static const unsigned short dep189[] = {
-  40, 41, 97, 137, 138, 158, 162, 175, 185, 190, 191, 282, 2138, 2139, 2140, 
-  2166, 2167, 2170, 2173, 4135, 10530, 20616, 
-};
-
-static const unsigned short dep190[] = {
-  77, 78, 82, 83, 97, 101, 102, 269, 270, 272, 273, 282, 284, 285, 
-};
-
-static const unsigned short dep191[] = {
-  40, 41, 47, 62, 78, 80, 83, 86, 97, 99, 102, 137, 138, 158, 160, 161, 162, 
-  175, 185, 190, 191, 192, 269, 270, 272, 274, 282, 284, 285, 2138, 2139, 2140, 
-  2166, 2167, 2170, 2173, 4135, 20616, 
-};
-
-static const unsigned short dep192[] = {
-  77, 78, 97, 101, 102, 104, 105, 269, 270, 282, 284, 285, 286, 287, 
-};
-
-static const unsigned short dep193[] = {
-  40, 41, 47, 62, 78, 80, 97, 99, 102, 104, 106, 137, 138, 158, 160, 161, 162, 
-  175, 185, 190, 191, 192, 269, 270, 282, 284, 285, 286, 287, 2138, 2139, 2140, 
-  2166, 2167, 2170, 2173, 4135, 20616, 
-};
-
-static const unsigned short dep194[] = {
-  40, 41, 97, 137, 138, 158, 162, 175, 185, 190, 191, 282, 2138, 2139, 2140, 
-  2166, 2167, 2170, 2173, 2327, 4135, 12481, 20616, 
-};
-
-static const unsigned short dep195[] = {
-  40, 41, 97, 137, 138, 158, 162, 175, 185, 190, 191, 282, 2138, 2139, 2140, 
-  2166, 2167, 2170, 2173, 2327, 4135, 6219, 20616, 
-};
-
-static const unsigned short dep196[] = {
-  40, 41, 97, 137, 138, 158, 162, 175, 185, 190, 191, 282, 2138, 2139, 2140, 
-  2166, 2167, 2170, 2173, 2327, 4135, 6237, 20616, 
-};
-
-static const unsigned short dep197[] = {
-  40, 41, 97, 137, 138, 158, 162, 175, 185, 190, 191, 282, 2138, 2139, 2140, 
-  2166, 2167, 2170, 2173, 2327, 4135, 6257, 8303, 20616, 
-};
-
-static const unsigned short dep198[] = {
-  40, 41, 97, 137, 138, 158, 162, 175, 185, 190, 191, 282, 2138, 2139, 2140, 
-  2166, 2167, 2170, 2173, 2327, 4135, 6259, 20616, 
-};
-
-static const unsigned short dep199[] = {
-  40, 41, 97, 137, 138, 158, 162, 175, 183, 184, 185, 282, 2138, 2139, 2140, 
-  2166, 2167, 2170, 2173, 2327, 4135, 6260, 6261, 20616, 
-};
-
-static const unsigned short dep200[] = {
-  40, 41, 97, 158, 162, 175, 185, 282, 2138, 2139, 2140, 2166, 2167, 2170, 2173, 
-  2327, 4135, 10350, 20616, 
-};
-
-static const unsigned short dep201[] = {
-  40, 41, 97, 158, 162, 175, 185, 190, 191, 282, 2138, 2139, 2140, 2166, 2167, 
-  2170, 2173, 2327, 4135, 6186, 20616, 
-};
-
-static const unsigned short dep202[] = {
-  77, 79, 80, 97, 98, 99, 100, 268, 269, 282, 283, 284, 
-};
-
-static const unsigned short dep203[] = {
-  40, 41, 78, 79, 83, 85, 97, 100, 102, 104, 107, 137, 138, 158, 162, 175, 185, 
-  190, 191, 192, 268, 270, 282, 283, 285, 2138, 2139, 2140, 2166, 2167, 2170, 
-  2173, 4135, 20616, 
-};
-
-static const unsigned short dep204[] = {
-  77, 79, 80, 81, 97, 98, 99, 100, 103, 268, 269, 271, 282, 283, 284, 
-};
-
-static const unsigned short dep205[] = {
-  40, 41, 78, 79, 81, 83, 85, 97, 100, 102, 103, 104, 107, 137, 138, 158, 162, 
-  175, 185, 190, 191, 192, 268, 270, 271, 282, 283, 285, 2138, 2139, 2140, 2166, 
-  2167, 2170, 2173, 4135, 20616, 
-};
-
-static const unsigned short dep206[] = {
-  77, 79, 80, 84, 85, 86, 97, 98, 99, 100, 268, 269, 274, 275, 282, 283, 284, 
-  
-};


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

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:53 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYu-00043s-U2; Fri, 14 Sep 2012 10:55:52 +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 1TCTYs-0003sF-KB
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:50 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-27.messagelabs.com!1347620139!9908526!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21494 invoked from network); 14 Sep 2012 10:55:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Sep 2012 10: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 1TCTYg-00016E-TM
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYg-0000qf-Rm
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:38 +0000
Message-Id: <E1TCTYg-0000qf-Rm@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:38 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] drivers: Remove some CONFIG_X86
	ifdef'ery.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347479663 -3600
# Node ID 3afa736ba7a57766c5ed72835e8d97affc951771
# Parent  d4761aa7daa244d8aae2496cb7eac9981c84c246
drivers: Remove some CONFIG_X86 ifdef'ery.

Not quite all, but a great deal was to specifically allow ia64 support
to be retrofitted to x86 platform code. Since we no longer support
ia64 we can happily remove the ifdefs. Any new platform which wanted
to share this code would likely need a different set of ifdefs in any
case, making it a brand new porting effort.

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r d4761aa7daa2 -r 3afa736ba7a5 xen/drivers/acpi/numa.c
--- a/xen/drivers/acpi/numa.c	Wed Sep 12 20:41:01 2012 +0100
+++ b/xen/drivers/acpi/numa.c	Wed Sep 12 20:54:23 2012 +0100
@@ -121,16 +121,6 @@ static int __init acpi_parse_slit(struct
 	return 0;
 }
 
-#ifndef CONFIG_X86
-void __init
-acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
-{
-	printk(KERN_WARNING PREFIX
-	       "Found unsupported x2apic [0x%08x] SRAT entry\n", pa->apic_id);
-	return;
-}
-#endif
-
 static int __init
 acpi_parse_x2apic_affinity(struct acpi_subtable_header *header,
 			   const unsigned long end)
diff -r d4761aa7daa2 -r 3afa736ba7a5 xen/drivers/acpi/pmstat.c
--- a/xen/drivers/acpi/pmstat.c	Wed Sep 12 20:41:01 2012 +0100
+++ b/xen/drivers/acpi/pmstat.c	Wed Sep 12 20:54:23 2012 +0100
@@ -134,7 +134,6 @@ int do_get_pm_info(struct xen_sysctl_get
         break;
     }
 
-#ifdef CONFIG_X86
     case PMSTAT_get_max_cx:
     {
         op->u.getcx.nr = pmstat_get_cx_nr(op->cpuid);
@@ -153,7 +152,6 @@ int do_get_pm_info(struct xen_sysctl_get
         ret = pmstat_reset_cx_stat(op->cpuid);
         break;
     }
-#endif
 
     default:
         printk("not defined sub-hypercall @ do_get_pm_info\n");
diff -r d4761aa7daa2 -r 3afa736ba7a5 xen/drivers/cpufreq/cpufreq.c
--- a/xen/drivers/cpufreq/cpufreq.c	Wed Sep 12 20:41:01 2012 +0100
+++ b/xen/drivers/cpufreq/cpufreq.c	Wed Sep 12 20:54:23 2012 +0100
@@ -481,8 +481,7 @@ int set_px_pminfo(uint32_t acpi_id, stru
 
     if ( dom0_px_info->flags & XEN_PX_PSD )
     {
-#ifdef CONFIG_X86
-        /* for X86, check domain coordination */
+        /* check domain coordination */
         if (dom0_px_info->shared_type != CPUFREQ_SHARED_TYPE_ALL &&
             dom0_px_info->shared_type != CPUFREQ_SHARED_TYPE_ANY &&
             dom0_px_info->shared_type != CPUFREQ_SHARED_TYPE_HW)
@@ -490,7 +489,6 @@ int set_px_pminfo(uint32_t acpi_id, stru
             ret = -EINVAL;
             goto out;
         }
-#endif
 
         pxpt->shared_type = dom0_px_info->shared_type;
         memcpy ((void *)&pxpt->domain_info,
diff -r d4761aa7daa2 -r 3afa736ba7a5 xen/drivers/passthrough/ats.h
--- a/xen/drivers/passthrough/ats.h	Wed Sep 12 20:41:01 2012 +0100
+++ b/xen/drivers/passthrough/ats.h	Wed Sep 12 20:54:23 2012 +0100
@@ -26,8 +26,6 @@ struct pci_ats_dev {
     u16 ats_queue_depth;    /* ATS device invalidation queue depth */
 };
 
-#ifdef CONFIG_X86
-
 #define ATS_REG_CAP    4
 #define ATS_REG_CTL    6
 #define ATS_QUEUE_DEPTH_MASK     0xF
@@ -61,36 +59,5 @@ static inline int pci_ats_device(int seg
     return pci_find_ext_capability(seg, bus, devfn, PCI_EXT_CAP_ID_ATS);
 }
 
-#else
-
-#define ats_enabled 0
-static inline int enable_ats_device(int seg, int bus, int devfn)
-{
-    BUG();
-    return -ENOSYS;
-}
-
-static inline void disable_ats_device(int seg, int bus, int devfn)
-{
-    BUG();
-}
-
-static inline int pci_ats_enabled(int seg, int bus, int devfn)
-{
-    return 0;
-}
-
-static inline int pci_ats_device(int seg, int bus, int devfn)
-{
-    return 0;
-}
-
-static inline struct pci_ats_dev *get_ats_device(int seg, int bus, int devfn)
-{
-    return NULL;
-}
-
-#endif
-
 #endif /* _ATS_H_ */
 
diff -r d4761aa7daa2 -r 3afa736ba7a5 xen/drivers/passthrough/pci.c
--- a/xen/drivers/passthrough/pci.c	Wed Sep 12 20:41:01 2012 +0100
+++ b/xen/drivers/passthrough/pci.c	Wed Sep 12 20:54:23 2012 +0100
@@ -29,9 +29,7 @@
 #include <xen/radix-tree.h>
 #include <xen/tasklet.h>
 #include <xsm/xsm.h>
-#ifdef CONFIG_X86
 #include <asm/msi.h>
-#endif
 
 struct pci_seg {
     struct list_head alldevs_list;
diff -r d4761aa7daa2 -r 3afa736ba7a5 xen/drivers/passthrough/vtd/dmar.c
--- a/xen/drivers/passthrough/vtd/dmar.c	Wed Sep 12 20:41:01 2012 +0100
+++ b/xen/drivers/passthrough/vtd/dmar.c	Wed Sep 12 20:54:23 2012 +0100
@@ -520,7 +520,6 @@ acpi_parse_one_rmrr(struct acpi_dmar_hea
     if ( (ret = acpi_dmar_check_length(header, sizeof(*rmrr))) != 0 )
         return ret;
 
-#ifdef CONFIG_X86
     /* This check is here simply to detect when RMRR values are
      * not properly represented in the system memory map and
      * inform the user
@@ -534,7 +533,6 @@ acpi_parse_one_rmrr(struct acpi_dmar_hea
                 "iommu_inclusive_mapping=1 parameter may be needed.\n",
                 base_addr, end_addr);
     }
-#endif
 
     rmrru = xzalloc(struct acpi_rmrr_unit);
     if ( !rmrru )
@@ -775,14 +773,10 @@ out:
     return ret;
 }
 
-#ifdef CONFIG_X86
 #include <asm/tboot.h>
 /* ACPI tables may not be DMA protected by tboot, so use DMAR copy */
 /* SINIT saved in SinitMleData in TXT heap (which is DMA protected) */
 #define parse_dmar_table(h) tboot_parse_dmar_table(h)
-#else
-#define parse_dmar_table(h) acpi_table_parse(ACPI_SIG_DMAR, h)
-#endif
 
 int __init acpi_dmar_init(void)
 {
@@ -813,14 +807,8 @@ int platform_supports_intremap(void)
     return (dmar_flags & mask) == ACPI_DMAR_INTR_REMAP;
 }
 
-#ifdef CONFIG_X86
 int platform_supports_x2apic(void)
 {
     unsigned int mask = ACPI_DMAR_INTR_REMAP | ACPI_DMAR_X2APIC_OPT_OUT;
-
-    if (!cpu_has_x2apic)
-        return 0;
-
-    return (dmar_flags & mask) == ACPI_DMAR_INTR_REMAP;
+    return cpu_has_x2apic && ((dmar_flags & mask) == ACPI_DMAR_INTR_REMAP);
 }
-#endif
diff -r d4761aa7daa2 -r 3afa736ba7a5 xen/drivers/passthrough/vtd/extern.h
--- a/xen/drivers/passthrough/vtd/extern.h	Wed Sep 12 20:41:01 2012 +0100
+++ b/xen/drivers/passthrough/vtd/extern.h	Wed Sep 12 20:54:23 2012 +0100
@@ -56,32 +56,12 @@ struct acpi_drhd_unit * ioapic_to_drhd(u
 struct acpi_drhd_unit * iommu_to_drhd(struct iommu *iommu);
 struct acpi_rhsa_unit * drhd_to_rhsa(struct acpi_drhd_unit *drhd);
 
-#ifdef CONFIG_X86
 struct acpi_drhd_unit * find_ats_dev_drhd(struct iommu *iommu);
 
 int ats_device(const struct pci_dev *, const struct acpi_drhd_unit *);
 
 int dev_invalidate_iotlb(struct iommu *iommu, u16 did,
                          u64 addr, unsigned int size_order, u64 type);
-#else
-
-static inline struct acpi_drhd_unit *find_ats_dev_drhd(struct iommu *iommu)
-{
-    return NULL;
-}
-
-static inline int ats_device(const struct pci_dev *pdev,
-                             const struct acpi_drhd_unit *drhd)
-{
-    return 0;
-}
-
-static inline int dev_invalidate_iotlb(struct iommu *iommu, u16 did, u64 addr,
-                                       unsigned int size_order, u64 type)
-{
-    return 0;
-}
-#endif
 
 int qinval_device_iotlb(struct iommu *iommu,
                         u32 max_invs_pend, u16 sid, u16 size, u64 addr);
diff -r d4761aa7daa2 -r 3afa736ba7a5 xen/drivers/passthrough/vtd/intremap.c
--- a/xen/drivers/passthrough/vtd/intremap.c	Wed Sep 12 20:41:01 2012 +0100
+++ b/xen/drivers/passthrough/vtd/intremap.c	Wed Sep 12 20:54:23 2012 +0100
@@ -31,11 +31,9 @@
 #include "vtd.h"
 #include "extern.h"
 
-#if defined(CONFIG_X86)
 #include <asm/apic.h>
 #include <asm/io_apic.h>
 #define nr_ioapic_entries(i)  nr_ioapic_entries[i]
-#endif
 
 /*
  * source validation type (SVT)
@@ -302,12 +300,10 @@ static int ioapic_rte_to_remap_entry(str
 
     if ( rte_upper )
     {
-#if defined(CONFIG_X86)
         if ( x2apic_enabled )
             new_ire.lo.dst = value;
         else
             new_ire.lo.dst = (value >> 24) << 8;
-#endif
     }
     else
     {
@@ -316,12 +312,8 @@ static int ioapic_rte_to_remap_entry(str
         new_ire.lo.dm = new_rte.dest_mode;
         new_ire.lo.tm = new_rte.trigger;
         new_ire.lo.dlm = new_rte.delivery_mode;
-#ifdef CONFIG_X86
         /* Hardware require RH = 1 for LPR delivery mode */
         new_ire.lo.rh = (new_ire.lo.dlm == dest_LowestPrio);
-#else
-        new_ire.lo.rh = 0;
-#endif
         new_ire.lo.avail = 0;
         new_ire.lo.res_1 = 0;
         new_ire.lo.vector = new_rte.vector;
@@ -422,8 +414,6 @@ void io_apic_write_remap_rte(
         __ioapic_write_entry(apic, ioapic_pin, 1, old_rte);
 }
 
-#if defined(CONFIG_X86)
-
 static void set_msi_source_id(struct pci_dev *pdev, struct iremap_entry *ire)
 {
     int type;
@@ -678,7 +668,6 @@ void msi_msg_write_remap_rte(
 
     msi_msg_to_remap_entry(iommu, pdev, msi_desc, msg);
 }
-#endif
 
 int enable_intremap(struct iommu *iommu, int eim)
 {
@@ -725,10 +714,9 @@ int enable_intremap(struct iommu *iommu,
         ir_ctrl->iremap_num = 0;
     }
 
-#ifdef CONFIG_X86
     /* set extended interrupt mode bit */
     ir_ctrl->iremap_maddr |= eim ? IRTA_EIME : 0;
-#endif
+
     spin_lock_irqsave(&iommu->register_lock, flags);
 
     /* set size of the interrupt remapping table */
diff -r d4761aa7daa2 -r 3afa736ba7a5 xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c	Wed Sep 12 20:41:01 2012 +0100
+++ b/xen/drivers/passthrough/vtd/iommu.c	Wed Sep 12 20:54:23 2012 +0100
@@ -34,11 +34,9 @@
 #include <xen/softirq.h>
 #include <asm/msi.h>
 #include <asm/irq.h>
-#if defined(CONFIG_X86)
 #include <asm/hvm/vmx/vmx.h>
 #include <asm/p2m.h>
 #include <mach_apic.h>
-#endif
 #include "iommu.h"
 #include "dmar.h"
 #include "extern.h"
@@ -1070,7 +1068,6 @@ static void dma_msi_set_affinity(struct 
     unsigned long flags;
     struct iommu *iommu = desc->action->dev_id;
 
-#ifdef CONFIG_X86
     dest = set_desc_affinity(desc, mask);
     if (dest == BAD_APICID){
         dprintk(XENLOG_ERR VTDPREFIX, "Set iommu interrupt affinity error!\n");
@@ -1094,16 +1091,6 @@ static void dma_msi_set_affinity(struct 
                     MSI_ADDR_REDIRECTION_CPU:
                     MSI_ADDR_REDIRECTION_LOWPRI;
     msg.address_lo |= MSI_ADDR_DEST_ID(dest & 0xff);
-#else
-    memset(&msg, 0, sizeof(msg));
-    msg.data = desc->arch.vector & 0xff;
-    msg.data |= 1 << 14;
-    msg.address_lo = (MSI_ADDRESS_HEADER << (MSI_ADDRESS_HEADER_SHIFT + 8));
-    msg.address_lo |= MSI_PHYSICAL_MODE << 2;
-    msg.address_lo |= MSI_REDIRECTION_HINT_MODE << 3;
-    dest = cpu_physical_id(cpumask_first(mask));
-    msg.address_lo |= dest << MSI_TARGET_CPU_SHIFT;
-#endif
 
     spin_lock_irqsave(&iommu->register_lock, flags);
     dmar_writel(iommu->reg, DMAR_FEDATA_REG, msg.data);
@@ -1137,11 +1124,7 @@ static int __init iommu_set_interrupt(st
     }
 
     irq_desc[irq].handler = &dma_msi_type;
-#ifdef CONFIG_X86
     ret = request_irq(irq, iommu_page_fault, 0, "dmar", drhd->iommu);
-#else
-    ret = request_irq_vector(irq, iommu_page_fault, 0, "dmar", drhd->iommu);
-#endif
     if ( ret )
     {
         irq_desc[irq].handler = &no_irq_type;
diff -r d4761aa7daa2 -r 3afa736ba7a5 xen/drivers/passthrough/vtd/quirks.c
--- a/xen/drivers/passthrough/vtd/quirks.c	Wed Sep 12 20:41:01 2012 +0100
+++ b/xen/drivers/passthrough/vtd/quirks.c	Wed Sep 12 20:54:23 2012 +0100
@@ -132,12 +132,8 @@ static void __init map_igd_reg(void)
     igd_reg = (igd_mmio & IGD_BAR_MASK) + 0x2000;
 
     /* ioremap this physical page */
-#if defined(CONFIG_X86)
     set_fixmap_nocache(FIX_IGD_MMIO, igd_reg);
     igd_reg_va = (u8 *)fix_to_virt(FIX_IGD_MMIO);
-#else
-    igd_reg_va = ioremap_nocache(igd_reg, 0x1000);
-#endif
 }
 
 /*
@@ -363,7 +359,6 @@ void me_wifi_quirk(struct domain *domain
  */
 void __init pci_vtd_quirk(struct pci_dev *pdev)
 {
-#ifdef CONFIG_X86
     int seg = pdev->seg;
     int bus = pdev->bus;
     int dev = PCI_SLOT(pdev->devfn);
@@ -376,5 +371,4 @@ void __init pci_vtd_quirk(struct pci_dev
         val = pci_conf_read32(seg, bus, dev, func, 0x1AC);
         pci_conf_write32(seg, bus, dev, func, 0x1AC, val | (1 << 31));
     }
-#endif
 }
diff -r d4761aa7daa2 -r 3afa736ba7a5 xen/drivers/passthrough/vtd/utils.c
--- a/xen/drivers/passthrough/vtd/utils.c	Wed Sep 12 20:41:01 2012 +0100
+++ b/xen/drivers/passthrough/vtd/utils.c	Wed Sep 12 20:54:23 2012 +0100
@@ -27,10 +27,7 @@
 #include "dmar.h"
 #include "vtd.h"
 #include "extern.h"
-
-#if defined(CONFIG_X86)
 #include <asm/io_apic.h>
-#endif
 
 int is_usb_device(u16 seg, u8 bus, u8 devfn)
 {
@@ -188,7 +185,6 @@ void print_vtd_entries(struct iommu *iom
 
 static void dump_iommu_info(unsigned char key)
 {
-#if defined(CONFIG_X86)
     struct acpi_drhd_unit *drhd;
     struct iommu *iommu;
     int i;
@@ -300,9 +296,6 @@ static void dump_iommu_info(unsigned cha
             }
         }
     }
-#else
-    printk("%s: not implemented for now\n", __func__);
-#endif
 }
 
 struct keyhandler dump_iommu_info_keyhandler = {
diff -r d4761aa7daa2 -r 3afa736ba7a5 xen/drivers/video/vesa.c
--- a/xen/drivers/video/vesa.c	Wed Sep 12 20:41:01 2012 +0100
+++ b/xen/drivers/video/vesa.c	Wed Sep 12 20:54:23 2012 +0100
@@ -151,8 +151,6 @@ void __init vesa_init(void)
     xfree(line_len);
 }
 
-#if defined(CONFIG_X86)
-
 #include <asm/mtrr.h>
 
 static unsigned int vesa_mtrr;
@@ -191,12 +189,6 @@ static void lfb_flush(void)
         __asm__ __volatile__ ("sfence" : : : "memory");
 }
 
-#else /* !defined(CONFIG_X86) */
-
-#define lfb_flush() ((void)0)
-
-#endif
-
 void __init vesa_endboot(bool_t keep)
 {
     if ( keep )

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:53 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYu-00043s-U2; Fri, 14 Sep 2012 10:55:52 +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 1TCTYs-0003sF-KB
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:50 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-27.messagelabs.com!1347620139!9908526!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21494 invoked from network); 14 Sep 2012 10:55:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Sep 2012 10: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 1TCTYg-00016E-TM
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYg-0000qf-Rm
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:38 +0000
Message-Id: <E1TCTYg-0000qf-Rm@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:38 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] drivers: Remove some CONFIG_X86
	ifdef'ery.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347479663 -3600
# Node ID 3afa736ba7a57766c5ed72835e8d97affc951771
# Parent  d4761aa7daa244d8aae2496cb7eac9981c84c246
drivers: Remove some CONFIG_X86 ifdef'ery.

Not quite all, but a great deal was to specifically allow ia64 support
to be retrofitted to x86 platform code. Since we no longer support
ia64 we can happily remove the ifdefs. Any new platform which wanted
to share this code would likely need a different set of ifdefs in any
case, making it a brand new porting effort.

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r d4761aa7daa2 -r 3afa736ba7a5 xen/drivers/acpi/numa.c
--- a/xen/drivers/acpi/numa.c	Wed Sep 12 20:41:01 2012 +0100
+++ b/xen/drivers/acpi/numa.c	Wed Sep 12 20:54:23 2012 +0100
@@ -121,16 +121,6 @@ static int __init acpi_parse_slit(struct
 	return 0;
 }
 
-#ifndef CONFIG_X86
-void __init
-acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
-{
-	printk(KERN_WARNING PREFIX
-	       "Found unsupported x2apic [0x%08x] SRAT entry\n", pa->apic_id);
-	return;
-}
-#endif
-
 static int __init
 acpi_parse_x2apic_affinity(struct acpi_subtable_header *header,
 			   const unsigned long end)
diff -r d4761aa7daa2 -r 3afa736ba7a5 xen/drivers/acpi/pmstat.c
--- a/xen/drivers/acpi/pmstat.c	Wed Sep 12 20:41:01 2012 +0100
+++ b/xen/drivers/acpi/pmstat.c	Wed Sep 12 20:54:23 2012 +0100
@@ -134,7 +134,6 @@ int do_get_pm_info(struct xen_sysctl_get
         break;
     }
 
-#ifdef CONFIG_X86
     case PMSTAT_get_max_cx:
     {
         op->u.getcx.nr = pmstat_get_cx_nr(op->cpuid);
@@ -153,7 +152,6 @@ int do_get_pm_info(struct xen_sysctl_get
         ret = pmstat_reset_cx_stat(op->cpuid);
         break;
     }
-#endif
 
     default:
         printk("not defined sub-hypercall @ do_get_pm_info\n");
diff -r d4761aa7daa2 -r 3afa736ba7a5 xen/drivers/cpufreq/cpufreq.c
--- a/xen/drivers/cpufreq/cpufreq.c	Wed Sep 12 20:41:01 2012 +0100
+++ b/xen/drivers/cpufreq/cpufreq.c	Wed Sep 12 20:54:23 2012 +0100
@@ -481,8 +481,7 @@ int set_px_pminfo(uint32_t acpi_id, stru
 
     if ( dom0_px_info->flags & XEN_PX_PSD )
     {
-#ifdef CONFIG_X86
-        /* for X86, check domain coordination */
+        /* check domain coordination */
         if (dom0_px_info->shared_type != CPUFREQ_SHARED_TYPE_ALL &&
             dom0_px_info->shared_type != CPUFREQ_SHARED_TYPE_ANY &&
             dom0_px_info->shared_type != CPUFREQ_SHARED_TYPE_HW)
@@ -490,7 +489,6 @@ int set_px_pminfo(uint32_t acpi_id, stru
             ret = -EINVAL;
             goto out;
         }
-#endif
 
         pxpt->shared_type = dom0_px_info->shared_type;
         memcpy ((void *)&pxpt->domain_info,
diff -r d4761aa7daa2 -r 3afa736ba7a5 xen/drivers/passthrough/ats.h
--- a/xen/drivers/passthrough/ats.h	Wed Sep 12 20:41:01 2012 +0100
+++ b/xen/drivers/passthrough/ats.h	Wed Sep 12 20:54:23 2012 +0100
@@ -26,8 +26,6 @@ struct pci_ats_dev {
     u16 ats_queue_depth;    /* ATS device invalidation queue depth */
 };
 
-#ifdef CONFIG_X86
-
 #define ATS_REG_CAP    4
 #define ATS_REG_CTL    6
 #define ATS_QUEUE_DEPTH_MASK     0xF
@@ -61,36 +59,5 @@ static inline int pci_ats_device(int seg
     return pci_find_ext_capability(seg, bus, devfn, PCI_EXT_CAP_ID_ATS);
 }
 
-#else
-
-#define ats_enabled 0
-static inline int enable_ats_device(int seg, int bus, int devfn)
-{
-    BUG();
-    return -ENOSYS;
-}
-
-static inline void disable_ats_device(int seg, int bus, int devfn)
-{
-    BUG();
-}
-
-static inline int pci_ats_enabled(int seg, int bus, int devfn)
-{
-    return 0;
-}
-
-static inline int pci_ats_device(int seg, int bus, int devfn)
-{
-    return 0;
-}
-
-static inline struct pci_ats_dev *get_ats_device(int seg, int bus, int devfn)
-{
-    return NULL;
-}
-
-#endif
-
 #endif /* _ATS_H_ */
 
diff -r d4761aa7daa2 -r 3afa736ba7a5 xen/drivers/passthrough/pci.c
--- a/xen/drivers/passthrough/pci.c	Wed Sep 12 20:41:01 2012 +0100
+++ b/xen/drivers/passthrough/pci.c	Wed Sep 12 20:54:23 2012 +0100
@@ -29,9 +29,7 @@
 #include <xen/radix-tree.h>
 #include <xen/tasklet.h>
 #include <xsm/xsm.h>
-#ifdef CONFIG_X86
 #include <asm/msi.h>
-#endif
 
 struct pci_seg {
     struct list_head alldevs_list;
diff -r d4761aa7daa2 -r 3afa736ba7a5 xen/drivers/passthrough/vtd/dmar.c
--- a/xen/drivers/passthrough/vtd/dmar.c	Wed Sep 12 20:41:01 2012 +0100
+++ b/xen/drivers/passthrough/vtd/dmar.c	Wed Sep 12 20:54:23 2012 +0100
@@ -520,7 +520,6 @@ acpi_parse_one_rmrr(struct acpi_dmar_hea
     if ( (ret = acpi_dmar_check_length(header, sizeof(*rmrr))) != 0 )
         return ret;
 
-#ifdef CONFIG_X86
     /* This check is here simply to detect when RMRR values are
      * not properly represented in the system memory map and
      * inform the user
@@ -534,7 +533,6 @@ acpi_parse_one_rmrr(struct acpi_dmar_hea
                 "iommu_inclusive_mapping=1 parameter may be needed.\n",
                 base_addr, end_addr);
     }
-#endif
 
     rmrru = xzalloc(struct acpi_rmrr_unit);
     if ( !rmrru )
@@ -775,14 +773,10 @@ out:
     return ret;
 }
 
-#ifdef CONFIG_X86
 #include <asm/tboot.h>
 /* ACPI tables may not be DMA protected by tboot, so use DMAR copy */
 /* SINIT saved in SinitMleData in TXT heap (which is DMA protected) */
 #define parse_dmar_table(h) tboot_parse_dmar_table(h)
-#else
-#define parse_dmar_table(h) acpi_table_parse(ACPI_SIG_DMAR, h)
-#endif
 
 int __init acpi_dmar_init(void)
 {
@@ -813,14 +807,8 @@ int platform_supports_intremap(void)
     return (dmar_flags & mask) == ACPI_DMAR_INTR_REMAP;
 }
 
-#ifdef CONFIG_X86
 int platform_supports_x2apic(void)
 {
     unsigned int mask = ACPI_DMAR_INTR_REMAP | ACPI_DMAR_X2APIC_OPT_OUT;
-
-    if (!cpu_has_x2apic)
-        return 0;
-
-    return (dmar_flags & mask) == ACPI_DMAR_INTR_REMAP;
+    return cpu_has_x2apic && ((dmar_flags & mask) == ACPI_DMAR_INTR_REMAP);
 }
-#endif
diff -r d4761aa7daa2 -r 3afa736ba7a5 xen/drivers/passthrough/vtd/extern.h
--- a/xen/drivers/passthrough/vtd/extern.h	Wed Sep 12 20:41:01 2012 +0100
+++ b/xen/drivers/passthrough/vtd/extern.h	Wed Sep 12 20:54:23 2012 +0100
@@ -56,32 +56,12 @@ struct acpi_drhd_unit * ioapic_to_drhd(u
 struct acpi_drhd_unit * iommu_to_drhd(struct iommu *iommu);
 struct acpi_rhsa_unit * drhd_to_rhsa(struct acpi_drhd_unit *drhd);
 
-#ifdef CONFIG_X86
 struct acpi_drhd_unit * find_ats_dev_drhd(struct iommu *iommu);
 
 int ats_device(const struct pci_dev *, const struct acpi_drhd_unit *);
 
 int dev_invalidate_iotlb(struct iommu *iommu, u16 did,
                          u64 addr, unsigned int size_order, u64 type);
-#else
-
-static inline struct acpi_drhd_unit *find_ats_dev_drhd(struct iommu *iommu)
-{
-    return NULL;
-}
-
-static inline int ats_device(const struct pci_dev *pdev,
-                             const struct acpi_drhd_unit *drhd)
-{
-    return 0;
-}
-
-static inline int dev_invalidate_iotlb(struct iommu *iommu, u16 did, u64 addr,
-                                       unsigned int size_order, u64 type)
-{
-    return 0;
-}
-#endif
 
 int qinval_device_iotlb(struct iommu *iommu,
                         u32 max_invs_pend, u16 sid, u16 size, u64 addr);
diff -r d4761aa7daa2 -r 3afa736ba7a5 xen/drivers/passthrough/vtd/intremap.c
--- a/xen/drivers/passthrough/vtd/intremap.c	Wed Sep 12 20:41:01 2012 +0100
+++ b/xen/drivers/passthrough/vtd/intremap.c	Wed Sep 12 20:54:23 2012 +0100
@@ -31,11 +31,9 @@
 #include "vtd.h"
 #include "extern.h"
 
-#if defined(CONFIG_X86)
 #include <asm/apic.h>
 #include <asm/io_apic.h>
 #define nr_ioapic_entries(i)  nr_ioapic_entries[i]
-#endif
 
 /*
  * source validation type (SVT)
@@ -302,12 +300,10 @@ static int ioapic_rte_to_remap_entry(str
 
     if ( rte_upper )
     {
-#if defined(CONFIG_X86)
         if ( x2apic_enabled )
             new_ire.lo.dst = value;
         else
             new_ire.lo.dst = (value >> 24) << 8;
-#endif
     }
     else
     {
@@ -316,12 +312,8 @@ static int ioapic_rte_to_remap_entry(str
         new_ire.lo.dm = new_rte.dest_mode;
         new_ire.lo.tm = new_rte.trigger;
         new_ire.lo.dlm = new_rte.delivery_mode;
-#ifdef CONFIG_X86
         /* Hardware require RH = 1 for LPR delivery mode */
         new_ire.lo.rh = (new_ire.lo.dlm == dest_LowestPrio);
-#else
-        new_ire.lo.rh = 0;
-#endif
         new_ire.lo.avail = 0;
         new_ire.lo.res_1 = 0;
         new_ire.lo.vector = new_rte.vector;
@@ -422,8 +414,6 @@ void io_apic_write_remap_rte(
         __ioapic_write_entry(apic, ioapic_pin, 1, old_rte);
 }
 
-#if defined(CONFIG_X86)
-
 static void set_msi_source_id(struct pci_dev *pdev, struct iremap_entry *ire)
 {
     int type;
@@ -678,7 +668,6 @@ void msi_msg_write_remap_rte(
 
     msi_msg_to_remap_entry(iommu, pdev, msi_desc, msg);
 }
-#endif
 
 int enable_intremap(struct iommu *iommu, int eim)
 {
@@ -725,10 +714,9 @@ int enable_intremap(struct iommu *iommu,
         ir_ctrl->iremap_num = 0;
     }
 
-#ifdef CONFIG_X86
     /* set extended interrupt mode bit */
     ir_ctrl->iremap_maddr |= eim ? IRTA_EIME : 0;
-#endif
+
     spin_lock_irqsave(&iommu->register_lock, flags);
 
     /* set size of the interrupt remapping table */
diff -r d4761aa7daa2 -r 3afa736ba7a5 xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c	Wed Sep 12 20:41:01 2012 +0100
+++ b/xen/drivers/passthrough/vtd/iommu.c	Wed Sep 12 20:54:23 2012 +0100
@@ -34,11 +34,9 @@
 #include <xen/softirq.h>
 #include <asm/msi.h>
 #include <asm/irq.h>
-#if defined(CONFIG_X86)
 #include <asm/hvm/vmx/vmx.h>
 #include <asm/p2m.h>
 #include <mach_apic.h>
-#endif
 #include "iommu.h"
 #include "dmar.h"
 #include "extern.h"
@@ -1070,7 +1068,6 @@ static void dma_msi_set_affinity(struct 
     unsigned long flags;
     struct iommu *iommu = desc->action->dev_id;
 
-#ifdef CONFIG_X86
     dest = set_desc_affinity(desc, mask);
     if (dest == BAD_APICID){
         dprintk(XENLOG_ERR VTDPREFIX, "Set iommu interrupt affinity error!\n");
@@ -1094,16 +1091,6 @@ static void dma_msi_set_affinity(struct 
                     MSI_ADDR_REDIRECTION_CPU:
                     MSI_ADDR_REDIRECTION_LOWPRI;
     msg.address_lo |= MSI_ADDR_DEST_ID(dest & 0xff);
-#else
-    memset(&msg, 0, sizeof(msg));
-    msg.data = desc->arch.vector & 0xff;
-    msg.data |= 1 << 14;
-    msg.address_lo = (MSI_ADDRESS_HEADER << (MSI_ADDRESS_HEADER_SHIFT + 8));
-    msg.address_lo |= MSI_PHYSICAL_MODE << 2;
-    msg.address_lo |= MSI_REDIRECTION_HINT_MODE << 3;
-    dest = cpu_physical_id(cpumask_first(mask));
-    msg.address_lo |= dest << MSI_TARGET_CPU_SHIFT;
-#endif
 
     spin_lock_irqsave(&iommu->register_lock, flags);
     dmar_writel(iommu->reg, DMAR_FEDATA_REG, msg.data);
@@ -1137,11 +1124,7 @@ static int __init iommu_set_interrupt(st
     }
 
     irq_desc[irq].handler = &dma_msi_type;
-#ifdef CONFIG_X86
     ret = request_irq(irq, iommu_page_fault, 0, "dmar", drhd->iommu);
-#else
-    ret = request_irq_vector(irq, iommu_page_fault, 0, "dmar", drhd->iommu);
-#endif
     if ( ret )
     {
         irq_desc[irq].handler = &no_irq_type;
diff -r d4761aa7daa2 -r 3afa736ba7a5 xen/drivers/passthrough/vtd/quirks.c
--- a/xen/drivers/passthrough/vtd/quirks.c	Wed Sep 12 20:41:01 2012 +0100
+++ b/xen/drivers/passthrough/vtd/quirks.c	Wed Sep 12 20:54:23 2012 +0100
@@ -132,12 +132,8 @@ static void __init map_igd_reg(void)
     igd_reg = (igd_mmio & IGD_BAR_MASK) + 0x2000;
 
     /* ioremap this physical page */
-#if defined(CONFIG_X86)
     set_fixmap_nocache(FIX_IGD_MMIO, igd_reg);
     igd_reg_va = (u8 *)fix_to_virt(FIX_IGD_MMIO);
-#else
-    igd_reg_va = ioremap_nocache(igd_reg, 0x1000);
-#endif
 }
 
 /*
@@ -363,7 +359,6 @@ void me_wifi_quirk(struct domain *domain
  */
 void __init pci_vtd_quirk(struct pci_dev *pdev)
 {
-#ifdef CONFIG_X86
     int seg = pdev->seg;
     int bus = pdev->bus;
     int dev = PCI_SLOT(pdev->devfn);
@@ -376,5 +371,4 @@ void __init pci_vtd_quirk(struct pci_dev
         val = pci_conf_read32(seg, bus, dev, func, 0x1AC);
         pci_conf_write32(seg, bus, dev, func, 0x1AC, val | (1 << 31));
     }
-#endif
 }
diff -r d4761aa7daa2 -r 3afa736ba7a5 xen/drivers/passthrough/vtd/utils.c
--- a/xen/drivers/passthrough/vtd/utils.c	Wed Sep 12 20:41:01 2012 +0100
+++ b/xen/drivers/passthrough/vtd/utils.c	Wed Sep 12 20:54:23 2012 +0100
@@ -27,10 +27,7 @@
 #include "dmar.h"
 #include "vtd.h"
 #include "extern.h"
-
-#if defined(CONFIG_X86)
 #include <asm/io_apic.h>
-#endif
 
 int is_usb_device(u16 seg, u8 bus, u8 devfn)
 {
@@ -188,7 +185,6 @@ void print_vtd_entries(struct iommu *iom
 
 static void dump_iommu_info(unsigned char key)
 {
-#if defined(CONFIG_X86)
     struct acpi_drhd_unit *drhd;
     struct iommu *iommu;
     int i;
@@ -300,9 +296,6 @@ static void dump_iommu_info(unsigned cha
             }
         }
     }
-#else
-    printk("%s: not implemented for now\n", __func__);
-#endif
 }
 
 struct keyhandler dump_iommu_info_keyhandler = {
diff -r d4761aa7daa2 -r 3afa736ba7a5 xen/drivers/video/vesa.c
--- a/xen/drivers/video/vesa.c	Wed Sep 12 20:41:01 2012 +0100
+++ b/xen/drivers/video/vesa.c	Wed Sep 12 20:54:23 2012 +0100
@@ -151,8 +151,6 @@ void __init vesa_init(void)
     xfree(line_len);
 }
 
-#if defined(CONFIG_X86)
-
 #include <asm/mtrr.h>
 
 static unsigned int vesa_mtrr;
@@ -191,12 +189,6 @@ static void lfb_flush(void)
         __asm__ __volatile__ ("sfence" : : : "memory");
 }
 
-#else /* !defined(CONFIG_X86) */
-
-#define lfb_flush() ((void)0)
-
-#endif
-
 void __init vesa_endboot(bool_t keep)
 {
     if ( keep )

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:54 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYw-00046n-Df; Fri, 14 Sep 2012 10:55:54 +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 1TCTYu-0003vg-P2
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:53 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-27.messagelabs.com!1347620130!9736209!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3625 invoked from network); 14 Sep 2012 10:55:31 -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;
	14 Sep 2012 10: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 1TCTYY-000152-Bu
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYY-0000nT-9f
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:30 +0000
Message-Id: <E1TCTYY-0000nT-9f@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:29 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: use only a single branch for
	upcall-pending exit path checks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347438018 -7200
# Node ID dd40b43f16bc5bebd833d4cd2691a5b2a5fbef27
# Parent  8c0aa97d529a55de2ab96be1a5a6e9ed6a9c6bf0
x86: use only a single branch for upcall-pending exit path checks

This utilizes the fact that the two bytes of interest are adjacent to
one another and that the resulting 16-bit values of interest are within
a contiguous range of numbers.

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


diff -r 8c0aa97d529a -r dd40b43f16bc xen/arch/x86/x86_32/entry.S
--- a/xen/arch/x86/x86_32/entry.S	Wed Sep 12 10:19:34 2012 +0200
+++ b/xen/arch/x86/x86_32/entry.S	Wed Sep 12 10:20:18 2012 +0200
@@ -219,10 +219,10 @@ test_all_events:
         jnz  process_nmi
 test_guest_events:
         movl VCPU_vcpu_info(%ebx),%eax
-        testb $0xFF,VCPUINFO_upcall_mask(%eax)
-        jnz  restore_all_guest
-        testb $0xFF,VCPUINFO_upcall_pending(%eax)
-        jz   restore_all_guest
+        movzwl VCPUINFO_upcall_pending(%eax),%eax
+        decl %eax
+        cmpl $0xfe,%eax
+        ja   restore_all_guest
 /*process_guest_events:*/
         sti
         leal VCPU_trap_bounce(%ebx),%edx
diff -r 8c0aa97d529a -r dd40b43f16bc xen/arch/x86/x86_64/compat/entry.S
--- a/xen/arch/x86/x86_64/compat/entry.S	Wed Sep 12 10:19:34 2012 +0200
+++ b/xen/arch/x86/x86_64/compat/entry.S	Wed Sep 12 10:20:18 2012 +0200
@@ -108,10 +108,10 @@ ENTRY(compat_test_all_events)
         jnz   compat_process_nmi
 compat_test_guest_events:
         movq  VCPU_vcpu_info(%rbx),%rax
-        testb $0xFF,COMPAT_VCPUINFO_upcall_mask(%rax)
-        jnz   compat_restore_all_guest
-        testb $0xFF,COMPAT_VCPUINFO_upcall_pending(%rax)
-        jz    compat_restore_all_guest
+        movzwl COMPAT_VCPUINFO_upcall_pending(%rax),%eax
+        decl  %eax
+        cmpl  $0xfe,%eax
+        ja    compat_restore_all_guest
 /*compat_process_guest_events:*/
         sti
         leaq  VCPU_trap_bounce(%rbx),%rdx
diff -r 8c0aa97d529a -r dd40b43f16bc xen/arch/x86/x86_64/entry.S
--- a/xen/arch/x86/x86_64/entry.S	Wed Sep 12 10:19:34 2012 +0200
+++ b/xen/arch/x86/x86_64/entry.S	Wed Sep 12 10:20:18 2012 +0200
@@ -199,8 +199,8 @@ test_all_events:
         movl  VCPU_processor(%rbx),%eax
         shl   $IRQSTAT_shift,%rax
         leaq  irq_stat(%rip),%rcx
-        testl $~0,(%rcx,%rax,1)
-        jnz   process_softirqs
+        cmpl  $0,(%rcx,%rax,1)
+        jne   process_softirqs
         testb $1,VCPU_mce_pending(%rbx)
         jnz   process_mce
 .Ltest_guest_nmi:
@@ -208,10 +208,10 @@ test_all_events:
         jnz   process_nmi
 test_guest_events:
         movq  VCPU_vcpu_info(%rbx),%rax
-        testb $0xFF,VCPUINFO_upcall_mask(%rax)
-        jnz   restore_all_guest
-        testb $0xFF,VCPUINFO_upcall_pending(%rax)
-        jz    restore_all_guest
+        movzwl VCPUINFO_upcall_pending(%rax),%eax
+        decl  %eax
+        cmpl  $0xfe,%eax
+        ja    restore_all_guest
 /*process_guest_events:*/
         sti
         leaq  VCPU_trap_bounce(%rbx),%rdx

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:54 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYw-00046n-Df; Fri, 14 Sep 2012 10:55:54 +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 1TCTYu-0003vg-P2
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:53 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-27.messagelabs.com!1347620130!9736209!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3625 invoked from network); 14 Sep 2012 10:55:31 -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;
	14 Sep 2012 10: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 1TCTYY-000152-Bu
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYY-0000nT-9f
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:30 +0000
Message-Id: <E1TCTYY-0000nT-9f@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:29 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: use only a single branch for
	upcall-pending exit path checks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347438018 -7200
# Node ID dd40b43f16bc5bebd833d4cd2691a5b2a5fbef27
# Parent  8c0aa97d529a55de2ab96be1a5a6e9ed6a9c6bf0
x86: use only a single branch for upcall-pending exit path checks

This utilizes the fact that the two bytes of interest are adjacent to
one another and that the resulting 16-bit values of interest are within
a contiguous range of numbers.

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


diff -r 8c0aa97d529a -r dd40b43f16bc xen/arch/x86/x86_32/entry.S
--- a/xen/arch/x86/x86_32/entry.S	Wed Sep 12 10:19:34 2012 +0200
+++ b/xen/arch/x86/x86_32/entry.S	Wed Sep 12 10:20:18 2012 +0200
@@ -219,10 +219,10 @@ test_all_events:
         jnz  process_nmi
 test_guest_events:
         movl VCPU_vcpu_info(%ebx),%eax
-        testb $0xFF,VCPUINFO_upcall_mask(%eax)
-        jnz  restore_all_guest
-        testb $0xFF,VCPUINFO_upcall_pending(%eax)
-        jz   restore_all_guest
+        movzwl VCPUINFO_upcall_pending(%eax),%eax
+        decl %eax
+        cmpl $0xfe,%eax
+        ja   restore_all_guest
 /*process_guest_events:*/
         sti
         leal VCPU_trap_bounce(%ebx),%edx
diff -r 8c0aa97d529a -r dd40b43f16bc xen/arch/x86/x86_64/compat/entry.S
--- a/xen/arch/x86/x86_64/compat/entry.S	Wed Sep 12 10:19:34 2012 +0200
+++ b/xen/arch/x86/x86_64/compat/entry.S	Wed Sep 12 10:20:18 2012 +0200
@@ -108,10 +108,10 @@ ENTRY(compat_test_all_events)
         jnz   compat_process_nmi
 compat_test_guest_events:
         movq  VCPU_vcpu_info(%rbx),%rax
-        testb $0xFF,COMPAT_VCPUINFO_upcall_mask(%rax)
-        jnz   compat_restore_all_guest
-        testb $0xFF,COMPAT_VCPUINFO_upcall_pending(%rax)
-        jz    compat_restore_all_guest
+        movzwl COMPAT_VCPUINFO_upcall_pending(%rax),%eax
+        decl  %eax
+        cmpl  $0xfe,%eax
+        ja    compat_restore_all_guest
 /*compat_process_guest_events:*/
         sti
         leaq  VCPU_trap_bounce(%rbx),%rdx
diff -r 8c0aa97d529a -r dd40b43f16bc xen/arch/x86/x86_64/entry.S
--- a/xen/arch/x86/x86_64/entry.S	Wed Sep 12 10:19:34 2012 +0200
+++ b/xen/arch/x86/x86_64/entry.S	Wed Sep 12 10:20:18 2012 +0200
@@ -199,8 +199,8 @@ test_all_events:
         movl  VCPU_processor(%rbx),%eax
         shl   $IRQSTAT_shift,%rax
         leaq  irq_stat(%rip),%rcx
-        testl $~0,(%rcx,%rax,1)
-        jnz   process_softirqs
+        cmpl  $0,(%rcx,%rax,1)
+        jne   process_softirqs
         testb $1,VCPU_mce_pending(%rbx)
         jnz   process_mce
 .Ltest_guest_nmi:
@@ -208,10 +208,10 @@ test_all_events:
         jnz   process_nmi
 test_guest_events:
         movq  VCPU_vcpu_info(%rbx),%rax
-        testb $0xFF,VCPUINFO_upcall_mask(%rax)
-        jnz   restore_all_guest
-        testb $0xFF,VCPUINFO_upcall_pending(%rax)
-        jz    restore_all_guest
+        movzwl VCPUINFO_upcall_pending(%rax),%eax
+        decl  %eax
+        cmpl  $0xfe,%eax
+        ja    restore_all_guest
 /*process_guest_events:*/
         sti
         leaq  VCPU_trap_bounce(%rbx),%rdx

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:54 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYw-000470-HK; Fri, 14 Sep 2012 10:55:54 +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 1TCTYu-0003ve-Oq
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:53 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-27.messagelabs.com!1347620131!9736213!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3660 invoked from network); 14 Sep 2012 10:55:32 -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;
	14 Sep 2012 10: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 1TCTYZ-00015I-Gq
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYZ-0000nx-FJ
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:31 +0000
Message-Id: <E1TCTYZ-0000nx-FJ@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:30 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Revert 25843:51090fe1ab97 (x86/HVM:
	assorted RTC emulation adjustments)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich
# Date 1347449068 -7200
# Node ID 05d82fb18335ecf4abf5ab9483d2f9929e478a54
# Parent  35fa512c60b2bb8e907e4c7cd3a3ef98bc671cfb
Revert 25843:51090fe1ab97 (x86/HVM: assorted RTC emulation adjustments)

This was found to cause RHEL6 HVM guests to hang during shutdown.
---


diff -r 35fa512c60b2 -r 05d82fb18335 xen/arch/x86/hvm/rtc.c
--- a/xen/arch/x86/hvm/rtc.c	Wed Sep 12 10:21:21 2012 +0200
+++ b/xen/arch/x86/hvm/rtc.c	Wed Sep 12 13:24:28 2012 +0200
@@ -50,24 +50,11 @@ static void rtc_set_time(RTCState *s);
 static inline int from_bcd(RTCState *s, int a);
 static inline int convert_hour(RTCState *s, int hour);
 
-static void rtc_toggle_irq(RTCState *s)
-{
-    struct domain *d = vrtc_domain(s);
-
-    ASSERT(spin_is_locked(&s->lock));
-    s->hw.cmos_data[RTC_REG_C] |= RTC_IRQF;
-    hvm_isa_irq_deassert(d, RTC_IRQ);
-    hvm_isa_irq_assert(d, RTC_IRQ);
-}
-
-void rtc_periodic_interrupt(void *opaque)
+static void rtc_periodic_cb(struct vcpu *v, void *opaque)
 {
     RTCState *s = opaque;
-
     spin_lock(&s->lock);
-    s->hw.cmos_data[RTC_REG_C] |= RTC_PF;
-    if ( s->hw.cmos_data[RTC_REG_B] & RTC_PIE )
-        rtc_toggle_irq(s);
+    s->hw.cmos_data[RTC_REG_C] |= 0xc0;
     spin_unlock(&s->lock);
 }
 
@@ -81,25 +68,19 @@ static void rtc_timer_update(RTCState *s
     ASSERT(spin_is_locked(&s->lock));
 
     period_code = s->hw.cmos_data[RTC_REG_A] & RTC_RATE_SELECT;
-    switch ( s->hw.cmos_data[RTC_REG_A] & RTC_DIV_CTL )
+    if ( (period_code != 0) && (s->hw.cmos_data[RTC_REG_B] & RTC_PIE) )
     {
-    case RTC_REF_CLCK_32KHZ:
-        if ( (period_code != 0) && (period_code <= 2) )
+        if ( period_code <= 2 )
             period_code += 7;
-        /* fall through */
-    case RTC_REF_CLCK_1MHZ:
-    case RTC_REF_CLCK_4MHZ:
-        if ( period_code != 0 )
-        {
-            period = 1 << (period_code - 1); /* period in 32 Khz cycles */
-            period = DIV_ROUND(period * 1000000000ULL, 32768); /* in ns */
-            create_periodic_time(v, &s->pt, period, period, RTC_IRQ, NULL, s);
-            break;
-        }
-        /* fall through */
-    default:
+
+        period = 1 << (period_code - 1); /* period in 32 Khz cycles */
+        period = DIV_ROUND((period * 1000000000ULL), 32768); /* period in ns */
+        create_periodic_time(v, &s->pt, period, period, RTC_IRQ,
+                             rtc_periodic_cb, s);
+    }
+    else
+    {
         destroy_periodic_time(&s->pt);
-        break;
     }
 }
 
@@ -121,7 +102,7 @@ static void check_update_timer(RTCState 
         guest_usec = get_localtime_us(d) % USEC_PER_SEC;
         if (guest_usec >= (USEC_PER_SEC - 244))
         {
-            /* RTC is in update cycle */
+            /* RTC is in update cycle when enabling UIE */
             s->hw.cmos_data[RTC_REG_A] |= RTC_UIP;
             next_update_time = (USEC_PER_SEC - guest_usec) * NS_PER_USEC;
             expire_time = NOW() + next_update_time;
@@ -163,6 +144,7 @@ static void rtc_update_timer(void *opaqu
 static void rtc_update_timer2(void *opaque)
 {
     RTCState *s = opaque;
+    struct domain *d = vrtc_domain(s);
 
     spin_lock(&s->lock);
     if (!(s->hw.cmos_data[RTC_REG_B] & RTC_SET))
@@ -170,7 +152,11 @@ static void rtc_update_timer2(void *opaq
         s->hw.cmos_data[RTC_REG_C] |= RTC_UF;
         s->hw.cmos_data[RTC_REG_A] &= ~RTC_UIP;
         if ((s->hw.cmos_data[RTC_REG_B] & RTC_UIE))
-            rtc_toggle_irq(s);
+        {
+            s->hw.cmos_data[RTC_REG_C] |= RTC_IRQF;
+            hvm_isa_irq_deassert(d, RTC_IRQ);
+            hvm_isa_irq_assert(d, RTC_IRQ);
+        }
         check_update_timer(s);
     }
     spin_unlock(&s->lock);
@@ -189,18 +175,21 @@ static void alarm_timer_update(RTCState 
 
     stop_timer(&s->alarm_timer);
 
-    if ( !(s->hw.cmos_data[RTC_REG_B] & RTC_SET) )
+    if ((s->hw.cmos_data[RTC_REG_B] & RTC_AIE) &&
+            !(s->hw.cmos_data[RTC_REG_B] & RTC_SET))
     {
         s->current_tm = gmtime(get_localtime(d));
         rtc_copy_date(s);
 
         alarm_sec = from_bcd(s, s->hw.cmos_data[RTC_SECONDS_ALARM]);
         alarm_min = from_bcd(s, s->hw.cmos_data[RTC_MINUTES_ALARM]);
-        alarm_hour = convert_hour(s, s->hw.cmos_data[RTC_HOURS_ALARM]);
+        alarm_hour = from_bcd(s, s->hw.cmos_data[RTC_HOURS_ALARM]);
+        alarm_hour = convert_hour(s, alarm_hour);
 
         cur_sec = from_bcd(s, s->hw.cmos_data[RTC_SECONDS]);
         cur_min = from_bcd(s, s->hw.cmos_data[RTC_MINUTES]);
-        cur_hour = convert_hour(s, s->hw.cmos_data[RTC_HOURS]);
+        cur_hour = from_bcd(s, s->hw.cmos_data[RTC_HOURS]);
+        cur_hour = convert_hour(s, cur_hour);
 
         next_update_time = USEC_PER_SEC - (get_localtime_us(d) % USEC_PER_SEC);
         next_update_time = next_update_time * NS_PER_USEC + NOW();
@@ -354,6 +343,7 @@ static void alarm_timer_update(RTCState 
 static void rtc_alarm_cb(void *opaque)
 {
     RTCState *s = opaque;
+    struct domain *d = vrtc_domain(s);
 
     spin_lock(&s->lock);
     if (!(s->hw.cmos_data[RTC_REG_B] & RTC_SET))
@@ -361,7 +351,11 @@ static void rtc_alarm_cb(void *opaque)
         s->hw.cmos_data[RTC_REG_C] |= RTC_AF;
         /* alarm interrupt */
         if (s->hw.cmos_data[RTC_REG_B] & RTC_AIE)
-            rtc_toggle_irq(s);
+        {
+            s->hw.cmos_data[RTC_REG_C] |= RTC_IRQF;
+            hvm_isa_irq_deassert(d, RTC_IRQ);
+            hvm_isa_irq_assert(d, RTC_IRQ);
+        }
         alarm_timer_update(s);
     }
     spin_unlock(&s->lock);
@@ -371,7 +365,7 @@ static int rtc_ioport_write(void *opaque
 {
     RTCState *s = opaque;
     struct domain *d = vrtc_domain(s);
-    uint32_t orig, mask;
+    uint32_t orig;
 
     spin_lock(&s->lock);
 
@@ -423,7 +417,7 @@ static int rtc_ioport_write(void *opaque
             /* set mode: reset UIP mode */
             s->hw.cmos_data[RTC_REG_A] &= ~RTC_UIP;
             /* adjust cmos before stopping */
-            if (!(orig & RTC_SET))
+            if (!(s->hw.cmos_data[RTC_REG_B] & RTC_SET))
             {
                 s->current_tm = gmtime(get_localtime(d));
                 rtc_copy_date(s);
@@ -432,26 +426,22 @@ static int rtc_ioport_write(void *opaque
         else
         {
             /* if disabling set mode, update the time */
-            if ( orig & RTC_SET )
+            if ( s->hw.cmos_data[RTC_REG_B] & RTC_SET )
                 rtc_set_time(s);
         }
-        /*
-         * If the interrupt is already set when the interrupt becomes
-         * enabled, raise an interrupt immediately.
-         * NB: RTC_{A,P,U}IE == RTC_{A,P,U}F respectively.
-         */
-        for ( mask = RTC_UIE; mask <= RTC_PIE; mask <<= 1 )
-            if ( (data & mask) && !(orig & mask) &&
-                 (s->hw.cmos_data[RTC_REG_C] & mask) )
+        /* if the interrupt is already set when the interrupt become
+         * enabled, raise an interrupt immediately*/
+        if ((data & RTC_UIE) && !(s->hw.cmos_data[RTC_REG_B] & RTC_UIE))
+            if (s->hw.cmos_data[RTC_REG_C] & RTC_UF)
             {
-                rtc_toggle_irq(s);
-                break;
+                hvm_isa_irq_deassert(d, RTC_IRQ);
+                hvm_isa_irq_assert(d, RTC_IRQ);
             }
         s->hw.cmos_data[RTC_REG_B] = data;
-        if ( (data ^ orig) & RTC_SET )
-            check_update_timer(s);
-        if ( (data ^ orig) & (RTC_24H | RTC_DM_BINARY | RTC_SET) )
-            alarm_timer_update(s);
+        if ( (data ^ orig) & RTC_PIE )
+            rtc_timer_update(s);
+        check_update_timer(s);
+        alarm_timer_update(s);
         break;
     case RTC_REG_C:
     case RTC_REG_D:
@@ -466,7 +456,7 @@ static int rtc_ioport_write(void *opaque
 
 static inline int to_bcd(RTCState *s, int a)
 {
-    if ( s->hw.cmos_data[RTC_REG_B] & RTC_DM_BINARY )
+    if ( s->hw.cmos_data[RTC_REG_B] & 0x04 )
         return a;
     else
         return ((a / 10) << 4) | (a % 10);
@@ -474,7 +464,7 @@ static inline int to_bcd(RTCState *s, in
 
 static inline int from_bcd(RTCState *s, int a)
 {
-    if ( s->hw.cmos_data[RTC_REG_B] & RTC_DM_BINARY )
+    if ( s->hw.cmos_data[RTC_REG_B] & 0x04 )
         return a;
     else
         return ((a >> 4) * 10) + (a & 0x0f);
@@ -482,14 +472,12 @@ static inline int from_bcd(RTCState *s, 
 
 /* Hours in 12 hour mode are in 1-12 range, not 0-11.
  * So we need convert it before using it*/
-static inline int convert_hour(RTCState *s, int raw)
+static inline int convert_hour(RTCState *s, int hour)
 {
-    int hour = from_bcd(s, raw & 0x7f);
-
     if (!(s->hw.cmos_data[RTC_REG_B] & RTC_24H))
     {
         hour %= 12;
-        if (raw & 0x80)
+        if (s->hw.cmos_data[RTC_HOURS] & 0x80)
             hour += 12;
     }
     return hour;
@@ -508,7 +496,8 @@ static void rtc_set_time(RTCState *s)
     
     tm->tm_sec = from_bcd(s, s->hw.cmos_data[RTC_SECONDS]);
     tm->tm_min = from_bcd(s, s->hw.cmos_data[RTC_MINUTES]);
-    tm->tm_hour = convert_hour(s, s->hw.cmos_data[RTC_HOURS]);
+    tm->tm_hour = from_bcd(s, s->hw.cmos_data[RTC_HOURS] & 0x7f);
+    tm->tm_hour = convert_hour(s, tm->tm_hour);
     tm->tm_wday = from_bcd(s, s->hw.cmos_data[RTC_DAY_OF_WEEK]);
     tm->tm_mday = from_bcd(s, s->hw.cmos_data[RTC_DAY_OF_MONTH]);
     tm->tm_mon = from_bcd(s, s->hw.cmos_data[RTC_MONTH]) - 1;
diff -r 35fa512c60b2 -r 05d82fb18335 xen/arch/x86/hvm/vpt.c
--- a/xen/arch/x86/hvm/vpt.c	Wed Sep 12 10:21:21 2012 +0200
+++ b/xen/arch/x86/hvm/vpt.c	Wed Sep 12 13:24:28 2012 +0200
@@ -22,7 +22,6 @@
 #include <asm/hvm/vpt.h>
 #include <asm/event.h>
 #include <asm/apic.h>
-#include <asm/mc146818rtc.h>
 
 #define mode_is(d, name) \
     ((d)->arch.hvm_domain.params[HVM_PARAM_TIMER_MODE] == HVMPTM_##name)
@@ -219,7 +218,6 @@ void pt_update_irq(struct vcpu *v)
     struct periodic_time *pt, *temp, *earliest_pt = NULL;
     uint64_t max_lag = -1ULL;
     int irq, is_lapic;
-    void *pt_priv;
 
     spin_lock(&v->arch.hvm_vcpu.tm_lock);
 
@@ -253,14 +251,13 @@ void pt_update_irq(struct vcpu *v)
     earliest_pt->irq_issued = 1;
     irq = earliest_pt->irq;
     is_lapic = (earliest_pt->source == PTSRC_lapic);
-    pt_priv = earliest_pt->priv;
 
     spin_unlock(&v->arch.hvm_vcpu.tm_lock);
 
     if ( is_lapic )
+    {
         vlapic_set_irq(vcpu_vlapic(v), irq, 0);
-    else if ( irq == RTC_IRQ && pt_priv )
-        rtc_periodic_interrupt(pt_priv);
+    }
     else
     {
         hvm_isa_irq_deassert(v->domain, irq);
diff -r 35fa512c60b2 -r 05d82fb18335 xen/include/asm-x86/hvm/vpt.h
--- a/xen/include/asm-x86/hvm/vpt.h	Wed Sep 12 10:21:21 2012 +0200
+++ b/xen/include/asm-x86/hvm/vpt.h	Wed Sep 12 13:24:28 2012 +0200
@@ -181,7 +181,6 @@ void rtc_migrate_timers(struct vcpu *v);
 void rtc_deinit(struct domain *d);
 void rtc_reset(struct domain *d);
 void rtc_update_clock(struct domain *d);
-void rtc_periodic_interrupt(void *);
 
 void pmtimer_init(struct vcpu *v);
 void pmtimer_deinit(struct domain *d);

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:54 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYw-000470-HK; Fri, 14 Sep 2012 10:55:54 +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 1TCTYu-0003ve-Oq
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:53 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-27.messagelabs.com!1347620131!9736213!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3660 invoked from network); 14 Sep 2012 10:55:32 -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;
	14 Sep 2012 10: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 1TCTYZ-00015I-Gq
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYZ-0000nx-FJ
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:31 +0000
Message-Id: <E1TCTYZ-0000nx-FJ@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:30 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Revert 25843:51090fe1ab97 (x86/HVM:
	assorted RTC emulation adjustments)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich
# Date 1347449068 -7200
# Node ID 05d82fb18335ecf4abf5ab9483d2f9929e478a54
# Parent  35fa512c60b2bb8e907e4c7cd3a3ef98bc671cfb
Revert 25843:51090fe1ab97 (x86/HVM: assorted RTC emulation adjustments)

This was found to cause RHEL6 HVM guests to hang during shutdown.
---


diff -r 35fa512c60b2 -r 05d82fb18335 xen/arch/x86/hvm/rtc.c
--- a/xen/arch/x86/hvm/rtc.c	Wed Sep 12 10:21:21 2012 +0200
+++ b/xen/arch/x86/hvm/rtc.c	Wed Sep 12 13:24:28 2012 +0200
@@ -50,24 +50,11 @@ static void rtc_set_time(RTCState *s);
 static inline int from_bcd(RTCState *s, int a);
 static inline int convert_hour(RTCState *s, int hour);
 
-static void rtc_toggle_irq(RTCState *s)
-{
-    struct domain *d = vrtc_domain(s);
-
-    ASSERT(spin_is_locked(&s->lock));
-    s->hw.cmos_data[RTC_REG_C] |= RTC_IRQF;
-    hvm_isa_irq_deassert(d, RTC_IRQ);
-    hvm_isa_irq_assert(d, RTC_IRQ);
-}
-
-void rtc_periodic_interrupt(void *opaque)
+static void rtc_periodic_cb(struct vcpu *v, void *opaque)
 {
     RTCState *s = opaque;
-
     spin_lock(&s->lock);
-    s->hw.cmos_data[RTC_REG_C] |= RTC_PF;
-    if ( s->hw.cmos_data[RTC_REG_B] & RTC_PIE )
-        rtc_toggle_irq(s);
+    s->hw.cmos_data[RTC_REG_C] |= 0xc0;
     spin_unlock(&s->lock);
 }
 
@@ -81,25 +68,19 @@ static void rtc_timer_update(RTCState *s
     ASSERT(spin_is_locked(&s->lock));
 
     period_code = s->hw.cmos_data[RTC_REG_A] & RTC_RATE_SELECT;
-    switch ( s->hw.cmos_data[RTC_REG_A] & RTC_DIV_CTL )
+    if ( (period_code != 0) && (s->hw.cmos_data[RTC_REG_B] & RTC_PIE) )
     {
-    case RTC_REF_CLCK_32KHZ:
-        if ( (period_code != 0) && (period_code <= 2) )
+        if ( period_code <= 2 )
             period_code += 7;
-        /* fall through */
-    case RTC_REF_CLCK_1MHZ:
-    case RTC_REF_CLCK_4MHZ:
-        if ( period_code != 0 )
-        {
-            period = 1 << (period_code - 1); /* period in 32 Khz cycles */
-            period = DIV_ROUND(period * 1000000000ULL, 32768); /* in ns */
-            create_periodic_time(v, &s->pt, period, period, RTC_IRQ, NULL, s);
-            break;
-        }
-        /* fall through */
-    default:
+
+        period = 1 << (period_code - 1); /* period in 32 Khz cycles */
+        period = DIV_ROUND((period * 1000000000ULL), 32768); /* period in ns */
+        create_periodic_time(v, &s->pt, period, period, RTC_IRQ,
+                             rtc_periodic_cb, s);
+    }
+    else
+    {
         destroy_periodic_time(&s->pt);
-        break;
     }
 }
 
@@ -121,7 +102,7 @@ static void check_update_timer(RTCState 
         guest_usec = get_localtime_us(d) % USEC_PER_SEC;
         if (guest_usec >= (USEC_PER_SEC - 244))
         {
-            /* RTC is in update cycle */
+            /* RTC is in update cycle when enabling UIE */
             s->hw.cmos_data[RTC_REG_A] |= RTC_UIP;
             next_update_time = (USEC_PER_SEC - guest_usec) * NS_PER_USEC;
             expire_time = NOW() + next_update_time;
@@ -163,6 +144,7 @@ static void rtc_update_timer(void *opaqu
 static void rtc_update_timer2(void *opaque)
 {
     RTCState *s = opaque;
+    struct domain *d = vrtc_domain(s);
 
     spin_lock(&s->lock);
     if (!(s->hw.cmos_data[RTC_REG_B] & RTC_SET))
@@ -170,7 +152,11 @@ static void rtc_update_timer2(void *opaq
         s->hw.cmos_data[RTC_REG_C] |= RTC_UF;
         s->hw.cmos_data[RTC_REG_A] &= ~RTC_UIP;
         if ((s->hw.cmos_data[RTC_REG_B] & RTC_UIE))
-            rtc_toggle_irq(s);
+        {
+            s->hw.cmos_data[RTC_REG_C] |= RTC_IRQF;
+            hvm_isa_irq_deassert(d, RTC_IRQ);
+            hvm_isa_irq_assert(d, RTC_IRQ);
+        }
         check_update_timer(s);
     }
     spin_unlock(&s->lock);
@@ -189,18 +175,21 @@ static void alarm_timer_update(RTCState 
 
     stop_timer(&s->alarm_timer);
 
-    if ( !(s->hw.cmos_data[RTC_REG_B] & RTC_SET) )
+    if ((s->hw.cmos_data[RTC_REG_B] & RTC_AIE) &&
+            !(s->hw.cmos_data[RTC_REG_B] & RTC_SET))
     {
         s->current_tm = gmtime(get_localtime(d));
         rtc_copy_date(s);
 
         alarm_sec = from_bcd(s, s->hw.cmos_data[RTC_SECONDS_ALARM]);
         alarm_min = from_bcd(s, s->hw.cmos_data[RTC_MINUTES_ALARM]);
-        alarm_hour = convert_hour(s, s->hw.cmos_data[RTC_HOURS_ALARM]);
+        alarm_hour = from_bcd(s, s->hw.cmos_data[RTC_HOURS_ALARM]);
+        alarm_hour = convert_hour(s, alarm_hour);
 
         cur_sec = from_bcd(s, s->hw.cmos_data[RTC_SECONDS]);
         cur_min = from_bcd(s, s->hw.cmos_data[RTC_MINUTES]);
-        cur_hour = convert_hour(s, s->hw.cmos_data[RTC_HOURS]);
+        cur_hour = from_bcd(s, s->hw.cmos_data[RTC_HOURS]);
+        cur_hour = convert_hour(s, cur_hour);
 
         next_update_time = USEC_PER_SEC - (get_localtime_us(d) % USEC_PER_SEC);
         next_update_time = next_update_time * NS_PER_USEC + NOW();
@@ -354,6 +343,7 @@ static void alarm_timer_update(RTCState 
 static void rtc_alarm_cb(void *opaque)
 {
     RTCState *s = opaque;
+    struct domain *d = vrtc_domain(s);
 
     spin_lock(&s->lock);
     if (!(s->hw.cmos_data[RTC_REG_B] & RTC_SET))
@@ -361,7 +351,11 @@ static void rtc_alarm_cb(void *opaque)
         s->hw.cmos_data[RTC_REG_C] |= RTC_AF;
         /* alarm interrupt */
         if (s->hw.cmos_data[RTC_REG_B] & RTC_AIE)
-            rtc_toggle_irq(s);
+        {
+            s->hw.cmos_data[RTC_REG_C] |= RTC_IRQF;
+            hvm_isa_irq_deassert(d, RTC_IRQ);
+            hvm_isa_irq_assert(d, RTC_IRQ);
+        }
         alarm_timer_update(s);
     }
     spin_unlock(&s->lock);
@@ -371,7 +365,7 @@ static int rtc_ioport_write(void *opaque
 {
     RTCState *s = opaque;
     struct domain *d = vrtc_domain(s);
-    uint32_t orig, mask;
+    uint32_t orig;
 
     spin_lock(&s->lock);
 
@@ -423,7 +417,7 @@ static int rtc_ioport_write(void *opaque
             /* set mode: reset UIP mode */
             s->hw.cmos_data[RTC_REG_A] &= ~RTC_UIP;
             /* adjust cmos before stopping */
-            if (!(orig & RTC_SET))
+            if (!(s->hw.cmos_data[RTC_REG_B] & RTC_SET))
             {
                 s->current_tm = gmtime(get_localtime(d));
                 rtc_copy_date(s);
@@ -432,26 +426,22 @@ static int rtc_ioport_write(void *opaque
         else
         {
             /* if disabling set mode, update the time */
-            if ( orig & RTC_SET )
+            if ( s->hw.cmos_data[RTC_REG_B] & RTC_SET )
                 rtc_set_time(s);
         }
-        /*
-         * If the interrupt is already set when the interrupt becomes
-         * enabled, raise an interrupt immediately.
-         * NB: RTC_{A,P,U}IE == RTC_{A,P,U}F respectively.
-         */
-        for ( mask = RTC_UIE; mask <= RTC_PIE; mask <<= 1 )
-            if ( (data & mask) && !(orig & mask) &&
-                 (s->hw.cmos_data[RTC_REG_C] & mask) )
+        /* if the interrupt is already set when the interrupt become
+         * enabled, raise an interrupt immediately*/
+        if ((data & RTC_UIE) && !(s->hw.cmos_data[RTC_REG_B] & RTC_UIE))
+            if (s->hw.cmos_data[RTC_REG_C] & RTC_UF)
             {
-                rtc_toggle_irq(s);
-                break;
+                hvm_isa_irq_deassert(d, RTC_IRQ);
+                hvm_isa_irq_assert(d, RTC_IRQ);
             }
         s->hw.cmos_data[RTC_REG_B] = data;
-        if ( (data ^ orig) & RTC_SET )
-            check_update_timer(s);
-        if ( (data ^ orig) & (RTC_24H | RTC_DM_BINARY | RTC_SET) )
-            alarm_timer_update(s);
+        if ( (data ^ orig) & RTC_PIE )
+            rtc_timer_update(s);
+        check_update_timer(s);
+        alarm_timer_update(s);
         break;
     case RTC_REG_C:
     case RTC_REG_D:
@@ -466,7 +456,7 @@ static int rtc_ioport_write(void *opaque
 
 static inline int to_bcd(RTCState *s, int a)
 {
-    if ( s->hw.cmos_data[RTC_REG_B] & RTC_DM_BINARY )
+    if ( s->hw.cmos_data[RTC_REG_B] & 0x04 )
         return a;
     else
         return ((a / 10) << 4) | (a % 10);
@@ -474,7 +464,7 @@ static inline int to_bcd(RTCState *s, in
 
 static inline int from_bcd(RTCState *s, int a)
 {
-    if ( s->hw.cmos_data[RTC_REG_B] & RTC_DM_BINARY )
+    if ( s->hw.cmos_data[RTC_REG_B] & 0x04 )
         return a;
     else
         return ((a >> 4) * 10) + (a & 0x0f);
@@ -482,14 +472,12 @@ static inline int from_bcd(RTCState *s, 
 
 /* Hours in 12 hour mode are in 1-12 range, not 0-11.
  * So we need convert it before using it*/
-static inline int convert_hour(RTCState *s, int raw)
+static inline int convert_hour(RTCState *s, int hour)
 {
-    int hour = from_bcd(s, raw & 0x7f);
-
     if (!(s->hw.cmos_data[RTC_REG_B] & RTC_24H))
     {
         hour %= 12;
-        if (raw & 0x80)
+        if (s->hw.cmos_data[RTC_HOURS] & 0x80)
             hour += 12;
     }
     return hour;
@@ -508,7 +496,8 @@ static void rtc_set_time(RTCState *s)
     
     tm->tm_sec = from_bcd(s, s->hw.cmos_data[RTC_SECONDS]);
     tm->tm_min = from_bcd(s, s->hw.cmos_data[RTC_MINUTES]);
-    tm->tm_hour = convert_hour(s, s->hw.cmos_data[RTC_HOURS]);
+    tm->tm_hour = from_bcd(s, s->hw.cmos_data[RTC_HOURS] & 0x7f);
+    tm->tm_hour = convert_hour(s, tm->tm_hour);
     tm->tm_wday = from_bcd(s, s->hw.cmos_data[RTC_DAY_OF_WEEK]);
     tm->tm_mday = from_bcd(s, s->hw.cmos_data[RTC_DAY_OF_MONTH]);
     tm->tm_mon = from_bcd(s, s->hw.cmos_data[RTC_MONTH]) - 1;
diff -r 35fa512c60b2 -r 05d82fb18335 xen/arch/x86/hvm/vpt.c
--- a/xen/arch/x86/hvm/vpt.c	Wed Sep 12 10:21:21 2012 +0200
+++ b/xen/arch/x86/hvm/vpt.c	Wed Sep 12 13:24:28 2012 +0200
@@ -22,7 +22,6 @@
 #include <asm/hvm/vpt.h>
 #include <asm/event.h>
 #include <asm/apic.h>
-#include <asm/mc146818rtc.h>
 
 #define mode_is(d, name) \
     ((d)->arch.hvm_domain.params[HVM_PARAM_TIMER_MODE] == HVMPTM_##name)
@@ -219,7 +218,6 @@ void pt_update_irq(struct vcpu *v)
     struct periodic_time *pt, *temp, *earliest_pt = NULL;
     uint64_t max_lag = -1ULL;
     int irq, is_lapic;
-    void *pt_priv;
 
     spin_lock(&v->arch.hvm_vcpu.tm_lock);
 
@@ -253,14 +251,13 @@ void pt_update_irq(struct vcpu *v)
     earliest_pt->irq_issued = 1;
     irq = earliest_pt->irq;
     is_lapic = (earliest_pt->source == PTSRC_lapic);
-    pt_priv = earliest_pt->priv;
 
     spin_unlock(&v->arch.hvm_vcpu.tm_lock);
 
     if ( is_lapic )
+    {
         vlapic_set_irq(vcpu_vlapic(v), irq, 0);
-    else if ( irq == RTC_IRQ && pt_priv )
-        rtc_periodic_interrupt(pt_priv);
+    }
     else
     {
         hvm_isa_irq_deassert(v->domain, irq);
diff -r 35fa512c60b2 -r 05d82fb18335 xen/include/asm-x86/hvm/vpt.h
--- a/xen/include/asm-x86/hvm/vpt.h	Wed Sep 12 10:21:21 2012 +0200
+++ b/xen/include/asm-x86/hvm/vpt.h	Wed Sep 12 13:24:28 2012 +0200
@@ -181,7 +181,6 @@ void rtc_migrate_timers(struct vcpu *v);
 void rtc_deinit(struct domain *d);
 void rtc_reset(struct domain *d);
 void rtc_update_clock(struct domain *d);
-void rtc_periodic_interrupt(void *);
 
 void pmtimer_init(struct vcpu *v);
 void pmtimer_deinit(struct domain *d);

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:54 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYw-00047U-M0; Fri, 14 Sep 2012 10:55:54 +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 1TCTYv-0003w4-1B
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:53 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-27.messagelabs.com!1347620136!9736224!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3815 invoked from network); 14 Sep 2012 10:55:37 -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;
	14 Sep 2012 10: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 1TCTYd-00015q-R9
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYd-0000pS-PX
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:35 +0000
Message-Id: <E1TCTYd-0000pS-PX@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:35 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/passthrough: Fix corruption
	caused by race conditions between
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Andrew Cooper <andrew.cooper3@citrix.com>
# Date 1347474676 -3600
# Node ID 4fdaebea82d7c1d906df85eaf7fdab18625e8388
# Parent  485e6db28b93d69e33628635eb562ea6f5179c90
x86/passthrough: Fix corruption caused by race conditions between
device allocation and deallocation to a domain.

A toolstack, when dealing with a domain using PCIPassthrough, could
reasonably be expected to issue DOMCTL_deassign_device hypercalls to
remove all passed through devices before issuing a
DOMCTL_destroydomain hypercall to kill the domain.  In the case where
a toolstack is perhaps less sensible in this regard, the hypervisor
should not fall over.

In domain_kill(), pci_release_devices() searches the alldevs_list list
looking for PCI devices still assigned to the domain.  If the
toolstack has correctly deassigned all devices before killing the
domain, this loop does nothing.

However, if there are still devices attached to the domain, the loop
will call pci_cleanup_msi() without unbinding the pirq from the
domain.  This eventually calls destroy_irq() which xfree()'s the
action.

However, as the irq_desc->action pointer is abused in an unsafe
matter, without unbinding first (which at least correctly cleans up),
the action is actually an irq_guest_action_t* rather than an
irqaction*, meaning that the cpu_eoi_map is leaked, and eoi_timer is
free()'d while still being on a pcpu's inactive_timer list.  As a
result, when this free()'d memory gets reused, the inactive_timer list
becomes corrupt, and list_*** operations will corrupt hypervisor
memory.

If the above were not bad enough, the loop in pci_release_devices()
still leaves references to the irq it destroyed in
domain->arch.pirq_irq and irq_pirq, meaning that a later loop,
free_domain_pirqs(), which happens as a result of
complete_domain_destroy() will unbind and destroy all irqs which were
still bound to the domain, resulting in a double destroy of any irq
which was still bound to the domain at the point at which the
DOMCTL_destroydomain hypercall happened.

Because of the allocation of irqs from find_unassigned_irq(), the
lowest free irq number is going to be handed back from create_irq().

There is a further race condition between the original (incorrect)
call to destroy_irq() from pci_release_devices(), and the later call
to free_domain_pirqs() (which happens in a softirq context at some
point after the domain has officially died) during which the same irq
number (which is still referenced in a stale way in
domain->arch.pirq_irq and irq_pirq) has been allocated to a new domain
via a PHYSDEVOP_map_pirq hypercall (Say perhaps in the case of
rebooting a domain).

In this case, the cleanup for the dead domain will free the recently
bound irq under the feet of the new domain.  Furthermore, after the
irq has been incorrectly destroyed, the same domain with another
PHYSDEVOP_map_pirq hypercall can be allocated the same irq number as
before, leading to an error along the lines of:

../physdev.c:188: dom54: -1:-1 already mapped to 74

In this case, the pirq_irq and irq_pirq mappings get updated to the
new PCI device from the latter PHYSDEVOP_map_pirq hypercall, and the
IOMMU interrupt remapping registers get updated, leading to IOMMU
Primary Pending Fault due to source-id verification failure for
incoming interrupts from the passed through device.

The easy fix is to simply deassign the device in pci_release_devices()
and leave all the real cleanup to the free_domain_pirqs() which
correctly unbinds and destroys the irq without leaving stale
references around.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 485e6db28b93 -r 4fdaebea82d7 xen/drivers/passthrough/pci.c
--- a/xen/drivers/passthrough/pci.c	Wed Sep 12 17:55:27 2012 +0100
+++ b/xen/drivers/passthrough/pci.c	Wed Sep 12 19:31:16 2012 +0100
@@ -577,7 +577,6 @@ void pci_release_devices(struct domain *
     pci_clean_dpci_irqs(d);
     while ( (pdev = pci_get_pdev_by_domain(d, -1, -1, -1)) )
     {
-        pci_cleanup_msi(pdev);
         bus = pdev->bus;
         devfn = pdev->devfn;
         if ( deassign_device(d, pdev->seg, bus, devfn) )

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:54 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTYw-00047U-M0; Fri, 14 Sep 2012 10:55:54 +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 1TCTYv-0003w4-1B
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:53 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-27.messagelabs.com!1347620136!9736224!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3815 invoked from network); 14 Sep 2012 10:55:37 -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;
	14 Sep 2012 10: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 1TCTYd-00015q-R9
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYd-0000pS-PX
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:35 +0000
Message-Id: <E1TCTYd-0000pS-PX@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:35 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/passthrough: Fix corruption
	caused by race conditions between
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Andrew Cooper <andrew.cooper3@citrix.com>
# Date 1347474676 -3600
# Node ID 4fdaebea82d7c1d906df85eaf7fdab18625e8388
# Parent  485e6db28b93d69e33628635eb562ea6f5179c90
x86/passthrough: Fix corruption caused by race conditions between
device allocation and deallocation to a domain.

A toolstack, when dealing with a domain using PCIPassthrough, could
reasonably be expected to issue DOMCTL_deassign_device hypercalls to
remove all passed through devices before issuing a
DOMCTL_destroydomain hypercall to kill the domain.  In the case where
a toolstack is perhaps less sensible in this regard, the hypervisor
should not fall over.

In domain_kill(), pci_release_devices() searches the alldevs_list list
looking for PCI devices still assigned to the domain.  If the
toolstack has correctly deassigned all devices before killing the
domain, this loop does nothing.

However, if there are still devices attached to the domain, the loop
will call pci_cleanup_msi() without unbinding the pirq from the
domain.  This eventually calls destroy_irq() which xfree()'s the
action.

However, as the irq_desc->action pointer is abused in an unsafe
matter, without unbinding first (which at least correctly cleans up),
the action is actually an irq_guest_action_t* rather than an
irqaction*, meaning that the cpu_eoi_map is leaked, and eoi_timer is
free()'d while still being on a pcpu's inactive_timer list.  As a
result, when this free()'d memory gets reused, the inactive_timer list
becomes corrupt, and list_*** operations will corrupt hypervisor
memory.

If the above were not bad enough, the loop in pci_release_devices()
still leaves references to the irq it destroyed in
domain->arch.pirq_irq and irq_pirq, meaning that a later loop,
free_domain_pirqs(), which happens as a result of
complete_domain_destroy() will unbind and destroy all irqs which were
still bound to the domain, resulting in a double destroy of any irq
which was still bound to the domain at the point at which the
DOMCTL_destroydomain hypercall happened.

Because of the allocation of irqs from find_unassigned_irq(), the
lowest free irq number is going to be handed back from create_irq().

There is a further race condition between the original (incorrect)
call to destroy_irq() from pci_release_devices(), and the later call
to free_domain_pirqs() (which happens in a softirq context at some
point after the domain has officially died) during which the same irq
number (which is still referenced in a stale way in
domain->arch.pirq_irq and irq_pirq) has been allocated to a new domain
via a PHYSDEVOP_map_pirq hypercall (Say perhaps in the case of
rebooting a domain).

In this case, the cleanup for the dead domain will free the recently
bound irq under the feet of the new domain.  Furthermore, after the
irq has been incorrectly destroyed, the same domain with another
PHYSDEVOP_map_pirq hypercall can be allocated the same irq number as
before, leading to an error along the lines of:

../physdev.c:188: dom54: -1:-1 already mapped to 74

In this case, the pirq_irq and irq_pirq mappings get updated to the
new PCI device from the latter PHYSDEVOP_map_pirq hypercall, and the
IOMMU interrupt remapping registers get updated, leading to IOMMU
Primary Pending Fault due to source-id verification failure for
incoming interrupts from the passed through device.

The easy fix is to simply deassign the device in pci_release_devices()
and leave all the real cleanup to the free_domain_pirqs() which
correctly unbinds and destroys the irq without leaving stale
references around.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 485e6db28b93 -r 4fdaebea82d7 xen/drivers/passthrough/pci.c
--- a/xen/drivers/passthrough/pci.c	Wed Sep 12 17:55:27 2012 +0100
+++ b/xen/drivers/passthrough/pci.c	Wed Sep 12 19:31:16 2012 +0100
@@ -577,7 +577,6 @@ void pci_release_devices(struct domain *
     pci_clean_dpci_irqs(d);
     while ( (pdev = pci_get_pdev_by_domain(d, -1, -1, -1)) )
     {
-        pci_cleanup_msi(pdev);
         bus = pdev->bus;
         devfn = pdev->devfn;
         if ( deassign_device(d, pdev->seg, bus, devfn) )

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:59 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTZ1-0004Ee-D6; Fri, 14 Sep 2012 10:55:59 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYy-00049o-6d
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:57 +0000
Received: from [85.158.143.35:41482] by server-2.bemta-4.messagelabs.com id
	40/EE-21239-B3D03505; Fri, 14 Sep 2012 10:55:55 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-21.messagelabs.com!1347620132!15772755!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32203 invoked from network); 14 Sep 2012 10:55:34 -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;
	14 Sep 2012 10: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 1TCTYa-00015P-Kc
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYa-0000oC-G0
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:32 +0000
Message-Id: <E1TCTYa-0000oC-G0@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:31 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: Remove x86_32 build target.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============2863405308373449842=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============2863405308373449842==
Content-Type: text/plain

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347452970 -3600
# Node ID bc8cb47787025aaa987a5a01719d014d8ede8665
# Parent  05d82fb18335ecf4abf5ab9483d2f9929e478a54
xen: Remove x86_32 build target.

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r 05d82fb18335 -r bc8cb4778702 xen/Makefile
--- a/xen/Makefile	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/Makefile	Wed Sep 12 13:29:30 2012 +0100
@@ -22,7 +22,11 @@ dist: install
 
 .PHONY: build install uninstall clean distclean cscope TAGS tags MAP gtags
 build install uninstall debug clean distclean cscope TAGS tags MAP gtags::
+ifneq ($(XEN_TARGET_ARCH),x86_32)
 	$(MAKE) -f Rules.mk _$@
+else
+	echo "*** Xen x86/32 target no longer supported!"
+endif
 
 .PHONY: _build
 _build: $(TARGET).gz
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/Makefile
--- a/xen/arch/x86/Makefile	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/Makefile	Wed Sep 12 13:29:30 2012 +0100
@@ -5,7 +5,6 @@ subdir-y += hvm
 subdir-y += mm
 subdir-y += oprofile
 
-subdir-$(x86_32) += x86_32
 subdir-$(x86_64) += x86_64
 
 obj-y += apic.o
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/Rules.mk
--- a/xen/arch/x86/Rules.mk	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/Rules.mk	Wed Sep 12 13:29:30 2012 +0100
@@ -41,22 +41,15 @@ CFLAGS += -DCONFIG_X86_SUPERVISOR_MODE_K
 endif
 
 x86 := y
+x86_32 := n
+x86_64 := y
 
-ifeq ($(TARGET_SUBARCH),x86_32)
-x86_32 := y
-x86_64 := n
-endif
-
-ifeq ($(TARGET_SUBARCH),x86_64)
 CFLAGS += -mno-red-zone -mno-sse -fpic
 CFLAGS += -fno-asynchronous-unwind-tables
 # -fvisibility=hidden reduces -fpic cost, if it's available
 ifneq ($(call cc-option,$(CC),-fvisibility=hidden,n),n)
 CFLAGS += -DGCC_HAS_VISIBILITY_ATTRIBUTE
 endif
-x86_32 := n
-x86_64 := y
-endif
 
 # Require GCC v3.4+ (to avoid issues with alignment constraints in Xen headers)
 check-$(gcc) = $(call cc-ver-check,CC,0x030400,"Xen requires at least gcc-3.4")
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/acpi/boot.c
--- a/xen/arch/x86/acpi/boot.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/acpi/boot.c	Wed Sep 12 13:29:30 2012 +0100
@@ -583,183 +583,6 @@ static void __init acpi_process_madt(voi
 	return;
 }
 
-#ifdef __i386__
-
-static int __init disable_acpi_irq(struct dmi_system_id *d)
-{
-	if (!acpi_force) {
-		printk(KERN_NOTICE "%s detected: force use of acpi=noirq\n",
-		       d->ident);
-		acpi_noirq_set();
-	}
-	return 0;
-}
-
-static int __init dmi_disable_acpi(struct dmi_system_id *d)
-{
-	if (!acpi_force) {
-		printk(KERN_NOTICE "%s detected: acpi off\n", d->ident);
-		disable_acpi();
-	} else {
-		printk(KERN_NOTICE
-		       "Warning: DMI blacklist says broken, but acpi forced\n");
-	}
-	return 0;
-}
-
-/*
- * Limit ACPI to CPU enumeration for HT
- */
-static int __init force_acpi_ht(struct dmi_system_id *d)
-{
-	if (!acpi_force) {
-		printk(KERN_NOTICE "%s detected: force use of acpi=ht\n",
-		       d->ident);
-		disable_acpi();
-		acpi_ht = 1;
-	} else {
-		printk(KERN_NOTICE
-		       "Warning: acpi=force overrules DMI blacklist: acpi=ht\n");
-	}
-	return 0;
-}
-
-/*
- * If your system is blacklisted here, but you find that acpi=force
- * works for you, please contact acpi-devel@sourceforge.net
- */
-static struct dmi_system_id __initdata acpi_dmi_table[] = {
-	/*
-	 * Boxes that need ACPI disabled
-	 */
-	{
-	 .callback = dmi_disable_acpi,
-	 .ident = "IBM Thinkpad",
-	 .matches = {
-		     DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
-		     DMI_MATCH(DMI_BOARD_NAME, "2629H1G"),
-		     },
-	 },
-
-	/*
-	 * Boxes that need acpi=ht
-	 */
-	{
-	 .callback = force_acpi_ht,
-	 .ident = "FSC Primergy T850",
-	 .matches = {
-		     DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
-		     DMI_MATCH(DMI_PRODUCT_NAME, "PRIMERGY T850"),
-		     },
-	 },
-	{
-	 .callback = force_acpi_ht,
-	 .ident = "DELL GX240",
-	 .matches = {
-		     DMI_MATCH(DMI_BOARD_VENDOR, "Dell Computer Corporation"),
-		     DMI_MATCH(DMI_BOARD_NAME, "OptiPlex GX240"),
-		     },
-	 },
-	{
-	 .callback = force_acpi_ht,
-	 .ident = "HP VISUALIZE NT Workstation",
-	 .matches = {
-		     DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"),
-		     DMI_MATCH(DMI_PRODUCT_NAME, "HP VISUALIZE NT Workstation"),
-		     },
-	 },
-	{
-	 .callback = force_acpi_ht,
-	 .ident = "Compaq Workstation W8000",
-	 .matches = {
-		     DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
-		     DMI_MATCH(DMI_PRODUCT_NAME, "Workstation W8000"),
-		     },
-	 },
-	{
-	 .callback = force_acpi_ht,
-	 .ident = "ASUS P4B266",
-	 .matches = {
-		     DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
-		     DMI_MATCH(DMI_BOARD_NAME, "P4B266"),
-		     },
-	 },
-	{
-	 .callback = force_acpi_ht,
-	 .ident = "ASUS P2B-DS",
-	 .matches = {
-		     DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
-		     DMI_MATCH(DMI_BOARD_NAME, "P2B-DS"),
-		     },
-	 },
-	{
-	 .callback = force_acpi_ht,
-	 .ident = "ASUS CUR-DLS",
-	 .matches = {
-		     DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
-		     DMI_MATCH(DMI_BOARD_NAME, "CUR-DLS"),
-		     },
-	 },
-	{
-	 .callback = force_acpi_ht,
-	 .ident = "ABIT i440BX-W83977",
-	 .matches = {
-		     DMI_MATCH(DMI_BOARD_VENDOR, "ABIT <http://www.abit.com>"),
-		     DMI_MATCH(DMI_BOARD_NAME, "i440BX-W83977 (BP6)"),
-		     },
-	 },
-	{
-	 .callback = force_acpi_ht,
-	 .ident = "IBM Bladecenter",
-	 .matches = {
-		     DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
-		     DMI_MATCH(DMI_BOARD_NAME, "IBM eServer BladeCenter HS20"),
-		     },
-	 },
-	{
-	 .callback = force_acpi_ht,
-	 .ident = "IBM eServer xSeries 360",
-	 .matches = {
-		     DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
-		     DMI_MATCH(DMI_BOARD_NAME, "eServer xSeries 360"),
-		     },
-	 },
-	{
-	 .callback = force_acpi_ht,
-	 .ident = "IBM eserver xSeries 330",
-	 .matches = {
-		     DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
-		     DMI_MATCH(DMI_BOARD_NAME, "eserver xSeries 330"),
-		     },
-	 },
-	{
-	 .callback = force_acpi_ht,
-	 .ident = "IBM eserver xSeries 440",
-	 .matches = {
-		     DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
-		     DMI_MATCH(DMI_PRODUCT_NAME, "eserver xSeries 440"),
-		     },
-	 },
-
-	/*
-	 * Boxes that need ACPI PCI IRQ routing disabled
-	 */
-	{
-	 .callback = disable_acpi_irq,
-	 .ident = "ASUS A7V",
-	 .matches = {
-		     DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC"),
-		     DMI_MATCH(DMI_BOARD_NAME, "<A7V>"),
-		     /* newer BIOS, Revision 1011, does work */
-		     DMI_MATCH(DMI_BIOS_VERSION,
-			       "ASUS A7V ACPI BIOS Revision 1007"),
-		     },
-	 },
-	{}
-};
-
-#endif				/* __i386__ */
-
 /*
  * acpi_boot_table_init() and acpi_boot_init()
  *  called from setup_arch(), always.
@@ -785,10 +608,6 @@ int __init acpi_boot_table_init(void)
 {
 	int error;
 
-#ifdef __i386__
-	dmi_check_system(acpi_dmi_table);
-#endif
-
 	/*
 	 * If acpi_disabled, bail out
 	 * One exception: acpi=ht continues far enough to enumerate LAPICs
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/acpi/cpufreq/cpufreq.c
--- a/xen/arch/x86/acpi/cpufreq/cpufreq.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/acpi/cpufreq/cpufreq.c	Wed Sep 12 13:29:30 2012 +0100
@@ -311,35 +311,6 @@ unsigned int get_measured_perf(unsigned 
     saved->aperf.whole = readin.aperf.whole;
     saved->mperf.whole = readin.mperf.whole;
 
-#ifdef __i386__
-    /*
-     * We dont want to do 64 bit divide with 32 bit kernel
-     * Get an approximate value. Return failure in case we cannot get
-     * an approximate value.
-     */
-    if (unlikely(cur.aperf.split.hi || cur.mperf.split.hi)) {
-        int shift_count;
-        uint32_t h;
-
-        h = max_t(uint32_t, cur.aperf.split.hi, cur.mperf.split.hi);
-        shift_count = fls(h);
-
-        cur.aperf.whole >>= shift_count;
-        cur.mperf.whole >>= shift_count;
-    }
-
-    if (((unsigned long)(-1) / 100) < cur.aperf.split.lo) {
-        int shift_count = 7;
-        cur.aperf.split.lo >>= shift_count;
-        cur.mperf.split.lo >>= shift_count;
-    }
-
-    if (cur.aperf.split.lo && cur.mperf.split.lo)
-        perf_percent = (cur.aperf.split.lo * 100) / cur.mperf.split.lo;
-    else
-        perf_percent = 0;
-
-#else
     if (unlikely(((unsigned long)(-1) / 100) < cur.aperf.whole)) {
         int shift_count = 7;
         cur.aperf.whole >>= shift_count;
@@ -351,8 +322,6 @@ unsigned int get_measured_perf(unsigned 
     else
         perf_percent = 0;
 
-#endif
-
     retval = policy->cpuinfo.max_freq * perf_percent / 100;
 
     return retval;
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/acpi/suspend.c
--- a/xen/arch/x86/acpi/suspend.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/acpi/suspend.c	Wed Sep 12 13:29:30 2012 +0100
@@ -15,18 +15,15 @@
 #include <asm/i387.h>
 #include <xen/hypercall.h>
 
-#if defined(CONFIG_X86_64)
 static unsigned long saved_lstar, saved_cstar;
 static unsigned long saved_sysenter_esp, saved_sysenter_eip;
 static unsigned long saved_fs_base, saved_gs_base, saved_kernel_gs_base;
 static uint16_t saved_segs[4];
-#endif
 
 void save_rest_processor_state(void)
 {
     vcpu_save_fpu(current);
 
-#if defined(CONFIG_X86_64)
     asm volatile (
         "movw %%ds,(%0); movw %%es,2(%0); movw %%fs,4(%0); movw %%gs,6(%0)"
         : : "r" (saved_segs) : "memory" );
@@ -40,7 +37,6 @@ void save_rest_processor_state(void)
         rdmsrl(MSR_IA32_SYSENTER_ESP, saved_sysenter_esp);
         rdmsrl(MSR_IA32_SYSENTER_EIP, saved_sysenter_eip);
     }
-#endif
 }
 
 
@@ -50,7 +46,6 @@ void restore_rest_processor_state(void)
 
     load_TR();
 
-#if defined(CONFIG_X86_64)
     /* Recover syscall MSRs */
     wrmsrl(MSR_LSTAR, saved_lstar);
     wrmsrl(MSR_CSTAR, saved_cstar);
@@ -80,11 +75,6 @@ void restore_rest_processor_state(void)
         do_set_segment_base(SEGBASE_GS_USER_SEL, saved_segs[3]);
     }
 
-#else /* !defined(CONFIG_X86_64) */
-    if ( supervisor_mode_kernel && cpu_has_sep )
-        wrmsr(MSR_IA32_SYSENTER_ESP, &this_cpu(init_tss).esp1, 0);
-#endif
-
     /* Maybe load the debug registers. */
     BUG_ON(is_hvm_vcpu(curr));
     if ( !is_idle_vcpu(curr) && curr->arch.debugreg[7] )
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/acpi/wakeup_prot.S
--- a/xen/arch/x86/acpi/wakeup_prot.S	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/acpi/wakeup_prot.S	Wed Sep 12 13:29:30 2012 +0100
@@ -8,8 +8,6 @@
 #include <asm/page.h>
 #include <asm/msr.h>
 
-#if defined(__x86_64__)
-
         .code64
 
 #define GREG(x)         %r##x
@@ -20,20 +18,6 @@
 
 #define REF(x)          x(%rip)
 
-#else /* !defined(__x86_64__) */
-
-        .code32
-
-#define GREG(x)         %e##x
-#define SAVED_GREG(x)   saved_e##x
-#define DECLARE_GREG(x) saved_e##x:     .long   0
-#define SAVE_GREG(x)    movl GREG(x), SAVED_GREG(x)
-#define LOAD_GREG(x)    movl SAVED_GREG(x), GREG(x)
-
-#define REF(x)          x
-
-#endif
-
 ENTRY(do_suspend_lowlevel)
 
         SAVE_GREG(sp)
@@ -45,8 +29,6 @@ ENTRY(do_suspend_lowlevel)
         SAVE_GREG(si)
         SAVE_GREG(di)
 
-#if defined(__x86_64__)
-
         SAVE_GREG(8)     # save r8...r15
         SAVE_GREG(9)
         SAVE_GREG(10)
@@ -61,16 +43,6 @@ ENTRY(do_suspend_lowlevel)
         mov     %cr8, GREG(ax)
         mov     GREG(ax), REF(saved_cr8)
 
-#else /* !defined(__x86_64__) */
-
-        pushfl;
-        popl    SAVED_GREG(flags)
-
-        mov     %ds, REF(saved_ds)
-        mov     %es, REF(saved_es)
-
-#endif
-
         mov     %ss, REF(saved_ss)
 
         sgdt    REF(saved_gdt)
@@ -85,17 +57,9 @@ ENTRY(do_suspend_lowlevel)
 
         call    save_rest_processor_state
 
-#if defined(__x86_64__)
-
         mov     $3, %rdi
         xor     %eax, %eax
 
-#else /* !defined(__x86_64__) */
-
-        push    $3
-
-#endif
-
         /* enter sleep state physically */
         call    acpi_enter_sleep_state
         jmp     __ret_point
@@ -121,7 +85,6 @@ __ret_point:
         mov     REF(saved_ss), %ss
         LOAD_GREG(sp)
 
-#if defined(__x86_64__)
         /* Reload code selector */
         pushq   $(__HYPERVISOR_CS64)
         leaq    1f(%rip),%rax
@@ -134,17 +97,6 @@ 1:
         pushq   SAVED_GREG(flags)
         popfq
 
-#else /* !defined(__x86_64__) */
-
-        pushl   SAVED_GREG(flags)
-        popfl
-
-        /* No reload to fs/gs, which is saved in bottom stack already */
-        mov     REF(saved_ds), %ds
-        mov     REF(saved_es), %es
-
-#endif
-
         call restore_rest_processor_state
 
         LOAD_GREG(bp)
@@ -154,7 +106,6 @@ 1:
         LOAD_GREG(dx)
         LOAD_GREG(si)
         LOAD_GREG(di)
-#if defined(__x86_64__)
         LOAD_GREG(8)     # save r8...r15
         LOAD_GREG(9)
         LOAD_GREG(10)
@@ -163,7 +114,6 @@ 1:
         LOAD_GREG(13)
         LOAD_GREG(14)
         LOAD_GREG(15)
-#endif
         ret 
 
 .data
@@ -184,8 +134,6 @@ DECLARE_GREG(si)
 DECLARE_GREG(di)
 DECLARE_GREG(flags)
 
-#if defined(__x86_64__)
-
 DECLARE_GREG(8)
 DECLARE_GREG(9)
 DECLARE_GREG(10)
@@ -202,17 +150,3 @@ saved_ldt:      .quad   0,0
 saved_cr0:      .quad   0
 saved_cr3:      .quad   0
 saved_cr8:      .quad   0
-
-#else /* !defined(__x86_64__) */
-
-saved_gdt:      .long   0,0
-saved_idt:      .long   0,0
-saved_ldt:      .long   0
-
-saved_cr0:      .long   0
-saved_cr3:      .long   0
-
-saved_ds:       .word   0
-saved_es:       .word   0
-
-#endif 
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/boot/head.S
--- a/xen/arch/x86/boot/head.S	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/boot/head.S	Wed Sep 12 13:29:30 2012 +0100
@@ -119,7 +119,6 @@ 1:
 1:      mov     %edx,sym_phys(cpuid_ext_features)
         mov     %edx,sym_phys(boot_cpu_data)+CPUINFO86_ext_features
 
-#if defined(__x86_64__)
         /* Check for availability of long mode. */
         bt      $29,%edx
         jnc     bad_cpu
@@ -138,7 +137,6 @@ 1:      mov     %eax,(%edx)
         mov     $sym_phys(l1_identmap)+__PAGE_HYPERVISOR,%edi
         mov     %edi,sym_phys(l2_xenmap)
         mov     %edi,sym_phys(l2_bootmap)
-#endif
 
         /* Apply relocations to bootstrap trampoline. */
         mov     sym_phys(trampoline_phys),%edx
@@ -191,11 +189,7 @@ trampoline_end:
 
         .text
 __high_start:
-#ifdef __x86_64__
 #include "x86_64.S"
-#else
-#include "x86_32.S"
-#endif
 
         .section .data.page_aligned, "aw", @progbits
         .p2align PAGE_SHIFT
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/boot/trampoline.S
--- a/xen/arch/x86/boot/trampoline.S	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/boot/trampoline.S	Wed Sep 12 13:29:30 2012 +0100
@@ -109,8 +109,6 @@ 1:      wrmsr
         jmp     1f
 1:
 
-#if defined(__x86_64__)
-
         /* Now in compatibility mode. Long-jump into 64-bit mode. */
         ljmp    $BOOT_CS64,$bootsym_rel(start64,6)
 
@@ -123,20 +121,6 @@ start64:
 high_start:
         .quad   __high_start
 
-#else /* !defined(__x86_64__) */
-
-        /* Install relocated selectors. */
-        lgdt    gdt_descr
-        mov     $(__HYPERVISOR_DS),%eax
-        mov     %eax,%ds
-        mov     %eax,%es
-        mov     %eax,%fs
-        mov     %eax,%gs
-        mov     %eax,%ss
-        ljmp    $(__HYPERVISOR_CS),$__high_start
-
-#endif
-
         .code32
 trampoline_boot_cpu_entry:
         cmpb    $0,bootsym_rel(skip_realmode,5)
@@ -169,7 +153,6 @@ 1:      mov     %cs,%ax
         lidt    bootsym(rm_idt)
         sti
 
-#if defined(__x86_64__)
         /*
          * Declare that our target operating mode is long mode.
          * Initialise 32-bit registers since some buggy BIOSes depend on it.
@@ -177,7 +160,6 @@ 1:      mov     %cs,%ax
         movl    $0xec00,%eax      # declare target operating mode
         movl    $0x0002,%ebx      # long mode
         int     $0x15
-#endif
 
         /*
          * Do real-mode work:
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/boot/wakeup.S
--- a/xen/arch/x86/boot/wakeup.S	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/boot/wakeup.S	Wed Sep 12 13:29:30 2012 +0100
@@ -161,8 +161,6 @@ 1:      wrmsr
         jmp     1f
 1:
 
-#if defined(__x86_64__)
-
         /* Now in compatibility mode. Long-jump to 64-bit mode */
         ljmp    $BOOT_CS64, $bootsym_rel(wakeup_64,6)
 
@@ -175,16 +173,6 @@ wakeup_64:
 ret_point:
         .quad   __ret_point
 
-#else /* !defined(__x86_64__) */
-
-        lgdt    gdt_descr
-        mov     $(__HYPERVISOR_DS), %eax
-        mov     %eax, %ds
-
-        ljmp    $(__HYPERVISOR_CS), $__ret_point
-
-#endif
-
 bogus_saved_magic:
         movw    $0x0e00 + 'S', 0xb8014
         jmp     bogus_saved_magic
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/boot/x86_32.S
--- a/xen/arch/x86/boot/x86_32.S	Wed Sep 12 13:24:28 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,131 +0,0 @@
-        .code32
-        
-        /* Enable full CR4 features. */
-        mov     mmu_cr4_features,%eax
-        mov     %eax,%cr4
-        
-        /* Initialise stack. */
-        mov     stack_start,%esp
-        or      $(STACK_SIZE-CPUINFO_sizeof),%esp
-        
-        /* Reset EFLAGS (subsumes CLI and CLD). */
-        pushl   $0
-        popf
-
-        lidt    idt_descr
-
-        test    %ebx,%ebx
-        jnz     start_secondary
-
-        /* Initialise IDT with simple error defaults. */
-        lea     ignore_int,%edx
-        mov     $(__HYPERVISOR_CS << 16),%eax
-        mov     %dx,%ax            /* selector = 0x0010 = cs */
-        mov     $0x8E00,%dx        /* interrupt gate - dpl=0, present */
-        lea     idt_table,%edi
-        mov     $256,%ecx
-1:      mov     %eax,(%edi)
-        mov     %edx,4(%edi)
-        add     $8,%edi
-        loop    1b
-                
-        /* Pass off the Multiboot info structure to C land. */
-        pushl   multiboot_ptr
-        call    __start_xen
-        ud2     /* Force a panic (invalid opcode). */
-
-/* This is the default interrupt handler. */
-int_msg:
-        .asciz "Unknown interrupt (cr2=%08x)\n"
-hex_msg:
-        .asciz "  %08x"
-        ALIGN
-ignore_int:
-        pusha
-        cld
-        mov     $(__HYPERVISOR_DS),%eax
-        mov     %eax,%ds
-        mov     %eax,%es
-        mov     %cr2,%eax
-        push    %eax
-        pushl   $int_msg
-        call    printk
-        add     $8,%esp
-        mov     %esp,%ebp
-0:      pushl   (%ebp)
-        add     $4,%ebp
-        pushl   $hex_msg
-        call    printk
-        add     $8,%esp
-        test    $0xffc,%ebp
-        jnz     0b
-1:      jmp     1b
-
-        .data
-        ALIGN
-ENTRY(stack_start)
-        .long cpu0_stack
-        
-/*** DESCRIPTOR TABLES ***/
-
-        ALIGN
-multiboot_ptr:
-        .long   0
-        
-        .word   0    
-idt_descr:
-        .word   256*8-1
-        .long   idt_table
-
-        .word   0
-gdt_descr:
-        .word   LAST_RESERVED_GDT_BYTE
-        .long   boot_cpu_gdt_table - FIRST_RESERVED_GDT_BYTE
-
-
-        .align 32
-ENTRY(idle_pg_table)
-        .long sym_phys(idle_pg_table_l2) + 0*PAGE_SIZE + 0x01, 0
-        .long sym_phys(idle_pg_table_l2) + 1*PAGE_SIZE + 0x01, 0
-        .long sym_phys(idle_pg_table_l2) + 2*PAGE_SIZE + 0x01, 0
-        .long sym_phys(idle_pg_table_l2) + 3*PAGE_SIZE + 0x01, 0
-
-        .section .data.page_aligned, "aw", @progbits
-        .align PAGE_SIZE, 0
-/* NB. Rings != 0 get access up to MACH2PHYS_VIRT_END. This allows access to */
-/*     the machine->physical mapping table. Ring 0 can access all memory.    */
-#define GUEST_DESC(d)                                                   \
-        .long ((MACH2PHYS_VIRT_END - 1) >> 12) & 0xffff,                \
-              ((MACH2PHYS_VIRT_END - 1) >> 12) & (0xf << 16) | (d)
-ENTRY(boot_cpu_gdt_table)
-        .quad 0x0000000000000000     /* double fault TSS */
-        .quad 0x00cf9a000000ffff     /* 0xe008 ring 0 4.00GB code at 0x0 */
-        .quad 0x00cf92000000ffff     /* 0xe010 ring 0 4.00GB data at 0x0 */
-        GUEST_DESC(0x00c0ba00)       /* 0xe019 ring 1 3.xxGB code at 0x0 */
-        GUEST_DESC(0x00c0b200)       /* 0xe021 ring 1 3.xxGB data at 0x0 */
-        GUEST_DESC(0x00c0fa00)       /* 0xe02b ring 3 3.xxGB code at 0x0 */
-        GUEST_DESC(0x00c0f200)       /* 0xe033 ring 3 3.xxGB data at 0x0 */
-        .fill (PER_CPU_GDT_ENTRY - FLAT_RING3_DS / 8 - 1), 8, 0
-        .quad 0x0000910000000000     /* per-CPU entry (limit == cpu) */
-        .align PAGE_SIZE,0
-
-#define PAGE_HYPERVISOR         __PAGE_HYPERVISOR
-#define PAGE_HYPERVISOR_NOCACHE __PAGE_HYPERVISOR_NOCACHE
-
-/* Mapping of first 16 megabytes of memory. */
-        .globl idle_pg_table_l2
-idle_pg_table_l2:
-        range = 8
-        .irp count, l2_linear_offset(__PAGE_OFFSET), \
-                    (4 * L2_PAGETABLE_ENTRIES - l2_linear_offset(__PAGE_OFFSET) - 1)
-        .long sym_phys(l1_identmap) + PAGE_HYPERVISOR, 0
-        pfn = 1 << PAGETABLE_ORDER
-        .rept range - 1
-        .long (pfn << PAGE_SHIFT) | PAGE_HYPERVISOR | _PAGE_PSE, 0
-        pfn = pfn + (1 << PAGETABLE_ORDER)
-        .endr
-        .fill \count - range, 8, 0
-        range = DIRECTMAP_MBYTES / 2
-        .endr
-        .long sym_phys(l1_fixmap) + PAGE_HYPERVISOR, 0
-        .size idle_pg_table_l2, . - idle_pg_table_l2
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/clear_page.S
--- a/xen/arch/x86/clear_page.S	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/clear_page.S	Wed Sep 12 13:29:30 2012 +0100
@@ -1,16 +1,9 @@
 #include <xen/config.h>
 #include <asm/page.h>
 
-#ifdef __i386__
-#define ptr_reg %edx
-#else
 #define ptr_reg %rdi
-#endif
 
 ENTRY(clear_page_sse2)
-#ifdef __i386__
-        mov     4(%esp), ptr_reg
-#endif
         mov     $PAGE_SIZE/16, %ecx
         xor     %eax,%eax
 
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/copy_page.S
--- a/xen/arch/x86/copy_page.S	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/copy_page.S	Wed Sep 12 13:29:30 2012 +0100
@@ -1,15 +1,6 @@
 #include <xen/config.h>
 #include <asm/page.h>
 
-#ifdef __i386__
-#define src_reg %esi
-#define dst_reg %edi
-#define WORD_SIZE 4
-#define tmp1_reg %eax
-#define tmp2_reg %edx
-#define tmp3_reg %ebx
-#define tmp4_reg %ebp
-#else
 #define src_reg %rsi
 #define dst_reg %rdi
 #define WORD_SIZE 8
@@ -17,17 +8,8 @@
 #define tmp2_reg %r9
 #define tmp3_reg %r10
 #define tmp4_reg %r11
-#endif
 
 ENTRY(copy_page_sse2)
-#ifdef __i386__
-        push    %ebx
-        push    %ebp
-        push    %esi
-        push    %edi
-        mov     6*4(%esp), src_reg
-        mov     5*4(%esp), dst_reg
-#endif
         mov     $PAGE_SIZE/(4*WORD_SIZE)-3, %ecx
 
         prefetchnta 2*4*WORD_SIZE(src_reg)
@@ -56,11 +38,5 @@ 1:      add     $4*WORD_SIZE, src_reg
         movnti  tmp3_reg, 2*WORD_SIZE(dst_reg)
         movnti  tmp4_reg, 3*WORD_SIZE(dst_reg)
 
-#ifdef __i386__
-        pop     %edi
-        pop     %esi
-        pop     %ebp
-        pop     %ebx
-#endif
         sfence
         ret
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/cpu/Makefile
--- a/xen/arch/x86/cpu/Makefile	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/cpu/Makefile	Wed Sep 12 13:29:30 2012 +0100
@@ -6,6 +6,5 @@ obj-y += common.o
 obj-y += intel.o
 obj-y += intel_cacheinfo.o
 
-obj-$(x86_32) += centaur.o
-obj-$(x86_32) += cyrix.o
-obj-$(x86_32) += transmeta.o
+# Keeping around for VIA support (JBeulich)
+# obj-$(x86_32) += centaur.o
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/cpu/amd.c
--- a/xen/arch/x86/cpu/amd.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/cpu/amd.c	Wed Sep 12 13:29:30 2012 +0100
@@ -32,11 +32,9 @@
 static char opt_famrev[14];
 string_param("cpuid_mask_cpu", opt_famrev);
 
-#ifdef __x86_64__
 /* 1 = allow, 0 = don't allow guest creation, -1 = don't allow boot */
 s8 __read_mostly opt_allow_unsafe;
 boolean_param("allow_unsafe", opt_allow_unsafe);
-#endif
 
 static inline void wrmsr_amd(unsigned int index, unsigned int lo, 
 		unsigned int hi)
@@ -400,7 +398,6 @@ static void __devinit init_amd(struct cp
 	   3DNow is IDd by bit 31 in extended CPUID (1*32+31) anyway */
 	clear_bit(0*32+31, c->x86_capability);
 	
-#ifdef CONFIG_X86_64
 	if (c->x86 == 0xf && c->x86_model < 0x14
 	    && cpu_has(c, X86_FEATURE_LAHF_LM)) {
 		/*
@@ -416,7 +413,6 @@ static void __devinit init_amd(struct cp
 			wrmsr_amd_safe(0xc001100d, lo, hi);
 		}
 	}
-#endif
 
 	switch(c->x86)
 	{
@@ -498,7 +494,6 @@ static void __devinit init_amd(struct cp
 	if (c->x86 >= 0x10 && !force_mwait)
 		clear_bit(X86_FEATURE_MWAIT, c->x86_capability);
 
-#ifdef __x86_64__
 	if (!cpu_has_amd_erratum(c, AMD_ERRATUM_121))
 		opt_allow_unsafe = 1;
 	else if (opt_allow_unsafe < 0)
@@ -523,7 +518,6 @@ static void __devinit init_amd(struct cp
 
 		fam10h_check_enable_mmcfg();
 	}
-#endif
 
 	/*
 	 * Family 0x12 and above processors have APIC timer
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/cpu/common.c
--- a/xen/arch/x86/cpu/common.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/cpu/common.c	Wed Sep 12 13:29:30 2012 +0100
@@ -281,31 +281,6 @@ static void __cpuinit generic_identify(s
 #endif
 }
 
-#ifdef __i386__
-
-static bool_t __cpuinitdata disable_x86_fxsr;
-boolean_param("nofxsr", disable_x86_fxsr);
-
-static bool_t __cpuinitdata disable_x86_serial_nr;
-boolean_param("noserialnumber", disable_x86_serial_nr);
-
-static void __cpuinit squash_the_stupid_serial_number(struct cpuinfo_x86 *c)
-{
-	if (cpu_has(c, X86_FEATURE_PN) && disable_x86_serial_nr ) {
-		/* Disable processor serial number */
-		uint64_t msr_content;
-		rdmsrl(MSR_IA32_BBL_CR_CTL,msr_content);
-		wrmsrl(MSR_IA32_BBL_CR_CTL, msr_content | 0x200000);
-		printk(KERN_NOTICE "CPU serial number disabled.\n");
-		clear_bit(X86_FEATURE_PN, c->x86_capability);
-
-		/* Disabling the serial number may affect the cpuid level */
-		c->cpuid_level = cpuid_eax(0);
-	}
-}
-
-#endif
-
 /*
  * This does the hard work of actually picking apart the CPU stuff...
  */
@@ -372,20 +347,6 @@ void __cpuinit identify_cpu(struct cpuin
 	 * we do "generic changes."
 	 */
 
-#ifdef __i386__
-	/* Disable the PN if appropriate */
-	squash_the_stupid_serial_number(c);
-
-	/* FXSR disabled? */
-	if (disable_x86_fxsr) {
-		clear_bit(X86_FEATURE_FXSR, c->x86_capability);
-		if (!cpu_has_xsave) {
-			clear_bit(X86_FEATURE_XMM, c->x86_capability);
-			clear_bit(X86_FEATURE_AES, c->x86_capability);
-		}
-	}
-#endif
-
 	for (i = 0 ; i < NCAPINTS ; ++i)
 		c->x86_capability[i] &= ~cleared_caps[i];
 
@@ -602,12 +563,6 @@ void __init early_cpu_init(void)
 {
 	intel_cpu_init();
 	amd_init_cpu();
-#ifdef CONFIG_X86_32
-	cyrix_init_cpu();
-	nsc_init_cpu();
-	centaur_init_cpu();
-	transmeta_init_cpu();
-#endif
 	early_cpu_detect();
 }
 /*
@@ -648,16 +603,9 @@ void __cpuinit cpu_init(void)
 
 	/* Set up and load the per-CPU TSS and LDT. */
 	t->bitmap = IOBMP_INVALID_OFFSET;
-#if defined(CONFIG_X86_32)
-	t->ss0  = __HYPERVISOR_DS;
-	t->esp0 = get_stack_bottom();
-	if ( supervisor_mode_kernel && cpu_has_sep )
-		wrmsr(MSR_IA32_SYSENTER_ESP, &t->esp1, 0);
-#elif defined(CONFIG_X86_64)
 	/* Bottom-of-stack must be 16-byte aligned! */
 	BUG_ON((get_stack_bottom() & 15) != 0);
 	t->rsp0 = get_stack_bottom();
-#endif
 	load_TR();
 	asm volatile ( "lldt %%ax" : : "a" (0) );
 
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/cpu/cyrix.c
--- a/xen/arch/x86/cpu/cyrix.c	Wed Sep 12 13:24:28 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,313 +0,0 @@
-#include <xen/config.h>
-#include <xen/init.h>
-#include <xen/irq.h>
-#include <xen/bitops.h>
-#include <xen/delay.h>
-#include <asm/io.h>
-#include <asm/processor.h>
-
-#include "cpu.h"
-
-/*
- * Read NSC/Cyrix DEVID registers (DIR) to get more detailed info. about the CPU
- */
-void __init do_cyrix_devid(unsigned char *dir0, unsigned char *dir1)
-{
-	unsigned char ccr3;
-	unsigned long flags;
-	
-	/* we test for DEVID by checking whether CCR3 is writable */
-	local_irq_save(flags);
-	ccr3 = getCx86(CX86_CCR3);
-	setCx86(CX86_CCR3, ccr3 ^ 0x80);
-	getCx86(0xc0);   /* dummy to change bus */
-
-	if (getCx86(CX86_CCR3) == ccr3)       /* no DEVID regs. */
-		BUG();
-	else {
-		setCx86(CX86_CCR3, ccr3);  /* restore CCR3 */
-
-		/* read DIR0 and DIR1 CPU registers */
-		*dir0 = getCx86(CX86_DIR0);
-		*dir1 = getCx86(CX86_DIR1);
-	}
-	local_irq_restore(flags);
-}
-
-/*
- * Cx86_dir0_msb is a HACK needed by check_cx686_cpuid/slop in bugs.h in
- * order to identify the Cyrix CPU model after we're out of setup.c
- *
- * Actually since bugs.h doesn't even reference this perhaps someone should
- * fix the documentation ???
- */
-static unsigned char Cx86_dir0_msb __initdata = 0;
-
-static char Cx86_model[][9] __initdata = {
-	"Cx486", "Cx486", "5x86 ", "6x86", "MediaGX ", "6x86MX ",
-	"M II ", "Unknown"
-};
-static char Cx86_cb[] __initdata = "?.5x Core/Bus Clock";
-static char cyrix_model_mult1[] __initdata = "12??43";
-static char cyrix_model_mult2[] __initdata = "12233445";
-
-/*
- * Reset the slow-loop (SLOP) bit on the 686(L) which is set by some old
- * BIOSes for compatibility with DOS games.  This makes the udelay loop
- * work correctly, and improves performance.
- *
- * FIXME: our newer udelay uses the tsc. We don't need to frob with SLOP
- */
-
-static void __init check_cx686_slop(struct cpuinfo_x86 *c)
-{
-	unsigned long flags;
-	
-	if (Cx86_dir0_msb == 3) {
-		unsigned char ccr3, ccr5;
-
-		local_irq_save(flags);
-		ccr3 = getCx86(CX86_CCR3);
-		setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10); /* enable MAPEN  */
-		ccr5 = getCx86(CX86_CCR5);
-		if (ccr5 & 2)
-			setCx86(CX86_CCR5, ccr5 & 0xfd);  /* reset SLOP */
-		setCx86(CX86_CCR3, ccr3);                 /* disable MAPEN */
-		local_irq_restore(flags);
-	}
-}
-
-
-static void __init set_cx86_reorder(void)
-{
-	u8 ccr3;
-
-	printk(KERN_INFO "Enable Memory access reorder on Cyrix/NSC processor.\n");
-	ccr3 = getCx86(CX86_CCR3);
-	setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10); /* enable MAPEN  */
-
-	/* Load/Store Serialize to mem access disable (=reorder it)  */
-	setCx86(CX86_PCR0, getCx86(CX86_PCR0) & ~0x80);
-	/* set load/store serialize from 1GB to 4GB */
-	ccr3 |= 0xe0;
-	setCx86(CX86_CCR3, ccr3);
-}
-
-static void __init set_cx86_memwb(void)
-{
-	u32 cr0;
-
-	printk(KERN_INFO "Enable Memory-Write-back mode on Cyrix/NSC processor.\n");
-
-	/* CCR2 bit 2: unlock NW bit */
-	setCx86(CX86_CCR2, getCx86(CX86_CCR2) & ~0x04);
-	/* set 'Not Write-through' */
-	cr0 = 0x20000000;
-	__asm__("movl %%cr0,%%eax\n\t"
-		"orl %0,%%eax\n\t"
-		"movl %%eax,%%cr0\n"
-		: : "r" (cr0)
-		:"ax");
-	/* CCR2 bit 2: lock NW bit and set WT1 */
-	setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x14 );
-}
-
-static void __init set_cx86_inc(void)
-{
-	unsigned char ccr3;
-
-	printk(KERN_INFO "Enable Incrementor on Cyrix/NSC processor.\n");
-
-	ccr3 = getCx86(CX86_CCR3);
-	setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10); /* enable MAPEN  */
-	/* PCR1 -- Performance Control */
-	/* Incrementor on, whatever that is */
-	setCx86(CX86_PCR1, getCx86(CX86_PCR1) | 0x02);
-	/* PCR0 -- Performance Control */
-	/* Incrementor Margin 10 */
-	setCx86(CX86_PCR0, getCx86(CX86_PCR0) | 0x04);
-	setCx86(CX86_CCR3, ccr3);	/* disable MAPEN */
-}
-
-/*
- *	Configure later MediaGX and/or Geode processor.
- */
-
-static void __init geode_configure(void)
-{
-	unsigned long flags;
-	u8 ccr3, ccr4;
-	local_irq_save(flags);
-
-	/* Suspend on halt power saving and enable #SUSP pin */
-	setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x88);
-
-	ccr3 = getCx86(CX86_CCR3);
-	setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10);	/* Enable */
-	
-	ccr4 = getCx86(CX86_CCR4);
-	ccr4 |= 0x38;		/* FPU fast, DTE cache, Mem bypass */
-	
-	setCx86(CX86_CCR3, ccr3);
-	
-	set_cx86_memwb();
-	set_cx86_reorder();	
-	set_cx86_inc();
-	
-	local_irq_restore(flags);
-}
-
-
-static void __init init_cyrix(struct cpuinfo_x86 *c)
-{
-	unsigned char dir0, dir0_msn, dir0_lsn, dir1 = 0;
-	const char *p = NULL;
-
-	/* Bit 31 in normal CPUID used for nonstandard 3DNow ID;
-	   3DNow is IDd by bit 31 in extended CPUID (1*32+31) anyway */
-	clear_bit(0*32+31, c->x86_capability);
-
-	/* Cyrix used bit 24 in extended (AMD) CPUID for Cyrix MMX extensions */
-	if ( test_bit(1*32+24, c->x86_capability) ) {
-		clear_bit(1*32+24, c->x86_capability);
-		set_bit(X86_FEATURE_CXMMX, c->x86_capability);
-	}
-
-	do_cyrix_devid(&dir0, &dir1);
-
-	check_cx686_slop(c);
-
-	Cx86_dir0_msb = dir0_msn = dir0 >> 4; /* identifies CPU "family"   */
-	dir0_lsn = dir0 & 0xf;                /* model or clock multiplier */
-
-	/* common case step number/rev -- exceptions handled below */
-	c->x86_model = (dir1 >> 4) + 1;
-	c->x86_mask = dir1 & 0xf;
-
-	/* Now cook; the original recipe is by Channing Corn, from Cyrix.
-	 * We do the same thing for each generation: we work out
-	 * the model, multiplier and stepping.  Black magic included,
-	 * to make the silicon step/rev numbers match the printed ones.
-	 */
-	 
-	switch (dir0_msn) {
-		unsigned char tmp;
-
-	case 3: /* 6x86/6x86L */
-		Cx86_cb[1] = ' ';
-		Cx86_cb[2] = cyrix_model_mult1[dir0_lsn & 5];
-		if (dir1 > 0x21) { /* 686L */
-			Cx86_cb[0] = 'L';
-			p = Cx86_cb;
-			(c->x86_model)++;
-		} else             /* 686 */
-			p = Cx86_cb+1;
-		/* Emulate MTRRs using Cyrix's ARRs. */
-		set_bit(X86_FEATURE_CYRIX_ARR, c->x86_capability);
-		/* 6x86's contain this bug */
-		/*c->coma_bug = 1;*/
-		break;
-
-	case 4: /* MediaGX/GXm or Geode GXM/GXLV/GX1 */
-		c->x86_cache_size=16;	/* Yep 16K integrated cache thats it */
- 
-		/* GXm supports extended cpuid levels 'ala' AMD */
-		if (c->cpuid_level == 2) {
-			/* Enable cxMMX extensions (GX1 Datasheet 54) */
-			setCx86(CX86_CCR7, getCx86(CX86_CCR7)|1);
-			
-			/* GXlv/GXm/GX1 */
-			if((dir1 >= 0x50 && dir1 <= 0x54) || dir1 >= 0x63)
-				geode_configure();
-			get_model_name(c);  /* get CPU marketing name */
-			return;
-		}
-		else {  /* MediaGX */
-			Cx86_cb[2] = (dir0_lsn & 1) ? '3' : '4';
-			p = Cx86_cb+2;
-			c->x86_model = (dir1 & 0x20) ? 1 : 2;
-		}
-		break;
-
-        case 5: /* 6x86MX/M II */
-		if (dir1 > 7)
-		{
-			dir0_msn++;  /* M II */
-			/* Enable MMX extensions (App note 108) */
-			setCx86(CX86_CCR7, getCx86(CX86_CCR7)|1);
-		}
-		else
-		{
-			/*c->coma_bug = 1;*/      /* 6x86MX, it has the bug. */
-		}
-		tmp = (!(dir0_lsn & 7) || dir0_lsn & 1) ? 2 : 0;
-		Cx86_cb[tmp] = cyrix_model_mult2[dir0_lsn & 7];
-		p = Cx86_cb+tmp;
-        	if (((dir1 & 0x0f) > 4) || ((dir1 & 0xf0) == 0x20))
-			(c->x86_model)++;
-		/* Emulate MTRRs using Cyrix's ARRs. */
-		set_bit(X86_FEATURE_CYRIX_ARR, c->x86_capability);
-		break;
-
-	default:  /* unknown (shouldn't happen, we know everyone ;-) */
-		dir0_msn = 7;
-		break;
-	}
-	safe_strcpy(c->x86_model_id, Cx86_model[dir0_msn & 7]);
-	if (p) safe_strcat(c->x86_model_id, p);
-	return;
-}
-
-/*
- * Cyrix CPUs without cpuid or with cpuid not yet enabled can be detected
- * by the fact that they preserve the flags across the division of 5/2.
- * PII and PPro exhibit this behavior too, but they have cpuid available.
- */
- 
-/*
- * Perform the Cyrix 5/2 test. A Cyrix won't change
- * the flags, while other 486 chips will.
- */
-static inline int test_cyrix_52div(void)
-{
-	unsigned int test;
-
-	__asm__ __volatile__(
-	     "sahf\n\t"		/* clear flags (%eax = 0x0005) */
-	     "div %b2\n\t"	/* divide 5 by 2 */
-	     "lahf"		/* store flags into %ah */
-	     : "=a" (test)
-	     : "0" (5), "q" (2)
-	     : "cc");
-
-	/* AH is 0x02 on Cyrix after the divide.. */
-	return (unsigned char) (test >> 8) == 0x02;
-}
-
-static struct cpu_dev cyrix_cpu_dev __cpuinitdata = {
-	.c_vendor	= "Cyrix",
-	.c_ident 	= { "CyrixInstead" },
-	.c_init		= init_cyrix,
-};
-
-int __init cyrix_init_cpu(void)
-{
-	cpu_devs[X86_VENDOR_CYRIX] = &cyrix_cpu_dev;
-	return 0;
-}
-
-//early_arch_initcall(cyrix_init_cpu);
-
-static struct cpu_dev nsc_cpu_dev __cpuinitdata = {
-	.c_vendor	= "NSC",
-	.c_ident 	= { "Geode by NSC" },
-	.c_init		= init_cyrix,
-};
-
-int __init nsc_init_cpu(void)
-{
-	cpu_devs[X86_VENDOR_NSC] = &nsc_cpu_dev;
-	return 0;
-}
-
-//early_arch_initcall(nsc_init_cpu);
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/cpu/mcheck/mce_intel.c
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c	Wed Sep 12 13:29:30 2012 +0100
@@ -445,10 +445,8 @@ intel_get_extended_msrs(struct mcinfo_gl
     for (i = MSR_IA32_MCG_EAX; i <= MSR_IA32_MCG_MISC; i++)
         intel_get_extended_msr(mc_ext, i);
 
-#ifdef __x86_64__
     for (i = MSR_IA32_MCG_R8; i <= MSR_IA32_MCG_R15; i++)
         intel_get_extended_msr(mc_ext, i);
-#endif
 
     return mc_ext;
 }
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/cpu/mtrr/Makefile
--- a/xen/arch/x86/cpu/mtrr/Makefile	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/cpu/mtrr/Makefile	Wed Sep 12 13:29:30 2012 +0100
@@ -1,5 +1,2 @@
-obj-$(x86_32) += amd.o
-obj-$(x86_32) += cyrix.o
 obj-y += generic.o
 obj-y += main.o
-obj-$(x86_32) += state.o
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/cpu/mtrr/amd.c
--- a/xen/arch/x86/cpu/mtrr/amd.c	Wed Sep 12 13:24:28 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,121 +0,0 @@
-#include <xen/init.h>
-#include <xen/mm.h>
-#include <asm/mtrr.h>
-#include <asm/msr.h>
-
-#include "mtrr.h"
-
-static void
-amd_get_mtrr(unsigned int reg, unsigned long *base,
-	     unsigned long *size, mtrr_type * type)
-{
-	unsigned long low, high;
-
-	rdmsr(MSR_K6_UWCCR, low, high);
-	/*  Upper dword is region 1, lower is region 0  */
-	if (reg == 1)
-		low = high;
-	/*  The base masks off on the right alignment  */
-	*base = (low & 0xFFFE0000) >> PAGE_SHIFT;
-	*type = 0;
-	if (low & 1)
-		*type = MTRR_TYPE_UNCACHABLE;
-	if (low & 2)
-		*type = MTRR_TYPE_WRCOMB;
-	if (!(low & 3)) {
-		*size = 0;
-		return;
-	}
-	/*
-	 *  This needs a little explaining. The size is stored as an
-	 *  inverted mask of bits of 128K granularity 15 bits long offset
-	 *  2 bits
-	 *
-	 *  So to get a size we do invert the mask and add 1 to the lowest
-	 *  mask bit (4 as its 2 bits in). This gives us a size we then shift
-	 *  to turn into 128K blocks
-	 *
-	 *  eg              111 1111 1111 1100      is 512K
-	 *
-	 *  invert          000 0000 0000 0011
-	 *  +1              000 0000 0000 0100
-	 *  *128K   ...
-	 */
-	low = (~low) & 0x1FFFC;
-	*size = (low + 4) << (15 - PAGE_SHIFT);
-	return;
-}
-
-static void amd_set_mtrr(unsigned int reg, unsigned long base,
-			 unsigned long size, mtrr_type type)
-/*  [SUMMARY] Set variable MTRR register on the local CPU.
-    <reg> The register to set.
-    <base> The base address of the region.
-    <size> The size of the region. If this is 0 the region is disabled.
-    <type> The type of the region.
-    <do_safe> If TRUE, do the change safely. If FALSE, safety measures should
-    be done externally.
-    [RETURNS] Nothing.
-*/
-{
-	u32 regs[2];
-
-	/*
-	 *  Low is MTRR0 , High MTRR 1
-	 */
-	rdmsr(MSR_K6_UWCCR, regs[0], regs[1]);
-	/*
-	 *  Blank to disable
-	 */
-	if (size == 0)
-		regs[reg] = 0;
-	else
-		/* Set the register to the base, the type (off by one) and an
-		   inverted bitmask of the size The size is the only odd
-		   bit. We are fed say 512K We invert this and we get 111 1111
-		   1111 1011 but if you subtract one and invert you get the   
-		   desired 111 1111 1111 1100 mask
-
-		   But ~(x - 1) == ~x + 1 == -x. Two's complement rocks!  */
-		regs[reg] = (-size >> (15 - PAGE_SHIFT) & 0x0001FFFC)
-		    | (base << PAGE_SHIFT) | (type + 1);
-
-	/*
-	 *  The writeback rule is quite specific. See the manual. Its
-	 *  disable local interrupts, write back the cache, set the mtrr
-	 */
-	wbinvd();
-	wrmsr(MSR_K6_UWCCR, regs[0], regs[1]);
-}
-
-static int amd_validate_add_page(unsigned long base, unsigned long size, unsigned int type)
-{
-	/* Apply the K6 block alignment and size rules
-	   In order
-	   o Uncached or gathering only
-	   o 128K or bigger block
-	   o Power of 2 block
-	   o base suitably aligned to the power
-	*/
-	if (type > MTRR_TYPE_WRCOMB || size < (1 << (17 - PAGE_SHIFT))
-	    || (size & ~(size - 1)) - size || (base & (size - 1)))
-		return -EINVAL;
-	return 0;
-}
-
-static const struct mtrr_ops amd_mtrr_ops = {
-	.vendor            = X86_VENDOR_AMD,
-	.set               = amd_set_mtrr,
-	.get               = amd_get_mtrr,
-	.get_free_region   = generic_get_free_region,
-	.validate_add_page = amd_validate_add_page,
-	.have_wrcomb       = positive_have_wrcomb,
-};
-
-int __init amd_init_mtrr(void)
-{
-	set_mtrr_ops(&amd_mtrr_ops);
-	return 0;
-}
-
-//arch_initcall(amd_mtrr_init);
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/cpu/mtrr/cyrix.c
--- a/xen/arch/x86/cpu/mtrr/cyrix.c	Wed Sep 12 13:24:28 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,376 +0,0 @@
-#include <xen/init.h>
-#include <xen/mm.h>
-#include <asm/mtrr.h>
-#include <asm/msr.h>
-#include <asm/io.h>
-#include "mtrr.h"
-
-int arr3_protected;
-
-static void
-cyrix_get_arr(unsigned int reg, unsigned long *base,
-	      unsigned long *size, mtrr_type * type)
-{
-	unsigned long flags;
-	unsigned char arr, ccr3, rcr, shift;
-
-	arr = CX86_ARR_BASE + (reg << 1) + reg;	/* avoid multiplication by 3 */
-
-	/* Save flags and disable interrupts */
-	local_irq_save(flags);
-
-	ccr3 = getCx86(CX86_CCR3);
-	setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10);	/* enable MAPEN */
-	((unsigned char *) base)[3] = getCx86(arr);
-	((unsigned char *) base)[2] = getCx86(arr + 1);
-	((unsigned char *) base)[1] = getCx86(arr + 2);
-	rcr = getCx86(CX86_RCR_BASE + reg);
-	setCx86(CX86_CCR3, ccr3);	/* disable MAPEN */
-
-	/* Enable interrupts if it was enabled previously */
-	local_irq_restore(flags);
-	shift = ((unsigned char *) base)[1] & 0x0f;
-	*base >>= PAGE_SHIFT;
-
-	/* Power of two, at least 4K on ARR0-ARR6, 256K on ARR7
-	 * Note: shift==0xf means 4G, this is unsupported.
-	 */
-	if (shift)
-		*size = (reg < 7 ? 0x1UL : 0x40UL) << (shift - 1);
-	else
-		*size = 0;
-
-	/* Bit 0 is Cache Enable on ARR7, Cache Disable on ARR0-ARR6 */
-	if (reg < 7) {
-		switch (rcr) {
-		case 1:
-			*type = MTRR_TYPE_UNCACHABLE;
-			break;
-		case 8:
-			*type = MTRR_TYPE_WRBACK;
-			break;
-		case 9:
-			*type = MTRR_TYPE_WRCOMB;
-			break;
-		case 24:
-		default:
-			*type = MTRR_TYPE_WRTHROUGH;
-			break;
-		}
-	} else {
-		switch (rcr) {
-		case 0:
-			*type = MTRR_TYPE_UNCACHABLE;
-			break;
-		case 8:
-			*type = MTRR_TYPE_WRCOMB;
-			break;
-		case 9:
-			*type = MTRR_TYPE_WRBACK;
-			break;
-		case 25:
-		default:
-			*type = MTRR_TYPE_WRTHROUGH;
-			break;
-		}
-	}
-}
-
-static int
-cyrix_get_free_region(unsigned long base, unsigned long size, int replace_reg)
-/*  [SUMMARY] Get a free ARR.
-    <base> The starting (base) address of the region.
-    <size> The size (in bytes) of the region.
-    [RETURNS] The index of the region on success, else -1 on error.
-*/
-{
-	int i;
-	mtrr_type ltype;
-	unsigned long lbase, lsize;
-
-	switch (replace_reg) {
-	case 7:
-		if (size < 0x40)
-			break;
-	case 6:
-	case 5:
-	case 4:
-		return replace_reg;
-	case 3:
-		if (arr3_protected)
-			break;
-	case 2:
-	case 1:
-	case 0:
-		return replace_reg;
-	}
-	/* If we are to set up a region >32M then look at ARR7 immediately */
-	if (size > 0x2000) {
-		cyrix_get_arr(7, &lbase, &lsize, &ltype);
-		if (lsize == 0)
-			return 7;
-		/*  Else try ARR0-ARR6 first  */
-	} else {
-		for (i = 0; i < 7; i++) {
-			cyrix_get_arr(i, &lbase, &lsize, &ltype);
-			if ((i == 3) && arr3_protected)
-				continue;
-			if (lsize == 0)
-				return i;
-		}
-		/* ARR0-ARR6 isn't free, try ARR7 but its size must be at least 256K */
-		cyrix_get_arr(i, &lbase, &lsize, &ltype);
-		if ((lsize == 0) && (size >= 0x40))
-			return i;
-	}
-	return -ENOSPC;
-}
-
-static u32 cr4 = 0;
-static u32 ccr3;
-
-static void prepare_set(void)
-{
-	u32 cr0;
-
-	/*  Save value of CR4 and clear Page Global Enable (bit 7)  */
-	if ( cpu_has_pge ) {
-		cr4 = read_cr4();
-		write_cr4(cr4 & ~X86_CR4_PGE);
-	}
-
-	/*  Disable and flush caches. Note that wbinvd flushes the TLBs as
-	    a side-effect  */
-	cr0 = read_cr0() | 0x40000000;
-	wbinvd();
-	write_cr0(cr0);
-	wbinvd();
-
-	/* Cyrix ARRs - everything else were excluded at the top */
-	ccr3 = getCx86(CX86_CCR3);
-
-	/* Cyrix ARRs - everything else were excluded at the top */
-	setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10);
-
-}
-
-static void post_set(void)
-{
-	/*  Flush caches and TLBs  */
-	wbinvd();
-
-	/* Cyrix ARRs - everything else was excluded at the top */
-	setCx86(CX86_CCR3, ccr3);
-		
-	/*  Enable caches  */
-	write_cr0(read_cr0() & 0xbfffffff);
-
-	/*  Restore value of CR4  */
-	if ( cpu_has_pge )
-		write_cr4(cr4);
-}
-
-static void cyrix_set_arr(unsigned int reg, unsigned long base,
-			  unsigned long size, mtrr_type type)
-{
-	unsigned char arr, arr_type, arr_size;
-
-	arr = CX86_ARR_BASE + (reg << 1) + reg;	/* avoid multiplication by 3 */
-
-	/* count down from 32M (ARR0-ARR6) or from 2G (ARR7) */
-	if (reg >= 7)
-		size >>= 6;
-
-	size &= 0x7fff;		/* make sure arr_size <= 14 */
-	for (arr_size = 0; size; arr_size++, size >>= 1) ;
-
-	if (reg < 7) {
-		switch (type) {
-		case MTRR_TYPE_UNCACHABLE:
-			arr_type = 1;
-			break;
-		case MTRR_TYPE_WRCOMB:
-			arr_type = 9;
-			break;
-		case MTRR_TYPE_WRTHROUGH:
-			arr_type = 24;
-			break;
-		default:
-			arr_type = 8;
-			break;
-		}
-	} else {
-		switch (type) {
-		case MTRR_TYPE_UNCACHABLE:
-			arr_type = 0;
-			break;
-		case MTRR_TYPE_WRCOMB:
-			arr_type = 8;
-			break;
-		case MTRR_TYPE_WRTHROUGH:
-			arr_type = 25;
-			break;
-		default:
-			arr_type = 9;
-			break;
-		}
-	}
-
-	prepare_set();
-
-	base <<= PAGE_SHIFT;
-	setCx86(arr, ((unsigned char *) &base)[3]);
-	setCx86(arr + 1, ((unsigned char *) &base)[2]);
-	setCx86(arr + 2, (((unsigned char *) &base)[1]) | arr_size);
-	setCx86(CX86_RCR_BASE + reg, arr_type);
-
-	post_set();
-}
-
-typedef struct {
-	unsigned long base;
-	unsigned long size;
-	mtrr_type type;
-} arr_state_t;
-
-static arr_state_t arr_state[8] = {
-	{0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL},
-	{0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}
-};
-
-static unsigned char ccr_state[7] = { 0, 0, 0, 0, 0, 0, 0 };
-
-static void cyrix_set_all(void)
-{
-	int i;
-
-	prepare_set();
-
-	/* the CCRs are not contiguous */
-	for (i = 0; i < 4; i++)
-		setCx86(CX86_CCR0 + i, ccr_state[i]);
-	for (; i < 7; i++)
-		setCx86(CX86_CCR4 + i, ccr_state[i]);
-	for (i = 0; i < 8; i++)
-		cyrix_set_arr(i, arr_state[i].base, 
-			      arr_state[i].size, arr_state[i].type);
-
-	post_set();
-}
-
-#if 0
-/*
- * On Cyrix 6x86(MX) and M II the ARR3 is special: it has connection
- * with the SMM (System Management Mode) mode. So we need the following:
- * Check whether SMI_LOCK (CCR3 bit 0) is set
- *   if it is set, write a warning message: ARR3 cannot be changed!
- *     (it cannot be changed until the next processor reset)
- *   if it is reset, then we can change it, set all the needed bits:
- *   - disable access to SMM memory through ARR3 range (CCR1 bit 7 reset)
- *   - disable access to SMM memory (CCR1 bit 2 reset)
- *   - disable SMM mode (CCR1 bit 1 reset)
- *   - disable write protection of ARR3 (CCR6 bit 1 reset)
- *   - (maybe) disable ARR3
- * Just to be sure, we enable ARR usage by the processor (CCR5 bit 5 set)
- */
-static void __init
-cyrix_arr_init(void)
-{
-	struct set_mtrr_context ctxt;
-	unsigned char ccr[7];
-	int ccrc[7] = { 0, 0, 0, 0, 0, 0, 0 };
-	int i;
-
-	/* flush cache and enable MAPEN */
-	set_mtrr_prepare_save(&ctxt);
-	set_mtrr_cache_disable(&ctxt);
-
-	/* Save all CCRs locally */
-	ccr[0] = getCx86(CX86_CCR0);
-	ccr[1] = getCx86(CX86_CCR1);
-	ccr[2] = getCx86(CX86_CCR2);
-	ccr[3] = ctxt.ccr3;
-	ccr[4] = getCx86(CX86_CCR4);
-	ccr[5] = getCx86(CX86_CCR5);
-	ccr[6] = getCx86(CX86_CCR6);
-
-	if (ccr[3] & 1) {
-		ccrc[3] = 1;
-		arr3_protected = 1;
-	} else {
-		/* Disable SMM mode (bit 1), access to SMM memory (bit 2) and
-		 * access to SMM memory through ARR3 (bit 7).
-		 */
-		if (ccr[1] & 0x80) {
-			ccr[1] &= 0x7f;
-			ccrc[1] |= 0x80;
-		}
-		if (ccr[1] & 0x04) {
-			ccr[1] &= 0xfb;
-			ccrc[1] |= 0x04;
-		}
-		if (ccr[1] & 0x02) {
-			ccr[1] &= 0xfd;
-			ccrc[1] |= 0x02;
-		}
-		arr3_protected = 0;
-		if (ccr[6] & 0x02) {
-			ccr[6] &= 0xfd;
-			ccrc[6] = 1;	/* Disable write protection of ARR3 */
-			setCx86(CX86_CCR6, ccr[6]);
-		}
-		/* Disable ARR3. This is safe now that we disabled SMM. */
-		/* cyrix_set_arr_up (3, 0, 0, 0, FALSE); */
-	}
-	/* If we changed CCR1 in memory, change it in the processor, too. */
-	if (ccrc[1])
-		setCx86(CX86_CCR1, ccr[1]);
-
-	/* Enable ARR usage by the processor */
-	if (!(ccr[5] & 0x20)) {
-		ccr[5] |= 0x20;
-		ccrc[5] = 1;
-		setCx86(CX86_CCR5, ccr[5]);
-	}
-
-	for (i = 0; i < 7; i++)
-		ccr_state[i] = ccr[i];
-	for (i = 0; i < 8; i++)
-		cyrix_get_arr(i,
-			      &arr_state[i].base, &arr_state[i].size,
-			      &arr_state[i].type);
-
-	set_mtrr_done(&ctxt);	/* flush cache and disable MAPEN */
-
-	if (ccrc[5])
-		printk(KERN_INFO "mtrr: ARR usage was not enabled, enabled manually\n");
-	if (ccrc[3])
-		printk(KERN_INFO "mtrr: ARR3 cannot be changed\n");
-/*
-    if ( ccrc[1] & 0x80) printk ("mtrr: SMM memory access through ARR3 disabled\n");
-    if ( ccrc[1] & 0x04) printk ("mtrr: SMM memory access disabled\n");
-    if ( ccrc[1] & 0x02) printk ("mtrr: SMM mode disabled\n");
-*/
-	if (ccrc[6])
-		printk(KERN_INFO "mtrr: ARR3 was write protected, unprotected\n");
-}
-#endif
-
-static const struct mtrr_ops cyrix_mtrr_ops = {
-	.vendor            = X86_VENDOR_CYRIX,
-//	.init              = cyrix_arr_init,
-	.set_all	   = cyrix_set_all,
-	.set               = cyrix_set_arr,
-	.get               = cyrix_get_arr,
-	.get_free_region   = cyrix_get_free_region,
-	.validate_add_page = generic_validate_add_page,
-	.have_wrcomb       = positive_have_wrcomb,
-};
-
-int __init cyrix_init_mtrr(void)
-{
-	set_mtrr_ops(&cyrix_mtrr_ops);
-	return 0;
-}
-
-//arch_initcall(cyrix_init_mtrr);
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/cpu/mtrr/main.c
--- a/xen/arch/x86/cpu/mtrr/main.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/cpu/mtrr/main.c	Wed Sep 12 13:29:30 2012 +0100
@@ -79,16 +79,6 @@ static const char *mtrr_attrib_to_str(in
 	return (x <= 6) ? mtrr_strings[x] : "?";
 }
 
-#ifndef CONFIG_X86_64
-static const struct mtrr_ops *mtrr_ops[X86_VENDOR_NUM];
-
-void set_mtrr_ops(const struct mtrr_ops * ops)
-{
-	if (ops->vendor && ops->vendor < X86_VENDOR_NUM)
-		mtrr_ops[ops->vendor] = ops;
-}
-#endif
-
 /*  Returns non-zero if we have the write-combining memory type  */
 static int have_wrcomb(void)
 {
@@ -521,12 +511,6 @@ int mtrr_del_page(int reg, unsigned long
 		printk(KERN_WARNING "mtrr: register: %d too big\n", reg);
 		goto out;
 	}
-	if (is_cpu(CYRIX) && !use_intel()) {
-		if ((reg == 3) && arr3_protected) {
-			printk(KERN_WARNING "mtrr: ARR3 cannot be changed\n");
-			goto out;
-		}
-	}
 	mtrr_if->get(reg, &lbase, &lsize, &ltype);
 	if (lsize < 1) {
 		printk(KERN_WARNING "mtrr: MTRR %d not used\n", reg);
@@ -566,18 +550,6 @@ mtrr_del(int reg, unsigned long base, un
 	return mtrr_del_page(reg, base >> PAGE_SHIFT, size >> PAGE_SHIFT);
 }
 
-/* HACK ALERT!
- * These should be called implicitly, but we can't yet until all the initcall
- * stuff is done...
- */
-static void __init init_ifs(void)
-{
-#ifndef CONFIG_X86_64
-	amd_init_mtrr();
-	cyrix_init_mtrr();
-#endif
-}
-
 /* The suspend/resume methods are only for CPU without MTRR. CPU using generic
  * MTRR driver doesn't require this
  */
@@ -598,8 +570,6 @@ unsigned int paddr_bits __read_mostly = 
  */
 void __init mtrr_bp_init(void)
 {
-	init_ifs();
-
 	if (cpu_has_mtrr) {
 		mtrr_if = &generic_mtrr_ops;
 		size_or_mask = 0xff000000;	/* 36 bits */
@@ -627,28 +597,6 @@ void __init mtrr_bp_init(void)
 			size_or_mask = 0xfff00000;	/* 32 bits */
 			size_and_mask = 0;
 		}
-	} else {
-#ifndef CONFIG_X86_64
-		switch (boot_cpu_data.x86_vendor) {
-		case X86_VENDOR_AMD:
-			if (cpu_has_k6_mtrr) {
-				/* Pre-Athlon (K6) AMD CPU MTRRs */
-				mtrr_if = mtrr_ops[X86_VENDOR_AMD];
-				size_or_mask = 0xfff00000;	/* 32 bits */
-				size_and_mask = 0;
-			}
-			break;
-		case X86_VENDOR_CYRIX:
-			if (cpu_has_cyrix_arr) {
-				mtrr_if = mtrr_ops[X86_VENDOR_CYRIX];
-				size_or_mask = 0xfff00000;	/* 32 bits */
-				size_and_mask = 0;
-			}
-			break;
-		default:
-			break;
-		}
-#endif
 	}
 
 	if (mtrr_if) {
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/cpu/mtrr/mtrr.h
--- a/xen/arch/x86/cpu/mtrr/mtrr.h	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/cpu/mtrr/mtrr.h	Wed Sep 12 13:29:30 2012 +0100
@@ -85,9 +85,3 @@ void mtrr_wrmsr(unsigned int msr, uint64
 
 extern int amd_init_mtrr(void);
 extern int cyrix_init_mtrr(void);
-
-#ifndef CONFIG_X86_64
-extern int arr3_protected;
-#else
-#define arr3_protected 0
-#endif
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/cpu/mtrr/state.c
--- a/xen/arch/x86/cpu/mtrr/state.c	Wed Sep 12 13:24:28 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-#include <xen/mm.h>
-#include <xen/init.h>
-#include <asm/io.h>
-#include <asm/mtrr.h>
-#include <asm/msr.h>
-#include "mtrr.h"
-
-
-/*  Put the processor into a state where MTRRs can be safely set  */
-void set_mtrr_prepare_save(struct set_mtrr_context *ctxt)
-{
-	unsigned int cr0;
-
-	/*  Disable interrupts locally  */
-	local_irq_save(ctxt->flags);
-
-	if (use_intel() || is_cpu(CYRIX)) {
-
-		/*  Save value of CR4 and clear Page Global Enable (bit 7)  */
-		if ( cpu_has_pge ) {
-			ctxt->cr4val = read_cr4();
-			write_cr4(ctxt->cr4val & (unsigned char) ~(1 << 7));
-		}
-
-		/*  Disable and flush caches. Note that wbinvd flushes the TLBs as
-		    a side-effect  */
-		cr0 = read_cr0() | 0x40000000;
-		wbinvd();
-		write_cr0(cr0);
-		wbinvd();
-
-		if (use_intel()) {
-			/*  Save MTRR state */
-			rdmsrl(MTRRdefType_MSR, ctxt->deftype);
-		} else
-			/* Cyrix ARRs - everything else were excluded at the top */
-			ctxt->ccr3 = getCx86(CX86_CCR3);
-	}
-}
-
-void set_mtrr_cache_disable(struct set_mtrr_context *ctxt)
-{
-	if (use_intel()) 
-		/*  Disable MTRRs, and set the default type to uncached  */
-		mtrr_wrmsr(MTRRdefType_MSR, ctxt->deftype & 0xf300UL);
-	else if (is_cpu(CYRIX))
-		/* Cyrix ARRs - everything else were excluded at the top */
-		setCx86(CX86_CCR3, (ctxt->ccr3 & 0x0f) | 0x10);
-}
-
-/*  Restore the processor after a set_mtrr_prepare  */
-void set_mtrr_done(struct set_mtrr_context *ctxt)
-{
-	if (use_intel() || is_cpu(CYRIX)) {
-
-		/*  Flush caches and TLBs  */
-		wbinvd();
-
-		/*  Restore MTRRdefType  */
-		if (use_intel())
-			/* Intel (P6) standard MTRRs */
-			mtrr_wrmsr(MTRRdefType_MSR, ctxt->deftype);
-		else
-			/* Cyrix ARRs - everything else was excluded at the top */
-			setCx86(CX86_CCR3, ctxt->ccr3);
-		
-		/*  Enable caches  */
-		write_cr0(read_cr0() & 0xbfffffff);
-
-		/*  Restore value of CR4  */
-		if ( cpu_has_pge )
-			write_cr4(ctxt->cr4val);
-	}
-	/*  Re-enable interrupts locally (if enabled previously)  */
-	local_irq_restore(ctxt->flags);
-}
-
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/cpu/transmeta.c
--- a/xen/arch/x86/cpu/transmeta.c	Wed Sep 12 13:24:28 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-#include <xen/config.h>
-#include <xen/lib.h>
-#include <xen/init.h>
-#include <asm/processor.h>
-#include <asm/msr.h>
-#include "cpu.h"
-
-static void __init init_transmeta(struct cpuinfo_x86 *c)
-{
-	unsigned int cap_mask, uk, max, dummy;
-	unsigned int cms_rev1, cms_rev2;
-	unsigned int cpu_rev, cpu_freq, cpu_flags, new_cpu_rev;
-	char cpu_info[65];
-
-	get_model_name(c);	/* Same as AMD/Cyrix */
-	display_cacheinfo(c);
-
-	/* Print CMS and CPU revision */
-	max = cpuid_eax(0x80860000);
-	cpu_rev = 0;
-	if ( max >= 0x80860001 ) {
-		cpuid(0x80860001, &dummy, &cpu_rev, &cpu_freq, &cpu_flags);
-		if (cpu_rev != 0x02000000) {
-			printk(KERN_INFO "CPU: Processor revision %u.%u.%u.%u, %u MHz\n",
-				(cpu_rev >> 24) & 0xff,
-				(cpu_rev >> 16) & 0xff,
-				(cpu_rev >> 8) & 0xff,
-				cpu_rev & 0xff,
-				cpu_freq);
-		}
-	}
-	if ( max >= 0x80860002 ) {
-		cpuid(0x80860002, &new_cpu_rev, &cms_rev1, &cms_rev2, &dummy);
-		if (cpu_rev == 0x02000000) {
-			printk(KERN_INFO "CPU: Processor revision %08X, %u MHz\n",
-				new_cpu_rev, cpu_freq);
-		}
-		printk(KERN_INFO "CPU: Code Morphing Software revision %u.%u.%u-%u-%u\n",
-		       (cms_rev1 >> 24) & 0xff,
-		       (cms_rev1 >> 16) & 0xff,
-		       (cms_rev1 >> 8) & 0xff,
-		       cms_rev1 & 0xff,
-		       cms_rev2);
-	}
-	if ( max >= 0x80860006 ) {
-		cpuid(0x80860003,
-		      (void *)&cpu_info[0],
-		      (void *)&cpu_info[4],
-		      (void *)&cpu_info[8],
-		      (void *)&cpu_info[12]);
-		cpuid(0x80860004,
-		      (void *)&cpu_info[16],
-		      (void *)&cpu_info[20],
-		      (void *)&cpu_info[24],
-		      (void *)&cpu_info[28]);
-		cpuid(0x80860005,
-		      (void *)&cpu_info[32],
-		      (void *)&cpu_info[36],
-		      (void *)&cpu_info[40],
-		      (void *)&cpu_info[44]);
-		cpuid(0x80860006,
-		      (void *)&cpu_info[48],
-		      (void *)&cpu_info[52],
-		      (void *)&cpu_info[56],
-		      (void *)&cpu_info[60]);
-		cpu_info[64] = '\0';
-		printk(KERN_INFO "CPU: %s\n", cpu_info);
-	}
-
-	/* Unhide possibly hidden capability flags */
-	rdmsr(0x80860004, cap_mask, uk);
-	wrmsr(0x80860004, ~0, uk);
-	c->x86_capability[0] = cpuid_edx(0x00000001);
-	wrmsr(0x80860004, cap_mask, uk);
-	
-	/* If we can run i686 user-space code, call us an i686 */
-#define USER686 (X86_FEATURE_TSC|X86_FEATURE_CX8|X86_FEATURE_CMOV)
-        if ( c->x86 == 5 && (c->x86_capability[0] & USER686) == USER686 )
-		c->x86 = 6;
-}
-
-static void transmeta_identify(struct cpuinfo_x86 * c)
-{
-	u32 xlvl;
-
-	/* Transmeta-defined flags: level 0x80860001 */
-	xlvl = cpuid_eax(0x80860000);
-	if ( (xlvl & 0xffff0000) == 0x80860000 ) {
-		if (  xlvl >= 0x80860001 )
-			c->x86_capability[2] = cpuid_edx(0x80860001);
-	}
-}
-
-static struct cpu_dev transmeta_cpu_dev __cpuinitdata = {
-	.c_vendor	= "Transmeta",
-	.c_ident	= { "GenuineTMx86", "TransmetaCPU" },
-	.c_init		= init_transmeta,
-	.c_identify	= transmeta_identify,
-};
-
-int __init transmeta_init_cpu(void)
-{
-	cpu_devs[X86_VENDOR_TRANSMETA] = &transmeta_cpu_dev;
-	return 0;
-}
-
-//early_arch_initcall(transmeta_init_cpu);
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/debug.c
--- a/xen/arch/x86/debug.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/debug.c	Wed Sep 12 13:29:30 2012 +0100
@@ -70,8 +70,6 @@ dbg_hvm_va2mfn(dbgva_t vaddr, struct dom
     return mfn;
 }
 
-#if defined(__x86_64__)
-
 /* 
  * pgd3val: this is the value of init_mm.pgd[3] in a PV guest. It is optional.
  *          This to assist debug of modules in the guest. The kernel address 
@@ -143,49 +141,6 @@ dbg_pv_va2mfn(dbgva_t vaddr, struct doma
     return mfn_valid(mfn) ? mfn : INVALID_MFN;
 }
 
-#else
-
-/* Returns: mfn for the given (pv guest) vaddr */
-static unsigned long 
-dbg_pv_va2mfn(dbgva_t vaddr, struct domain *dp, uint64_t pgd3val)
-{
-    l3_pgentry_t l3e, *l3t;
-    l2_pgentry_t l2e, *l2t;
-    l1_pgentry_t l1e, *l1t;
-    unsigned long cr3 = (pgd3val ? pgd3val : dp->vcpu[0]->arch.cr3);
-    unsigned long mfn = cr3 >> PAGE_SHIFT;
-
-    DBGP2("vaddr:%lx domid:%d cr3:%lx pgd3:%lx\n", vaddr, dp->domain_id, 
-          cr3, pgd3val);
-
-    if ( pgd3val == 0 )
-    {
-        l3t  = map_domain_page(mfn);
-        l3t += (cr3 & 0xFE0UL) >> 3;
-        l3e = l3t[l3_table_offset(vaddr)];
-        mfn = l3e_get_pfn(l3e);
-        unmap_domain_page(l3t);
-        if ( !(l3e_get_flags(l3e) & _PAGE_PRESENT) )
-            return INVALID_MFN;
-    }
-
-    l2t = map_domain_page(mfn);
-    l2e = l2t[l2_table_offset(vaddr)];
-    mfn = l2e_get_pfn(l2e);
-    unmap_domain_page(l2t);
-    if ( !(l2e_get_flags(l2e) & _PAGE_PRESENT) || 
-         (l2e_get_flags(l2e) & _PAGE_PSE) )
-        return INVALID_MFN;
-
-    l1t = map_domain_page(mfn);
-    l1e = l1t[l1_table_offset(vaddr)];
-    mfn = l1e_get_pfn(l1e);
-    unmap_domain_page(l1t);
-
-    return mfn_valid(mfn) ? mfn : INVALID_MFN;
-}
-#endif  /* defined(__x86_64__) */
-
 /* Returns: number of bytes remaining to be copied */
 static int
 dbg_rw_guest_mem(dbgva_t addr, dbgbyte_t *buf, int len, struct domain *dp, 
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/domain.c	Wed Sep 12 13:29:30 2012 +0100
@@ -184,11 +184,8 @@ struct domain *alloc_domain_struct(void)
      * We pack the PDX of the domain structure into a 32-bit field within
      * the page_info structure. Hence the MEMF_bits() restriction.
      */
-    unsigned int bits = 32 + PAGE_SHIFT;
+    unsigned int bits = 32 + PAGE_SHIFT + pfn_pdx_hole_shift;
 
-#ifdef __x86_64__
-    bits += pfn_pdx_hole_shift;
-#endif
     BUILD_BUG_ON(sizeof(*d) > PAGE_SIZE);
     d = alloc_xenheap_pages(0, MEMF_bits(bits));
     if ( d != NULL )
@@ -232,9 +229,6 @@ struct vcpu_guest_context *alloc_vcpu_gu
     enum fixed_addresses idx = FIX_VGC_BEGIN -
         cpu * PFN_UP(sizeof(struct vcpu_guest_context));
 
-#ifdef __i386__
-    BUILD_BUG_ON(sizeof(struct vcpu_guest_context) > PAGE_SIZE);
-#endif
     BUG_ON(per_cpu(vgc_pages[0], cpu) != NULL);
 
     for ( i = 0; i < PFN_UP(sizeof(struct vcpu_guest_context)); ++i )
@@ -270,8 +264,6 @@ void free_vcpu_guest_context(struct vcpu
     }
 }
 
-#ifdef __x86_64__
-
 static int setup_compat_l4(struct vcpu *v)
 {
     struct page_info *pg;
@@ -376,11 +368,6 @@ int switch_compat(struct domain *d)
     return -ENOMEM;
 }
 
-#else
-#define setup_compat_l4(v) 0
-#define release_compat_l4(v) ((void)0)
-#endif
-
 static inline bool_t standalone_trap_ctxt(struct vcpu *v)
 {
     BUILD_BUG_ON(256 * sizeof(*v->arch.pv_vcpu.trap_ctxt) > PAGE_SIZE);
@@ -390,31 +377,23 @@ static inline bool_t standalone_trap_ctx
 int vcpu_initialise(struct vcpu *v)
 {
     struct domain *d = v->domain;
+    unsigned int idx;
     int rc;
 
     v->arch.flags = TF_kernel_mode;
 
-#if defined(__i386__)
-    mapcache_vcpu_init(v);
-#else
+    idx = perdomain_pt_pgidx(v);
+    if ( !perdomain_pt_page(d, idx) )
     {
-        unsigned int idx = perdomain_pt_pgidx(v);
         struct page_info *pg;
-
-        if ( !perdomain_pt_page(d, idx) )
-        {
-            pg = alloc_domheap_page(NULL, MEMF_node(vcpu_to_node(v)));
-            if ( !pg )
-                return -ENOMEM;
-            clear_page(page_to_virt(pg));
-            perdomain_pt_page(d, idx) = pg;
-            d->arch.mm_perdomain_l2[l2_table_offset(PERDOMAIN_VIRT_START)+idx]
-                = l2e_from_page(pg, __PAGE_HYPERVISOR);
-        }
+        pg = alloc_domheap_page(NULL, MEMF_node(vcpu_to_node(v)));
+        if ( !pg )
+            return -ENOMEM;
+        clear_page(page_to_virt(pg));
+        perdomain_pt_page(d, idx) = pg;
+        d->arch.mm_perdomain_l2[l2_table_offset(PERDOMAIN_VIRT_START)+idx]
+            = l2e_from_page(pg, __PAGE_HYPERVISOR);
     }
-#endif
-
-    pae_l3_cache_init(&v->arch.pae_l3_cache);
 
     paging_vcpu_init(v);
 
@@ -499,11 +478,7 @@ void vcpu_destroy(struct vcpu *v)
 
 int arch_domain_create(struct domain *d, unsigned int domcr_flags)
 {
-#ifdef __x86_64__
     struct page_info *pg;
-#else
-    int pdpt_order;
-#endif
     int i, paging_initialised = 0;
     int rc = -ENOMEM;
 
@@ -520,18 +495,6 @@ int arch_domain_create(struct domain *d,
     d->arch.relmem = RELMEM_not_started;
     INIT_PAGE_LIST_HEAD(&d->arch.relmem_list);
 
-#if defined(__i386__)
-
-    pdpt_order = get_order_from_bytes(PDPT_L1_ENTRIES * sizeof(l1_pgentry_t));
-    d->arch.mm_perdomain_pt = alloc_xenheap_pages(pdpt_order, 0);
-    if ( d->arch.mm_perdomain_pt == NULL )
-        goto fail;
-    memset(d->arch.mm_perdomain_pt, 0, PAGE_SIZE << pdpt_order);
-
-    mapcache_domain_init(d);
-
-#else /* __x86_64__ */
-
     if ( d->domain_id && !is_idle_domain(d) &&
          cpu_has_amd_erratum(&boot_cpu_data, AMD_ERRATUM_121) )
     {
@@ -572,8 +535,6 @@ int arch_domain_create(struct domain *d,
     HYPERVISOR_COMPAT_VIRT_START(d) =
         is_hvm_domain(d) ? ~0u : __HYPERVISOR_COMPAT_VIRT_START;
 
-#endif /* __x86_64__ */
-
     if ( (rc = paging_domain_init(d, domcr_flags)) != 0 )
         goto fail;
     paging_initialised = 1;
@@ -647,24 +608,18 @@ int arch_domain_create(struct domain *d,
     free_xenheap_page(d->shared_info);
     if ( paging_initialised )
         paging_final_teardown(d);
-#ifdef __x86_64__
     if ( d->arch.mm_perdomain_l2 )
         free_domheap_page(virt_to_page(d->arch.mm_perdomain_l2));
     if ( d->arch.mm_perdomain_l3 )
         free_domheap_page(virt_to_page(d->arch.mm_perdomain_l3));
     if ( d->arch.mm_perdomain_pt_pages )
         free_domheap_page(virt_to_page(d->arch.mm_perdomain_pt_pages));
-#else
-    free_xenheap_pages(d->arch.mm_perdomain_pt, pdpt_order);
-#endif
     return rc;
 }
 
 void arch_domain_destroy(struct domain *d)
 {
-#ifdef __x86_64__
     unsigned int i;
-#endif
 
     if ( is_hvm_domain(d) )
         hvm_domain_destroy(d);
@@ -678,11 +633,6 @@ void arch_domain_destroy(struct domain *
 
     paging_final_teardown(d);
 
-#ifdef __i386__
-    free_xenheap_pages(
-        d->arch.mm_perdomain_pt,
-        get_order_from_bytes(PDPT_L1_ENTRIES * sizeof(l1_pgentry_t)));
-#else
     for ( i = 0; i < PDPT_L2_ENTRIES; ++i )
     {
         if ( perdomain_pt_page(d, i) )
@@ -691,7 +641,6 @@ void arch_domain_destroy(struct domain *
     free_domheap_page(virt_to_page(d->arch.mm_perdomain_pt_pages));
     free_domheap_page(virt_to_page(d->arch.mm_perdomain_l2));
     free_domheap_page(virt_to_page(d->arch.mm_perdomain_l3));
-#endif
 
     free_xenheap_page(d->shared_info);
     cleanup_domain_irq_mapping(d);
@@ -751,21 +700,15 @@ int arch_set_info_guest(
     {
         if ( !compat )
         {
-#ifdef __x86_64__
             if ( !is_canonical_address(c.nat->user_regs.eip) ||
                  !is_canonical_address(c.nat->event_callback_eip) ||
                  !is_canonical_address(c.nat->syscall_callback_eip) ||
                  !is_canonical_address(c.nat->failsafe_callback_eip) )
                 return -EINVAL;
-#endif
 
             fixup_guest_stack_selector(d, c.nat->user_regs.ss);
             fixup_guest_stack_selector(d, c.nat->kernel_ss);
             fixup_guest_code_selector(d, c.nat->user_regs.cs);
-#ifdef __i386__
-            fixup_guest_code_selector(d, c.nat->event_callback_cs);
-            fixup_guest_code_selector(d, c.nat->failsafe_callback_cs);
-#endif
 
             for ( i = 0; i < 256; i++ )
             {
@@ -863,7 +806,6 @@ int arch_set_info_guest(
         if ( !compat )
         {
             fail = xen_pfn_to_cr3(pfn) != c.nat->ctrlreg[3];
-#ifdef CONFIG_X86_64
             if ( pagetable_is_null(v->arch.guest_table_user) )
                 fail |= c.nat->ctrlreg[1] || !(flags & VGCF_in_kernel);
             else
@@ -876,7 +818,6 @@ int arch_set_info_guest(
 
             pfn = l4e_get_pfn(*l4tab);
             fail = compat_pfn_to_cr3(pfn) != c.cmp->ctrlreg[3];
-#endif
         }
 
         for ( i = 0; i < ARRAY_SIZE(v->arch.pv_vcpu.gdt_frames); ++i )
@@ -897,7 +838,6 @@ int arch_set_info_guest(
 
     v->arch.pv_vcpu.event_callback_eip = c(event_callback_eip);
     v->arch.pv_vcpu.failsafe_callback_eip = c(failsafe_callback_eip);
-#ifdef CONFIG_X86_64
     if ( !compat )
     {
         v->arch.pv_vcpu.syscall_callback_eip = c.nat->syscall_callback_eip;
@@ -906,7 +846,6 @@ int arch_set_info_guest(
         v->arch.pv_vcpu.gs_base_user = c.nat->gs_base_user;
     }
     else
-#endif
     {
         v->arch.pv_vcpu.event_callback_cs = c(event_callback_cs);
         v->arch.pv_vcpu.failsafe_callback_cs = c(failsafe_callback_cs);
@@ -968,7 +907,6 @@ int arch_set_info_guest(
         }
 
         v->arch.guest_table = pagetable_from_page(cr3_page);
-#ifdef __x86_64__
         if ( c.nat->ctrlreg[1] )
         {
             cr3_gfn = xen_cr3_to_pfn(c.nat->ctrlreg[1]);
@@ -1022,7 +960,6 @@ int arch_set_info_guest(
         l4tab = __va(pagetable_get_paddr(v->arch.guest_table));
         *l4tab = l4e_from_pfn(page_to_mfn(cr3_page),
             _PAGE_PRESENT|_PAGE_RW|_PAGE_USER|_PAGE_ACCESSED);
-#endif
     }
 
     if ( v->vcpu_id == 0 )
@@ -1256,8 +1193,6 @@ arch_do_vcpu_op(
     return rc;
 }
 
-#ifdef __x86_64__
-
 #define loadsegment(seg,value) ({               \
     int __r = 1;                                \
     asm volatile (                              \
@@ -1483,20 +1418,6 @@ static void save_segments(struct vcpu *v
 
 #define switch_kernel_stack(v) ((void)0)
 
-#elif defined(__i386__)
-
-#define load_segments(n) ((void)0)
-#define save_segments(p) ((void)0)
-
-static inline void switch_kernel_stack(struct vcpu *v)
-{
-    struct tss_struct *tss = &this_cpu(init_tss);
-    tss->esp1 = v->arch.pv_vcpu.kernel_sp;
-    tss->ss1  = v->arch.pv_vcpu.kernel_ss;
-}
-
-#endif /* __i386__ */
-
 static void paravirt_ctxt_switch_from(struct vcpu *v)
 {
     save_segments(v);
@@ -1812,7 +1733,6 @@ unsigned long hypercall_create_continuat
         else
             current->arch.hvm_vcpu.hcall_preempted = 1;
 
-#ifdef __x86_64__
         if ( !is_hvm_vcpu(current) ?
              !is_pv_32on64_vcpu(current) :
              (hvm_guest_x86_mode(current) == 8) )
@@ -1832,7 +1752,6 @@ unsigned long hypercall_create_continuat
             }
         }
         else
-#endif
         {
             if ( supervisor_mode_kernel )
                 regs->eip &= ~31; /* re-execute entire hypercall entry stub */
@@ -2066,7 +1985,6 @@ static void vcpu_destroy_pagetables(stru
     struct domain *d = v->domain;
     unsigned long pfn;
 
-#ifdef __x86_64__
     if ( is_pv_32on64_vcpu(v) )
     {
         pfn = l4e_get_pfn(*(l4_pgentry_t *)
@@ -2087,7 +2005,6 @@ static void vcpu_destroy_pagetables(stru
         v->arch.cr3 = 0;
         return;
     }
-#endif
 
     pfn = pagetable_get_pfn(v->arch.guest_table);
     if ( pfn != 0 )
@@ -2099,7 +2016,6 @@ static void vcpu_destroy_pagetables(stru
         v->arch.guest_table = pagetable_null();
     }
 
-#ifdef __x86_64__
     /* Drop ref to guest_table_user (from MMUEXT_NEW_USER_BASEPTR) */
     pfn = pagetable_get_pfn(v->arch.guest_table_user);
     if ( pfn != 0 )
@@ -2113,7 +2029,6 @@ static void vcpu_destroy_pagetables(stru
         }
         v->arch.guest_table_user = pagetable_null();
     }
-#endif
 
     v->arch.cr3 = 0;
 }
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/domain_build.c
--- a/xen/arch/x86/domain_build.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/domain_build.c	Wed Sep 12 13:29:30 2012 +0100
@@ -126,12 +126,6 @@ boolean_param("dom0_shadow", opt_dom0_sh
 static char __initdata opt_dom0_ioports_disable[200] = "";
 string_param("dom0_ioports_disable", opt_dom0_ioports_disable);
 
-#if defined(__i386__)
-/* No ring-3 access in initial leaf page tables. */
-#define L1_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED)
-#define L2_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_DIRTY|_PAGE_USER)
-#define L3_PROT (_PAGE_PRESENT)
-#elif defined(__x86_64__)
 /* Allow ring-3 access in long mode as guest cannot use ring 1 ... */
 #define BASE_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_USER)
 #define L1_PROT (BASE_PROT|_PAGE_GUEST_KERNEL)
@@ -140,7 +134,6 @@ string_param("dom0_ioports_disable", opt
 #define L2_PROT (BASE_PROT|_PAGE_DIRTY)
 #define L3_PROT (BASE_PROT|_PAGE_DIRTY)
 #define L4_PROT (BASE_PROT|_PAGE_DIRTY)
-#endif
 
 #define round_pgup(_p)    (((_p)+(PAGE_SIZE-1))&PAGE_MASK)
 #define round_pgdown(_p)  ((_p)&PAGE_MASK)
@@ -238,7 +231,6 @@ static unsigned long __init compute_dom0
     nr_pages = min(nr_pages, max_pages);
     nr_pages = min(nr_pages, avail);
 
-#ifdef __x86_64__
     if ( (parms->p2m_base == UNSET_ADDR) && (dom0_nrpages <= 0) &&
          ((dom0_min_nrpages <= 0) || (nr_pages > min_pages)) )
     {
@@ -271,7 +263,6 @@ static unsigned long __init compute_dom0
             printk("Dom0 memory clipped to %lu pages\n", nr_pages);
         }
     }
-#endif
 
     d->max_pages = min_t(unsigned long, max_pages, UINT_MAX);
 
@@ -443,7 +434,6 @@ int __init construct_dom0(
         return -EINVAL;
     }
 
-#if defined(__x86_64__)
     if ( compat32 )
     {
         d->arch.is_32bit_pv = d->arch.has_32bit_shinfo = 1;
@@ -451,7 +441,6 @@ int __init construct_dom0(
         if ( setup_compat_arg_xlat(v) != 0 )
             BUG();
     }
-#endif
 
     nr_pages = compute_dom0_nr_pages(d, &parms, initrd_len);
 
@@ -463,15 +452,10 @@ int __init construct_dom0(
         unsigned long mask = (1UL << L2_PAGETABLE_SHIFT) - 1;
         value = (parms.virt_hv_start_low + mask) & ~mask;
         BUG_ON(!is_pv_32bit_domain(d));
-#if defined(__i386__)
-        if ( value > HYPERVISOR_VIRT_START )
-            panic("Domain 0 expects too high a hypervisor start address.\n");
-#else
         if ( value > __HYPERVISOR_COMPAT_VIRT_START )
             panic("Domain 0 expects too high a hypervisor start address.\n");
         HYPERVISOR_COMPAT_VIRT_START(d) =
             max_t(unsigned int, m2p_compat_vstart, value);
-#endif
     }
 
     if ( (parms.p2m_base != UNSET_ADDR) && elf_32bit(&elf) )
@@ -521,12 +505,6 @@ int __init construct_dom0(
         v_end            = (vstack_end + (1UL<<22)-1) & ~((1UL<<22)-1);
         if ( (v_end - vstack_end) < (512UL << 10) )
             v_end += 1UL << 22; /* Add extra 4MB to get >= 512kB padding. */
-#if defined(__i386__)
-        /* 5 pages: 1x 3rd + 4x 2nd level */
-        if ( (((v_end - v_start + ((1UL<<L2_PAGETABLE_SHIFT)-1)) >>
-               L2_PAGETABLE_SHIFT) + 5) <= nr_pt_pages )
-            break;
-#elif defined(__x86_64__)
 #define NR(_l,_h,_s) \
     (((((_h) + ((1UL<<(_s))-1)) & ~((1UL<<(_s))-1)) - \
        ((_l) & ~((1UL<<(_s))-1))) >> (_s))
@@ -538,7 +516,6 @@ int __init construct_dom0(
               NR(v_start, v_end, L2_PAGETABLE_SHIFT))  /* # L1 */
              <= nr_pt_pages )
             break;
-#endif
     }
 
     count = v_end - v_start;
@@ -553,12 +530,7 @@ int __init construct_dom0(
         vphysmap_start = parms.p2m_base;
         vphysmap_end   = vphysmap_start + nr_pages * sizeof(unsigned long);
     }
-#ifdef __i386__
-    if ( !test_bit(XENFEAT_pae_pgdir_above_4gb, parms.f_supported) )
-        page = alloc_domheap_pages(d, order, MEMF_bits(32));
-    else
-#endif
-        page = alloc_domheap_pages(d, order, 0);
+    page = alloc_domheap_pages(d, order, 0);
     if ( page == NULL )
         panic("Not enough RAM for domain 0 allocation.\n");
     alloc_spfn = page_to_mfn(page);
@@ -571,7 +543,6 @@ int __init construct_dom0(
                      d->tot_pages;
         initrd_mfn = mfn = initrd->mod_start;
         count = PFN_UP(initrd_len);
-#ifdef __x86_64__
         if ( d->arch.physaddr_bitsize &&
              ((mfn + count - 1) >> (d->arch.physaddr_bitsize - PAGE_SHIFT)) )
         {
@@ -593,10 +564,11 @@ int __init construct_dom0(
             initrd->mod_start = initrd_mfn = page_to_mfn(page);
         }
         else
-#endif
+        {
             while ( count-- )
                 if ( assign_pages(d, mfn_to_page(mfn++), 0, 0) )
                     BUG();
+        }
         initrd->mod_end = 0;
     }
 
@@ -633,120 +605,6 @@ int __init construct_dom0(
     if ( vinitrd_start )
         mpt_alloc -= PAGE_ALIGN(initrd_len);
 
-#if defined(__i386__)
-    /*
-     * Protect the lowest 1GB of memory. We use a temporary mapping there
-     * from which we copy the kernel and ramdisk images.
-     */
-    if ( v_start < (1UL<<30) )
-    {
-        printk("Initial loading isn't allowed to lowest 1GB of memory.\n");
-        return -EINVAL;
-    }
-
-    mpt.mod_start = mpt_alloc >> PAGE_SHIFT;
-    mpt.mod_end   = vpt_end - vpt_start;
-    mpt_ptr = bootstrap_map(&mpt);
-#define MPT_ALLOC(n) (mpt_ptr += (n)*PAGE_SIZE, mpt_alloc += (n)*PAGE_SIZE)
-
-    /* WARNING: The new domain must have its 'processor' field filled in! */
-    l3start = l3tab = mpt_ptr; MPT_ALLOC(1);
-    l2start = l2tab = mpt_ptr; MPT_ALLOC(4);
-    for (i = 0; i < L3_PAGETABLE_ENTRIES; i++) {
-        if ( i < 3 )
-            clear_page(l2tab + i * L2_PAGETABLE_ENTRIES);
-        else
-            copy_page(l2tab + i * L2_PAGETABLE_ENTRIES,
-                      idle_pg_table_l2 + i * L2_PAGETABLE_ENTRIES);
-        l3tab[i] = l3e_from_pfn(mpt.mod_start + 1 + i, L3_PROT);
-        l2tab[(LINEAR_PT_VIRT_START >> L2_PAGETABLE_SHIFT)+i] =
-            l2e_from_pfn(mpt.mod_start + 1 + i, __PAGE_HYPERVISOR);
-    }
-    v->arch.guest_table = pagetable_from_pfn(mpt.mod_start);
-
-    for ( i = 0; i < PDPT_L2_ENTRIES; i++ )
-        l2tab[l2_linear_offset(PERDOMAIN_VIRT_START) + i] =
-            l2e_from_page(perdomain_pt_page(d, i), __PAGE_HYPERVISOR);
-
-    l2tab += l2_linear_offset(v_start);
-    pfn = alloc_spfn;
-    for ( count = 0; count < ((v_end-v_start)>>PAGE_SHIFT); count++ )
-    {
-        if ( !((unsigned long)l1tab & (PAGE_SIZE-1)) )
-        {
-            l1tab = mpt_ptr;
-            *l2tab = l2e_from_paddr(mpt_alloc, L2_PROT);
-            MPT_ALLOC(1);
-            l2tab++;
-            clear_page(l1tab);
-            if ( count == 0 )
-                l1tab += l1_table_offset(v_start);
-        }
-        if ( count < initrd_pfn || count >= initrd_pfn + PFN_UP(initrd_len) )
-            mfn = pfn++;
-        else
-            mfn = initrd_mfn++;
-        *l1tab = l1e_from_pfn(mfn, L1_PROT);
-        l1tab++;
-        
-        page = mfn_to_page(mfn);
-        if ( !get_page_and_type(page, d, PGT_writable_page) )
-            BUG();
-    }
-#undef MPT_ALLOC
-
-    /* Pages that are part of page tables must be read only. */
-    mpt_alloc = (paddr_t)mpt.mod_start << PAGE_SHIFT;
-    mpt_ptr = l3start;
-    l2tab = l2start + l2_linear_offset(vpt_start);
-    l1start = mpt_ptr + (l2e_get_paddr(*l2tab) - mpt_alloc);
-    l1tab = l1start + l1_table_offset(vpt_start);
-    for ( count = 0; count < nr_pt_pages; count++ ) 
-    {
-        page = mfn_to_page(l1e_get_pfn(*l1tab));
-        if ( !opt_dom0_shadow )
-            l1e_remove_flags(*l1tab, _PAGE_RW);
-        else
-            if ( !get_page_type(page, PGT_writable_page) )
-                BUG();
-
-        switch ( count )
-        {
-        case 0:
-            page->u.inuse.type_info &= ~PGT_type_mask;
-            page->u.inuse.type_info |= PGT_l3_page_table;
-            get_page(page, d); /* an extra ref because of readable mapping */
-
-            /* Get another ref to L3 page so that it can be pinned. */
-            page->u.inuse.type_info++;
-            page->count_info++;
-            set_bit(_PGT_pinned, &page->u.inuse.type_info);
-            break;
-        case 1 ... 4:
-            page->u.inuse.type_info &= ~PGT_type_mask;
-            page->u.inuse.type_info |= PGT_l2_page_table;
-            if ( count == 4 )
-                page->u.inuse.type_info |= PGT_pae_xen_l2;
-            get_page(page, d); /* an extra ref because of readable mapping */
-            break;
-        default:
-            page->u.inuse.type_info &= ~PGT_type_mask;
-            page->u.inuse.type_info |= PGT_l1_page_table;
-            get_page(page, d); /* an extra ref because of readable mapping */
-            break;
-        }
-        if ( !((unsigned long)++l1tab & (PAGE_SIZE - 1)) )
-            l1tab = mpt_ptr + (l2e_get_paddr(*++l2tab) - mpt_alloc);
-    }
-
-    /*
-     * Put Xen's first L3 entry into Dom0's page tables so that updates
-     * through bootstrap_map() will affect the page tables we will run on.
-     */
-    l3start[0] = l3e_from_paddr(__pa(idle_pg_table_l2), L3_PROT);
-
-#elif defined(__x86_64__)
-
     /* Overlap with Xen protected area? */
     if ( !is_pv_32on64_domain(d) ?
          ((v_start < HYPERVISOR_VIRT_END) &&
@@ -903,8 +761,6 @@ int __init construct_dom0(
         }
     }
 
-#endif /* __x86_64__ */
-
     /* Mask all upcalls... */
     for ( i = 0; i < XEN_LEGACY_MAX_VCPUS; i++ )
         shared_info(d, vcpu_info[i].evtchn_upcall_mask) = 1;
@@ -971,7 +827,6 @@ int __init construct_dom0(
              elf_64bit(&elf) ? 64 : 32, parms.pae ? "p" : "");
 
     count = d->tot_pages;
-#ifdef __x86_64__
     /* Set up the phys->machine table if not part of the initial mapping. */
     if ( parms.p2m_base != UNSET_ADDR )
     {
@@ -1071,7 +926,6 @@ int __init construct_dom0(
         if ( !page )
             panic("Not enough RAM for DOM0 P->M table.\n");
     }
-#endif
 
     /* Write the phys->machine and machine->phys table entries. */
     for ( pfn = 0; pfn < count; pfn++ )
@@ -1158,34 +1012,12 @@ int __init construct_dom0(
         si->console.dom0.info_size = sizeof(struct dom0_vga_console_info);
     }
 
-#if defined(__x86_64__)
     if ( is_pv_32on64_domain(d) )
         xlat_start_info(si, XLAT_start_info_console_dom0);
-#endif
 
     /* Return to idle domain's page tables. */
     write_ptbase(current);
 
-#if defined(__i386__)
-    /* Restore Dom0's first L3 entry. */
-    mpt.mod_end = 5 * PAGE_SIZE;
-    l3start = mpt_ptr = bootstrap_map(&mpt);
-    l2start = mpt_ptr + PAGE_SIZE;
-    l3start[0] = l3e_from_pfn(mpt.mod_start + 1, L3_PROT);
-
-    /* Re-setup CR3  */
-    if ( paging_mode_enabled(d) )
-        paging_update_paging_modes(v);
-    else
-        update_cr3(v);
-
-    /*
-     * Destroy low mappings - they were only for our convenience. Note
-     * that zap_low_mappings() exceeds what bootstrap_map(NULL) would do.
-     */
-    zap_low_mappings(l2start);
-#endif
-
     update_domain_wallclock_time(d);
 
     v->is_initialised = 1;
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/domctl.c	Wed Sep 12 13:29:30 2012 +0100
@@ -156,7 +156,6 @@ long arch_do_domctl(
     break;
 
     case XEN_DOMCTL_getpageframeinfo3:
-#ifdef __x86_64__
         if (!has_32bit_shinfo(current->domain))
         {
             unsigned int n, j;
@@ -258,7 +257,6 @@ long arch_do_domctl(
             rcu_unlock_domain(d);
             break;
         }
-#endif
         /* fall thru */
     case XEN_DOMCTL_getpageframeinfo2:
     {
@@ -1004,7 +1002,6 @@ long arch_do_domctl(
         if ( domctl->cmd == XEN_DOMCTL_get_ext_vcpucontext )
         {
             evc->size = sizeof(*evc);
-#ifdef __x86_64__
             if ( !is_hvm_domain(d) )
             {
                 evc->sysenter_callback_cs      =
@@ -1021,7 +1018,6 @@ long arch_do_domctl(
                     v->arch.pv_vcpu.syscall32_disables_events;
             }
             else
-#endif
             {
                 evc->sysenter_callback_cs      = 0;
                 evc->sysenter_callback_eip     = 0;
@@ -1037,7 +1033,6 @@ long arch_do_domctl(
             ret = -EINVAL;
             if ( evc->size < offsetof(typeof(*evc), mcg_cap) )
                 goto ext_vcpucontext_out;
-#ifdef __x86_64__
             if ( !is_hvm_domain(d) )
             {
                 if ( !is_canonical_address(evc->sysenter_callback_eip) ||
@@ -1059,7 +1054,6 @@ long arch_do_domctl(
                     evc->syscall32_disables_events;
             }
             else
-#endif
             /* We do not support syscall/syscall32/sysenter on 32-bit Xen. */
             if ( (evc->sysenter_callback_cs & ~3) ||
                  evc->sysenter_callback_eip ||
@@ -1443,7 +1437,6 @@ long arch_do_domctl(
     }
     break;
 
-#ifdef __x86_64__
     case XEN_DOMCTL_mem_event_op:
     {
         struct domain *d;
@@ -1477,7 +1470,6 @@ long arch_do_domctl(
         } 
     }
     break;
-#endif /* __x86_64__ */
 
 #if P2M_AUDIT
     case XEN_DOMCTL_audit_p2m:
@@ -1594,12 +1586,9 @@ void arch_get_info_guest(struct vcpu *v,
         c.nat->user_regs.es = sreg.sel;
         hvm_get_segment_register(v, x86_seg_fs, &sreg);
         c.nat->user_regs.fs = sreg.sel;
-#ifdef __x86_64__
         c.nat->fs_base = sreg.base;
-#endif
         hvm_get_segment_register(v, x86_seg_gs, &sreg);
         c.nat->user_regs.gs = sreg.sel;
-#ifdef __x86_64__
         if ( ring_0(&c.nat->user_regs) )
         {
             c.nat->gs_base_kernel = sreg.base;
@@ -1610,7 +1599,6 @@ void arch_get_info_guest(struct vcpu *v,
             c.nat->gs_base_user = sreg.base;
             c.nat->gs_base_kernel = hvm_get_shadow_gs_base(v);
         }
-#endif
     }
     else
     {
@@ -1631,7 +1619,6 @@ void arch_get_info_guest(struct vcpu *v,
             c(ctrlreg[i] = v->arch.pv_vcpu.ctrlreg[i]);
         c(event_callback_eip = v->arch.pv_vcpu.event_callback_eip);
         c(failsafe_callback_eip = v->arch.pv_vcpu.failsafe_callback_eip);
-#ifdef CONFIG_X86_64
         if ( !compat )
         {
             c.nat->syscall_callback_eip = v->arch.pv_vcpu.syscall_callback_eip;
@@ -1640,7 +1627,6 @@ void arch_get_info_guest(struct vcpu *v,
             c.nat->gs_base_user = v->arch.pv_vcpu.gs_base_user;
         }
         else
-#endif
         {
             c(event_callback_cs = v->arch.pv_vcpu.event_callback_cs);
             c(failsafe_callback_cs = v->arch.pv_vcpu.failsafe_callback_cs);
@@ -1655,11 +1641,9 @@ void arch_get_info_guest(struct vcpu *v,
         {
             c.nat->ctrlreg[3] = xen_pfn_to_cr3(
                 pagetable_get_pfn(v->arch.guest_table));
-#ifdef __x86_64__
             c.nat->ctrlreg[1] =
                 pagetable_is_null(v->arch.guest_table_user) ? 0
                 : xen_pfn_to_cr3(pagetable_get_pfn(v->arch.guest_table_user));
-#endif
 
             /* Merge shadow DR7 bits into real DR7. */
             c.nat->debugreg[7] |= c.nat->debugreg[5];
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/e820.c
--- a/xen/arch/x86/e820.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/e820.c	Wed Sep 12 13:29:30 2012 +0100
@@ -514,6 +514,7 @@ static void __init reserve_dmi_region(vo
 static void __init machine_specific_memory_setup(
     struct e820entry *raw, int *raw_nr)
 {
+    unsigned long mpt_limit, ro_mpt_limit;
     uint64_t top_of_ram, size;
     int i;
 
@@ -536,25 +537,15 @@ static void __init machine_specific_memo
                 NULL);
     }
 
-#ifdef __i386__
-    clip_to_limit((1ULL << 30) * MACHPHYS_MBYTES,
-                  "Only the first %lu GB of the physical memory map "
-                  "can be accessed by Xen in 32-bit mode.");
-#else
-    {
-        unsigned long mpt_limit, ro_mpt_limit;
-
-        mpt_limit = ((RDWR_MPT_VIRT_END - RDWR_MPT_VIRT_START)
-                     / sizeof(unsigned long)) << PAGE_SHIFT;
-        ro_mpt_limit = ((RO_MPT_VIRT_END - RO_MPT_VIRT_START)
-                        / sizeof(unsigned long)) << PAGE_SHIFT;
-        if ( mpt_limit > ro_mpt_limit )
-            mpt_limit = ro_mpt_limit;
-        clip_to_limit(mpt_limit,
-                      "Only the first %lu GB of the physical "
-                      "memory map can be accessed by Xen.");
-    }
-#endif
+    mpt_limit = ((RDWR_MPT_VIRT_END - RDWR_MPT_VIRT_START)
+                 / sizeof(unsigned long)) << PAGE_SHIFT;
+    ro_mpt_limit = ((RO_MPT_VIRT_END - RO_MPT_VIRT_START)
+                    / sizeof(unsigned long)) << PAGE_SHIFT;
+    if ( mpt_limit > ro_mpt_limit )
+        mpt_limit = ro_mpt_limit;
+    clip_to_limit(mpt_limit,
+                  "Only the first %lu GB of the physical "
+                  "memory map can be accessed by Xen.");
 
     reserve_dmi_region();
 
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/extable.c
--- a/xen/arch/x86/extable.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/extable.c	Wed Sep 12 13:29:30 2012 +0100
@@ -6,12 +6,7 @@
 #include <xen/spinlock.h>
 #include <asm/uaccess.h>
 
-#ifdef __i386__
-#define EX_FIELD(ptr, field) (ptr)->field
-#define swap_ex NULL
-#else
 #define EX_FIELD(ptr, field) ((unsigned long)&(ptr)->field + (ptr)->field)
-#endif
 
 static inline unsigned long ex_addr(const struct exception_table_entry *x)
 {
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/genapic/x2apic.c
--- a/xen/arch/x86/genapic/x2apic.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/genapic/x2apic.c	Wed Sep 12 13:29:30 2012 +0100
@@ -138,19 +138,7 @@ void __init check_x2apic_preenabled(void
     if ( lo & MSR_IA32_APICBASE_EXTD )
     {
         printk("x2APIC mode is already enabled by BIOS.\n");
-#ifndef __i386__
         x2apic_enabled = 1;
         genapic = apic_x2apic_probe();
-#else
-        lo &= ~(MSR_IA32_APICBASE_ENABLE | MSR_IA32_APICBASE_EXTD);
-        wrmsr(MSR_IA32_APICBASE, lo, hi);
-        lo |= MSR_IA32_APICBASE_ENABLE;
-        wrmsr(MSR_IA32_APICBASE, lo, hi);
-        printk("x2APIC disabled permanently on x86_32.\n");
-#endif
     }
-
-#ifdef __i386__
-    clear_bit(X86_FEATURE_X2APIC, boot_cpu_data.x86_capability);
-#endif
 }
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/hvm/hvm.c	Wed Sep 12 13:29:30 2012 +0100
@@ -681,7 +681,6 @@ static int hvm_save_cpu_ctxt(struct doma
         ctxt.rsp = v->arch.user_regs.esp;
         ctxt.rip = v->arch.user_regs.eip;
         ctxt.rflags = v->arch.user_regs.eflags;
-#ifdef __x86_64__
         ctxt.r8  = v->arch.user_regs.r8;
         ctxt.r9  = v->arch.user_regs.r9;
         ctxt.r10 = v->arch.user_regs.r10;
@@ -690,7 +689,6 @@ static int hvm_save_cpu_ctxt(struct doma
         ctxt.r13 = v->arch.user_regs.r13;
         ctxt.r14 = v->arch.user_regs.r14;
         ctxt.r15 = v->arch.user_regs.r15;
-#endif
         ctxt.dr0 = v->arch.debugreg[0];
         ctxt.dr1 = v->arch.debugreg[1];
         ctxt.dr2 = v->arch.debugreg[2];
@@ -867,7 +865,6 @@ static int hvm_load_cpu_ctxt(struct doma
     v->arch.user_regs.esp = ctxt.rsp;
     v->arch.user_regs.eip = ctxt.rip;
     v->arch.user_regs.eflags = ctxt.rflags | 2;
-#ifdef __x86_64__
     v->arch.user_regs.r8  = ctxt.r8;
     v->arch.user_regs.r9  = ctxt.r9;
     v->arch.user_regs.r10 = ctxt.r10;
@@ -876,7 +873,6 @@ static int hvm_load_cpu_ctxt(struct doma
     v->arch.user_regs.r13 = ctxt.r13;
     v->arch.user_regs.r14 = ctxt.r14;
     v->arch.user_regs.r15 = ctxt.r15;
-#endif
     v->arch.debugreg[0] = ctxt.dr0;
     v->arch.debugreg[1] = ctxt.dr1;
     v->arch.debugreg[2] = ctxt.dr2;
@@ -1259,9 +1255,7 @@ int hvm_hap_nested_page_fault(paddr_t gp
     struct vcpu *v = current;
     struct p2m_domain *p2m;
     int rc, fall_through = 0, paged = 0;
-#ifdef __x86_64__
     int sharing_enomem = 0;
-#endif
     mem_event_request_t *req_ptr = NULL;
 
     /* On Nested Virtualization, walk the guest page table.
@@ -1370,7 +1364,6 @@ int hvm_hap_nested_page_fault(paddr_t gp
         goto out;
     }
 
-#ifdef __x86_64__
     /* Check if the page has been paged out */
     if ( p2m_is_paged(p2mt) || (p2mt == p2m_ram_paging_out) )
         paged = 1;
@@ -1384,7 +1377,6 @@ int hvm_hap_nested_page_fault(paddr_t gp
         rc = 1;
         goto out_put_gfn;
     }
-#endif
  
     /* Spurious fault? PoD and log-dirty also take this path. */
     if ( p2m_is_ram(p2mt) )
@@ -1426,7 +1418,6 @@ out:
      * locks in such circumstance */
     if ( paged )
         p2m_mem_paging_populate(v->domain, gfn);
-#ifdef __x86_64__
     if ( sharing_enomem )
     {
         int rv;
@@ -1439,7 +1430,6 @@ out:
             rc = 0;
         }
     }
-#endif
     if ( req_ptr )
     {
         mem_access_send_req(v->domain, req_ptr);
@@ -2625,14 +2615,12 @@ unsigned long copy_to_user_hvm(void *to,
 {
     int rc;
 
-#ifdef __x86_64__
     if ( !current->arch.hvm_vcpu.hcall_64bit &&
          is_compat_arg_xlat_range(to, len) )
     {
         memcpy(to, from, len);
         return 0;
     }
-#endif
 
     rc = hvm_copy_to_guest_virt_nofault((unsigned long)to, (void *)from,
                                         len, 0);
@@ -2643,14 +2631,12 @@ unsigned long clear_user_hvm(void *to, u
 {
     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 */
@@ -2660,14 +2646,12 @@ unsigned long copy_from_user_hvm(void *t
 {
     int rc;
 
-#ifdef __x86_64__
     if ( !current->arch.hvm_vcpu.hcall_64bit &&
          is_compat_arg_xlat_range(from, len) )
     {
         memcpy(to, from, len);
         return 0;
     }
-#endif
 
     rc = hvm_copy_from_guest_virt_nofault(to, (unsigned long)from, len, 0);
     return rc ? len : 0; /* fake a copy_from_user() return code */
@@ -3121,24 +3105,6 @@ typedef unsigned long hvm_hypercall_t(
 #define HYPERCALL(x)                                        \
     [ __HYPERVISOR_ ## x ] = (hvm_hypercall_t *) do_ ## x
 
-#if defined(__i386__)
-
-static hvm_hypercall_t *hvm_hypercall32_table[NR_hypercalls] = {
-    [ __HYPERVISOR_memory_op ] = (hvm_hypercall_t *)hvm_memory_op,
-    [ __HYPERVISOR_grant_table_op ] = (hvm_hypercall_t *)hvm_grant_table_op,
-    [ __HYPERVISOR_vcpu_op ] = (hvm_hypercall_t *)hvm_vcpu_op,
-    [ __HYPERVISOR_physdev_op ] = (hvm_hypercall_t *)hvm_physdev_op,
-    HYPERCALL(xen_version),
-    HYPERCALL(event_channel_op),
-    HYPERCALL(sched_op),
-    HYPERCALL(set_timer_op),
-    HYPERCALL(hvm_op),
-    HYPERCALL(sysctl),
-    HYPERCALL(tmem_op)
-};
-
-#else /* defined(__x86_64__) */
-
 static long hvm_grant_table_op_compat32(unsigned int cmd,
                                         XEN_GUEST_HANDLE(void) uop,
                                         unsigned int count)
@@ -3239,8 +3205,6 @@ static hvm_hypercall_t *hvm_hypercall32_
     HYPERCALL(tmem_op)
 };
 
-#endif /* defined(__x86_64__) */
-
 int hvm_do_hypercall(struct cpu_user_regs *regs)
 {
     struct vcpu *curr = current;
@@ -3250,9 +3214,7 @@ int hvm_do_hypercall(struct cpu_user_reg
 
     switch ( mode )
     {
-#ifdef __x86_64__
     case 8:        
-#endif
     case 4:
     case 2:
         hvm_get_segment_register(curr, x86_seg_ss, &sreg);
@@ -3277,7 +3239,6 @@ int hvm_do_hypercall(struct cpu_user_reg
 
     curr->arch.hvm_vcpu.hcall_preempted = 0;
 
-#ifdef __x86_64__
     if ( mode == 8 )
     {
         HVM_DBG_LOG(DBG_LEVEL_HCALL, "hcall%u(%lx, %lx, %lx, %lx, %lx, %lx)",
@@ -3294,7 +3255,6 @@ int hvm_do_hypercall(struct cpu_user_reg
         curr->arch.hvm_vcpu.hcall_64bit = 0;
     }
     else
-#endif
     {
         HVM_DBG_LOG(DBG_LEVEL_HCALL, "hcall%u(%x, %x, %x, %x, %x, %x)", eax,
                     (uint32_t)regs->ebx, (uint32_t)regs->ecx,
@@ -4369,7 +4329,6 @@ int hvm_debug_op(struct vcpu *v, int32_t
     return rc;
 }
 
-#ifdef __x86_64__
 static int hvm_memory_event_traps(long p, uint32_t reason,
                                   unsigned long value, unsigned long old, 
                                   bool_t gla_valid, unsigned long gla) 
@@ -4462,7 +4421,6 @@ int hvm_memory_event_single_step(unsigne
             MEM_EVENT_REASON_SINGLESTEP,
             gfn, 0, 1, gla);
 }
-#endif /* __x86_64__ */
 
 int nhvm_vcpu_hostrestore(struct vcpu *v, struct cpu_user_regs *regs)
 {
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/hvm/svm/emulate.c
--- a/xen/arch/x86/hvm/svm/emulate.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/hvm/svm/emulate.c	Wed Sep 12 13:29:30 2012 +0100
@@ -44,9 +44,7 @@ static unsigned int is_prefix(u8 opc)
     case 0xF0:
     case 0xF3:
     case 0xF2:
-#if __x86_64__
     case 0x40 ... 0x4f:
-#endif /* __x86_64__ */
         return 1;
     }
     return 0;
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/hvm/svm/entry.S
--- a/xen/arch/x86/hvm/svm/entry.S	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/hvm/svm/entry.S	Wed Sep 12 13:29:30 2012 +0100
@@ -33,24 +33,11 @@
 
 #define get_current(reg) GET_CURRENT(r(reg))
         
-#if defined(__x86_64__)
 #define r(reg) %r##reg
 #define addr_of(lbl) lbl(%rip)
 #define call_with_regs(fn)                      \
         mov  %rsp,%rdi;                         \
         call fn;
-#else /* defined(__i386__) */
-#define r(reg) %e##reg
-#define addr_of(lbl) lbl
-#define UREGS_rax UREGS_eax
-#define UREGS_rip UREGS_eip
-#define UREGS_rsp UREGS_esp
-#define call_with_regs(fn)                      \
-        mov  %esp,%eax;                         \
-        push %eax;                              \
-        call fn;                                \
-        add  $4,%esp;
-#endif
 
 ENTRY(svm_asm_do_resume)
         call svm_intr_assist
@@ -93,7 +80,6 @@ UNLIKELY_END(svm_trace)
 
         mov  VCPU_svm_vmcb_pa(r(bx)),r(ax)
 
-#if defined(__x86_64__)
         pop  %r15
         pop  %r14
         pop  %r13
@@ -109,18 +95,9 @@ UNLIKELY_END(svm_trace)
         pop  %rdx
         pop  %rsi
         pop  %rdi
-#else /* defined(__i386__) */
-        pop  %ebx
-        pop  %ecx
-        pop  %edx
-        pop  %esi
-        pop  %edi
-        pop  %ebp
-#endif
 
         VMRUN
 
-#if defined(__x86_64__)
         push %rdi
         push %rsi
         push %rdx
@@ -136,14 +113,6 @@ UNLIKELY_END(svm_trace)
         push %r13
         push %r14
         push %r15
-#else /* defined(__i386__) */
-        push %ebp
-        push %edi
-        push %esi
-        push %edx
-        push %ecx
-        push %ebx
-#endif
 
         get_current(bx)
         movb $0,VCPU_svm_vmcb_in_sync(r(bx))
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/hvm/svm/svm.c	Wed Sep 12 13:29:30 2012 +0100
@@ -871,12 +871,10 @@ static void svm_ctxt_switch_from(struct 
     svm_sync_vmcb(v);
     svm_vmload(per_cpu(root_vmcb, cpu));
 
-#ifdef __x86_64__
     /* Resume use of ISTs now that the host TR is reinstated. */
     idt_tables[cpu][TRAP_double_fault].a  |= IST_DF << 32;
     idt_tables[cpu][TRAP_nmi].a           |= IST_NMI << 32;
     idt_tables[cpu][TRAP_machine_check].a |= IST_MCE << 32;
-#endif
 }
 
 static void svm_ctxt_switch_to(struct vcpu *v)
@@ -884,7 +882,6 @@ static void svm_ctxt_switch_to(struct vc
     struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb;
     int cpu = smp_processor_id();
 
-#ifdef  __x86_64__
     /* 
      * This is required, because VMRUN does consistency check
      * and some of the DOM0 selectors are pointing to 
@@ -902,7 +899,6 @@ static void svm_ctxt_switch_to(struct vc
     idt_tables[cpu][TRAP_double_fault].a  &= ~(7UL << 32);
     idt_tables[cpu][TRAP_nmi].a           &= ~(7UL << 32);
     idt_tables[cpu][TRAP_machine_check].a &= ~(7UL << 32);
-#endif
 
     svm_restore_dr(v);
 
@@ -1222,7 +1218,6 @@ static int svm_cpu_up(void)
     /* Initialize core's ASID handling. */
     svm_asid_init(c);
 
-#ifdef __x86_64__
     /*
      * Check whether EFER.LMSLE can be written.
      * Unfortunately there's no feature bit defined for this.
@@ -1242,7 +1237,6 @@ static int svm_cpu_up(void)
             printk(XENLOG_WARNING "Inconsistent LMSLE support across CPUs!\n");
         cpu_has_lmsl = 0;
     }
-#endif
 
     /* Initialize OSVW bits to be used by guests */
     svm_host_osvw_init();
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/hvm/viridian.c
--- a/xen/arch/x86/hvm/viridian.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/hvm/viridian.c	Wed Sep 12 13:29:30 2012 +0100
@@ -346,13 +346,11 @@ int viridian_hypercall(struct cpu_user_r
 
     switch ( mode )
     {
-#ifdef __x86_64__
     case 8:
         input.raw = regs->rcx;
         input_params_gpa = regs->rdx;
         output_params_gpa = regs->r8;
         break;
-#endif
     case 4:
         input.raw = ((uint64_t)regs->edx << 32) | regs->eax;
         input_params_gpa = ((uint64_t)regs->ebx << 32) | regs->ecx;
@@ -377,11 +375,9 @@ int viridian_hypercall(struct cpu_user_r
 out:
     output.result = status;
     switch (mode) {
-#ifdef __x86_64__
     case 8:
         regs->rax = output.raw;
         break;
-#endif
     default:
         regs->edx = output.raw >> 32;
         regs->eax = output.raw;
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/hvm/vlapic.c
--- a/xen/arch/x86/hvm/vlapic.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/hvm/vlapic.c	Wed Sep 12 13:29:30 2012 +0100
@@ -1184,11 +1184,6 @@ int vlapic_init(struct vcpu *v)
 
     vlapic->pt.source = PTSRC_lapic;
 
-#ifdef __i386__
-    /* 32-bit VMX may be limited to 32-bit physical addresses. */
-    if ( boot_cpu_data.x86_vendor == X86_VENDOR_INTEL )
-        memflags |= MEMF_bits(32);
-#endif
     if (vlapic->regs_page == NULL)
     {
         vlapic->regs_page = alloc_domheap_page(NULL, memflags);
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/hvm/vmx/entry.S
--- a/xen/arch/x86/hvm/vmx/entry.S	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/hvm/vmx/entry.S	Wed Sep 12 13:29:30 2012 +0100
@@ -38,28 +38,15 @@
 
 #define get_current(reg) GET_CURRENT(r(reg))
 
-#if defined(__x86_64__)
 #define r(reg) %r##reg
 #define addr_of(lbl) lbl(%rip)
 #define call_with_regs(fn)                      \
         mov  %rsp,%rdi;                         \
         call fn;
-#else /* defined(__i386__) */
-#define r(reg) %e##reg
-#define addr_of(lbl) lbl
-#define UREGS_rip UREGS_eip
-#define UREGS_rsp UREGS_esp
-#define call_with_regs(fn)                      \
-        mov  %esp,%eax;                         \
-        push %eax;                              \
-        call fn;                                \
-        add  $4,%esp;
-#endif
 
         ALIGN
 .globl vmx_asm_vmexit_handler
 vmx_asm_vmexit_handler:
-#if defined(__x86_64__)
         push %rdi
         push %rsi
         push %rdx
@@ -75,15 +62,6 @@ vmx_asm_vmexit_handler:
         push %r13
         push %r14
         push %r15
-#else /* defined(__i386__) */
-        push %eax
-        push %ebp
-        push %edi
-        push %esi
-        push %edx
-        push %ecx
-        push %ebx
-#endif
 
         get_current(bx)
 
@@ -153,7 +131,6 @@ UNLIKELY_END(realmode)
         VMWRITE(UREGS_eflags)
 
         cmpb $0,VCPU_vmx_launched(r(bx))
-#if defined(__x86_64__)
         pop  %r15
         pop  %r14
         pop  %r13
@@ -169,15 +146,6 @@ UNLIKELY_END(realmode)
         pop  %rdx
         pop  %rsi
         pop  %rdi
-#else /* defined(__i386__) */
-        pop  %ebx
-        pop  %ecx
-        pop  %edx
-        pop  %esi
-        pop  %edi
-        pop  %ebp
-        pop  %eax
-#endif
         je   .Lvmx_launch
 
 /*.Lvmx_resume:*/
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/hvm/vmx/vmcs.c
--- a/xen/arch/x86/hvm/vmx/vmcs.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/hvm/vmx/vmcs.c	Wed Sep 12 13:29:30 2012 +0100
@@ -145,10 +145,8 @@ static int vmx_init_vmcs_config(void)
 
     min = (CPU_BASED_HLT_EXITING |
            CPU_BASED_VIRTUAL_INTR_PENDING |
-#ifdef __x86_64__
            CPU_BASED_CR8_LOAD_EXITING |
            CPU_BASED_CR8_STORE_EXITING |
-#endif
            CPU_BASED_INVLPG_EXITING |
            CPU_BASED_CR3_LOAD_EXITING |
            CPU_BASED_CR3_STORE_EXITING |
@@ -166,11 +164,9 @@ static int vmx_init_vmcs_config(void)
         "CPU-Based Exec Control", min, opt,
         MSR_IA32_VMX_PROCBASED_CTLS, &mismatch);
     _vmx_cpu_based_exec_control &= ~CPU_BASED_RDTSC_EXITING;
-#ifdef __x86_64__
     if ( _vmx_cpu_based_exec_control & CPU_BASED_TPR_SHADOW )
         _vmx_cpu_based_exec_control &=
             ~(CPU_BASED_CR8_LOAD_EXITING | CPU_BASED_CR8_STORE_EXITING);
-#endif
 
     if ( _vmx_cpu_based_exec_control & CPU_BASED_ACTIVATE_SECONDARY_CONTROLS )
     {
@@ -249,18 +245,9 @@ static int vmx_init_vmcs_config(void)
         _vmx_secondary_exec_control &= ~ SECONDARY_EXEC_PAUSE_LOOP_EXITING;
     }
 
-#if defined(__i386__)
-    /* If we can't virtualise APIC accesses, the TPR shadow is pointless. */
-    if ( !(_vmx_secondary_exec_control &
-           SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES) )
-        _vmx_cpu_based_exec_control &= ~CPU_BASED_TPR_SHADOW;
-#endif
-
     min = VM_EXIT_ACK_INTR_ON_EXIT;
     opt = VM_EXIT_SAVE_GUEST_PAT | VM_EXIT_LOAD_HOST_PAT;
-#ifdef __x86_64__
     min |= VM_EXIT_IA32E_MODE;
-#endif
     _vmx_vmexit_control = adjust_vmx_controls(
         "VMExit Control", min, opt, MSR_IA32_VMX_EXIT_CTLS, &mismatch);
 
@@ -333,7 +320,6 @@ static int vmx_init_vmcs_config(void)
         return -EINVAL;
     }
 
-#ifdef __x86_64__
     /* IA-32 SDM Vol 3B: 64-bit CPUs always have VMX_BASIC_MSR[48]==0. */
     if ( vmx_basic_msr_high & (1u<<16) )
     {
@@ -341,7 +327,6 @@ static int vmx_init_vmcs_config(void)
                smp_processor_id());
         return -EINVAL;
     }
-#endif
 
     /* Require Write-Back (WB) memory type for VMCS accesses. */
     if ( ((vmx_basic_msr_high >> 18) & 15) != 6 )
@@ -866,9 +851,6 @@ static int construct_vmcs(struct vcpu *v
     __vmwrite(GUEST_INTERRUPTIBILITY_INFO, 0);
     __vmwrite(GUEST_DR7, 0);
     __vmwrite(VMCS_LINK_POINTER, ~0UL);
-#if defined(__i386__)
-    __vmwrite(VMCS_LINK_POINTER_HIGH, ~0UL);
-#endif
 
     v->arch.hvm_vmx.exception_bitmap = HVM_TRAP_MASK
               | (paging_mode_hap(d) ? 0 : (1U << TRAP_page_fault))
@@ -889,13 +871,7 @@ static int construct_vmcs(struct vcpu *v
     }
 
     if ( paging_mode_hap(d) )
-    {
         __vmwrite(EPT_POINTER, d->arch.hvm_domain.vmx.ept_control.eptp);
-#ifdef __i386__
-        __vmwrite(EPT_POINTER_HIGH,
-                  d->arch.hvm_domain.vmx.ept_control.eptp >> 32);
-#endif
-    }
 
     if ( cpu_has_vmx_pat && paging_mode_hap(d) )
     {
@@ -906,10 +882,6 @@ static int construct_vmcs(struct vcpu *v
 
         __vmwrite(HOST_PAT, host_pat);
         __vmwrite(GUEST_PAT, guest_pat);
-#ifdef __i386__
-        __vmwrite(HOST_PAT_HIGH, host_pat >> 32);
-        __vmwrite(GUEST_PAT_HIGH, guest_pat >> 32);
-#endif
     }
 
     vmx_vmcs_exit(v);
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Wed Sep 12 13:29:30 2012 +0100
@@ -145,8 +145,6 @@ static void vmx_vcpu_destroy(struct vcpu
     passive_domain_destroy(v);
 }
 
-#ifdef __x86_64__
-
 static DEFINE_PER_CPU(struct vmx_msr_state, host_msr_state);
 
 static u32 msr_index[] =
@@ -338,28 +336,6 @@ static void vmx_restore_guest_msrs(struc
         wrmsrl(MSR_TSC_AUX, hvm_msr_tsc_aux(v));
 }
 
-#else  /* __i386__ */
-
-void vmx_save_host_msrs(void) {}
-#define vmx_restore_host_msrs()     ((void)0)
-
-#define vmx_save_guest_msrs(v)      ((void)0)
-#define vmx_restore_guest_msrs(v)   ((void)0)
-
-static enum handler_return
-long_mode_do_msr_read(unsigned int msr, uint64_t *msr_content)
-{
-    return HNDL_unhandled;
-}
-
-static enum handler_return
-long_mode_do_msr_write(unsigned int msr, uint64_t msr_content)
-{
-    return HNDL_unhandled;
-}
-
-#endif /* __i386__ */
-
 void vmx_update_cpu_exec_control(struct vcpu *v)
 {
     if ( nestedhvm_vcpu_in_guestmode(v) )
@@ -565,7 +541,6 @@ static int vmx_vmcs_restore(struct vcpu 
 
 static void vmx_save_cpu_state(struct vcpu *v, struct hvm_hw_cpu *data)
 {
-#ifdef __x86_64__
     struct vmx_msr_state *guest_state = &v->arch.hvm_vmx.msr_state;
     unsigned long guest_flags = guest_state->flags;
 
@@ -577,14 +552,12 @@ static void vmx_save_cpu_state(struct vc
     data->msr_lstar        = guest_state->msrs[VMX_INDEX_MSR_LSTAR];
     data->msr_star         = guest_state->msrs[VMX_INDEX_MSR_STAR];
     data->msr_syscall_mask = guest_state->msrs[VMX_INDEX_MSR_SYSCALL_MASK];
-#endif
 
     data->tsc = hvm_get_guest_tsc(v);
 }
 
 static void vmx_load_cpu_state(struct vcpu *v, struct hvm_hw_cpu *data)
 {
-#ifdef __x86_64__
     struct vmx_msr_state *guest_state = &v->arch.hvm_vmx.msr_state;
 
     /* restore msrs */
@@ -595,7 +568,6 @@ static void vmx_load_cpu_state(struct vc
 
     v->arch.hvm_vmx.cstar     = data->msr_cstar;
     v->arch.hvm_vmx.shadow_gs = data->shadow_gs;
-#endif
 
     hvm_set_guest_tsc(v, data->tsc);
 }
@@ -942,11 +914,7 @@ static void vmx_set_segment_register(str
 
 static unsigned long vmx_get_shadow_gs_base(struct vcpu *v)
 {
-#ifdef __x86_64__
     return v->arch.hvm_vmx.shadow_gs;
-#else
-    return 0;
-#endif
 }
 
 static int vmx_set_guest_pat(struct vcpu *v, u64 gpat)
@@ -956,9 +924,6 @@ static int vmx_set_guest_pat(struct vcpu
 
     vmx_vmcs_enter(v);
     __vmwrite(GUEST_PAT, gpat);
-#ifdef __i386__
-    __vmwrite(GUEST_PAT_HIGH, gpat >> 32);
-#endif
     vmx_vmcs_exit(v);
     return 1;
 }
@@ -970,9 +935,6 @@ static int vmx_get_guest_pat(struct vcpu
 
     vmx_vmcs_enter(v);
     *gpat = __vmread(GUEST_PAT);
-#ifdef __i386__
-    *gpat |= (u64)__vmread(GUEST_PAT_HIGH) << 32;
-#endif
     vmx_vmcs_exit(v);
     return 1;
 }
@@ -985,9 +947,6 @@ static void vmx_set_tsc_offset(struct vc
         offset += nvmx_get_tsc_offset(v);
 
     __vmwrite(TSC_OFFSET, offset);
-#if defined (__i386__)
-    __vmwrite(TSC_OFFSET_HIGH, offset >> 32);
-#endif
     vmx_vmcs_exit(v);
 }
 
@@ -1074,12 +1033,6 @@ static void vmx_load_pdptrs(struct vcpu 
     __vmwrite(GUEST_PDPTR1, guest_pdptrs[1]);
     __vmwrite(GUEST_PDPTR2, guest_pdptrs[2]);
     __vmwrite(GUEST_PDPTR3, guest_pdptrs[3]);
-#ifdef __i386__
-    __vmwrite(GUEST_PDPTR0_HIGH, guest_pdptrs[0] >> 32);
-    __vmwrite(GUEST_PDPTR1_HIGH, guest_pdptrs[1] >> 32);
-    __vmwrite(GUEST_PDPTR2_HIGH, guest_pdptrs[2] >> 32);
-    __vmwrite(GUEST_PDPTR3_HIGH, guest_pdptrs[3] >> 32);
-#endif
 
     vmx_vmcs_exit(v);
 
@@ -1245,7 +1198,6 @@ static void vmx_update_guest_cr(struct v
 
 static void vmx_update_guest_efer(struct vcpu *v)
 {
-#ifdef __x86_64__
     unsigned long vm_entry_value;
 
     vmx_vmcs_enter(v);
@@ -1258,7 +1210,6 @@ static void vmx_update_guest_efer(struct
     __vmwrite(VM_ENTRY_CONTROLS, vm_entry_value);
 
     vmx_vmcs_exit(v);
-#endif
 
     if ( v == current )
         write_efer((read_efer() & ~EFER_SCE) |
@@ -1764,14 +1715,6 @@ static const struct lbr_info {
     { MSR_C2_LASTBRANCH_0_FROM_IP,  NUM_MSR_ATOM_LASTBRANCH_FROM_TO },
     { MSR_C2_LASTBRANCH_0_TO_IP,    NUM_MSR_ATOM_LASTBRANCH_FROM_TO },
     { 0, 0 }
-#ifdef __i386__
-}, pm_lbr[] = {
-    { MSR_IA32_LASTINTFROMIP,       1 },
-    { MSR_IA32_LASTINTTOIP,         1 },
-    { MSR_PM_LASTBRANCH_TOS,        1 },
-    { MSR_PM_LASTBRANCH_0,          NUM_MSR_PM_LASTBRANCH },
-    { 0, 0 }
-#endif
 };
 
 static const struct lbr_info *last_branch_msr_get(void)
@@ -1781,14 +1724,6 @@ static const struct lbr_info *last_branc
     case 6:
         switch ( boot_cpu_data.x86_model )
         {
-#ifdef __i386__
-        /* PentiumM */
-        case 9: case 13:
-        /* Core Solo/Duo */
-        case 14:
-            return pm_lbr;
-            break;
-#endif
         /* Core2 Duo */
         case 15:
         /* Enhanced Core */
@@ -1857,9 +1792,6 @@ static int vmx_msr_read_intercept(unsign
         break;
     case MSR_IA32_DEBUGCTLMSR:
         *msr_content = __vmread(GUEST_IA32_DEBUGCTL);
-#ifdef __i386__
-        *msr_content |= (u64)__vmread(GUEST_IA32_DEBUGCTL_HIGH) << 32;
-#endif
         break;
     case IA32_FEATURE_CONTROL_MSR:
     case MSR_IA32_VMX_BASIC...MSR_IA32_VMX_TRUE_ENTRY_CTLS:
@@ -2027,9 +1959,6 @@ static int vmx_msr_write_intercept(unsig
         else
         {
             __vmwrite(GUEST_IA32_DEBUGCTL, msr_content);
-#ifdef __i386__
-            __vmwrite(GUEST_IA32_DEBUGCTL_HIGH, msr_content >> 32);
-#endif
         }
 
         break;
@@ -2697,9 +2626,6 @@ void vmx_vmexit_handler(struct cpu_user_
     case EXIT_REASON_EPT_VIOLATION:
     {
         paddr_t gpa = __vmread(GUEST_PHYSICAL_ADDRESS);
-#ifdef __i386__
-        gpa |= (paddr_t)__vmread(GUEST_PHYSICAL_ADDRESS_HIGH) << 32;
-#endif
         exit_qualification = __vmread(EXIT_QUALIFICATION);
         ept_handle_violation(exit_qualification, gpa);
         break;
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/hvm/vmx/vpmu_core2.c
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c	Wed Sep 12 13:29:30 2012 +0100
@@ -662,7 +662,6 @@ static int core2_vpmu_initialise(struct 
     /* Check the 'Debug Store' feature in the CPUID.EAX[1]:EDX[21] */
     if ( cpu_has(c, X86_FEATURE_DS) )
     {
-#ifdef __x86_64__
         if ( !cpu_has(c, X86_FEATURE_DTES64) )
         {
             printk(XENLOG_G_WARNING "CPU doesn't support 64-bit DS Area"
@@ -670,7 +669,6 @@ static int core2_vpmu_initialise(struct 
                    v->domain->domain_id, v->vcpu_id);
             goto func_out;
         }
-#endif
         vpmu_set(vpmu, VPMU_CPU_HAS_DS);
         rdmsrl(MSR_IA32_MISC_ENABLE, msr_content);
         if ( msr_content & MSR_IA32_MISC_ENABLE_BTS_UNAVAIL )
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Wed Sep 12 13:29:30 2012 +0100
@@ -234,7 +234,6 @@ static unsigned long reg_read(struct cpu
     CASE_GET_REG(RSI, esi);
     CASE_GET_REG(RDI, edi);
     CASE_GET_REG(RSP, esp);
-#ifdef CONFIG_X86_64
     CASE_GET_REG(R8, r8);
     CASE_GET_REG(R9, r9);
     CASE_GET_REG(R10, r10);
@@ -243,7 +242,6 @@ static unsigned long reg_read(struct cpu
     CASE_GET_REG(R13, r13);
     CASE_GET_REG(R14, r14);
     CASE_GET_REG(R15, r15);
-#endif
     default:
         break;
     }
@@ -264,7 +262,6 @@ static void reg_write(struct cpu_user_re
     CASE_SET_REG(RSI, esi);
     CASE_SET_REG(RDI, edi);
     CASE_SET_REG(RSP, esp);
-#ifdef CONFIG_X86_64
     CASE_SET_REG(R8, r8);
     CASE_SET_REG(R9, r9);
     CASE_SET_REG(R10, r10);
@@ -273,7 +270,6 @@ static void reg_write(struct cpu_user_re
     CASE_SET_REG(R13, r13);
     CASE_SET_REG(R14, r14);
     CASE_SET_REG(R15, r15);
-#endif
     default:
         break;
     }
@@ -646,10 +642,6 @@ static unsigned long vmcs_gstate_field[]
     /* 64 BITS */
     VMCS_LINK_POINTER,
     GUEST_IA32_DEBUGCTL,
-#ifndef CONFIG_X86_64
-    VMCS_LINK_POINTER_HIGH,
-    GUEST_IA32_DEBUGCTL_HIGH,
-#endif
     /* 32 BITS */
     GUEST_ES_LIMIT,
     GUEST_CS_LIMIT,
@@ -799,9 +791,7 @@ static void virtual_vmentry(struct cpu_u
     struct vcpu *v = current;
     struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
     void *vvmcs = nvcpu->nv_vvmcx;
-#ifdef __x86_64__
     unsigned long lm_l1, lm_l2;
-#endif
 
     vmx_vmcs_switch(v->arch.hvm_vmx.vmcs, nvcpu->nv_n2vmcx);
 
@@ -809,7 +799,6 @@ static void virtual_vmentry(struct cpu_u
     nvcpu->nv_vmentry_pending = 0;
     nvcpu->nv_vmswitch_in_progress = 1;
 
-#ifdef __x86_64__
     /*
      * EFER handling:
      * hvm_set_efer won't work if CR0.PG = 1, so we change the value
@@ -827,15 +816,12 @@ static void virtual_vmentry(struct cpu_u
         v->arch.hvm_vcpu.guest_efer |= EFER_LMA | EFER_LME;
     else
         v->arch.hvm_vcpu.guest_efer &= ~(EFER_LMA | EFER_LME);
-#endif
 
     load_shadow_control(v);
     load_shadow_guest_state(v);
 
-#ifdef __x86_64__
     if ( lm_l1 != lm_l2 )
         paging_update_paging_modes(v);
-#endif
 
     regs->eip = __get_vvmcs(vvmcs, GUEST_RIP);
     regs->esp = __get_vvmcs(vvmcs, GUEST_RSP);
@@ -954,9 +940,7 @@ static void virtual_vmexit(struct cpu_us
 {
     struct vcpu *v = current;
     struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
-#ifdef __x86_64__
     unsigned long lm_l1, lm_l2;
-#endif
 
     sync_vvmcs_ro(v);
     sync_vvmcs_guest_state(v, regs);
@@ -967,7 +951,6 @@ static void virtual_vmexit(struct cpu_us
     nestedhvm_vcpu_exit_guestmode(v);
     nvcpu->nv_vmexit_pending = 0;
 
-#ifdef __x86_64__
     lm_l2 = !!hvm_long_mode_enabled(v);
     lm_l1 = !!(__get_vvmcs(nvcpu->nv_vvmcx, VM_EXIT_CONTROLS) &
                            VM_EXIT_IA32E_MODE);
@@ -976,17 +959,14 @@ static void virtual_vmexit(struct cpu_us
         v->arch.hvm_vcpu.guest_efer |= EFER_LMA | EFER_LME;
     else
         v->arch.hvm_vcpu.guest_efer &= ~(EFER_LMA | EFER_LME);
-#endif
 
     vmx_update_cpu_exec_control(v);
     vmx_update_exception_bitmap(v);
 
     load_vvmcs_host_state(v);
 
-#ifdef __x86_64__
     if ( lm_l1 != lm_l2 )
         paging_update_paging_modes(v);
-#endif
 
     regs->eip = __get_vvmcs(nvcpu->nv_vvmcx, HOST_RIP);
     regs->esp = __get_vvmcs(nvcpu->nv_vvmcx, HOST_RSP);
@@ -1341,9 +1321,7 @@ int nvmx_msr_read_intercept(unsigned int
         /* bit 0-8, 10,11,13,14,16,17 must be 1 (refer G4 of SDM) */
         tmp = 0x36dff;
         data = VM_EXIT_ACK_INTR_ON_EXIT;
-#ifdef __x86_64__
         data |= VM_EXIT_IA32E_MODE;
-#endif
 	/* 0-settings */
         data = ((data | tmp) << 32) | tmp;
         break;
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/i387.c
--- a/xen/arch/x86/i387.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/i387.c	Wed Sep 12 13:29:30 2012 +0100
@@ -56,12 +56,8 @@ static inline void fpu_fxrstor(struct vc
      * tools, by silently clearing the block.
      */
     asm volatile (
-#ifdef __i386__
-        "1: fxrstor %0            \n"
-#else /* __x86_64__ */
         /* See above for why the operands/constraints are this way. */
         "1: " REX64_PREFIX "fxrstor (%2)\n"
-#endif
         ".section .fixup,\"ax\"   \n"
         "2: push %%"__OP"ax       \n"
         "   push %%"__OP"cx       \n"
@@ -79,9 +75,7 @@ static inline void fpu_fxrstor(struct vc
         : 
         : "m" (*fpu_ctxt),
           "i" (sizeof(v->arch.xsave_area->fpu_sse)/4)
-#ifdef __x86_64__
           ,"cdaSDb" (fpu_ctxt)
-#endif
         );
 }
 
@@ -112,11 +106,6 @@ static inline void fpu_fxsave(struct vcp
 {
     char *fpu_ctxt = v->arch.fpu_ctxt;
 
-#ifdef __i386__
-    asm volatile (
-        "fxsave %0"
-        : "=m" (*fpu_ctxt) );
-#else /* __x86_64__ */
     /*
      * The only way to force fxsaveq on a wide range of gas versions. On 
      * older versions the rex64 prefix works only if we force an
@@ -125,7 +114,6 @@ static inline void fpu_fxsave(struct vcp
     asm volatile (
         REX64_PREFIX "fxsave (%1)"
         : "=m" (*fpu_ctxt) : "cdaSDb" (fpu_ctxt) );
-#endif
     
     /* Clear exception flags if FSW.ES is set. */
     if ( unlikely(fpu_ctxt[2] & 0x80) )
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/machine_kexec.c
--- a/xen/arch/x86/machine_kexec.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/machine_kexec.c	Wed Sep 12 13:29:30 2012 +0100
@@ -16,9 +16,6 @@ typedef void (*relocate_new_kernel_t)(
                 unsigned long indirection_page,
                 unsigned long *page_list,
                 unsigned long start_address,
-#ifdef __i386__
-                unsigned int cpu_has_pae,
-#endif
                 unsigned int preserve_context);
 
 int machine_kexec_load(int type, int slot, xen_kexec_image_t *image)
@@ -113,9 +110,6 @@ void machine_kexec(xen_kexec_image_t *im
         rnk = (relocate_new_kernel_t) image->page_list[1];
         (*rnk)(image->indirection_page, image->page_list,
                image->start_address,
-#ifdef __i386__
-               1 /* cpu_has_pae */,
-#endif
                0 /* preserve_context */);
     }
 }
@@ -132,15 +126,7 @@ void arch_crash_save_vmcoreinfo(void)
 	VMCOREINFO_SYMBOL(dom_xen);
 	VMCOREINFO_SYMBOL(dom_io);
 
-#ifdef CONFIG_X86_32
-    VMCOREINFO_SYMBOL(xenheap_phys_end);
-#endif
-#ifdef CONFIG_X86_PAE
-	VMCOREINFO_SYMBOL_ALIAS(pgd_l3, idle_pg_table);
-#endif
-#ifdef CONFIG_X86_64
 	VMCOREINFO_SYMBOL_ALIAS(pgd_l4, idle_pg_table);
-#endif
 }
 
 /*
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/mm.c	Wed Sep 12 13:29:30 2012 +0100
@@ -130,9 +130,8 @@ l1_pgentry_t __attribute__ ((__section__
 /*
  * PTE updates can be done with ordinary writes except:
  *  1. Debug builds get extra checking by using CMPXCHG[8B].
- *  2. PAE builds perform an atomic 8-byte store with CMPXCHG8B.
  */
-#if !defined(NDEBUG) || defined(__i386__)
+#if !defined(NDEBUG)
 #define PTE_UPDATE_WITH_CMPXCHG
 #endif
 
@@ -156,17 +155,12 @@ bool_t __read_mostly machine_to_phys_map
 bool_t __read_mostly opt_allow_superpage;
 boolean_param("allowsuperpage", opt_allow_superpage);
 
-#ifdef __i386__
-static int get_superpage(unsigned long mfn, struct domain *d);
-#endif
 static void put_superpage(unsigned long mfn);
 
 static uint32_t base_disallow_mask;
 #define L1_DISALLOW_MASK (base_disallow_mask | _PAGE_GNTTAB)
 #define L2_DISALLOW_MASK (base_disallow_mask & ~_PAGE_PSE)
 
-#if defined(__x86_64__)
-
 #define l3_disallow_mask(d) (!is_pv_32on64_domain(d) ?  \
                              base_disallow_mask :       \
                              0xFFFFF198U)
@@ -179,12 +173,6 @@ static uint32_t base_disallow_mask;
 #define L1_DISALLOW_MASK ((base_disallow_mask | _PAGE_GNTTAB) & ~_PAGE_GLOBAL)
 #endif
 
-#elif defined (__i386__)
-
-#define l3_disallow_mask(d) 0xFFFFF1FEU /* must-be-zero */
-
-#endif
-
 #define l1_disallow_mask(d)                                     \
     ((d != dom_io) &&                                           \
      (rangeset_is_empty((d)->iomem_caps) &&                     \
@@ -193,7 +181,6 @@ static uint32_t base_disallow_mask;
       !is_hvm_domain(d)) ?                                      \
      L1_DISALLOW_MASK : (L1_DISALLOW_MASK & ~PAGE_CACHE_ATTRS))
 
-#ifdef __x86_64__
 static void __init init_spagetable(void)
 {
     unsigned long s, start = SPAGETABLE_VIRT_START;
@@ -215,7 +202,6 @@ static void __init init_spagetable(void)
     }
     memset((void *)start, 0, end - start);
 }
-#endif
 
 static void __init init_frametable_chunk(void *start, void *end)
 {
@@ -253,9 +239,7 @@ void __init init_frametable(void)
     unsigned int sidx, eidx, nidx;
     unsigned int max_idx = (max_pdx + PDX_GROUP_COUNT - 1) / PDX_GROUP_COUNT;
 
-#ifdef __x86_64__
     BUILD_BUG_ON(XEN_VIRT_END > FRAMETABLE_VIRT_END);
-#endif
     BUILD_BUG_ON(FRAMETABLE_VIRT_START & ((1UL << L2_PAGETABLE_SHIFT) - 1));
 
     for ( sidx = 0; ; sidx = nidx )
@@ -278,10 +262,8 @@ void __init init_frametable(void)
                (unsigned long)pdx_to_page(max_idx * PDX_GROUP_COUNT) -
                (unsigned long)pdx_to_page(max_pdx));
     }
-#ifdef __x86_64__
     if (opt_allow_superpage)
         init_spagetable();
-#endif
 }
 
 void __init arch_init_memory(void)
@@ -356,12 +338,7 @@ void __init arch_init_memory(void)
          * the statically-initialised 1-16MB mapping area.
          */
         iostart_pfn = max_t(unsigned long, pfn, 1UL << (20 - PAGE_SHIFT));
-#if defined(CONFIG_X86_32)
-        ioend_pfn = min_t(unsigned long, rstart_pfn,
-                          DIRECTMAP_MBYTES << (20 - PAGE_SHIFT));
-#else
         ioend_pfn = min(rstart_pfn, 16UL << (20 - PAGE_SHIFT));
-#endif
         if ( iostart_pfn < ioend_pfn )            
             destroy_xen_mappings((unsigned long)mfn_to_virt(iostart_pfn),
                                  (unsigned long)mfn_to_virt(ioend_pfn));
@@ -470,91 +447,11 @@ void share_xen_page_with_privileged_gues
     share_xen_page_with_guest(page, dom_xen, readonly);
 }
 
-#if defined(__i386__)
-
-#ifdef NDEBUG
-/* Only PDPTs above 4GB boundary need to be shadowed in low memory. */
-#define l3tab_needs_shadow(mfn) ((mfn) >= 0x100000)
-#else
-/*
- * In debug builds we shadow a selection of <4GB PDPTs to exercise code paths.
- * We cannot safely shadow the idle page table, nor shadow page tables
- * (detected by zero reference count). As required for correctness, we
- * always shadow PDPTs above 4GB.
- */
-#define l3tab_needs_shadow(mfn)                          \
-    (((((mfn) << PAGE_SHIFT) != __pa(idle_pg_table)) &&  \
-      (mfn_to_page(mfn)->count_info & PGC_count_mask) && \
-      ((mfn) & 1)) || /* odd MFNs are shadowed */        \
-     ((mfn) >= 0x100000))
-#endif
-
-static l1_pgentry_t *fix_pae_highmem_pl1e;
-
-/* Cache the address of PAE high-memory fixmap page tables. */
-static int __init cache_pae_fixmap_address(void)
-{
-    unsigned long fixmap_base = fix_to_virt(FIX_PAE_HIGHMEM_0);
-    l2_pgentry_t *pl2e = virt_to_xen_l2e(fixmap_base);
-    fix_pae_highmem_pl1e = l2e_to_l1e(*pl2e) + l1_table_offset(fixmap_base);
-    return 0;
-}
-__initcall(cache_pae_fixmap_address);
-
-static DEFINE_PER_CPU(u32, make_cr3_timestamp);
-
-void make_cr3(struct vcpu *v, unsigned long mfn)
-/* Takes the MFN of a PAE l3 table, copies the contents to below 4GB if
- * necessary, and sets v->arch.cr3 to the value to load in CR3. */
-{
-    l3_pgentry_t *highmem_l3tab, *lowmem_l3tab;
-    struct pae_l3_cache *cache = &v->arch.pae_l3_cache;
-    unsigned int cpu = smp_processor_id();
-
-    /* Fast path: does this mfn need a shadow at all? */
-    if ( !l3tab_needs_shadow(mfn) )
-    {
-        v->arch.cr3 = mfn << PAGE_SHIFT;
-        /* Cache is no longer in use or valid */
-        cache->high_mfn = 0;
-        return;
-    }
-
-    /* Caching logic is not interrupt safe. */
-    ASSERT(!in_irq());
-
-    /* Protects against pae_flush_pgd(). */
-    spin_lock(&cache->lock);
-
-    cache->inuse_idx ^= 1;
-    cache->high_mfn   = mfn;
-
-    /* Map the guest L3 table and copy to the chosen low-memory cache. */
-    l1e_write(fix_pae_highmem_pl1e-cpu, l1e_from_pfn(mfn, __PAGE_HYPERVISOR));
-    /* First check the previous high mapping can't be in the TLB. 
-     * (i.e. have we loaded CR3 since we last did this?) */
-    if ( unlikely(this_cpu(make_cr3_timestamp) == this_cpu(tlbflush_time)) )
-        flush_tlb_one_local(fix_to_virt(FIX_PAE_HIGHMEM_0 + cpu));
-    highmem_l3tab = (l3_pgentry_t *)fix_to_virt(FIX_PAE_HIGHMEM_0 + cpu);
-    lowmem_l3tab  = cache->table[cache->inuse_idx];
-    memcpy(lowmem_l3tab, highmem_l3tab, sizeof(cache->table[0]));
-    l1e_write(fix_pae_highmem_pl1e-cpu, l1e_empty());
-    this_cpu(make_cr3_timestamp) = this_cpu(tlbflush_time);
-
-    v->arch.cr3 = __pa(lowmem_l3tab);
-
-    spin_unlock(&cache->lock);
-}
-
-#else /* !defined(__i386__) */
-
 void make_cr3(struct vcpu *v, unsigned long mfn)
 {
     v->arch.cr3 = mfn << PAGE_SHIFT;
 }
 
-#endif /* !defined(__i386__) */
-
 void write_ptbase(struct vcpu *v)
 {
     write_cr3(v->arch.cr3);
@@ -721,7 +618,6 @@ static int get_page_and_type_from_pagenr
     return rc;
 }
 
-#ifdef __x86_64__
 static void put_data_page(
     struct page_info *page, int writeable)
 {
@@ -730,7 +626,6 @@ static void put_data_page(
     else
         put_page(page);
 }
-#endif
 
 /*
  * We allow root tables to map each other (a.k.a. linear page tables). It
@@ -805,7 +700,6 @@ int is_iomem_page(unsigned long mfn)
 static int update_xen_mappings(unsigned long mfn, unsigned long cacheattr)
 {
     int err = 0;
-#ifdef __x86_64__
     bool_t alias = mfn >= PFN_DOWN(xen_phys_start) &&
          mfn < PFN_UP(xen_phys_start + xen_virt_end - XEN_VIRT_START);
     unsigned long xen_va =
@@ -818,7 +712,6 @@ static int update_xen_mappings(unsigned 
                      PAGE_HYPERVISOR | cacheattr_to_pte_flags(cacheattr));
     if ( unlikely(alias) && !cacheattr && !err )
         err = map_pages_to_xen(xen_va, mfn, 1, PAGE_HYPERVISOR);
-#endif
     return err;
 }
 
@@ -1058,8 +951,6 @@ get_page_from_l4e(
 }
 #endif /* 4 level */
 
-#ifdef __x86_64__
-
 #ifdef USER_MAPPINGS_ARE_GLOBAL
 #define adjust_guest_l1e(pl1e, d)                                            \
     do {                                                                     \
@@ -1108,24 +999,12 @@ get_page_from_l4e(
             l4e_add_flags((pl4e), _PAGE_USER);                  \
     } while ( 0 )
 
-#else /* !defined(__x86_64__) */
-
-#define adjust_guest_l1e(_p, _d) ((void)(_d))
-#define adjust_guest_l2e(_p, _d) ((void)(_d))
-#define adjust_guest_l3e(_p, _d) ((void)(_d))
-
-#endif
-
-#ifdef __x86_64__
 #define unadjust_guest_l3e(pl3e, d)                                         \
     do {                                                                    \
         if ( unlikely(is_pv_32on64_domain(d)) &&                            \
              likely(l3e_get_flags((pl3e)) & _PAGE_PRESENT) )                \
             l3e_remove_flags((pl3e), _PAGE_USER|_PAGE_RW|_PAGE_ACCESSED);   \
     } while ( 0 )
-#else
-#define unadjust_guest_l3e(_p, _d) ((void)(_d))
-#endif
 
 void put_page_from_l1e(l1_pgentry_t l1e, struct domain *l1e_owner)
 {
@@ -1209,7 +1088,6 @@ static int put_page_from_l3e(l3_pgentry_
     if ( !(l3e_get_flags(l3e) & _PAGE_PRESENT) || (l3e_get_pfn(l3e) == pfn) )
         return 1;
 
-#ifdef __x86_64__
     if ( unlikely(l3e_get_flags(l3e) & _PAGE_PSE) )
     {
         unsigned long mfn = l3e_get_pfn(l3e);
@@ -1222,7 +1100,6 @@ static int put_page_from_l3e(l3_pgentry_
 
         return 0;
     }
-#endif
 
     if ( unlikely(partial > 0) )
         return __put_page_type(l3e_get_page(l3e), preemptible);
@@ -1289,10 +1166,6 @@ static int create_pae_xen_mappings(struc
 {
     struct page_info *page;
     l3_pgentry_t     l3e3;
-#ifdef __i386__
-    l2_pgentry_t     *pl2e, l2e;
-    int              i;
-#endif
 
     if ( !is_pv_32bit_domain(d) )
         return 1;
@@ -1326,76 +1199,9 @@ static int create_pae_xen_mappings(struc
         return 0;
     }
 
-#ifdef __i386__
-    /* Xen linear pagetable mappings. */
-    pl2e = map_domain_page(l3e_get_pfn(l3e3));
-    for ( i = 0; i < (LINEARPT_MBYTES >> (L2_PAGETABLE_SHIFT - 20)); i++ )
-    {
-        l2e = l2e_empty();
-        if ( l3e_get_flags(pl3e[i]) & _PAGE_PRESENT )
-            l2e = l2e_from_pfn(l3e_get_pfn(pl3e[i]), __PAGE_HYPERVISOR);
-        l2e_write(&pl2e[l2_table_offset(LINEAR_PT_VIRT_START) + i], l2e);
-    }
-    unmap_domain_page(pl2e);
-#endif
-
     return 1;
 }
 
-#ifdef __i386__
-/* Flush a pgdir update into low-memory caches. */
-static void pae_flush_pgd(
-    unsigned long mfn, unsigned int idx, l3_pgentry_t nl3e)
-{
-    struct domain *d = page_get_owner(mfn_to_page(mfn));
-    struct vcpu   *v;
-    intpte_t       _ol3e, _nl3e, _pl3e;
-    l3_pgentry_t  *l3tab_ptr;
-    struct pae_l3_cache *cache;
-
-    if ( unlikely(shadow_mode_enabled(d)) )
-    {
-        cpumask_t m;
-
-        /* Re-shadow this l3 table on any vcpus that are using it */
-        cpumask_clear(&m);
-        for_each_vcpu ( d, v )
-            if ( pagetable_get_pfn(v->arch.guest_table) == mfn )
-            {
-                paging_update_cr3(v);
-                cpumask_or(&m, &m, v->vcpu_dirty_cpumask);
-            }
-        flush_tlb_mask(&m);
-    }
-
-    /* If below 4GB then the pgdir is not shadowed in low memory. */
-    if ( !l3tab_needs_shadow(mfn) )
-        return;
-
-    for_each_vcpu ( d, v )
-    {
-        cache = &v->arch.pae_l3_cache;
-
-        spin_lock(&cache->lock);
-
-        if ( cache->high_mfn == mfn )
-        {
-            l3tab_ptr = &cache->table[cache->inuse_idx][idx];
-            _ol3e = l3e_get_intpte(*l3tab_ptr);
-            _nl3e = l3e_get_intpte(nl3e);
-            _pl3e = cmpxchg(&l3e_get_intpte(*l3tab_ptr), _ol3e, _nl3e);
-            BUG_ON(_pl3e != _ol3e);
-        }
-
-        spin_unlock(&cache->lock);
-    }
-
-    flush_tlb_mask(d->domain_dirty_cpumask);
-}
-#else
-# define pae_flush_pgd(mfn, idx, nl3e) ((void)0)
-#endif
-
 static int alloc_l2_table(struct page_info *page, unsigned long type,
                           int preemptible)
 {
@@ -1435,22 +1241,10 @@ static int alloc_l2_table(struct page_in
     if ( rc >= 0 && (type & PGT_pae_xen_l2) )
     {
         /* Xen private mappings. */
-#if defined(__i386__)
-        memcpy(&pl2e[L2_PAGETABLE_FIRST_XEN_SLOT & (L2_PAGETABLE_ENTRIES-1)],
-               &idle_pg_table_l2[L2_PAGETABLE_FIRST_XEN_SLOT],
-               L2_PAGETABLE_XEN_SLOTS * sizeof(l2_pgentry_t));
-        for ( i = 0; i < PDPT_L2_ENTRIES; i++ )
-            l2e_write(&pl2e[l2_table_offset(PERDOMAIN_VIRT_START) + i],
-                      l2e_from_page(perdomain_pt_page(d, i),
-                                    __PAGE_HYPERVISOR));
-        pl2e[l2_table_offset(LINEAR_PT_VIRT_START)] =
-            l2e_from_pfn(pfn, __PAGE_HYPERVISOR);
-#else
         memcpy(&pl2e[COMPAT_L2_PAGETABLE_FIRST_XEN_SLOT(d)],
                &compat_idle_pg_table_l2[
                    l2_table_offset(HIRO_COMPAT_MPT_VIRT_START)],
                COMPAT_L2_PAGETABLE_XEN_SLOTS(d) * sizeof(*pl2e));
-#endif
     }
 
     unmap_domain_page(pl2e);
@@ -1626,9 +1420,7 @@ static void free_l1_table(struct page_in
 
 static int free_l2_table(struct page_info *page, int preemptible)
 {
-#ifdef __x86_64__
     struct domain *d = page_get_owner(page);
-#endif
     unsigned long pfn = page_to_mfn(page);
     l2_pgentry_t *pl2e;
     unsigned int  i = page->nr_validated_ptes - 1;
@@ -2024,13 +1816,9 @@ static int mod_l3_entry(l3_pgentry_t *pl
     }
 
     if ( likely(rc == 0) )
-    {
         if ( !create_pae_xen_mappings(d, pl3e) )
             BUG();
 
-        pae_flush_pgd(pfn, pgentry_ptr_to_slot(pl3e), nl3e);
-    }
-
     put_page_from_l3e(ol3e, pfn, 0, 0);
     return rc;
 }
@@ -2612,8 +2400,6 @@ static void put_spage_pages(struct page_
     return;
 }
 
-#ifdef __x86_64__
-
 static int mark_superpage(struct spage_info *spage, struct domain *d)
 {
     unsigned long x, nx, y = spage->type_info;
@@ -2774,25 +2560,6 @@ static void put_superpage(unsigned long 
     return;
 }
 
-#else /* __i386__ */
-
-void clear_superpage_mark(struct page_info *page)
-{
-}
-
-static int get_superpage(unsigned long mfn, struct domain *d)
-{
-    return get_spage_pages(mfn_to_page(mfn), d);
-}
-
-static void put_superpage(unsigned long mfn)
-{
-    put_spage_pages(mfn_to_page(mfn));
-}
-
-#endif
-
-
 int new_guest_cr3(unsigned long mfn)
 {
     struct vcpu *curr = current;
@@ -2800,7 +2567,6 @@ int new_guest_cr3(unsigned long mfn)
     int okay;
     unsigned long old_base_mfn;
 
-#ifdef __x86_64__
     if ( is_pv_32on64_domain(d) )
     {
         okay = paging_mode_refcounts(d)
@@ -2822,7 +2588,7 @@ int new_guest_cr3(unsigned long mfn)
 
         return 1;
     }
-#endif
+
     okay = paging_mode_refcounts(d)
         ? get_page_from_pagenr(mfn, d)
         : !get_page_and_type_from_pagenr(mfn, PGT_root_page_table, d, 0, 0);
@@ -2948,28 +2714,8 @@ static inline int vcpumask_to_pcpumask(
     }
 }
 
-#ifdef __i386__
-static inline void *fixmap_domain_page(unsigned long mfn)
-{
-    unsigned int cpu = smp_processor_id();
-    void *ptr = (void *)fix_to_virt(FIX_PAE_HIGHMEM_0 + cpu);
-
-    l1e_write(fix_pae_highmem_pl1e - cpu,
-              l1e_from_pfn(mfn, __PAGE_HYPERVISOR));
-    flush_tlb_one_local(ptr);
-    return ptr;
-}
-static inline void fixunmap_domain_page(const void *ptr)
-{
-    unsigned int cpu = virt_to_fix((unsigned long)ptr) - FIX_PAE_HIGHMEM_0;
-
-    l1e_write(fix_pae_highmem_pl1e - cpu, l1e_empty());
-    this_cpu(make_cr3_timestamp) = this_cpu(tlbflush_time);
-}
-#else
 #define fixmap_domain_page(mfn) mfn_to_virt(mfn)
 #define fixunmap_domain_page(ptr) ((void)(ptr))
-#endif
 
 long do_mmuext_op(
     XEN_GUEST_HANDLE(mmuext_op_t) uops,
@@ -3141,8 +2887,6 @@ long do_mmuext_op(
                     && new_guest_cr3(op.arg1.mfn));
             break;
 
-        
-#ifdef __x86_64__
         case MMUEXT_NEW_USER_BASEPTR: {
             unsigned long old_mfn;
 
@@ -3179,7 +2923,6 @@ long do_mmuext_op(
 
             break;
         }
-#endif
         
         case MMUEXT_TLB_FLUSH_LOCAL:
             flush_tlb_local();
@@ -3345,7 +3088,6 @@ long do_mmuext_op(
             break;
         }
 
-#ifdef __x86_64__
         case MMUEXT_MARK_SUPER:
         {
             unsigned long mfn;
@@ -3397,7 +3139,6 @@ long do_mmuext_op(
             okay = (unmark_superpage(spage) >= 0);
             break;
         }
-#endif
 
         default:
             MEM_LOG("Invalid extended pt command 0x%x", op.cmd);
@@ -5195,7 +4936,6 @@ int ptwr_do_page_fault(struct vcpu *v, u
     return 0;
 }
 
-#ifdef __x86_64__
 /*************************
  * fault handling for read-only MMIO pages
  */
@@ -5284,7 +5024,6 @@ int mmio_ro_do_page_fault(struct vcpu *v
 
     return rc != X86EMUL_UNHANDLEABLE ? EXCRET_fault_fixed : 0;
 }
-#endif /* __x86_64__ */
 
 void free_xen_pagetable(void *v)
 {
@@ -5325,7 +5064,6 @@ int map_pages_to_xen(
 
     while ( nr_mfns != 0 )
     {
-#ifdef __x86_64__
         l3_pgentry_t ol3e, *pl3e = virt_to_xen_l3e(virt);
 
         if ( !pl3e )
@@ -5447,7 +5185,6 @@ int map_pages_to_xen(
                                                 __PAGE_HYPERVISOR));
             flush_area(virt, flush_flags);
         }
-#endif
 
         pl2e = virt_to_xen_l2e(virt);
         if ( !pl2e )
@@ -5588,8 +5325,7 @@ int map_pages_to_xen(
             }
         }
 
- check_l3: ;
-#ifdef __x86_64__
+ check_l3:
         if ( cpu_has_page1gb &&
              (flags == PAGE_HYPERVISOR) &&
              ((nr_mfns == 0) ||
@@ -5617,7 +5353,6 @@ int map_pages_to_xen(
                 free_xen_pagetable(l3e_to_l2e(ol3e));
             }
         }
-#endif
     }
 
     return 0;
@@ -5635,7 +5370,6 @@ void destroy_xen_mappings(unsigned long 
 
     while ( v < e )
     {
-#ifdef __x86_64__
         l3_pgentry_t *pl3e = virt_to_xen_l3e(v);
 
         if ( !(l3e_get_flags(*pl3e) & _PAGE_PRESENT) )
@@ -5667,7 +5401,6 @@ void destroy_xen_mappings(unsigned long 
             l3e_write_atomic(pl3e, l3e_from_pfn(virt_to_mfn(pl2e),
                                                 __PAGE_HYPERVISOR));
         }
-#endif
 
         pl2e = virt_to_xen_l2e(v);
 
@@ -5722,7 +5455,6 @@ void destroy_xen_mappings(unsigned long 
             }
         }
 
-#ifdef __x86_64__
         /* If we are done with the L3E, check if it is now empty. */
         if ( (v != e) && (l2_table_offset(v) + l1_table_offset(v) != 0) )
             continue;
@@ -5737,7 +5469,6 @@ void destroy_xen_mappings(unsigned long 
             flush_area(NULL, FLUSH_TLB_GLOBAL); /* flush before free */
             free_xen_pagetable(pl2e);
         }
-#endif
     }
 
     flush_area(NULL, FLUSH_TLB_GLOBAL);
@@ -5755,13 +5486,6 @@ void __set_fixmap(
 void memguard_init(void)
 {
     unsigned long start = max_t(unsigned long, xen_phys_start, 1UL << 20);
-#ifdef __i386__
-    map_pages_to_xen(
-        (unsigned long)__va(start),
-        start >> PAGE_SHIFT,
-        (xenheap_phys_end - start) >> PAGE_SHIFT,
-        __PAGE_HYPERVISOR|MAP_SMALL_PAGES);
-#else
     map_pages_to_xen(
         (unsigned long)__va(start),
         start >> PAGE_SHIFT,
@@ -5773,7 +5497,6 @@ void memguard_init(void)
         start >> PAGE_SHIFT,
         (__pa(&_end) + PAGE_SIZE - 1 - start) >> PAGE_SHIFT,
         __PAGE_HYPERVISOR|MAP_SMALL_PAGES);
-#endif
 }
 
 static void __memguard_change_range(void *p, unsigned long l, int guard)
@@ -5820,18 +5543,12 @@ void memguard_unguard_stack(void *p)
     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:
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/mm/p2m-pt.c
--- a/xen/arch/x86/mm/p2m-pt.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/mm/p2m-pt.c	Wed Sep 12 13:29:30 2012 +0100
@@ -63,21 +63,12 @@
 static unsigned long p2m_type_to_flags(p2m_type_t t, mfn_t mfn)
 {
     unsigned long flags;
-#ifdef __x86_64__
     /*
      * AMD IOMMU: When we share p2m table with iommu, bit 9 - bit 11 will be
      * used for iommu hardware to encode next io page level. Bit 59 - bit 62
      * are used for iommu flags, We could not use these bits to store p2m types.
      */
     flags = (unsigned long)(t & 0x7f) << 12;
-#else
-    flags = (t & 0x7UL) << 9;
-#endif
-
-#ifndef __x86_64__
-    /* 32-bit builds don't support a lot of the p2m types */
-    BUG_ON(t > p2m_populate_on_demand);
-#endif
 
     switch(t)
     {
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/mm/p2m.c	Wed Sep 12 13:29:30 2012 +0100
@@ -170,7 +170,6 @@ mfn_t __get_gfn_type_access(struct p2m_d
 
     mfn = p2m->get_entry(p2m, gfn, t, a, q, page_order);
 
-#ifdef __x86_64__
     if ( (q & P2M_UNSHARE) && p2m_is_shared(*t) )
     {
         ASSERT(!p2m_is_nestedp2m(p2m));
@@ -180,9 +179,7 @@ mfn_t __get_gfn_type_access(struct p2m_d
             (void)mem_sharing_notify_enomem(p2m->domain, gfn, 0);
         mfn = p2m->get_entry(p2m, gfn, t, a, q, page_order);
     }
-#endif
 
-#ifdef __x86_64__
     if (unlikely((p2m_is_broken(*t))))
     {
         /* Return invalid_mfn to avoid caller's access */
@@ -190,7 +187,6 @@ mfn_t __get_gfn_type_access(struct p2m_d
         if ( q & P2M_ALLOC )
             domain_crash(p2m->domain);
     }
-#endif
 
     return mfn;
 }
@@ -412,18 +408,15 @@ void p2m_teardown(struct p2m_domain *p2m
 {
     struct page_info *pg;
     struct domain *d = p2m->domain;
-#ifdef __x86_64__
     unsigned long gfn;
     p2m_type_t t;
     mfn_t mfn;
-#endif
 
     if (p2m == NULL)
         return;
 
     p2m_lock(p2m);
 
-#ifdef __x86_64__
     /* Try to unshare any remaining shared p2m entries. Safeguard
      * Since relinquish_shared_pages should have done the work. */ 
     for ( gfn=0; gfn < p2m->max_mapped_pfn; gfn++ )
@@ -439,7 +432,6 @@ void p2m_teardown(struct p2m_domain *p2m
             BUG_ON(mem_sharing_unshare_page(d, gfn, MEM_SHARING_DESTROY_GFN));
         }
     }
-#endif
 
     p2m->phys_table = pagetable_null();
 
@@ -565,7 +557,6 @@ guest_physmap_add_entry(struct domain *d
     for ( i = 0; i < (1UL << page_order); i++ )
     {
         omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, 0, NULL);
-#ifdef __x86_64__
         if ( p2m_is_shared(ot) )
         {
             /* Do an unshare to cleanly take care of all corner 
@@ -592,7 +583,6 @@ guest_physmap_add_entry(struct domain *d
             omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, 0, NULL);
             ASSERT(!p2m_is_shared(ot));
         }
-#endif /* __x86_64__ */
         if ( p2m_is_grant(ot) )
         {
             /* Really shouldn't be unmapping grant maps this way */
@@ -840,7 +830,6 @@ set_shared_p2m_entry(struct domain *d, u
     return rc;
 }
 
-#ifdef __x86_64__
 /**
  * p2m_mem_paging_nominate - Mark a guest page as to-be-paged-out
  * @d: guest domain
@@ -1430,9 +1419,6 @@ int p2m_get_mem_access(struct domain *d,
     return 0;
 }
 
-
-#endif /* __x86_64__ */
-
 static struct p2m_domain *
 p2m_getlru_nestedp2m(struct domain *d, struct p2m_domain *p2m)
 {
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/mm/shadow/Makefile
--- a/xen/arch/x86/mm/shadow/Makefile	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/mm/shadow/Makefile	Wed Sep 12 13:29:30 2012 +0100
@@ -1,4 +1,3 @@
-obj-$(x86_32) += common.o guest_2.o guest_3.o
 obj-$(x86_64) += common.o guest_2.o guest_3.o guest_4.o
 
 guest_%.o: multi.c Makefile
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/mm/shadow/common.c
--- a/xen/arch/x86/mm/shadow/common.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/mm/shadow/common.c	Wed Sep 12 13:29:30 2012 +0100
@@ -276,12 +276,6 @@ hvm_emulate_cmpxchg(enum x86_segment seg
         return v->arch.paging.mode->shadow.x86_emulate_cmpxchg(
             v, addr, old[0], new[0], bytes, sh_ctxt);
 
-#ifdef __i386__
-    if ( bytes == 8 )
-        return v->arch.paging.mode->shadow.x86_emulate_cmpxchg8b(
-            v, addr, old[0], old[1], new[0], new[1], sh_ctxt);
-#endif
-
     return X86EMUL_UNHANDLEABLE;
 }
 
@@ -353,12 +347,6 @@ pv_emulate_cmpxchg(enum x86_segment seg,
         return v->arch.paging.mode->shadow.x86_emulate_cmpxchg(
             v, offset, old[0], new[0], bytes, sh_ctxt);
 
-#ifdef __i386__
-    if ( bytes == 8 )
-        return v->arch.paging.mode->shadow.x86_emulate_cmpxchg8b(
-            v, offset, old[0], old[1], new[0], new[1], sh_ctxt);
-#endif
-
     return X86EMUL_UNHANDLEABLE;
 }
 
@@ -2879,29 +2867,23 @@ static void sh_update_paging_modes(struc
             v->arch.guest_table = d->arch.paging.shadow.unpaged_pagetable;
             v->arch.paging.mode = &SHADOW_INTERNAL_NAME(sh_paging_mode, 2);
         }
+        else if ( hvm_long_mode_enabled(v) )
+        {
+            // long mode guest...
+            v->arch.paging.mode =
+                &SHADOW_INTERNAL_NAME(sh_paging_mode, 4);
+        }
+        else if ( hvm_pae_enabled(v) )
+        {
+            // 32-bit PAE mode guest...
+            v->arch.paging.mode =
+                &SHADOW_INTERNAL_NAME(sh_paging_mode, 3);
+        }
         else
         {
-#ifdef __x86_64__
-            if ( hvm_long_mode_enabled(v) )
-            {
-                // long mode guest...
-                v->arch.paging.mode =
-                    &SHADOW_INTERNAL_NAME(sh_paging_mode, 4);
-            }
-            else
-#endif
-                if ( hvm_pae_enabled(v) )
-                {
-                    // 32-bit PAE mode guest...
-                    v->arch.paging.mode =
-                        &SHADOW_INTERNAL_NAME(sh_paging_mode, 3);
-                }
-                else
-                {
-                    // 32-bit 2 level guest...
-                    v->arch.paging.mode =
-                        &SHADOW_INTERNAL_NAME(sh_paging_mode, 2);
-                }
+            // 32-bit 2 level guest...
+            v->arch.paging.mode =
+                &SHADOW_INTERNAL_NAME(sh_paging_mode, 2);
         }
 
         if ( pagetable_is_null(v->arch.monitor_table) )
@@ -3664,11 +3646,6 @@ int shadow_track_dirty_vram(struct domai
     }
     else
     {
-#ifdef __i386__
-        unsigned long map_mfn = INVALID_MFN;
-        void *map_sl1p = NULL;
-#endif
-
         /* Iterate over VRAM to track dirty bits. */
         for ( i = 0; i < nr; i++ ) {
             mfn_t mfn = get_gfn_query_unlocked(d, begin_pfn + i, &t);
@@ -3702,21 +3679,7 @@ int shadow_track_dirty_vram(struct domai
                     {
                         /* Hopefully the most common case: only one mapping,
                          * whose dirty bit we can use. */
-                        l1_pgentry_t *sl1e;
-#ifdef __i386__
-                        void *sl1p = map_sl1p;
-                        unsigned long sl1mfn = paddr_to_pfn(sl1ma);
-
-                        if ( sl1mfn != map_mfn ) {
-                            if ( map_sl1p )
-                                sh_unmap_domain_page(map_sl1p);
-                            map_sl1p = sl1p = sh_map_domain_page(_mfn(sl1mfn));
-                            map_mfn = sl1mfn;
-                        }
-                        sl1e = sl1p + (sl1ma & ~PAGE_MASK);
-#else
-                        sl1e = maddr_to_virt(sl1ma);
-#endif
+                        l1_pgentry_t *sl1e = maddr_to_virt(sl1ma);
 
                         if ( l1e_get_flags(*sl1e) & _PAGE_DIRTY )
                         {
@@ -3743,11 +3706,6 @@ int shadow_track_dirty_vram(struct domai
             }
         }
 
-#ifdef __i386__
-        if ( map_sl1p )
-            sh_unmap_domain_page(map_sl1p);
-#endif
-
         rc = -EFAULT;
         if ( copy_to_guest(dirty_bitmap, dirty_vram->dirty_bitmap, dirty_size) == 0 ) {
             memset(dirty_vram->dirty_bitmap, 0, dirty_size);
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/mm/shadow/multi.c
--- a/xen/arch/x86/mm/shadow/multi.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/mm/shadow/multi.c	Wed Sep 12 13:29:30 2012 +0100
@@ -5096,41 +5096,6 @@ sh_x86_emulate_cmpxchg(struct vcpu *v, u
     return rv;
 }
 
-#ifdef __i386__
-static int
-sh_x86_emulate_cmpxchg8b(struct vcpu *v, unsigned long vaddr, 
-                          unsigned long old_lo, unsigned long old_hi,
-                          unsigned long new_lo, unsigned long new_hi,
-                          struct sh_emulate_ctxt *sh_ctxt)
-{
-    void *addr;
-    u64 old, new, prev;
-    int rv = X86EMUL_OKAY;
-
-    /* Unaligned writes are only acceptable on HVM */
-    if ( (vaddr & 7) && !is_hvm_vcpu(v) )
-        return X86EMUL_UNHANDLEABLE;
-
-    addr = emulate_map_dest(v, vaddr, 8, sh_ctxt);
-    if ( emulate_map_dest_failed(addr) )
-        return (long)addr;
-
-    old = (((u64) old_hi) << 32) | (u64) old_lo;
-    new = (((u64) new_hi) << 32) | (u64) new_lo;
-
-    paging_lock(v->domain);
-    prev = cmpxchg(((u64 *)addr), old, new);
-
-    if ( prev != old )
-        rv = X86EMUL_CMPXCHG_FAILED;
-
-    emulate_unmap_dest(v, addr, 8, sh_ctxt);
-    shadow_audit_tables(v);
-    paging_unlock(v->domain);
-    return rv;
-}
-#endif
-
 /**************************************************************************/
 /* Audit tools */
 
@@ -5455,9 +5420,6 @@ const struct paging_mode sh_paging_mode 
     .shadow.detach_old_tables      = sh_detach_old_tables,
     .shadow.x86_emulate_write      = sh_x86_emulate_write,
     .shadow.x86_emulate_cmpxchg    = sh_x86_emulate_cmpxchg,
-#ifdef __i386__
-    .shadow.x86_emulate_cmpxchg8b  = sh_x86_emulate_cmpxchg8b,
-#endif
     .shadow.make_monitor_table     = sh_make_monitor_table,
     .shadow.destroy_monitor_table  = sh_destroy_monitor_table,
 #if SHADOW_OPTIMIZATIONS & SHOPT_WRITABLE_HEURISTIC
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/numa.c
--- a/xen/arch/x86/numa.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/numa.c	Wed Sep 12 13:29:30 2012 +0100
@@ -96,7 +96,6 @@ static int __init populate_memnodemap(co
 
 static int __init allocate_cachealigned_memnodemap(void)
 {
-#ifndef __i386__
 	unsigned long size = PFN_UP(memnodemapsize * sizeof(*memnodemap));
 	unsigned long mfn = alloc_boot_pages(size, 1);
 
@@ -115,13 +114,6 @@ static int __init allocate_cachealigned_
 	memnodemapsize = size / sizeof(*memnodemap);
 
 	return 0;
-#else
-	printk(KERN_ERR
-	       "Memory to Node hash needs %lu entries, got only %zu\n",
-	       memnodemapsize, ARRAY_SIZE(_memnodemap));
-	memnodemapsize = 0;
-	return -1;
-#endif
 }
 
 /*
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/oprofile/backtrace.c
--- a/xen/arch/x86/oprofile/backtrace.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/oprofile/backtrace.c	Wed Sep 12 13:29:30 2012 +0100
@@ -10,10 +10,10 @@
  *
  */
 
-#include<xen/types.h>
-#include<asm/page.h>
-#include<xen/xenoprof.h>
-#include<xen/guest_access.h>
+#include <xen/types.h>
+#include <asm/page.h>
+#include <xen/xenoprof.h>
+#include <xen/guest_access.h>
 
 struct frame_head {
     struct frame_head * ebp;
@@ -22,14 +22,12 @@ struct frame_head {
 typedef struct frame_head frame_head_t;
 DEFINE_XEN_GUEST_HANDLE(frame_head_t);
 
-#ifdef CONFIG_X86_64
 struct frame_head_32bit {
     uint32_t ebp;
     uint32_t ret;
 } __attribute__((packed));
 typedef struct frame_head_32bit frame_head32_t;
 DEFINE_COMPAT_HANDLE(frame_head32_t);
-#endif
 
 static struct frame_head *
 dump_hypervisor_backtrace(struct vcpu *vcpu, const struct frame_head *head,
@@ -46,7 +44,6 @@ dump_hypervisor_backtrace(struct vcpu *v
     return head->ebp;
 }
 
-#ifdef CONFIG_X86_64
 static inline int is_32bit_vcpu(struct vcpu *vcpu)
 {
     if (is_hvm_vcpu(vcpu))
@@ -54,7 +51,6 @@ static inline int is_32bit_vcpu(struct v
     else
         return is_pv_32bit_vcpu(vcpu);
 }
-#endif
 
 static struct frame_head *
 dump_guest_backtrace(struct vcpu *vcpu, const struct frame_head *head,
@@ -62,7 +58,6 @@ dump_guest_backtrace(struct vcpu *vcpu, 
 {
     frame_head_t bufhead;
 
-#ifdef CONFIG_X86_64
     if ( is_32bit_vcpu(vcpu) )
     {
         __compat_handle_const_frame_head32_t guest_head =
@@ -78,7 +73,6 @@ dump_guest_backtrace(struct vcpu *vcpu, 
         bufhead.ret = bufhead32.ret;
     }
     else
-#endif
     {
         XEN_GUEST_HANDLE(const_frame_head_t) guest_head =
             const_guest_handle_from_ptr(head, frame_head_t);
@@ -136,11 +130,7 @@ static int valid_hypervisor_stack(const 
 				  const struct cpu_user_regs *regs)
 {
     unsigned long headaddr = (unsigned long)head;
-#ifdef CONFIG_X86_64
     unsigned long stack = (unsigned long)regs->rsp;
-#else
-    unsigned long stack = (unsigned long)regs;
-#endif
     unsigned long stack_base = (stack & ~(STACK_SIZE - 1)) + STACK_SIZE;
 
     return headaddr > stack && headaddr < stack_base;
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/oprofile/op_model_athlon.c
--- a/xen/arch/x86/oprofile/op_model_athlon.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/oprofile/op_model_athlon.c	Wed Sep 12 13:29:30 2012 +0100
@@ -53,12 +53,8 @@ static unsigned long reset_value[MAX_COU
 
 extern char svm_stgi_label[];
 
-#ifdef CONFIG_X86_64
 u32 ibs_caps = 0;
 static u64 ibs_op_ctl;
-#else
-#define ibs_op_ctl 0
-#endif
 
 /* IBS cpuid feature detection */
 #define IBS_CPUID_FEATURES              0x8000001b
@@ -352,7 +348,6 @@ static int athlon_check_ctrs(unsigned in
 
 static inline void start_ibs(void)
 {
-#ifdef CONFIG_X86_64
 	u64 val = 0;
 
 	if (!ibs_caps)
@@ -390,7 +385,6 @@ static inline void start_ibs(void)
 		val = op_amd_randomize_ibs_op(ibs_op_ctl);
 		wrmsrl(MSR_AMD64_IBSOPCTL, val);
 	}
-#endif
 }
  
 static void athlon_start(struct op_msrs const * const msrs)
@@ -439,8 +433,6 @@ static void athlon_stop(struct op_msrs c
 	stop_ibs();
 }
 
-#ifdef CONFIG_X86_64
-
 #define IBSCTL_LVTOFFSETVAL             (1 << 8)
 #define APIC_EILVT_MSG_NMI              0x4
 #define APIC_EILVT_LVTOFF_IBS           1
@@ -535,8 +527,6 @@ void __init ibs_init(void)
 		(unsigned)ibs_caps);
 }
 
-#endif /* CONFIG_X86_64 */
-
 struct op_x86_model_spec const op_athlon_spec = {
 	.num_counters = K7_NUM_COUNTERS,
 	.num_controls = K7_NUM_CONTROLS,
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/physdev.c	Wed Sep 12 13:29:30 2012 +0100
@@ -23,9 +23,7 @@ int physdev_map_pirq(domid_t, int type, 
                      struct msi_info *);
 int physdev_unmap_pirq(domid_t, int pirq);
 
-#ifdef CONFIG_X86_64
 #include "x86_64/mmconfig.h"
-#endif
 
 #ifndef COMPAT
 typedef long ret_t;
@@ -609,7 +607,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
         break;
     }
 
-#ifdef __x86_64__
     case PHYSDEVOP_pci_mmcfg_reserved: {
         struct physdev_pci_mmcfg_reserved info;
 
@@ -629,7 +626,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
                                  info.start_bus, info.end_bus, info.flags);
         break;
     }
-#endif
 
     case PHYSDEVOP_restore_msi: {
         struct physdev_restore_msi restore_msi;
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/setup.c	Wed Sep 12 13:29:30 2012 +0100
@@ -86,13 +86,7 @@ cpumask_t __read_mostly cpu_present_map;
 
 unsigned long __read_mostly xen_phys_start;
 
-#ifdef CONFIG_X86_32
-/* Limits of Xen heap, used to initialise the allocator. */
-unsigned long __initdata xenheap_initial_phys_start;
-unsigned long __read_mostly xenheap_phys_end;
-#else
 unsigned long __read_mostly xen_virt_end;
-#endif
 
 DEFINE_PER_CPU(struct tss_struct, init_tss);
 
@@ -174,10 +168,8 @@ static void free_xen_data(char *s, char 
     init_xenheap_pages(__pa(s), __pa(e));
 #endif
     memguard_guard_range(s, e-s);
-#if defined(CONFIG_X86_64)
     /* Also zap the mapping in the 1:1 area. */
     memguard_guard_range(__va(__pa(s)), e-s);
-#endif
 }
 
 extern char __init_begin[], __init_end[], __bss_start[];
@@ -271,10 +263,8 @@ static void *__init bootstrap_map(const 
     uint64_t start, end, mask = (1L << L2_PAGETABLE_SHIFT) - 1;
     void *ret;
 
-#ifdef __x86_64__
     if ( system_state != SYS_STATE_early_boot )
         return mod ? mfn_to_virt(mod->mod_start) : NULL;
-#endif
 
     if ( !mod )
     {
@@ -384,7 +374,6 @@ static uint64_t __init consider_modules(
 
 static void __init setup_max_pdx(void)
 {
-#ifdef __x86_64__
     max_pdx = pfn_to_pdx(max_page - 1) + 1;
 
     if ( max_pdx > (DIRECTMAP_SIZE >> PAGE_SHIFT) )
@@ -394,7 +383,6 @@ static void __init setup_max_pdx(void)
         max_pdx = FRAMETABLE_SIZE / sizeof(*frame_table);
 
     max_page = pdx_to_pfn(max_pdx - 1) + 1;
-#endif
 }
 
 void set_pdx_range(unsigned long smfn, unsigned long emfn)
@@ -680,11 +668,9 @@ void __init __start_xen(unsigned long mb
         destroy_xen_mappings(xen_phys_start,
                              xen_phys_start + BOOTSTRAP_MAP_BASE);
 
-#ifdef CONFIG_X86_64
         /* Make boot page tables match non-EFI boot. */
         l3_bootmap[l3_table_offset(BOOTSTRAP_MAP_BASE)] =
             l3e_from_paddr(__pa(l2_bootmap), __PAGE_HYPERVISOR);
-#endif
 
         memmap_type = loader;
     }
@@ -814,13 +800,10 @@ void __init __start_xen(unsigned long mb
         {
             end = min(e, limit);
             set_pdx_range(s >> PAGE_SHIFT, end >> PAGE_SHIFT);
-#ifdef CONFIG_X86_64
             map_pages_to_xen((unsigned long)__va(s), s >> PAGE_SHIFT,
                              (end - s) >> PAGE_SHIFT, PAGE_HYPERVISOR);
-#endif
         }
 
-#if defined(CONFIG_X86_64)
         e = min_t(uint64_t, e, 1ULL << (PAGE_SHIFT + 32));
 #define reloc_size ((__pa(&_end) + mask) & ~mask)
         /* Is the region suitable for relocating Xen? */
@@ -916,7 +899,6 @@ void __init __start_xen(unsigned long mb
 
             bootstrap_map(NULL);
         }
-#endif
 
         /* Is the region suitable for relocating the multiboot modules? */
         for ( j = mbi->mods_count - 1; j >= 0; j-- )
@@ -943,10 +925,6 @@ void __init __start_xen(unsigned long mb
             }
         }
 
-#ifdef CONFIG_X86_32
-        /* Confine the kexec area to below 4Gb. */
-        e = min_t(uint64_t, e, 1ULL << 32);
-#endif
         /* Don't overlap with modules. */
         e = consider_modules(s, e, PAGE_ALIGN(kexec_crash_area.size),
                              mod, mbi->mods_count, -1);
@@ -966,17 +944,10 @@ void __init __start_xen(unsigned long mb
         reserve_e820_ram(&boot_e820, s, s + PAGE_ALIGN(mod[i].mod_end));
     }
 
-#if defined(CONFIG_X86_32)
-    xenheap_initial_phys_start = (PFN_UP(__pa(&_end)) + 1) << PAGE_SHIFT;
-    /* Must pass a single mapped page for populating bootmem_region_list. */
-    init_boot_pages(__pa(&_end), xenheap_initial_phys_start);
-    xenheap_phys_end = DIRECTMAP_MBYTES << 20;
-#else
     if ( !xen_phys_start )
         EARLY_FAIL("Not enough memory to relocate Xen.\n");
     reserve_e820_ram(&boot_e820, efi_enabled ? mbi->mem_upper : __pa(&_start),
                      __pa(&_end));
-#endif
 
     /* Late kexec reservation (dynamic start address). */
     kexec_reserve_area(&boot_e820);
@@ -990,22 +961,15 @@ void __init __start_xen(unsigned long mb
     for ( i = 0; i < boot_e820.nr_map; i++ )
     {
         uint64_t s, e, mask = PAGE_SIZE - 1;
-#ifdef CONFIG_X86_64
         uint64_t map_s, map_e;
-#endif
 
         /* Only page alignment required now. */
         s = (boot_e820.map[i].addr + mask) & ~mask;
         e = (boot_e820.map[i].addr + boot_e820.map[i].size) & ~mask;
-#if defined(CONFIG_X86_32)
-        s = max_t(uint64_t, s, xenheap_phys_end);
-#else
         s = max_t(uint64_t, s, 1<<20);
-#endif
         if ( (boot_e820.map[i].type != E820_RAM) || (s >= e) )
             continue;
 
-#ifdef __x86_64__
         if ( !acpi_boot_table_init_done &&
              s >= (1ULL << 32) &&
              !acpi_boot_table_init() )
@@ -1042,11 +1006,9 @@ void __init __start_xen(unsigned long mb
                                   " %013"PRIx64"-%013"PRIx64"\n",
                    e, map_e);
         }
-#endif
 
         set_pdx_range(s >> PAGE_SHIFT, e >> PAGE_SHIFT);
 
-#ifdef CONFIG_X86_64
         /* Need to create mappings above BOOTSTRAP_MAP_BASE. */
         map_s = max_t(uint64_t, s, BOOTSTRAP_MAP_BASE);
         map_e = min_t(uint64_t, e,
@@ -1080,29 +1042,22 @@ void __init __start_xen(unsigned long mb
                              (map_s - s) >> PAGE_SHIFT, PAGE_HYPERVISOR);
             init_boot_pages(s, map_s);
         }
-#else
-        init_boot_pages(s, e);
-#endif
     }
 
     for ( i = 0; i < mbi->mods_count; ++i )
     {
         set_pdx_range(mod[i].mod_start,
                       mod[i].mod_start + PFN_UP(mod[i].mod_end));
-#ifdef CONFIG_X86_64
         map_pages_to_xen((unsigned long)mfn_to_virt(mod[i].mod_start),
                          mod[i].mod_start,
                          PFN_UP(mod[i].mod_end), PAGE_HYPERVISOR);
-#endif
     }
-#ifdef CONFIG_X86_64
     map_pages_to_xen((unsigned long)__va(kexec_crash_area.start),
                      kexec_crash_area.start >> PAGE_SHIFT,
                      PFN_UP(kexec_crash_area.size), PAGE_HYPERVISOR);
     xen_virt_end = ((unsigned long)_end + (1UL << L2_PAGETABLE_SHIFT) - 1) &
                    ~((1UL << L2_PAGETABLE_SHIFT) - 1);
     destroy_xen_mappings(xen_virt_end, XEN_VIRT_START + BOOTSTRAP_MAP_BASE);
-#endif
 
     memguard_init();
 
@@ -1151,30 +1106,10 @@ void __init __start_xen(unsigned long mb
 
     numa_initmem_init(0, max_page);
 
-#if defined(CONFIG_X86_32)
-    /* Initialise the Xen heap. */
-    for ( nr_pages = i = 0; i < boot_e820.nr_map; i++ )
-    {
-        uint64_t s = boot_e820.map[i].addr;
-        uint64_t e = s + boot_e820.map[i].size;
-        s = max_t(uint64_t, s, xenheap_initial_phys_start);
-        e = min_t(uint64_t, e, xenheap_phys_end);
-        if ( (boot_e820.map[i].type != E820_RAM) || (s >= e) )
-            continue;
-        init_xenheap_pages(s, e);
-        nr_pages += (e - s) >> PAGE_SHIFT;
-    }
-    printk("Xen heap: %luMB (%lukB)\n", 
-           nr_pages >> (20 - PAGE_SHIFT),
-           nr_pages << (PAGE_SHIFT - 10));
-#endif
-
     end_boot_allocator();
     system_state = SYS_STATE_boot;
 
-#if defined(CONFIG_X86_64)
     vesa_init();
-#endif
 
     softirq_init();
     tasklet_subsys_init();
@@ -1217,10 +1152,8 @@ void __init __start_xen(unsigned long mb
         max_cpus = nr_cpu_ids;
     }
 
-#ifdef CONFIG_X86_64
     /* Low mappings were only needed for some BIOS table parsing. */
     zap_low_mappings();
-#endif
 
     init_apic_mappings();
 
@@ -1268,11 +1201,9 @@ void __init __start_xen(unsigned long mb
 
     pt_pci_init();
 
-#ifdef CONFIG_X86_64
     vesa_mtrr_init();
 
     acpi_mmcfg_init();
-#endif
 
     iommu_setup();    /* setup iommu if available */
 
@@ -1406,10 +1337,8 @@ void arch_get_xen_caps(xen_capabilities_
 
     (*info)[0] = '\0';
 
-#ifdef CONFIG_X86_64
     snprintf(s, sizeof(s), "xen-%d.%d-x86_64 ", major, minor);
     safe_strcat(*info, s);
-#endif
     snprintf(s, sizeof(s), "xen-%d.%d-x86_32p ", major, minor);
     safe_strcat(*info, s);
     if ( hvm_enabled )
@@ -1418,10 +1347,8 @@ void arch_get_xen_caps(xen_capabilities_
         safe_strcat(*info, s);
         snprintf(s, sizeof(s), "hvm-%d.%d-x86_32p ", major, minor);
         safe_strcat(*info, s);
-#ifdef CONFIG_X86_64
         snprintf(s, sizeof(s), "hvm-%d.%d-x86_64 ", major, minor);
         safe_strcat(*info, s);
-#endif
     }
 }
 
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/shutdown.c
--- a/xen/arch/x86/shutdown.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/shutdown.c	Wed Sep 12 13:29:30 2012 +0100
@@ -100,202 +100,6 @@ void machine_halt(void)
     __machine_halt(NULL);
 }
 
-#ifdef __i386__
-
-/* The following code and data reboots the machine by switching to real
-   mode and jumping to the BIOS reset entry point, as if the CPU has
-   really been reset.  The previous version asked the keyboard
-   controller to pulse the CPU reset line, which is more thorough, but
-   doesn't work with at least one type of 486 motherboard.  It is easy
-   to stop this code working; hence the copious comments. */
-
-static unsigned long long
-real_mode_gdt_entries [3] =
-{
-    0x0000000000000000ULL,      /* Null descriptor */
-    0x00009a000000ffffULL,      /* 16-bit real-mode 64k code at 0x00000000 */
-    0x000092000100ffffULL       /* 16-bit real-mode 64k data at 0x00000100 */
-};
-
-static const struct
-{
-    unsigned short       size __attribute__ ((packed));
-    unsigned long long * base __attribute__ ((packed));
-}
-real_mode_gdt = { sizeof (real_mode_gdt_entries) - 1, real_mode_gdt_entries },
-real_mode_idt = { 0x3ff, NULL };
-
-
-/* This is 16-bit protected mode code to disable paging and the cache,
-   switch to real mode and jump to the BIOS reset code.
-
-   The instruction that switches to real mode by writing to CR0 must be
-   followed immediately by a far jump instruction, which set CS to a
-   valid value for real mode, and flushes the prefetch queue to avoid
-   running instructions that have already been decoded in protected
-   mode.
-
-   Clears all the flags except ET, especially PG (paging), PE
-   (protected-mode enable) and TS (task switch for coprocessor state
-   save).  Flushes the TLB after paging has been disabled.  Sets CD and
-   NW, to disable the cache on a 486, and invalidates the cache.  This
-   is more like the state of a 486 after reset.  I don't know if
-   something else should be done for other chips.
-
-   More could be done here to set up the registers as if a CPU reset had
-   occurred; hopefully real BIOSs don't assume much. */
-
-static const unsigned char real_mode_switch [] =
-{
-    0x0f, 0x20, 0xc0,                           /*    movl  %cr0,%eax        */
-    0x66, 0x83, 0xe0, 0x11,                     /*    andl  $0x00000011,%eax */
-    0x66, 0x0d, 0x00, 0x00, 0x00, 0x60,         /*    orl   $0x60000000,%eax */
-    0x0f, 0x22, 0xc0,                           /*    movl  %eax,%cr0        */
-    0x0f, 0x22, 0xd8,                           /*    movl  %eax,%cr3        */
-    0x0f, 0x20, 0xc2,                           /*    movl  %cr0,%edx        */
-    0x66, 0x81, 0xe2, 0x00, 0x00, 0x00, 0x60,   /*    andl  $0x60000000,%edx */
-    0x74, 0x02,                                 /*    jz    f                */
-    0x0f, 0x09,                                 /*    wbinvd                 */
-    0x24, 0x10,                                 /* f: andb  $0x10,al         */
-    0x0f, 0x22, 0xc0                            /*    movl  %eax,%cr0        */
-};
-#define MAX_LENGTH 0x40
-static const unsigned char jump_to_bios [] =
-{
-    0xea, 0xf0, 0xff, 0x00, 0xf0                /*    ljmp  $0xf000,$0xfff0  */
-};
-
-/*
- * Switch to real mode and then execute the code
- * specified by the code and length parameters.
- * We assume that length will aways be less that MAX_LENGTH!
- */
-static void machine_real_restart(const unsigned char *code, unsigned length)
-{
-    local_irq_disable();
-
-    /* Write zero to CMOS register number 0x0f, which the BIOS POST
-       routine will recognize as telling it to do a proper reboot.  (Well
-       that's what this book in front of me says -- it may only apply to
-       the Phoenix BIOS though, it's not clear).  At the same time,
-       disable NMIs by setting the top bit in the CMOS address register,
-       as we're about to do peculiar things to the CPU. */
-
-    spin_lock(&rtc_lock);
-    CMOS_WRITE(0x00, 0x8f);
-    spin_unlock(&rtc_lock);
-
-    /* Identity-map virtual address zero. */
-
-    map_pages_to_xen(0, 0, 1, __PAGE_HYPERVISOR|MAP_SMALL_PAGES);
-    set_current(idle_vcpu[0]);
-    write_ptbase(idle_vcpu[0]);
-
-    /* For the switch to real mode, copy some code to low memory.  It has
-       to be in the first 64k because it is running in 16-bit mode, and it
-       has to have the same physical and virtual address, because it turns
-       off paging.  Copy it near the end of the first page, out of the way
-       of BIOS variables. */
-
-    memcpy((void *)(PAGE_SIZE - sizeof(real_mode_switch) - MAX_LENGTH),
-           real_mode_switch, sizeof(real_mode_switch));
-    memcpy((void *)(PAGE_SIZE - MAX_LENGTH), code, length);
-
-    /* Set up the IDT for real mode. */
-
-    __asm__ __volatile__("lidt %0": : "m" (real_mode_idt));
-
-    /* Set up a GDT from which we can load segment descriptors for real
-       mode.  The GDT is not used in real mode; it is just needed here to
-       prepare the descriptors. */
-
-    __asm__ __volatile__("lgdt %0": : "m" (real_mode_gdt));
-
-    /* Load the data segment registers, and thus the descriptors ready for
-       real mode.  The base address of each segment is 0x100, 16 times the
-       selector value being loaded here.  This is so that the segment
-       registers don't have to be reloaded after switching to real mode:
-       the values are consistent for real mode operation already. */
-
-    __asm__ __volatile__ ("\tmov %0,%%ds\n"
-                          "\tmov %0,%%es\n"
-                          "\tmov %0,%%fs\n"
-                          "\tmov %0,%%gs\n"
-                          "\tmov %0,%%ss"
-                          :
-                          : "r" (0x0010));
-
-    /* Jump to the 16-bit code that we copied earlier.  It disables paging
-       and the cache, switches to real mode, and jumps to the BIOS reset
-       entry point. */
-
-    __asm__ __volatile__ ("ljmp $0x0008,%0"
-                          :
-                          : "i" ((void *)(PAGE_SIZE -
-                                          sizeof(real_mode_switch) -
-                                          MAX_LENGTH)));
-}
-
-static int __init set_bios_reboot(struct dmi_system_id *d)
-{
-    if ( reboot_type != BOOT_BIOS )
-    {
-        reboot_type = BOOT_BIOS;
-        printk("%s series board detected. "
-               "Selecting BIOS-method for reboots.\n", d->ident);
-    }
-    return 0;
-}
-
-static struct dmi_system_id __initdata reboot_dmi_table[] = {
-    {    /* Handle problems with rebooting on Dell 1300's */
-        .callback = set_bios_reboot,
-        .ident = "Dell PowerEdge 1300",
-        .matches = {
-            DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 1300/"),
-        },
-    },
-    {    /* Handle problems with rebooting on Dell 300's */
-        .callback = set_bios_reboot,
-        .ident = "Dell PowerEdge 300",
-        .matches = {
-            DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 300/"),
-        },
-    },
-    {    /* Handle problems with rebooting on Dell 2400's */
-        .callback = set_bios_reboot,
-        .ident = "Dell PowerEdge 2400",
-        .matches = {
-            DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 2400"),
-        },
-    },
-    {    /* Handle problems with rebooting on HP laptops */
-        .callback = set_bios_reboot,
-        .ident = "HP Compaq Laptop",
-        .matches = {
-            DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq"),
-        },
-    },
-    { }
-};
-
-static int __init reboot_init(void)
-{
-    dmi_check_system(reboot_dmi_table);
-    return 0;
-}
-__initcall(reboot_init);
-
-#else /* __x86_64__ */
-
-#define machine_real_restart(x, y)
-
-#endif
-
 static void __machine_restart(void *pdelay)
 {
     machine_restart(*(unsigned int *)pdelay);
@@ -371,7 +175,7 @@ void machine_restart(unsigned int delay_
             reboot_type = BOOT_KBD;
             break;
         case BOOT_BIOS:
-            machine_real_restart(jump_to_bios, sizeof(jump_to_bios));
+            /* unsupported on x86_64 */
             reboot_type = BOOT_KBD;
             break;
         case BOOT_ACPI:
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/smpboot.c
--- a/xen/arch/x86/smpboot.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/smpboot.c	Wed Sep 12 13:29:30 2012 +0100
@@ -660,9 +660,7 @@ static void cpu_smpboot_free(unsigned in
     order = get_order_from_pages(NR_RESERVED_GDT_PAGES);
     free_xenheap_pages(per_cpu(gdt_table, cpu), order);
 
-#ifdef __x86_64__
     free_xenheap_pages(per_cpu(compat_gdt_table, cpu), order);
-#endif
 
     order = get_order_from_bytes(IDT_ENTRIES * sizeof(idt_entry_t));
     free_xenheap_pages(idt_tables[cpu], order);
@@ -695,14 +693,12 @@ static int cpu_smpboot_alloc(unsigned in
     BUILD_BUG_ON(NR_CPUS > 0x10000);
     gdt[PER_CPU_GDT_ENTRY - FIRST_RESERVED_GDT_ENTRY].a = cpu;
 
-#ifdef __x86_64__
     per_cpu(compat_gdt_table, cpu) = gdt =
         alloc_xenheap_pages(order, MEMF_node(cpu_to_node(cpu)));
     if ( gdt == NULL )
         goto oom;
     memcpy(gdt, boot_cpu_compat_gdt_table, NR_RESERVED_GDT_PAGES * PAGE_SIZE);
     gdt[PER_CPU_GDT_ENTRY - FIRST_RESERVED_GDT_ENTRY].a = cpu;
-#endif
 
     order = get_order_from_bytes(IDT_ENTRIES * sizeof(idt_entry_t));
     idt_tables[cpu] = alloc_xenheap_pages(order, MEMF_node(cpu_to_node(cpu)));
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/srat.c
--- a/xen/arch/x86/srat.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/srat.c	Wed Sep 12 13:29:30 2012 +0100
@@ -115,7 +115,6 @@ static __init void bad_srat(void)
 		pxm2node[i] = NUMA_NO_NODE;
 }
 
-#ifdef CONFIG_X86_64
 /*
  * A lot of BIOS fill in 10 (= no distance) everywhere. This messes
  * up the NUMA heuristics which wants the local node to have a smaller
@@ -157,11 +156,6 @@ void __init acpi_numa_slit_init(struct a
 	acpi_slit = mfn_to_virt(mfn);
 	memcpy(acpi_slit, slit, slit->header.length);
 }
-#else
-void __init acpi_numa_slit_init(struct acpi_table_slit *slit)
-{
-}
-#endif
 
 /* Callback for Proximity Domain -> x2APIC mapping */
 void __init
@@ -267,9 +261,7 @@ acpi_numa_memory_affinity_init(struct ac
 	{
 		printk(KERN_INFO "SRAT: hot plug zone found %"PRIx64" - %"PRIx64" \n",
 				start, end);
-#ifdef CONFIG_X86_64
 		mem_hotplug = 1;
-#endif
 	}
 
 	i = conflicting_memblks(start, end);
@@ -348,8 +340,6 @@ static int nodes_cover_memory(void)
 
 void __init acpi_numa_arch_fixup(void) {}
 
-#ifdef __x86_64__
-
 static u64 __initdata srat_region_mask;
 
 static u64 __init fill_mask(u64 mask)
@@ -411,8 +401,6 @@ void __init srat_parse_regions(u64 addr)
 	pfn_pdx_hole_setup(mask >> PAGE_SHIFT);
 }
 
-#endif /* __x86_64__ */
-
 /* Use the information discovered above to actually set up the nodes. */
 int __init acpi_scan_nodes(u64 start, u64 end)
 {
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/time.c
--- a/xen/arch/x86/time.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/time.c	Wed Sep 12 13:29:30 2012 +0100
@@ -120,31 +120,15 @@ static inline u32 mul_frac(u32 multiplic
 static inline u64 scale_delta(u64 delta, struct time_scale *scale)
 {
     u64 product;
-#ifdef CONFIG_X86_32
-    u32 tmp1, tmp2;
-#endif
 
     if ( scale->shift < 0 )
         delta >>= -scale->shift;
     else
         delta <<= scale->shift;
 
-#ifdef CONFIG_X86_32
-    asm (
-        "mul  %5       ; "
-        "mov  %4,%%eax ; "
-        "mov  %%edx,%4 ; "
-        "mul  %5       ; "
-        "xor  %5,%5    ; "
-        "add  %4,%%eax ; "
-        "adc  %5,%%edx ; "
-        : "=A" (product), "=r" (tmp1), "=r" (tmp2)
-        : "a" ((u32)delta), "1" ((u32)(delta >> 32)), "2" (scale->mul_frac) );
-#else
     asm (
         "mul %%rdx ; shrd $32,%%rdx,%%rax"
         : "=a" (product) : "0" (delta), "d" ((u64)scale->mul_frac) );
-#endif
 
     return product;
 }
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/trace.c
--- a/xen/arch/x86/trace.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/trace.c	Wed Sep 12 13:29:30 2012 +0100
@@ -6,16 +6,10 @@
 #include <xen/sched.h>
 #include <xen/trace.h>
 
-#ifndef __x86_64__
-#undef TRC_64_FLAG
-#define TRC_64_FLAG 0
-#endif
-
 void trace_hypercall(void)
 {
     struct cpu_user_regs *regs = guest_cpu_user_regs();
 
-#ifdef __x86_64__
     if ( is_pv_32on64_vcpu(current) )
     {
         struct {
@@ -28,7 +22,6 @@ void trace_hypercall(void)
         __trace_var(TRC_PV_HYPERCALL, 1, sizeof(d), &d);
     }
     else
-#endif
     {
         struct {
             unsigned long eip;
@@ -48,7 +41,6 @@ void trace_hypercall(void)
 void __trace_pv_trap(int trapnr, unsigned long eip,
                      int use_error_code, unsigned error_code)
 {
-#ifdef __x86_64__
     if ( is_pv_32on64_vcpu(current) )
     {
         struct {
@@ -66,7 +58,6 @@ void __trace_pv_trap(int trapnr, unsigne
         __trace_var(TRC_PV_TRAP, 1, sizeof(d), &d);
     }
     else
-#endif        
     {
         struct {
             unsigned long eip;
@@ -91,7 +82,6 @@ void __trace_pv_page_fault(unsigned long
 {
     unsigned long eip = guest_cpu_user_regs()->eip;
 
-#ifdef __x86_64__
     if ( is_pv_32on64_vcpu(current) )
     {
         struct {
@@ -105,7 +95,6 @@ void __trace_pv_page_fault(unsigned long
         __trace_var(TRC_PV_PAGE_FAULT, 1, sizeof(d), &d);
     }
     else
-#endif        
     {
         struct {
             unsigned long eip, addr;
@@ -124,14 +113,12 @@ void __trace_pv_page_fault(unsigned long
 
 void __trace_trap_one_addr(unsigned event, unsigned long va)
 {
-#ifdef __x86_64__
     if ( is_pv_32on64_vcpu(current) )
     {
         u32 d = va;
         __trace_var(event, 1, sizeof(d), &d);
     }
     else
-#endif        
     {
         event |= TRC_64_FLAG;
         __trace_var(event, 1, sizeof(va), &va);
@@ -141,7 +128,6 @@ void __trace_trap_one_addr(unsigned even
 void __trace_trap_two_addr(unsigned event, unsigned long va1,
                            unsigned long va2)
 {
-#ifdef __x86_64__
     if ( is_pv_32on64_vcpu(current) )
     {
         struct {
@@ -152,7 +138,6 @@ void __trace_trap_two_addr(unsigned even
         __trace_var(event, 1, sizeof(d), &d);
     }
     else
-#endif        
     {
         struct {
             unsigned long va1, va2;
@@ -176,7 +161,6 @@ void __trace_ptwr_emulation(unsigned lon
      * cases, "unsigned long" is the size of a guest virtual address.
      */
 
-#ifdef __x86_64__
     if ( is_pv_32on64_vcpu(current) )
     {
         struct {
@@ -190,7 +174,6 @@ void __trace_ptwr_emulation(unsigned lon
         __trace_var(TRC_PV_PTWR_EMULATION_PAE, 1, sizeof(d), &d);
     }
     else
-#endif        
     {
         struct {
             l1_pgentry_t pte;
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/traps.c	Wed Sep 12 13:29:30 2012 +0100
@@ -111,13 +111,8 @@ integer_param("debug_stack_lines", debug
 static bool_t __devinitdata opt_ler;
 boolean_param("ler", opt_ler);
 
-#ifdef CONFIG_X86_32
-#define stack_words_per_line 8
-#define ESP_BEFORE_EXCEPTION(regs) ((unsigned long *)&regs->esp)
-#else
 #define stack_words_per_line 4
 #define ESP_BEFORE_EXCEPTION(regs) ((unsigned long *)regs->rsp)
-#endif
 
 static void show_guest_stack(struct vcpu *v, struct cpu_user_regs *regs)
 {
@@ -157,14 +152,7 @@ static void show_guest_stack(struct vcpu
         struct vcpu *vcpu;
 
         ASSERT(guest_kernel_mode(v, regs));
-#ifndef __x86_64__
-        addr = read_cr3();
-        for_each_vcpu( v->domain, vcpu )
-            if ( vcpu->arch.cr3 == addr )
-                break;
-#else
         vcpu = maddr_get_owner(read_cr3()) == v->domain ? v : NULL;
-#endif
         if ( !vcpu )
         {
             stack = do_page_walk(v, (unsigned long)stack);
@@ -387,7 +375,6 @@ unsigned long *get_x86_gpr(struct cpu_us
     case  5: p = &regs->ebp; break;
     case  6: p = &regs->esi; break;
     case  7: p = &regs->edi; break;
-#if defined(__x86_64__)
     case  8: p = &regs->r8;  break;
     case  9: p = &regs->r9;  break;
     case 10: p = &regs->r10; break;
@@ -396,7 +383,6 @@ unsigned long *get_x86_gpr(struct cpu_us
     case 13: p = &regs->r13; break;
     case 14: p = &regs->r14; break;
     case 15: p = &regs->r15; break;
-#endif
     default: p = NULL; break;
     }
 
@@ -823,10 +809,6 @@ static void pv_cpuid(struct cpu_user_reg
         /* Modify Feature Information. */
         if ( !cpu_has_sep )
             __clear_bit(X86_FEATURE_SEP, &d);
-#ifdef __i386__
-        if ( !supervisor_mode_kernel )
-            __clear_bit(X86_FEATURE_SEP, &d);
-#endif
         __clear_bit(X86_FEATURE_DS, &d);
         __clear_bit(X86_FEATURE_ACC, &d);
         __clear_bit(X86_FEATURE_PBE, &d);
@@ -879,10 +861,8 @@ static void pv_cpuid(struct cpu_user_reg
             __clear_bit(X86_FEATURE_LM % 32, &d);
             __clear_bit(X86_FEATURE_LAHF_LM % 32, &c);
         }
-#ifndef __i386__
         if ( is_pv_32on64_vcpu(current) &&
              boot_cpu_data.x86_vendor != X86_VENDOR_AMD )
-#endif
             __clear_bit(X86_FEATURE_SYSCALL % 32, &d);
         __clear_bit(X86_FEATURE_PAGE1GB % 32, &d);
         __clear_bit(X86_FEATURE_RDTSCP % 32, &d);
@@ -1361,11 +1341,9 @@ static int fixup_page_fault(unsigned lon
              ptwr_do_page_fault(v, addr, regs) )
             return EXCRET_fault_fixed;
 
-#ifdef __x86_64__
         if ( IS_PRIV(d) && (regs->error_code & PFEC_page_present) &&
              mmio_ro_do_page_fault(v, addr, regs) )
             return EXCRET_fault_fixed;
-#endif
     }
 
     /* For non-external shadowed guests, we fix up both their own 
@@ -1566,7 +1544,6 @@ static int read_descriptor(unsigned int 
     return 1;
 }
 
-#ifdef __x86_64__
 static int read_gate_descriptor(unsigned int gate_sel,
                                 const struct vcpu *v,
                                 unsigned int *sel,
@@ -1622,20 +1599,15 @@ static int read_gate_descriptor(unsigned
 
     return 1;
 }
-#endif
 
 /* Has the guest requested sufficient permission for this I/O access? */
 static int guest_io_okay(
     unsigned int port, unsigned int bytes,
     struct vcpu *v, struct cpu_user_regs *regs)
 {
-#if defined(__x86_64__)
     /* If in user mode, switch to kernel mode just to read I/O bitmap. */
     int user_mode = !(v->arch.flags & TF_kernel_mode);
 #define TOGGLE_MODE() if ( user_mode ) toggle_guest_mode(v)
-#elif defined(__i386__)
-#define TOGGLE_MODE() ((void)0)
-#endif
 
     if ( !vm86_mode(regs) &&
          (v->arch.pv_vcpu.iopl >= (guest_kernel_mode(v, regs) ? 1 : 3)) )
@@ -1889,11 +1861,7 @@ static inline uint64_t guest_misc_enable
     }                                                                       \
     (eip) += sizeof(_x); _x; })
 
-#if defined(CONFIG_X86_32)
-# define read_sreg(regs, sr) ((regs)->sr)
-#elif defined(CONFIG_X86_64)
-# define read_sreg(regs, sr) read_segment_register(sr)
-#endif
+#define read_sreg(regs, sr) read_segment_register(sr)
 
 static int is_cpufreq_controller(struct domain *d)
 {
@@ -1901,9 +1869,7 @@ static int is_cpufreq_controller(struct 
             (d->domain_id == 0));
 }
 
-#ifdef CONFIG_X86_64
 #include "x86_64/mmconfig.h"
-#endif
 
 static int emulate_privileged_op(struct cpu_user_regs *regs)
 {
@@ -2034,7 +2000,6 @@ static int emulate_privileged_op(struct 
                   (ar & _SEGMENT_CODE) || !(ar & _SEGMENT_WR)) )
                 goto fail;
         }
-#ifdef CONFIG_X86_64
         else
         {
             if ( lm_ovr == lm_seg_none || data_sel < 4 )
@@ -2062,7 +2027,6 @@ static int emulate_privileged_op(struct 
             data_limit = ~0UL;
             ar = _SEGMENT_WR|_SEGMENT_S|_SEGMENT_DPL|_SEGMENT_P;
         }
-#endif
 
         port = (u16)regs->edx;
 
@@ -2126,7 +2090,6 @@ static int emulate_privileged_op(struct 
      * GPR context. This is needed for some systems which (ab)use IN/OUT
      * to communicate with BIOS code in system-management mode.
      */
-#ifdef __x86_64__
     /* movq $host_to_guest_gpr_switch,%rcx */
     io_emul_stub[0] = 0x48;
     io_emul_stub[1] = 0xb9;
@@ -2134,14 +2097,6 @@ static int emulate_privileged_op(struct 
     /* callq *%rcx */
     io_emul_stub[10] = 0xff;
     io_emul_stub[11] = 0xd1;
-#else
-    /* call host_to_guest_gpr_switch */
-    io_emul_stub[0] = 0xe8;
-    *(s32 *)&io_emul_stub[1] =
-        (char *)host_to_guest_gpr_switch - &io_emul_stub[5];
-    /* 7 x nop */
-    memset(&io_emul_stub[5], 0x90, 7);
-#endif
     /* data16 or nop */
     io_emul_stub[12] = (op_bytes != 2) ? 0x90 : 0x66;
     /* <io-access opcode> */
@@ -2443,7 +2398,6 @@ static int emulate_privileged_op(struct 
         msr_content = ((uint64_t)edx << 32) | eax;
         switch ( (u32)regs->ecx )
         {
-#ifdef CONFIG_X86_64
         case MSR_FS_BASE:
             if ( is_pv_32on64_vcpu(v) )
                 goto fail;
@@ -2465,7 +2419,6 @@ static int emulate_privileged_op(struct 
                 goto fail;
             v->arch.pv_vcpu.gs_base_user = msr_content;
             break;
-#endif
         case MSR_K7_FID_VID_STATUS:
         case MSR_K7_FID_VID_CTL:
         case MSR_K8_PSTATE_LIMIT:
@@ -2509,10 +2462,8 @@ static int emulate_privileged_op(struct 
             if ( (rdmsr_safe(MSR_FAM10H_MMIO_CONF_BASE, val) != 0) )
                 goto fail;
             if (
-#ifdef CONFIG_X86_64
                  (pci_probe & PCI_PROBE_MASK) == PCI_PROBE_MMCONF ?
                  val != msr_content :
-#endif
                  ((val ^ msr_content) &
                   ~( FAM10H_MMIO_CONF_ENABLE |
                     (FAM10H_MMIO_CONF_BUSRANGE_MASK <<
@@ -2600,7 +2551,6 @@ static int emulate_privileged_op(struct 
     case 0x32: /* RDMSR */
         switch ( (u32)regs->ecx )
         {
-#ifdef CONFIG_X86_64
         case MSR_FS_BASE:
             if ( is_pv_32on64_vcpu(v) )
                 goto fail;
@@ -2619,7 +2569,6 @@ static int emulate_privileged_op(struct 
             regs->eax = v->arch.pv_vcpu.gs_base_user & 0xFFFFFFFFUL;
             regs->edx = v->arch.pv_vcpu.gs_base_user >> 32;
             break;
-#endif
         case MSR_K7_FID_VID_CTL:
         case MSR_K7_FID_VID_STATUS:
         case MSR_K8_PSTATE_LIMIT:
@@ -2714,7 +2663,6 @@ static inline int check_stack_limit(unsi
 
 static void emulate_gate_op(struct cpu_user_regs *regs)
 {
-#ifdef __x86_64__
     struct vcpu *v = current;
     unsigned int sel, ar, dpl, nparm, opnd_sel;
     unsigned int op_default, op_bytes, ad_default, ad_bytes;
@@ -3071,7 +3019,6 @@ static void emulate_gate_op(struct cpu_u
 
     regs->cs = sel;
     instruction_done(regs, off, 0);
-#endif
 }
 
 void do_general_protection(struct cpu_user_regs *regs)
@@ -3134,16 +3081,6 @@ void do_general_protection(struct cpu_us
         return;
     }
 
-#if defined(__i386__)
-    if ( VM_ASSIST(v->domain, VMASST_TYPE_4gb_segments) && 
-         (regs->error_code == 0) && 
-         gpf_emulate_4gb(regs) )
-    {
-        TRACE_1D(TRC_PV_EMULATE_4GB, regs->eip);
-        return;
-    }
-#endif
-
     /* Pass on GPF as is. */
     do_guest_trap(TRAP_gp_fault, regs, 1);
     return;
@@ -3425,7 +3362,6 @@ void do_debug(struct cpu_user_regs *regs
     {
         if ( regs->eflags & X86_EFLAGS_TF )
         {
-#ifdef __x86_64__
             /* In SYSENTER entry path we can't zap TF until EFLAGS is saved. */
             if ( (regs->rip >= (unsigned long)sysenter_entry) &&
                  (regs->rip <= (unsigned long)sysenter_eflags_saved) )
@@ -3434,7 +3370,6 @@ void do_debug(struct cpu_user_regs *regs
                     regs->eflags &= ~X86_EFLAGS_TF;
                 goto out;
             }
-#endif
             if ( !debugger_trap_fatal(TRAP_debug, regs) )
             {
                 WARN_ON(1);
@@ -3816,12 +3751,6 @@ long set_debugreg(struct vcpu *v, int re
                         return -EPERM;
                     io_enable |= value & (3 << ((i - 16) >> 1));
                 }
-#ifdef __i386__
-                if ( ((boot_cpu_data.x86_vendor != X86_VENDOR_INTEL) ||
-                      !boot_cpu_has(X86_FEATURE_LM)) &&
-                     (((value >> i) & 0xc) == DR_LEN_8) )
-                    return -EPERM;
-#endif
             }
 
             /* Guest DR5 is a handy stash for I/O intercept information. */
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/x86_32/Makefile
--- a/xen/arch/x86/x86_32/Makefile	Wed Sep 12 13:24:28 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-obj-y += domain_page.o
-obj-bin-y += entry.o
-obj-bin-y += gpr_switch.o
-obj-y += mm.o
-obj-y += seg_fixup.o
-obj-y += traps.o
-obj-y += machine_kexec.o
-obj-y += pci.o
-
-obj-$(crash_debug) += gdbstub.o
-
-obj-bin-$(supervisor_mode_kernel) += supervisor_mode_kernel.o
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/x86_32/asm-offsets.c
--- a/xen/arch/x86/x86_32/asm-offsets.c	Wed Sep 12 13:24:28 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,140 +0,0 @@
-/*
- * Generate definitions needed by assembly language modules.
- * This code generates raw asm output which is post-processed
- * to extract and format the required data.
- */
-#define COMPILE_OFFSETS
-
-#include <xen/config.h>
-#include <xen/perfc.h>
-#include <xen/sched.h>
-#include <asm/fixmap.h>
-#include <asm/hardirq.h>
-#include <xen/multiboot.h>
-
-#define DEFINE(_sym, _val) \
-    __asm__ __volatile__ ( "\n->" #_sym " %0 " #_val : : "i" (_val) )
-#define BLANK() \
-    __asm__ __volatile__ ( "\n->" : : )
-#define OFFSET(_sym, _str, _mem) \
-    DEFINE(_sym, offsetof(_str, _mem));
-
-/* base-2 logarithm */
-#define __L2(_x)  (((_x) & 0x00000002) ?   1 : 0)
-#define __L4(_x)  (((_x) & 0x0000000c) ? ( 2 + __L2( (_x)>> 2)) : __L2( _x))
-#define __L8(_x)  (((_x) & 0x000000f0) ? ( 4 + __L4( (_x)>> 4)) : __L4( _x))
-#define __L16(_x) (((_x) & 0x0000ff00) ? ( 8 + __L8( (_x)>> 8)) : __L8( _x))
-#define LOG_2(_x) (((_x) & 0xffff0000) ? (16 + __L16((_x)>>16)) : __L16(_x))
-
-void __dummy__(void)
-{
-    OFFSET(UREGS_eax, struct cpu_user_regs, eax);
-    OFFSET(UREGS_ebx, struct cpu_user_regs, ebx);
-    OFFSET(UREGS_ecx, struct cpu_user_regs, ecx);
-    OFFSET(UREGS_edx, struct cpu_user_regs, edx);
-    OFFSET(UREGS_esi, struct cpu_user_regs, esi);
-    OFFSET(UREGS_edi, struct cpu_user_regs, edi);
-    OFFSET(UREGS_esp, struct cpu_user_regs, esp);
-    OFFSET(UREGS_ebp, struct cpu_user_regs, ebp);
-    OFFSET(UREGS_eip, struct cpu_user_regs, eip);
-    OFFSET(UREGS_cs, struct cpu_user_regs, cs);
-    OFFSET(UREGS_ds, struct cpu_user_regs, ds);
-    OFFSET(UREGS_es, struct cpu_user_regs, es);
-    OFFSET(UREGS_fs, struct cpu_user_regs, fs);
-    OFFSET(UREGS_gs, struct cpu_user_regs, gs);
-    OFFSET(UREGS_ss, struct cpu_user_regs, ss);
-    OFFSET(UREGS_eflags, struct cpu_user_regs, eflags);
-    OFFSET(UREGS_error_code, struct cpu_user_regs, error_code);
-    OFFSET(UREGS_entry_vector, struct cpu_user_regs, entry_vector);
-    OFFSET(UREGS_saved_upcall_mask, struct cpu_user_regs, saved_upcall_mask);
-    OFFSET(UREGS_kernel_sizeof, struct cpu_user_regs, esp);
-    DEFINE(UREGS_user_sizeof, sizeof(struct cpu_user_regs));
-    BLANK();
-
-    OFFSET(VCPU_processor, struct vcpu, processor);
-    OFFSET(VCPU_vcpu_info, struct vcpu, vcpu_info);
-    OFFSET(VCPU_trap_bounce, struct vcpu, arch.pv_vcpu.trap_bounce);
-    OFFSET(VCPU_thread_flags, struct vcpu, arch.flags);
-    OFFSET(VCPU_event_sel, struct vcpu, arch.pv_vcpu.event_callback_cs);
-    OFFSET(VCPU_event_addr, struct vcpu, arch.pv_vcpu.event_callback_eip);
-    OFFSET(VCPU_failsafe_sel, struct vcpu,
-           arch.pv_vcpu.failsafe_callback_cs);
-    OFFSET(VCPU_failsafe_addr, struct vcpu,
-           arch.pv_vcpu.failsafe_callback_eip);
-    OFFSET(VCPU_kernel_ss, struct vcpu, arch.pv_vcpu.kernel_ss);
-    OFFSET(VCPU_kernel_sp, struct vcpu, arch.pv_vcpu.kernel_sp);
-    OFFSET(VCPU_guest_context_flags, struct vcpu, arch.vgc_flags);
-    OFFSET(VCPU_nmi_pending, struct vcpu, nmi_pending);
-    OFFSET(VCPU_mce_pending, struct vcpu, mce_pending);
-    OFFSET(VCPU_nmi_old_mask, struct vcpu, nmi_state.old_mask);
-    OFFSET(VCPU_mce_old_mask, struct vcpu, mce_state.old_mask);
-    OFFSET(VCPU_async_exception_mask, struct vcpu, async_exception_mask);
-    DEFINE(VCPU_TRAP_NMI, VCPU_TRAP_NMI);
-    DEFINE(VCPU_TRAP_MCE, VCPU_TRAP_MCE);
-    DEFINE(_VGCF_failsafe_disables_events, _VGCF_failsafe_disables_events);
-    BLANK();
-
-    OFFSET(TSS_ss0, struct tss_struct, ss0);
-    OFFSET(TSS_esp0, struct tss_struct, esp0);
-    OFFSET(TSS_ss1, struct tss_struct, ss1);
-    OFFSET(TSS_esp1, struct tss_struct, esp1);
-    DEFINE(TSS_sizeof, sizeof(struct tss_struct));
-    BLANK();
-
-    OFFSET(VCPU_svm_vmcb_pa, struct vcpu, arch.hvm_svm.vmcb_pa);
-    OFFSET(VCPU_svm_vmcb, struct vcpu, arch.hvm_svm.vmcb);
-    OFFSET(VCPU_svm_vmcb_in_sync, struct vcpu, arch.hvm_svm.vmcb_in_sync);
-    BLANK();
-
-    OFFSET(VCPU_vmx_launched, struct vcpu, arch.hvm_vmx.launched);
-    OFFSET(VCPU_vmx_realmode, struct vcpu, arch.hvm_vmx.vmx_realmode);
-    OFFSET(VCPU_vmx_emulate, struct vcpu, arch.hvm_vmx.vmx_emulate);
-    OFFSET(VCPU_vm86_seg_mask, struct vcpu, arch.hvm_vmx.vm86_segment_mask);
-    OFFSET(VCPU_hvm_guest_cr2, struct vcpu, arch.hvm_vcpu.guest_cr[2]);
-    BLANK();
-
-    OFFSET(VCPU_nhvm_guestmode, struct vcpu, arch.hvm_vcpu.nvcpu.nv_guestmode);
-    OFFSET(VCPU_nhvm_p2m, struct vcpu, arch.hvm_vcpu.nvcpu.nv_p2m);
-    OFFSET(VCPU_nsvm_hap_enabled, struct vcpu, arch.hvm_vcpu.nvcpu.u.nsvm.ns_hap_enabled);
-    BLANK();
-
-    OFFSET(VMCB_rax, struct vmcb_struct, rax);
-    OFFSET(VMCB_rip, struct vmcb_struct, rip);
-    OFFSET(VMCB_rsp, struct vmcb_struct, rsp);
-    OFFSET(VMCB_rflags, struct vmcb_struct, rflags);
-    BLANK();
-
-    OFFSET(VCPUINFO_upcall_pending, vcpu_info_t, evtchn_upcall_pending);
-    OFFSET(VCPUINFO_upcall_mask, vcpu_info_t, evtchn_upcall_mask);
-    BLANK();
-
-    OFFSET(CPUINFO_guest_cpu_user_regs, struct cpu_info, guest_cpu_user_regs);
-    OFFSET(CPUINFO_processor_id, struct cpu_info, processor_id);
-    OFFSET(CPUINFO_current_vcpu, struct cpu_info, current_vcpu);
-    DEFINE(CPUINFO_sizeof, sizeof(struct cpu_info));
-    BLANK();
-
-    OFFSET(TRAPBOUNCE_error_code, struct trap_bounce, error_code);
-    OFFSET(TRAPBOUNCE_flags, struct trap_bounce, flags);
-    OFFSET(TRAPBOUNCE_cs, struct trap_bounce, cs);
-    OFFSET(TRAPBOUNCE_eip, struct trap_bounce, eip);
-    BLANK();
-
-#if PERF_COUNTERS
-    DEFINE(ASM_PERFC_hypercalls, PERFC_hypercalls);
-    DEFINE(ASM_PERFC_exceptions, PERFC_exceptions);
-    BLANK();
-#endif
-
-    DEFINE(FIXMAP_apic_base, fix_to_virt(FIX_APIC_BASE));
-    BLANK();
-
-    DEFINE(IRQSTAT_shift, LOG_2(sizeof(irq_cpustat_t)));
-    BLANK();
-
-    OFFSET(CPUINFO86_ext_features, struct cpuinfo_x86, x86_capability[1]);
-    BLANK();
-
-    OFFSET(MB_flags, multiboot_info_t, flags);
-    OFFSET(MB_cmdline, multiboot_info_t, cmdline);
-}
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/x86_32/domain_page.c
--- a/xen/arch/x86/x86_32/domain_page.c	Wed Sep 12 13:24:28 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,279 +0,0 @@
-/******************************************************************************
- * domain_page.h
- * 
- * Allow temporary mapping of domain pages.
- * 
- * Copyright (c) 2003-2006, Keir Fraser <keir@xensource.com>
- */
-
-#include <xen/config.h>
-#include <xen/sched.h>
-#include <xen/mm.h>
-#include <xen/perfc.h>
-#include <xen/domain_page.h>
-#include <asm/current.h>
-#include <asm/flushtlb.h>
-#include <asm/hardirq.h>
-#include <asm/hvm/support.h>
-#include <asm/fixmap.h>
-
-static inline struct vcpu *mapcache_current_vcpu(void)
-{
-    struct vcpu *v;
-
-    /* In the common case we use the mapcache of the running VCPU. */
-    v = current;
-
-    /*
-     * If guest_table is NULL, and we are running a paravirtualised guest,
-     * then it means we are running on the idle domain's page table and must
-     * therefore use its mapcache.
-     */
-    if ( unlikely(!pagetable_get_pfn(v->arch.guest_table)) && !is_hvm_vcpu(v) )
-    {
-        /* If we really are idling, perform lazy context switch now. */
-        if ( (v = idle_vcpu[smp_processor_id()]) == current )
-            sync_local_execstate();
-        /* We must now be running on the idle page table. */
-        ASSERT(read_cr3() == __pa(idle_pg_table));
-    }
-
-    return v;
-}
-
-void *map_domain_page(unsigned long mfn)
-{
-    unsigned long va, flags;
-    unsigned int idx, i;
-    struct vcpu *v;
-    struct mapcache_domain *dcache;
-    struct mapcache_vcpu *vcache;
-    struct vcpu_maphash_entry *hashent;
-
-    perfc_incr(map_domain_page_count);
-
-    v = mapcache_current_vcpu();
-    /* Prevent vcpu pointer being used before initialize. */
-    ASSERT((unsigned long)v != 0xfffff000);
-
-    dcache = &v->domain->arch.mapcache;
-    vcache = &v->arch.mapcache;
-
-    local_irq_save(flags);
-
-    hashent = &vcache->hash[MAPHASH_HASHFN(mfn)];
-    if ( hashent->mfn == mfn )
-    {
-        idx = hashent->idx;
-        hashent->refcnt++;
-        ASSERT(idx < MAPCACHE_ENTRIES);
-        ASSERT(hashent->refcnt != 0);
-        ASSERT(l1e_get_pfn(dcache->l1tab[idx]) == mfn);
-        goto out;
-    }
-
-    spin_lock(&dcache->lock);
-
-    /* Has some other CPU caused a wrap? We must flush if so. */
-    if ( unlikely(dcache->epoch != vcache->shadow_epoch) )
-    {
-        vcache->shadow_epoch = dcache->epoch;
-        if ( NEED_FLUSH(this_cpu(tlbflush_time), dcache->tlbflush_timestamp) )
-        {
-            perfc_incr(domain_page_tlb_flush);
-            flush_tlb_local();
-        }
-    }
-
-    idx = find_next_zero_bit(dcache->inuse, MAPCACHE_ENTRIES, dcache->cursor);
-    if ( unlikely(idx >= MAPCACHE_ENTRIES) )
-    {
-        /* /First/, clean the garbage map and update the inuse list. */
-        for ( i = 0; i < ARRAY_SIZE(dcache->garbage); i++ )
-        {
-            unsigned long x = xchg(&dcache->garbage[i], 0);
-            dcache->inuse[i] &= ~x;
-        }
-
-        /* /Second/, flush TLBs. */
-        perfc_incr(domain_page_tlb_flush);
-        flush_tlb_local();
-        vcache->shadow_epoch = ++dcache->epoch;
-        dcache->tlbflush_timestamp = tlbflush_current_time();
-
-        idx = find_first_zero_bit(dcache->inuse, MAPCACHE_ENTRIES);
-        BUG_ON(idx >= MAPCACHE_ENTRIES);
-    }
-
-    set_bit(idx, dcache->inuse);
-    dcache->cursor = idx + 1;
-
-    spin_unlock(&dcache->lock);
-
-    l1e_write(&dcache->l1tab[idx], l1e_from_pfn(mfn, __PAGE_HYPERVISOR));
-
- out:
-    local_irq_restore(flags);
-    va = MAPCACHE_VIRT_START + (idx << PAGE_SHIFT);
-    return (void *)va;
-}
-
-void unmap_domain_page(const void *va)
-{
-    unsigned int idx;
-    struct vcpu *v;
-    struct mapcache_domain *dcache;
-    unsigned long mfn, flags;
-    struct vcpu_maphash_entry *hashent;
-
-    ASSERT((void *)MAPCACHE_VIRT_START <= va);
-    ASSERT(va < (void *)MAPCACHE_VIRT_END);
-
-    v = mapcache_current_vcpu();
-
-    dcache = &v->domain->arch.mapcache;
-
-    idx = ((unsigned long)va - MAPCACHE_VIRT_START) >> PAGE_SHIFT;
-    mfn = l1e_get_pfn(dcache->l1tab[idx]);
-    hashent = &v->arch.mapcache.hash[MAPHASH_HASHFN(mfn)];
-
-    local_irq_save(flags);
-
-    if ( hashent->idx == idx )
-    {
-        ASSERT(hashent->mfn == mfn);
-        ASSERT(hashent->refcnt != 0);
-        hashent->refcnt--;
-    }
-    else if ( hashent->refcnt == 0 )
-    {
-        if ( hashent->idx != MAPHASHENT_NOTINUSE )
-        {
-            /* /First/, zap the PTE. */
-            ASSERT(l1e_get_pfn(dcache->l1tab[hashent->idx]) == hashent->mfn);
-            l1e_write(&dcache->l1tab[hashent->idx], l1e_empty());
-            /* /Second/, mark as garbage. */
-            set_bit(hashent->idx, dcache->garbage);
-        }
-
-        /* Add newly-freed mapping to the maphash. */
-        hashent->mfn = mfn;
-        hashent->idx = idx;
-    }
-    else
-    {
-        /* /First/, zap the PTE. */
-        l1e_write(&dcache->l1tab[idx], l1e_empty());
-        /* /Second/, mark as garbage. */
-        set_bit(idx, dcache->garbage);
-    }
-
-    local_irq_restore(flags);
-}
-
-void mapcache_domain_init(struct domain *d)
-{
-    d->arch.mapcache.l1tab = d->arch.mm_perdomain_pt +
-        (GDT_LDT_MBYTES << (20 - PAGE_SHIFT));
-    spin_lock_init(&d->arch.mapcache.lock);
-}
-
-void mapcache_vcpu_init(struct vcpu *v)
-{
-    unsigned int i;
-    struct vcpu_maphash_entry *hashent;
-
-    /* Mark all maphash entries as not in use. */
-    for ( i = 0; i < MAPHASH_ENTRIES; i++ )
-    {
-        hashent = &v->arch.mapcache.hash[i];
-        hashent->mfn = ~0UL; /* never valid to map */
-        hashent->idx = MAPHASHENT_NOTINUSE;
-    }
-}
-
-#define GLOBALMAP_BITS (IOREMAP_MBYTES << (20 - PAGE_SHIFT))
-static unsigned long inuse[BITS_TO_LONGS(GLOBALMAP_BITS)];
-static unsigned long garbage[BITS_TO_LONGS(GLOBALMAP_BITS)];
-static unsigned int inuse_cursor;
-static DEFINE_SPINLOCK(globalmap_lock);
-
-void *map_domain_page_global(unsigned long mfn)
-{
-    l2_pgentry_t *pl2e;
-    l1_pgentry_t *pl1e;
-    unsigned int idx, i;
-    unsigned long va;
-
-    ASSERT(!in_irq() && local_irq_is_enabled());
-
-    /* At least half the ioremap space should be available to us. */
-    BUILD_BUG_ON(IOREMAP_VIRT_START + (IOREMAP_MBYTES << 19) >= FIXADDR_START);
-
-    spin_lock(&globalmap_lock);
-
-    idx = find_next_zero_bit(inuse, GLOBALMAP_BITS, inuse_cursor);
-    va = IOREMAP_VIRT_START + (idx << PAGE_SHIFT);
-    if ( unlikely(va >= FIXADDR_START) )
-    {
-        /* /First/, clean the garbage map and update the inuse list. */
-        for ( i = 0; i < ARRAY_SIZE(garbage); i++ )
-        {
-            unsigned long x = xchg(&garbage[i], 0);
-            inuse[i] &= ~x;
-        }
-
-        /* /Second/, flush all TLBs to get rid of stale garbage mappings. */
-        flush_tlb_all();
-
-        idx = find_first_zero_bit(inuse, GLOBALMAP_BITS);
-        va = IOREMAP_VIRT_START + (idx << PAGE_SHIFT);
-        if ( unlikely(va >= FIXADDR_START) )
-        {
-            spin_unlock(&globalmap_lock);
-            return NULL;
-        }
-    }
-
-    set_bit(idx, inuse);
-    inuse_cursor = idx + 1;
-
-    spin_unlock(&globalmap_lock);
-
-    pl2e = virt_to_xen_l2e(va);
-    pl1e = l2e_to_l1e(*pl2e) + l1_table_offset(va);
-    l1e_write(pl1e, l1e_from_pfn(mfn, __PAGE_HYPERVISOR));
-
-    return (void *)va;
-}
-
-void unmap_domain_page_global(const void *va)
-{
-    unsigned long __va = (unsigned long)va;
-    l2_pgentry_t *pl2e;
-    l1_pgentry_t *pl1e;
-    unsigned int idx;
-
-    ASSERT(__va >= IOREMAP_VIRT_START);
-
-    /* /First/, we zap the PTE. */
-    pl2e = virt_to_xen_l2e(__va);
-    pl1e = l2e_to_l1e(*pl2e) + l1_table_offset(__va);
-    l1e_write(pl1e, l1e_empty());
-
-    /* /Second/, we add to the garbage map. */
-    idx = (__va - IOREMAP_VIRT_START) >> PAGE_SHIFT;
-    set_bit(idx, garbage);
-}
-
-/* Translate a map-domain-page'd address to the underlying MFN */
-unsigned long domain_page_map_to_mfn(void *va)
-{
-    l1_pgentry_t *l1e;
-
-    ASSERT( (((unsigned long) va) >= MAPCACHE_VIRT_START) &&
-            (((unsigned long) va) <= MAPCACHE_VIRT_END) );
-    l1e = &__linear_l1_table[
-            l1_linear_offset((unsigned long) va)];
-    return l1e_get_pfn(*l1e);
-}
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/x86_32/entry.S
--- a/xen/arch/x86/x86_32/entry.S	Wed Sep 12 13:24:28 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,757 +0,0 @@
-/*
- * Hypercall and fault low-level handling routines.
- *
- * Copyright (c) 2002-2004, K A Fraser
- * Copyright (c) 1991, 1992 Linus Torvalds
- * 
- * Calling back to a guest OS:
- * ===========================
- * 
- * First, we require that all callbacks (either via a supplied
- * interrupt-descriptor-table, or via the special event or failsafe callbacks
- * in the shared-info-structure) are to ring 1. This just makes life easier,
- * in that it means we don't have to do messy GDT/LDT lookups to find
- * out which the privilege-level of the return code-selector. That code
- * would just be a hassle to write, and would need to account for running
- * off the end of the GDT/LDT, for example. For all callbacks we check
- * that the provided return CS is not == __HYPERVISOR_{CS,DS}. Apart from that 
- * we're safe as don't allow a guest OS to install ring-0 privileges into the
- * GDT/LDT. It's up to the guest OS to ensure all returns via the IDT are to
- * ring 1. If not, we load incorrect SS/ESP values from the TSS (for ring 1
- * rather than the correct ring) and bad things are bound to ensue -- IRET is
- * likely to fault, and we may end up killing the domain (no harm can
- * come to Xen, though).
- *      
- * When doing a callback, we check if the return CS is in ring 0. If so,
- * callback is delayed until next return to ring != 0.
- * If return CS is in ring 1, then we create a callback frame
- * starting at return SS/ESP. The base of the frame does an intra-privilege
- * interrupt-return.
- * If return CS is in ring > 1, we create a callback frame starting
- * at SS/ESP taken from appropriate section of the current TSS. The base
- * of the frame does an inter-privilege interrupt-return.
- * 
- * Note that the "failsafe callback" uses a special stackframe:
- * { return_DS, return_ES, return_FS, return_GS, return_EIP,
- *   return_CS, return_EFLAGS[, return_ESP, return_SS] }
- * That is, original values for DS/ES/FS/GS are placed on stack rather than
- * in DS/ES/FS/GS themselves. Why? It saves us loading them, only to have them
- * saved/restored in guest OS. Furthermore, if we load them we may cause
- * a fault if they are invalid, which is a hassle to deal with. We avoid
- * that problem if we don't load them :-) This property allows us to use
- * the failsafe callback as a fallback: if we ever fault on loading DS/ES/FS/GS
- * on return to ring != 0, we can simply package it up as a return via
- * the failsafe callback, and let the guest OS sort it out (perhaps by
- * killing an application process). Note that we also do this for any
- * faulting IRET -- just let the guest OS handle it via the event
- * callback.
- *
- * We terminate a domain in the following cases:
- *  - creating a callback stack frame (due to bad ring-1 stack).
- *  - faulting IRET on entry to failsafe callback handler.
- * So, each domain must keep its ring-1 %ss/%esp and failsafe callback
- * handler in good order (absolutely no faults allowed!).
- */
-
-#include <xen/config.h>
-#include <xen/errno.h>
-#include <xen/softirq.h>
-#include <asm/asm_defns.h>
-#include <asm/apicdef.h>
-#include <asm/page.h>
-#include <public/xen.h>
-
-        ALIGN
-restore_all_guest:
-        ASSERT_INTERRUPTS_DISABLED
-        testl $X86_EFLAGS_VM,UREGS_eflags(%esp)
-        popl  %ebx
-        popl  %ecx
-        popl  %edx
-        popl  %esi
-        popl  %edi
-        popl  %ebp
-        popl  %eax
-        leal  4(%esp),%esp
-        jnz   .Lrestore_iret_guest
-#ifdef CONFIG_X86_SUPERVISOR_MODE_KERNEL
-        testb $2,UREGS_cs-UREGS_eip(%esp)
-        jnz   .Lrestore_sregs_guest
-        call  restore_ring0_guest
-        jmp   .Lrestore_iret_guest
-#endif
-.Lrestore_sregs_guest:
-.Lft1:  mov  UREGS_ds-UREGS_eip(%esp),%ds
-.Lft2:  mov  UREGS_es-UREGS_eip(%esp),%es
-.Lft3:  mov  UREGS_fs-UREGS_eip(%esp),%fs
-.Lft4:  mov  UREGS_gs-UREGS_eip(%esp),%gs
-.Lrestore_iret_guest:
-.Lft5:  iret
-.section .fixup,"ax"
-.Lfx1:  sti
-        SAVE_ALL_GPRS
-        mov   UREGS_error_code(%esp),%esi
-        pushfl                         # EFLAGS
-        movl  $__HYPERVISOR_CS,%eax
-        pushl %eax                     # CS
-        movl  $.Ldf1,%eax
-        pushl %eax                     # EIP
-        pushl %esi                     # error_code/entry_vector
-        jmp   handle_exception
-.Ldf1:  GET_CURRENT(%ebx)
-        jmp   test_all_events
-failsafe_callback:
-        GET_CURRENT(%ebx)
-        leal  VCPU_trap_bounce(%ebx),%edx
-        movl  VCPU_failsafe_addr(%ebx),%eax
-        movl  %eax,TRAPBOUNCE_eip(%edx)
-        movl  VCPU_failsafe_sel(%ebx),%eax
-        movw  %ax,TRAPBOUNCE_cs(%edx)
-        movb  $TBF_FAILSAFE,TRAPBOUNCE_flags(%edx)
-        bt    $_VGCF_failsafe_disables_events,VCPU_guest_context_flags(%ebx)
-        jnc   1f
-        orb   $TBF_INTERRUPT,TRAPBOUNCE_flags(%edx)
-1:      call  create_bounce_frame
-        xorl  %eax,%eax
-        movl  %eax,UREGS_ds(%esp)
-        movl  %eax,UREGS_es(%esp)
-        movl  %eax,UREGS_fs(%esp)
-        movl  %eax,UREGS_gs(%esp)
-        jmp   test_all_events
-.previous
-        _ASM_PRE_EXTABLE(.Lft1, .Lfx1)
-        _ASM_PRE_EXTABLE(.Lft2, .Lfx1)
-        _ASM_PRE_EXTABLE(.Lft3, .Lfx1)
-        _ASM_PRE_EXTABLE(.Lft4, .Lfx1)
-        _ASM_PRE_EXTABLE(.Lft5, .Lfx1)
-        _ASM_EXTABLE(.Ldf1, failsafe_callback)
-
-        ALIGN
-restore_all_xen:
-        popl %ebx
-        popl %ecx
-        popl %edx
-        popl %esi
-        popl %edi
-        popl %ebp
-        popl %eax
-        addl $4,%esp
-        iret
-
-ENTRY(hypercall)
-        subl $4,%esp
-        FIXUP_RING0_GUEST_STACK
-        SAVE_ALL(,1f)
-1:      sti
-        GET_CURRENT(%ebx)
-        cmpl  $NR_hypercalls,%eax
-        jae   bad_hypercall
-        PERFC_INCR(hypercalls, %eax, %ebx)
-#ifndef NDEBUG
-        /* Create shadow parameters and corrupt those not used by this call. */
-        pushl %eax
-        pushl UREGS_eip+4(%esp)
-        pushl 28(%esp) # EBP
-        pushl 28(%esp) # EDI
-        pushl 28(%esp) # ESI
-        pushl 28(%esp) # EDX
-        pushl 28(%esp) # ECX
-        pushl 28(%esp) # EBX
-        movzb hypercall_args_table(,%eax,1),%ecx
-        leal  (%esp,%ecx,4),%edi
-        subl  $6,%ecx
-        negl  %ecx
-        movl  %eax,%esi
-        movl  $0xDEADBEEF,%eax
-        rep   stosl
-        movl  %esi,%eax
-#define SHADOW_BYTES 32 /* 6 shadow parameters + EIP + hypercall # */
-#else
-        /* 
-         * We need shadow parameters even on non-debug builds. We depend on the
-         * original versions not being clobbered (needed to create a hypercall
-         * continuation). But that isn't guaranteed by the function-call ABI.
-         */ 
-        pushl 20(%esp) # EBP
-        pushl 20(%esp) # EDI
-        pushl 20(%esp) # ESI
-        pushl 20(%esp) # EDX
-        pushl 20(%esp) # ECX
-        pushl 20(%esp) # EBX
-#define SHADOW_BYTES 24 /* 6 shadow parameters */
-#endif
-        cmpb  $0,tb_init_done
-UNLIKELY_START(ne, trace)
-        call  trace_hypercall
-        /* Now restore all the registers that trace_hypercall clobbered */
-        movl  UREGS_eax+SHADOW_BYTES(%esp),%eax /* Hypercall # */
-UNLIKELY_END(trace)
-        call *hypercall_table(,%eax,4)
-        movl  %eax,UREGS_eax+SHADOW_BYTES(%esp) # save the return value
-#undef SHADOW_BYTES
-        addl  $24,%esp     # Discard the shadow parameters
-#ifndef NDEBUG
-        /* Deliberately corrupt real parameter regs used by this hypercall. */
-        popl  %ecx         # Shadow EIP
-        cmpl  %ecx,UREGS_eip+4(%esp)
-        popl  %ecx         # Shadow hypercall index
-        jne   skip_clobber # If EIP has changed then don't clobber
-        movzb hypercall_args_table(,%ecx,1),%ecx
-        movl  %esp,%edi
-        movl  $0xDEADBEEF,%eax
-        rep   stosl
-skip_clobber:
-#endif
-
-test_all_events:
-        xorl %ecx,%ecx
-        notl %ecx
-        cli                             # tests must not race interrupts
-/*test_softirqs:*/  
-        movl VCPU_processor(%ebx),%eax
-        shl  $IRQSTAT_shift,%eax
-        test %ecx,irq_stat(%eax,1)
-        jnz  process_softirqs
-        testb $1,VCPU_mce_pending(%ebx)
-        jnz  process_mce
-.Ltest_guest_nmi:
-        testb $1,VCPU_nmi_pending(%ebx)
-        jnz  process_nmi
-test_guest_events:
-        movl VCPU_vcpu_info(%ebx),%eax
-        movzwl VCPUINFO_upcall_pending(%eax),%eax
-        decl %eax
-        cmpl $0xfe,%eax
-        ja   restore_all_guest
-/*process_guest_events:*/
-        sti
-        leal VCPU_trap_bounce(%ebx),%edx
-        movl VCPU_event_addr(%ebx),%eax
-        movl %eax,TRAPBOUNCE_eip(%edx)
-        movl VCPU_event_sel(%ebx),%eax
-        movw %ax,TRAPBOUNCE_cs(%edx)
-        movb $TBF_INTERRUPT,TRAPBOUNCE_flags(%edx)
-        call create_bounce_frame
-        jmp  test_all_events
-
-        ALIGN
-process_softirqs:
-        sti       
-        call do_softirq
-        jmp  test_all_events
-
-        ALIGN
-/* %ebx: struct vcpu */
-process_mce:
-        testb $1 << VCPU_TRAP_MCE,VCPU_async_exception_mask(%ebx)
-        jnz  .Ltest_guest_nmi
-        sti
-        movb $0,VCPU_mce_pending(%ebx)
-        call set_guest_machinecheck_trapbounce
-        test %eax,%eax
-        jz   test_all_events
-        movzbl VCPU_async_exception_mask(%ebx),%edx # save mask for the
-        movb %dl,VCPU_mce_old_mask(%ebx)            # iret hypercall
-        orl  $1 << VCPU_TRAP_MCE,%edx
-        movb %dl,VCPU_async_exception_mask(%ebx)
-        jmp process_trap
-
-        ALIGN
-/* %ebx: struct vcpu */
-process_nmi:
-        testb $1 << VCPU_TRAP_NMI,VCPU_async_exception_mask(%ebx)
-        jnz  test_guest_events
-        sti
-        movb $0,VCPU_nmi_pending(%ebx)
-        call set_guest_nmi_trapbounce
-        test %eax,%eax
-        jz   test_all_events
-        movzbl VCPU_async_exception_mask(%ebx),%edx # save mask for the
-        movb %dl,VCPU_nmi_old_mask(%ebx)            # iret hypercall
-        orl  $1 << VCPU_TRAP_NMI,%edx
-        movb %dl,VCPU_async_exception_mask(%ebx)
-        /* FALLTHROUGH */
-process_trap:
-        leal VCPU_trap_bounce(%ebx),%edx
-        call create_bounce_frame
-        jmp  test_all_events
-
-bad_hypercall:
-        movl $-ENOSYS,UREGS_eax(%esp)
-        jmp  test_all_events
-
-/* CREATE A BASIC EXCEPTION FRAME ON GUEST OS (RING-1) STACK:            */
-/*   {EIP, CS, EFLAGS, [ESP, SS]}                                        */
-/* %edx == trap_bounce, %ebx == struct vcpu                       */
-/* %eax,%ecx are clobbered. %gs:%esi contain new UREGS_ss/UREGS_esp. */
-create_bounce_frame:
-        ASSERT_INTERRUPTS_ENABLED
-        movl UREGS_eflags+4(%esp),%ecx
-        movb UREGS_cs+4(%esp),%cl
-        testl $(2|X86_EFLAGS_VM),%ecx
-        jz   ring1 /* jump if returning to an existing ring-1 activation */
-        movl VCPU_kernel_sp(%ebx),%esi
-.Lft6:  mov  VCPU_kernel_ss(%ebx),%gs
-        testl $X86_EFLAGS_VM,%ecx
-UNLIKELY_START(nz, bounce_vm86_1)
-        subl $16,%esi       /* push ES/DS/FS/GS (VM86 stack frame) */
-        movl UREGS_es+4(%esp),%eax
-.Lft7:  movl %eax,%gs:(%esi)
-        movl UREGS_ds+4(%esp),%eax
-.Lft8:  movl %eax,%gs:4(%esi)
-        movl UREGS_fs+4(%esp),%eax
-.Lft9:  movl %eax,%gs:8(%esi)
-        movl UREGS_gs+4(%esp),%eax
-.Lft10: movl %eax,%gs:12(%esi)
-UNLIKELY_END(bounce_vm86_1)
-        subl $8,%esi        /* push SS/ESP (inter-priv iret) */
-        movl UREGS_esp+4(%esp),%eax
-.Lft11: movl %eax,%gs:(%esi)
-        movl UREGS_ss+4(%esp),%eax
-.Lft12: movl %eax,%gs:4(%esi)
-        jmp 1f
-ring1:  /* obtain ss/esp from oldss/oldesp -- a ring-1 activation exists */
-        movl UREGS_esp+4(%esp),%esi
-.Lft13: mov  UREGS_ss+4(%esp),%gs
-1:      /* Construct a stack frame: EFLAGS, CS/EIP */
-        movb TRAPBOUNCE_flags(%edx),%cl
-        subl $12,%esi
-        movl UREGS_eip+4(%esp),%eax
-.Lft14: movl %eax,%gs:(%esi)
-        movl VCPU_vcpu_info(%ebx),%eax
-        pushl VCPUINFO_upcall_mask(%eax)
-        testb $TBF_INTERRUPT,%cl
-        setnz %ch                        # TBF_INTERRUPT -> set upcall mask
-        orb  %ch,VCPUINFO_upcall_mask(%eax)
-        popl %eax
-        shll $16,%eax                    # Bits 16-23: saved_upcall_mask
-        movw UREGS_cs+4(%esp),%ax        # Bits  0-15: CS
-#ifdef CONFIG_X86_SUPERVISOR_MODE_KERNEL
-        testw $2,%ax
-        jnz  .Lft15
-        and  $~3,%ax                     # RPL 1 -> RPL 0
-#endif
-.Lft15: movl %eax,%gs:4(%esi)
-        test $0x00FF0000,%eax            # Bits 16-23: saved_upcall_mask
-        setz %ch                         # %ch == !saved_upcall_mask
-        movl UREGS_eflags+4(%esp),%eax
-        andl $~X86_EFLAGS_IF,%eax
-        shlb $1,%ch                      # Bit 9 (EFLAGS.IF)
-        orb  %ch,%ah                     # Fold EFLAGS.IF into %eax
-.Lft16: movl %eax,%gs:8(%esi)
-        test $TBF_EXCEPTION_ERRCODE,%cl
-        jz   1f
-        subl $4,%esi                    # push error_code onto guest frame
-        movl TRAPBOUNCE_error_code(%edx),%eax
-.Lft17: movl %eax,%gs:(%esi)
-1:      testb $TBF_FAILSAFE,%cl
-UNLIKELY_START(nz, bounce_failsafe)
-        subl $16,%esi                # add DS/ES/FS/GS to failsafe stack frame
-        testl $X86_EFLAGS_VM,UREGS_eflags+4(%esp)
-        jnz  .Lvm86_2
-        movl UREGS_ds+4(%esp),%eax   # non-VM86: write real selector values
-.Lft22: movl %eax,%gs:(%esi)
-        movl UREGS_es+4(%esp),%eax
-.Lft23: movl %eax,%gs:4(%esi)
-        movl UREGS_fs+4(%esp),%eax
-.Lft24: movl %eax,%gs:8(%esi)
-        movl UREGS_gs+4(%esp),%eax
-.Lft25: movl %eax,%gs:12(%esi)
-        jmp  .Lnvm86_3
-.Lvm86_2:
-        xorl %eax,%eax               # VM86: we write zero selector values
-.Lft18: movl %eax,%gs:(%esi)
-.Lft19: movl %eax,%gs:4(%esi)
-.Lft20: movl %eax,%gs:8(%esi)
-.Lft21: movl %eax,%gs:12(%esi)
-UNLIKELY_END(bounce_failsafe)
-        testl $X86_EFLAGS_VM,UREGS_eflags+4(%esp)
-UNLIKELY_START(nz, bounce_vm86_3)
-        xorl %eax,%eax      /* zero DS-GS, just as a real CPU would */
-        movl %eax,UREGS_ds+4(%esp)
-        movl %eax,UREGS_es+4(%esp)
-        movl %eax,UREGS_fs+4(%esp)
-        movl %eax,UREGS_gs+4(%esp)
-UNLIKELY_END(bounce_vm86_3)
-.Lnvm86_3:
-        /* Rewrite our stack frame and return to ring 1. */
-        /* IA32 Ref. Vol. 3: TF, VM, RF and NT flags are cleared on trap. */
-        andl $~(X86_EFLAGS_VM|X86_EFLAGS_RF|\
-                X86_EFLAGS_NT|X86_EFLAGS_TF),UREGS_eflags+4(%esp)
-        mov  %gs,UREGS_ss+4(%esp)
-        movl %esi,UREGS_esp+4(%esp)
-        movzwl TRAPBOUNCE_cs(%edx),%eax
-        /* Null selectors (0-3) are not allowed. */
-        testl $~3,%eax
-        jz   domain_crash_synchronous
-        movl %eax,UREGS_cs+4(%esp)
-        movl TRAPBOUNCE_eip(%edx),%eax
-        movl %eax,UREGS_eip+4(%esp)
-        ret
-        _ASM_EXTABLE(.Lft6,  domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft7,  domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft8,  domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft9,  domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft10, domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft11, domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft12, domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft13, domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft14, domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft15, domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft16, domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft17, domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft18, domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft19, domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft20, domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft21, domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft22, domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft23, domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft24, domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft25, domain_crash_synchronous)
-
-domain_crash_synchronous_string:
-        .asciz "domain_crash_sync called from entry.S (%lx)\n"
-
-domain_crash_synchronous:
-        pushl $domain_crash_synchronous_string
-        call  printk
-        jmp   __domain_crash_synchronous
-
-ENTRY(ret_from_intr)
-        GET_CURRENT(%ebx)
-        movl  UREGS_eflags(%esp),%eax
-        movb  UREGS_cs(%esp),%al
-        testl $(3|X86_EFLAGS_VM),%eax
-        jnz   test_all_events
-        jmp   restore_all_xen
-
-ENTRY(page_fault)
-        movw  $TRAP_page_fault,2(%esp)
-handle_exception:
-        FIXUP_RING0_GUEST_STACK
-        SAVE_ALL(1f,2f)
-        .text 1
-        /* Exception within Xen: make sure we have valid %ds,%es. */
-1:      mov   %ecx,%ds
-        mov   %ecx,%es
-        jmp   2f
-        .previous
-2:      testb $X86_EFLAGS_IF>>8,UREGS_eflags+1(%esp)
-        jz    exception_with_ints_disabled
-        sti                             # re-enable interrupts
-1:      xorl  %eax,%eax
-        movw  UREGS_entry_vector(%esp),%ax
-        movl  %esp,%edx
-        pushl %edx                      # push the cpu_user_regs pointer
-        GET_CURRENT(%ebx)
-        PERFC_INCR(exceptions, %eax, %ebx)
-        call  *exception_table(,%eax,4)
-        addl  $4,%esp
-        movl  UREGS_eflags(%esp),%eax
-        movb  UREGS_cs(%esp),%al
-        testl $(3|X86_EFLAGS_VM),%eax
-        jz    restore_all_xen
-        leal  VCPU_trap_bounce(%ebx),%edx
-        testb $TBF_EXCEPTION,TRAPBOUNCE_flags(%edx)
-        jz    test_all_events
-        call  create_bounce_frame
-        movb  $0,TRAPBOUNCE_flags(%edx)
-        jmp   test_all_events
-
-exception_with_ints_disabled:
-        movl  UREGS_eflags(%esp),%eax
-        movb  UREGS_cs(%esp),%al
-        testl $(3|X86_EFLAGS_VM),%eax   # interrupts disabled outside Xen?
-        jnz   FATAL_exception_with_ints_disabled
-        pushl %esp
-        call  search_pre_exception_table
-        addl  $4,%esp
-        testl %eax,%eax                 # no fixup code for faulting EIP?
-        jz    1b
-        movl  %eax,UREGS_eip(%esp)
-        movl  %esp,%esi
-        subl  $4,%esp
-        movl  %esp,%edi
-        movl  $UREGS_kernel_sizeof/4,%ecx
-        rep;  movsl                     # make room for error_code/entry_vector
-        movl  UREGS_error_code(%esp),%eax # error_code/entry_vector
-        movl  %eax,UREGS_kernel_sizeof(%esp)
-        jmp   restore_all_xen           # return to fixup code
-
-FATAL_exception_with_ints_disabled:
-        xorl  %esi,%esi
-        movw  UREGS_entry_vector(%esp),%si
-        movl  %esp,%edx
-        pushl %edx                      # push the cpu_user_regs pointer
-        pushl %esi                      # push the trapnr (entry vector)
-        call  fatal_trap
-        ud2
-                                        
-ENTRY(coprocessor_error)
-        pushl $TRAP_copro_error<<16
-        jmp   handle_exception
-
-ENTRY(simd_coprocessor_error)
-        pushl $TRAP_simd_error<<16
-        jmp   handle_exception
-
-ENTRY(device_not_available)
-        pushl $TRAP_no_device<<16
-        jmp   handle_exception
-
-ENTRY(divide_error)
-        pushl $TRAP_divide_error<<16
-        jmp   handle_exception
-
-ENTRY(debug)
-        pushl $TRAP_debug<<16
-        jmp   handle_exception
-
-ENTRY(int3)
-        pushl $TRAP_int3<<16
-        jmp   handle_exception
-
-ENTRY(overflow)
-        pushl $TRAP_overflow<<16
-        jmp   handle_exception
-
-ENTRY(bounds)
-        pushl $TRAP_bounds<<16
-        jmp   handle_exception
-
-ENTRY(invalid_op)
-        pushl $TRAP_invalid_op<<16
-        jmp   handle_exception
-
-ENTRY(coprocessor_segment_overrun)
-        pushl $TRAP_copro_seg<<16
-        jmp   handle_exception
-
-ENTRY(invalid_TSS)
-        movw  $TRAP_invalid_tss,2(%esp)
-        jmp   handle_exception
-
-ENTRY(segment_not_present)
-        movw  $TRAP_no_segment,2(%esp)
-        jmp   handle_exception
-
-ENTRY(stack_segment)
-        movw  $TRAP_stack_error,2(%esp)
-        jmp   handle_exception
-
-ENTRY(general_protection)
-        movw  $TRAP_gp_fault,2(%esp)
-        jmp   handle_exception
-
-ENTRY(alignment_check)
-        movw  $TRAP_alignment_check,2(%esp)
-        jmp   handle_exception
-
-ENTRY(spurious_interrupt_bug)
-        pushl $TRAP_spurious_int<<16
-        jmp   handle_exception
-
-        .pushsection .init.text, "ax", @progbits
-ENTRY(early_page_fault)
-        SAVE_ALL(1f,1f)
-1:      movl  %esp,%eax
-        pushl %eax
-        call  do_early_page_fault
-        addl  $4,%esp
-        jmp   restore_all_xen
-        .popsection
-
-handle_nmi_mce:
-#ifdef CONFIG_X86_SUPERVISOR_MODE_KERNEL
-        # NMI/MCE entry protocol is incompatible with guest kernel in ring 0.
-        addl  $4,%esp
-        iret
-#else
-        # Save state but do not trash the segment registers!
-        SAVE_ALL(.Lnmi_mce_xen,.Lnmi_mce_common)
-.Lnmi_mce_common:
-        xorl  %eax,%eax
-        movw  UREGS_entry_vector(%esp),%ax
-        movl  %esp,%edx
-        pushl %edx
-        call  *exception_table(,%eax,4)
-        addl  $4,%esp
-        /* 
-         * NB. We may return to Xen context with polluted %ds/%es. But in such
-         * cases we have put guest DS/ES on the guest stack frame, which will
-         * be detected by SAVE_ALL(), or we have rolled back restore_guest.
-         */
-        jmp   ret_from_intr
-.Lnmi_mce_xen:
-        /* Check the outer (guest) context for %ds/%es state validity. */
-        GET_CPUINFO_FIELD(CPUINFO_guest_cpu_user_regs,%ebx)
-        testl $X86_EFLAGS_VM,%ss:UREGS_eflags(%ebx)
-        mov   %ds,%eax
-        mov   %es,%edx
-        jnz   .Lnmi_mce_vm86
-        /* We may have interrupted Xen while messing with %ds/%es... */
-        cmpw  %ax,%cx
-        mov   %ecx,%ds             /* Ensure %ds is valid */
-        cmove UREGS_ds(%ebx),%eax  /* Grab guest DS if it wasn't in %ds */
-        cmpw  %dx,%cx
-        movl  %eax,UREGS_ds(%ebx)  /* Ensure guest frame contains guest DS */
-        cmove UREGS_es(%ebx),%edx  /* Grab guest ES if it wasn't in %es */
-        mov   %ecx,%es             /* Ensure %es is valid */
-        movl  $.Lrestore_sregs_guest,%ecx
-        movl  %edx,UREGS_es(%ebx)  /* Ensure guest frame contains guest ES */
-        cmpl  %ecx,UREGS_eip(%esp)
-        jbe   .Lnmi_mce_common
-        cmpl  $.Lrestore_iret_guest,UREGS_eip(%esp)
-        ja    .Lnmi_mce_common
-        /* Roll outer context restore_guest back to restoring %ds/%es. */
-        movl  %ecx,UREGS_eip(%esp)
-        jmp   .Lnmi_mce_common
-.Lnmi_mce_vm86:
-        /* vm86 is easy: the CPU saved %ds/%es so we can safely stomp them. */
-        mov   %ecx,%ds
-        mov   %ecx,%es
-        jmp   .Lnmi_mce_common
-#endif /* !CONFIG_X86_SUPERVISOR_MODE_KERNEL */
-
-ENTRY(nmi)
-        pushl $TRAP_nmi<<16
-        jmp   handle_nmi_mce
-
-ENTRY(machine_check)
-        pushl $TRAP_machine_check<<16
-        jmp   handle_nmi_mce
-
-ENTRY(setup_vm86_frame)
-        mov %ecx,%ds
-        mov %ecx,%es
-        # Copies the entire stack frame forwards by 16 bytes.
-        .macro copy_vm86_words count=18
-        .if \count
-        pushl ((\count-1)*4)(%esp)
-        popl  ((\count-1)*4)+16(%esp)
-        copy_vm86_words "(\count-1)"
-        .endif
-        .endm
-        copy_vm86_words
-        addl $16,%esp
-        ret
-
-.section .rodata, "a", @progbits
-
-ENTRY(exception_table)
-        .long do_divide_error
-        .long do_debug
-        .long do_nmi
-        .long do_int3
-        .long do_overflow
-        .long do_bounds
-        .long do_invalid_op
-        .long do_device_not_available
-        .long 0 # double fault
-        .long do_coprocessor_segment_overrun
-        .long do_invalid_TSS
-        .long do_segment_not_present
-        .long do_stack_segment
-        .long do_general_protection
-        .long do_page_fault
-        .long do_spurious_interrupt_bug
-        .long do_coprocessor_error
-        .long do_alignment_check
-        .long do_machine_check
-        .long do_simd_coprocessor_error
-
-ENTRY(hypercall_table)
-        .long do_set_trap_table     /*  0 */
-        .long do_mmu_update
-        .long do_set_gdt
-        .long do_stack_switch
-        .long do_set_callbacks
-        .long do_fpu_taskswitch     /*  5 */
-        .long do_sched_op_compat
-        .long do_platform_op
-        .long do_set_debugreg
-        .long do_get_debugreg
-        .long do_update_descriptor  /* 10 */
-        .long do_ni_hypercall
-        .long do_memory_op
-        .long do_multicall
-        .long do_update_va_mapping
-        .long do_set_timer_op       /* 15 */
-        .long do_event_channel_op_compat
-        .long do_xen_version
-        .long do_console_io
-        .long do_physdev_op_compat
-        .long do_grant_table_op     /* 20 */
-        .long do_vm_assist
-        .long do_update_va_mapping_otherdomain
-        .long do_iret
-        .long do_vcpu_op
-        .long do_ni_hypercall       /* 25 */
-        .long do_mmuext_op
-        .long do_xsm_op
-        .long do_nmi_op
-        .long do_sched_op
-        .long do_callback_op        /* 30 */
-        .long do_xenoprof_op
-        .long do_event_channel_op
-        .long do_physdev_op
-        .long do_hvm_op
-        .long do_sysctl             /* 35 */
-        .long do_domctl
-        .long do_kexec_op
-        .long do_tmem_op
-        .rept __HYPERVISOR_arch_0-((.-hypercall_table)/4)
-        .long do_ni_hypercall
-        .endr
-        .long do_mca                /* 48 */
-        .rept NR_hypercalls-((.-hypercall_table)/4)
-        .long do_ni_hypercall
-        .endr
-
-ENTRY(hypercall_args_table)
-        .byte 1 /* do_set_trap_table    */  /*  0 */
-        .byte 4 /* do_mmu_update        */
-        .byte 2 /* do_set_gdt           */
-        .byte 2 /* do_stack_switch      */
-        .byte 4 /* do_set_callbacks     */
-        .byte 1 /* do_fpu_taskswitch    */  /*  5 */
-        .byte 2 /* do_sched_op_compat   */
-        .byte 1 /* do_platform_op       */
-        .byte 2 /* do_set_debugreg      */
-        .byte 1 /* do_get_debugreg      */
-        .byte 4 /* do_update_descriptor */  /* 10 */
-        .byte 0 /* do_ni_hypercall      */
-        .byte 2 /* do_memory_op         */
-        .byte 2 /* do_multicall         */
-        .byte 4 /* do_update_va_mapping */
-        .byte 2 /* do_set_timer_op      */  /* 15 */
-        .byte 1 /* do_event_channel_op_compat */
-        .byte 2 /* do_xen_version       */
-        .byte 3 /* do_console_io        */
-        .byte 1 /* do_physdev_op_compat */
-        .byte 3 /* do_grant_table_op    */  /* 20 */
-        .byte 2 /* do_vm_assist         */
-        .byte 5 /* do_update_va_mapping_otherdomain */
-        .byte 0 /* do_iret              */
-        .byte 3 /* do_vcpu_op           */
-        .byte 0 /* do_ni_hypercall      */  /* 25 */
-        .byte 4 /* do_mmuext_op         */
-        .byte 1 /* do_xsm_op            */
-        .byte 2 /* do_nmi_op            */
-        .byte 2 /* do_sched_op          */
-        .byte 2 /* do_callback_op       */  /* 30 */
-        .byte 2 /* do_xenoprof_op       */
-        .byte 2 /* do_event_channel_op  */
-        .byte 2 /* do_physdev_op        */
-        .byte 2 /* do_hvm_op            */
-        .byte 1 /* do_sysctl            */  /* 35 */
-        .byte 1 /* do_domctl            */
-        .byte 2 /* do_kexec_op          */
-        .byte 1 /* do_tmem_op           */
-        .rept __HYPERVISOR_arch_0-(.-hypercall_args_table)
-        .byte 0 /* do_ni_hypercall      */
-        .endr
-        .byte 1 /* do_mca               */  /* 48 */
-        .rept NR_hypercalls-(.-hypercall_args_table)
-        .byte 0 /* do_ni_hypercall      */
-        .endr
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/x86_32/gdbstub.c
--- a/xen/arch/x86/x86_32/gdbstub.c	Wed Sep 12 13:24:28 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-/*
- * x86-specific gdb stub routines
- * based on x86 cdb(xen/arch/x86/cdb.c), but Extensively modified.
- * 
- * Copyright (C) 2006 Isaku Yamahata <yamahata at valinux co jp>
- *                    VA Linux Systems Japan. K.K.
- *
- * 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 <asm/debugger.h>
-
-void 
-gdb_arch_read_reg_array(struct cpu_user_regs *regs, struct gdb_context *ctx)
-{
-#define GDB_REG(r) gdb_write_to_packet_hex(r, sizeof(r), ctx);
-    GDB_REG(regs->eax);
-    GDB_REG(regs->ecx);
-    GDB_REG(regs->edx);
-    GDB_REG(regs->ebx);
-    GDB_REG(regs->esp);
-    GDB_REG(regs->ebp);
-    GDB_REG(regs->esi);
-    GDB_REG(regs->edi);
-    GDB_REG(regs->eip);
-    GDB_REG(regs->eflags);
-#undef GDB_REG
-#define GDB_SEG_REG(s)  gdb_write_to_packet_hex(s, sizeof(u32), ctx);
-    /* sizeof(segment) = 16bit */
-    /* but gdb requires its return value as 32bit value */
-    GDB_SEG_REG(regs->cs);
-    GDB_SEG_REG(regs->ss);
-    GDB_SEG_REG(regs->ds);
-    GDB_SEG_REG(regs->es);
-    GDB_SEG_REG(regs->fs);
-    GDB_SEG_REG(regs->gs);
-#undef GDB_SEG_REG
-    gdb_send_packet(ctx);
-}
-
-void
-gdb_arch_write_reg_array(struct cpu_user_regs *regs, const char* buf,
-                         struct gdb_context *ctx)
-{
-    /* XXX TODO */
-    gdb_send_reply("E02", ctx);
-}
-
-void
-gdb_arch_read_reg(unsigned long regnum, struct cpu_user_regs *regs,
-                  struct gdb_context *ctx)
-{
-    gdb_send_reply("", ctx);
-}
-
-void
-gdb_arch_write_reg(unsigned long regnum, unsigned long val, 
-                    struct cpu_user_regs *regs, struct gdb_context *ctx)
-{
-    gdb_send_reply("", ctx);
-}
-
-/*
- * Local variables:
- * mode: C
- * c-set-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * End:
- */
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/x86_32/gpr_switch.S
--- a/xen/arch/x86/x86_32/gpr_switch.S	Wed Sep 12 13:24:28 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * GPR context switch between host and guest.
- * Used by IO-port-access emulation stub.
- *
- * Copyright (c) 2006, Novell, Inc.
- */
-
-#include <xen/config.h>
-#include <asm/asm_defns.h>
-
-ENTRY(host_to_guest_gpr_switch)
-        movl  (%esp), %ecx
-        movl  %eax, (%esp)
-        movl  UREGS_edx(%eax), %edx
-        pushl %ebx
-        movl  UREGS_ebx(%eax), %ebx
-        pushl %ebp
-        movl  UREGS_ebp(%eax), %ebp
-        pushl %esi
-        movl  UREGS_esi(%eax), %esi
-        pushl %edi
-        movl  UREGS_edi(%eax), %edi
-        pushl $guest_to_host_gpr_switch
-        pushl %ecx
-        movl  UREGS_ecx(%eax), %ecx
-        movl  UREGS_eax(%eax), %eax
-        ret
-
-ENTRY(guest_to_host_gpr_switch)
-        pushl %edx
-        movl  5*4(%esp), %edx
-        movl  %eax, UREGS_eax(%edx)
-        popl  UREGS_edx(%edx)
-        movl  %edi, UREGS_edi(%edx)
-        popl  %edi
-        movl  %esi, UREGS_esi(%edx)
-        popl  %esi
-        movl  %ebp, UREGS_ebp(%edx)
-        popl  %ebp
-        movl  %ebx, UREGS_ebx(%edx)
-        popl  %ebx
-        movl  %ecx, UREGS_ecx(%edx)
-        popl  %ecx
-        ret
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/x86_32/machine_kexec.c
--- a/xen/arch/x86/x86_32/machine_kexec.c	Wed Sep 12 13:24:28 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-/******************************************************************************
- * machine_kexec.c
- *
- * Xen port written by:
- * - Simon 'Horms' Horman <horms@verge.net.au>
- * - Magnus Damm <magnus@valinux.co.jp>
- */
-
-#include <xen/types.h>
-#include <xen/kernel.h>
-#include <asm/page.h>
-#include <public/kexec.h>
-
-int machine_kexec_get_xen(xen_kexec_range_t *range)
-{
-        range->start = virt_to_maddr(_start);
-        range->size = (unsigned long)xenheap_phys_end -
-                      (unsigned long)range->start;
-        return 0;
-}
-
-/*
- * Local variables:
- * mode: C
- * c-set-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/x86_32/mm.c
--- a/xen/arch/x86/x86_32/mm.c	Wed Sep 12 13:24:28 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,379 +0,0 @@
-/******************************************************************************
- * arch/x86/x86_32/mm.c
- * 
- * Modifications to Linux original are copyright (c) 2004, K A Fraser
- * 
- * 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/config.h>
-#include <xen/lib.h>
-#include <xen/init.h>
-#include <xen/mm.h>
-#include <xen/sched.h>
-#include <xen/guest_access.h>
-#include <asm/current.h>
-#include <asm/page.h>
-#include <asm/flushtlb.h>
-#include <asm/fixmap.h>
-#include <asm/setup.h>
-#include <public/memory.h>
-
-unsigned int __read_mostly PAGE_HYPERVISOR         = __PAGE_HYPERVISOR;
-unsigned int __read_mostly PAGE_HYPERVISOR_NOCACHE = __PAGE_HYPERVISOR_NOCACHE;
-
-static unsigned long __read_mostly mpt_size;
-
-void *alloc_xen_pagetable(void)
-{
-    unsigned long mfn;
-
-    if ( system_state != SYS_STATE_early_boot )
-    {
-        void *v = alloc_xenheap_page();
-
-        BUG_ON(!dom0 && !v);
-        return v;
-    }
-
-    mfn = xenheap_initial_phys_start >> PAGE_SHIFT;
-    xenheap_initial_phys_start += PAGE_SIZE;
-    return mfn_to_virt(mfn);
-}
-
-l2_pgentry_t *virt_to_xen_l2e(unsigned long v)
-{
-    return &idle_pg_table_l2[l2_linear_offset(v)];
-}
-
-void *do_page_walk(struct vcpu *v, unsigned long addr)
-{
-    return NULL;
-}
-
-void __init paging_init(void)
-{
-    unsigned long v;
-    struct page_info *pg;
-    unsigned int i, n;
-
-    if ( cpu_has_pge )
-    {
-        /* Suitable Xen mapping can be GLOBAL. */
-        set_in_cr4(X86_CR4_PGE);
-        PAGE_HYPERVISOR         |= _PAGE_GLOBAL;
-        PAGE_HYPERVISOR_NOCACHE |= _PAGE_GLOBAL;
-        /* Transform early mappings (e.g., the frametable). */
-        for ( v = HYPERVISOR_VIRT_START; v; v += (1 << L2_PAGETABLE_SHIFT) )
-            if ( (l2e_get_flags(idle_pg_table_l2[l2_linear_offset(v)]) &
-                  (_PAGE_PSE|_PAGE_PRESENT)) == (_PAGE_PSE|_PAGE_PRESENT) )
-                l2e_add_flags(idle_pg_table_l2[l2_linear_offset(v)],
-                              _PAGE_GLOBAL);
-        for ( i = 0; i < L1_PAGETABLE_ENTRIES; i++ )
-            l1e_add_flags(l1_identmap[i], _PAGE_GLOBAL);
-    }
-
-    /*
-     * Allocate and map the machine-to-phys table and create read-only mapping 
-     * of MPT for guest-OS use.
-     */
-    mpt_size  = (max_page * BYTES_PER_LONG) + (1UL << L2_PAGETABLE_SHIFT) - 1;
-    mpt_size &= ~((1UL << L2_PAGETABLE_SHIFT) - 1UL);
-#define MFN(x) (((x) << L2_PAGETABLE_SHIFT) / sizeof(unsigned long))
-#define CNT ((sizeof(*frame_table) & -sizeof(*frame_table)) / \
-             sizeof(*machine_to_phys_mapping))
-    BUILD_BUG_ON((sizeof(*frame_table) & ~sizeof(*frame_table)) % \
-                 sizeof(*machine_to_phys_mapping));
-    for ( i = 0; i < (mpt_size >> L2_PAGETABLE_SHIFT); i++ )
-    {
-        for ( n = 0; n < CNT; ++n)
-            if ( mfn_valid(MFN(i) + n * PDX_GROUP_COUNT) )
-                break;
-        if ( n == CNT )
-            continue;
-        if ( (pg = alloc_domheap_pages(NULL, PAGETABLE_ORDER, 0)) == NULL )
-            panic("Not enough memory to bootstrap Xen.\n");
-        l2e_write(&idle_pg_table_l2[l2_linear_offset(RDWR_MPT_VIRT_START) + i],
-                  l2e_from_page(pg, PAGE_HYPERVISOR | _PAGE_PSE));
-        /* NB. Cannot be GLOBAL as shadow_mode_translate reuses this area. */
-        l2e_write(&idle_pg_table_l2[l2_linear_offset(RO_MPT_VIRT_START) + i],
-                  l2e_from_page(
-                      pg, (__PAGE_HYPERVISOR | _PAGE_PSE) & ~_PAGE_RW));
-        /* Fill with INVALID_M2P_ENTRY. */
-        memset((void *)(RDWR_MPT_VIRT_START + (i << L2_PAGETABLE_SHIFT)), 0xFF,
-               1UL << L2_PAGETABLE_SHIFT);
-    }
-#undef CNT
-#undef MFN
-
-    machine_to_phys_mapping_valid = 1;
-
-    /* Create page tables for ioremap()/map_domain_page_global(). */
-    for ( i = 0; i < (IOREMAP_MBYTES >> (L2_PAGETABLE_SHIFT - 20)); i++ )
-    {
-        void *p;
-        l2_pgentry_t *pl2e;
-        pl2e = &idle_pg_table_l2[l2_linear_offset(IOREMAP_VIRT_START) + i];
-        if ( l2e_get_flags(*pl2e) & _PAGE_PRESENT )
-            continue;
-        p = alloc_xenheap_page();
-        clear_page(p);
-        l2e_write(pl2e, l2e_from_page(virt_to_page(p), __PAGE_HYPERVISOR));
-    }
-}
-
-void __init setup_idle_pagetable(void)
-{
-    int i;
-
-    for ( i = 0; i < PDPT_L2_ENTRIES; i++ )
-        l2e_write(&idle_pg_table_l2[l2_linear_offset(PERDOMAIN_VIRT_START)+i],
-                  l2e_from_page(virt_to_page(idle_vcpu[0]->domain->
-                                             arch.mm_perdomain_pt) + i,
-                                __PAGE_HYPERVISOR));
-}
-
-void __init zap_low_mappings(l2_pgentry_t *dom0_l2)
-{
-    int i;
-
-    /* Clear temporary idle mappings from the dom0 initial l2. */
-    for ( i = 0; i < (HYPERVISOR_VIRT_START >> L2_PAGETABLE_SHIFT); i++ )
-        if ( l2e_get_intpte(dom0_l2[i]) ==
-             l2e_get_intpte(idle_pg_table_l2[i]) )
-            l2e_write(&dom0_l2[i], l2e_empty());
-
-    /* Now zap mappings in the idle pagetables. */
-    BUG_ON(l2e_get_pfn(idle_pg_table_l2[0]) != virt_to_mfn(l1_identmap));
-    l2e_write_atomic(&idle_pg_table_l2[0], l2e_empty());
-    destroy_xen_mappings(0, HYPERVISOR_VIRT_START);
-
-    flush_all(FLUSH_TLB_GLOBAL);
-
-    /* Replace with mapping of the boot trampoline only. */
-    map_pages_to_xen(trampoline_phys, trampoline_phys >> PAGE_SHIFT,
-                     PFN_UP(trampoline_end - trampoline_start),
-                     __PAGE_HYPERVISOR);
-}
-
-void __init subarch_init_memory(void)
-{
-    unsigned long m2p_start_mfn;
-    unsigned int i, j;
-    l2_pgentry_t l2e;
-
-    BUILD_BUG_ON(sizeof(struct page_info) != 24);
-
-    /* M2P table is mappable read-only by privileged domains. */
-    for ( i = 0; i < (mpt_size >> L2_PAGETABLE_SHIFT); i++ )
-    {
-        l2e = idle_pg_table_l2[l2_linear_offset(RDWR_MPT_VIRT_START) + i];
-        if ( !(l2e_get_flags(l2e) & _PAGE_PRESENT) )
-            continue;
-        m2p_start_mfn = l2e_get_pfn(l2e);
-        for ( j = 0; j < L2_PAGETABLE_ENTRIES; j++ )
-        {
-            struct page_info *page = mfn_to_page(m2p_start_mfn + j);
-            share_xen_page_with_privileged_guests(page, XENSHARE_readonly);
-        }
-    }
-
-    if ( supervisor_mode_kernel )
-    {
-        /* Guest kernel runs in ring 0, not ring 1. */
-        struct desc_struct *d;
-        d = &boot_cpu_gdt_table[(FLAT_RING1_CS >> 3) - FIRST_RESERVED_GDT_ENTRY];
-        d[0].b &= ~_SEGMENT_DPL;
-        d[1].b &= ~_SEGMENT_DPL;
-    }
-}
-
-long subarch_memory_op(int op, XEN_GUEST_HANDLE(void) arg)
-{
-    struct xen_machphys_mfn_list xmml;
-    unsigned long mfn, last_mfn;
-    unsigned int i, max;
-    l2_pgentry_t l2e;
-    long rc = 0;
-
-    switch ( op )
-    {
-    case XENMEM_machphys_mfn_list:
-        if ( copy_from_guest(&xmml, arg, 1) )
-            return -EFAULT;
-
-        max = min_t(unsigned int, xmml.max_extents, mpt_size >> 21);
-
-        for ( i = 0, last_mfn = 0; i < max; i++ )
-        {
-            l2e = idle_pg_table_l2[l2_linear_offset(
-                RDWR_MPT_VIRT_START + (i << 21))];
-            if ( l2e_get_flags(l2e) & _PAGE_PRESENT )
-                mfn = l2e_get_pfn(l2e);
-            else
-                mfn = last_mfn;
-            ASSERT(mfn);
-            if ( copy_to_guest_offset(xmml.extent_start, i, &mfn, 1) )
-                return -EFAULT;
-            last_mfn = mfn;
-        }
-
-        xmml.nr_extents = i;
-        if ( copy_to_guest(arg, &xmml, 1) )
-            return -EFAULT;
-
-        break;
-
-    default:
-        rc = -ENOSYS;
-        break;
-    }
-
-    return rc;
-}
-
-long do_stack_switch(unsigned long ss, unsigned long esp)
-{
-    struct tss_struct *t = &this_cpu(init_tss);
-
-    fixup_guest_stack_selector(current->domain, ss);
-
-    current->arch.pv_vcpu.kernel_ss = ss;
-    current->arch.pv_vcpu.kernel_sp = esp;
-    t->ss1  = ss;
-    t->esp1 = esp;
-
-    return 0;
-}
-
-/* Returns TRUE if given descriptor is valid for GDT or LDT. */
-int check_descriptor(const struct domain *dom, struct desc_struct *d)
-{
-    unsigned long base, limit;
-    u32 a = d->a, b = d->b;
-    u16 cs;
-
-    /* Let a ring0 guest kernel set any descriptor it wants to. */
-    if ( supervisor_mode_kernel )
-        return 1;
-
-    /* A not-present descriptor will always fault, so is safe. */
-    if ( !(b & _SEGMENT_P) ) 
-        goto good;
-
-    /*
-     * We don't allow a DPL of zero. There is no legitimate reason for 
-     * specifying DPL==0, and it gets rather dangerous if we also accept call 
-     * gates (consider a call gate pointing at another kernel descriptor with 
-     * DPL 0 -- this would get the OS ring-0 privileges).
-     */
-    if ( (b & _SEGMENT_DPL) < (GUEST_KERNEL_RPL(dom) << 13) )
-        d->b = b = (b & ~_SEGMENT_DPL) | (GUEST_KERNEL_RPL(dom) << 13);
-
-    if ( !(b & _SEGMENT_S) )
-    {
-        /*
-         * System segment:
-         *  1. Don't allow interrupt or trap gates as they belong in the IDT.
-         *  2. Don't allow TSS descriptors or task gates as we don't
-         *     virtualise x86 tasks.
-         *  3. Don't allow LDT descriptors because they're unnecessary and
-         *     I'm uneasy about allowing an LDT page to contain LDT
-         *     descriptors. In any case, Xen automatically creates the
-         *     required descriptor when reloading the LDT register.
-         *  4. We allow call gates but they must not jump to a private segment.
-         */
-
-        /* Disallow everything but call gates. */
-        if ( (b & _SEGMENT_TYPE) != 0xc00 )
-            goto bad;
-
-        /* Validate and fix up the target code selector. */
-        cs = a >> 16;
-        fixup_guest_code_selector(dom, cs);
-        if ( !guest_gate_selector_okay(dom, cs) )
-            goto bad;
-        a = d->a = (d->a & 0xffffU) | (cs << 16);
-
-        /* Reserved bits must be zero. */
-        if ( (b & 0xe0) != 0 )
-            goto bad;
-        
-        /* No base/limit check is needed for a call gate. */
-        goto good;
-    }
-    
-    /* Check that base is at least a page away from Xen-private area. */
-    base  = (b&(0xff<<24)) | ((b&0xff)<<16) | (a>>16);
-    if ( base >= (GUEST_SEGMENT_MAX_ADDR - PAGE_SIZE) )
-        goto bad;
-
-    /* Check and truncate the limit if necessary. */
-    limit = (b&0xf0000) | (a&0xffff);
-    limit++; /* We add one because limit is inclusive. */
-    if ( (b & _SEGMENT_G) )
-        limit <<= 12;
-
-    if ( (b & (_SEGMENT_CODE | _SEGMENT_EC)) == _SEGMENT_EC )
-    {
-        /*
-         * DATA, GROWS-DOWN.
-         * Grows-down limit check. 
-         * NB. limit == 0xFFFFF provides no access      (if G=1).
-         *     limit == 0x00000 provides 4GB-4kB access (if G=1).
-         */
-        if ( (base + limit) > base )
-        {
-            limit = -(base & PAGE_MASK);
-            goto truncate;
-        }
-    }
-    else
-    {
-        /*
-         * DATA, GROWS-UP. 
-         * CODE (CONFORMING AND NON-CONFORMING).
-         * Grows-up limit check.
-         * NB. limit == 0xFFFFF provides 4GB access (if G=1).
-         *     limit == 0x00000 provides 4kB access (if G=1).
-         */
-        if ( ((base + limit) <= base) || 
-             ((base + limit) > GUEST_SEGMENT_MAX_ADDR) )
-        {
-            limit = GUEST_SEGMENT_MAX_ADDR - base;
-        truncate:
-            if ( !(b & _SEGMENT_G) )
-                goto bad; /* too dangerous; too hard to work out... */
-            limit = (limit >> 12) - 1;
-            d->a &= ~0x0ffff; d->a |= limit & 0x0ffff;
-            d->b &= ~0xf0000; d->b |= limit & 0xf0000;
-        }
-    }
-
- good:
-    return 1;
- bad:
-    return 0;
-}
-
-/*
- * Local variables:
- * mode: C
- * c-set-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/x86_32/pci.c
--- a/xen/arch/x86/x86_32/pci.c	Wed Sep 12 13:24:28 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/******************************************************************************
- * pci.c
- * 
- * Architecture-dependent PCI access functions.
- */
-
-#include <xen/spinlock.h>
-#include <xen/pci.h>
-#include <xen/init.h>
-#include <asm/io.h>
-
-#define PCI_CONF_ADDRESS(bus, dev, func, reg) \
-    (0x80000000 | (bus << 16) | (dev << 11) | (func << 8) | (reg & ~3))
-
-uint8_t pci_conf_read8(
-    unsigned int seg, unsigned int bus, unsigned int dev, unsigned int func,
-    unsigned int reg)
-{
-    if ( seg || (reg > 255) )
-        return ~0;
-    BUG_ON((bus > 255) || (dev > 31) || (func > 7));
-    return pci_conf_read(PCI_CONF_ADDRESS(bus, dev, func, reg), reg & 3, 1);
-}
-
-uint16_t pci_conf_read16(
-    unsigned int seg, unsigned int bus, unsigned int dev, unsigned int func,
-    unsigned int reg)
-{
-    if ( seg || (reg > 255) )
-        return ~0;
-    BUG_ON((bus > 255) || (dev > 31) || (func > 7));
-    return pci_conf_read(PCI_CONF_ADDRESS(bus, dev, func, reg), reg & 2, 2);
-}
-
-uint32_t pci_conf_read32(
-    unsigned int seg, unsigned int bus, unsigned int dev, unsigned int func,
-    unsigned int reg)
-{
-    if ( seg || (reg > 255) )
-        return ~0;
-    BUG_ON((bus > 255) || (dev > 31) || (func > 7));
-    return pci_conf_read(PCI_CONF_ADDRESS(bus, dev, func, reg), 0, 4);
-}
-
-void pci_conf_write8(
-    unsigned int seg, unsigned int bus, unsigned int dev, unsigned int func,
-    unsigned int reg, uint8_t data)
-{
-    if ( seg )
-        return;
-    BUG_ON((bus > 255) || (dev > 31) || (func > 7) || (reg > 255));
-    pci_conf_write(PCI_CONF_ADDRESS(bus, dev, func, reg), reg & 3, 1, data);
-}
-
-void pci_conf_write16(
-    unsigned int seg, unsigned int bus, unsigned int dev, unsigned int func,
-    unsigned int reg, uint16_t data)
-{
-    if ( seg )
-        return;
-    BUG_ON((bus > 255) || (dev > 31) || (func > 7) || (reg > 255));
-    pci_conf_write(PCI_CONF_ADDRESS(bus, dev, func, reg), reg & 2, 2, data);
-}
-
-void pci_conf_write32(
-    unsigned int seg, unsigned int bus, unsigned int dev, unsigned int func,
-    unsigned int reg, uint32_t data)
-{
-    if ( seg )
-        return;
-    BUG_ON((bus > 255) || (dev > 31) || (func > 7) || (reg > 255));
-    pci_conf_write(PCI_CONF_ADDRESS(bus, dev, func, reg), 0, 4, data);
-}
-
-void __init arch_pci_ro_device(int seg, int bdf)
-{
-}
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/x86_32/seg_fixup.c
--- a/xen/arch/x86/x86_32/seg_fixup.c	Wed Sep 12 13:24:28 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,577 +0,0 @@
-/******************************************************************************
- * arch/x86/x86_32/seg_fixup.c
- * 
- * Support for -ve accesses to pseudo-4GB segments.
- * 
- * Copyright (c) 2004, K A Fraser
- * 
- * 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/config.h>
-#include <xen/init.h>
-#include <xen/sched.h>
-#include <xen/lib.h>
-#include <xen/errno.h>
-#include <xen/mm.h>
-#include <xen/perfc.h>
-#include <asm/current.h>
-#include <asm/processor.h>
-#include <asm/regs.h>
-#include <asm/x86_emulate.h>
-
-/* General instruction properties. */
-#define INSN_SUFFIX_BYTES (7)
-#define OPCODE_BYTE       (1<<4)  
-#define HAS_MODRM         (1<<5)
-
-/* Short forms for the table. */
-#define X  0 /* invalid for some random reason */
-#define O  OPCODE_BYTE
-#define M  HAS_MODRM
-
-static const u8 insn_decode[256] = {
-    /* 0x00 - 0x0F */
-    O|M, O|M, O|M, O|M, X, X, X, X,
-    O|M, O|M, O|M, O|M, X, X, X, X,
-    /* 0x10 - 0x1F */
-    O|M, O|M, O|M, O|M, X, X, X, X,
-    O|M, O|M, O|M, O|M, X, X, X, X,
-    /* 0x20 - 0x2F */
-    O|M, O|M, O|M, O|M, X, X, X, X,
-    O|M, O|M, O|M, O|M, X, X, X, X,
-    /* 0x30 - 0x3F */
-    O|M, O|M, O|M, O|M, X, X, X, X,
-    O|M, O|M, O|M, O|M, X, X, X, X,
-    /* 0x40 - 0x4F */
-    X, X, X, X, X, X, X, X,
-    X, X, X, X, X, X, X, X,
-    /* 0x50 - 0x5F */
-    X, X, X, X, X, X, X, X,
-    X, X, X, X, X, X, X, X,
-    /* 0x60 - 0x6F */
-    X, X, X, X, X, X, X, X,
-    X, O|M|4, X, O|M|1, X, X, X, X,
-    /* 0x70 - 0x7F */
-    X, X, X, X, X, X, X, X,
-    X, X, X, X, X, X, X, X,
-    /* 0x80 - 0x8F */
-    O|M|1, O|M|4, O|M|1, O|M|1, O|M, O|M, O|M, O|M,
-    O|M, O|M, O|M, O|M, O|M, X|M, O|M, O|M,
-    /* 0x90 - 0x9F */
-    X, X, X, X, X, X, X, X,
-    X, X, X, X, X, X, X, X,
-    /* 0xA0 - 0xAF */
-    O|4, O|4, O|4, O|4, X, X, X, X,
-    X, X, X, X, X, X, X, X,
-    /* 0xB0 - 0xBF */
-    X, X, X, X, X, X, X, X,
-    X, X, X, X, X, X, X, X,
-    /* 0xC0 - 0xCF */
-    O|M|1, O|M|1, X, X, X, X, O|M|1, O|M|4,
-    X, X, X, X, X, X, X, X,
-    /* 0xD0 - 0xDF */
-    O|M, O|M, O|M, O|M, X, X, X, X,
-    X, X, X, X, X, X, X, X,
-    /* 0xE0 - 0xEF */
-    X, X, X, X, X, X, X, X,
-    X, X, X, X, X, X, X, X,
-    /* 0xF0 - 0xFF */
-    X, X, X, X, X, X, O|M, O|M,
-    X, X, X, X, X, X, O|M, O|M
-};
-
-static const u8 float_decode[64] = {
-    O|M, O|M, O|M, O|M, O|M, O|M, O|M, O|M, /* 0xD8 */
-    O|M, X, O|M, O|M, O|M, O|M, O|M, O|M, /* 0xD9 */
-    O|M, O|M, O|M, O|M, O|M, O|M, O|M, O|M, /* 0xDA */
-    O|M, X, O|M, O|M, X, O|M, X, O|M, /* 0xDB */
-    O|M, O|M, O|M, O|M, O|M, O|M, O|M, O|M, /* 0xDC */
-    O|M, O|M, O|M, O|M, O|M, X, O|M, O|M, /* 0xDD */
-    O|M, O|M, O|M, O|M, O|M, O|M, O|M, O|M, /* 0xDE */
-    O|M, X, O|M, O|M, O|M, O|M, O|M, O|M, /* 0xDF */
-};
-
-static const u8 twobyte_decode[256] = {
-    /* 0x00 - 0x0F */
-    X, X, X, X, X, X, X, X,
-    X, X, X, X, X, X, X, X,
-    /* 0x10 - 0x1F */
-    X, X, X, X, X, X, X, X,
-    O|M, X, X, X, X, X, X, X,
-    /* 0x20 - 0x2F */
-    X, X, X, X, X, X, X, X,
-    X, X, X, X, X, X, X, X,
-    /* 0x30 - 0x3F */
-    X, X, X, X, X, X, X, X,
-    X, X, X, X, X, X, X, X,
-    /* 0x40 - 0x4F */
-    O|M, O|M, O|M, O|M, O|M, O|M, O|M, O|M,
-    O|M, O|M, O|M, O|M, O|M, O|M, O|M, O|M,
-    /* 0x50 - 0x5F */
-    X, X, X, X, X, X, X, X,
-    X, X, X, X, X, X, X, X,
-    /* 0x60 - 0x6F */
-    X, X, X, X, X, X, X, X,
-    X, X, X, X, X, X, X, X,
-    /* 0x70 - 0x7F */
-    X, X, X, X, X, X, X, X,
-    X, X, X, X, X, X, X, X,
-    /* 0x80 - 0x8F */
-    X, X, X, X, X, X, X, X,
-    X, X, X, X, X, X, X, X,
-    /* 0x90 - 0x9F */
-    O|M, O|M, O|M, O|M, O|M, O|M, O|M, O|M,
-    O|M, O|M, O|M, O|M, O|M, O|M, O|M, O|M,
-    /* 0xA0 - 0xAF */
-    X, X, X, O|M, O|M|1, O|M, O|M, X,
-    X, X, X, O|M, O|M|1, O|M, X, O|M,
-    /* 0xB0 - 0xBF */
-    X, X, X, O|M, X, X, O|M, O|M,
-    X, X, O|M|1, O|M, O|M, O|M, O|M, O|M,
-    /* 0xC0 - 0xCF */
-    O|M, O|M, X, O|M, X, X, X, O|M,
-    X, X, X, X, X, X, X, X,
-    /* 0xD0 - 0xDF */
-    X, X, X, X, X, X, X, X,
-    X, X, X, X, X, X, X, X,
-    /* 0xE0 - 0xEF */
-    X, X, X, X, X, X, X, X,
-    X, X, X, X, X, X, X, X,
-    /* 0xF0 - 0xFF */
-    X, X, X, X, X, X, X, X,
-    X, X, X, X, X, X, X, X
-};
-
-/*
- * Obtain the base and limit associated with the given segment selector.
- * The selector must identify a 32-bit code or data segment. Any segment that
- * appears to be truncated to not overlap with Xen is assumed to be a truncated
- * 4GB segment, and the returned limit reflects this.
- *  @seg   (IN) : Segment selector to decode.
- *  @base  (OUT): Decoded linear base address.
- *  @limit (OUT): Decoded segment limit, in bytes. 0 == unlimited (4GB).
- */
-static int get_baselimit(u16 seg, unsigned long *base, unsigned long *limit)
-{
-    struct vcpu *curr = current;
-    uint32_t    *table, a, b;
-    int          ldt = !!(seg & 4);
-    int          idx = (seg >> 3) & 8191;
-
-    /* Get base and check limit. */
-    if ( ldt )
-    {
-        table = (uint32_t *)LDT_VIRT_START(curr);
-        if ( idx >= curr->arch.pv_vcpu.ldt_ents )
-            goto fail;
-    }
-    else /* gdt */
-    {
-        table = (uint32_t *)GDT_VIRT_START(curr);
-        if ( idx >= curr->arch.pv_vcpu.gdt_ents )
-            goto fail;
-    }
-
-    /* Grab the segment descriptor. */
-    if ( __get_user(a, &table[2*idx+0]) ||
-         __get_user(b, &table[2*idx+1]) )
-        goto fail; /* Barking up the wrong tree. Decode needs a page fault.*/
-
-    /* We only parse 32-bit code and data segments. */
-    if ( (b & (_SEGMENT_P|_SEGMENT_S|_SEGMENT_DB)) != 
-         (_SEGMENT_P|_SEGMENT_S|_SEGMENT_DB) )
-        goto fail;
-
-    /* Decode base and limit. */
-    *base  = (b&(0xff<<24)) | ((b&0xff)<<16) | (a>>16);
-    *limit = ((b & 0xf0000) | (a & 0x0ffff)) + 1;
-    if ( (b & _SEGMENT_G) )
-        *limit <<= 12;
-
-    /*
-     * Anything that looks like a truncated segment we assume ought really
-     * to be a 4GB segment. DANGER!
-     */
-    if ( (GUEST_SEGMENT_MAX_ADDR - (*base + *limit)) < PAGE_SIZE )
-        *limit = 0;
-
-    return 1;
-
- fail:
-    return 0;
-}
-
-/* Turn a segment+offset into a linear address. */
-static int linearise_address(u16 seg, unsigned long off, unsigned long *linear)
-{
-    unsigned long base, limit;
-
-    if ( !get_baselimit(seg, &base, &limit) )
-        return 0;
-
-    if ( off > (limit-1) )
-        return 0;
-
-    *linear = base + off;
-
-    return 1;
-}
-
-static int fixup_seg(u16 seg, unsigned long offset)
-{
-    struct vcpu *curr = current;
-    uint32_t    *table, a, b, base, limit;
-    int          ldt = !!(seg & 4);
-    int          idx = (seg >> 3) & 8191;
-
-    /* Get base and check limit. */
-    if ( ldt )
-    {
-        table = (uint32_t *)LDT_VIRT_START(curr);
-        if ( idx >= curr->arch.pv_vcpu.ldt_ents )
-        {
-            dprintk(XENLOG_DEBUG, "Segment %04x out of LDT range (%u)\n",
-                    seg, curr->arch.pv_vcpu.ldt_ents);
-            goto fail;
-        }
-    }
-    else /* gdt */
-    {
-        table = (uint32_t *)GDT_VIRT_START(curr);
-        if ( idx >= curr->arch.pv_vcpu.gdt_ents )
-        {
-            dprintk(XENLOG_DEBUG, "Segment %04x out of GDT range (%u)\n",
-                    seg, curr->arch.pv_vcpu.gdt_ents);
-            goto fail;
-        }
-    }
-
-    /* Grab the segment descriptor. */
-    if ( __get_user(a, &table[2*idx+0]) ||
-         __get_user(b, &table[2*idx+1]) )
-    {
-        dprintk(XENLOG_DEBUG, "Fault while reading segment %04x\n", seg);
-        goto fail; /* Barking up the wrong tree. Decode needs a page fault.*/
-    }
-
-    /* We only parse 32-bit page-granularity non-privileged data segments. */
-    if ( (b & (_SEGMENT_P|_SEGMENT_S|_SEGMENT_DB|
-               _SEGMENT_G|_SEGMENT_CODE|_SEGMENT_DPL)) != 
-         (_SEGMENT_P|_SEGMENT_S|_SEGMENT_DB|_SEGMENT_G|_SEGMENT_DPL) )
-    {
-        dprintk(XENLOG_DEBUG, "Bad segment %08x:%08x\n", a, b);
-        goto fail;
-    }
-
-    /* Decode base and limit. */
-    base  = (b&(0xff<<24)) | ((b&0xff)<<16) | (a>>16);
-    limit = (((b & 0xf0000) | (a & 0x0ffff)) + 1) << 12;
-
-    if ( b & _SEGMENT_EC )
-    {
-        /* Expands-down: All the way to zero? Assume 4GB if so. */
-        if ( ((base + limit) < PAGE_SIZE) && (offset <= limit)  )
-        {
-            /* Flip to expands-up. */
-            limit = GUEST_SEGMENT_MAX_ADDR - base;
-            goto flip;
-        }
-    }
-    else
-    {
-        /* Expands-up: All the way to Xen space? Assume 4GB if so. */
-        if ( ((GUEST_SEGMENT_MAX_ADDR - (base + limit)) < PAGE_SIZE) &&
-             (offset > limit) )
-        {
-            /* Flip to expands-down. */
-            limit = -(base & PAGE_MASK);
-            goto flip;
-        }
-    }
-
-    dprintk(XENLOG_DEBUG, "None of the above! (%08x:%08x, %08x, %08x, %08x)\n",
-            a, b, base, limit, base+limit);
-
- fail:
-    return 0;
-
- flip:
-    limit = (limit >> 12) - 1;
-    a &= ~0x0ffff; a |= limit & 0x0ffff;
-    b &= ~0xf0000; b |= limit & 0xf0000;
-    b ^= _SEGMENT_EC; /* grows-up <-> grows-down */
-    /* NB. This can't fault. Checked readable above; must also be writable. */
-    write_atomic((uint64_t *)&table[2*idx], ((uint64_t)b<<32) | a);
-    return 1;
-}
-
-/*
- * Called from the general-protection fault handler to attempt to decode
- * and emulate an instruction that depends on 4GB segments.
- */
-int gpf_emulate_4gb(struct cpu_user_regs *regs)
-{
-    struct vcpu   *curr = current;
-    u8             modrm, mod, rm, decode;
-    const u32     *base, *index = NULL;
-    unsigned long  offset;
-    s8             disp8;
-    s32            disp32 = 0;
-    u8            *eip;         /* ptr to instruction start */
-    u8            *pb, b;       /* ptr into instr. / current instr. byte */
-    int            gs_override = 0, scale = 0, opcode = -1;
-    const u8      *table = insn_decode;
-
-    /* WARNING: We only work for ring-3 segments. */
-    if ( unlikely(vm86_mode(regs)) || unlikely(!ring_3(regs)) )
-        goto fail;
-
-    if ( !linearise_address((u16)regs->cs, regs->eip, (unsigned long *)&eip) )
-    {
-        dprintk(XENLOG_DEBUG, "Cannot linearise %04x:%08x\n",
-                regs->cs, regs->eip);
-        goto fail;
-    }
-
-    /* Parse prefix bytes. We're basically looking for segment override. */
-    for ( pb = eip; ; pb++ )
-    {
-        if ( get_user(b, pb) )
-        {
-            dprintk(XENLOG_DEBUG,
-                    "Fault while accessing byte %ld of instruction\n",
-                    (long)(pb-eip));
-            goto page_fault;
-        }
-
-        if ( (pb - eip) >= 15 )
-        {
-            dprintk(XENLOG_DEBUG, "Too many instruction prefixes for a "
-                    "legal instruction\n");
-            goto fail;
-        }
-
-        if ( opcode != -1 )
-        {
-            opcode = (opcode << 8) | b;
-            break;
-        }
-
-        switch ( b )
-        {
-        case 0x67: /* Address-size override */
-        case 0x2e: /* CS override */
-        case 0x3e: /* DS override */
-        case 0x26: /* ES override */
-        case 0x64: /* FS override */
-        case 0x36: /* SS override */
-            dprintk(XENLOG_DEBUG, "Unhandled prefix %02x\n", b);
-            goto fail;
-        case 0x66: /* Operand-size override */
-        case 0xf0: /* LOCK */
-        case 0xf2: /* REPNE/REPNZ */
-        case 0xf3: /* REP/REPE/REPZ */
-            break;
-        case 0x65: /* GS override */
-            gs_override = 1;
-            break;
-        case 0x0f: /* Not really a prefix byte */
-            table = twobyte_decode;
-            opcode = b;
-            break;
-        case 0xd8: /* Math coprocessor instructions.  */
-        case 0xd9:
-        case 0xda:
-        case 0xdb:
-        case 0xdc:
-        case 0xdd:
-        case 0xde:
-        case 0xdf:
-            /* Float opcodes have a secondary opcode in the modrm byte.  */
-            table = float_decode;
-            if ( get_user(modrm, pb + 1) )
-            {
-                dprintk(XENLOG_DEBUG, "Fault while extracting modrm byte\n");
-                goto page_fault;
-            }
-
-            opcode = (b << 8) | modrm;
-            b = ((b & 7) << 3) + ((modrm >> 3) & 7);
-            goto done_prefix;
-
-        default: /* Not a prefix byte */
-            goto done_prefix;
-        }
-    }
- done_prefix:
-
-    if ( !gs_override )
-    {
-        dprintk(XENLOG_DEBUG, "Only instructions with GS override\n");
-        goto fail;
-    }
-
-    decode = table[b];
-    pb++;
-
-    if ( !(decode & OPCODE_BYTE) )
-    {
-        if (opcode == -1)
-            dprintk(XENLOG_DEBUG, "Unsupported opcode %02x\n", b);
-        else
-            dprintk(XENLOG_DEBUG, "Unsupported opcode %02x %02x\n",
-                    opcode >> 8, opcode & 255);
-        goto fail;
-    }
-
-    if ( !(decode & HAS_MODRM) )
-    {
-        /* Must be a <disp32>, or bail. */
-        if ( (decode & INSN_SUFFIX_BYTES) != 4 )
-            goto fail;
-
-        if ( get_user(offset, (u32 *)pb) )
-        {
-            dprintk(XENLOG_DEBUG, "Fault while extracting <moffs32>.\n");
-            goto page_fault;
-        }
-        pb += 4;
-
-        goto skip_modrm;
-    }
-
-    /*
-     * Mod/RM processing.
-     */
-
-    if ( get_user(modrm, pb) )
-    {
-        dprintk(XENLOG_DEBUG, "Fault while extracting modrm byte\n");
-        goto page_fault;
-    }
-
-    pb++;
-
-    mod = (modrm >> 6) & 3;
-    rm  = (modrm >> 0) & 7;
-
-    if ( rm == 4 )
-    {
-        u8 sib;
-
-        if ( get_user(sib, pb) )
-        {
-            dprintk(XENLOG_DEBUG, "Fault while extracting sib byte\n");
-            goto page_fault;
-        }
-
-        pb++;
-
-        rm = sib & 7;
-        if ( (sib & 0x38) != 0x20 )
-            index = decode_register((sib >> 3) & 7, regs, 0);
-        scale = sib >> 6;
-    }
-
-    /* Decode R/M field. */
-    base = decode_register(rm, regs, 0);
-
-    /* Decode Mod field. */
-    switch ( mod )
-    {
-    case 0:
-        if ( rm == 5 ) /* disp32 rather than (EBP) */
-        {
-            base = NULL;
-            if ( get_user(disp32, (u32 *)pb) )
-            {
-                dprintk(XENLOG_DEBUG, "Fault while extracting <base32>.\n");
-                goto page_fault;
-            }
-            pb += 4;
-        }
-        break;
-
-    case 1:
-        if ( get_user(disp8, pb) )
-        {
-            dprintk(XENLOG_DEBUG, "Fault while extracting <disp8>.\n");
-            goto page_fault;
-        }
-        pb++;
-        disp32 = disp8;
-        break;
-
-    case 2:
-        if ( get_user(disp32, (u32 *)pb) )
-        {
-            dprintk(XENLOG_DEBUG, "Fault while extracting <disp32>.\n");
-            goto page_fault;
-        }
-        pb += 4;
-        break;
-
-    case 3:
-        dprintk(XENLOG_DEBUG, "Not a memory operand!\n");
-        goto fail;
-    }
-
-    offset = disp32;
-    if ( base != NULL )
-        offset += *base;
-    if ( index != NULL )
-        offset += *index << scale;
-
- skip_modrm:
-    if ( !fixup_seg((u16)regs->gs, offset) )
-        goto fail;
-
-    /* Success! */
-    perfc_incr(seg_fixups);
-
-    /* If requested, give a callback on otherwise unused vector 15. */
-    if ( VM_ASSIST(curr->domain, VMASST_TYPE_4gb_segments_notify) )
-    {
-        struct trap_info   *ti  = &curr->arch.pv_vcpu.trap_ctxt[15];
-        struct trap_bounce *tb  = &curr->arch.pv_vcpu.trap_bounce;
-
-        tb->flags      = TBF_EXCEPTION | TBF_EXCEPTION_ERRCODE;
-        tb->error_code = pb - eip;
-        tb->cs         = ti->cs;
-        tb->eip        = ti->address;
-        if ( TI_GET_IF(ti) )
-            tb->flags |= TBF_INTERRUPT;
-    }
-
-    return EXCRET_fault_fixed;
-
- fail:
-    return 0;
-
- page_fault:
-    propagate_page_fault((unsigned long)pb, 0); /* read fault */
-    return EXCRET_fault_fixed;
-}
-
-/*
- * Local variables:
- * mode: C
- * c-set-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/x86_32/supervisor_mode_kernel.S
--- a/xen/arch/x86/x86_32/supervisor_mode_kernel.S	Wed Sep 12 13:24:28 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,145 +0,0 @@
-/*
- * Handle stack fixup for guest running in RING 0.
- *
- * Copyright (c) 2006 Ian Campbell
- *
- * When a guest kernel is allowed to run in RING 0 a hypercall,
- * interrupt or exception interrupting the guest kernel will not cause
- * a privilege level change and therefore the stack will not be swapped
- * to the Xen stack.
- *
- * To fix this we look for RING 0 activation frames with a stack
- * pointer below HYPERVISOR_VIRT_START (indicating a guest kernel
- * frame) and fix this up by locating the Xen stack via the TSS
- * and moving the activation frame to the Xen stack. In the process we
- * convert the frame into an inter-privilege frame returning to RING 1
- * so that we can catch and reverse the process on exit.
- */
-
-#include <xen/config.h>
-#include <asm/asm_defns.h>
-#include <public/xen.h>
-
-#define guestreg(field) ((field)-UREGS_eip+36)
-
-        # Upon entry the stack should be the Xen stack and contain:
-        #   %ss, %esp, EFLAGS, %cs|1, %eip, RETURN
-        # On exit the stack should be %ss:%esp (i.e. the guest stack)
-        # and contain:
-        #   EFLAGS, %cs, %eip, RETURN
-        ALIGN
-ENTRY(restore_ring0_guest)
-        pusha
-
-        # Point %gs:%esi to guest stack.
-RRG0:   movw guestreg(UREGS_ss)(%esp),%gs
-        movl guestreg(UREGS_esp)(%esp),%esi
-
-        # Copy EFLAGS, %cs, %eip, RETURN, PUSHA from Xen stack to guest stack.
-        movl $12,%ecx /* 12 32-bit values */
-
-1:      subl $4,%esi
-        movl -4(%esp,%ecx,4),%eax
-RRG1:   movl %eax,%gs:(%esi)
-        loop 1b
-
-RRG2:   andl $~3,%gs:guestreg(UREGS_cs)(%esi)
-
-        movl %gs,%eax
-
-        # We need to do this because these registers are not present
-        # on the guest stack so they cannot be restored by the code in
-        # restore_all_guest.
-RRG3:   mov  guestreg(UREGS_ds)(%esp),%ds
-RRG4:   mov  guestreg(UREGS_es)(%esp),%es
-RRG5:   mov  guestreg(UREGS_fs)(%esp),%fs
-RRG6:   mov  guestreg(UREGS_gs)(%esp),%gs
-
-RRG7:   movl %eax,%ss
-        movl %esi,%esp
-
-        popa
-        ret
-.section __ex_table,"a"
-        .long RRG0,domain_crash_synchronous
-        .long RRG1,domain_crash_synchronous
-        .long RRG2,domain_crash_synchronous
-        .long RRG3,domain_crash_synchronous
-        .long RRG4,domain_crash_synchronous
-        .long RRG5,domain_crash_synchronous
-        .long RRG6,domain_crash_synchronous
-        .long RRG7,domain_crash_synchronous
-.previous
-
-        # Upon entry the stack should be a guest stack and contain:
-        #   EFLAGS, %cs, %eip, ERROR, RETURN
-        # On exit the stack should be the Xen stack and contain:
-        #   %ss, %esp, EFLAGS, %cs|1, %eip, ERROR, RETURN
-        ALIGN
-ENTRY(fixup_ring0_guest_stack)
-        pushl %eax
-        pushl %ecx
-        pushl %ds
-        pushl %gs
-        pushl %esi
-
-        movw  $__HYPERVISOR_DS,%ax
-        movw  %ax,%ds
-
-        # Point %gs:%esi to guest stack frame.
-        movw  %ss,%ax
-        movw  %ax,%gs
-        movl  %esp,%esi
-        # Account for entries on the guest stack:
-        # * Pushed by normal exception/interrupt/hypercall mechanisms
-        #   * EFLAGS, %cs, %eip, ERROR == 4 words.
-        # * Pushed by the fixup routine
-        #   * [RETURN], %eax, %ecx, %ds, %gs and %esi == 6 words.
-        addl $((6+4)*4),%esi
-
-        # %gs:%esi now points to the guest stack before the
-        # interrupt/exception occurred.
-
-        movl  $PER_CPU_GDT_ENTRY*8,%ecx
-        lsll  %ecx,%ecx
-        movl  __per_cpu_offset(,%ecx,4),%ecx
-        addl  $per_cpu__init_tss,%ecx
-
-        # Load Xen stack from TSS.
-        movw  TSS_ss0(%ecx),%ax
-TRP1:   movw  %ax,%ss
-        movl  TSS_esp0(%ecx),%esp
-
-        pushl %gs
-        pushl %esi
-
-        # Move EFLAGS, %cs, %eip, ERROR, RETURN, %eax, %ecx, %ds, %gs, %esi
-        # from guest stack to Xen stack.
-        movl  $10,%ecx
-1:      subl  $4,%esp
-        subl  $4,%esi
-TRP2:   movl  %gs:(%esi),%eax
-        movl  %eax,(%esp)
-        loop  1b
-
-        # CS = CS|1 to simulate RING1 stack frame.
-        orl   $1,32(%esp)
-
-        popl  %esi
-        popl  %gs
-        popl  %ds
-        popl  %ecx
-        popl  %eax
-        ret
-.section __ex_table,"a"
-        .long TRP1,domain_crash_synchronous
-        .long TRP2,domain_crash_synchronous
-.previous
-
-domain_crash_synchronous_string:
-        .asciz "domain_crash_sync called from supervisor_mode_kernel.S (%lx)\n"
-
-domain_crash_synchronous:
-        pushl $domain_crash_synchronous_string
-        call  printk
-        jmp   __domain_crash_synchronous
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/x86_32/traps.c
--- a/xen/arch/x86/x86_32/traps.c	Wed Sep 12 13:24:28 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,637 +0,0 @@
-
-#include <xen/config.h>
-#include <xen/version.h>
-#include <xen/domain_page.h>
-#include <xen/init.h>
-#include <xen/sched.h>
-#include <xen/lib.h>
-#include <xen/console.h>
-#include <xen/mm.h>
-#include <xen/irq.h>
-#include <xen/symbols.h>
-#include <xen/shutdown.h>
-#include <xen/nmi.h>
-#include <xen/cpu.h>
-#include <xen/guest_access.h>
-#include <asm/current.h>
-#include <asm/flushtlb.h>
-#include <asm/traps.h>
-#include <asm/hvm/hvm.h>
-#include <asm/hvm/support.h>
-
-#include <public/callback.h>
-
-static void print_xen_info(void)
-{
-    char taint_str[TAINT_STRING_MAX_LEN];
-    char debug = 'n', *arch = "x86_32p";
-
-#ifndef NDEBUG
-    debug = 'y';
-#endif
-
-    printk("----[ Xen-%d.%d%s  %s  debug=%c  %s ]----\n",
-           xen_major_version(), xen_minor_version(), xen_extra_version(),
-           arch, debug, print_tainted(taint_str));
-}
-
-enum context { CTXT_hypervisor, CTXT_pv_guest, CTXT_hvm_guest };
-
-static void _show_registers(
-    const struct cpu_user_regs *regs, unsigned long crs[8],
-    enum context context, const struct vcpu *v)
-{
-    const static char *context_names[] = {
-        [CTXT_hypervisor] = "hypervisor",
-        [CTXT_pv_guest]   = "pv guest",
-        [CTXT_hvm_guest]  = "hvm guest"
-    };
-
-    printk("EIP:    %04x:[<%08x>]", regs->cs, regs->eip);
-    if ( context == CTXT_hypervisor )
-        print_symbol(" %s", regs->eip);
-    printk("\nEFLAGS: %08x   ", regs->eflags);
-    if ( (context == CTXT_pv_guest) && v && v->vcpu_info )
-        printk("EM: %d   ", !!v->vcpu_info->evtchn_upcall_mask);
-    printk("CONTEXT: %s\n", context_names[context]);
-
-    printk("eax: %08x   ebx: %08x   ecx: %08x   edx: %08x\n",
-           regs->eax, regs->ebx, regs->ecx, regs->edx);
-    printk("esi: %08x   edi: %08x   ebp: %08x   esp: %08x\n",
-           regs->esi, regs->edi, regs->ebp, regs->esp);
-    printk("cr0: %08lx   cr4: %08lx   cr3: %08lx   cr2: %08lx\n",
-           crs[0], crs[4], crs[3], crs[2]);
-    printk("ds: %04x   es: %04x   fs: %04x   gs: %04x   "
-           "ss: %04x   cs: %04x\n",
-           regs->ds, regs->es, regs->fs,
-           regs->gs, regs->ss, regs->cs);
-}
-
-void show_registers(struct cpu_user_regs *regs)
-{
-    struct cpu_user_regs fault_regs = *regs;
-    unsigned long fault_crs[8];
-    enum context context;
-    struct vcpu *v = current;
-
-    if ( is_hvm_vcpu(v) && guest_mode(regs) )
-    {
-        struct segment_register sreg;
-        context = CTXT_hvm_guest;
-        fault_crs[0] = v->arch.hvm_vcpu.guest_cr[0];
-        fault_crs[2] = v->arch.hvm_vcpu.guest_cr[2];
-        fault_crs[3] = v->arch.hvm_vcpu.guest_cr[3];
-        fault_crs[4] = v->arch.hvm_vcpu.guest_cr[4];
-        hvm_get_segment_register(v, x86_seg_cs, &sreg);
-        fault_regs.cs = sreg.sel;
-        hvm_get_segment_register(v, x86_seg_ds, &sreg);
-        fault_regs.ds = sreg.sel;
-        hvm_get_segment_register(v, x86_seg_es, &sreg);
-        fault_regs.es = sreg.sel;
-        hvm_get_segment_register(v, x86_seg_fs, &sreg);
-        fault_regs.fs = sreg.sel;
-        hvm_get_segment_register(v, x86_seg_gs, &sreg);
-        fault_regs.gs = sreg.sel;
-        hvm_get_segment_register(v, x86_seg_ss, &sreg);
-        fault_regs.ss = sreg.sel;
-    }
-    else
-    {
-        if ( !guest_mode(regs) )
-        {
-            context = CTXT_hypervisor;
-            fault_regs.esp = (unsigned long)&regs->esp;
-            fault_regs.ss = read_segment_register(ss);
-            fault_regs.ds = read_segment_register(ds);
-            fault_regs.es = read_segment_register(es);
-            fault_regs.fs = read_segment_register(fs);
-            fault_regs.gs = read_segment_register(gs);
-            fault_crs[2] = read_cr2();
-        }
-        else
-        {
-            context = CTXT_pv_guest;
-            fault_crs[2] = v->vcpu_info->arch.cr2;
-        }
-
-        fault_crs[0] = read_cr0();
-        fault_crs[3] = read_cr3();
-        fault_crs[4] = read_cr4();
-    }
-
-    print_xen_info();
-    printk("CPU:    %d\n", smp_processor_id());
-    _show_registers(&fault_regs, fault_crs, context, v);
-
-    if ( this_cpu(ler_msr) && !guest_mode(regs) )
-    {
-        u32 from, to, hi;
-        rdmsr(this_cpu(ler_msr), from, hi);
-        rdmsr(this_cpu(ler_msr) + 1, to, hi);
-        printk("ler: %08x -> %08x\n", from, to);
-    }
-}
-
-void vcpu_show_registers(const struct vcpu *v)
-{
-    unsigned long crs[8];
-
-    /* No need to handle HVM for now. */
-    if ( is_hvm_vcpu(v) )
-        return;
-
-    crs[0] = v->arch.pv_vcpu.ctrlreg[0];
-    crs[2] = v->vcpu_info->arch.cr2;
-    crs[3] = pagetable_get_paddr(v->arch.guest_table);
-    crs[4] = v->arch.pv_vcpu.ctrlreg[4];
-
-    _show_registers(&v->arch.user_regs, crs, CTXT_pv_guest, v);
-}
-
-void show_page_walk(unsigned long addr)
-{
-    unsigned long pfn, mfn, cr3 = read_cr3();
-    l3_pgentry_t l3e, *l3t;
-    l2_pgentry_t l2e, *l2t;
-    l1_pgentry_t l1e, *l1t;
-
-    printk("Pagetable walk from %08lx:\n", addr);
-
-    mfn = cr3 >> PAGE_SHIFT;
-
-    l3t  = map_domain_page(mfn);
-    l3t += (cr3 & 0xFE0UL) >> 3;
-    l3e = l3t[l3_table_offset(addr)];
-    mfn = l3e_get_pfn(l3e);
-    pfn = mfn_valid(mfn) && machine_to_phys_mapping_valid ?
-          get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
-    printk(" L3[0x%03lx] = %"PRIpte" %08lx\n",
-           l3_table_offset(addr), l3e_get_intpte(l3e), pfn);
-    unmap_domain_page(l3t);
-    if ( !(l3e_get_flags(l3e) & _PAGE_PRESENT) ||
-         !mfn_valid(mfn) )
-        return;
-
-    l2t = map_domain_page(mfn);
-    l2e = l2t[l2_table_offset(addr)];
-    mfn = l2e_get_pfn(l2e);
-    pfn = mfn_valid(mfn) && machine_to_phys_mapping_valid ?
-          get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
-    printk(" L2[0x%03lx] = %"PRIpte" %08lx %s\n",
-           l2_table_offset(addr), l2e_get_intpte(l2e), pfn,
-           (l2e_get_flags(l2e) & _PAGE_PSE) ? "(PSE)" : "");
-    unmap_domain_page(l2t);
-    if ( !(l2e_get_flags(l2e) & _PAGE_PRESENT) ||
-         (l2e_get_flags(l2e) & _PAGE_PSE) ||
-         !mfn_valid(mfn) )
-        return;
-
-    l1t = map_domain_page(mfn);
-    l1e = l1t[l1_table_offset(addr)];
-    mfn = l1e_get_pfn(l1e);
-    pfn = mfn_valid(mfn) && machine_to_phys_mapping_valid ?
-          get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
-    printk(" L1[0x%03lx] = %"PRIpte" %08lx\n",
-           l1_table_offset(addr), l1e_get_intpte(l1e), pfn);
-    unmap_domain_page(l1t);
-}
-
-static DEFINE_PER_CPU_READ_MOSTLY(struct tss_struct *, doublefault_tss);
-static unsigned char __attribute__ ((__section__ (".bss.page_aligned")))
-    boot_cpu_doublefault_space[PAGE_SIZE];
-
-static int cpu_doublefault_tss_callback(
-    struct notifier_block *nfb, unsigned long action, void *hcpu)
-{
-    unsigned int cpu = (unsigned long)hcpu;
-    void *p;
-    int rc = 0;
-
-    switch ( action )
-    {
-    case CPU_UP_PREPARE:
-        per_cpu(doublefault_tss, cpu) = p = alloc_xenheap_page();
-        if ( p == NULL )
-            rc = -ENOMEM;
-        else
-            memset(p, 0, PAGE_SIZE);
-        break;
-    case CPU_UP_CANCELED:
-    case CPU_DEAD:
-        free_xenheap_page(per_cpu(doublefault_tss, cpu));
-        break;
-    default:
-        break;
-    }
-
-    return !rc ? NOTIFY_DONE : notifier_from_errno(rc);
-}
-
-static struct notifier_block cpu_doublefault_tss_nfb = {
-    .notifier_call = cpu_doublefault_tss_callback
-};
-
-void do_double_fault(void)
-{
-    struct tss_struct *tss;
-    unsigned int cpu;
-
-    watchdog_disable();
-
-    console_force_unlock();
-
-    asm ( "lsll %1, %0" : "=r" (cpu) : "rm" (PER_CPU_GDT_ENTRY << 3) );
-
-    /* Find information saved during fault and dump it to the console. */
-    tss = &per_cpu(init_tss, cpu);
-    printk("*** DOUBLE FAULT ***\n");
-    print_xen_info();
-    printk("CPU:    %d\nEIP:    %04x:[<%08x>]",
-           cpu, tss->cs, tss->eip);
-    print_symbol(" %s\n", tss->eip);
-    printk("EFLAGS: %08x\n", tss->eflags);
-    printk("CR3:    %08x\n", tss->__cr3);
-    printk("eax: %08x   ebx: %08x   ecx: %08x   edx: %08x\n",
-           tss->eax, tss->ebx, tss->ecx, tss->edx);
-    printk("esi: %08x   edi: %08x   ebp: %08x   esp: %08x\n",
-           tss->esi, tss->edi, tss->ebp, tss->esp);
-    printk("ds: %04x   es: %04x   fs: %04x   gs: %04x   ss: %04x\n",
-           tss->ds, tss->es, tss->fs, tss->gs, tss->ss);
-    show_stack_overflow(cpu, tss->esp);
-
-    panic("DOUBLE FAULT -- system shutdown\n");
-}
-
-unsigned long do_iret(void)
-{
-    struct cpu_user_regs *regs = guest_cpu_user_regs();
-    struct vcpu *v = current;
-    u32 eflags;
-
-    /* Check worst-case stack frame for overlap with Xen protected area. */
-    if ( unlikely(!access_ok(regs->esp, 40)) )
-        goto exit_and_crash;
-
-    /* Pop and restore EAX (clobbered by hypercall). */
-    if ( unlikely(__copy_from_user(&regs->eax, (void *)regs->esp, 4)) )
-        goto exit_and_crash;
-    regs->esp += 4;
-
-    /* Pop and restore CS and EIP. */
-    if ( unlikely(__copy_from_user(&regs->eip, (void *)regs->esp, 8)) )
-        goto exit_and_crash;
-    regs->esp += 8;
-
-    /*
-     * Pop, fix up and restore EFLAGS. We fix up in a local staging area
-     * to avoid firing the BUG_ON(IOPL) check in arch_get_info_guest.
-     */
-    if ( unlikely(__copy_from_user(&eflags, (void *)regs->esp, 4)) )
-        goto exit_and_crash;
-    regs->esp += 4;
-    regs->eflags = (eflags & ~X86_EFLAGS_IOPL) | X86_EFLAGS_IF;
-
-    if ( vm86_mode(regs) )
-    {
-        /* Return to VM86 mode: pop and restore ESP,SS,ES,DS,FS and GS. */
-        if ( __copy_from_user(&regs->esp, (void *)regs->esp, 24) )
-            goto exit_and_crash;
-    }
-    else if ( unlikely(ring_0(regs)) )
-    {
-        goto exit_and_crash;
-    }
-    else if ( !ring_1(regs) )
-    {
-        /* Return to ring 2/3: pop and restore ESP and SS. */
-        if ( __copy_from_user(&regs->esp, (void *)regs->esp, 8) )
-            goto exit_and_crash;
-    }
-
-    /* Restore upcall mask from supplied EFLAGS.IF. */
-    vcpu_info(v, evtchn_upcall_mask) = !(eflags & X86_EFLAGS_IF);
-
-    async_exception_cleanup(v);
-
-    /*
-     * The hypercall exit path will overwrite EAX with this return
-     * value.
-     */
-    return regs->eax;
-
- exit_and_crash:
-    gdprintk(XENLOG_ERR, "Fatal error\n");
-    domain_crash(v->domain);
-    return 0;
-}
-
-static void set_task_gate(unsigned int n, unsigned int sel)
-{
-    idt_table[n].b = 0;
-    wmb(); /* disable gate /then/ rewrite */
-    idt_table[n].a = sel << 16;
-    wmb(); /* rewrite /then/ enable gate */
-    idt_table[n].b = 0x8500;
-}
-
-void __devinit subarch_percpu_traps_init(void)
-{
-    struct tss_struct *tss;
-    int cpu = smp_processor_id();
-
-    if ( cpu == 0 )
-    {
-        /* The hypercall entry vector is only accessible from ring 1. */
-        _set_gate(idt_table+HYPERCALL_VECTOR, 14, 1, &hypercall);
-
-        this_cpu(doublefault_tss) = (void *)boot_cpu_doublefault_space;
-
-        register_cpu_notifier(&cpu_doublefault_tss_nfb);
-    }
-
-    tss = this_cpu(doublefault_tss);
-    BUG_ON(tss == NULL);
-
-    /*
-     * Make a separate task for double faults. This will get us debug output if
-     * we blow the kernel stack.
-     */
-    tss->ds     = __HYPERVISOR_DS;
-    tss->es     = __HYPERVISOR_DS;
-    tss->ss     = __HYPERVISOR_DS;
-    tss->esp    = (unsigned long)tss + PAGE_SIZE;
-    tss->__cr3  = __pa(idle_pg_table);
-    tss->cs     = __HYPERVISOR_CS;
-    tss->eip    = (unsigned long)do_double_fault;
-    tss->eflags = 2;
-    tss->bitmap = IOBMP_INVALID_OFFSET;
-    _set_tssldt_desc(
-        this_cpu(gdt_table) + DOUBLEFAULT_TSS_ENTRY - FIRST_RESERVED_GDT_ENTRY,
-        (unsigned long)tss, 235, 9);
-
-    set_task_gate(TRAP_double_fault, DOUBLEFAULT_TSS_ENTRY << 3);
-}
-
-void init_int80_direct_trap(struct vcpu *v)
-{
-    struct trap_info *ti = &v->arch.pv_vcpu.trap_ctxt[0x80];
-
-    /*
-     * We can't virtualise interrupt gates, as there's no way to get
-     * the CPU to automatically clear the events_mask variable. Also we
-     * must ensure that the CS is safe to poke into an interrupt gate.
-     *
-     * When running with supervisor_mode_kernel enabled a direct trap
-     * to the guest OS cannot be used because the INT instruction will
-     * switch to the Xen stack and we need to swap back to the guest
-     * kernel stack before passing control to the system call entry point.
-     */
-    if ( TI_GET_IF(ti) || !guest_gate_selector_okay(v->domain, ti->cs) ||
-         supervisor_mode_kernel )
-    {
-        v->arch.pv_vcpu.int80_desc.a = v->arch.pv_vcpu.int80_desc.b = 0;
-        return;
-    }
-
-    v->arch.pv_vcpu.int80_desc.a = (ti->cs << 16) | (ti->address & 0xffff);
-    v->arch.pv_vcpu.int80_desc.b =
-        (ti->address & 0xffff0000) | 0x8f00 | ((TI_GET_DPL(ti) & 3) << 13);
-
-    if ( v == current )
-        set_int80_direct_trap(v);
-}
-
-#ifdef CONFIG_X86_SUPERVISOR_MODE_KERNEL
-static void do_update_sysenter(void *info)
-{
-    xen_callback_t *address = info;
-
-    wrmsr(MSR_IA32_SYSENTER_CS, address->cs, 0);
-    wrmsr(MSR_IA32_SYSENTER_EIP, address->eip, 0);
-}
-#endif
-
-static long register_guest_callback(struct callback_register *reg)
-{
-    long ret = 0;
-    struct vcpu *v = current;
-
-    fixup_guest_code_selector(v->domain, reg->address.cs);
-
-    switch ( reg->type )
-    {
-    case CALLBACKTYPE_event:
-        v->arch.pv_vcpu.event_callback_cs     = reg->address.cs;
-        v->arch.pv_vcpu.event_callback_eip    = reg->address.eip;
-        break;
-
-    case CALLBACKTYPE_failsafe:
-        v->arch.pv_vcpu.failsafe_callback_cs  = reg->address.cs;
-        v->arch.pv_vcpu.failsafe_callback_eip = reg->address.eip;
-        if ( reg->flags & CALLBACKF_mask_events )
-            set_bit(_VGCF_failsafe_disables_events,
-                    &v->arch.vgc_flags);
-        else
-            clear_bit(_VGCF_failsafe_disables_events,
-                      &v->arch.vgc_flags);
-        break;
-
-#ifdef CONFIG_X86_SUPERVISOR_MODE_KERNEL
-    case CALLBACKTYPE_sysenter_deprecated:
-        if ( !cpu_has_sep )
-            ret = -EINVAL;
-        else
-            on_each_cpu(do_update_sysenter, &reg->address, 1);
-        break;
-
-    case CALLBACKTYPE_sysenter:
-        if ( !cpu_has_sep )
-            ret = -EINVAL;
-        else
-            do_update_sysenter(&reg->address);
-        break;
-#endif
-
-    case CALLBACKTYPE_nmi:
-        ret = register_guest_nmi_callback(reg->address.eip);
-        break;
-
-    default:
-        ret = -ENOSYS;
-        break;
-    }
-
-    return ret;
-}
-
-static long unregister_guest_callback(struct callback_unregister *unreg)
-{
-    long ret;
-
-    switch ( unreg->type )
-    {
-    case CALLBACKTYPE_event:
-    case CALLBACKTYPE_failsafe:
-#ifdef CONFIG_X86_SUPERVISOR_MODE_KERNEL
-    case CALLBACKTYPE_sysenter_deprecated:
-    case CALLBACKTYPE_sysenter:
-#endif
-        ret = -EINVAL;
-        break;
-
-    case CALLBACKTYPE_nmi:
-        ret = unregister_guest_nmi_callback();
-        break;
-
-    default:
-        ret = -ENOSYS;
-        break;
-    }
-
-    return ret;
-}
-
-
-long do_callback_op(int cmd, XEN_GUEST_HANDLE(const_void) arg)
-{
-    long ret;
-
-    switch ( cmd )
-    {
-    case CALLBACKOP_register:
-    {
-        struct callback_register reg;
-
-        ret = -EFAULT;
-        if ( copy_from_guest(&reg, arg, 1) )
-            break;
-
-        ret = register_guest_callback(&reg);
-    }
-    break;
-
-    case CALLBACKOP_unregister:
-    {
-        struct callback_unregister unreg;
-
-        ret = -EFAULT;
-        if ( copy_from_guest(&unreg, arg, 1) )
-            break;
-
-        ret = unregister_guest_callback(&unreg);
-    }
-    break;
-
-    default:
-        ret = -ENOSYS;
-        break;
-    }
-
-    return ret;
-}
-
-long do_set_callbacks(unsigned long event_selector,
-                      unsigned long event_address,
-                      unsigned long failsafe_selector,
-                      unsigned long failsafe_address)
-{
-    struct callback_register event = {
-        .type = CALLBACKTYPE_event,
-        .address = { event_selector, event_address },
-    };
-    struct callback_register failsafe = {
-        .type = CALLBACKTYPE_failsafe,
-        .address = { failsafe_selector, failsafe_address },
-    };
-
-    register_guest_callback(&event);
-    register_guest_callback(&failsafe);
-
-    return 0;
-}
-
-static void hypercall_page_initialise_ring0_kernel(void *hypercall_page)
-{
-    char *p;
-    int i;
-
-    /* Fill in all the transfer points with template machine code. */
-
-    for ( i = 0; i < (PAGE_SIZE / 32); i++ )
-    {
-        p = (char *)(hypercall_page + (i * 32));
-
-        *(u8  *)(p+ 0) = 0x9c;      /* pushf */
-        *(u8  *)(p+ 1) = 0xfa;      /* cli */
-        *(u8  *)(p+ 2) = 0xb8;      /* mov $<i>,%eax */
-        *(u32 *)(p+ 3) = i;
-        *(u8  *)(p+ 7) = 0x9a;      /* lcall $__HYPERVISOR_CS,&hypercall */
-        *(u32 *)(p+ 8) = (u32)&hypercall;
-        *(u16 *)(p+12) = (u16)__HYPERVISOR_CS;
-        *(u8  *)(p+14) = 0xc3;      /* ret */
-    }
-
-    /*
-     * HYPERVISOR_iret is special because it doesn't return and expects a
-     * special stack frame. Guests jump at this transfer point instead of
-     * calling it.
-     */
-    p = (char *)(hypercall_page + (__HYPERVISOR_iret * 32));
-    *(u8  *)(p+ 0) = 0x50;      /* push %eax */
-    *(u8  *)(p+ 1) = 0x9c;      /* pushf */
-    *(u8  *)(p+ 2) = 0xfa;      /* cli */
-    *(u8  *)(p+ 3) = 0xb8;      /* mov $<i>,%eax */
-    *(u32 *)(p+ 4) = __HYPERVISOR_iret;
-    *(u8  *)(p+ 8) = 0x9a;      /* lcall $__HYPERVISOR_CS,&hypercall */
-    *(u32 *)(p+ 9) = (u32)&hypercall;
-    *(u16 *)(p+13) = (u16)__HYPERVISOR_CS;
-}
-
-static void hypercall_page_initialise_ring1_kernel(void *hypercall_page)
-{
-    char *p;
-    int i;
-
-    /* Fill in all the transfer points with template machine code. */
-
-    for ( i = 0; i < (PAGE_SIZE / 32); i++ )
-    {
-        p = (char *)(hypercall_page + (i * 32));
-        *(u8  *)(p+ 0) = 0xb8;    /* mov  $<i>,%eax */
-        *(u32 *)(p+ 1) = i;
-        *(u16 *)(p+ 5) = (HYPERCALL_VECTOR << 8) | 0xcd; /* int  $xx */
-        *(u8  *)(p+ 7) = 0xc3;    /* ret */
-    }
-
-    /*
-     * HYPERVISOR_iret is special because it doesn't return and expects a 
-     * special stack frame. Guests jump at this transfer point instead of 
-     * calling it.
-     */
-    p = (char *)(hypercall_page + (__HYPERVISOR_iret * 32));
-    *(u8  *)(p+ 0) = 0x50;    /* push %eax */
-    *(u8  *)(p+ 1) = 0xb8;    /* mov  $__HYPERVISOR_iret,%eax */
-    *(u32 *)(p+ 2) = __HYPERVISOR_iret;
-    *(u16 *)(p+ 6) = (HYPERCALL_VECTOR << 8) | 0xcd; /* int  $xx */
-}
-
-void hypercall_page_initialise(struct domain *d, void *hypercall_page)
-{
-    memset(hypercall_page, 0xCC, PAGE_SIZE);
-    if ( is_hvm_domain(d) )
-        hvm_hypercall_page_initialise(d, hypercall_page);
-    else if ( supervisor_mode_kernel )
-        hypercall_page_initialise_ring0_kernel(hypercall_page);
-    else
-        hypercall_page_initialise_ring1_kernel(hypercall_page);
-}
-
-/*
- * Local variables:
- * mode: C
- * c-set-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/xen.lds.S
--- a/xen/arch/x86/xen.lds.S	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/xen.lds.S	Wed Sep 12 13:29:30 2012 +0100
@@ -18,11 +18,7 @@ ENTRY(efi_start)
 
 #else /* !EFI */
 
-#ifdef __x86_64__
 #define FORMAT "elf64-x86-64"
-#else
-#define FORMAT "elf32-i386"
-#endif
 
 ENTRY(start)
 
@@ -30,11 +26,7 @@ ENTRY(start)
 
 OUTPUT_FORMAT(FORMAT, FORMAT, FORMAT)
 
-#ifdef __x86_64__
 OUTPUT_ARCH(i386:x86-64)
-#else
-OUTPUT_ARCH(i386)
-#endif
 
 PHDRS
 {
@@ -42,7 +34,7 @@ PHDRS
 }
 SECTIONS
 {
-#if defined(__x86_64__) && !defined(EFI)
+#if !defined(EFI)
   . = __XEN_VIRT_START;
   __image_base__ = .;
 #endif
diff -r 05d82fb18335 -r bc8cb4778702 xen/common/Makefile
--- a/xen/common/Makefile	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/common/Makefile	Wed Sep 12 13:29:30 2012 +0100
@@ -56,7 +56,6 @@ obj-$(CONFIG_XENCOMM) += xencomm.o
 
 subdir-$(CONFIG_COMPAT) += compat
 
-subdir-$(x86_32) += hvm
 subdir-$(x86_64) += hvm
 
 subdir-y += libelf
diff -r 05d82fb18335 -r bc8cb4778702 xen/common/tmem.c
--- a/xen/common/tmem.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/common/tmem.c	Wed Sep 12 13:29:30 2012 +0100
@@ -50,7 +50,7 @@
 #define INVERT_SENTINEL(_x,_y) _x->sentinel = ~_y##_SENTINEL
 #define ASSERT_SENTINEL(_x,_y) \
     ASSERT(_x->sentinel != ~_y##_SENTINEL);ASSERT(_x->sentinel == _y##_SENTINEL)
-#if defined(__i386__) || defined(CONFIG_ARM)
+#if defined(CONFIG_ARM)
 #define POOL_SENTINEL 0x87658765
 #define OBJ_SENTINEL 0x12345678
 #define OBJNODE_SENTINEL 0xfedcba09
@@ -1233,11 +1233,7 @@ static client_t *client_create(cli_id_t 
         goto fail;
     }
     client->cli_id = cli_id;
-#ifdef __i386__
-    client->compress = 0;
-#else
     client->compress = tmh_compression_enabled();
-#endif
     client->shared_auth_required = tmh_shared_auth();
     for ( i = 0; i < MAX_GLOBAL_SHARED_POOLS; i++)
         client->shared_auth_uuid[i][0] =
@@ -1460,9 +1456,6 @@ static NOINLINE int do_tmem_put_compress
     ASSERT_SPINLOCK(&pgp->us.obj->obj_spinlock);
     ASSERT(pgp->us.obj->pool != NULL);
     ASSERT(pgp->us.obj->pool->client != NULL);
-#ifdef __i386__
-    return -ENOMEM;
-#endif
 
     if ( pgp->pfp != NULL )
         pgp_free_data(pgp, pgp->us.obj->pool);
@@ -2275,9 +2268,6 @@ static int tmemc_set_var_one(client_t *c
                         arg1, cli_id_str, cli_id);
         break;
     case TMEMC_SET_COMPRESS:
-#ifdef __i386__
-        return -1;
-#endif
         if ( tmh_dedup_enabled() )
         {
             tmh_client_warn("tmem: compression %s for all %ss, cannot be changed when tmem_dedup is enabled\n",
@@ -2892,9 +2882,6 @@ EXPORT void *tmem_relinquish_pages(unsig
 
     if (!tmh_enabled() || !tmh_freeable_pages())
         return NULL;
-#ifdef __i386__
-    return NULL;
-#endif
 
     relinq_attempts++;
     if ( order > 0 )
diff -r 05d82fb18335 -r bc8cb4778702 xen/common/tmem_xen.c
--- a/xen/common/tmem_xen.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/common/tmem_xen.c	Wed Sep 12 13:29:30 2012 +0100
@@ -348,7 +348,6 @@ EXPORT void tmh_scrub_page(struct page_i
         scrub_one_page(pi);
 }
 
-#ifndef __i386__
 static noinline void *tmh_mempool_page_get(unsigned long size)
 {
     struct page_info *pi;
@@ -398,7 +397,6 @@ static void tmh_persistent_pool_page_put
     ASSERT(IS_VALID_PAGE(pi));
     _tmh_free_page_thispool(pi);
 }
-#endif
 
 /******************  XEN-SPECIFIC CLIENT HANDLING ********************/
 
@@ -413,7 +411,6 @@ EXPORT tmh_client_t *tmh_client_init(cli
     for (i = 0, shift = 12; i < 4; shift -=4, i++)
         name[i] = (((unsigned short)cli_id >> shift) & 0xf) + '0';
     name[4] = '\0';
-#ifndef __i386__
     tmh->persistent_pool = xmem_pool_create(name, tmh_persistent_pool_page_get,
         tmh_persistent_pool_page_put, PAGE_SIZE, 0, PAGE_SIZE);
     if ( tmh->persistent_pool == NULL )
@@ -421,23 +418,18 @@ EXPORT tmh_client_t *tmh_client_init(cli
         xfree(tmh);
         return NULL;
     }
-#endif
     return tmh;
 }
 
 EXPORT void tmh_client_destroy(tmh_client_t *tmh)
 {
     ASSERT(tmh->domain->is_dying);
-#ifndef __i386__
     xmem_pool_destroy(tmh->persistent_pool);
-#endif
     tmh->domain = NULL;
 }
 
 /******************  XEN-SPECIFIC HOST INITIALIZATION ********************/
 
-#ifndef __i386__
-
 static int dstmem_order, workmem_order;
 
 static int cpu_callback(
@@ -517,12 +509,3 @@ EXPORT int __init tmh_init(void)
 
     return 1;
 }
-
-#else
-
-EXPORT int __init tmh_init(void)
-{
-    return 1;
-}
-
-#endif
diff -r 05d82fb18335 -r bc8cb4778702 xen/common/wait.c
--- a/xen/common/wait.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/common/wait.c	Wed Sep 12 13:29:30 2012 +0100
@@ -140,7 +140,6 @@ static void __prepare_to_wait(struct wai
     }
 
     asm volatile (
-#ifdef CONFIG_X86_64
         "push %%rax; push %%rbx; push %%rdx; "
         "push %%rbp; push %%r8; push %%r9; push %%r10; push %%r11; "
         "push %%r12; push %%r13; push %%r14; push %%r15; call 1f; "
@@ -151,15 +150,6 @@ static void __prepare_to_wait(struct wai
         "pop %%r15; pop %%r14; pop %%r13; pop %%r12; "
         "pop %%r11; pop %%r10; pop %%r9; pop %%r8; "
         "pop %%rbp; pop %%rdx; pop %%rbx; pop %%rax"
-#else
-        "push %%eax; push %%ebx; push %%edx; "
-        "push %%ebp; call 1f; "
-        "1: mov %%esp,%%esi; addl $2f-1b,(%%esp); "
-        "sub %%esi,%%ecx; cmp %3,%%ecx; jbe 2f; "
-        "xor %%esi,%%esi; jmp 3f; "
-        "2: rep movsb; mov %%esp,%%esi; 3: pop %%eax; "
-        "pop %%ebp; pop %%edx; pop %%ebx; pop %%eax"
-#endif
         : "=&S" (wqv->esp), "=&c" (dummy), "=&D" (dummy)
         : "i" (PAGE_SIZE), "1" (cpu_info), "2" (wqv->stack)
         : "memory" );
diff -r 05d82fb18335 -r bc8cb4778702 xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/drivers/passthrough/vtd/iommu.c	Wed Sep 12 13:29:30 2012 +0100
@@ -880,11 +880,9 @@ static int iommu_page_fault_do_one(struc
                 seg, (source_id >> 8), PCI_SLOT(source_id & 0xFF),
                 PCI_FUNC(source_id & 0xFF), addr, iommu->reg,
                 fault_reason, reason);
-#ifndef __i386__ /* map_domain_page() cannot be used in this context */
 	if (iommu_debug)
             print_vtd_entries(iommu, (source_id >> 8),
                           (source_id & 0xff), (addr >> PAGE_SHIFT));
-#endif
     }
     else
         INTEL_IOMMU_DEBUG(
diff -r 05d82fb18335 -r bc8cb4778702 xen/include/asm-x86/amd.h
--- a/xen/include/asm-x86/amd.h	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/include/asm-x86/amd.h	Wed Sep 12 13:29:30 2012 +0100
@@ -146,11 +146,9 @@
 struct cpuinfo_x86;
 int cpu_has_amd_erratum(const struct cpuinfo_x86 *, int, ...);
 
-#ifdef __x86_64__
 extern s8 opt_allow_unsafe;
 
 void fam10h_check_enable_mmcfg(void);
 void check_enable_amd_mmconf_dmi(void);
-#endif
 
 #endif /* __AMD_H__ */
diff -r 05d82fb18335 -r bc8cb4778702 xen/include/asm-x86/apicdef.h
--- a/xen/include/asm-x86/apicdef.h	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/include/asm-x86/apicdef.h	Wed Sep 12 13:29:30 2012 +0100
@@ -129,11 +129,7 @@
 /* It's only used in x2APIC mode of an x2APIC unit. */
 #define APIC_MSR_BASE 0x800
 
-#ifdef __i386__
- #define MAX_IO_APICS 64
-#else
- #define MAX_IO_APICS 128
-#endif
+#define MAX_IO_APICS 128
 
 /*
  * the local APIC register structure, memory mapped. Not terribly well
diff -r 05d82fb18335 -r bc8cb4778702 xen/include/asm-x86/asm_defns.h
--- a/xen/include/asm-x86/asm_defns.h	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/include/asm-x86/asm_defns.h	Wed Sep 12 13:29:30 2012 +0100
@@ -12,11 +12,7 @@
 void ret_from_intr(void);
 #endif
 
-#ifdef __x86_64__
 #include <asm/x86_64/asm_defns.h>
-#else
-#include <asm/x86_32/asm_defns.h>
-#endif
 
 /* Exception table entry */
 #ifdef __ASSEMBLY__
diff -r 05d82fb18335 -r bc8cb4778702 xen/include/asm-x86/atomic.h
--- a/xen/include/asm-x86/atomic.h	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/include/asm-x86/atomic.h	Wed Sep 12 13:29:30 2012 +0100
@@ -22,22 +22,8 @@ build_write_atomic(write_u8_atomic, "b",
 build_write_atomic(write_u16_atomic, "w", uint16_t, "r", )
 build_write_atomic(write_u32_atomic, "l", uint32_t, "r", )
 
-#ifdef __x86_64__
 build_read_atomic(read_u64_atomic, "q", uint64_t, "=r", )
 build_write_atomic(write_u64_atomic, "q", uint64_t, "r", )
-#else
-static inline uint64_t read_u64_atomic(const volatile uint64_t *addr)
-{
-    uint64_t *__addr = (uint64_t *)addr;
-    return __cmpxchg8b(__addr, 0, 0);
-}
-static inline void write_u64_atomic(volatile uint64_t *addr, uint64_t val)
-{
-    uint64_t old = *addr, new, *__addr = (uint64_t *)addr;
-    while ( (new = __cmpxchg8b(__addr, old, val)) != old )
-        old = new;
-}
-#endif
 
 #undef build_read_atomic
 #undef build_write_atomic
diff -r 05d82fb18335 -r bc8cb4778702 xen/include/asm-x86/bug.h
--- a/xen/include/asm-x86/bug.h	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/include/asm-x86/bug.h	Wed Sep 12 13:29:30 2012 +0100
@@ -1,11 +1,7 @@
 #ifndef __X86_BUG_H__
 #define __X86_BUG_H__
 
-#ifdef __x86_64__
 #include <asm/x86_64/bug.h>
-#else
-#include <asm/x86_32/bug.h>
-#endif
 
 struct bug_frame {
     unsigned char ud2[2];
diff -r 05d82fb18335 -r bc8cb4778702 xen/include/asm-x86/config.h
--- a/xen/include/asm-x86/config.h	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/include/asm-x86/config.h	Wed Sep 12 13:29:30 2012 +0100
@@ -7,13 +7,8 @@
 #ifndef __X86_CONFIG_H__
 #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 LONG_BYTEORDER 3
+#define CONFIG_PAGING_LEVELS 4
 
 #define BYTES_PER_LONG (1 << LONG_BYTEORDER)
 #define BITS_PER_LONG (BYTES_PER_LONG << 3)
@@ -56,17 +51,10 @@
 
 #ifdef MAX_PHYS_CPUS
 #define NR_CPUS MAX_PHYS_CPUS
-#elif defined __i386__
-#define NR_CPUS 128
 #else
 #define NR_CPUS 256
 #endif
 
-#ifdef __i386__
-/* Maximum number of virtual CPUs in multi-processor guests. */
-#define MAX_VIRT_CPUS XEN_LEGACY_MAX_VCPUS
-#endif
-
 /* Maximum we can support with current vLAPIC ID mapping. */
 #define MAX_HVM_VCPUS 128
 
@@ -94,11 +82,7 @@
 #define MEMORY_GUARD
 #endif
 
-#ifdef __i386__
-#define STACK_ORDER 2
-#else
 #define STACK_ORDER 3
-#endif
 #define STACK_SIZE  (PAGE_SIZE << STACK_ORDER)
 
 /* Primary stack is restricted to 8kB by guard pages. */
@@ -123,8 +107,6 @@ extern unsigned char boot_edid_info[128]
 
 #define asmlinkage
 
-#if defined(__x86_64__)
-
 #define CONFIG_X86_64 1
 #define CONFIG_COMPAT 1
 
@@ -286,86 +268,8 @@ extern unsigned char boot_edid_info[128]
 #define __OS          "q"  /* Operation Suffix */
 #define __OP          "r"  /* Operand Prefix */
 
-#elif defined(__i386__)
-
-#define CONFIG_X86_32      1
-#define CONFIG_DOMAIN_PAGE 1
-
-/*
- * Memory layout (high to low):                          PAE-SIZE
- *                                                       ------
- *  I/O remapping area                                   ( 4MB)
- *  Direct-map (1:1) area [Xen code/data/heap]           (12MB)
- *  Per-domain mappings (inc. 4MB map_domain_page cache) ( 8MB)
- *  Shadow linear pagetable                              ( 8MB)
- *  Guest linear pagetable                               ( 8MB)
- *  Machine-to-physical translation table [writable]     (16MB)
- *  Frame-info table                                     (96MB)
- *   * Start of guest inaccessible area
- *  Machine-to-physical translation table [read-only]    (16MB)
- *   * Start of guest unmodifiable area
- */
-
-#define IOREMAP_MBYTES           4
-#define DIRECTMAP_MBYTES        12
-#define MAPCACHE_MBYTES          4
-#define PERDOMAIN_MBYTES         8
-
-#define LINEARPT_MBYTES          8
-#define MACHPHYS_MBYTES         16 /* 1 MB needed per 1 GB memory */
-#define FRAMETABLE_MBYTES       (MACHPHYS_MBYTES * 6)
-
-#define IOREMAP_VIRT_END	_AC(0,UL)
-#define IOREMAP_VIRT_START	(IOREMAP_VIRT_END - (IOREMAP_MBYTES<<20))
-#define DIRECTMAP_VIRT_END	IOREMAP_VIRT_START
-#define DIRECTMAP_VIRT_START	(DIRECTMAP_VIRT_END - (DIRECTMAP_MBYTES<<20))
-#define MAPCACHE_VIRT_END	DIRECTMAP_VIRT_START
-#define MAPCACHE_VIRT_START	(MAPCACHE_VIRT_END - (MAPCACHE_MBYTES<<20))
-#define PERDOMAIN_VIRT_END	DIRECTMAP_VIRT_START
-#define PERDOMAIN_VIRT_START	(PERDOMAIN_VIRT_END - (PERDOMAIN_MBYTES<<20))
-#define SH_LINEAR_PT_VIRT_END	PERDOMAIN_VIRT_START
-#define SH_LINEAR_PT_VIRT_START	(SH_LINEAR_PT_VIRT_END - (LINEARPT_MBYTES<<20))
-#define LINEAR_PT_VIRT_END	SH_LINEAR_PT_VIRT_START
-#define LINEAR_PT_VIRT_START	(LINEAR_PT_VIRT_END - (LINEARPT_MBYTES<<20))
-#define RDWR_MPT_VIRT_END	LINEAR_PT_VIRT_START
-#define RDWR_MPT_VIRT_START	(RDWR_MPT_VIRT_END - (MACHPHYS_MBYTES<<20))
-#define FRAMETABLE_VIRT_END	RDWR_MPT_VIRT_START
-#define FRAMETABLE_SIZE         (FRAMETABLE_MBYTES<<20)
-#define FRAMETABLE_VIRT_START	(FRAMETABLE_VIRT_END - FRAMETABLE_SIZE)
-#define RO_MPT_VIRT_END		FRAMETABLE_VIRT_START
-#define RO_MPT_VIRT_START	(RO_MPT_VIRT_END - (MACHPHYS_MBYTES<<20))
-
-#define DIRECTMAP_PHYS_END	(DIRECTMAP_MBYTES<<20)
-
-/* Maximum linear address accessible via guest memory segments. */
-#define GUEST_SEGMENT_MAX_ADDR  RO_MPT_VIRT_END
-
-/* Hypervisor owns top 168MB of virtual address space. */
-#define HYPERVISOR_VIRT_START   mk_unsigned_long(0xF5800000)
-
-#define L2_PAGETABLE_FIRST_XEN_SLOT \
-    (HYPERVISOR_VIRT_START >> L2_PAGETABLE_SHIFT)
-#define L2_PAGETABLE_LAST_XEN_SLOT  \
-    (~0UL >> L2_PAGETABLE_SHIFT)
-#define L2_PAGETABLE_XEN_SLOTS \
-    (L2_PAGETABLE_LAST_XEN_SLOT - L2_PAGETABLE_FIRST_XEN_SLOT + 1)
-
-#define PGT_base_page_table     PGT_l3_page_table
-
-#define __HYPERVISOR_CS 0xe008
-#define __HYPERVISOR_DS 0xe010
-
-/* For generic assembly code: use macros to define operation/operand sizes. */
-#define __OS          "l"  /* Operation Suffix */
-#define __OP          "e"  /* Operand Prefix */
-
-#endif /* __i386__ */
-
 #ifndef __ASSEMBLY__
 extern unsigned long xen_phys_start;
-#if defined(__i386__)
-extern unsigned long xenheap_phys_end;
-#endif
 #endif
 
 /* GDT/LDT shadow mapping area. The first per-domain-mapping sub-area. */
@@ -391,11 +295,7 @@ extern unsigned long xenheap_phys_end;
 #define PDPT_L2_ENTRIES       \
     ((PDPT_L1_ENTRIES + (1 << PAGETABLE_ORDER) - 1) >> PAGETABLE_ORDER)
 
-#if defined(__x86_64__)
 #define ELFSIZE 64
-#else
-#define ELFSIZE 32
-#endif
 
 #define ARCH_CRASH_SAVE_VMCOREINFO
 
diff -r 05d82fb18335 -r bc8cb4778702 xen/include/asm-x86/cpufeature.h
--- a/xen/include/asm-x86/cpufeature.h	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/include/asm-x86/cpufeature.h	Wed Sep 12 13:29:30 2012 +0100
@@ -165,33 +165,6 @@
 #define CPUID5_ECX_EXTENSIONS_SUPPORTED 0x1
 #define CPUID5_ECX_INTERRUPT_BREAK      0x2
 
-#ifdef __i386__
-#define cpu_has_vme		boot_cpu_has(X86_FEATURE_VME)
-#define cpu_has_de		boot_cpu_has(X86_FEATURE_DE)
-#define cpu_has_pse		boot_cpu_has(X86_FEATURE_PSE)
-#define cpu_has_tsc		boot_cpu_has(X86_FEATURE_TSC)
-#define cpu_has_pge		boot_cpu_has(X86_FEATURE_PGE)
-#define cpu_has_pat		boot_cpu_has(X86_FEATURE_PAT)
-#define cpu_has_apic		boot_cpu_has(X86_FEATURE_APIC)
-#define cpu_has_sep		boot_cpu_has(X86_FEATURE_SEP)
-#define cpu_has_mtrr		boot_cpu_has(X86_FEATURE_MTRR)
-#define cpu_has_mmx		boot_cpu_has(X86_FEATURE_MMX)
-#define cpu_has_fxsr		boot_cpu_has(X86_FEATURE_FXSR)
-#define cpu_has_xmm		boot_cpu_has(X86_FEATURE_XMM)
-#define cpu_has_xmm2		boot_cpu_has(X86_FEATURE_XMM2)
-#define cpu_has_xmm3		boot_cpu_has(X86_FEATURE_XMM3)
-#define cpu_has_ht		boot_cpu_has(X86_FEATURE_HT)
-#define cpu_has_syscall		boot_cpu_has(X86_FEATURE_SYSCALL)
-#define cpu_has_mp		boot_cpu_has(X86_FEATURE_MP)
-#define cpu_has_nx		boot_cpu_has(X86_FEATURE_NX)
-#define cpu_has_k6_mtrr		boot_cpu_has(X86_FEATURE_K6_MTRR)
-#define cpu_has_cyrix_arr	boot_cpu_has(X86_FEATURE_CYRIX_ARR)
-#define cpu_has_centaur_mcr	boot_cpu_has(X86_FEATURE_CENTAUR_MCR)
-#define cpu_has_clflush		boot_cpu_has(X86_FEATURE_CLFLSH)
-#define cpu_has_page1gb		0
-#define cpu_has_efer		(boot_cpu_data.x86_capability[1] & 0x20100800)
-#define cpu_has_fsgsbase	0
-#else /* __x86_64__ */
 #define cpu_has_vme		0
 #define cpu_has_de		1
 #define cpu_has_pse		1
@@ -217,7 +190,6 @@
 #define cpu_has_page1gb		boot_cpu_has(X86_FEATURE_PAGE1GB)
 #define cpu_has_efer		1
 #define cpu_has_fsgsbase	boot_cpu_has(X86_FEATURE_FSGSBASE)
-#endif
 
 #define cpu_has_smep            boot_cpu_has(X86_FEATURE_SMEP)
 
diff -r 05d82fb18335 -r bc8cb4778702 xen/include/asm-x86/current.h
--- a/xen/include/asm-x86/current.h	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/include/asm-x86/current.h	Wed Sep 12 13:29:30 2012 +0100
@@ -19,9 +19,8 @@ struct cpu_info {
     unsigned int processor_id;
     struct vcpu *current_vcpu;
     unsigned long per_cpu_offset;
-#ifdef __x86_64__ /* get_stack_bottom() must be 16-byte aligned */
+    /* get_stack_bottom() must be 16-byte aligned */
     unsigned long __pad_for_stack_bottom;
-#endif
 };
 
 static inline struct cpu_info *get_cpu_info(void)
diff -r 05d82fb18335 -r bc8cb4778702 xen/include/asm-x86/desc.h
--- a/xen/include/asm-x86/desc.h	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/include/asm-x86/desc.h	Wed Sep 12 13:29:30 2012 +0100
@@ -18,8 +18,6 @@
 
 #define LDT_ENTRY_SIZE 8
 
-#if defined(__x86_64__)
-
 #define FLAT_COMPAT_RING1_CS 0xe019  /* GDT index 259 */
 #define FLAT_COMPAT_RING1_DS 0xe021  /* GDT index 260 */
 #define FLAT_COMPAT_RING1_SS 0xe021  /* GDT index 260 */
@@ -38,30 +36,9 @@
 #define LDT_ENTRY (TSS_ENTRY + 2)
 #define PER_CPU_GDT_ENTRY (LDT_ENTRY + 2)
 
-#elif defined(__i386__)
-
-#define FLAT_COMPAT_KERNEL_CS FLAT_KERNEL_CS
-#define FLAT_COMPAT_KERNEL_DS FLAT_KERNEL_DS
-#define FLAT_COMPAT_KERNEL_SS FLAT_KERNEL_SS
-#define FLAT_COMPAT_USER_CS   FLAT_USER_CS
-#define FLAT_COMPAT_USER_DS   FLAT_USER_DS
-#define FLAT_COMPAT_USER_SS   FLAT_USER_SS
-
-#define DOUBLEFAULT_TSS_ENTRY FIRST_RESERVED_GDT_ENTRY
-
-#define TSS_ENTRY (FIRST_RESERVED_GDT_ENTRY + 8)
-#define LDT_ENTRY (TSS_ENTRY + 1)
-#define PER_CPU_GDT_ENTRY (LDT_ENTRY + 1)
-
-#endif
-
 #ifndef __ASSEMBLY__
 
-#if defined(__x86_64__)
 #define GUEST_KERNEL_RPL(d) (is_pv_32bit_domain(d) ? 1 : 3)
-#elif defined(__i386__)
-#define GUEST_KERNEL_RPL(d) ((void)(d), 1)
-#endif
 
 /* Fix up the RPL of a guest segment selector. */
 #define __fixup_guest_selector(d, sel)                             \
@@ -115,11 +92,7 @@
 #define _SEGMENT_S       ( 1<<12) /* System descriptor (yes iff S==0) */
 #define _SEGMENT_DPL     ( 3<<13) /* Descriptor Privilege Level */
 #define _SEGMENT_P       ( 1<<15) /* Segment Present */
-#ifdef __x86_64__
 #define _SEGMENT_L       ( 1<<21) /* 64-bit segment */
-#else
-#define _SEGMENT_L       0
-#endif
 #define _SEGMENT_DB      ( 1<<22) /* 16- or 32-bit segment */
 #define _SEGMENT_G       ( 1<<23) /* Granularity */
 
@@ -129,8 +102,6 @@ struct desc_struct {
     u32 a, b;
 };
 
-#if defined(__x86_64__)
-
 typedef struct {
     u64 a, b;
 } idt_entry_t;
@@ -165,40 +136,6 @@ do {                                    
         (((u32)(addr) & 0x00FF0000U) >> 16);             \
 } while (0)
 
-#elif defined(__i386__)
-
-typedef struct desc_struct idt_entry_t;
-
-#define _set_gate(gate_addr,type,dpl,addr)               \
-do {                                                     \
-    (gate_addr)->b = 0;                                  \
-    wmb(); /* disable gate /then/ rewrite */             \
-    (gate_addr)->a =                                     \
-        ((unsigned long)(addr) & 0xFFFFUL) |             \
-        ((unsigned long)__HYPERVISOR_CS << 16);          \
-    wmb(); /* rewrite /then/ enable gate */              \
-    (gate_addr)->b =                                     \
-        ((unsigned long)(addr) & 0xFFFF0000UL) |         \
-        ((unsigned long)(dpl) << 13) |                   \
-        ((unsigned long)(type) << 8) |                   \
-        (1UL << 15);                                     \
-} while (0)
-
-#define _set_tssldt_desc(desc,addr,limit,type)           \
-do {                                                     \
-    (desc)->b = 0;                                       \
-    wmb(); /* disable entry /then/ rewrite */            \
-    (desc)->a =                                          \
-        ((u32)(addr) << 16) | ((u32)(limit) & 0xFFFF);   \
-    wmb(); /* rewrite /then/ enable entry */             \
-    (desc)->b =                                          \
-        ((u32)(addr) & 0xFF000000U) |                    \
-        ((u32)(type) << 8) | 0x8000U |                   \
-        (((u32)(addr) & 0x00FF0000U) >> 16);             \
-} while (0)
-
-#endif
-
 struct desc_ptr {
 	unsigned short limit;
 	unsigned long base;
diff -r 05d82fb18335 -r bc8cb4778702 xen/include/asm-x86/domain.h
--- a/xen/include/asm-x86/domain.h	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/include/asm-x86/domain.h	Wed Sep 12 13:29:30 2012 +0100
@@ -13,11 +13,7 @@
 #define has_32bit_shinfo(d)    ((d)->arch.has_32bit_shinfo)
 #define is_pv_32bit_domain(d)  ((d)->arch.is_32bit_pv)
 #define is_pv_32bit_vcpu(v)    (is_pv_32bit_domain((v)->domain))
-#ifdef __x86_64__
 #define is_pv_32on64_domain(d) (is_pv_32bit_domain(d))
-#else
-#define is_pv_32on64_domain(d) (0)
-#endif
 #define is_pv_32on64_vcpu(v)   (is_pv_32on64_domain((v)->domain))
 
 #define is_hvm_pv_evtchn_domain(d) (is_hvm_domain(d) && \
@@ -243,18 +239,11 @@ struct pv_domain
 
 struct arch_domain
 {
-#ifdef CONFIG_X86_64
     struct page_info **mm_perdomain_pt_pages;
     l2_pgentry_t *mm_perdomain_l2;
     l3_pgentry_t *mm_perdomain_l3;
 
     unsigned int hv_compat_vstart;
-#else
-    l1_pgentry_t *mm_perdomain_pt;
-
-    /* map_domain_page() mapping cache. */
-    struct mapcache_domain mapcache;
-#endif
 
     bool_t s3_integrity;
 
@@ -330,7 +319,6 @@ struct arch_domain
 #define has_arch_pdevs(d)    (!list_empty(&(d)->arch.pdev_list))
 #define has_arch_mmios(d)    (!rangeset_is_empty((d)->iomem_caps))
 
-#ifdef CONFIG_X86_64
 #define perdomain_pt_pgidx(v) \
       ((v)->vcpu_id >> (PAGETABLE_ORDER - GDT_LDT_VCPU_SHIFT))
 #define perdomain_ptes(d, v) \
@@ -338,32 +326,6 @@ struct arch_domain
       [perdomain_pt_pgidx(v)]) + (((v)->vcpu_id << GDT_LDT_VCPU_SHIFT) & \
                                   (L1_PAGETABLE_ENTRIES - 1)))
 #define perdomain_pt_page(d, n) ((d)->arch.mm_perdomain_pt_pages[n])
-#else
-#define perdomain_ptes(d, v) \
-    ((d)->arch.mm_perdomain_pt + ((v)->vcpu_id << GDT_LDT_VCPU_SHIFT))
-#define perdomain_pt_page(d, n) \
-    (virt_to_page((d)->arch.mm_perdomain_pt) + (n))
-#endif
-
-
-#ifdef __i386__
-struct pae_l3_cache {
-    /*
-     * Two low-memory (<4GB) PAE L3 tables, used as fallback when the guest
-     * supplies a >=4GB PAE L3 table. We need two because we cannot set up
-     * an L3 table while we are currently running on it (without using
-     * expensive atomic 64-bit operations).
-     */
-    l3_pgentry_t  table[2][4] __attribute__((__aligned__(32)));
-    unsigned long high_mfn;  /* The >=4GB MFN being shadowed. */
-    unsigned int  inuse_idx; /* Which of the two cache slots is in use? */
-    spinlock_t    lock;
-};
-#define pae_l3_cache_init(c) spin_lock_init(&(c)->lock)
-#else /* !defined(__i386__) */
-struct pae_l3_cache { };
-#define pae_l3_cache_init(c) ((void)0)
-#endif
 
 struct pv_vcpu
 {
@@ -379,9 +341,7 @@ struct pv_vcpu
     unsigned long event_callback_eip;
     unsigned long failsafe_callback_eip;
     union {
-#ifdef CONFIG_X86_64
         unsigned long syscall_callback_eip;
-#endif
         struct {
             unsigned int event_callback_cs;
             unsigned int failsafe_callback_cs;
@@ -390,7 +350,6 @@ struct pv_vcpu
 
     unsigned long vm_assist;
 
-#ifdef CONFIG_X86_64
     unsigned long syscall32_callback_eip;
     unsigned long sysenter_callback_eip;
     unsigned short syscall32_callback_cs;
@@ -402,15 +361,10 @@ struct pv_vcpu
     unsigned long fs_base;
     unsigned long gs_base_kernel;
     unsigned long gs_base_user;
-#endif
 
     /* Bounce information for propagating an exception to guest OS. */
     struct trap_bounce trap_bounce;
-#ifdef CONFIG_X86_64
     struct trap_bounce int80_bounce;
-#else
-    struct desc_struct int80_desc;


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

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:55:59 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:55:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTZ1-0004Ee-D6; Fri, 14 Sep 2012 10:55:59 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYy-00049o-6d
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:57 +0000
Received: from [85.158.143.35:41482] by server-2.bemta-4.messagelabs.com id
	40/EE-21239-B3D03505; Fri, 14 Sep 2012 10:55:55 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-21.messagelabs.com!1347620132!15772755!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32203 invoked from network); 14 Sep 2012 10:55:34 -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;
	14 Sep 2012 10: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 1TCTYa-00015P-Kc
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYa-0000oC-G0
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:32 +0000
Message-Id: <E1TCTYa-0000oC-G0@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:31 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: Remove x86_32 build target.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============2863405308373449842=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============2863405308373449842==
Content-Type: text/plain

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347452970 -3600
# Node ID bc8cb47787025aaa987a5a01719d014d8ede8665
# Parent  05d82fb18335ecf4abf5ab9483d2f9929e478a54
xen: Remove x86_32 build target.

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r 05d82fb18335 -r bc8cb4778702 xen/Makefile
--- a/xen/Makefile	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/Makefile	Wed Sep 12 13:29:30 2012 +0100
@@ -22,7 +22,11 @@ dist: install
 
 .PHONY: build install uninstall clean distclean cscope TAGS tags MAP gtags
 build install uninstall debug clean distclean cscope TAGS tags MAP gtags::
+ifneq ($(XEN_TARGET_ARCH),x86_32)
 	$(MAKE) -f Rules.mk _$@
+else
+	echo "*** Xen x86/32 target no longer supported!"
+endif
 
 .PHONY: _build
 _build: $(TARGET).gz
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/Makefile
--- a/xen/arch/x86/Makefile	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/Makefile	Wed Sep 12 13:29:30 2012 +0100
@@ -5,7 +5,6 @@ subdir-y += hvm
 subdir-y += mm
 subdir-y += oprofile
 
-subdir-$(x86_32) += x86_32
 subdir-$(x86_64) += x86_64
 
 obj-y += apic.o
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/Rules.mk
--- a/xen/arch/x86/Rules.mk	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/Rules.mk	Wed Sep 12 13:29:30 2012 +0100
@@ -41,22 +41,15 @@ CFLAGS += -DCONFIG_X86_SUPERVISOR_MODE_K
 endif
 
 x86 := y
+x86_32 := n
+x86_64 := y
 
-ifeq ($(TARGET_SUBARCH),x86_32)
-x86_32 := y
-x86_64 := n
-endif
-
-ifeq ($(TARGET_SUBARCH),x86_64)
 CFLAGS += -mno-red-zone -mno-sse -fpic
 CFLAGS += -fno-asynchronous-unwind-tables
 # -fvisibility=hidden reduces -fpic cost, if it's available
 ifneq ($(call cc-option,$(CC),-fvisibility=hidden,n),n)
 CFLAGS += -DGCC_HAS_VISIBILITY_ATTRIBUTE
 endif
-x86_32 := n
-x86_64 := y
-endif
 
 # Require GCC v3.4+ (to avoid issues with alignment constraints in Xen headers)
 check-$(gcc) = $(call cc-ver-check,CC,0x030400,"Xen requires at least gcc-3.4")
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/acpi/boot.c
--- a/xen/arch/x86/acpi/boot.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/acpi/boot.c	Wed Sep 12 13:29:30 2012 +0100
@@ -583,183 +583,6 @@ static void __init acpi_process_madt(voi
 	return;
 }
 
-#ifdef __i386__
-
-static int __init disable_acpi_irq(struct dmi_system_id *d)
-{
-	if (!acpi_force) {
-		printk(KERN_NOTICE "%s detected: force use of acpi=noirq\n",
-		       d->ident);
-		acpi_noirq_set();
-	}
-	return 0;
-}
-
-static int __init dmi_disable_acpi(struct dmi_system_id *d)
-{
-	if (!acpi_force) {
-		printk(KERN_NOTICE "%s detected: acpi off\n", d->ident);
-		disable_acpi();
-	} else {
-		printk(KERN_NOTICE
-		       "Warning: DMI blacklist says broken, but acpi forced\n");
-	}
-	return 0;
-}
-
-/*
- * Limit ACPI to CPU enumeration for HT
- */
-static int __init force_acpi_ht(struct dmi_system_id *d)
-{
-	if (!acpi_force) {
-		printk(KERN_NOTICE "%s detected: force use of acpi=ht\n",
-		       d->ident);
-		disable_acpi();
-		acpi_ht = 1;
-	} else {
-		printk(KERN_NOTICE
-		       "Warning: acpi=force overrules DMI blacklist: acpi=ht\n");
-	}
-	return 0;
-}
-
-/*
- * If your system is blacklisted here, but you find that acpi=force
- * works for you, please contact acpi-devel@sourceforge.net
- */
-static struct dmi_system_id __initdata acpi_dmi_table[] = {
-	/*
-	 * Boxes that need ACPI disabled
-	 */
-	{
-	 .callback = dmi_disable_acpi,
-	 .ident = "IBM Thinkpad",
-	 .matches = {
-		     DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
-		     DMI_MATCH(DMI_BOARD_NAME, "2629H1G"),
-		     },
-	 },
-
-	/*
-	 * Boxes that need acpi=ht
-	 */
-	{
-	 .callback = force_acpi_ht,
-	 .ident = "FSC Primergy T850",
-	 .matches = {
-		     DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
-		     DMI_MATCH(DMI_PRODUCT_NAME, "PRIMERGY T850"),
-		     },
-	 },
-	{
-	 .callback = force_acpi_ht,
-	 .ident = "DELL GX240",
-	 .matches = {
-		     DMI_MATCH(DMI_BOARD_VENDOR, "Dell Computer Corporation"),
-		     DMI_MATCH(DMI_BOARD_NAME, "OptiPlex GX240"),
-		     },
-	 },
-	{
-	 .callback = force_acpi_ht,
-	 .ident = "HP VISUALIZE NT Workstation",
-	 .matches = {
-		     DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"),
-		     DMI_MATCH(DMI_PRODUCT_NAME, "HP VISUALIZE NT Workstation"),
-		     },
-	 },
-	{
-	 .callback = force_acpi_ht,
-	 .ident = "Compaq Workstation W8000",
-	 .matches = {
-		     DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
-		     DMI_MATCH(DMI_PRODUCT_NAME, "Workstation W8000"),
-		     },
-	 },
-	{
-	 .callback = force_acpi_ht,
-	 .ident = "ASUS P4B266",
-	 .matches = {
-		     DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
-		     DMI_MATCH(DMI_BOARD_NAME, "P4B266"),
-		     },
-	 },
-	{
-	 .callback = force_acpi_ht,
-	 .ident = "ASUS P2B-DS",
-	 .matches = {
-		     DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
-		     DMI_MATCH(DMI_BOARD_NAME, "P2B-DS"),
-		     },
-	 },
-	{
-	 .callback = force_acpi_ht,
-	 .ident = "ASUS CUR-DLS",
-	 .matches = {
-		     DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
-		     DMI_MATCH(DMI_BOARD_NAME, "CUR-DLS"),
-		     },
-	 },
-	{
-	 .callback = force_acpi_ht,
-	 .ident = "ABIT i440BX-W83977",
-	 .matches = {
-		     DMI_MATCH(DMI_BOARD_VENDOR, "ABIT <http://www.abit.com>"),
-		     DMI_MATCH(DMI_BOARD_NAME, "i440BX-W83977 (BP6)"),
-		     },
-	 },
-	{
-	 .callback = force_acpi_ht,
-	 .ident = "IBM Bladecenter",
-	 .matches = {
-		     DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
-		     DMI_MATCH(DMI_BOARD_NAME, "IBM eServer BladeCenter HS20"),
-		     },
-	 },
-	{
-	 .callback = force_acpi_ht,
-	 .ident = "IBM eServer xSeries 360",
-	 .matches = {
-		     DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
-		     DMI_MATCH(DMI_BOARD_NAME, "eServer xSeries 360"),
-		     },
-	 },
-	{
-	 .callback = force_acpi_ht,
-	 .ident = "IBM eserver xSeries 330",
-	 .matches = {
-		     DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
-		     DMI_MATCH(DMI_BOARD_NAME, "eserver xSeries 330"),
-		     },
-	 },
-	{
-	 .callback = force_acpi_ht,
-	 .ident = "IBM eserver xSeries 440",
-	 .matches = {
-		     DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
-		     DMI_MATCH(DMI_PRODUCT_NAME, "eserver xSeries 440"),
-		     },
-	 },
-
-	/*
-	 * Boxes that need ACPI PCI IRQ routing disabled
-	 */
-	{
-	 .callback = disable_acpi_irq,
-	 .ident = "ASUS A7V",
-	 .matches = {
-		     DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC"),
-		     DMI_MATCH(DMI_BOARD_NAME, "<A7V>"),
-		     /* newer BIOS, Revision 1011, does work */
-		     DMI_MATCH(DMI_BIOS_VERSION,
-			       "ASUS A7V ACPI BIOS Revision 1007"),
-		     },
-	 },
-	{}
-};
-
-#endif				/* __i386__ */
-
 /*
  * acpi_boot_table_init() and acpi_boot_init()
  *  called from setup_arch(), always.
@@ -785,10 +608,6 @@ int __init acpi_boot_table_init(void)
 {
 	int error;
 
-#ifdef __i386__
-	dmi_check_system(acpi_dmi_table);
-#endif
-
 	/*
 	 * If acpi_disabled, bail out
 	 * One exception: acpi=ht continues far enough to enumerate LAPICs
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/acpi/cpufreq/cpufreq.c
--- a/xen/arch/x86/acpi/cpufreq/cpufreq.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/acpi/cpufreq/cpufreq.c	Wed Sep 12 13:29:30 2012 +0100
@@ -311,35 +311,6 @@ unsigned int get_measured_perf(unsigned 
     saved->aperf.whole = readin.aperf.whole;
     saved->mperf.whole = readin.mperf.whole;
 
-#ifdef __i386__
-    /*
-     * We dont want to do 64 bit divide with 32 bit kernel
-     * Get an approximate value. Return failure in case we cannot get
-     * an approximate value.
-     */
-    if (unlikely(cur.aperf.split.hi || cur.mperf.split.hi)) {
-        int shift_count;
-        uint32_t h;
-
-        h = max_t(uint32_t, cur.aperf.split.hi, cur.mperf.split.hi);
-        shift_count = fls(h);
-
-        cur.aperf.whole >>= shift_count;
-        cur.mperf.whole >>= shift_count;
-    }
-
-    if (((unsigned long)(-1) / 100) < cur.aperf.split.lo) {
-        int shift_count = 7;
-        cur.aperf.split.lo >>= shift_count;
-        cur.mperf.split.lo >>= shift_count;
-    }
-
-    if (cur.aperf.split.lo && cur.mperf.split.lo)
-        perf_percent = (cur.aperf.split.lo * 100) / cur.mperf.split.lo;
-    else
-        perf_percent = 0;
-
-#else
     if (unlikely(((unsigned long)(-1) / 100) < cur.aperf.whole)) {
         int shift_count = 7;
         cur.aperf.whole >>= shift_count;
@@ -351,8 +322,6 @@ unsigned int get_measured_perf(unsigned 
     else
         perf_percent = 0;
 
-#endif
-
     retval = policy->cpuinfo.max_freq * perf_percent / 100;
 
     return retval;
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/acpi/suspend.c
--- a/xen/arch/x86/acpi/suspend.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/acpi/suspend.c	Wed Sep 12 13:29:30 2012 +0100
@@ -15,18 +15,15 @@
 #include <asm/i387.h>
 #include <xen/hypercall.h>
 
-#if defined(CONFIG_X86_64)
 static unsigned long saved_lstar, saved_cstar;
 static unsigned long saved_sysenter_esp, saved_sysenter_eip;
 static unsigned long saved_fs_base, saved_gs_base, saved_kernel_gs_base;
 static uint16_t saved_segs[4];
-#endif
 
 void save_rest_processor_state(void)
 {
     vcpu_save_fpu(current);
 
-#if defined(CONFIG_X86_64)
     asm volatile (
         "movw %%ds,(%0); movw %%es,2(%0); movw %%fs,4(%0); movw %%gs,6(%0)"
         : : "r" (saved_segs) : "memory" );
@@ -40,7 +37,6 @@ void save_rest_processor_state(void)
         rdmsrl(MSR_IA32_SYSENTER_ESP, saved_sysenter_esp);
         rdmsrl(MSR_IA32_SYSENTER_EIP, saved_sysenter_eip);
     }
-#endif
 }
 
 
@@ -50,7 +46,6 @@ void restore_rest_processor_state(void)
 
     load_TR();
 
-#if defined(CONFIG_X86_64)
     /* Recover syscall MSRs */
     wrmsrl(MSR_LSTAR, saved_lstar);
     wrmsrl(MSR_CSTAR, saved_cstar);
@@ -80,11 +75,6 @@ void restore_rest_processor_state(void)
         do_set_segment_base(SEGBASE_GS_USER_SEL, saved_segs[3]);
     }
 
-#else /* !defined(CONFIG_X86_64) */
-    if ( supervisor_mode_kernel && cpu_has_sep )
-        wrmsr(MSR_IA32_SYSENTER_ESP, &this_cpu(init_tss).esp1, 0);
-#endif
-
     /* Maybe load the debug registers. */
     BUG_ON(is_hvm_vcpu(curr));
     if ( !is_idle_vcpu(curr) && curr->arch.debugreg[7] )
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/acpi/wakeup_prot.S
--- a/xen/arch/x86/acpi/wakeup_prot.S	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/acpi/wakeup_prot.S	Wed Sep 12 13:29:30 2012 +0100
@@ -8,8 +8,6 @@
 #include <asm/page.h>
 #include <asm/msr.h>
 
-#if defined(__x86_64__)
-
         .code64
 
 #define GREG(x)         %r##x
@@ -20,20 +18,6 @@
 
 #define REF(x)          x(%rip)
 
-#else /* !defined(__x86_64__) */
-
-        .code32
-
-#define GREG(x)         %e##x
-#define SAVED_GREG(x)   saved_e##x
-#define DECLARE_GREG(x) saved_e##x:     .long   0
-#define SAVE_GREG(x)    movl GREG(x), SAVED_GREG(x)
-#define LOAD_GREG(x)    movl SAVED_GREG(x), GREG(x)
-
-#define REF(x)          x
-
-#endif
-
 ENTRY(do_suspend_lowlevel)
 
         SAVE_GREG(sp)
@@ -45,8 +29,6 @@ ENTRY(do_suspend_lowlevel)
         SAVE_GREG(si)
         SAVE_GREG(di)
 
-#if defined(__x86_64__)
-
         SAVE_GREG(8)     # save r8...r15
         SAVE_GREG(9)
         SAVE_GREG(10)
@@ -61,16 +43,6 @@ ENTRY(do_suspend_lowlevel)
         mov     %cr8, GREG(ax)
         mov     GREG(ax), REF(saved_cr8)
 
-#else /* !defined(__x86_64__) */
-
-        pushfl;
-        popl    SAVED_GREG(flags)
-
-        mov     %ds, REF(saved_ds)
-        mov     %es, REF(saved_es)
-
-#endif
-
         mov     %ss, REF(saved_ss)
 
         sgdt    REF(saved_gdt)
@@ -85,17 +57,9 @@ ENTRY(do_suspend_lowlevel)
 
         call    save_rest_processor_state
 
-#if defined(__x86_64__)
-
         mov     $3, %rdi
         xor     %eax, %eax
 
-#else /* !defined(__x86_64__) */
-
-        push    $3
-
-#endif
-
         /* enter sleep state physically */
         call    acpi_enter_sleep_state
         jmp     __ret_point
@@ -121,7 +85,6 @@ __ret_point:
         mov     REF(saved_ss), %ss
         LOAD_GREG(sp)
 
-#if defined(__x86_64__)
         /* Reload code selector */
         pushq   $(__HYPERVISOR_CS64)
         leaq    1f(%rip),%rax
@@ -134,17 +97,6 @@ 1:
         pushq   SAVED_GREG(flags)
         popfq
 
-#else /* !defined(__x86_64__) */
-
-        pushl   SAVED_GREG(flags)
-        popfl
-
-        /* No reload to fs/gs, which is saved in bottom stack already */
-        mov     REF(saved_ds), %ds
-        mov     REF(saved_es), %es
-
-#endif
-
         call restore_rest_processor_state
 
         LOAD_GREG(bp)
@@ -154,7 +106,6 @@ 1:
         LOAD_GREG(dx)
         LOAD_GREG(si)
         LOAD_GREG(di)
-#if defined(__x86_64__)
         LOAD_GREG(8)     # save r8...r15
         LOAD_GREG(9)
         LOAD_GREG(10)
@@ -163,7 +114,6 @@ 1:
         LOAD_GREG(13)
         LOAD_GREG(14)
         LOAD_GREG(15)
-#endif
         ret 
 
 .data
@@ -184,8 +134,6 @@ DECLARE_GREG(si)
 DECLARE_GREG(di)
 DECLARE_GREG(flags)
 
-#if defined(__x86_64__)
-
 DECLARE_GREG(8)
 DECLARE_GREG(9)
 DECLARE_GREG(10)
@@ -202,17 +150,3 @@ saved_ldt:      .quad   0,0
 saved_cr0:      .quad   0
 saved_cr3:      .quad   0
 saved_cr8:      .quad   0
-
-#else /* !defined(__x86_64__) */
-
-saved_gdt:      .long   0,0
-saved_idt:      .long   0,0
-saved_ldt:      .long   0
-
-saved_cr0:      .long   0
-saved_cr3:      .long   0
-
-saved_ds:       .word   0
-saved_es:       .word   0
-
-#endif 
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/boot/head.S
--- a/xen/arch/x86/boot/head.S	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/boot/head.S	Wed Sep 12 13:29:30 2012 +0100
@@ -119,7 +119,6 @@ 1:
 1:      mov     %edx,sym_phys(cpuid_ext_features)
         mov     %edx,sym_phys(boot_cpu_data)+CPUINFO86_ext_features
 
-#if defined(__x86_64__)
         /* Check for availability of long mode. */
         bt      $29,%edx
         jnc     bad_cpu
@@ -138,7 +137,6 @@ 1:      mov     %eax,(%edx)
         mov     $sym_phys(l1_identmap)+__PAGE_HYPERVISOR,%edi
         mov     %edi,sym_phys(l2_xenmap)
         mov     %edi,sym_phys(l2_bootmap)
-#endif
 
         /* Apply relocations to bootstrap trampoline. */
         mov     sym_phys(trampoline_phys),%edx
@@ -191,11 +189,7 @@ trampoline_end:
 
         .text
 __high_start:
-#ifdef __x86_64__
 #include "x86_64.S"
-#else
-#include "x86_32.S"
-#endif
 
         .section .data.page_aligned, "aw", @progbits
         .p2align PAGE_SHIFT
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/boot/trampoline.S
--- a/xen/arch/x86/boot/trampoline.S	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/boot/trampoline.S	Wed Sep 12 13:29:30 2012 +0100
@@ -109,8 +109,6 @@ 1:      wrmsr
         jmp     1f
 1:
 
-#if defined(__x86_64__)
-
         /* Now in compatibility mode. Long-jump into 64-bit mode. */
         ljmp    $BOOT_CS64,$bootsym_rel(start64,6)
 
@@ -123,20 +121,6 @@ start64:
 high_start:
         .quad   __high_start
 
-#else /* !defined(__x86_64__) */
-
-        /* Install relocated selectors. */
-        lgdt    gdt_descr
-        mov     $(__HYPERVISOR_DS),%eax
-        mov     %eax,%ds
-        mov     %eax,%es
-        mov     %eax,%fs
-        mov     %eax,%gs
-        mov     %eax,%ss
-        ljmp    $(__HYPERVISOR_CS),$__high_start
-
-#endif
-
         .code32
 trampoline_boot_cpu_entry:
         cmpb    $0,bootsym_rel(skip_realmode,5)
@@ -169,7 +153,6 @@ 1:      mov     %cs,%ax
         lidt    bootsym(rm_idt)
         sti
 
-#if defined(__x86_64__)
         /*
          * Declare that our target operating mode is long mode.
          * Initialise 32-bit registers since some buggy BIOSes depend on it.
@@ -177,7 +160,6 @@ 1:      mov     %cs,%ax
         movl    $0xec00,%eax      # declare target operating mode
         movl    $0x0002,%ebx      # long mode
         int     $0x15
-#endif
 
         /*
          * Do real-mode work:
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/boot/wakeup.S
--- a/xen/arch/x86/boot/wakeup.S	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/boot/wakeup.S	Wed Sep 12 13:29:30 2012 +0100
@@ -161,8 +161,6 @@ 1:      wrmsr
         jmp     1f
 1:
 
-#if defined(__x86_64__)
-
         /* Now in compatibility mode. Long-jump to 64-bit mode */
         ljmp    $BOOT_CS64, $bootsym_rel(wakeup_64,6)
 
@@ -175,16 +173,6 @@ wakeup_64:
 ret_point:
         .quad   __ret_point
 
-#else /* !defined(__x86_64__) */
-
-        lgdt    gdt_descr
-        mov     $(__HYPERVISOR_DS), %eax
-        mov     %eax, %ds
-
-        ljmp    $(__HYPERVISOR_CS), $__ret_point
-
-#endif
-
 bogus_saved_magic:
         movw    $0x0e00 + 'S', 0xb8014
         jmp     bogus_saved_magic
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/boot/x86_32.S
--- a/xen/arch/x86/boot/x86_32.S	Wed Sep 12 13:24:28 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,131 +0,0 @@
-        .code32
-        
-        /* Enable full CR4 features. */
-        mov     mmu_cr4_features,%eax
-        mov     %eax,%cr4
-        
-        /* Initialise stack. */
-        mov     stack_start,%esp
-        or      $(STACK_SIZE-CPUINFO_sizeof),%esp
-        
-        /* Reset EFLAGS (subsumes CLI and CLD). */
-        pushl   $0
-        popf
-
-        lidt    idt_descr
-
-        test    %ebx,%ebx
-        jnz     start_secondary
-
-        /* Initialise IDT with simple error defaults. */
-        lea     ignore_int,%edx
-        mov     $(__HYPERVISOR_CS << 16),%eax
-        mov     %dx,%ax            /* selector = 0x0010 = cs */
-        mov     $0x8E00,%dx        /* interrupt gate - dpl=0, present */
-        lea     idt_table,%edi
-        mov     $256,%ecx
-1:      mov     %eax,(%edi)
-        mov     %edx,4(%edi)
-        add     $8,%edi
-        loop    1b
-                
-        /* Pass off the Multiboot info structure to C land. */
-        pushl   multiboot_ptr
-        call    __start_xen
-        ud2     /* Force a panic (invalid opcode). */
-
-/* This is the default interrupt handler. */
-int_msg:
-        .asciz "Unknown interrupt (cr2=%08x)\n"
-hex_msg:
-        .asciz "  %08x"
-        ALIGN
-ignore_int:
-        pusha
-        cld
-        mov     $(__HYPERVISOR_DS),%eax
-        mov     %eax,%ds
-        mov     %eax,%es
-        mov     %cr2,%eax
-        push    %eax
-        pushl   $int_msg
-        call    printk
-        add     $8,%esp
-        mov     %esp,%ebp
-0:      pushl   (%ebp)
-        add     $4,%ebp
-        pushl   $hex_msg
-        call    printk
-        add     $8,%esp
-        test    $0xffc,%ebp
-        jnz     0b
-1:      jmp     1b
-
-        .data
-        ALIGN
-ENTRY(stack_start)
-        .long cpu0_stack
-        
-/*** DESCRIPTOR TABLES ***/
-
-        ALIGN
-multiboot_ptr:
-        .long   0
-        
-        .word   0    
-idt_descr:
-        .word   256*8-1
-        .long   idt_table
-
-        .word   0
-gdt_descr:
-        .word   LAST_RESERVED_GDT_BYTE
-        .long   boot_cpu_gdt_table - FIRST_RESERVED_GDT_BYTE
-
-
-        .align 32
-ENTRY(idle_pg_table)
-        .long sym_phys(idle_pg_table_l2) + 0*PAGE_SIZE + 0x01, 0
-        .long sym_phys(idle_pg_table_l2) + 1*PAGE_SIZE + 0x01, 0
-        .long sym_phys(idle_pg_table_l2) + 2*PAGE_SIZE + 0x01, 0
-        .long sym_phys(idle_pg_table_l2) + 3*PAGE_SIZE + 0x01, 0
-
-        .section .data.page_aligned, "aw", @progbits
-        .align PAGE_SIZE, 0
-/* NB. Rings != 0 get access up to MACH2PHYS_VIRT_END. This allows access to */
-/*     the machine->physical mapping table. Ring 0 can access all memory.    */
-#define GUEST_DESC(d)                                                   \
-        .long ((MACH2PHYS_VIRT_END - 1) >> 12) & 0xffff,                \
-              ((MACH2PHYS_VIRT_END - 1) >> 12) & (0xf << 16) | (d)
-ENTRY(boot_cpu_gdt_table)
-        .quad 0x0000000000000000     /* double fault TSS */
-        .quad 0x00cf9a000000ffff     /* 0xe008 ring 0 4.00GB code at 0x0 */
-        .quad 0x00cf92000000ffff     /* 0xe010 ring 0 4.00GB data at 0x0 */
-        GUEST_DESC(0x00c0ba00)       /* 0xe019 ring 1 3.xxGB code at 0x0 */
-        GUEST_DESC(0x00c0b200)       /* 0xe021 ring 1 3.xxGB data at 0x0 */
-        GUEST_DESC(0x00c0fa00)       /* 0xe02b ring 3 3.xxGB code at 0x0 */
-        GUEST_DESC(0x00c0f200)       /* 0xe033 ring 3 3.xxGB data at 0x0 */
-        .fill (PER_CPU_GDT_ENTRY - FLAT_RING3_DS / 8 - 1), 8, 0
-        .quad 0x0000910000000000     /* per-CPU entry (limit == cpu) */
-        .align PAGE_SIZE,0
-
-#define PAGE_HYPERVISOR         __PAGE_HYPERVISOR
-#define PAGE_HYPERVISOR_NOCACHE __PAGE_HYPERVISOR_NOCACHE
-
-/* Mapping of first 16 megabytes of memory. */
-        .globl idle_pg_table_l2
-idle_pg_table_l2:
-        range = 8
-        .irp count, l2_linear_offset(__PAGE_OFFSET), \
-                    (4 * L2_PAGETABLE_ENTRIES - l2_linear_offset(__PAGE_OFFSET) - 1)
-        .long sym_phys(l1_identmap) + PAGE_HYPERVISOR, 0
-        pfn = 1 << PAGETABLE_ORDER
-        .rept range - 1
-        .long (pfn << PAGE_SHIFT) | PAGE_HYPERVISOR | _PAGE_PSE, 0
-        pfn = pfn + (1 << PAGETABLE_ORDER)
-        .endr
-        .fill \count - range, 8, 0
-        range = DIRECTMAP_MBYTES / 2
-        .endr
-        .long sym_phys(l1_fixmap) + PAGE_HYPERVISOR, 0
-        .size idle_pg_table_l2, . - idle_pg_table_l2
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/clear_page.S
--- a/xen/arch/x86/clear_page.S	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/clear_page.S	Wed Sep 12 13:29:30 2012 +0100
@@ -1,16 +1,9 @@
 #include <xen/config.h>
 #include <asm/page.h>
 
-#ifdef __i386__
-#define ptr_reg %edx
-#else
 #define ptr_reg %rdi
-#endif
 
 ENTRY(clear_page_sse2)
-#ifdef __i386__
-        mov     4(%esp), ptr_reg
-#endif
         mov     $PAGE_SIZE/16, %ecx
         xor     %eax,%eax
 
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/copy_page.S
--- a/xen/arch/x86/copy_page.S	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/copy_page.S	Wed Sep 12 13:29:30 2012 +0100
@@ -1,15 +1,6 @@
 #include <xen/config.h>
 #include <asm/page.h>
 
-#ifdef __i386__
-#define src_reg %esi
-#define dst_reg %edi
-#define WORD_SIZE 4
-#define tmp1_reg %eax
-#define tmp2_reg %edx
-#define tmp3_reg %ebx
-#define tmp4_reg %ebp
-#else
 #define src_reg %rsi
 #define dst_reg %rdi
 #define WORD_SIZE 8
@@ -17,17 +8,8 @@
 #define tmp2_reg %r9
 #define tmp3_reg %r10
 #define tmp4_reg %r11
-#endif
 
 ENTRY(copy_page_sse2)
-#ifdef __i386__
-        push    %ebx
-        push    %ebp
-        push    %esi
-        push    %edi
-        mov     6*4(%esp), src_reg
-        mov     5*4(%esp), dst_reg
-#endif
         mov     $PAGE_SIZE/(4*WORD_SIZE)-3, %ecx
 
         prefetchnta 2*4*WORD_SIZE(src_reg)
@@ -56,11 +38,5 @@ 1:      add     $4*WORD_SIZE, src_reg
         movnti  tmp3_reg, 2*WORD_SIZE(dst_reg)
         movnti  tmp4_reg, 3*WORD_SIZE(dst_reg)
 
-#ifdef __i386__
-        pop     %edi
-        pop     %esi
-        pop     %ebp
-        pop     %ebx
-#endif
         sfence
         ret
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/cpu/Makefile
--- a/xen/arch/x86/cpu/Makefile	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/cpu/Makefile	Wed Sep 12 13:29:30 2012 +0100
@@ -6,6 +6,5 @@ obj-y += common.o
 obj-y += intel.o
 obj-y += intel_cacheinfo.o
 
-obj-$(x86_32) += centaur.o
-obj-$(x86_32) += cyrix.o
-obj-$(x86_32) += transmeta.o
+# Keeping around for VIA support (JBeulich)
+# obj-$(x86_32) += centaur.o
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/cpu/amd.c
--- a/xen/arch/x86/cpu/amd.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/cpu/amd.c	Wed Sep 12 13:29:30 2012 +0100
@@ -32,11 +32,9 @@
 static char opt_famrev[14];
 string_param("cpuid_mask_cpu", opt_famrev);
 
-#ifdef __x86_64__
 /* 1 = allow, 0 = don't allow guest creation, -1 = don't allow boot */
 s8 __read_mostly opt_allow_unsafe;
 boolean_param("allow_unsafe", opt_allow_unsafe);
-#endif
 
 static inline void wrmsr_amd(unsigned int index, unsigned int lo, 
 		unsigned int hi)
@@ -400,7 +398,6 @@ static void __devinit init_amd(struct cp
 	   3DNow is IDd by bit 31 in extended CPUID (1*32+31) anyway */
 	clear_bit(0*32+31, c->x86_capability);
 	
-#ifdef CONFIG_X86_64
 	if (c->x86 == 0xf && c->x86_model < 0x14
 	    && cpu_has(c, X86_FEATURE_LAHF_LM)) {
 		/*
@@ -416,7 +413,6 @@ static void __devinit init_amd(struct cp
 			wrmsr_amd_safe(0xc001100d, lo, hi);
 		}
 	}
-#endif
 
 	switch(c->x86)
 	{
@@ -498,7 +494,6 @@ static void __devinit init_amd(struct cp
 	if (c->x86 >= 0x10 && !force_mwait)
 		clear_bit(X86_FEATURE_MWAIT, c->x86_capability);
 
-#ifdef __x86_64__
 	if (!cpu_has_amd_erratum(c, AMD_ERRATUM_121))
 		opt_allow_unsafe = 1;
 	else if (opt_allow_unsafe < 0)
@@ -523,7 +518,6 @@ static void __devinit init_amd(struct cp
 
 		fam10h_check_enable_mmcfg();
 	}
-#endif
 
 	/*
 	 * Family 0x12 and above processors have APIC timer
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/cpu/common.c
--- a/xen/arch/x86/cpu/common.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/cpu/common.c	Wed Sep 12 13:29:30 2012 +0100
@@ -281,31 +281,6 @@ static void __cpuinit generic_identify(s
 #endif
 }
 
-#ifdef __i386__
-
-static bool_t __cpuinitdata disable_x86_fxsr;
-boolean_param("nofxsr", disable_x86_fxsr);
-
-static bool_t __cpuinitdata disable_x86_serial_nr;
-boolean_param("noserialnumber", disable_x86_serial_nr);
-
-static void __cpuinit squash_the_stupid_serial_number(struct cpuinfo_x86 *c)
-{
-	if (cpu_has(c, X86_FEATURE_PN) && disable_x86_serial_nr ) {
-		/* Disable processor serial number */
-		uint64_t msr_content;
-		rdmsrl(MSR_IA32_BBL_CR_CTL,msr_content);
-		wrmsrl(MSR_IA32_BBL_CR_CTL, msr_content | 0x200000);
-		printk(KERN_NOTICE "CPU serial number disabled.\n");
-		clear_bit(X86_FEATURE_PN, c->x86_capability);
-
-		/* Disabling the serial number may affect the cpuid level */
-		c->cpuid_level = cpuid_eax(0);
-	}
-}
-
-#endif
-
 /*
  * This does the hard work of actually picking apart the CPU stuff...
  */
@@ -372,20 +347,6 @@ void __cpuinit identify_cpu(struct cpuin
 	 * we do "generic changes."
 	 */
 
-#ifdef __i386__
-	/* Disable the PN if appropriate */
-	squash_the_stupid_serial_number(c);
-
-	/* FXSR disabled? */
-	if (disable_x86_fxsr) {
-		clear_bit(X86_FEATURE_FXSR, c->x86_capability);
-		if (!cpu_has_xsave) {
-			clear_bit(X86_FEATURE_XMM, c->x86_capability);
-			clear_bit(X86_FEATURE_AES, c->x86_capability);
-		}
-	}
-#endif
-
 	for (i = 0 ; i < NCAPINTS ; ++i)
 		c->x86_capability[i] &= ~cleared_caps[i];
 
@@ -602,12 +563,6 @@ void __init early_cpu_init(void)
 {
 	intel_cpu_init();
 	amd_init_cpu();
-#ifdef CONFIG_X86_32
-	cyrix_init_cpu();
-	nsc_init_cpu();
-	centaur_init_cpu();
-	transmeta_init_cpu();
-#endif
 	early_cpu_detect();
 }
 /*
@@ -648,16 +603,9 @@ void __cpuinit cpu_init(void)
 
 	/* Set up and load the per-CPU TSS and LDT. */
 	t->bitmap = IOBMP_INVALID_OFFSET;
-#if defined(CONFIG_X86_32)
-	t->ss0  = __HYPERVISOR_DS;
-	t->esp0 = get_stack_bottom();
-	if ( supervisor_mode_kernel && cpu_has_sep )
-		wrmsr(MSR_IA32_SYSENTER_ESP, &t->esp1, 0);
-#elif defined(CONFIG_X86_64)
 	/* Bottom-of-stack must be 16-byte aligned! */
 	BUG_ON((get_stack_bottom() & 15) != 0);
 	t->rsp0 = get_stack_bottom();
-#endif
 	load_TR();
 	asm volatile ( "lldt %%ax" : : "a" (0) );
 
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/cpu/cyrix.c
--- a/xen/arch/x86/cpu/cyrix.c	Wed Sep 12 13:24:28 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,313 +0,0 @@
-#include <xen/config.h>
-#include <xen/init.h>
-#include <xen/irq.h>
-#include <xen/bitops.h>
-#include <xen/delay.h>
-#include <asm/io.h>
-#include <asm/processor.h>
-
-#include "cpu.h"
-
-/*
- * Read NSC/Cyrix DEVID registers (DIR) to get more detailed info. about the CPU
- */
-void __init do_cyrix_devid(unsigned char *dir0, unsigned char *dir1)
-{
-	unsigned char ccr3;
-	unsigned long flags;
-	
-	/* we test for DEVID by checking whether CCR3 is writable */
-	local_irq_save(flags);
-	ccr3 = getCx86(CX86_CCR3);
-	setCx86(CX86_CCR3, ccr3 ^ 0x80);
-	getCx86(0xc0);   /* dummy to change bus */
-
-	if (getCx86(CX86_CCR3) == ccr3)       /* no DEVID regs. */
-		BUG();
-	else {
-		setCx86(CX86_CCR3, ccr3);  /* restore CCR3 */
-
-		/* read DIR0 and DIR1 CPU registers */
-		*dir0 = getCx86(CX86_DIR0);
-		*dir1 = getCx86(CX86_DIR1);
-	}
-	local_irq_restore(flags);
-}
-
-/*
- * Cx86_dir0_msb is a HACK needed by check_cx686_cpuid/slop in bugs.h in
- * order to identify the Cyrix CPU model after we're out of setup.c
- *
- * Actually since bugs.h doesn't even reference this perhaps someone should
- * fix the documentation ???
- */
-static unsigned char Cx86_dir0_msb __initdata = 0;
-
-static char Cx86_model[][9] __initdata = {
-	"Cx486", "Cx486", "5x86 ", "6x86", "MediaGX ", "6x86MX ",
-	"M II ", "Unknown"
-};
-static char Cx86_cb[] __initdata = "?.5x Core/Bus Clock";
-static char cyrix_model_mult1[] __initdata = "12??43";
-static char cyrix_model_mult2[] __initdata = "12233445";
-
-/*
- * Reset the slow-loop (SLOP) bit on the 686(L) which is set by some old
- * BIOSes for compatibility with DOS games.  This makes the udelay loop
- * work correctly, and improves performance.
- *
- * FIXME: our newer udelay uses the tsc. We don't need to frob with SLOP
- */
-
-static void __init check_cx686_slop(struct cpuinfo_x86 *c)
-{
-	unsigned long flags;
-	
-	if (Cx86_dir0_msb == 3) {
-		unsigned char ccr3, ccr5;
-
-		local_irq_save(flags);
-		ccr3 = getCx86(CX86_CCR3);
-		setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10); /* enable MAPEN  */
-		ccr5 = getCx86(CX86_CCR5);
-		if (ccr5 & 2)
-			setCx86(CX86_CCR5, ccr5 & 0xfd);  /* reset SLOP */
-		setCx86(CX86_CCR3, ccr3);                 /* disable MAPEN */
-		local_irq_restore(flags);
-	}
-}
-
-
-static void __init set_cx86_reorder(void)
-{
-	u8 ccr3;
-
-	printk(KERN_INFO "Enable Memory access reorder on Cyrix/NSC processor.\n");
-	ccr3 = getCx86(CX86_CCR3);
-	setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10); /* enable MAPEN  */
-
-	/* Load/Store Serialize to mem access disable (=reorder it)  */
-	setCx86(CX86_PCR0, getCx86(CX86_PCR0) & ~0x80);
-	/* set load/store serialize from 1GB to 4GB */
-	ccr3 |= 0xe0;
-	setCx86(CX86_CCR3, ccr3);
-}
-
-static void __init set_cx86_memwb(void)
-{
-	u32 cr0;
-
-	printk(KERN_INFO "Enable Memory-Write-back mode on Cyrix/NSC processor.\n");
-
-	/* CCR2 bit 2: unlock NW bit */
-	setCx86(CX86_CCR2, getCx86(CX86_CCR2) & ~0x04);
-	/* set 'Not Write-through' */
-	cr0 = 0x20000000;
-	__asm__("movl %%cr0,%%eax\n\t"
-		"orl %0,%%eax\n\t"
-		"movl %%eax,%%cr0\n"
-		: : "r" (cr0)
-		:"ax");
-	/* CCR2 bit 2: lock NW bit and set WT1 */
-	setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x14 );
-}
-
-static void __init set_cx86_inc(void)
-{
-	unsigned char ccr3;
-
-	printk(KERN_INFO "Enable Incrementor on Cyrix/NSC processor.\n");
-
-	ccr3 = getCx86(CX86_CCR3);
-	setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10); /* enable MAPEN  */
-	/* PCR1 -- Performance Control */
-	/* Incrementor on, whatever that is */
-	setCx86(CX86_PCR1, getCx86(CX86_PCR1) | 0x02);
-	/* PCR0 -- Performance Control */
-	/* Incrementor Margin 10 */
-	setCx86(CX86_PCR0, getCx86(CX86_PCR0) | 0x04);
-	setCx86(CX86_CCR3, ccr3);	/* disable MAPEN */
-}
-
-/*
- *	Configure later MediaGX and/or Geode processor.
- */
-
-static void __init geode_configure(void)
-{
-	unsigned long flags;
-	u8 ccr3, ccr4;
-	local_irq_save(flags);
-
-	/* Suspend on halt power saving and enable #SUSP pin */
-	setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x88);
-
-	ccr3 = getCx86(CX86_CCR3);
-	setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10);	/* Enable */
-	
-	ccr4 = getCx86(CX86_CCR4);
-	ccr4 |= 0x38;		/* FPU fast, DTE cache, Mem bypass */
-	
-	setCx86(CX86_CCR3, ccr3);
-	
-	set_cx86_memwb();
-	set_cx86_reorder();	
-	set_cx86_inc();
-	
-	local_irq_restore(flags);
-}
-
-
-static void __init init_cyrix(struct cpuinfo_x86 *c)
-{
-	unsigned char dir0, dir0_msn, dir0_lsn, dir1 = 0;
-	const char *p = NULL;
-
-	/* Bit 31 in normal CPUID used for nonstandard 3DNow ID;
-	   3DNow is IDd by bit 31 in extended CPUID (1*32+31) anyway */
-	clear_bit(0*32+31, c->x86_capability);
-
-	/* Cyrix used bit 24 in extended (AMD) CPUID for Cyrix MMX extensions */
-	if ( test_bit(1*32+24, c->x86_capability) ) {
-		clear_bit(1*32+24, c->x86_capability);
-		set_bit(X86_FEATURE_CXMMX, c->x86_capability);
-	}
-
-	do_cyrix_devid(&dir0, &dir1);
-
-	check_cx686_slop(c);
-
-	Cx86_dir0_msb = dir0_msn = dir0 >> 4; /* identifies CPU "family"   */
-	dir0_lsn = dir0 & 0xf;                /* model or clock multiplier */
-
-	/* common case step number/rev -- exceptions handled below */
-	c->x86_model = (dir1 >> 4) + 1;
-	c->x86_mask = dir1 & 0xf;
-
-	/* Now cook; the original recipe is by Channing Corn, from Cyrix.
-	 * We do the same thing for each generation: we work out
-	 * the model, multiplier and stepping.  Black magic included,
-	 * to make the silicon step/rev numbers match the printed ones.
-	 */
-	 
-	switch (dir0_msn) {
-		unsigned char tmp;
-
-	case 3: /* 6x86/6x86L */
-		Cx86_cb[1] = ' ';
-		Cx86_cb[2] = cyrix_model_mult1[dir0_lsn & 5];
-		if (dir1 > 0x21) { /* 686L */
-			Cx86_cb[0] = 'L';
-			p = Cx86_cb;
-			(c->x86_model)++;
-		} else             /* 686 */
-			p = Cx86_cb+1;
-		/* Emulate MTRRs using Cyrix's ARRs. */
-		set_bit(X86_FEATURE_CYRIX_ARR, c->x86_capability);
-		/* 6x86's contain this bug */
-		/*c->coma_bug = 1;*/
-		break;
-
-	case 4: /* MediaGX/GXm or Geode GXM/GXLV/GX1 */
-		c->x86_cache_size=16;	/* Yep 16K integrated cache thats it */
- 
-		/* GXm supports extended cpuid levels 'ala' AMD */
-		if (c->cpuid_level == 2) {
-			/* Enable cxMMX extensions (GX1 Datasheet 54) */
-			setCx86(CX86_CCR7, getCx86(CX86_CCR7)|1);
-			
-			/* GXlv/GXm/GX1 */
-			if((dir1 >= 0x50 && dir1 <= 0x54) || dir1 >= 0x63)
-				geode_configure();
-			get_model_name(c);  /* get CPU marketing name */
-			return;
-		}
-		else {  /* MediaGX */
-			Cx86_cb[2] = (dir0_lsn & 1) ? '3' : '4';
-			p = Cx86_cb+2;
-			c->x86_model = (dir1 & 0x20) ? 1 : 2;
-		}
-		break;
-
-        case 5: /* 6x86MX/M II */
-		if (dir1 > 7)
-		{
-			dir0_msn++;  /* M II */
-			/* Enable MMX extensions (App note 108) */
-			setCx86(CX86_CCR7, getCx86(CX86_CCR7)|1);
-		}
-		else
-		{
-			/*c->coma_bug = 1;*/      /* 6x86MX, it has the bug. */
-		}
-		tmp = (!(dir0_lsn & 7) || dir0_lsn & 1) ? 2 : 0;
-		Cx86_cb[tmp] = cyrix_model_mult2[dir0_lsn & 7];
-		p = Cx86_cb+tmp;
-        	if (((dir1 & 0x0f) > 4) || ((dir1 & 0xf0) == 0x20))
-			(c->x86_model)++;
-		/* Emulate MTRRs using Cyrix's ARRs. */
-		set_bit(X86_FEATURE_CYRIX_ARR, c->x86_capability);
-		break;
-
-	default:  /* unknown (shouldn't happen, we know everyone ;-) */
-		dir0_msn = 7;
-		break;
-	}
-	safe_strcpy(c->x86_model_id, Cx86_model[dir0_msn & 7]);
-	if (p) safe_strcat(c->x86_model_id, p);
-	return;
-}
-
-/*
- * Cyrix CPUs without cpuid or with cpuid not yet enabled can be detected
- * by the fact that they preserve the flags across the division of 5/2.
- * PII and PPro exhibit this behavior too, but they have cpuid available.
- */
- 
-/*
- * Perform the Cyrix 5/2 test. A Cyrix won't change
- * the flags, while other 486 chips will.
- */
-static inline int test_cyrix_52div(void)
-{
-	unsigned int test;
-
-	__asm__ __volatile__(
-	     "sahf\n\t"		/* clear flags (%eax = 0x0005) */
-	     "div %b2\n\t"	/* divide 5 by 2 */
-	     "lahf"		/* store flags into %ah */
-	     : "=a" (test)
-	     : "0" (5), "q" (2)
-	     : "cc");
-
-	/* AH is 0x02 on Cyrix after the divide.. */
-	return (unsigned char) (test >> 8) == 0x02;
-}
-
-static struct cpu_dev cyrix_cpu_dev __cpuinitdata = {
-	.c_vendor	= "Cyrix",
-	.c_ident 	= { "CyrixInstead" },
-	.c_init		= init_cyrix,
-};
-
-int __init cyrix_init_cpu(void)
-{
-	cpu_devs[X86_VENDOR_CYRIX] = &cyrix_cpu_dev;
-	return 0;
-}
-
-//early_arch_initcall(cyrix_init_cpu);
-
-static struct cpu_dev nsc_cpu_dev __cpuinitdata = {
-	.c_vendor	= "NSC",
-	.c_ident 	= { "Geode by NSC" },
-	.c_init		= init_cyrix,
-};
-
-int __init nsc_init_cpu(void)
-{
-	cpu_devs[X86_VENDOR_NSC] = &nsc_cpu_dev;
-	return 0;
-}
-
-//early_arch_initcall(nsc_init_cpu);
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/cpu/mcheck/mce_intel.c
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c	Wed Sep 12 13:29:30 2012 +0100
@@ -445,10 +445,8 @@ intel_get_extended_msrs(struct mcinfo_gl
     for (i = MSR_IA32_MCG_EAX; i <= MSR_IA32_MCG_MISC; i++)
         intel_get_extended_msr(mc_ext, i);
 
-#ifdef __x86_64__
     for (i = MSR_IA32_MCG_R8; i <= MSR_IA32_MCG_R15; i++)
         intel_get_extended_msr(mc_ext, i);
-#endif
 
     return mc_ext;
 }
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/cpu/mtrr/Makefile
--- a/xen/arch/x86/cpu/mtrr/Makefile	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/cpu/mtrr/Makefile	Wed Sep 12 13:29:30 2012 +0100
@@ -1,5 +1,2 @@
-obj-$(x86_32) += amd.o
-obj-$(x86_32) += cyrix.o
 obj-y += generic.o
 obj-y += main.o
-obj-$(x86_32) += state.o
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/cpu/mtrr/amd.c
--- a/xen/arch/x86/cpu/mtrr/amd.c	Wed Sep 12 13:24:28 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,121 +0,0 @@
-#include <xen/init.h>
-#include <xen/mm.h>
-#include <asm/mtrr.h>
-#include <asm/msr.h>
-
-#include "mtrr.h"
-
-static void
-amd_get_mtrr(unsigned int reg, unsigned long *base,
-	     unsigned long *size, mtrr_type * type)
-{
-	unsigned long low, high;
-
-	rdmsr(MSR_K6_UWCCR, low, high);
-	/*  Upper dword is region 1, lower is region 0  */
-	if (reg == 1)
-		low = high;
-	/*  The base masks off on the right alignment  */
-	*base = (low & 0xFFFE0000) >> PAGE_SHIFT;
-	*type = 0;
-	if (low & 1)
-		*type = MTRR_TYPE_UNCACHABLE;
-	if (low & 2)
-		*type = MTRR_TYPE_WRCOMB;
-	if (!(low & 3)) {
-		*size = 0;
-		return;
-	}
-	/*
-	 *  This needs a little explaining. The size is stored as an
-	 *  inverted mask of bits of 128K granularity 15 bits long offset
-	 *  2 bits
-	 *
-	 *  So to get a size we do invert the mask and add 1 to the lowest
-	 *  mask bit (4 as its 2 bits in). This gives us a size we then shift
-	 *  to turn into 128K blocks
-	 *
-	 *  eg              111 1111 1111 1100      is 512K
-	 *
-	 *  invert          000 0000 0000 0011
-	 *  +1              000 0000 0000 0100
-	 *  *128K   ...
-	 */
-	low = (~low) & 0x1FFFC;
-	*size = (low + 4) << (15 - PAGE_SHIFT);
-	return;
-}
-
-static void amd_set_mtrr(unsigned int reg, unsigned long base,
-			 unsigned long size, mtrr_type type)
-/*  [SUMMARY] Set variable MTRR register on the local CPU.
-    <reg> The register to set.
-    <base> The base address of the region.
-    <size> The size of the region. If this is 0 the region is disabled.
-    <type> The type of the region.
-    <do_safe> If TRUE, do the change safely. If FALSE, safety measures should
-    be done externally.
-    [RETURNS] Nothing.
-*/
-{
-	u32 regs[2];
-
-	/*
-	 *  Low is MTRR0 , High MTRR 1
-	 */
-	rdmsr(MSR_K6_UWCCR, regs[0], regs[1]);
-	/*
-	 *  Blank to disable
-	 */
-	if (size == 0)
-		regs[reg] = 0;
-	else
-		/* Set the register to the base, the type (off by one) and an
-		   inverted bitmask of the size The size is the only odd
-		   bit. We are fed say 512K We invert this and we get 111 1111
-		   1111 1011 but if you subtract one and invert you get the   
-		   desired 111 1111 1111 1100 mask
-
-		   But ~(x - 1) == ~x + 1 == -x. Two's complement rocks!  */
-		regs[reg] = (-size >> (15 - PAGE_SHIFT) & 0x0001FFFC)
-		    | (base << PAGE_SHIFT) | (type + 1);
-
-	/*
-	 *  The writeback rule is quite specific. See the manual. Its
-	 *  disable local interrupts, write back the cache, set the mtrr
-	 */
-	wbinvd();
-	wrmsr(MSR_K6_UWCCR, regs[0], regs[1]);
-}
-
-static int amd_validate_add_page(unsigned long base, unsigned long size, unsigned int type)
-{
-	/* Apply the K6 block alignment and size rules
-	   In order
-	   o Uncached or gathering only
-	   o 128K or bigger block
-	   o Power of 2 block
-	   o base suitably aligned to the power
-	*/
-	if (type > MTRR_TYPE_WRCOMB || size < (1 << (17 - PAGE_SHIFT))
-	    || (size & ~(size - 1)) - size || (base & (size - 1)))
-		return -EINVAL;
-	return 0;
-}
-
-static const struct mtrr_ops amd_mtrr_ops = {
-	.vendor            = X86_VENDOR_AMD,
-	.set               = amd_set_mtrr,
-	.get               = amd_get_mtrr,
-	.get_free_region   = generic_get_free_region,
-	.validate_add_page = amd_validate_add_page,
-	.have_wrcomb       = positive_have_wrcomb,
-};
-
-int __init amd_init_mtrr(void)
-{
-	set_mtrr_ops(&amd_mtrr_ops);
-	return 0;
-}
-
-//arch_initcall(amd_mtrr_init);
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/cpu/mtrr/cyrix.c
--- a/xen/arch/x86/cpu/mtrr/cyrix.c	Wed Sep 12 13:24:28 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,376 +0,0 @@
-#include <xen/init.h>
-#include <xen/mm.h>
-#include <asm/mtrr.h>
-#include <asm/msr.h>
-#include <asm/io.h>
-#include "mtrr.h"
-
-int arr3_protected;
-
-static void
-cyrix_get_arr(unsigned int reg, unsigned long *base,
-	      unsigned long *size, mtrr_type * type)
-{
-	unsigned long flags;
-	unsigned char arr, ccr3, rcr, shift;
-
-	arr = CX86_ARR_BASE + (reg << 1) + reg;	/* avoid multiplication by 3 */
-
-	/* Save flags and disable interrupts */
-	local_irq_save(flags);
-
-	ccr3 = getCx86(CX86_CCR3);
-	setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10);	/* enable MAPEN */
-	((unsigned char *) base)[3] = getCx86(arr);
-	((unsigned char *) base)[2] = getCx86(arr + 1);
-	((unsigned char *) base)[1] = getCx86(arr + 2);
-	rcr = getCx86(CX86_RCR_BASE + reg);
-	setCx86(CX86_CCR3, ccr3);	/* disable MAPEN */
-
-	/* Enable interrupts if it was enabled previously */
-	local_irq_restore(flags);
-	shift = ((unsigned char *) base)[1] & 0x0f;
-	*base >>= PAGE_SHIFT;
-
-	/* Power of two, at least 4K on ARR0-ARR6, 256K on ARR7
-	 * Note: shift==0xf means 4G, this is unsupported.
-	 */
-	if (shift)
-		*size = (reg < 7 ? 0x1UL : 0x40UL) << (shift - 1);
-	else
-		*size = 0;
-
-	/* Bit 0 is Cache Enable on ARR7, Cache Disable on ARR0-ARR6 */
-	if (reg < 7) {
-		switch (rcr) {
-		case 1:
-			*type = MTRR_TYPE_UNCACHABLE;
-			break;
-		case 8:
-			*type = MTRR_TYPE_WRBACK;
-			break;
-		case 9:
-			*type = MTRR_TYPE_WRCOMB;
-			break;
-		case 24:
-		default:
-			*type = MTRR_TYPE_WRTHROUGH;
-			break;
-		}
-	} else {
-		switch (rcr) {
-		case 0:
-			*type = MTRR_TYPE_UNCACHABLE;
-			break;
-		case 8:
-			*type = MTRR_TYPE_WRCOMB;
-			break;
-		case 9:
-			*type = MTRR_TYPE_WRBACK;
-			break;
-		case 25:
-		default:
-			*type = MTRR_TYPE_WRTHROUGH;
-			break;
-		}
-	}
-}
-
-static int
-cyrix_get_free_region(unsigned long base, unsigned long size, int replace_reg)
-/*  [SUMMARY] Get a free ARR.
-    <base> The starting (base) address of the region.
-    <size> The size (in bytes) of the region.
-    [RETURNS] The index of the region on success, else -1 on error.
-*/
-{
-	int i;
-	mtrr_type ltype;
-	unsigned long lbase, lsize;
-
-	switch (replace_reg) {
-	case 7:
-		if (size < 0x40)
-			break;
-	case 6:
-	case 5:
-	case 4:
-		return replace_reg;
-	case 3:
-		if (arr3_protected)
-			break;
-	case 2:
-	case 1:
-	case 0:
-		return replace_reg;
-	}
-	/* If we are to set up a region >32M then look at ARR7 immediately */
-	if (size > 0x2000) {
-		cyrix_get_arr(7, &lbase, &lsize, &ltype);
-		if (lsize == 0)
-			return 7;
-		/*  Else try ARR0-ARR6 first  */
-	} else {
-		for (i = 0; i < 7; i++) {
-			cyrix_get_arr(i, &lbase, &lsize, &ltype);
-			if ((i == 3) && arr3_protected)
-				continue;
-			if (lsize == 0)
-				return i;
-		}
-		/* ARR0-ARR6 isn't free, try ARR7 but its size must be at least 256K */
-		cyrix_get_arr(i, &lbase, &lsize, &ltype);
-		if ((lsize == 0) && (size >= 0x40))
-			return i;
-	}
-	return -ENOSPC;
-}
-
-static u32 cr4 = 0;
-static u32 ccr3;
-
-static void prepare_set(void)
-{
-	u32 cr0;
-
-	/*  Save value of CR4 and clear Page Global Enable (bit 7)  */
-	if ( cpu_has_pge ) {
-		cr4 = read_cr4();
-		write_cr4(cr4 & ~X86_CR4_PGE);
-	}
-
-	/*  Disable and flush caches. Note that wbinvd flushes the TLBs as
-	    a side-effect  */
-	cr0 = read_cr0() | 0x40000000;
-	wbinvd();
-	write_cr0(cr0);
-	wbinvd();
-
-	/* Cyrix ARRs - everything else were excluded at the top */
-	ccr3 = getCx86(CX86_CCR3);
-
-	/* Cyrix ARRs - everything else were excluded at the top */
-	setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10);
-
-}
-
-static void post_set(void)
-{
-	/*  Flush caches and TLBs  */
-	wbinvd();
-
-	/* Cyrix ARRs - everything else was excluded at the top */
-	setCx86(CX86_CCR3, ccr3);
-		
-	/*  Enable caches  */
-	write_cr0(read_cr0() & 0xbfffffff);
-
-	/*  Restore value of CR4  */
-	if ( cpu_has_pge )
-		write_cr4(cr4);
-}
-
-static void cyrix_set_arr(unsigned int reg, unsigned long base,
-			  unsigned long size, mtrr_type type)
-{
-	unsigned char arr, arr_type, arr_size;
-
-	arr = CX86_ARR_BASE + (reg << 1) + reg;	/* avoid multiplication by 3 */
-
-	/* count down from 32M (ARR0-ARR6) or from 2G (ARR7) */
-	if (reg >= 7)
-		size >>= 6;
-
-	size &= 0x7fff;		/* make sure arr_size <= 14 */
-	for (arr_size = 0; size; arr_size++, size >>= 1) ;
-
-	if (reg < 7) {
-		switch (type) {
-		case MTRR_TYPE_UNCACHABLE:
-			arr_type = 1;
-			break;
-		case MTRR_TYPE_WRCOMB:
-			arr_type = 9;
-			break;
-		case MTRR_TYPE_WRTHROUGH:
-			arr_type = 24;
-			break;
-		default:
-			arr_type = 8;
-			break;
-		}
-	} else {
-		switch (type) {
-		case MTRR_TYPE_UNCACHABLE:
-			arr_type = 0;
-			break;
-		case MTRR_TYPE_WRCOMB:
-			arr_type = 8;
-			break;
-		case MTRR_TYPE_WRTHROUGH:
-			arr_type = 25;
-			break;
-		default:
-			arr_type = 9;
-			break;
-		}
-	}
-
-	prepare_set();
-
-	base <<= PAGE_SHIFT;
-	setCx86(arr, ((unsigned char *) &base)[3]);
-	setCx86(arr + 1, ((unsigned char *) &base)[2]);
-	setCx86(arr + 2, (((unsigned char *) &base)[1]) | arr_size);
-	setCx86(CX86_RCR_BASE + reg, arr_type);
-
-	post_set();
-}
-
-typedef struct {
-	unsigned long base;
-	unsigned long size;
-	mtrr_type type;
-} arr_state_t;
-
-static arr_state_t arr_state[8] = {
-	{0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL},
-	{0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}
-};
-
-static unsigned char ccr_state[7] = { 0, 0, 0, 0, 0, 0, 0 };
-
-static void cyrix_set_all(void)
-{
-	int i;
-
-	prepare_set();
-
-	/* the CCRs are not contiguous */
-	for (i = 0; i < 4; i++)
-		setCx86(CX86_CCR0 + i, ccr_state[i]);
-	for (; i < 7; i++)
-		setCx86(CX86_CCR4 + i, ccr_state[i]);
-	for (i = 0; i < 8; i++)
-		cyrix_set_arr(i, arr_state[i].base, 
-			      arr_state[i].size, arr_state[i].type);
-
-	post_set();
-}
-
-#if 0
-/*
- * On Cyrix 6x86(MX) and M II the ARR3 is special: it has connection
- * with the SMM (System Management Mode) mode. So we need the following:
- * Check whether SMI_LOCK (CCR3 bit 0) is set
- *   if it is set, write a warning message: ARR3 cannot be changed!
- *     (it cannot be changed until the next processor reset)
- *   if it is reset, then we can change it, set all the needed bits:
- *   - disable access to SMM memory through ARR3 range (CCR1 bit 7 reset)
- *   - disable access to SMM memory (CCR1 bit 2 reset)
- *   - disable SMM mode (CCR1 bit 1 reset)
- *   - disable write protection of ARR3 (CCR6 bit 1 reset)
- *   - (maybe) disable ARR3
- * Just to be sure, we enable ARR usage by the processor (CCR5 bit 5 set)
- */
-static void __init
-cyrix_arr_init(void)
-{
-	struct set_mtrr_context ctxt;
-	unsigned char ccr[7];
-	int ccrc[7] = { 0, 0, 0, 0, 0, 0, 0 };
-	int i;
-
-	/* flush cache and enable MAPEN */
-	set_mtrr_prepare_save(&ctxt);
-	set_mtrr_cache_disable(&ctxt);
-
-	/* Save all CCRs locally */
-	ccr[0] = getCx86(CX86_CCR0);
-	ccr[1] = getCx86(CX86_CCR1);
-	ccr[2] = getCx86(CX86_CCR2);
-	ccr[3] = ctxt.ccr3;
-	ccr[4] = getCx86(CX86_CCR4);
-	ccr[5] = getCx86(CX86_CCR5);
-	ccr[6] = getCx86(CX86_CCR6);
-
-	if (ccr[3] & 1) {
-		ccrc[3] = 1;
-		arr3_protected = 1;
-	} else {
-		/* Disable SMM mode (bit 1), access to SMM memory (bit 2) and
-		 * access to SMM memory through ARR3 (bit 7).
-		 */
-		if (ccr[1] & 0x80) {
-			ccr[1] &= 0x7f;
-			ccrc[1] |= 0x80;
-		}
-		if (ccr[1] & 0x04) {
-			ccr[1] &= 0xfb;
-			ccrc[1] |= 0x04;
-		}
-		if (ccr[1] & 0x02) {
-			ccr[1] &= 0xfd;
-			ccrc[1] |= 0x02;
-		}
-		arr3_protected = 0;
-		if (ccr[6] & 0x02) {
-			ccr[6] &= 0xfd;
-			ccrc[6] = 1;	/* Disable write protection of ARR3 */
-			setCx86(CX86_CCR6, ccr[6]);
-		}
-		/* Disable ARR3. This is safe now that we disabled SMM. */
-		/* cyrix_set_arr_up (3, 0, 0, 0, FALSE); */
-	}
-	/* If we changed CCR1 in memory, change it in the processor, too. */
-	if (ccrc[1])
-		setCx86(CX86_CCR1, ccr[1]);
-
-	/* Enable ARR usage by the processor */
-	if (!(ccr[5] & 0x20)) {
-		ccr[5] |= 0x20;
-		ccrc[5] = 1;
-		setCx86(CX86_CCR5, ccr[5]);
-	}
-
-	for (i = 0; i < 7; i++)
-		ccr_state[i] = ccr[i];
-	for (i = 0; i < 8; i++)
-		cyrix_get_arr(i,
-			      &arr_state[i].base, &arr_state[i].size,
-			      &arr_state[i].type);
-
-	set_mtrr_done(&ctxt);	/* flush cache and disable MAPEN */
-
-	if (ccrc[5])
-		printk(KERN_INFO "mtrr: ARR usage was not enabled, enabled manually\n");
-	if (ccrc[3])
-		printk(KERN_INFO "mtrr: ARR3 cannot be changed\n");
-/*
-    if ( ccrc[1] & 0x80) printk ("mtrr: SMM memory access through ARR3 disabled\n");
-    if ( ccrc[1] & 0x04) printk ("mtrr: SMM memory access disabled\n");
-    if ( ccrc[1] & 0x02) printk ("mtrr: SMM mode disabled\n");
-*/
-	if (ccrc[6])
-		printk(KERN_INFO "mtrr: ARR3 was write protected, unprotected\n");
-}
-#endif
-
-static const struct mtrr_ops cyrix_mtrr_ops = {
-	.vendor            = X86_VENDOR_CYRIX,
-//	.init              = cyrix_arr_init,
-	.set_all	   = cyrix_set_all,
-	.set               = cyrix_set_arr,
-	.get               = cyrix_get_arr,
-	.get_free_region   = cyrix_get_free_region,
-	.validate_add_page = generic_validate_add_page,
-	.have_wrcomb       = positive_have_wrcomb,
-};
-
-int __init cyrix_init_mtrr(void)
-{
-	set_mtrr_ops(&cyrix_mtrr_ops);
-	return 0;
-}
-
-//arch_initcall(cyrix_init_mtrr);
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/cpu/mtrr/main.c
--- a/xen/arch/x86/cpu/mtrr/main.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/cpu/mtrr/main.c	Wed Sep 12 13:29:30 2012 +0100
@@ -79,16 +79,6 @@ static const char *mtrr_attrib_to_str(in
 	return (x <= 6) ? mtrr_strings[x] : "?";
 }
 
-#ifndef CONFIG_X86_64
-static const struct mtrr_ops *mtrr_ops[X86_VENDOR_NUM];
-
-void set_mtrr_ops(const struct mtrr_ops * ops)
-{
-	if (ops->vendor && ops->vendor < X86_VENDOR_NUM)
-		mtrr_ops[ops->vendor] = ops;
-}
-#endif
-
 /*  Returns non-zero if we have the write-combining memory type  */
 static int have_wrcomb(void)
 {
@@ -521,12 +511,6 @@ int mtrr_del_page(int reg, unsigned long
 		printk(KERN_WARNING "mtrr: register: %d too big\n", reg);
 		goto out;
 	}
-	if (is_cpu(CYRIX) && !use_intel()) {
-		if ((reg == 3) && arr3_protected) {
-			printk(KERN_WARNING "mtrr: ARR3 cannot be changed\n");
-			goto out;
-		}
-	}
 	mtrr_if->get(reg, &lbase, &lsize, &ltype);
 	if (lsize < 1) {
 		printk(KERN_WARNING "mtrr: MTRR %d not used\n", reg);
@@ -566,18 +550,6 @@ mtrr_del(int reg, unsigned long base, un
 	return mtrr_del_page(reg, base >> PAGE_SHIFT, size >> PAGE_SHIFT);
 }
 
-/* HACK ALERT!
- * These should be called implicitly, but we can't yet until all the initcall
- * stuff is done...
- */
-static void __init init_ifs(void)
-{
-#ifndef CONFIG_X86_64
-	amd_init_mtrr();
-	cyrix_init_mtrr();
-#endif
-}
-
 /* The suspend/resume methods are only for CPU without MTRR. CPU using generic
  * MTRR driver doesn't require this
  */
@@ -598,8 +570,6 @@ unsigned int paddr_bits __read_mostly = 
  */
 void __init mtrr_bp_init(void)
 {
-	init_ifs();
-
 	if (cpu_has_mtrr) {
 		mtrr_if = &generic_mtrr_ops;
 		size_or_mask = 0xff000000;	/* 36 bits */
@@ -627,28 +597,6 @@ void __init mtrr_bp_init(void)
 			size_or_mask = 0xfff00000;	/* 32 bits */
 			size_and_mask = 0;
 		}
-	} else {
-#ifndef CONFIG_X86_64
-		switch (boot_cpu_data.x86_vendor) {
-		case X86_VENDOR_AMD:
-			if (cpu_has_k6_mtrr) {
-				/* Pre-Athlon (K6) AMD CPU MTRRs */
-				mtrr_if = mtrr_ops[X86_VENDOR_AMD];
-				size_or_mask = 0xfff00000;	/* 32 bits */
-				size_and_mask = 0;
-			}
-			break;
-		case X86_VENDOR_CYRIX:
-			if (cpu_has_cyrix_arr) {
-				mtrr_if = mtrr_ops[X86_VENDOR_CYRIX];
-				size_or_mask = 0xfff00000;	/* 32 bits */
-				size_and_mask = 0;
-			}
-			break;
-		default:
-			break;
-		}
-#endif
 	}
 
 	if (mtrr_if) {
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/cpu/mtrr/mtrr.h
--- a/xen/arch/x86/cpu/mtrr/mtrr.h	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/cpu/mtrr/mtrr.h	Wed Sep 12 13:29:30 2012 +0100
@@ -85,9 +85,3 @@ void mtrr_wrmsr(unsigned int msr, uint64
 
 extern int amd_init_mtrr(void);
 extern int cyrix_init_mtrr(void);
-
-#ifndef CONFIG_X86_64
-extern int arr3_protected;
-#else
-#define arr3_protected 0
-#endif
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/cpu/mtrr/state.c
--- a/xen/arch/x86/cpu/mtrr/state.c	Wed Sep 12 13:24:28 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-#include <xen/mm.h>
-#include <xen/init.h>
-#include <asm/io.h>
-#include <asm/mtrr.h>
-#include <asm/msr.h>
-#include "mtrr.h"
-
-
-/*  Put the processor into a state where MTRRs can be safely set  */
-void set_mtrr_prepare_save(struct set_mtrr_context *ctxt)
-{
-	unsigned int cr0;
-
-	/*  Disable interrupts locally  */
-	local_irq_save(ctxt->flags);
-
-	if (use_intel() || is_cpu(CYRIX)) {
-
-		/*  Save value of CR4 and clear Page Global Enable (bit 7)  */
-		if ( cpu_has_pge ) {
-			ctxt->cr4val = read_cr4();
-			write_cr4(ctxt->cr4val & (unsigned char) ~(1 << 7));
-		}
-
-		/*  Disable and flush caches. Note that wbinvd flushes the TLBs as
-		    a side-effect  */
-		cr0 = read_cr0() | 0x40000000;
-		wbinvd();
-		write_cr0(cr0);
-		wbinvd();
-
-		if (use_intel()) {
-			/*  Save MTRR state */
-			rdmsrl(MTRRdefType_MSR, ctxt->deftype);
-		} else
-			/* Cyrix ARRs - everything else were excluded at the top */
-			ctxt->ccr3 = getCx86(CX86_CCR3);
-	}
-}
-
-void set_mtrr_cache_disable(struct set_mtrr_context *ctxt)
-{
-	if (use_intel()) 
-		/*  Disable MTRRs, and set the default type to uncached  */
-		mtrr_wrmsr(MTRRdefType_MSR, ctxt->deftype & 0xf300UL);
-	else if (is_cpu(CYRIX))
-		/* Cyrix ARRs - everything else were excluded at the top */
-		setCx86(CX86_CCR3, (ctxt->ccr3 & 0x0f) | 0x10);
-}
-
-/*  Restore the processor after a set_mtrr_prepare  */
-void set_mtrr_done(struct set_mtrr_context *ctxt)
-{
-	if (use_intel() || is_cpu(CYRIX)) {
-
-		/*  Flush caches and TLBs  */
-		wbinvd();
-
-		/*  Restore MTRRdefType  */
-		if (use_intel())
-			/* Intel (P6) standard MTRRs */
-			mtrr_wrmsr(MTRRdefType_MSR, ctxt->deftype);
-		else
-			/* Cyrix ARRs - everything else was excluded at the top */
-			setCx86(CX86_CCR3, ctxt->ccr3);
-		
-		/*  Enable caches  */
-		write_cr0(read_cr0() & 0xbfffffff);
-
-		/*  Restore value of CR4  */
-		if ( cpu_has_pge )
-			write_cr4(ctxt->cr4val);
-	}
-	/*  Re-enable interrupts locally (if enabled previously)  */
-	local_irq_restore(ctxt->flags);
-}
-
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/cpu/transmeta.c
--- a/xen/arch/x86/cpu/transmeta.c	Wed Sep 12 13:24:28 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-#include <xen/config.h>
-#include <xen/lib.h>
-#include <xen/init.h>
-#include <asm/processor.h>
-#include <asm/msr.h>
-#include "cpu.h"
-
-static void __init init_transmeta(struct cpuinfo_x86 *c)
-{
-	unsigned int cap_mask, uk, max, dummy;
-	unsigned int cms_rev1, cms_rev2;
-	unsigned int cpu_rev, cpu_freq, cpu_flags, new_cpu_rev;
-	char cpu_info[65];
-
-	get_model_name(c);	/* Same as AMD/Cyrix */
-	display_cacheinfo(c);
-
-	/* Print CMS and CPU revision */
-	max = cpuid_eax(0x80860000);
-	cpu_rev = 0;
-	if ( max >= 0x80860001 ) {
-		cpuid(0x80860001, &dummy, &cpu_rev, &cpu_freq, &cpu_flags);
-		if (cpu_rev != 0x02000000) {
-			printk(KERN_INFO "CPU: Processor revision %u.%u.%u.%u, %u MHz\n",
-				(cpu_rev >> 24) & 0xff,
-				(cpu_rev >> 16) & 0xff,
-				(cpu_rev >> 8) & 0xff,
-				cpu_rev & 0xff,
-				cpu_freq);
-		}
-	}
-	if ( max >= 0x80860002 ) {
-		cpuid(0x80860002, &new_cpu_rev, &cms_rev1, &cms_rev2, &dummy);
-		if (cpu_rev == 0x02000000) {
-			printk(KERN_INFO "CPU: Processor revision %08X, %u MHz\n",
-				new_cpu_rev, cpu_freq);
-		}
-		printk(KERN_INFO "CPU: Code Morphing Software revision %u.%u.%u-%u-%u\n",
-		       (cms_rev1 >> 24) & 0xff,
-		       (cms_rev1 >> 16) & 0xff,
-		       (cms_rev1 >> 8) & 0xff,
-		       cms_rev1 & 0xff,
-		       cms_rev2);
-	}
-	if ( max >= 0x80860006 ) {
-		cpuid(0x80860003,
-		      (void *)&cpu_info[0],
-		      (void *)&cpu_info[4],
-		      (void *)&cpu_info[8],
-		      (void *)&cpu_info[12]);
-		cpuid(0x80860004,
-		      (void *)&cpu_info[16],
-		      (void *)&cpu_info[20],
-		      (void *)&cpu_info[24],
-		      (void *)&cpu_info[28]);
-		cpuid(0x80860005,
-		      (void *)&cpu_info[32],
-		      (void *)&cpu_info[36],
-		      (void *)&cpu_info[40],
-		      (void *)&cpu_info[44]);
-		cpuid(0x80860006,
-		      (void *)&cpu_info[48],
-		      (void *)&cpu_info[52],
-		      (void *)&cpu_info[56],
-		      (void *)&cpu_info[60]);
-		cpu_info[64] = '\0';
-		printk(KERN_INFO "CPU: %s\n", cpu_info);
-	}
-
-	/* Unhide possibly hidden capability flags */
-	rdmsr(0x80860004, cap_mask, uk);
-	wrmsr(0x80860004, ~0, uk);
-	c->x86_capability[0] = cpuid_edx(0x00000001);
-	wrmsr(0x80860004, cap_mask, uk);
-	
-	/* If we can run i686 user-space code, call us an i686 */
-#define USER686 (X86_FEATURE_TSC|X86_FEATURE_CX8|X86_FEATURE_CMOV)
-        if ( c->x86 == 5 && (c->x86_capability[0] & USER686) == USER686 )
-		c->x86 = 6;
-}
-
-static void transmeta_identify(struct cpuinfo_x86 * c)
-{
-	u32 xlvl;
-
-	/* Transmeta-defined flags: level 0x80860001 */
-	xlvl = cpuid_eax(0x80860000);
-	if ( (xlvl & 0xffff0000) == 0x80860000 ) {
-		if (  xlvl >= 0x80860001 )
-			c->x86_capability[2] = cpuid_edx(0x80860001);
-	}
-}
-
-static struct cpu_dev transmeta_cpu_dev __cpuinitdata = {
-	.c_vendor	= "Transmeta",
-	.c_ident	= { "GenuineTMx86", "TransmetaCPU" },
-	.c_init		= init_transmeta,
-	.c_identify	= transmeta_identify,
-};
-
-int __init transmeta_init_cpu(void)
-{
-	cpu_devs[X86_VENDOR_TRANSMETA] = &transmeta_cpu_dev;
-	return 0;
-}
-
-//early_arch_initcall(transmeta_init_cpu);
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/debug.c
--- a/xen/arch/x86/debug.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/debug.c	Wed Sep 12 13:29:30 2012 +0100
@@ -70,8 +70,6 @@ dbg_hvm_va2mfn(dbgva_t vaddr, struct dom
     return mfn;
 }
 
-#if defined(__x86_64__)
-
 /* 
  * pgd3val: this is the value of init_mm.pgd[3] in a PV guest. It is optional.
  *          This to assist debug of modules in the guest. The kernel address 
@@ -143,49 +141,6 @@ dbg_pv_va2mfn(dbgva_t vaddr, struct doma
     return mfn_valid(mfn) ? mfn : INVALID_MFN;
 }
 
-#else
-
-/* Returns: mfn for the given (pv guest) vaddr */
-static unsigned long 
-dbg_pv_va2mfn(dbgva_t vaddr, struct domain *dp, uint64_t pgd3val)
-{
-    l3_pgentry_t l3e, *l3t;
-    l2_pgentry_t l2e, *l2t;
-    l1_pgentry_t l1e, *l1t;
-    unsigned long cr3 = (pgd3val ? pgd3val : dp->vcpu[0]->arch.cr3);
-    unsigned long mfn = cr3 >> PAGE_SHIFT;
-
-    DBGP2("vaddr:%lx domid:%d cr3:%lx pgd3:%lx\n", vaddr, dp->domain_id, 
-          cr3, pgd3val);
-
-    if ( pgd3val == 0 )
-    {
-        l3t  = map_domain_page(mfn);
-        l3t += (cr3 & 0xFE0UL) >> 3;
-        l3e = l3t[l3_table_offset(vaddr)];
-        mfn = l3e_get_pfn(l3e);
-        unmap_domain_page(l3t);
-        if ( !(l3e_get_flags(l3e) & _PAGE_PRESENT) )
-            return INVALID_MFN;
-    }
-
-    l2t = map_domain_page(mfn);
-    l2e = l2t[l2_table_offset(vaddr)];
-    mfn = l2e_get_pfn(l2e);
-    unmap_domain_page(l2t);
-    if ( !(l2e_get_flags(l2e) & _PAGE_PRESENT) || 
-         (l2e_get_flags(l2e) & _PAGE_PSE) )
-        return INVALID_MFN;
-
-    l1t = map_domain_page(mfn);
-    l1e = l1t[l1_table_offset(vaddr)];
-    mfn = l1e_get_pfn(l1e);
-    unmap_domain_page(l1t);
-
-    return mfn_valid(mfn) ? mfn : INVALID_MFN;
-}
-#endif  /* defined(__x86_64__) */
-
 /* Returns: number of bytes remaining to be copied */
 static int
 dbg_rw_guest_mem(dbgva_t addr, dbgbyte_t *buf, int len, struct domain *dp, 
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/domain.c	Wed Sep 12 13:29:30 2012 +0100
@@ -184,11 +184,8 @@ struct domain *alloc_domain_struct(void)
      * We pack the PDX of the domain structure into a 32-bit field within
      * the page_info structure. Hence the MEMF_bits() restriction.
      */
-    unsigned int bits = 32 + PAGE_SHIFT;
+    unsigned int bits = 32 + PAGE_SHIFT + pfn_pdx_hole_shift;
 
-#ifdef __x86_64__
-    bits += pfn_pdx_hole_shift;
-#endif
     BUILD_BUG_ON(sizeof(*d) > PAGE_SIZE);
     d = alloc_xenheap_pages(0, MEMF_bits(bits));
     if ( d != NULL )
@@ -232,9 +229,6 @@ struct vcpu_guest_context *alloc_vcpu_gu
     enum fixed_addresses idx = FIX_VGC_BEGIN -
         cpu * PFN_UP(sizeof(struct vcpu_guest_context));
 
-#ifdef __i386__
-    BUILD_BUG_ON(sizeof(struct vcpu_guest_context) > PAGE_SIZE);
-#endif
     BUG_ON(per_cpu(vgc_pages[0], cpu) != NULL);
 
     for ( i = 0; i < PFN_UP(sizeof(struct vcpu_guest_context)); ++i )
@@ -270,8 +264,6 @@ void free_vcpu_guest_context(struct vcpu
     }
 }
 
-#ifdef __x86_64__
-
 static int setup_compat_l4(struct vcpu *v)
 {
     struct page_info *pg;
@@ -376,11 +368,6 @@ int switch_compat(struct domain *d)
     return -ENOMEM;
 }
 
-#else
-#define setup_compat_l4(v) 0
-#define release_compat_l4(v) ((void)0)
-#endif
-
 static inline bool_t standalone_trap_ctxt(struct vcpu *v)
 {
     BUILD_BUG_ON(256 * sizeof(*v->arch.pv_vcpu.trap_ctxt) > PAGE_SIZE);
@@ -390,31 +377,23 @@ static inline bool_t standalone_trap_ctx
 int vcpu_initialise(struct vcpu *v)
 {
     struct domain *d = v->domain;
+    unsigned int idx;
     int rc;
 
     v->arch.flags = TF_kernel_mode;
 
-#if defined(__i386__)
-    mapcache_vcpu_init(v);
-#else
+    idx = perdomain_pt_pgidx(v);
+    if ( !perdomain_pt_page(d, idx) )
     {
-        unsigned int idx = perdomain_pt_pgidx(v);
         struct page_info *pg;
-
-        if ( !perdomain_pt_page(d, idx) )
-        {
-            pg = alloc_domheap_page(NULL, MEMF_node(vcpu_to_node(v)));
-            if ( !pg )
-                return -ENOMEM;
-            clear_page(page_to_virt(pg));
-            perdomain_pt_page(d, idx) = pg;
-            d->arch.mm_perdomain_l2[l2_table_offset(PERDOMAIN_VIRT_START)+idx]
-                = l2e_from_page(pg, __PAGE_HYPERVISOR);
-        }
+        pg = alloc_domheap_page(NULL, MEMF_node(vcpu_to_node(v)));
+        if ( !pg )
+            return -ENOMEM;
+        clear_page(page_to_virt(pg));
+        perdomain_pt_page(d, idx) = pg;
+        d->arch.mm_perdomain_l2[l2_table_offset(PERDOMAIN_VIRT_START)+idx]
+            = l2e_from_page(pg, __PAGE_HYPERVISOR);
     }
-#endif
-
-    pae_l3_cache_init(&v->arch.pae_l3_cache);
 
     paging_vcpu_init(v);
 
@@ -499,11 +478,7 @@ void vcpu_destroy(struct vcpu *v)
 
 int arch_domain_create(struct domain *d, unsigned int domcr_flags)
 {
-#ifdef __x86_64__
     struct page_info *pg;
-#else
-    int pdpt_order;
-#endif
     int i, paging_initialised = 0;
     int rc = -ENOMEM;
 
@@ -520,18 +495,6 @@ int arch_domain_create(struct domain *d,
     d->arch.relmem = RELMEM_not_started;
     INIT_PAGE_LIST_HEAD(&d->arch.relmem_list);
 
-#if defined(__i386__)
-
-    pdpt_order = get_order_from_bytes(PDPT_L1_ENTRIES * sizeof(l1_pgentry_t));
-    d->arch.mm_perdomain_pt = alloc_xenheap_pages(pdpt_order, 0);
-    if ( d->arch.mm_perdomain_pt == NULL )
-        goto fail;
-    memset(d->arch.mm_perdomain_pt, 0, PAGE_SIZE << pdpt_order);
-
-    mapcache_domain_init(d);
-
-#else /* __x86_64__ */
-
     if ( d->domain_id && !is_idle_domain(d) &&
          cpu_has_amd_erratum(&boot_cpu_data, AMD_ERRATUM_121) )
     {
@@ -572,8 +535,6 @@ int arch_domain_create(struct domain *d,
     HYPERVISOR_COMPAT_VIRT_START(d) =
         is_hvm_domain(d) ? ~0u : __HYPERVISOR_COMPAT_VIRT_START;
 
-#endif /* __x86_64__ */
-
     if ( (rc = paging_domain_init(d, domcr_flags)) != 0 )
         goto fail;
     paging_initialised = 1;
@@ -647,24 +608,18 @@ int arch_domain_create(struct domain *d,
     free_xenheap_page(d->shared_info);
     if ( paging_initialised )
         paging_final_teardown(d);
-#ifdef __x86_64__
     if ( d->arch.mm_perdomain_l2 )
         free_domheap_page(virt_to_page(d->arch.mm_perdomain_l2));
     if ( d->arch.mm_perdomain_l3 )
         free_domheap_page(virt_to_page(d->arch.mm_perdomain_l3));
     if ( d->arch.mm_perdomain_pt_pages )
         free_domheap_page(virt_to_page(d->arch.mm_perdomain_pt_pages));
-#else
-    free_xenheap_pages(d->arch.mm_perdomain_pt, pdpt_order);
-#endif
     return rc;
 }
 
 void arch_domain_destroy(struct domain *d)
 {
-#ifdef __x86_64__
     unsigned int i;
-#endif
 
     if ( is_hvm_domain(d) )
         hvm_domain_destroy(d);
@@ -678,11 +633,6 @@ void arch_domain_destroy(struct domain *
 
     paging_final_teardown(d);
 
-#ifdef __i386__
-    free_xenheap_pages(
-        d->arch.mm_perdomain_pt,
-        get_order_from_bytes(PDPT_L1_ENTRIES * sizeof(l1_pgentry_t)));
-#else
     for ( i = 0; i < PDPT_L2_ENTRIES; ++i )
     {
         if ( perdomain_pt_page(d, i) )
@@ -691,7 +641,6 @@ void arch_domain_destroy(struct domain *
     free_domheap_page(virt_to_page(d->arch.mm_perdomain_pt_pages));
     free_domheap_page(virt_to_page(d->arch.mm_perdomain_l2));
     free_domheap_page(virt_to_page(d->arch.mm_perdomain_l3));
-#endif
 
     free_xenheap_page(d->shared_info);
     cleanup_domain_irq_mapping(d);
@@ -751,21 +700,15 @@ int arch_set_info_guest(
     {
         if ( !compat )
         {
-#ifdef __x86_64__
             if ( !is_canonical_address(c.nat->user_regs.eip) ||
                  !is_canonical_address(c.nat->event_callback_eip) ||
                  !is_canonical_address(c.nat->syscall_callback_eip) ||
                  !is_canonical_address(c.nat->failsafe_callback_eip) )
                 return -EINVAL;
-#endif
 
             fixup_guest_stack_selector(d, c.nat->user_regs.ss);
             fixup_guest_stack_selector(d, c.nat->kernel_ss);
             fixup_guest_code_selector(d, c.nat->user_regs.cs);
-#ifdef __i386__
-            fixup_guest_code_selector(d, c.nat->event_callback_cs);
-            fixup_guest_code_selector(d, c.nat->failsafe_callback_cs);
-#endif
 
             for ( i = 0; i < 256; i++ )
             {
@@ -863,7 +806,6 @@ int arch_set_info_guest(
         if ( !compat )
         {
             fail = xen_pfn_to_cr3(pfn) != c.nat->ctrlreg[3];
-#ifdef CONFIG_X86_64
             if ( pagetable_is_null(v->arch.guest_table_user) )
                 fail |= c.nat->ctrlreg[1] || !(flags & VGCF_in_kernel);
             else
@@ -876,7 +818,6 @@ int arch_set_info_guest(
 
             pfn = l4e_get_pfn(*l4tab);
             fail = compat_pfn_to_cr3(pfn) != c.cmp->ctrlreg[3];
-#endif
         }
 
         for ( i = 0; i < ARRAY_SIZE(v->arch.pv_vcpu.gdt_frames); ++i )
@@ -897,7 +838,6 @@ int arch_set_info_guest(
 
     v->arch.pv_vcpu.event_callback_eip = c(event_callback_eip);
     v->arch.pv_vcpu.failsafe_callback_eip = c(failsafe_callback_eip);
-#ifdef CONFIG_X86_64
     if ( !compat )
     {
         v->arch.pv_vcpu.syscall_callback_eip = c.nat->syscall_callback_eip;
@@ -906,7 +846,6 @@ int arch_set_info_guest(
         v->arch.pv_vcpu.gs_base_user = c.nat->gs_base_user;
     }
     else
-#endif
     {
         v->arch.pv_vcpu.event_callback_cs = c(event_callback_cs);
         v->arch.pv_vcpu.failsafe_callback_cs = c(failsafe_callback_cs);
@@ -968,7 +907,6 @@ int arch_set_info_guest(
         }
 
         v->arch.guest_table = pagetable_from_page(cr3_page);
-#ifdef __x86_64__
         if ( c.nat->ctrlreg[1] )
         {
             cr3_gfn = xen_cr3_to_pfn(c.nat->ctrlreg[1]);
@@ -1022,7 +960,6 @@ int arch_set_info_guest(
         l4tab = __va(pagetable_get_paddr(v->arch.guest_table));
         *l4tab = l4e_from_pfn(page_to_mfn(cr3_page),
             _PAGE_PRESENT|_PAGE_RW|_PAGE_USER|_PAGE_ACCESSED);
-#endif
     }
 
     if ( v->vcpu_id == 0 )
@@ -1256,8 +1193,6 @@ arch_do_vcpu_op(
     return rc;
 }
 
-#ifdef __x86_64__
-
 #define loadsegment(seg,value) ({               \
     int __r = 1;                                \
     asm volatile (                              \
@@ -1483,20 +1418,6 @@ static void save_segments(struct vcpu *v
 
 #define switch_kernel_stack(v) ((void)0)
 
-#elif defined(__i386__)
-
-#define load_segments(n) ((void)0)
-#define save_segments(p) ((void)0)
-
-static inline void switch_kernel_stack(struct vcpu *v)
-{
-    struct tss_struct *tss = &this_cpu(init_tss);
-    tss->esp1 = v->arch.pv_vcpu.kernel_sp;
-    tss->ss1  = v->arch.pv_vcpu.kernel_ss;
-}
-
-#endif /* __i386__ */
-
 static void paravirt_ctxt_switch_from(struct vcpu *v)
 {
     save_segments(v);
@@ -1812,7 +1733,6 @@ unsigned long hypercall_create_continuat
         else
             current->arch.hvm_vcpu.hcall_preempted = 1;
 
-#ifdef __x86_64__
         if ( !is_hvm_vcpu(current) ?
              !is_pv_32on64_vcpu(current) :
              (hvm_guest_x86_mode(current) == 8) )
@@ -1832,7 +1752,6 @@ unsigned long hypercall_create_continuat
             }
         }
         else
-#endif
         {
             if ( supervisor_mode_kernel )
                 regs->eip &= ~31; /* re-execute entire hypercall entry stub */
@@ -2066,7 +1985,6 @@ static void vcpu_destroy_pagetables(stru
     struct domain *d = v->domain;
     unsigned long pfn;
 
-#ifdef __x86_64__
     if ( is_pv_32on64_vcpu(v) )
     {
         pfn = l4e_get_pfn(*(l4_pgentry_t *)
@@ -2087,7 +2005,6 @@ static void vcpu_destroy_pagetables(stru
         v->arch.cr3 = 0;
         return;
     }
-#endif
 
     pfn = pagetable_get_pfn(v->arch.guest_table);
     if ( pfn != 0 )
@@ -2099,7 +2016,6 @@ static void vcpu_destroy_pagetables(stru
         v->arch.guest_table = pagetable_null();
     }
 
-#ifdef __x86_64__
     /* Drop ref to guest_table_user (from MMUEXT_NEW_USER_BASEPTR) */
     pfn = pagetable_get_pfn(v->arch.guest_table_user);
     if ( pfn != 0 )
@@ -2113,7 +2029,6 @@ static void vcpu_destroy_pagetables(stru
         }
         v->arch.guest_table_user = pagetable_null();
     }
-#endif
 
     v->arch.cr3 = 0;
 }
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/domain_build.c
--- a/xen/arch/x86/domain_build.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/domain_build.c	Wed Sep 12 13:29:30 2012 +0100
@@ -126,12 +126,6 @@ boolean_param("dom0_shadow", opt_dom0_sh
 static char __initdata opt_dom0_ioports_disable[200] = "";
 string_param("dom0_ioports_disable", opt_dom0_ioports_disable);
 
-#if defined(__i386__)
-/* No ring-3 access in initial leaf page tables. */
-#define L1_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED)
-#define L2_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_DIRTY|_PAGE_USER)
-#define L3_PROT (_PAGE_PRESENT)
-#elif defined(__x86_64__)
 /* Allow ring-3 access in long mode as guest cannot use ring 1 ... */
 #define BASE_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_USER)
 #define L1_PROT (BASE_PROT|_PAGE_GUEST_KERNEL)
@@ -140,7 +134,6 @@ string_param("dom0_ioports_disable", opt
 #define L2_PROT (BASE_PROT|_PAGE_DIRTY)
 #define L3_PROT (BASE_PROT|_PAGE_DIRTY)
 #define L4_PROT (BASE_PROT|_PAGE_DIRTY)
-#endif
 
 #define round_pgup(_p)    (((_p)+(PAGE_SIZE-1))&PAGE_MASK)
 #define round_pgdown(_p)  ((_p)&PAGE_MASK)
@@ -238,7 +231,6 @@ static unsigned long __init compute_dom0
     nr_pages = min(nr_pages, max_pages);
     nr_pages = min(nr_pages, avail);
 
-#ifdef __x86_64__
     if ( (parms->p2m_base == UNSET_ADDR) && (dom0_nrpages <= 0) &&
          ((dom0_min_nrpages <= 0) || (nr_pages > min_pages)) )
     {
@@ -271,7 +263,6 @@ static unsigned long __init compute_dom0
             printk("Dom0 memory clipped to %lu pages\n", nr_pages);
         }
     }
-#endif
 
     d->max_pages = min_t(unsigned long, max_pages, UINT_MAX);
 
@@ -443,7 +434,6 @@ int __init construct_dom0(
         return -EINVAL;
     }
 
-#if defined(__x86_64__)
     if ( compat32 )
     {
         d->arch.is_32bit_pv = d->arch.has_32bit_shinfo = 1;
@@ -451,7 +441,6 @@ int __init construct_dom0(
         if ( setup_compat_arg_xlat(v) != 0 )
             BUG();
     }
-#endif
 
     nr_pages = compute_dom0_nr_pages(d, &parms, initrd_len);
 
@@ -463,15 +452,10 @@ int __init construct_dom0(
         unsigned long mask = (1UL << L2_PAGETABLE_SHIFT) - 1;
         value = (parms.virt_hv_start_low + mask) & ~mask;
         BUG_ON(!is_pv_32bit_domain(d));
-#if defined(__i386__)
-        if ( value > HYPERVISOR_VIRT_START )
-            panic("Domain 0 expects too high a hypervisor start address.\n");
-#else
         if ( value > __HYPERVISOR_COMPAT_VIRT_START )
             panic("Domain 0 expects too high a hypervisor start address.\n");
         HYPERVISOR_COMPAT_VIRT_START(d) =
             max_t(unsigned int, m2p_compat_vstart, value);
-#endif
     }
 
     if ( (parms.p2m_base != UNSET_ADDR) && elf_32bit(&elf) )
@@ -521,12 +505,6 @@ int __init construct_dom0(
         v_end            = (vstack_end + (1UL<<22)-1) & ~((1UL<<22)-1);
         if ( (v_end - vstack_end) < (512UL << 10) )
             v_end += 1UL << 22; /* Add extra 4MB to get >= 512kB padding. */
-#if defined(__i386__)
-        /* 5 pages: 1x 3rd + 4x 2nd level */
-        if ( (((v_end - v_start + ((1UL<<L2_PAGETABLE_SHIFT)-1)) >>
-               L2_PAGETABLE_SHIFT) + 5) <= nr_pt_pages )
-            break;
-#elif defined(__x86_64__)
 #define NR(_l,_h,_s) \
     (((((_h) + ((1UL<<(_s))-1)) & ~((1UL<<(_s))-1)) - \
        ((_l) & ~((1UL<<(_s))-1))) >> (_s))
@@ -538,7 +516,6 @@ int __init construct_dom0(
               NR(v_start, v_end, L2_PAGETABLE_SHIFT))  /* # L1 */
              <= nr_pt_pages )
             break;
-#endif
     }
 
     count = v_end - v_start;
@@ -553,12 +530,7 @@ int __init construct_dom0(
         vphysmap_start = parms.p2m_base;
         vphysmap_end   = vphysmap_start + nr_pages * sizeof(unsigned long);
     }
-#ifdef __i386__
-    if ( !test_bit(XENFEAT_pae_pgdir_above_4gb, parms.f_supported) )
-        page = alloc_domheap_pages(d, order, MEMF_bits(32));
-    else
-#endif
-        page = alloc_domheap_pages(d, order, 0);
+    page = alloc_domheap_pages(d, order, 0);
     if ( page == NULL )
         panic("Not enough RAM for domain 0 allocation.\n");
     alloc_spfn = page_to_mfn(page);
@@ -571,7 +543,6 @@ int __init construct_dom0(
                      d->tot_pages;
         initrd_mfn = mfn = initrd->mod_start;
         count = PFN_UP(initrd_len);
-#ifdef __x86_64__
         if ( d->arch.physaddr_bitsize &&
              ((mfn + count - 1) >> (d->arch.physaddr_bitsize - PAGE_SHIFT)) )
         {
@@ -593,10 +564,11 @@ int __init construct_dom0(
             initrd->mod_start = initrd_mfn = page_to_mfn(page);
         }
         else
-#endif
+        {
             while ( count-- )
                 if ( assign_pages(d, mfn_to_page(mfn++), 0, 0) )
                     BUG();
+        }
         initrd->mod_end = 0;
     }
 
@@ -633,120 +605,6 @@ int __init construct_dom0(
     if ( vinitrd_start )
         mpt_alloc -= PAGE_ALIGN(initrd_len);
 
-#if defined(__i386__)
-    /*
-     * Protect the lowest 1GB of memory. We use a temporary mapping there
-     * from which we copy the kernel and ramdisk images.
-     */
-    if ( v_start < (1UL<<30) )
-    {
-        printk("Initial loading isn't allowed to lowest 1GB of memory.\n");
-        return -EINVAL;
-    }
-
-    mpt.mod_start = mpt_alloc >> PAGE_SHIFT;
-    mpt.mod_end   = vpt_end - vpt_start;
-    mpt_ptr = bootstrap_map(&mpt);
-#define MPT_ALLOC(n) (mpt_ptr += (n)*PAGE_SIZE, mpt_alloc += (n)*PAGE_SIZE)
-
-    /* WARNING: The new domain must have its 'processor' field filled in! */
-    l3start = l3tab = mpt_ptr; MPT_ALLOC(1);
-    l2start = l2tab = mpt_ptr; MPT_ALLOC(4);
-    for (i = 0; i < L3_PAGETABLE_ENTRIES; i++) {
-        if ( i < 3 )
-            clear_page(l2tab + i * L2_PAGETABLE_ENTRIES);
-        else
-            copy_page(l2tab + i * L2_PAGETABLE_ENTRIES,
-                      idle_pg_table_l2 + i * L2_PAGETABLE_ENTRIES);
-        l3tab[i] = l3e_from_pfn(mpt.mod_start + 1 + i, L3_PROT);
-        l2tab[(LINEAR_PT_VIRT_START >> L2_PAGETABLE_SHIFT)+i] =
-            l2e_from_pfn(mpt.mod_start + 1 + i, __PAGE_HYPERVISOR);
-    }
-    v->arch.guest_table = pagetable_from_pfn(mpt.mod_start);
-
-    for ( i = 0; i < PDPT_L2_ENTRIES; i++ )
-        l2tab[l2_linear_offset(PERDOMAIN_VIRT_START) + i] =
-            l2e_from_page(perdomain_pt_page(d, i), __PAGE_HYPERVISOR);
-
-    l2tab += l2_linear_offset(v_start);
-    pfn = alloc_spfn;
-    for ( count = 0; count < ((v_end-v_start)>>PAGE_SHIFT); count++ )
-    {
-        if ( !((unsigned long)l1tab & (PAGE_SIZE-1)) )
-        {
-            l1tab = mpt_ptr;
-            *l2tab = l2e_from_paddr(mpt_alloc, L2_PROT);
-            MPT_ALLOC(1);
-            l2tab++;
-            clear_page(l1tab);
-            if ( count == 0 )
-                l1tab += l1_table_offset(v_start);
-        }
-        if ( count < initrd_pfn || count >= initrd_pfn + PFN_UP(initrd_len) )
-            mfn = pfn++;
-        else
-            mfn = initrd_mfn++;
-        *l1tab = l1e_from_pfn(mfn, L1_PROT);
-        l1tab++;
-        
-        page = mfn_to_page(mfn);
-        if ( !get_page_and_type(page, d, PGT_writable_page) )
-            BUG();
-    }
-#undef MPT_ALLOC
-
-    /* Pages that are part of page tables must be read only. */
-    mpt_alloc = (paddr_t)mpt.mod_start << PAGE_SHIFT;
-    mpt_ptr = l3start;
-    l2tab = l2start + l2_linear_offset(vpt_start);
-    l1start = mpt_ptr + (l2e_get_paddr(*l2tab) - mpt_alloc);
-    l1tab = l1start + l1_table_offset(vpt_start);
-    for ( count = 0; count < nr_pt_pages; count++ ) 
-    {
-        page = mfn_to_page(l1e_get_pfn(*l1tab));
-        if ( !opt_dom0_shadow )
-            l1e_remove_flags(*l1tab, _PAGE_RW);
-        else
-            if ( !get_page_type(page, PGT_writable_page) )
-                BUG();
-
-        switch ( count )
-        {
-        case 0:
-            page->u.inuse.type_info &= ~PGT_type_mask;
-            page->u.inuse.type_info |= PGT_l3_page_table;
-            get_page(page, d); /* an extra ref because of readable mapping */
-
-            /* Get another ref to L3 page so that it can be pinned. */
-            page->u.inuse.type_info++;
-            page->count_info++;
-            set_bit(_PGT_pinned, &page->u.inuse.type_info);
-            break;
-        case 1 ... 4:
-            page->u.inuse.type_info &= ~PGT_type_mask;
-            page->u.inuse.type_info |= PGT_l2_page_table;
-            if ( count == 4 )
-                page->u.inuse.type_info |= PGT_pae_xen_l2;
-            get_page(page, d); /* an extra ref because of readable mapping */
-            break;
-        default:
-            page->u.inuse.type_info &= ~PGT_type_mask;
-            page->u.inuse.type_info |= PGT_l1_page_table;
-            get_page(page, d); /* an extra ref because of readable mapping */
-            break;
-        }
-        if ( !((unsigned long)++l1tab & (PAGE_SIZE - 1)) )
-            l1tab = mpt_ptr + (l2e_get_paddr(*++l2tab) - mpt_alloc);
-    }
-
-    /*
-     * Put Xen's first L3 entry into Dom0's page tables so that updates
-     * through bootstrap_map() will affect the page tables we will run on.
-     */
-    l3start[0] = l3e_from_paddr(__pa(idle_pg_table_l2), L3_PROT);
-
-#elif defined(__x86_64__)
-
     /* Overlap with Xen protected area? */
     if ( !is_pv_32on64_domain(d) ?
          ((v_start < HYPERVISOR_VIRT_END) &&
@@ -903,8 +761,6 @@ int __init construct_dom0(
         }
     }
 
-#endif /* __x86_64__ */
-
     /* Mask all upcalls... */
     for ( i = 0; i < XEN_LEGACY_MAX_VCPUS; i++ )
         shared_info(d, vcpu_info[i].evtchn_upcall_mask) = 1;
@@ -971,7 +827,6 @@ int __init construct_dom0(
              elf_64bit(&elf) ? 64 : 32, parms.pae ? "p" : "");
 
     count = d->tot_pages;
-#ifdef __x86_64__
     /* Set up the phys->machine table if not part of the initial mapping. */
     if ( parms.p2m_base != UNSET_ADDR )
     {
@@ -1071,7 +926,6 @@ int __init construct_dom0(
         if ( !page )
             panic("Not enough RAM for DOM0 P->M table.\n");
     }
-#endif
 
     /* Write the phys->machine and machine->phys table entries. */
     for ( pfn = 0; pfn < count; pfn++ )
@@ -1158,34 +1012,12 @@ int __init construct_dom0(
         si->console.dom0.info_size = sizeof(struct dom0_vga_console_info);
     }
 
-#if defined(__x86_64__)
     if ( is_pv_32on64_domain(d) )
         xlat_start_info(si, XLAT_start_info_console_dom0);
-#endif
 
     /* Return to idle domain's page tables. */
     write_ptbase(current);
 
-#if defined(__i386__)
-    /* Restore Dom0's first L3 entry. */
-    mpt.mod_end = 5 * PAGE_SIZE;
-    l3start = mpt_ptr = bootstrap_map(&mpt);
-    l2start = mpt_ptr + PAGE_SIZE;
-    l3start[0] = l3e_from_pfn(mpt.mod_start + 1, L3_PROT);
-
-    /* Re-setup CR3  */
-    if ( paging_mode_enabled(d) )
-        paging_update_paging_modes(v);
-    else
-        update_cr3(v);
-
-    /*
-     * Destroy low mappings - they were only for our convenience. Note
-     * that zap_low_mappings() exceeds what bootstrap_map(NULL) would do.
-     */
-    zap_low_mappings(l2start);
-#endif
-
     update_domain_wallclock_time(d);
 
     v->is_initialised = 1;
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/domctl.c	Wed Sep 12 13:29:30 2012 +0100
@@ -156,7 +156,6 @@ long arch_do_domctl(
     break;
 
     case XEN_DOMCTL_getpageframeinfo3:
-#ifdef __x86_64__
         if (!has_32bit_shinfo(current->domain))
         {
             unsigned int n, j;
@@ -258,7 +257,6 @@ long arch_do_domctl(
             rcu_unlock_domain(d);
             break;
         }
-#endif
         /* fall thru */
     case XEN_DOMCTL_getpageframeinfo2:
     {
@@ -1004,7 +1002,6 @@ long arch_do_domctl(
         if ( domctl->cmd == XEN_DOMCTL_get_ext_vcpucontext )
         {
             evc->size = sizeof(*evc);
-#ifdef __x86_64__
             if ( !is_hvm_domain(d) )
             {
                 evc->sysenter_callback_cs      =
@@ -1021,7 +1018,6 @@ long arch_do_domctl(
                     v->arch.pv_vcpu.syscall32_disables_events;
             }
             else
-#endif
             {
                 evc->sysenter_callback_cs      = 0;
                 evc->sysenter_callback_eip     = 0;
@@ -1037,7 +1033,6 @@ long arch_do_domctl(
             ret = -EINVAL;
             if ( evc->size < offsetof(typeof(*evc), mcg_cap) )
                 goto ext_vcpucontext_out;
-#ifdef __x86_64__
             if ( !is_hvm_domain(d) )
             {
                 if ( !is_canonical_address(evc->sysenter_callback_eip) ||
@@ -1059,7 +1054,6 @@ long arch_do_domctl(
                     evc->syscall32_disables_events;
             }
             else
-#endif
             /* We do not support syscall/syscall32/sysenter on 32-bit Xen. */
             if ( (evc->sysenter_callback_cs & ~3) ||
                  evc->sysenter_callback_eip ||
@@ -1443,7 +1437,6 @@ long arch_do_domctl(
     }
     break;
 
-#ifdef __x86_64__
     case XEN_DOMCTL_mem_event_op:
     {
         struct domain *d;
@@ -1477,7 +1470,6 @@ long arch_do_domctl(
         } 
     }
     break;
-#endif /* __x86_64__ */
 
 #if P2M_AUDIT
     case XEN_DOMCTL_audit_p2m:
@@ -1594,12 +1586,9 @@ void arch_get_info_guest(struct vcpu *v,
         c.nat->user_regs.es = sreg.sel;
         hvm_get_segment_register(v, x86_seg_fs, &sreg);
         c.nat->user_regs.fs = sreg.sel;
-#ifdef __x86_64__
         c.nat->fs_base = sreg.base;
-#endif
         hvm_get_segment_register(v, x86_seg_gs, &sreg);
         c.nat->user_regs.gs = sreg.sel;
-#ifdef __x86_64__
         if ( ring_0(&c.nat->user_regs) )
         {
             c.nat->gs_base_kernel = sreg.base;
@@ -1610,7 +1599,6 @@ void arch_get_info_guest(struct vcpu *v,
             c.nat->gs_base_user = sreg.base;
             c.nat->gs_base_kernel = hvm_get_shadow_gs_base(v);
         }
-#endif
     }
     else
     {
@@ -1631,7 +1619,6 @@ void arch_get_info_guest(struct vcpu *v,
             c(ctrlreg[i] = v->arch.pv_vcpu.ctrlreg[i]);
         c(event_callback_eip = v->arch.pv_vcpu.event_callback_eip);
         c(failsafe_callback_eip = v->arch.pv_vcpu.failsafe_callback_eip);
-#ifdef CONFIG_X86_64
         if ( !compat )
         {
             c.nat->syscall_callback_eip = v->arch.pv_vcpu.syscall_callback_eip;
@@ -1640,7 +1627,6 @@ void arch_get_info_guest(struct vcpu *v,
             c.nat->gs_base_user = v->arch.pv_vcpu.gs_base_user;
         }
         else
-#endif
         {
             c(event_callback_cs = v->arch.pv_vcpu.event_callback_cs);
             c(failsafe_callback_cs = v->arch.pv_vcpu.failsafe_callback_cs);
@@ -1655,11 +1641,9 @@ void arch_get_info_guest(struct vcpu *v,
         {
             c.nat->ctrlreg[3] = xen_pfn_to_cr3(
                 pagetable_get_pfn(v->arch.guest_table));
-#ifdef __x86_64__
             c.nat->ctrlreg[1] =
                 pagetable_is_null(v->arch.guest_table_user) ? 0
                 : xen_pfn_to_cr3(pagetable_get_pfn(v->arch.guest_table_user));
-#endif
 
             /* Merge shadow DR7 bits into real DR7. */
             c.nat->debugreg[7] |= c.nat->debugreg[5];
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/e820.c
--- a/xen/arch/x86/e820.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/e820.c	Wed Sep 12 13:29:30 2012 +0100
@@ -514,6 +514,7 @@ static void __init reserve_dmi_region(vo
 static void __init machine_specific_memory_setup(
     struct e820entry *raw, int *raw_nr)
 {
+    unsigned long mpt_limit, ro_mpt_limit;
     uint64_t top_of_ram, size;
     int i;
 
@@ -536,25 +537,15 @@ static void __init machine_specific_memo
                 NULL);
     }
 
-#ifdef __i386__
-    clip_to_limit((1ULL << 30) * MACHPHYS_MBYTES,
-                  "Only the first %lu GB of the physical memory map "
-                  "can be accessed by Xen in 32-bit mode.");
-#else
-    {
-        unsigned long mpt_limit, ro_mpt_limit;
-
-        mpt_limit = ((RDWR_MPT_VIRT_END - RDWR_MPT_VIRT_START)
-                     / sizeof(unsigned long)) << PAGE_SHIFT;
-        ro_mpt_limit = ((RO_MPT_VIRT_END - RO_MPT_VIRT_START)
-                        / sizeof(unsigned long)) << PAGE_SHIFT;
-        if ( mpt_limit > ro_mpt_limit )
-            mpt_limit = ro_mpt_limit;
-        clip_to_limit(mpt_limit,
-                      "Only the first %lu GB of the physical "
-                      "memory map can be accessed by Xen.");
-    }
-#endif
+    mpt_limit = ((RDWR_MPT_VIRT_END - RDWR_MPT_VIRT_START)
+                 / sizeof(unsigned long)) << PAGE_SHIFT;
+    ro_mpt_limit = ((RO_MPT_VIRT_END - RO_MPT_VIRT_START)
+                    / sizeof(unsigned long)) << PAGE_SHIFT;
+    if ( mpt_limit > ro_mpt_limit )
+        mpt_limit = ro_mpt_limit;
+    clip_to_limit(mpt_limit,
+                  "Only the first %lu GB of the physical "
+                  "memory map can be accessed by Xen.");
 
     reserve_dmi_region();
 
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/extable.c
--- a/xen/arch/x86/extable.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/extable.c	Wed Sep 12 13:29:30 2012 +0100
@@ -6,12 +6,7 @@
 #include <xen/spinlock.h>
 #include <asm/uaccess.h>
 
-#ifdef __i386__
-#define EX_FIELD(ptr, field) (ptr)->field
-#define swap_ex NULL
-#else
 #define EX_FIELD(ptr, field) ((unsigned long)&(ptr)->field + (ptr)->field)
-#endif
 
 static inline unsigned long ex_addr(const struct exception_table_entry *x)
 {
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/genapic/x2apic.c
--- a/xen/arch/x86/genapic/x2apic.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/genapic/x2apic.c	Wed Sep 12 13:29:30 2012 +0100
@@ -138,19 +138,7 @@ void __init check_x2apic_preenabled(void
     if ( lo & MSR_IA32_APICBASE_EXTD )
     {
         printk("x2APIC mode is already enabled by BIOS.\n");
-#ifndef __i386__
         x2apic_enabled = 1;
         genapic = apic_x2apic_probe();
-#else
-        lo &= ~(MSR_IA32_APICBASE_ENABLE | MSR_IA32_APICBASE_EXTD);
-        wrmsr(MSR_IA32_APICBASE, lo, hi);
-        lo |= MSR_IA32_APICBASE_ENABLE;
-        wrmsr(MSR_IA32_APICBASE, lo, hi);
-        printk("x2APIC disabled permanently on x86_32.\n");
-#endif
     }
-
-#ifdef __i386__
-    clear_bit(X86_FEATURE_X2APIC, boot_cpu_data.x86_capability);
-#endif
 }
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/hvm/hvm.c	Wed Sep 12 13:29:30 2012 +0100
@@ -681,7 +681,6 @@ static int hvm_save_cpu_ctxt(struct doma
         ctxt.rsp = v->arch.user_regs.esp;
         ctxt.rip = v->arch.user_regs.eip;
         ctxt.rflags = v->arch.user_regs.eflags;
-#ifdef __x86_64__
         ctxt.r8  = v->arch.user_regs.r8;
         ctxt.r9  = v->arch.user_regs.r9;
         ctxt.r10 = v->arch.user_regs.r10;
@@ -690,7 +689,6 @@ static int hvm_save_cpu_ctxt(struct doma
         ctxt.r13 = v->arch.user_regs.r13;
         ctxt.r14 = v->arch.user_regs.r14;
         ctxt.r15 = v->arch.user_regs.r15;
-#endif
         ctxt.dr0 = v->arch.debugreg[0];
         ctxt.dr1 = v->arch.debugreg[1];
         ctxt.dr2 = v->arch.debugreg[2];
@@ -867,7 +865,6 @@ static int hvm_load_cpu_ctxt(struct doma
     v->arch.user_regs.esp = ctxt.rsp;
     v->arch.user_regs.eip = ctxt.rip;
     v->arch.user_regs.eflags = ctxt.rflags | 2;
-#ifdef __x86_64__
     v->arch.user_regs.r8  = ctxt.r8;
     v->arch.user_regs.r9  = ctxt.r9;
     v->arch.user_regs.r10 = ctxt.r10;
@@ -876,7 +873,6 @@ static int hvm_load_cpu_ctxt(struct doma
     v->arch.user_regs.r13 = ctxt.r13;
     v->arch.user_regs.r14 = ctxt.r14;
     v->arch.user_regs.r15 = ctxt.r15;
-#endif
     v->arch.debugreg[0] = ctxt.dr0;
     v->arch.debugreg[1] = ctxt.dr1;
     v->arch.debugreg[2] = ctxt.dr2;
@@ -1259,9 +1255,7 @@ int hvm_hap_nested_page_fault(paddr_t gp
     struct vcpu *v = current;
     struct p2m_domain *p2m;
     int rc, fall_through = 0, paged = 0;
-#ifdef __x86_64__
     int sharing_enomem = 0;
-#endif
     mem_event_request_t *req_ptr = NULL;
 
     /* On Nested Virtualization, walk the guest page table.
@@ -1370,7 +1364,6 @@ int hvm_hap_nested_page_fault(paddr_t gp
         goto out;
     }
 
-#ifdef __x86_64__
     /* Check if the page has been paged out */
     if ( p2m_is_paged(p2mt) || (p2mt == p2m_ram_paging_out) )
         paged = 1;
@@ -1384,7 +1377,6 @@ int hvm_hap_nested_page_fault(paddr_t gp
         rc = 1;
         goto out_put_gfn;
     }
-#endif
  
     /* Spurious fault? PoD and log-dirty also take this path. */
     if ( p2m_is_ram(p2mt) )
@@ -1426,7 +1418,6 @@ out:
      * locks in such circumstance */
     if ( paged )
         p2m_mem_paging_populate(v->domain, gfn);
-#ifdef __x86_64__
     if ( sharing_enomem )
     {
         int rv;
@@ -1439,7 +1430,6 @@ out:
             rc = 0;
         }
     }
-#endif
     if ( req_ptr )
     {
         mem_access_send_req(v->domain, req_ptr);
@@ -2625,14 +2615,12 @@ unsigned long copy_to_user_hvm(void *to,
 {
     int rc;
 
-#ifdef __x86_64__
     if ( !current->arch.hvm_vcpu.hcall_64bit &&
          is_compat_arg_xlat_range(to, len) )
     {
         memcpy(to, from, len);
         return 0;
     }
-#endif
 
     rc = hvm_copy_to_guest_virt_nofault((unsigned long)to, (void *)from,
                                         len, 0);
@@ -2643,14 +2631,12 @@ unsigned long clear_user_hvm(void *to, u
 {
     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 */
@@ -2660,14 +2646,12 @@ unsigned long copy_from_user_hvm(void *t
 {
     int rc;
 
-#ifdef __x86_64__
     if ( !current->arch.hvm_vcpu.hcall_64bit &&
          is_compat_arg_xlat_range(from, len) )
     {
         memcpy(to, from, len);
         return 0;
     }
-#endif
 
     rc = hvm_copy_from_guest_virt_nofault(to, (unsigned long)from, len, 0);
     return rc ? len : 0; /* fake a copy_from_user() return code */
@@ -3121,24 +3105,6 @@ typedef unsigned long hvm_hypercall_t(
 #define HYPERCALL(x)                                        \
     [ __HYPERVISOR_ ## x ] = (hvm_hypercall_t *) do_ ## x
 
-#if defined(__i386__)
-
-static hvm_hypercall_t *hvm_hypercall32_table[NR_hypercalls] = {
-    [ __HYPERVISOR_memory_op ] = (hvm_hypercall_t *)hvm_memory_op,
-    [ __HYPERVISOR_grant_table_op ] = (hvm_hypercall_t *)hvm_grant_table_op,
-    [ __HYPERVISOR_vcpu_op ] = (hvm_hypercall_t *)hvm_vcpu_op,
-    [ __HYPERVISOR_physdev_op ] = (hvm_hypercall_t *)hvm_physdev_op,
-    HYPERCALL(xen_version),
-    HYPERCALL(event_channel_op),
-    HYPERCALL(sched_op),
-    HYPERCALL(set_timer_op),
-    HYPERCALL(hvm_op),
-    HYPERCALL(sysctl),
-    HYPERCALL(tmem_op)
-};
-
-#else /* defined(__x86_64__) */
-
 static long hvm_grant_table_op_compat32(unsigned int cmd,
                                         XEN_GUEST_HANDLE(void) uop,
                                         unsigned int count)
@@ -3239,8 +3205,6 @@ static hvm_hypercall_t *hvm_hypercall32_
     HYPERCALL(tmem_op)
 };
 
-#endif /* defined(__x86_64__) */
-
 int hvm_do_hypercall(struct cpu_user_regs *regs)
 {
     struct vcpu *curr = current;
@@ -3250,9 +3214,7 @@ int hvm_do_hypercall(struct cpu_user_reg
 
     switch ( mode )
     {
-#ifdef __x86_64__
     case 8:        
-#endif
     case 4:
     case 2:
         hvm_get_segment_register(curr, x86_seg_ss, &sreg);
@@ -3277,7 +3239,6 @@ int hvm_do_hypercall(struct cpu_user_reg
 
     curr->arch.hvm_vcpu.hcall_preempted = 0;
 
-#ifdef __x86_64__
     if ( mode == 8 )
     {
         HVM_DBG_LOG(DBG_LEVEL_HCALL, "hcall%u(%lx, %lx, %lx, %lx, %lx, %lx)",
@@ -3294,7 +3255,6 @@ int hvm_do_hypercall(struct cpu_user_reg
         curr->arch.hvm_vcpu.hcall_64bit = 0;
     }
     else
-#endif
     {
         HVM_DBG_LOG(DBG_LEVEL_HCALL, "hcall%u(%x, %x, %x, %x, %x, %x)", eax,
                     (uint32_t)regs->ebx, (uint32_t)regs->ecx,
@@ -4369,7 +4329,6 @@ int hvm_debug_op(struct vcpu *v, int32_t
     return rc;
 }
 
-#ifdef __x86_64__
 static int hvm_memory_event_traps(long p, uint32_t reason,
                                   unsigned long value, unsigned long old, 
                                   bool_t gla_valid, unsigned long gla) 
@@ -4462,7 +4421,6 @@ int hvm_memory_event_single_step(unsigne
             MEM_EVENT_REASON_SINGLESTEP,
             gfn, 0, 1, gla);
 }
-#endif /* __x86_64__ */
 
 int nhvm_vcpu_hostrestore(struct vcpu *v, struct cpu_user_regs *regs)
 {
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/hvm/svm/emulate.c
--- a/xen/arch/x86/hvm/svm/emulate.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/hvm/svm/emulate.c	Wed Sep 12 13:29:30 2012 +0100
@@ -44,9 +44,7 @@ static unsigned int is_prefix(u8 opc)
     case 0xF0:
     case 0xF3:
     case 0xF2:
-#if __x86_64__
     case 0x40 ... 0x4f:
-#endif /* __x86_64__ */
         return 1;
     }
     return 0;
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/hvm/svm/entry.S
--- a/xen/arch/x86/hvm/svm/entry.S	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/hvm/svm/entry.S	Wed Sep 12 13:29:30 2012 +0100
@@ -33,24 +33,11 @@
 
 #define get_current(reg) GET_CURRENT(r(reg))
         
-#if defined(__x86_64__)
 #define r(reg) %r##reg
 #define addr_of(lbl) lbl(%rip)
 #define call_with_regs(fn)                      \
         mov  %rsp,%rdi;                         \
         call fn;
-#else /* defined(__i386__) */
-#define r(reg) %e##reg
-#define addr_of(lbl) lbl
-#define UREGS_rax UREGS_eax
-#define UREGS_rip UREGS_eip
-#define UREGS_rsp UREGS_esp
-#define call_with_regs(fn)                      \
-        mov  %esp,%eax;                         \
-        push %eax;                              \
-        call fn;                                \
-        add  $4,%esp;
-#endif
 
 ENTRY(svm_asm_do_resume)
         call svm_intr_assist
@@ -93,7 +80,6 @@ UNLIKELY_END(svm_trace)
 
         mov  VCPU_svm_vmcb_pa(r(bx)),r(ax)
 
-#if defined(__x86_64__)
         pop  %r15
         pop  %r14
         pop  %r13
@@ -109,18 +95,9 @@ UNLIKELY_END(svm_trace)
         pop  %rdx
         pop  %rsi
         pop  %rdi
-#else /* defined(__i386__) */
-        pop  %ebx
-        pop  %ecx
-        pop  %edx
-        pop  %esi
-        pop  %edi
-        pop  %ebp
-#endif
 
         VMRUN
 
-#if defined(__x86_64__)
         push %rdi
         push %rsi
         push %rdx
@@ -136,14 +113,6 @@ UNLIKELY_END(svm_trace)
         push %r13
         push %r14
         push %r15
-#else /* defined(__i386__) */
-        push %ebp
-        push %edi
-        push %esi
-        push %edx
-        push %ecx
-        push %ebx
-#endif
 
         get_current(bx)
         movb $0,VCPU_svm_vmcb_in_sync(r(bx))
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/hvm/svm/svm.c	Wed Sep 12 13:29:30 2012 +0100
@@ -871,12 +871,10 @@ static void svm_ctxt_switch_from(struct 
     svm_sync_vmcb(v);
     svm_vmload(per_cpu(root_vmcb, cpu));
 
-#ifdef __x86_64__
     /* Resume use of ISTs now that the host TR is reinstated. */
     idt_tables[cpu][TRAP_double_fault].a  |= IST_DF << 32;
     idt_tables[cpu][TRAP_nmi].a           |= IST_NMI << 32;
     idt_tables[cpu][TRAP_machine_check].a |= IST_MCE << 32;
-#endif
 }
 
 static void svm_ctxt_switch_to(struct vcpu *v)
@@ -884,7 +882,6 @@ static void svm_ctxt_switch_to(struct vc
     struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb;
     int cpu = smp_processor_id();
 
-#ifdef  __x86_64__
     /* 
      * This is required, because VMRUN does consistency check
      * and some of the DOM0 selectors are pointing to 
@@ -902,7 +899,6 @@ static void svm_ctxt_switch_to(struct vc
     idt_tables[cpu][TRAP_double_fault].a  &= ~(7UL << 32);
     idt_tables[cpu][TRAP_nmi].a           &= ~(7UL << 32);
     idt_tables[cpu][TRAP_machine_check].a &= ~(7UL << 32);
-#endif
 
     svm_restore_dr(v);
 
@@ -1222,7 +1218,6 @@ static int svm_cpu_up(void)
     /* Initialize core's ASID handling. */
     svm_asid_init(c);
 
-#ifdef __x86_64__
     /*
      * Check whether EFER.LMSLE can be written.
      * Unfortunately there's no feature bit defined for this.
@@ -1242,7 +1237,6 @@ static int svm_cpu_up(void)
             printk(XENLOG_WARNING "Inconsistent LMSLE support across CPUs!\n");
         cpu_has_lmsl = 0;
     }
-#endif
 
     /* Initialize OSVW bits to be used by guests */
     svm_host_osvw_init();
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/hvm/viridian.c
--- a/xen/arch/x86/hvm/viridian.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/hvm/viridian.c	Wed Sep 12 13:29:30 2012 +0100
@@ -346,13 +346,11 @@ int viridian_hypercall(struct cpu_user_r
 
     switch ( mode )
     {
-#ifdef __x86_64__
     case 8:
         input.raw = regs->rcx;
         input_params_gpa = regs->rdx;
         output_params_gpa = regs->r8;
         break;
-#endif
     case 4:
         input.raw = ((uint64_t)regs->edx << 32) | regs->eax;
         input_params_gpa = ((uint64_t)regs->ebx << 32) | regs->ecx;
@@ -377,11 +375,9 @@ int viridian_hypercall(struct cpu_user_r
 out:
     output.result = status;
     switch (mode) {
-#ifdef __x86_64__
     case 8:
         regs->rax = output.raw;
         break;
-#endif
     default:
         regs->edx = output.raw >> 32;
         regs->eax = output.raw;
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/hvm/vlapic.c
--- a/xen/arch/x86/hvm/vlapic.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/hvm/vlapic.c	Wed Sep 12 13:29:30 2012 +0100
@@ -1184,11 +1184,6 @@ int vlapic_init(struct vcpu *v)
 
     vlapic->pt.source = PTSRC_lapic;
 
-#ifdef __i386__
-    /* 32-bit VMX may be limited to 32-bit physical addresses. */
-    if ( boot_cpu_data.x86_vendor == X86_VENDOR_INTEL )
-        memflags |= MEMF_bits(32);
-#endif
     if (vlapic->regs_page == NULL)
     {
         vlapic->regs_page = alloc_domheap_page(NULL, memflags);
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/hvm/vmx/entry.S
--- a/xen/arch/x86/hvm/vmx/entry.S	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/hvm/vmx/entry.S	Wed Sep 12 13:29:30 2012 +0100
@@ -38,28 +38,15 @@
 
 #define get_current(reg) GET_CURRENT(r(reg))
 
-#if defined(__x86_64__)
 #define r(reg) %r##reg
 #define addr_of(lbl) lbl(%rip)
 #define call_with_regs(fn)                      \
         mov  %rsp,%rdi;                         \
         call fn;
-#else /* defined(__i386__) */
-#define r(reg) %e##reg
-#define addr_of(lbl) lbl
-#define UREGS_rip UREGS_eip
-#define UREGS_rsp UREGS_esp
-#define call_with_regs(fn)                      \
-        mov  %esp,%eax;                         \
-        push %eax;                              \
-        call fn;                                \
-        add  $4,%esp;
-#endif
 
         ALIGN
 .globl vmx_asm_vmexit_handler
 vmx_asm_vmexit_handler:
-#if defined(__x86_64__)
         push %rdi
         push %rsi
         push %rdx
@@ -75,15 +62,6 @@ vmx_asm_vmexit_handler:
         push %r13
         push %r14
         push %r15
-#else /* defined(__i386__) */
-        push %eax
-        push %ebp
-        push %edi
-        push %esi
-        push %edx
-        push %ecx
-        push %ebx
-#endif
 
         get_current(bx)
 
@@ -153,7 +131,6 @@ UNLIKELY_END(realmode)
         VMWRITE(UREGS_eflags)
 
         cmpb $0,VCPU_vmx_launched(r(bx))
-#if defined(__x86_64__)
         pop  %r15
         pop  %r14
         pop  %r13
@@ -169,15 +146,6 @@ UNLIKELY_END(realmode)
         pop  %rdx
         pop  %rsi
         pop  %rdi
-#else /* defined(__i386__) */
-        pop  %ebx
-        pop  %ecx
-        pop  %edx
-        pop  %esi
-        pop  %edi
-        pop  %ebp
-        pop  %eax
-#endif
         je   .Lvmx_launch
 
 /*.Lvmx_resume:*/
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/hvm/vmx/vmcs.c
--- a/xen/arch/x86/hvm/vmx/vmcs.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/hvm/vmx/vmcs.c	Wed Sep 12 13:29:30 2012 +0100
@@ -145,10 +145,8 @@ static int vmx_init_vmcs_config(void)
 
     min = (CPU_BASED_HLT_EXITING |
            CPU_BASED_VIRTUAL_INTR_PENDING |
-#ifdef __x86_64__
            CPU_BASED_CR8_LOAD_EXITING |
            CPU_BASED_CR8_STORE_EXITING |
-#endif
            CPU_BASED_INVLPG_EXITING |
            CPU_BASED_CR3_LOAD_EXITING |
            CPU_BASED_CR3_STORE_EXITING |
@@ -166,11 +164,9 @@ static int vmx_init_vmcs_config(void)
         "CPU-Based Exec Control", min, opt,
         MSR_IA32_VMX_PROCBASED_CTLS, &mismatch);
     _vmx_cpu_based_exec_control &= ~CPU_BASED_RDTSC_EXITING;
-#ifdef __x86_64__
     if ( _vmx_cpu_based_exec_control & CPU_BASED_TPR_SHADOW )
         _vmx_cpu_based_exec_control &=
             ~(CPU_BASED_CR8_LOAD_EXITING | CPU_BASED_CR8_STORE_EXITING);
-#endif
 
     if ( _vmx_cpu_based_exec_control & CPU_BASED_ACTIVATE_SECONDARY_CONTROLS )
     {
@@ -249,18 +245,9 @@ static int vmx_init_vmcs_config(void)
         _vmx_secondary_exec_control &= ~ SECONDARY_EXEC_PAUSE_LOOP_EXITING;
     }
 
-#if defined(__i386__)
-    /* If we can't virtualise APIC accesses, the TPR shadow is pointless. */
-    if ( !(_vmx_secondary_exec_control &
-           SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES) )
-        _vmx_cpu_based_exec_control &= ~CPU_BASED_TPR_SHADOW;
-#endif
-
     min = VM_EXIT_ACK_INTR_ON_EXIT;
     opt = VM_EXIT_SAVE_GUEST_PAT | VM_EXIT_LOAD_HOST_PAT;
-#ifdef __x86_64__
     min |= VM_EXIT_IA32E_MODE;
-#endif
     _vmx_vmexit_control = adjust_vmx_controls(
         "VMExit Control", min, opt, MSR_IA32_VMX_EXIT_CTLS, &mismatch);
 
@@ -333,7 +320,6 @@ static int vmx_init_vmcs_config(void)
         return -EINVAL;
     }
 
-#ifdef __x86_64__
     /* IA-32 SDM Vol 3B: 64-bit CPUs always have VMX_BASIC_MSR[48]==0. */
     if ( vmx_basic_msr_high & (1u<<16) )
     {
@@ -341,7 +327,6 @@ static int vmx_init_vmcs_config(void)
                smp_processor_id());
         return -EINVAL;
     }
-#endif
 
     /* Require Write-Back (WB) memory type for VMCS accesses. */
     if ( ((vmx_basic_msr_high >> 18) & 15) != 6 )
@@ -866,9 +851,6 @@ static int construct_vmcs(struct vcpu *v
     __vmwrite(GUEST_INTERRUPTIBILITY_INFO, 0);
     __vmwrite(GUEST_DR7, 0);
     __vmwrite(VMCS_LINK_POINTER, ~0UL);
-#if defined(__i386__)
-    __vmwrite(VMCS_LINK_POINTER_HIGH, ~0UL);
-#endif
 
     v->arch.hvm_vmx.exception_bitmap = HVM_TRAP_MASK
               | (paging_mode_hap(d) ? 0 : (1U << TRAP_page_fault))
@@ -889,13 +871,7 @@ static int construct_vmcs(struct vcpu *v
     }
 
     if ( paging_mode_hap(d) )
-    {
         __vmwrite(EPT_POINTER, d->arch.hvm_domain.vmx.ept_control.eptp);
-#ifdef __i386__
-        __vmwrite(EPT_POINTER_HIGH,
-                  d->arch.hvm_domain.vmx.ept_control.eptp >> 32);
-#endif
-    }
 
     if ( cpu_has_vmx_pat && paging_mode_hap(d) )
     {
@@ -906,10 +882,6 @@ static int construct_vmcs(struct vcpu *v
 
         __vmwrite(HOST_PAT, host_pat);
         __vmwrite(GUEST_PAT, guest_pat);
-#ifdef __i386__
-        __vmwrite(HOST_PAT_HIGH, host_pat >> 32);
-        __vmwrite(GUEST_PAT_HIGH, guest_pat >> 32);
-#endif
     }
 
     vmx_vmcs_exit(v);
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Wed Sep 12 13:29:30 2012 +0100
@@ -145,8 +145,6 @@ static void vmx_vcpu_destroy(struct vcpu
     passive_domain_destroy(v);
 }
 
-#ifdef __x86_64__
-
 static DEFINE_PER_CPU(struct vmx_msr_state, host_msr_state);
 
 static u32 msr_index[] =
@@ -338,28 +336,6 @@ static void vmx_restore_guest_msrs(struc
         wrmsrl(MSR_TSC_AUX, hvm_msr_tsc_aux(v));
 }
 
-#else  /* __i386__ */
-
-void vmx_save_host_msrs(void) {}
-#define vmx_restore_host_msrs()     ((void)0)
-
-#define vmx_save_guest_msrs(v)      ((void)0)
-#define vmx_restore_guest_msrs(v)   ((void)0)
-
-static enum handler_return
-long_mode_do_msr_read(unsigned int msr, uint64_t *msr_content)
-{
-    return HNDL_unhandled;
-}
-
-static enum handler_return
-long_mode_do_msr_write(unsigned int msr, uint64_t msr_content)
-{
-    return HNDL_unhandled;
-}
-
-#endif /* __i386__ */
-
 void vmx_update_cpu_exec_control(struct vcpu *v)
 {
     if ( nestedhvm_vcpu_in_guestmode(v) )
@@ -565,7 +541,6 @@ static int vmx_vmcs_restore(struct vcpu 
 
 static void vmx_save_cpu_state(struct vcpu *v, struct hvm_hw_cpu *data)
 {
-#ifdef __x86_64__
     struct vmx_msr_state *guest_state = &v->arch.hvm_vmx.msr_state;
     unsigned long guest_flags = guest_state->flags;
 
@@ -577,14 +552,12 @@ static void vmx_save_cpu_state(struct vc
     data->msr_lstar        = guest_state->msrs[VMX_INDEX_MSR_LSTAR];
     data->msr_star         = guest_state->msrs[VMX_INDEX_MSR_STAR];
     data->msr_syscall_mask = guest_state->msrs[VMX_INDEX_MSR_SYSCALL_MASK];
-#endif
 
     data->tsc = hvm_get_guest_tsc(v);
 }
 
 static void vmx_load_cpu_state(struct vcpu *v, struct hvm_hw_cpu *data)
 {
-#ifdef __x86_64__
     struct vmx_msr_state *guest_state = &v->arch.hvm_vmx.msr_state;
 
     /* restore msrs */
@@ -595,7 +568,6 @@ static void vmx_load_cpu_state(struct vc
 
     v->arch.hvm_vmx.cstar     = data->msr_cstar;
     v->arch.hvm_vmx.shadow_gs = data->shadow_gs;
-#endif
 
     hvm_set_guest_tsc(v, data->tsc);
 }
@@ -942,11 +914,7 @@ static void vmx_set_segment_register(str
 
 static unsigned long vmx_get_shadow_gs_base(struct vcpu *v)
 {
-#ifdef __x86_64__
     return v->arch.hvm_vmx.shadow_gs;
-#else
-    return 0;
-#endif
 }
 
 static int vmx_set_guest_pat(struct vcpu *v, u64 gpat)
@@ -956,9 +924,6 @@ static int vmx_set_guest_pat(struct vcpu
 
     vmx_vmcs_enter(v);
     __vmwrite(GUEST_PAT, gpat);
-#ifdef __i386__
-    __vmwrite(GUEST_PAT_HIGH, gpat >> 32);
-#endif
     vmx_vmcs_exit(v);
     return 1;
 }
@@ -970,9 +935,6 @@ static int vmx_get_guest_pat(struct vcpu
 
     vmx_vmcs_enter(v);
     *gpat = __vmread(GUEST_PAT);
-#ifdef __i386__
-    *gpat |= (u64)__vmread(GUEST_PAT_HIGH) << 32;
-#endif
     vmx_vmcs_exit(v);
     return 1;
 }
@@ -985,9 +947,6 @@ static void vmx_set_tsc_offset(struct vc
         offset += nvmx_get_tsc_offset(v);
 
     __vmwrite(TSC_OFFSET, offset);
-#if defined (__i386__)
-    __vmwrite(TSC_OFFSET_HIGH, offset >> 32);
-#endif
     vmx_vmcs_exit(v);
 }
 
@@ -1074,12 +1033,6 @@ static void vmx_load_pdptrs(struct vcpu 
     __vmwrite(GUEST_PDPTR1, guest_pdptrs[1]);
     __vmwrite(GUEST_PDPTR2, guest_pdptrs[2]);
     __vmwrite(GUEST_PDPTR3, guest_pdptrs[3]);
-#ifdef __i386__
-    __vmwrite(GUEST_PDPTR0_HIGH, guest_pdptrs[0] >> 32);
-    __vmwrite(GUEST_PDPTR1_HIGH, guest_pdptrs[1] >> 32);
-    __vmwrite(GUEST_PDPTR2_HIGH, guest_pdptrs[2] >> 32);
-    __vmwrite(GUEST_PDPTR3_HIGH, guest_pdptrs[3] >> 32);
-#endif
 
     vmx_vmcs_exit(v);
 
@@ -1245,7 +1198,6 @@ static void vmx_update_guest_cr(struct v
 
 static void vmx_update_guest_efer(struct vcpu *v)
 {
-#ifdef __x86_64__
     unsigned long vm_entry_value;
 
     vmx_vmcs_enter(v);
@@ -1258,7 +1210,6 @@ static void vmx_update_guest_efer(struct
     __vmwrite(VM_ENTRY_CONTROLS, vm_entry_value);
 
     vmx_vmcs_exit(v);
-#endif
 
     if ( v == current )
         write_efer((read_efer() & ~EFER_SCE) |
@@ -1764,14 +1715,6 @@ static const struct lbr_info {
     { MSR_C2_LASTBRANCH_0_FROM_IP,  NUM_MSR_ATOM_LASTBRANCH_FROM_TO },
     { MSR_C2_LASTBRANCH_0_TO_IP,    NUM_MSR_ATOM_LASTBRANCH_FROM_TO },
     { 0, 0 }
-#ifdef __i386__
-}, pm_lbr[] = {
-    { MSR_IA32_LASTINTFROMIP,       1 },
-    { MSR_IA32_LASTINTTOIP,         1 },
-    { MSR_PM_LASTBRANCH_TOS,        1 },
-    { MSR_PM_LASTBRANCH_0,          NUM_MSR_PM_LASTBRANCH },
-    { 0, 0 }
-#endif
 };
 
 static const struct lbr_info *last_branch_msr_get(void)
@@ -1781,14 +1724,6 @@ static const struct lbr_info *last_branc
     case 6:
         switch ( boot_cpu_data.x86_model )
         {
-#ifdef __i386__
-        /* PentiumM */
-        case 9: case 13:
-        /* Core Solo/Duo */
-        case 14:
-            return pm_lbr;
-            break;
-#endif
         /* Core2 Duo */
         case 15:
         /* Enhanced Core */
@@ -1857,9 +1792,6 @@ static int vmx_msr_read_intercept(unsign
         break;
     case MSR_IA32_DEBUGCTLMSR:
         *msr_content = __vmread(GUEST_IA32_DEBUGCTL);
-#ifdef __i386__
-        *msr_content |= (u64)__vmread(GUEST_IA32_DEBUGCTL_HIGH) << 32;
-#endif
         break;
     case IA32_FEATURE_CONTROL_MSR:
     case MSR_IA32_VMX_BASIC...MSR_IA32_VMX_TRUE_ENTRY_CTLS:
@@ -2027,9 +1959,6 @@ static int vmx_msr_write_intercept(unsig
         else
         {
             __vmwrite(GUEST_IA32_DEBUGCTL, msr_content);
-#ifdef __i386__
-            __vmwrite(GUEST_IA32_DEBUGCTL_HIGH, msr_content >> 32);
-#endif
         }
 
         break;
@@ -2697,9 +2626,6 @@ void vmx_vmexit_handler(struct cpu_user_
     case EXIT_REASON_EPT_VIOLATION:
     {
         paddr_t gpa = __vmread(GUEST_PHYSICAL_ADDRESS);
-#ifdef __i386__
-        gpa |= (paddr_t)__vmread(GUEST_PHYSICAL_ADDRESS_HIGH) << 32;
-#endif
         exit_qualification = __vmread(EXIT_QUALIFICATION);
         ept_handle_violation(exit_qualification, gpa);
         break;
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/hvm/vmx/vpmu_core2.c
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c	Wed Sep 12 13:29:30 2012 +0100
@@ -662,7 +662,6 @@ static int core2_vpmu_initialise(struct 
     /* Check the 'Debug Store' feature in the CPUID.EAX[1]:EDX[21] */
     if ( cpu_has(c, X86_FEATURE_DS) )
     {
-#ifdef __x86_64__
         if ( !cpu_has(c, X86_FEATURE_DTES64) )
         {
             printk(XENLOG_G_WARNING "CPU doesn't support 64-bit DS Area"
@@ -670,7 +669,6 @@ static int core2_vpmu_initialise(struct 
                    v->domain->domain_id, v->vcpu_id);
             goto func_out;
         }
-#endif
         vpmu_set(vpmu, VPMU_CPU_HAS_DS);
         rdmsrl(MSR_IA32_MISC_ENABLE, msr_content);
         if ( msr_content & MSR_IA32_MISC_ENABLE_BTS_UNAVAIL )
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Wed Sep 12 13:29:30 2012 +0100
@@ -234,7 +234,6 @@ static unsigned long reg_read(struct cpu
     CASE_GET_REG(RSI, esi);
     CASE_GET_REG(RDI, edi);
     CASE_GET_REG(RSP, esp);
-#ifdef CONFIG_X86_64
     CASE_GET_REG(R8, r8);
     CASE_GET_REG(R9, r9);
     CASE_GET_REG(R10, r10);
@@ -243,7 +242,6 @@ static unsigned long reg_read(struct cpu
     CASE_GET_REG(R13, r13);
     CASE_GET_REG(R14, r14);
     CASE_GET_REG(R15, r15);
-#endif
     default:
         break;
     }
@@ -264,7 +262,6 @@ static void reg_write(struct cpu_user_re
     CASE_SET_REG(RSI, esi);
     CASE_SET_REG(RDI, edi);
     CASE_SET_REG(RSP, esp);
-#ifdef CONFIG_X86_64
     CASE_SET_REG(R8, r8);
     CASE_SET_REG(R9, r9);
     CASE_SET_REG(R10, r10);
@@ -273,7 +270,6 @@ static void reg_write(struct cpu_user_re
     CASE_SET_REG(R13, r13);
     CASE_SET_REG(R14, r14);
     CASE_SET_REG(R15, r15);
-#endif
     default:
         break;
     }
@@ -646,10 +642,6 @@ static unsigned long vmcs_gstate_field[]
     /* 64 BITS */
     VMCS_LINK_POINTER,
     GUEST_IA32_DEBUGCTL,
-#ifndef CONFIG_X86_64
-    VMCS_LINK_POINTER_HIGH,
-    GUEST_IA32_DEBUGCTL_HIGH,
-#endif
     /* 32 BITS */
     GUEST_ES_LIMIT,
     GUEST_CS_LIMIT,
@@ -799,9 +791,7 @@ static void virtual_vmentry(struct cpu_u
     struct vcpu *v = current;
     struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
     void *vvmcs = nvcpu->nv_vvmcx;
-#ifdef __x86_64__
     unsigned long lm_l1, lm_l2;
-#endif
 
     vmx_vmcs_switch(v->arch.hvm_vmx.vmcs, nvcpu->nv_n2vmcx);
 
@@ -809,7 +799,6 @@ static void virtual_vmentry(struct cpu_u
     nvcpu->nv_vmentry_pending = 0;
     nvcpu->nv_vmswitch_in_progress = 1;
 
-#ifdef __x86_64__
     /*
      * EFER handling:
      * hvm_set_efer won't work if CR0.PG = 1, so we change the value
@@ -827,15 +816,12 @@ static void virtual_vmentry(struct cpu_u
         v->arch.hvm_vcpu.guest_efer |= EFER_LMA | EFER_LME;
     else
         v->arch.hvm_vcpu.guest_efer &= ~(EFER_LMA | EFER_LME);
-#endif
 
     load_shadow_control(v);
     load_shadow_guest_state(v);
 
-#ifdef __x86_64__
     if ( lm_l1 != lm_l2 )
         paging_update_paging_modes(v);
-#endif
 
     regs->eip = __get_vvmcs(vvmcs, GUEST_RIP);
     regs->esp = __get_vvmcs(vvmcs, GUEST_RSP);
@@ -954,9 +940,7 @@ static void virtual_vmexit(struct cpu_us
 {
     struct vcpu *v = current;
     struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
-#ifdef __x86_64__
     unsigned long lm_l1, lm_l2;
-#endif
 
     sync_vvmcs_ro(v);
     sync_vvmcs_guest_state(v, regs);
@@ -967,7 +951,6 @@ static void virtual_vmexit(struct cpu_us
     nestedhvm_vcpu_exit_guestmode(v);
     nvcpu->nv_vmexit_pending = 0;
 
-#ifdef __x86_64__
     lm_l2 = !!hvm_long_mode_enabled(v);
     lm_l1 = !!(__get_vvmcs(nvcpu->nv_vvmcx, VM_EXIT_CONTROLS) &
                            VM_EXIT_IA32E_MODE);
@@ -976,17 +959,14 @@ static void virtual_vmexit(struct cpu_us
         v->arch.hvm_vcpu.guest_efer |= EFER_LMA | EFER_LME;
     else
         v->arch.hvm_vcpu.guest_efer &= ~(EFER_LMA | EFER_LME);
-#endif
 
     vmx_update_cpu_exec_control(v);
     vmx_update_exception_bitmap(v);
 
     load_vvmcs_host_state(v);
 
-#ifdef __x86_64__
     if ( lm_l1 != lm_l2 )
         paging_update_paging_modes(v);
-#endif
 
     regs->eip = __get_vvmcs(nvcpu->nv_vvmcx, HOST_RIP);
     regs->esp = __get_vvmcs(nvcpu->nv_vvmcx, HOST_RSP);
@@ -1341,9 +1321,7 @@ int nvmx_msr_read_intercept(unsigned int
         /* bit 0-8, 10,11,13,14,16,17 must be 1 (refer G4 of SDM) */
         tmp = 0x36dff;
         data = VM_EXIT_ACK_INTR_ON_EXIT;
-#ifdef __x86_64__
         data |= VM_EXIT_IA32E_MODE;
-#endif
 	/* 0-settings */
         data = ((data | tmp) << 32) | tmp;
         break;
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/i387.c
--- a/xen/arch/x86/i387.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/i387.c	Wed Sep 12 13:29:30 2012 +0100
@@ -56,12 +56,8 @@ static inline void fpu_fxrstor(struct vc
      * tools, by silently clearing the block.
      */
     asm volatile (
-#ifdef __i386__
-        "1: fxrstor %0            \n"
-#else /* __x86_64__ */
         /* See above for why the operands/constraints are this way. */
         "1: " REX64_PREFIX "fxrstor (%2)\n"
-#endif
         ".section .fixup,\"ax\"   \n"
         "2: push %%"__OP"ax       \n"
         "   push %%"__OP"cx       \n"
@@ -79,9 +75,7 @@ static inline void fpu_fxrstor(struct vc
         : 
         : "m" (*fpu_ctxt),
           "i" (sizeof(v->arch.xsave_area->fpu_sse)/4)
-#ifdef __x86_64__
           ,"cdaSDb" (fpu_ctxt)
-#endif
         );
 }
 
@@ -112,11 +106,6 @@ static inline void fpu_fxsave(struct vcp
 {
     char *fpu_ctxt = v->arch.fpu_ctxt;
 
-#ifdef __i386__
-    asm volatile (
-        "fxsave %0"
-        : "=m" (*fpu_ctxt) );
-#else /* __x86_64__ */
     /*
      * The only way to force fxsaveq on a wide range of gas versions. On 
      * older versions the rex64 prefix works only if we force an
@@ -125,7 +114,6 @@ static inline void fpu_fxsave(struct vcp
     asm volatile (
         REX64_PREFIX "fxsave (%1)"
         : "=m" (*fpu_ctxt) : "cdaSDb" (fpu_ctxt) );
-#endif
     
     /* Clear exception flags if FSW.ES is set. */
     if ( unlikely(fpu_ctxt[2] & 0x80) )
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/machine_kexec.c
--- a/xen/arch/x86/machine_kexec.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/machine_kexec.c	Wed Sep 12 13:29:30 2012 +0100
@@ -16,9 +16,6 @@ typedef void (*relocate_new_kernel_t)(
                 unsigned long indirection_page,
                 unsigned long *page_list,
                 unsigned long start_address,
-#ifdef __i386__
-                unsigned int cpu_has_pae,
-#endif
                 unsigned int preserve_context);
 
 int machine_kexec_load(int type, int slot, xen_kexec_image_t *image)
@@ -113,9 +110,6 @@ void machine_kexec(xen_kexec_image_t *im
         rnk = (relocate_new_kernel_t) image->page_list[1];
         (*rnk)(image->indirection_page, image->page_list,
                image->start_address,
-#ifdef __i386__
-               1 /* cpu_has_pae */,
-#endif
                0 /* preserve_context */);
     }
 }
@@ -132,15 +126,7 @@ void arch_crash_save_vmcoreinfo(void)
 	VMCOREINFO_SYMBOL(dom_xen);
 	VMCOREINFO_SYMBOL(dom_io);
 
-#ifdef CONFIG_X86_32
-    VMCOREINFO_SYMBOL(xenheap_phys_end);
-#endif
-#ifdef CONFIG_X86_PAE
-	VMCOREINFO_SYMBOL_ALIAS(pgd_l3, idle_pg_table);
-#endif
-#ifdef CONFIG_X86_64
 	VMCOREINFO_SYMBOL_ALIAS(pgd_l4, idle_pg_table);
-#endif
 }
 
 /*
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/mm.c	Wed Sep 12 13:29:30 2012 +0100
@@ -130,9 +130,8 @@ l1_pgentry_t __attribute__ ((__section__
 /*
  * PTE updates can be done with ordinary writes except:
  *  1. Debug builds get extra checking by using CMPXCHG[8B].
- *  2. PAE builds perform an atomic 8-byte store with CMPXCHG8B.
  */
-#if !defined(NDEBUG) || defined(__i386__)
+#if !defined(NDEBUG)
 #define PTE_UPDATE_WITH_CMPXCHG
 #endif
 
@@ -156,17 +155,12 @@ bool_t __read_mostly machine_to_phys_map
 bool_t __read_mostly opt_allow_superpage;
 boolean_param("allowsuperpage", opt_allow_superpage);
 
-#ifdef __i386__
-static int get_superpage(unsigned long mfn, struct domain *d);
-#endif
 static void put_superpage(unsigned long mfn);
 
 static uint32_t base_disallow_mask;
 #define L1_DISALLOW_MASK (base_disallow_mask | _PAGE_GNTTAB)
 #define L2_DISALLOW_MASK (base_disallow_mask & ~_PAGE_PSE)
 
-#if defined(__x86_64__)
-
 #define l3_disallow_mask(d) (!is_pv_32on64_domain(d) ?  \
                              base_disallow_mask :       \
                              0xFFFFF198U)
@@ -179,12 +173,6 @@ static uint32_t base_disallow_mask;
 #define L1_DISALLOW_MASK ((base_disallow_mask | _PAGE_GNTTAB) & ~_PAGE_GLOBAL)
 #endif
 
-#elif defined (__i386__)
-
-#define l3_disallow_mask(d) 0xFFFFF1FEU /* must-be-zero */
-
-#endif
-
 #define l1_disallow_mask(d)                                     \
     ((d != dom_io) &&                                           \
      (rangeset_is_empty((d)->iomem_caps) &&                     \
@@ -193,7 +181,6 @@ static uint32_t base_disallow_mask;
       !is_hvm_domain(d)) ?                                      \
      L1_DISALLOW_MASK : (L1_DISALLOW_MASK & ~PAGE_CACHE_ATTRS))
 
-#ifdef __x86_64__
 static void __init init_spagetable(void)
 {
     unsigned long s, start = SPAGETABLE_VIRT_START;
@@ -215,7 +202,6 @@ static void __init init_spagetable(void)
     }
     memset((void *)start, 0, end - start);
 }
-#endif
 
 static void __init init_frametable_chunk(void *start, void *end)
 {
@@ -253,9 +239,7 @@ void __init init_frametable(void)
     unsigned int sidx, eidx, nidx;
     unsigned int max_idx = (max_pdx + PDX_GROUP_COUNT - 1) / PDX_GROUP_COUNT;
 
-#ifdef __x86_64__
     BUILD_BUG_ON(XEN_VIRT_END > FRAMETABLE_VIRT_END);
-#endif
     BUILD_BUG_ON(FRAMETABLE_VIRT_START & ((1UL << L2_PAGETABLE_SHIFT) - 1));
 
     for ( sidx = 0; ; sidx = nidx )
@@ -278,10 +262,8 @@ void __init init_frametable(void)
                (unsigned long)pdx_to_page(max_idx * PDX_GROUP_COUNT) -
                (unsigned long)pdx_to_page(max_pdx));
     }
-#ifdef __x86_64__
     if (opt_allow_superpage)
         init_spagetable();
-#endif
 }
 
 void __init arch_init_memory(void)
@@ -356,12 +338,7 @@ void __init arch_init_memory(void)
          * the statically-initialised 1-16MB mapping area.
          */
         iostart_pfn = max_t(unsigned long, pfn, 1UL << (20 - PAGE_SHIFT));
-#if defined(CONFIG_X86_32)
-        ioend_pfn = min_t(unsigned long, rstart_pfn,
-                          DIRECTMAP_MBYTES << (20 - PAGE_SHIFT));
-#else
         ioend_pfn = min(rstart_pfn, 16UL << (20 - PAGE_SHIFT));
-#endif
         if ( iostart_pfn < ioend_pfn )            
             destroy_xen_mappings((unsigned long)mfn_to_virt(iostart_pfn),
                                  (unsigned long)mfn_to_virt(ioend_pfn));
@@ -470,91 +447,11 @@ void share_xen_page_with_privileged_gues
     share_xen_page_with_guest(page, dom_xen, readonly);
 }
 
-#if defined(__i386__)
-
-#ifdef NDEBUG
-/* Only PDPTs above 4GB boundary need to be shadowed in low memory. */
-#define l3tab_needs_shadow(mfn) ((mfn) >= 0x100000)
-#else
-/*
- * In debug builds we shadow a selection of <4GB PDPTs to exercise code paths.
- * We cannot safely shadow the idle page table, nor shadow page tables
- * (detected by zero reference count). As required for correctness, we
- * always shadow PDPTs above 4GB.
- */
-#define l3tab_needs_shadow(mfn)                          \
-    (((((mfn) << PAGE_SHIFT) != __pa(idle_pg_table)) &&  \
-      (mfn_to_page(mfn)->count_info & PGC_count_mask) && \
-      ((mfn) & 1)) || /* odd MFNs are shadowed */        \
-     ((mfn) >= 0x100000))
-#endif
-
-static l1_pgentry_t *fix_pae_highmem_pl1e;
-
-/* Cache the address of PAE high-memory fixmap page tables. */
-static int __init cache_pae_fixmap_address(void)
-{
-    unsigned long fixmap_base = fix_to_virt(FIX_PAE_HIGHMEM_0);
-    l2_pgentry_t *pl2e = virt_to_xen_l2e(fixmap_base);
-    fix_pae_highmem_pl1e = l2e_to_l1e(*pl2e) + l1_table_offset(fixmap_base);
-    return 0;
-}
-__initcall(cache_pae_fixmap_address);
-
-static DEFINE_PER_CPU(u32, make_cr3_timestamp);
-
-void make_cr3(struct vcpu *v, unsigned long mfn)
-/* Takes the MFN of a PAE l3 table, copies the contents to below 4GB if
- * necessary, and sets v->arch.cr3 to the value to load in CR3. */
-{
-    l3_pgentry_t *highmem_l3tab, *lowmem_l3tab;
-    struct pae_l3_cache *cache = &v->arch.pae_l3_cache;
-    unsigned int cpu = smp_processor_id();
-
-    /* Fast path: does this mfn need a shadow at all? */
-    if ( !l3tab_needs_shadow(mfn) )
-    {
-        v->arch.cr3 = mfn << PAGE_SHIFT;
-        /* Cache is no longer in use or valid */
-        cache->high_mfn = 0;
-        return;
-    }
-
-    /* Caching logic is not interrupt safe. */
-    ASSERT(!in_irq());
-
-    /* Protects against pae_flush_pgd(). */
-    spin_lock(&cache->lock);
-
-    cache->inuse_idx ^= 1;
-    cache->high_mfn   = mfn;
-
-    /* Map the guest L3 table and copy to the chosen low-memory cache. */
-    l1e_write(fix_pae_highmem_pl1e-cpu, l1e_from_pfn(mfn, __PAGE_HYPERVISOR));
-    /* First check the previous high mapping can't be in the TLB. 
-     * (i.e. have we loaded CR3 since we last did this?) */
-    if ( unlikely(this_cpu(make_cr3_timestamp) == this_cpu(tlbflush_time)) )
-        flush_tlb_one_local(fix_to_virt(FIX_PAE_HIGHMEM_0 + cpu));
-    highmem_l3tab = (l3_pgentry_t *)fix_to_virt(FIX_PAE_HIGHMEM_0 + cpu);
-    lowmem_l3tab  = cache->table[cache->inuse_idx];
-    memcpy(lowmem_l3tab, highmem_l3tab, sizeof(cache->table[0]));
-    l1e_write(fix_pae_highmem_pl1e-cpu, l1e_empty());
-    this_cpu(make_cr3_timestamp) = this_cpu(tlbflush_time);
-
-    v->arch.cr3 = __pa(lowmem_l3tab);
-
-    spin_unlock(&cache->lock);
-}
-
-#else /* !defined(__i386__) */
-
 void make_cr3(struct vcpu *v, unsigned long mfn)
 {
     v->arch.cr3 = mfn << PAGE_SHIFT;
 }
 
-#endif /* !defined(__i386__) */
-
 void write_ptbase(struct vcpu *v)
 {
     write_cr3(v->arch.cr3);
@@ -721,7 +618,6 @@ static int get_page_and_type_from_pagenr
     return rc;
 }
 
-#ifdef __x86_64__
 static void put_data_page(
     struct page_info *page, int writeable)
 {
@@ -730,7 +626,6 @@ static void put_data_page(
     else
         put_page(page);
 }
-#endif
 
 /*
  * We allow root tables to map each other (a.k.a. linear page tables). It
@@ -805,7 +700,6 @@ int is_iomem_page(unsigned long mfn)
 static int update_xen_mappings(unsigned long mfn, unsigned long cacheattr)
 {
     int err = 0;
-#ifdef __x86_64__
     bool_t alias = mfn >= PFN_DOWN(xen_phys_start) &&
          mfn < PFN_UP(xen_phys_start + xen_virt_end - XEN_VIRT_START);
     unsigned long xen_va =
@@ -818,7 +712,6 @@ static int update_xen_mappings(unsigned 
                      PAGE_HYPERVISOR | cacheattr_to_pte_flags(cacheattr));
     if ( unlikely(alias) && !cacheattr && !err )
         err = map_pages_to_xen(xen_va, mfn, 1, PAGE_HYPERVISOR);
-#endif
     return err;
 }
 
@@ -1058,8 +951,6 @@ get_page_from_l4e(
 }
 #endif /* 4 level */
 
-#ifdef __x86_64__
-
 #ifdef USER_MAPPINGS_ARE_GLOBAL
 #define adjust_guest_l1e(pl1e, d)                                            \
     do {                                                                     \
@@ -1108,24 +999,12 @@ get_page_from_l4e(
             l4e_add_flags((pl4e), _PAGE_USER);                  \
     } while ( 0 )
 
-#else /* !defined(__x86_64__) */
-
-#define adjust_guest_l1e(_p, _d) ((void)(_d))
-#define adjust_guest_l2e(_p, _d) ((void)(_d))
-#define adjust_guest_l3e(_p, _d) ((void)(_d))
-
-#endif
-
-#ifdef __x86_64__
 #define unadjust_guest_l3e(pl3e, d)                                         \
     do {                                                                    \
         if ( unlikely(is_pv_32on64_domain(d)) &&                            \
              likely(l3e_get_flags((pl3e)) & _PAGE_PRESENT) )                \
             l3e_remove_flags((pl3e), _PAGE_USER|_PAGE_RW|_PAGE_ACCESSED);   \
     } while ( 0 )
-#else
-#define unadjust_guest_l3e(_p, _d) ((void)(_d))
-#endif
 
 void put_page_from_l1e(l1_pgentry_t l1e, struct domain *l1e_owner)
 {
@@ -1209,7 +1088,6 @@ static int put_page_from_l3e(l3_pgentry_
     if ( !(l3e_get_flags(l3e) & _PAGE_PRESENT) || (l3e_get_pfn(l3e) == pfn) )
         return 1;
 
-#ifdef __x86_64__
     if ( unlikely(l3e_get_flags(l3e) & _PAGE_PSE) )
     {
         unsigned long mfn = l3e_get_pfn(l3e);
@@ -1222,7 +1100,6 @@ static int put_page_from_l3e(l3_pgentry_
 
         return 0;
     }
-#endif
 
     if ( unlikely(partial > 0) )
         return __put_page_type(l3e_get_page(l3e), preemptible);
@@ -1289,10 +1166,6 @@ static int create_pae_xen_mappings(struc
 {
     struct page_info *page;
     l3_pgentry_t     l3e3;
-#ifdef __i386__
-    l2_pgentry_t     *pl2e, l2e;
-    int              i;
-#endif
 
     if ( !is_pv_32bit_domain(d) )
         return 1;
@@ -1326,76 +1199,9 @@ static int create_pae_xen_mappings(struc
         return 0;
     }
 
-#ifdef __i386__
-    /* Xen linear pagetable mappings. */
-    pl2e = map_domain_page(l3e_get_pfn(l3e3));
-    for ( i = 0; i < (LINEARPT_MBYTES >> (L2_PAGETABLE_SHIFT - 20)); i++ )
-    {
-        l2e = l2e_empty();
-        if ( l3e_get_flags(pl3e[i]) & _PAGE_PRESENT )
-            l2e = l2e_from_pfn(l3e_get_pfn(pl3e[i]), __PAGE_HYPERVISOR);
-        l2e_write(&pl2e[l2_table_offset(LINEAR_PT_VIRT_START) + i], l2e);
-    }
-    unmap_domain_page(pl2e);
-#endif
-
     return 1;
 }
 
-#ifdef __i386__
-/* Flush a pgdir update into low-memory caches. */
-static void pae_flush_pgd(
-    unsigned long mfn, unsigned int idx, l3_pgentry_t nl3e)
-{
-    struct domain *d = page_get_owner(mfn_to_page(mfn));
-    struct vcpu   *v;
-    intpte_t       _ol3e, _nl3e, _pl3e;
-    l3_pgentry_t  *l3tab_ptr;
-    struct pae_l3_cache *cache;
-
-    if ( unlikely(shadow_mode_enabled(d)) )
-    {
-        cpumask_t m;
-
-        /* Re-shadow this l3 table on any vcpus that are using it */
-        cpumask_clear(&m);
-        for_each_vcpu ( d, v )
-            if ( pagetable_get_pfn(v->arch.guest_table) == mfn )
-            {
-                paging_update_cr3(v);
-                cpumask_or(&m, &m, v->vcpu_dirty_cpumask);
-            }
-        flush_tlb_mask(&m);
-    }
-
-    /* If below 4GB then the pgdir is not shadowed in low memory. */
-    if ( !l3tab_needs_shadow(mfn) )
-        return;
-
-    for_each_vcpu ( d, v )
-    {
-        cache = &v->arch.pae_l3_cache;
-
-        spin_lock(&cache->lock);
-
-        if ( cache->high_mfn == mfn )
-        {
-            l3tab_ptr = &cache->table[cache->inuse_idx][idx];
-            _ol3e = l3e_get_intpte(*l3tab_ptr);
-            _nl3e = l3e_get_intpte(nl3e);
-            _pl3e = cmpxchg(&l3e_get_intpte(*l3tab_ptr), _ol3e, _nl3e);
-            BUG_ON(_pl3e != _ol3e);
-        }
-
-        spin_unlock(&cache->lock);
-    }
-
-    flush_tlb_mask(d->domain_dirty_cpumask);
-}
-#else
-# define pae_flush_pgd(mfn, idx, nl3e) ((void)0)
-#endif
-
 static int alloc_l2_table(struct page_info *page, unsigned long type,
                           int preemptible)
 {
@@ -1435,22 +1241,10 @@ static int alloc_l2_table(struct page_in
     if ( rc >= 0 && (type & PGT_pae_xen_l2) )
     {
         /* Xen private mappings. */
-#if defined(__i386__)
-        memcpy(&pl2e[L2_PAGETABLE_FIRST_XEN_SLOT & (L2_PAGETABLE_ENTRIES-1)],
-               &idle_pg_table_l2[L2_PAGETABLE_FIRST_XEN_SLOT],
-               L2_PAGETABLE_XEN_SLOTS * sizeof(l2_pgentry_t));
-        for ( i = 0; i < PDPT_L2_ENTRIES; i++ )
-            l2e_write(&pl2e[l2_table_offset(PERDOMAIN_VIRT_START) + i],
-                      l2e_from_page(perdomain_pt_page(d, i),
-                                    __PAGE_HYPERVISOR));
-        pl2e[l2_table_offset(LINEAR_PT_VIRT_START)] =
-            l2e_from_pfn(pfn, __PAGE_HYPERVISOR);
-#else
         memcpy(&pl2e[COMPAT_L2_PAGETABLE_FIRST_XEN_SLOT(d)],
                &compat_idle_pg_table_l2[
                    l2_table_offset(HIRO_COMPAT_MPT_VIRT_START)],
                COMPAT_L2_PAGETABLE_XEN_SLOTS(d) * sizeof(*pl2e));
-#endif
     }
 
     unmap_domain_page(pl2e);
@@ -1626,9 +1420,7 @@ static void free_l1_table(struct page_in
 
 static int free_l2_table(struct page_info *page, int preemptible)
 {
-#ifdef __x86_64__
     struct domain *d = page_get_owner(page);
-#endif
     unsigned long pfn = page_to_mfn(page);
     l2_pgentry_t *pl2e;
     unsigned int  i = page->nr_validated_ptes - 1;
@@ -2024,13 +1816,9 @@ static int mod_l3_entry(l3_pgentry_t *pl
     }
 
     if ( likely(rc == 0) )
-    {
         if ( !create_pae_xen_mappings(d, pl3e) )
             BUG();
 
-        pae_flush_pgd(pfn, pgentry_ptr_to_slot(pl3e), nl3e);
-    }
-
     put_page_from_l3e(ol3e, pfn, 0, 0);
     return rc;
 }
@@ -2612,8 +2400,6 @@ static void put_spage_pages(struct page_
     return;
 }
 
-#ifdef __x86_64__
-
 static int mark_superpage(struct spage_info *spage, struct domain *d)
 {
     unsigned long x, nx, y = spage->type_info;
@@ -2774,25 +2560,6 @@ static void put_superpage(unsigned long 
     return;
 }
 
-#else /* __i386__ */
-
-void clear_superpage_mark(struct page_info *page)
-{
-}
-
-static int get_superpage(unsigned long mfn, struct domain *d)
-{
-    return get_spage_pages(mfn_to_page(mfn), d);
-}
-
-static void put_superpage(unsigned long mfn)
-{
-    put_spage_pages(mfn_to_page(mfn));
-}
-
-#endif
-
-
 int new_guest_cr3(unsigned long mfn)
 {
     struct vcpu *curr = current;
@@ -2800,7 +2567,6 @@ int new_guest_cr3(unsigned long mfn)
     int okay;
     unsigned long old_base_mfn;
 
-#ifdef __x86_64__
     if ( is_pv_32on64_domain(d) )
     {
         okay = paging_mode_refcounts(d)
@@ -2822,7 +2588,7 @@ int new_guest_cr3(unsigned long mfn)
 
         return 1;
     }
-#endif
+
     okay = paging_mode_refcounts(d)
         ? get_page_from_pagenr(mfn, d)
         : !get_page_and_type_from_pagenr(mfn, PGT_root_page_table, d, 0, 0);
@@ -2948,28 +2714,8 @@ static inline int vcpumask_to_pcpumask(
     }
 }
 
-#ifdef __i386__
-static inline void *fixmap_domain_page(unsigned long mfn)
-{
-    unsigned int cpu = smp_processor_id();
-    void *ptr = (void *)fix_to_virt(FIX_PAE_HIGHMEM_0 + cpu);
-
-    l1e_write(fix_pae_highmem_pl1e - cpu,
-              l1e_from_pfn(mfn, __PAGE_HYPERVISOR));
-    flush_tlb_one_local(ptr);
-    return ptr;
-}
-static inline void fixunmap_domain_page(const void *ptr)
-{
-    unsigned int cpu = virt_to_fix((unsigned long)ptr) - FIX_PAE_HIGHMEM_0;
-
-    l1e_write(fix_pae_highmem_pl1e - cpu, l1e_empty());
-    this_cpu(make_cr3_timestamp) = this_cpu(tlbflush_time);
-}
-#else
 #define fixmap_domain_page(mfn) mfn_to_virt(mfn)
 #define fixunmap_domain_page(ptr) ((void)(ptr))
-#endif
 
 long do_mmuext_op(
     XEN_GUEST_HANDLE(mmuext_op_t) uops,
@@ -3141,8 +2887,6 @@ long do_mmuext_op(
                     && new_guest_cr3(op.arg1.mfn));
             break;
 
-        
-#ifdef __x86_64__
         case MMUEXT_NEW_USER_BASEPTR: {
             unsigned long old_mfn;
 
@@ -3179,7 +2923,6 @@ long do_mmuext_op(
 
             break;
         }
-#endif
         
         case MMUEXT_TLB_FLUSH_LOCAL:
             flush_tlb_local();
@@ -3345,7 +3088,6 @@ long do_mmuext_op(
             break;
         }
 
-#ifdef __x86_64__
         case MMUEXT_MARK_SUPER:
         {
             unsigned long mfn;
@@ -3397,7 +3139,6 @@ long do_mmuext_op(
             okay = (unmark_superpage(spage) >= 0);
             break;
         }
-#endif
 
         default:
             MEM_LOG("Invalid extended pt command 0x%x", op.cmd);
@@ -5195,7 +4936,6 @@ int ptwr_do_page_fault(struct vcpu *v, u
     return 0;
 }
 
-#ifdef __x86_64__
 /*************************
  * fault handling for read-only MMIO pages
  */
@@ -5284,7 +5024,6 @@ int mmio_ro_do_page_fault(struct vcpu *v
 
     return rc != X86EMUL_UNHANDLEABLE ? EXCRET_fault_fixed : 0;
 }
-#endif /* __x86_64__ */
 
 void free_xen_pagetable(void *v)
 {
@@ -5325,7 +5064,6 @@ int map_pages_to_xen(
 
     while ( nr_mfns != 0 )
     {
-#ifdef __x86_64__
         l3_pgentry_t ol3e, *pl3e = virt_to_xen_l3e(virt);
 
         if ( !pl3e )
@@ -5447,7 +5185,6 @@ int map_pages_to_xen(
                                                 __PAGE_HYPERVISOR));
             flush_area(virt, flush_flags);
         }
-#endif
 
         pl2e = virt_to_xen_l2e(virt);
         if ( !pl2e )
@@ -5588,8 +5325,7 @@ int map_pages_to_xen(
             }
         }
 
- check_l3: ;
-#ifdef __x86_64__
+ check_l3:
         if ( cpu_has_page1gb &&
              (flags == PAGE_HYPERVISOR) &&
              ((nr_mfns == 0) ||
@@ -5617,7 +5353,6 @@ int map_pages_to_xen(
                 free_xen_pagetable(l3e_to_l2e(ol3e));
             }
         }
-#endif
     }
 
     return 0;
@@ -5635,7 +5370,6 @@ void destroy_xen_mappings(unsigned long 
 
     while ( v < e )
     {
-#ifdef __x86_64__
         l3_pgentry_t *pl3e = virt_to_xen_l3e(v);
 
         if ( !(l3e_get_flags(*pl3e) & _PAGE_PRESENT) )
@@ -5667,7 +5401,6 @@ void destroy_xen_mappings(unsigned long 
             l3e_write_atomic(pl3e, l3e_from_pfn(virt_to_mfn(pl2e),
                                                 __PAGE_HYPERVISOR));
         }
-#endif
 
         pl2e = virt_to_xen_l2e(v);
 
@@ -5722,7 +5455,6 @@ void destroy_xen_mappings(unsigned long 
             }
         }
 
-#ifdef __x86_64__
         /* If we are done with the L3E, check if it is now empty. */
         if ( (v != e) && (l2_table_offset(v) + l1_table_offset(v) != 0) )
             continue;
@@ -5737,7 +5469,6 @@ void destroy_xen_mappings(unsigned long 
             flush_area(NULL, FLUSH_TLB_GLOBAL); /* flush before free */
             free_xen_pagetable(pl2e);
         }
-#endif
     }
 
     flush_area(NULL, FLUSH_TLB_GLOBAL);
@@ -5755,13 +5486,6 @@ void __set_fixmap(
 void memguard_init(void)
 {
     unsigned long start = max_t(unsigned long, xen_phys_start, 1UL << 20);
-#ifdef __i386__
-    map_pages_to_xen(
-        (unsigned long)__va(start),
-        start >> PAGE_SHIFT,
-        (xenheap_phys_end - start) >> PAGE_SHIFT,
-        __PAGE_HYPERVISOR|MAP_SMALL_PAGES);
-#else
     map_pages_to_xen(
         (unsigned long)__va(start),
         start >> PAGE_SHIFT,
@@ -5773,7 +5497,6 @@ void memguard_init(void)
         start >> PAGE_SHIFT,
         (__pa(&_end) + PAGE_SIZE - 1 - start) >> PAGE_SHIFT,
         __PAGE_HYPERVISOR|MAP_SMALL_PAGES);
-#endif
 }
 
 static void __memguard_change_range(void *p, unsigned long l, int guard)
@@ -5820,18 +5543,12 @@ void memguard_unguard_stack(void *p)
     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:
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/mm/p2m-pt.c
--- a/xen/arch/x86/mm/p2m-pt.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/mm/p2m-pt.c	Wed Sep 12 13:29:30 2012 +0100
@@ -63,21 +63,12 @@
 static unsigned long p2m_type_to_flags(p2m_type_t t, mfn_t mfn)
 {
     unsigned long flags;
-#ifdef __x86_64__
     /*
      * AMD IOMMU: When we share p2m table with iommu, bit 9 - bit 11 will be
      * used for iommu hardware to encode next io page level. Bit 59 - bit 62
      * are used for iommu flags, We could not use these bits to store p2m types.
      */
     flags = (unsigned long)(t & 0x7f) << 12;
-#else
-    flags = (t & 0x7UL) << 9;
-#endif
-
-#ifndef __x86_64__
-    /* 32-bit builds don't support a lot of the p2m types */
-    BUG_ON(t > p2m_populate_on_demand);
-#endif
 
     switch(t)
     {
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/mm/p2m.c	Wed Sep 12 13:29:30 2012 +0100
@@ -170,7 +170,6 @@ mfn_t __get_gfn_type_access(struct p2m_d
 
     mfn = p2m->get_entry(p2m, gfn, t, a, q, page_order);
 
-#ifdef __x86_64__
     if ( (q & P2M_UNSHARE) && p2m_is_shared(*t) )
     {
         ASSERT(!p2m_is_nestedp2m(p2m));
@@ -180,9 +179,7 @@ mfn_t __get_gfn_type_access(struct p2m_d
             (void)mem_sharing_notify_enomem(p2m->domain, gfn, 0);
         mfn = p2m->get_entry(p2m, gfn, t, a, q, page_order);
     }
-#endif
 
-#ifdef __x86_64__
     if (unlikely((p2m_is_broken(*t))))
     {
         /* Return invalid_mfn to avoid caller's access */
@@ -190,7 +187,6 @@ mfn_t __get_gfn_type_access(struct p2m_d
         if ( q & P2M_ALLOC )
             domain_crash(p2m->domain);
     }
-#endif
 
     return mfn;
 }
@@ -412,18 +408,15 @@ void p2m_teardown(struct p2m_domain *p2m
 {
     struct page_info *pg;
     struct domain *d = p2m->domain;
-#ifdef __x86_64__
     unsigned long gfn;
     p2m_type_t t;
     mfn_t mfn;
-#endif
 
     if (p2m == NULL)
         return;
 
     p2m_lock(p2m);
 
-#ifdef __x86_64__
     /* Try to unshare any remaining shared p2m entries. Safeguard
      * Since relinquish_shared_pages should have done the work. */ 
     for ( gfn=0; gfn < p2m->max_mapped_pfn; gfn++ )
@@ -439,7 +432,6 @@ void p2m_teardown(struct p2m_domain *p2m
             BUG_ON(mem_sharing_unshare_page(d, gfn, MEM_SHARING_DESTROY_GFN));
         }
     }
-#endif
 
     p2m->phys_table = pagetable_null();
 
@@ -565,7 +557,6 @@ guest_physmap_add_entry(struct domain *d
     for ( i = 0; i < (1UL << page_order); i++ )
     {
         omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, 0, NULL);
-#ifdef __x86_64__
         if ( p2m_is_shared(ot) )
         {
             /* Do an unshare to cleanly take care of all corner 
@@ -592,7 +583,6 @@ guest_physmap_add_entry(struct domain *d
             omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, 0, NULL);
             ASSERT(!p2m_is_shared(ot));
         }
-#endif /* __x86_64__ */
         if ( p2m_is_grant(ot) )
         {
             /* Really shouldn't be unmapping grant maps this way */
@@ -840,7 +830,6 @@ set_shared_p2m_entry(struct domain *d, u
     return rc;
 }
 
-#ifdef __x86_64__
 /**
  * p2m_mem_paging_nominate - Mark a guest page as to-be-paged-out
  * @d: guest domain
@@ -1430,9 +1419,6 @@ int p2m_get_mem_access(struct domain *d,
     return 0;
 }
 
-
-#endif /* __x86_64__ */
-
 static struct p2m_domain *
 p2m_getlru_nestedp2m(struct domain *d, struct p2m_domain *p2m)
 {
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/mm/shadow/Makefile
--- a/xen/arch/x86/mm/shadow/Makefile	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/mm/shadow/Makefile	Wed Sep 12 13:29:30 2012 +0100
@@ -1,4 +1,3 @@
-obj-$(x86_32) += common.o guest_2.o guest_3.o
 obj-$(x86_64) += common.o guest_2.o guest_3.o guest_4.o
 
 guest_%.o: multi.c Makefile
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/mm/shadow/common.c
--- a/xen/arch/x86/mm/shadow/common.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/mm/shadow/common.c	Wed Sep 12 13:29:30 2012 +0100
@@ -276,12 +276,6 @@ hvm_emulate_cmpxchg(enum x86_segment seg
         return v->arch.paging.mode->shadow.x86_emulate_cmpxchg(
             v, addr, old[0], new[0], bytes, sh_ctxt);
 
-#ifdef __i386__
-    if ( bytes == 8 )
-        return v->arch.paging.mode->shadow.x86_emulate_cmpxchg8b(
-            v, addr, old[0], old[1], new[0], new[1], sh_ctxt);
-#endif
-
     return X86EMUL_UNHANDLEABLE;
 }
 
@@ -353,12 +347,6 @@ pv_emulate_cmpxchg(enum x86_segment seg,
         return v->arch.paging.mode->shadow.x86_emulate_cmpxchg(
             v, offset, old[0], new[0], bytes, sh_ctxt);
 
-#ifdef __i386__
-    if ( bytes == 8 )
-        return v->arch.paging.mode->shadow.x86_emulate_cmpxchg8b(
-            v, offset, old[0], old[1], new[0], new[1], sh_ctxt);
-#endif
-
     return X86EMUL_UNHANDLEABLE;
 }
 
@@ -2879,29 +2867,23 @@ static void sh_update_paging_modes(struc
             v->arch.guest_table = d->arch.paging.shadow.unpaged_pagetable;
             v->arch.paging.mode = &SHADOW_INTERNAL_NAME(sh_paging_mode, 2);
         }
+        else if ( hvm_long_mode_enabled(v) )
+        {
+            // long mode guest...
+            v->arch.paging.mode =
+                &SHADOW_INTERNAL_NAME(sh_paging_mode, 4);
+        }
+        else if ( hvm_pae_enabled(v) )
+        {
+            // 32-bit PAE mode guest...
+            v->arch.paging.mode =
+                &SHADOW_INTERNAL_NAME(sh_paging_mode, 3);
+        }
         else
         {
-#ifdef __x86_64__
-            if ( hvm_long_mode_enabled(v) )
-            {
-                // long mode guest...
-                v->arch.paging.mode =
-                    &SHADOW_INTERNAL_NAME(sh_paging_mode, 4);
-            }
-            else
-#endif
-                if ( hvm_pae_enabled(v) )
-                {
-                    // 32-bit PAE mode guest...
-                    v->arch.paging.mode =
-                        &SHADOW_INTERNAL_NAME(sh_paging_mode, 3);
-                }
-                else
-                {
-                    // 32-bit 2 level guest...
-                    v->arch.paging.mode =
-                        &SHADOW_INTERNAL_NAME(sh_paging_mode, 2);
-                }
+            // 32-bit 2 level guest...
+            v->arch.paging.mode =
+                &SHADOW_INTERNAL_NAME(sh_paging_mode, 2);
         }
 
         if ( pagetable_is_null(v->arch.monitor_table) )
@@ -3664,11 +3646,6 @@ int shadow_track_dirty_vram(struct domai
     }
     else
     {
-#ifdef __i386__
-        unsigned long map_mfn = INVALID_MFN;
-        void *map_sl1p = NULL;
-#endif
-
         /* Iterate over VRAM to track dirty bits. */
         for ( i = 0; i < nr; i++ ) {
             mfn_t mfn = get_gfn_query_unlocked(d, begin_pfn + i, &t);
@@ -3702,21 +3679,7 @@ int shadow_track_dirty_vram(struct domai
                     {
                         /* Hopefully the most common case: only one mapping,
                          * whose dirty bit we can use. */
-                        l1_pgentry_t *sl1e;
-#ifdef __i386__
-                        void *sl1p = map_sl1p;
-                        unsigned long sl1mfn = paddr_to_pfn(sl1ma);
-
-                        if ( sl1mfn != map_mfn ) {
-                            if ( map_sl1p )
-                                sh_unmap_domain_page(map_sl1p);
-                            map_sl1p = sl1p = sh_map_domain_page(_mfn(sl1mfn));
-                            map_mfn = sl1mfn;
-                        }
-                        sl1e = sl1p + (sl1ma & ~PAGE_MASK);
-#else
-                        sl1e = maddr_to_virt(sl1ma);
-#endif
+                        l1_pgentry_t *sl1e = maddr_to_virt(sl1ma);
 
                         if ( l1e_get_flags(*sl1e) & _PAGE_DIRTY )
                         {
@@ -3743,11 +3706,6 @@ int shadow_track_dirty_vram(struct domai
             }
         }
 
-#ifdef __i386__
-        if ( map_sl1p )
-            sh_unmap_domain_page(map_sl1p);
-#endif
-
         rc = -EFAULT;
         if ( copy_to_guest(dirty_bitmap, dirty_vram->dirty_bitmap, dirty_size) == 0 ) {
             memset(dirty_vram->dirty_bitmap, 0, dirty_size);
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/mm/shadow/multi.c
--- a/xen/arch/x86/mm/shadow/multi.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/mm/shadow/multi.c	Wed Sep 12 13:29:30 2012 +0100
@@ -5096,41 +5096,6 @@ sh_x86_emulate_cmpxchg(struct vcpu *v, u
     return rv;
 }
 
-#ifdef __i386__
-static int
-sh_x86_emulate_cmpxchg8b(struct vcpu *v, unsigned long vaddr, 
-                          unsigned long old_lo, unsigned long old_hi,
-                          unsigned long new_lo, unsigned long new_hi,
-                          struct sh_emulate_ctxt *sh_ctxt)
-{
-    void *addr;
-    u64 old, new, prev;
-    int rv = X86EMUL_OKAY;
-
-    /* Unaligned writes are only acceptable on HVM */
-    if ( (vaddr & 7) && !is_hvm_vcpu(v) )
-        return X86EMUL_UNHANDLEABLE;
-
-    addr = emulate_map_dest(v, vaddr, 8, sh_ctxt);
-    if ( emulate_map_dest_failed(addr) )
-        return (long)addr;
-
-    old = (((u64) old_hi) << 32) | (u64) old_lo;
-    new = (((u64) new_hi) << 32) | (u64) new_lo;
-
-    paging_lock(v->domain);
-    prev = cmpxchg(((u64 *)addr), old, new);
-
-    if ( prev != old )
-        rv = X86EMUL_CMPXCHG_FAILED;
-
-    emulate_unmap_dest(v, addr, 8, sh_ctxt);
-    shadow_audit_tables(v);
-    paging_unlock(v->domain);
-    return rv;
-}
-#endif
-
 /**************************************************************************/
 /* Audit tools */
 
@@ -5455,9 +5420,6 @@ const struct paging_mode sh_paging_mode 
     .shadow.detach_old_tables      = sh_detach_old_tables,
     .shadow.x86_emulate_write      = sh_x86_emulate_write,
     .shadow.x86_emulate_cmpxchg    = sh_x86_emulate_cmpxchg,
-#ifdef __i386__
-    .shadow.x86_emulate_cmpxchg8b  = sh_x86_emulate_cmpxchg8b,
-#endif
     .shadow.make_monitor_table     = sh_make_monitor_table,
     .shadow.destroy_monitor_table  = sh_destroy_monitor_table,
 #if SHADOW_OPTIMIZATIONS & SHOPT_WRITABLE_HEURISTIC
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/numa.c
--- a/xen/arch/x86/numa.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/numa.c	Wed Sep 12 13:29:30 2012 +0100
@@ -96,7 +96,6 @@ static int __init populate_memnodemap(co
 
 static int __init allocate_cachealigned_memnodemap(void)
 {
-#ifndef __i386__
 	unsigned long size = PFN_UP(memnodemapsize * sizeof(*memnodemap));
 	unsigned long mfn = alloc_boot_pages(size, 1);
 
@@ -115,13 +114,6 @@ static int __init allocate_cachealigned_
 	memnodemapsize = size / sizeof(*memnodemap);
 
 	return 0;
-#else
-	printk(KERN_ERR
-	       "Memory to Node hash needs %lu entries, got only %zu\n",
-	       memnodemapsize, ARRAY_SIZE(_memnodemap));
-	memnodemapsize = 0;
-	return -1;
-#endif
 }
 
 /*
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/oprofile/backtrace.c
--- a/xen/arch/x86/oprofile/backtrace.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/oprofile/backtrace.c	Wed Sep 12 13:29:30 2012 +0100
@@ -10,10 +10,10 @@
  *
  */
 
-#include<xen/types.h>
-#include<asm/page.h>
-#include<xen/xenoprof.h>
-#include<xen/guest_access.h>
+#include <xen/types.h>
+#include <asm/page.h>
+#include <xen/xenoprof.h>
+#include <xen/guest_access.h>
 
 struct frame_head {
     struct frame_head * ebp;
@@ -22,14 +22,12 @@ struct frame_head {
 typedef struct frame_head frame_head_t;
 DEFINE_XEN_GUEST_HANDLE(frame_head_t);
 
-#ifdef CONFIG_X86_64
 struct frame_head_32bit {
     uint32_t ebp;
     uint32_t ret;
 } __attribute__((packed));
 typedef struct frame_head_32bit frame_head32_t;
 DEFINE_COMPAT_HANDLE(frame_head32_t);
-#endif
 
 static struct frame_head *
 dump_hypervisor_backtrace(struct vcpu *vcpu, const struct frame_head *head,
@@ -46,7 +44,6 @@ dump_hypervisor_backtrace(struct vcpu *v
     return head->ebp;
 }
 
-#ifdef CONFIG_X86_64
 static inline int is_32bit_vcpu(struct vcpu *vcpu)
 {
     if (is_hvm_vcpu(vcpu))
@@ -54,7 +51,6 @@ static inline int is_32bit_vcpu(struct v
     else
         return is_pv_32bit_vcpu(vcpu);
 }
-#endif
 
 static struct frame_head *
 dump_guest_backtrace(struct vcpu *vcpu, const struct frame_head *head,
@@ -62,7 +58,6 @@ dump_guest_backtrace(struct vcpu *vcpu, 
 {
     frame_head_t bufhead;
 
-#ifdef CONFIG_X86_64
     if ( is_32bit_vcpu(vcpu) )
     {
         __compat_handle_const_frame_head32_t guest_head =
@@ -78,7 +73,6 @@ dump_guest_backtrace(struct vcpu *vcpu, 
         bufhead.ret = bufhead32.ret;
     }
     else
-#endif
     {
         XEN_GUEST_HANDLE(const_frame_head_t) guest_head =
             const_guest_handle_from_ptr(head, frame_head_t);
@@ -136,11 +130,7 @@ static int valid_hypervisor_stack(const 
 				  const struct cpu_user_regs *regs)
 {
     unsigned long headaddr = (unsigned long)head;
-#ifdef CONFIG_X86_64
     unsigned long stack = (unsigned long)regs->rsp;
-#else
-    unsigned long stack = (unsigned long)regs;
-#endif
     unsigned long stack_base = (stack & ~(STACK_SIZE - 1)) + STACK_SIZE;
 
     return headaddr > stack && headaddr < stack_base;
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/oprofile/op_model_athlon.c
--- a/xen/arch/x86/oprofile/op_model_athlon.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/oprofile/op_model_athlon.c	Wed Sep 12 13:29:30 2012 +0100
@@ -53,12 +53,8 @@ static unsigned long reset_value[MAX_COU
 
 extern char svm_stgi_label[];
 
-#ifdef CONFIG_X86_64
 u32 ibs_caps = 0;
 static u64 ibs_op_ctl;
-#else
-#define ibs_op_ctl 0
-#endif
 
 /* IBS cpuid feature detection */
 #define IBS_CPUID_FEATURES              0x8000001b
@@ -352,7 +348,6 @@ static int athlon_check_ctrs(unsigned in
 
 static inline void start_ibs(void)
 {
-#ifdef CONFIG_X86_64
 	u64 val = 0;
 
 	if (!ibs_caps)
@@ -390,7 +385,6 @@ static inline void start_ibs(void)
 		val = op_amd_randomize_ibs_op(ibs_op_ctl);
 		wrmsrl(MSR_AMD64_IBSOPCTL, val);
 	}
-#endif
 }
  
 static void athlon_start(struct op_msrs const * const msrs)
@@ -439,8 +433,6 @@ static void athlon_stop(struct op_msrs c
 	stop_ibs();
 }
 
-#ifdef CONFIG_X86_64
-
 #define IBSCTL_LVTOFFSETVAL             (1 << 8)
 #define APIC_EILVT_MSG_NMI              0x4
 #define APIC_EILVT_LVTOFF_IBS           1
@@ -535,8 +527,6 @@ void __init ibs_init(void)
 		(unsigned)ibs_caps);
 }
 
-#endif /* CONFIG_X86_64 */
-
 struct op_x86_model_spec const op_athlon_spec = {
 	.num_counters = K7_NUM_COUNTERS,
 	.num_controls = K7_NUM_CONTROLS,
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/physdev.c	Wed Sep 12 13:29:30 2012 +0100
@@ -23,9 +23,7 @@ int physdev_map_pirq(domid_t, int type, 
                      struct msi_info *);
 int physdev_unmap_pirq(domid_t, int pirq);
 
-#ifdef CONFIG_X86_64
 #include "x86_64/mmconfig.h"
-#endif
 
 #ifndef COMPAT
 typedef long ret_t;
@@ -609,7 +607,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
         break;
     }
 
-#ifdef __x86_64__
     case PHYSDEVOP_pci_mmcfg_reserved: {
         struct physdev_pci_mmcfg_reserved info;
 
@@ -629,7 +626,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
                                  info.start_bus, info.end_bus, info.flags);
         break;
     }
-#endif
 
     case PHYSDEVOP_restore_msi: {
         struct physdev_restore_msi restore_msi;
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/setup.c	Wed Sep 12 13:29:30 2012 +0100
@@ -86,13 +86,7 @@ cpumask_t __read_mostly cpu_present_map;
 
 unsigned long __read_mostly xen_phys_start;
 
-#ifdef CONFIG_X86_32
-/* Limits of Xen heap, used to initialise the allocator. */
-unsigned long __initdata xenheap_initial_phys_start;
-unsigned long __read_mostly xenheap_phys_end;
-#else
 unsigned long __read_mostly xen_virt_end;
-#endif
 
 DEFINE_PER_CPU(struct tss_struct, init_tss);
 
@@ -174,10 +168,8 @@ static void free_xen_data(char *s, char 
     init_xenheap_pages(__pa(s), __pa(e));
 #endif
     memguard_guard_range(s, e-s);
-#if defined(CONFIG_X86_64)
     /* Also zap the mapping in the 1:1 area. */
     memguard_guard_range(__va(__pa(s)), e-s);
-#endif
 }
 
 extern char __init_begin[], __init_end[], __bss_start[];
@@ -271,10 +263,8 @@ static void *__init bootstrap_map(const 
     uint64_t start, end, mask = (1L << L2_PAGETABLE_SHIFT) - 1;
     void *ret;
 
-#ifdef __x86_64__
     if ( system_state != SYS_STATE_early_boot )
         return mod ? mfn_to_virt(mod->mod_start) : NULL;
-#endif
 
     if ( !mod )
     {
@@ -384,7 +374,6 @@ static uint64_t __init consider_modules(
 
 static void __init setup_max_pdx(void)
 {
-#ifdef __x86_64__
     max_pdx = pfn_to_pdx(max_page - 1) + 1;
 
     if ( max_pdx > (DIRECTMAP_SIZE >> PAGE_SHIFT) )
@@ -394,7 +383,6 @@ static void __init setup_max_pdx(void)
         max_pdx = FRAMETABLE_SIZE / sizeof(*frame_table);
 
     max_page = pdx_to_pfn(max_pdx - 1) + 1;
-#endif
 }
 
 void set_pdx_range(unsigned long smfn, unsigned long emfn)
@@ -680,11 +668,9 @@ void __init __start_xen(unsigned long mb
         destroy_xen_mappings(xen_phys_start,
                              xen_phys_start + BOOTSTRAP_MAP_BASE);
 
-#ifdef CONFIG_X86_64
         /* Make boot page tables match non-EFI boot. */
         l3_bootmap[l3_table_offset(BOOTSTRAP_MAP_BASE)] =
             l3e_from_paddr(__pa(l2_bootmap), __PAGE_HYPERVISOR);
-#endif
 
         memmap_type = loader;
     }
@@ -814,13 +800,10 @@ void __init __start_xen(unsigned long mb
         {
             end = min(e, limit);
             set_pdx_range(s >> PAGE_SHIFT, end >> PAGE_SHIFT);
-#ifdef CONFIG_X86_64
             map_pages_to_xen((unsigned long)__va(s), s >> PAGE_SHIFT,
                              (end - s) >> PAGE_SHIFT, PAGE_HYPERVISOR);
-#endif
         }
 
-#if defined(CONFIG_X86_64)
         e = min_t(uint64_t, e, 1ULL << (PAGE_SHIFT + 32));
 #define reloc_size ((__pa(&_end) + mask) & ~mask)
         /* Is the region suitable for relocating Xen? */
@@ -916,7 +899,6 @@ void __init __start_xen(unsigned long mb
 
             bootstrap_map(NULL);
         }
-#endif
 
         /* Is the region suitable for relocating the multiboot modules? */
         for ( j = mbi->mods_count - 1; j >= 0; j-- )
@@ -943,10 +925,6 @@ void __init __start_xen(unsigned long mb
             }
         }
 
-#ifdef CONFIG_X86_32
-        /* Confine the kexec area to below 4Gb. */
-        e = min_t(uint64_t, e, 1ULL << 32);
-#endif
         /* Don't overlap with modules. */
         e = consider_modules(s, e, PAGE_ALIGN(kexec_crash_area.size),
                              mod, mbi->mods_count, -1);
@@ -966,17 +944,10 @@ void __init __start_xen(unsigned long mb
         reserve_e820_ram(&boot_e820, s, s + PAGE_ALIGN(mod[i].mod_end));
     }
 
-#if defined(CONFIG_X86_32)
-    xenheap_initial_phys_start = (PFN_UP(__pa(&_end)) + 1) << PAGE_SHIFT;
-    /* Must pass a single mapped page for populating bootmem_region_list. */
-    init_boot_pages(__pa(&_end), xenheap_initial_phys_start);
-    xenheap_phys_end = DIRECTMAP_MBYTES << 20;
-#else
     if ( !xen_phys_start )
         EARLY_FAIL("Not enough memory to relocate Xen.\n");
     reserve_e820_ram(&boot_e820, efi_enabled ? mbi->mem_upper : __pa(&_start),
                      __pa(&_end));
-#endif
 
     /* Late kexec reservation (dynamic start address). */
     kexec_reserve_area(&boot_e820);
@@ -990,22 +961,15 @@ void __init __start_xen(unsigned long mb
     for ( i = 0; i < boot_e820.nr_map; i++ )
     {
         uint64_t s, e, mask = PAGE_SIZE - 1;
-#ifdef CONFIG_X86_64
         uint64_t map_s, map_e;
-#endif
 
         /* Only page alignment required now. */
         s = (boot_e820.map[i].addr + mask) & ~mask;
         e = (boot_e820.map[i].addr + boot_e820.map[i].size) & ~mask;
-#if defined(CONFIG_X86_32)
-        s = max_t(uint64_t, s, xenheap_phys_end);
-#else
         s = max_t(uint64_t, s, 1<<20);
-#endif
         if ( (boot_e820.map[i].type != E820_RAM) || (s >= e) )
             continue;
 
-#ifdef __x86_64__
         if ( !acpi_boot_table_init_done &&
              s >= (1ULL << 32) &&
              !acpi_boot_table_init() )
@@ -1042,11 +1006,9 @@ void __init __start_xen(unsigned long mb
                                   " %013"PRIx64"-%013"PRIx64"\n",
                    e, map_e);
         }
-#endif
 
         set_pdx_range(s >> PAGE_SHIFT, e >> PAGE_SHIFT);
 
-#ifdef CONFIG_X86_64
         /* Need to create mappings above BOOTSTRAP_MAP_BASE. */
         map_s = max_t(uint64_t, s, BOOTSTRAP_MAP_BASE);
         map_e = min_t(uint64_t, e,
@@ -1080,29 +1042,22 @@ void __init __start_xen(unsigned long mb
                              (map_s - s) >> PAGE_SHIFT, PAGE_HYPERVISOR);
             init_boot_pages(s, map_s);
         }
-#else
-        init_boot_pages(s, e);
-#endif
     }
 
     for ( i = 0; i < mbi->mods_count; ++i )
     {
         set_pdx_range(mod[i].mod_start,
                       mod[i].mod_start + PFN_UP(mod[i].mod_end));
-#ifdef CONFIG_X86_64
         map_pages_to_xen((unsigned long)mfn_to_virt(mod[i].mod_start),
                          mod[i].mod_start,
                          PFN_UP(mod[i].mod_end), PAGE_HYPERVISOR);
-#endif
     }
-#ifdef CONFIG_X86_64
     map_pages_to_xen((unsigned long)__va(kexec_crash_area.start),
                      kexec_crash_area.start >> PAGE_SHIFT,
                      PFN_UP(kexec_crash_area.size), PAGE_HYPERVISOR);
     xen_virt_end = ((unsigned long)_end + (1UL << L2_PAGETABLE_SHIFT) - 1) &
                    ~((1UL << L2_PAGETABLE_SHIFT) - 1);
     destroy_xen_mappings(xen_virt_end, XEN_VIRT_START + BOOTSTRAP_MAP_BASE);
-#endif
 
     memguard_init();
 
@@ -1151,30 +1106,10 @@ void __init __start_xen(unsigned long mb
 
     numa_initmem_init(0, max_page);
 
-#if defined(CONFIG_X86_32)
-    /* Initialise the Xen heap. */
-    for ( nr_pages = i = 0; i < boot_e820.nr_map; i++ )
-    {
-        uint64_t s = boot_e820.map[i].addr;
-        uint64_t e = s + boot_e820.map[i].size;
-        s = max_t(uint64_t, s, xenheap_initial_phys_start);
-        e = min_t(uint64_t, e, xenheap_phys_end);
-        if ( (boot_e820.map[i].type != E820_RAM) || (s >= e) )
-            continue;
-        init_xenheap_pages(s, e);
-        nr_pages += (e - s) >> PAGE_SHIFT;
-    }
-    printk("Xen heap: %luMB (%lukB)\n", 
-           nr_pages >> (20 - PAGE_SHIFT),
-           nr_pages << (PAGE_SHIFT - 10));
-#endif
-
     end_boot_allocator();
     system_state = SYS_STATE_boot;
 
-#if defined(CONFIG_X86_64)
     vesa_init();
-#endif
 
     softirq_init();
     tasklet_subsys_init();
@@ -1217,10 +1152,8 @@ void __init __start_xen(unsigned long mb
         max_cpus = nr_cpu_ids;
     }
 
-#ifdef CONFIG_X86_64
     /* Low mappings were only needed for some BIOS table parsing. */
     zap_low_mappings();
-#endif
 
     init_apic_mappings();
 
@@ -1268,11 +1201,9 @@ void __init __start_xen(unsigned long mb
 
     pt_pci_init();
 
-#ifdef CONFIG_X86_64
     vesa_mtrr_init();
 
     acpi_mmcfg_init();
-#endif
 
     iommu_setup();    /* setup iommu if available */
 
@@ -1406,10 +1337,8 @@ void arch_get_xen_caps(xen_capabilities_
 
     (*info)[0] = '\0';
 
-#ifdef CONFIG_X86_64
     snprintf(s, sizeof(s), "xen-%d.%d-x86_64 ", major, minor);
     safe_strcat(*info, s);
-#endif
     snprintf(s, sizeof(s), "xen-%d.%d-x86_32p ", major, minor);
     safe_strcat(*info, s);
     if ( hvm_enabled )
@@ -1418,10 +1347,8 @@ void arch_get_xen_caps(xen_capabilities_
         safe_strcat(*info, s);
         snprintf(s, sizeof(s), "hvm-%d.%d-x86_32p ", major, minor);
         safe_strcat(*info, s);
-#ifdef CONFIG_X86_64
         snprintf(s, sizeof(s), "hvm-%d.%d-x86_64 ", major, minor);
         safe_strcat(*info, s);
-#endif
     }
 }
 
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/shutdown.c
--- a/xen/arch/x86/shutdown.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/shutdown.c	Wed Sep 12 13:29:30 2012 +0100
@@ -100,202 +100,6 @@ void machine_halt(void)
     __machine_halt(NULL);
 }
 
-#ifdef __i386__
-
-/* The following code and data reboots the machine by switching to real
-   mode and jumping to the BIOS reset entry point, as if the CPU has
-   really been reset.  The previous version asked the keyboard
-   controller to pulse the CPU reset line, which is more thorough, but
-   doesn't work with at least one type of 486 motherboard.  It is easy
-   to stop this code working; hence the copious comments. */
-
-static unsigned long long
-real_mode_gdt_entries [3] =
-{
-    0x0000000000000000ULL,      /* Null descriptor */
-    0x00009a000000ffffULL,      /* 16-bit real-mode 64k code at 0x00000000 */
-    0x000092000100ffffULL       /* 16-bit real-mode 64k data at 0x00000100 */
-};
-
-static const struct
-{
-    unsigned short       size __attribute__ ((packed));
-    unsigned long long * base __attribute__ ((packed));
-}
-real_mode_gdt = { sizeof (real_mode_gdt_entries) - 1, real_mode_gdt_entries },
-real_mode_idt = { 0x3ff, NULL };
-
-
-/* This is 16-bit protected mode code to disable paging and the cache,
-   switch to real mode and jump to the BIOS reset code.
-
-   The instruction that switches to real mode by writing to CR0 must be
-   followed immediately by a far jump instruction, which set CS to a
-   valid value for real mode, and flushes the prefetch queue to avoid
-   running instructions that have already been decoded in protected
-   mode.
-
-   Clears all the flags except ET, especially PG (paging), PE
-   (protected-mode enable) and TS (task switch for coprocessor state
-   save).  Flushes the TLB after paging has been disabled.  Sets CD and
-   NW, to disable the cache on a 486, and invalidates the cache.  This
-   is more like the state of a 486 after reset.  I don't know if
-   something else should be done for other chips.
-
-   More could be done here to set up the registers as if a CPU reset had
-   occurred; hopefully real BIOSs don't assume much. */
-
-static const unsigned char real_mode_switch [] =
-{
-    0x0f, 0x20, 0xc0,                           /*    movl  %cr0,%eax        */
-    0x66, 0x83, 0xe0, 0x11,                     /*    andl  $0x00000011,%eax */
-    0x66, 0x0d, 0x00, 0x00, 0x00, 0x60,         /*    orl   $0x60000000,%eax */
-    0x0f, 0x22, 0xc0,                           /*    movl  %eax,%cr0        */
-    0x0f, 0x22, 0xd8,                           /*    movl  %eax,%cr3        */
-    0x0f, 0x20, 0xc2,                           /*    movl  %cr0,%edx        */
-    0x66, 0x81, 0xe2, 0x00, 0x00, 0x00, 0x60,   /*    andl  $0x60000000,%edx */
-    0x74, 0x02,                                 /*    jz    f                */
-    0x0f, 0x09,                                 /*    wbinvd                 */
-    0x24, 0x10,                                 /* f: andb  $0x10,al         */
-    0x0f, 0x22, 0xc0                            /*    movl  %eax,%cr0        */
-};
-#define MAX_LENGTH 0x40
-static const unsigned char jump_to_bios [] =
-{
-    0xea, 0xf0, 0xff, 0x00, 0xf0                /*    ljmp  $0xf000,$0xfff0  */
-};
-
-/*
- * Switch to real mode and then execute the code
- * specified by the code and length parameters.
- * We assume that length will aways be less that MAX_LENGTH!
- */
-static void machine_real_restart(const unsigned char *code, unsigned length)
-{
-    local_irq_disable();
-
-    /* Write zero to CMOS register number 0x0f, which the BIOS POST
-       routine will recognize as telling it to do a proper reboot.  (Well
-       that's what this book in front of me says -- it may only apply to
-       the Phoenix BIOS though, it's not clear).  At the same time,
-       disable NMIs by setting the top bit in the CMOS address register,
-       as we're about to do peculiar things to the CPU. */
-
-    spin_lock(&rtc_lock);
-    CMOS_WRITE(0x00, 0x8f);
-    spin_unlock(&rtc_lock);
-
-    /* Identity-map virtual address zero. */
-
-    map_pages_to_xen(0, 0, 1, __PAGE_HYPERVISOR|MAP_SMALL_PAGES);
-    set_current(idle_vcpu[0]);
-    write_ptbase(idle_vcpu[0]);
-
-    /* For the switch to real mode, copy some code to low memory.  It has
-       to be in the first 64k because it is running in 16-bit mode, and it
-       has to have the same physical and virtual address, because it turns
-       off paging.  Copy it near the end of the first page, out of the way
-       of BIOS variables. */
-
-    memcpy((void *)(PAGE_SIZE - sizeof(real_mode_switch) - MAX_LENGTH),
-           real_mode_switch, sizeof(real_mode_switch));
-    memcpy((void *)(PAGE_SIZE - MAX_LENGTH), code, length);
-
-    /* Set up the IDT for real mode. */
-
-    __asm__ __volatile__("lidt %0": : "m" (real_mode_idt));
-
-    /* Set up a GDT from which we can load segment descriptors for real
-       mode.  The GDT is not used in real mode; it is just needed here to
-       prepare the descriptors. */
-
-    __asm__ __volatile__("lgdt %0": : "m" (real_mode_gdt));
-
-    /* Load the data segment registers, and thus the descriptors ready for
-       real mode.  The base address of each segment is 0x100, 16 times the
-       selector value being loaded here.  This is so that the segment
-       registers don't have to be reloaded after switching to real mode:
-       the values are consistent for real mode operation already. */
-
-    __asm__ __volatile__ ("\tmov %0,%%ds\n"
-                          "\tmov %0,%%es\n"
-                          "\tmov %0,%%fs\n"
-                          "\tmov %0,%%gs\n"
-                          "\tmov %0,%%ss"
-                          :
-                          : "r" (0x0010));
-
-    /* Jump to the 16-bit code that we copied earlier.  It disables paging
-       and the cache, switches to real mode, and jumps to the BIOS reset
-       entry point. */
-
-    __asm__ __volatile__ ("ljmp $0x0008,%0"
-                          :
-                          : "i" ((void *)(PAGE_SIZE -
-                                          sizeof(real_mode_switch) -
-                                          MAX_LENGTH)));
-}
-
-static int __init set_bios_reboot(struct dmi_system_id *d)
-{
-    if ( reboot_type != BOOT_BIOS )
-    {
-        reboot_type = BOOT_BIOS;
-        printk("%s series board detected. "
-               "Selecting BIOS-method for reboots.\n", d->ident);
-    }
-    return 0;
-}
-
-static struct dmi_system_id __initdata reboot_dmi_table[] = {
-    {    /* Handle problems with rebooting on Dell 1300's */
-        .callback = set_bios_reboot,
-        .ident = "Dell PowerEdge 1300",
-        .matches = {
-            DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 1300/"),
-        },
-    },
-    {    /* Handle problems with rebooting on Dell 300's */
-        .callback = set_bios_reboot,
-        .ident = "Dell PowerEdge 300",
-        .matches = {
-            DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 300/"),
-        },
-    },
-    {    /* Handle problems with rebooting on Dell 2400's */
-        .callback = set_bios_reboot,
-        .ident = "Dell PowerEdge 2400",
-        .matches = {
-            DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 2400"),
-        },
-    },
-    {    /* Handle problems with rebooting on HP laptops */
-        .callback = set_bios_reboot,
-        .ident = "HP Compaq Laptop",
-        .matches = {
-            DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq"),
-        },
-    },
-    { }
-};
-
-static int __init reboot_init(void)
-{
-    dmi_check_system(reboot_dmi_table);
-    return 0;
-}
-__initcall(reboot_init);
-
-#else /* __x86_64__ */
-
-#define machine_real_restart(x, y)
-
-#endif
-
 static void __machine_restart(void *pdelay)
 {
     machine_restart(*(unsigned int *)pdelay);
@@ -371,7 +175,7 @@ void machine_restart(unsigned int delay_
             reboot_type = BOOT_KBD;
             break;
         case BOOT_BIOS:
-            machine_real_restart(jump_to_bios, sizeof(jump_to_bios));
+            /* unsupported on x86_64 */
             reboot_type = BOOT_KBD;
             break;
         case BOOT_ACPI:
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/smpboot.c
--- a/xen/arch/x86/smpboot.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/smpboot.c	Wed Sep 12 13:29:30 2012 +0100
@@ -660,9 +660,7 @@ static void cpu_smpboot_free(unsigned in
     order = get_order_from_pages(NR_RESERVED_GDT_PAGES);
     free_xenheap_pages(per_cpu(gdt_table, cpu), order);
 
-#ifdef __x86_64__
     free_xenheap_pages(per_cpu(compat_gdt_table, cpu), order);
-#endif
 
     order = get_order_from_bytes(IDT_ENTRIES * sizeof(idt_entry_t));
     free_xenheap_pages(idt_tables[cpu], order);
@@ -695,14 +693,12 @@ static int cpu_smpboot_alloc(unsigned in
     BUILD_BUG_ON(NR_CPUS > 0x10000);
     gdt[PER_CPU_GDT_ENTRY - FIRST_RESERVED_GDT_ENTRY].a = cpu;
 
-#ifdef __x86_64__
     per_cpu(compat_gdt_table, cpu) = gdt =
         alloc_xenheap_pages(order, MEMF_node(cpu_to_node(cpu)));
     if ( gdt == NULL )
         goto oom;
     memcpy(gdt, boot_cpu_compat_gdt_table, NR_RESERVED_GDT_PAGES * PAGE_SIZE);
     gdt[PER_CPU_GDT_ENTRY - FIRST_RESERVED_GDT_ENTRY].a = cpu;
-#endif
 
     order = get_order_from_bytes(IDT_ENTRIES * sizeof(idt_entry_t));
     idt_tables[cpu] = alloc_xenheap_pages(order, MEMF_node(cpu_to_node(cpu)));
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/srat.c
--- a/xen/arch/x86/srat.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/srat.c	Wed Sep 12 13:29:30 2012 +0100
@@ -115,7 +115,6 @@ static __init void bad_srat(void)
 		pxm2node[i] = NUMA_NO_NODE;
 }
 
-#ifdef CONFIG_X86_64
 /*
  * A lot of BIOS fill in 10 (= no distance) everywhere. This messes
  * up the NUMA heuristics which wants the local node to have a smaller
@@ -157,11 +156,6 @@ void __init acpi_numa_slit_init(struct a
 	acpi_slit = mfn_to_virt(mfn);
 	memcpy(acpi_slit, slit, slit->header.length);
 }
-#else
-void __init acpi_numa_slit_init(struct acpi_table_slit *slit)
-{
-}
-#endif
 
 /* Callback for Proximity Domain -> x2APIC mapping */
 void __init
@@ -267,9 +261,7 @@ acpi_numa_memory_affinity_init(struct ac
 	{
 		printk(KERN_INFO "SRAT: hot plug zone found %"PRIx64" - %"PRIx64" \n",
 				start, end);
-#ifdef CONFIG_X86_64
 		mem_hotplug = 1;
-#endif
 	}
 
 	i = conflicting_memblks(start, end);
@@ -348,8 +340,6 @@ static int nodes_cover_memory(void)
 
 void __init acpi_numa_arch_fixup(void) {}
 
-#ifdef __x86_64__
-
 static u64 __initdata srat_region_mask;
 
 static u64 __init fill_mask(u64 mask)
@@ -411,8 +401,6 @@ void __init srat_parse_regions(u64 addr)
 	pfn_pdx_hole_setup(mask >> PAGE_SHIFT);
 }
 
-#endif /* __x86_64__ */
-
 /* Use the information discovered above to actually set up the nodes. */
 int __init acpi_scan_nodes(u64 start, u64 end)
 {
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/time.c
--- a/xen/arch/x86/time.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/time.c	Wed Sep 12 13:29:30 2012 +0100
@@ -120,31 +120,15 @@ static inline u32 mul_frac(u32 multiplic
 static inline u64 scale_delta(u64 delta, struct time_scale *scale)
 {
     u64 product;
-#ifdef CONFIG_X86_32
-    u32 tmp1, tmp2;
-#endif
 
     if ( scale->shift < 0 )
         delta >>= -scale->shift;
     else
         delta <<= scale->shift;
 
-#ifdef CONFIG_X86_32
-    asm (
-        "mul  %5       ; "
-        "mov  %4,%%eax ; "
-        "mov  %%edx,%4 ; "
-        "mul  %5       ; "
-        "xor  %5,%5    ; "
-        "add  %4,%%eax ; "
-        "adc  %5,%%edx ; "
-        : "=A" (product), "=r" (tmp1), "=r" (tmp2)
-        : "a" ((u32)delta), "1" ((u32)(delta >> 32)), "2" (scale->mul_frac) );
-#else
     asm (
         "mul %%rdx ; shrd $32,%%rdx,%%rax"
         : "=a" (product) : "0" (delta), "d" ((u64)scale->mul_frac) );
-#endif
 
     return product;
 }
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/trace.c
--- a/xen/arch/x86/trace.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/trace.c	Wed Sep 12 13:29:30 2012 +0100
@@ -6,16 +6,10 @@
 #include <xen/sched.h>
 #include <xen/trace.h>
 
-#ifndef __x86_64__
-#undef TRC_64_FLAG
-#define TRC_64_FLAG 0
-#endif
-
 void trace_hypercall(void)
 {
     struct cpu_user_regs *regs = guest_cpu_user_regs();
 
-#ifdef __x86_64__
     if ( is_pv_32on64_vcpu(current) )
     {
         struct {
@@ -28,7 +22,6 @@ void trace_hypercall(void)
         __trace_var(TRC_PV_HYPERCALL, 1, sizeof(d), &d);
     }
     else
-#endif
     {
         struct {
             unsigned long eip;
@@ -48,7 +41,6 @@ void trace_hypercall(void)
 void __trace_pv_trap(int trapnr, unsigned long eip,
                      int use_error_code, unsigned error_code)
 {
-#ifdef __x86_64__
     if ( is_pv_32on64_vcpu(current) )
     {
         struct {
@@ -66,7 +58,6 @@ void __trace_pv_trap(int trapnr, unsigne
         __trace_var(TRC_PV_TRAP, 1, sizeof(d), &d);
     }
     else
-#endif        
     {
         struct {
             unsigned long eip;
@@ -91,7 +82,6 @@ void __trace_pv_page_fault(unsigned long
 {
     unsigned long eip = guest_cpu_user_regs()->eip;
 
-#ifdef __x86_64__
     if ( is_pv_32on64_vcpu(current) )
     {
         struct {
@@ -105,7 +95,6 @@ void __trace_pv_page_fault(unsigned long
         __trace_var(TRC_PV_PAGE_FAULT, 1, sizeof(d), &d);
     }
     else
-#endif        
     {
         struct {
             unsigned long eip, addr;
@@ -124,14 +113,12 @@ void __trace_pv_page_fault(unsigned long
 
 void __trace_trap_one_addr(unsigned event, unsigned long va)
 {
-#ifdef __x86_64__
     if ( is_pv_32on64_vcpu(current) )
     {
         u32 d = va;
         __trace_var(event, 1, sizeof(d), &d);
     }
     else
-#endif        
     {
         event |= TRC_64_FLAG;
         __trace_var(event, 1, sizeof(va), &va);
@@ -141,7 +128,6 @@ void __trace_trap_one_addr(unsigned even
 void __trace_trap_two_addr(unsigned event, unsigned long va1,
                            unsigned long va2)
 {
-#ifdef __x86_64__
     if ( is_pv_32on64_vcpu(current) )
     {
         struct {
@@ -152,7 +138,6 @@ void __trace_trap_two_addr(unsigned even
         __trace_var(event, 1, sizeof(d), &d);
     }
     else
-#endif        
     {
         struct {
             unsigned long va1, va2;
@@ -176,7 +161,6 @@ void __trace_ptwr_emulation(unsigned lon
      * cases, "unsigned long" is the size of a guest virtual address.
      */
 
-#ifdef __x86_64__
     if ( is_pv_32on64_vcpu(current) )
     {
         struct {
@@ -190,7 +174,6 @@ void __trace_ptwr_emulation(unsigned lon
         __trace_var(TRC_PV_PTWR_EMULATION_PAE, 1, sizeof(d), &d);
     }
     else
-#endif        
     {
         struct {
             l1_pgentry_t pte;
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/traps.c	Wed Sep 12 13:29:30 2012 +0100
@@ -111,13 +111,8 @@ integer_param("debug_stack_lines", debug
 static bool_t __devinitdata opt_ler;
 boolean_param("ler", opt_ler);
 
-#ifdef CONFIG_X86_32
-#define stack_words_per_line 8
-#define ESP_BEFORE_EXCEPTION(regs) ((unsigned long *)&regs->esp)
-#else
 #define stack_words_per_line 4
 #define ESP_BEFORE_EXCEPTION(regs) ((unsigned long *)regs->rsp)
-#endif
 
 static void show_guest_stack(struct vcpu *v, struct cpu_user_regs *regs)
 {
@@ -157,14 +152,7 @@ static void show_guest_stack(struct vcpu
         struct vcpu *vcpu;
 
         ASSERT(guest_kernel_mode(v, regs));
-#ifndef __x86_64__
-        addr = read_cr3();
-        for_each_vcpu( v->domain, vcpu )
-            if ( vcpu->arch.cr3 == addr )
-                break;
-#else
         vcpu = maddr_get_owner(read_cr3()) == v->domain ? v : NULL;
-#endif
         if ( !vcpu )
         {
             stack = do_page_walk(v, (unsigned long)stack);
@@ -387,7 +375,6 @@ unsigned long *get_x86_gpr(struct cpu_us
     case  5: p = &regs->ebp; break;
     case  6: p = &regs->esi; break;
     case  7: p = &regs->edi; break;
-#if defined(__x86_64__)
     case  8: p = &regs->r8;  break;
     case  9: p = &regs->r9;  break;
     case 10: p = &regs->r10; break;
@@ -396,7 +383,6 @@ unsigned long *get_x86_gpr(struct cpu_us
     case 13: p = &regs->r13; break;
     case 14: p = &regs->r14; break;
     case 15: p = &regs->r15; break;
-#endif
     default: p = NULL; break;
     }
 
@@ -823,10 +809,6 @@ static void pv_cpuid(struct cpu_user_reg
         /* Modify Feature Information. */
         if ( !cpu_has_sep )
             __clear_bit(X86_FEATURE_SEP, &d);
-#ifdef __i386__
-        if ( !supervisor_mode_kernel )
-            __clear_bit(X86_FEATURE_SEP, &d);
-#endif
         __clear_bit(X86_FEATURE_DS, &d);
         __clear_bit(X86_FEATURE_ACC, &d);
         __clear_bit(X86_FEATURE_PBE, &d);
@@ -879,10 +861,8 @@ static void pv_cpuid(struct cpu_user_reg
             __clear_bit(X86_FEATURE_LM % 32, &d);
             __clear_bit(X86_FEATURE_LAHF_LM % 32, &c);
         }
-#ifndef __i386__
         if ( is_pv_32on64_vcpu(current) &&
              boot_cpu_data.x86_vendor != X86_VENDOR_AMD )
-#endif
             __clear_bit(X86_FEATURE_SYSCALL % 32, &d);
         __clear_bit(X86_FEATURE_PAGE1GB % 32, &d);
         __clear_bit(X86_FEATURE_RDTSCP % 32, &d);
@@ -1361,11 +1341,9 @@ static int fixup_page_fault(unsigned lon
              ptwr_do_page_fault(v, addr, regs) )
             return EXCRET_fault_fixed;
 
-#ifdef __x86_64__
         if ( IS_PRIV(d) && (regs->error_code & PFEC_page_present) &&
              mmio_ro_do_page_fault(v, addr, regs) )
             return EXCRET_fault_fixed;
-#endif
     }
 
     /* For non-external shadowed guests, we fix up both their own 
@@ -1566,7 +1544,6 @@ static int read_descriptor(unsigned int 
     return 1;
 }
 
-#ifdef __x86_64__
 static int read_gate_descriptor(unsigned int gate_sel,
                                 const struct vcpu *v,
                                 unsigned int *sel,
@@ -1622,20 +1599,15 @@ static int read_gate_descriptor(unsigned
 
     return 1;
 }
-#endif
 
 /* Has the guest requested sufficient permission for this I/O access? */
 static int guest_io_okay(
     unsigned int port, unsigned int bytes,
     struct vcpu *v, struct cpu_user_regs *regs)
 {
-#if defined(__x86_64__)
     /* If in user mode, switch to kernel mode just to read I/O bitmap. */
     int user_mode = !(v->arch.flags & TF_kernel_mode);
 #define TOGGLE_MODE() if ( user_mode ) toggle_guest_mode(v)
-#elif defined(__i386__)
-#define TOGGLE_MODE() ((void)0)
-#endif
 
     if ( !vm86_mode(regs) &&
          (v->arch.pv_vcpu.iopl >= (guest_kernel_mode(v, regs) ? 1 : 3)) )
@@ -1889,11 +1861,7 @@ static inline uint64_t guest_misc_enable
     }                                                                       \
     (eip) += sizeof(_x); _x; })
 
-#if defined(CONFIG_X86_32)
-# define read_sreg(regs, sr) ((regs)->sr)
-#elif defined(CONFIG_X86_64)
-# define read_sreg(regs, sr) read_segment_register(sr)
-#endif
+#define read_sreg(regs, sr) read_segment_register(sr)
 
 static int is_cpufreq_controller(struct domain *d)
 {
@@ -1901,9 +1869,7 @@ static int is_cpufreq_controller(struct 
             (d->domain_id == 0));
 }
 
-#ifdef CONFIG_X86_64
 #include "x86_64/mmconfig.h"
-#endif
 
 static int emulate_privileged_op(struct cpu_user_regs *regs)
 {
@@ -2034,7 +2000,6 @@ static int emulate_privileged_op(struct 
                   (ar & _SEGMENT_CODE) || !(ar & _SEGMENT_WR)) )
                 goto fail;
         }
-#ifdef CONFIG_X86_64
         else
         {
             if ( lm_ovr == lm_seg_none || data_sel < 4 )
@@ -2062,7 +2027,6 @@ static int emulate_privileged_op(struct 
             data_limit = ~0UL;
             ar = _SEGMENT_WR|_SEGMENT_S|_SEGMENT_DPL|_SEGMENT_P;
         }
-#endif
 
         port = (u16)regs->edx;
 
@@ -2126,7 +2090,6 @@ static int emulate_privileged_op(struct 
      * GPR context. This is needed for some systems which (ab)use IN/OUT
      * to communicate with BIOS code in system-management mode.
      */
-#ifdef __x86_64__
     /* movq $host_to_guest_gpr_switch,%rcx */
     io_emul_stub[0] = 0x48;
     io_emul_stub[1] = 0xb9;
@@ -2134,14 +2097,6 @@ static int emulate_privileged_op(struct 
     /* callq *%rcx */
     io_emul_stub[10] = 0xff;
     io_emul_stub[11] = 0xd1;
-#else
-    /* call host_to_guest_gpr_switch */
-    io_emul_stub[0] = 0xe8;
-    *(s32 *)&io_emul_stub[1] =
-        (char *)host_to_guest_gpr_switch - &io_emul_stub[5];
-    /* 7 x nop */
-    memset(&io_emul_stub[5], 0x90, 7);
-#endif
     /* data16 or nop */
     io_emul_stub[12] = (op_bytes != 2) ? 0x90 : 0x66;
     /* <io-access opcode> */
@@ -2443,7 +2398,6 @@ static int emulate_privileged_op(struct 
         msr_content = ((uint64_t)edx << 32) | eax;
         switch ( (u32)regs->ecx )
         {
-#ifdef CONFIG_X86_64
         case MSR_FS_BASE:
             if ( is_pv_32on64_vcpu(v) )
                 goto fail;
@@ -2465,7 +2419,6 @@ static int emulate_privileged_op(struct 
                 goto fail;
             v->arch.pv_vcpu.gs_base_user = msr_content;
             break;
-#endif
         case MSR_K7_FID_VID_STATUS:
         case MSR_K7_FID_VID_CTL:
         case MSR_K8_PSTATE_LIMIT:
@@ -2509,10 +2462,8 @@ static int emulate_privileged_op(struct 
             if ( (rdmsr_safe(MSR_FAM10H_MMIO_CONF_BASE, val) != 0) )
                 goto fail;
             if (
-#ifdef CONFIG_X86_64
                  (pci_probe & PCI_PROBE_MASK) == PCI_PROBE_MMCONF ?
                  val != msr_content :
-#endif
                  ((val ^ msr_content) &
                   ~( FAM10H_MMIO_CONF_ENABLE |
                     (FAM10H_MMIO_CONF_BUSRANGE_MASK <<
@@ -2600,7 +2551,6 @@ static int emulate_privileged_op(struct 
     case 0x32: /* RDMSR */
         switch ( (u32)regs->ecx )
         {
-#ifdef CONFIG_X86_64
         case MSR_FS_BASE:
             if ( is_pv_32on64_vcpu(v) )
                 goto fail;
@@ -2619,7 +2569,6 @@ static int emulate_privileged_op(struct 
             regs->eax = v->arch.pv_vcpu.gs_base_user & 0xFFFFFFFFUL;
             regs->edx = v->arch.pv_vcpu.gs_base_user >> 32;
             break;
-#endif
         case MSR_K7_FID_VID_CTL:
         case MSR_K7_FID_VID_STATUS:
         case MSR_K8_PSTATE_LIMIT:
@@ -2714,7 +2663,6 @@ static inline int check_stack_limit(unsi
 
 static void emulate_gate_op(struct cpu_user_regs *regs)
 {
-#ifdef __x86_64__
     struct vcpu *v = current;
     unsigned int sel, ar, dpl, nparm, opnd_sel;
     unsigned int op_default, op_bytes, ad_default, ad_bytes;
@@ -3071,7 +3019,6 @@ static void emulate_gate_op(struct cpu_u
 
     regs->cs = sel;
     instruction_done(regs, off, 0);
-#endif
 }
 
 void do_general_protection(struct cpu_user_regs *regs)
@@ -3134,16 +3081,6 @@ void do_general_protection(struct cpu_us
         return;
     }
 
-#if defined(__i386__)
-    if ( VM_ASSIST(v->domain, VMASST_TYPE_4gb_segments) && 
-         (regs->error_code == 0) && 
-         gpf_emulate_4gb(regs) )
-    {
-        TRACE_1D(TRC_PV_EMULATE_4GB, regs->eip);
-        return;
-    }
-#endif
-
     /* Pass on GPF as is. */
     do_guest_trap(TRAP_gp_fault, regs, 1);
     return;
@@ -3425,7 +3362,6 @@ void do_debug(struct cpu_user_regs *regs
     {
         if ( regs->eflags & X86_EFLAGS_TF )
         {
-#ifdef __x86_64__
             /* In SYSENTER entry path we can't zap TF until EFLAGS is saved. */
             if ( (regs->rip >= (unsigned long)sysenter_entry) &&
                  (regs->rip <= (unsigned long)sysenter_eflags_saved) )
@@ -3434,7 +3370,6 @@ void do_debug(struct cpu_user_regs *regs
                     regs->eflags &= ~X86_EFLAGS_TF;
                 goto out;
             }
-#endif
             if ( !debugger_trap_fatal(TRAP_debug, regs) )
             {
                 WARN_ON(1);
@@ -3816,12 +3751,6 @@ long set_debugreg(struct vcpu *v, int re
                         return -EPERM;
                     io_enable |= value & (3 << ((i - 16) >> 1));
                 }
-#ifdef __i386__
-                if ( ((boot_cpu_data.x86_vendor != X86_VENDOR_INTEL) ||
-                      !boot_cpu_has(X86_FEATURE_LM)) &&
-                     (((value >> i) & 0xc) == DR_LEN_8) )
-                    return -EPERM;
-#endif
             }
 
             /* Guest DR5 is a handy stash for I/O intercept information. */
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/x86_32/Makefile
--- a/xen/arch/x86/x86_32/Makefile	Wed Sep 12 13:24:28 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-obj-y += domain_page.o
-obj-bin-y += entry.o
-obj-bin-y += gpr_switch.o
-obj-y += mm.o
-obj-y += seg_fixup.o
-obj-y += traps.o
-obj-y += machine_kexec.o
-obj-y += pci.o
-
-obj-$(crash_debug) += gdbstub.o
-
-obj-bin-$(supervisor_mode_kernel) += supervisor_mode_kernel.o
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/x86_32/asm-offsets.c
--- a/xen/arch/x86/x86_32/asm-offsets.c	Wed Sep 12 13:24:28 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,140 +0,0 @@
-/*
- * Generate definitions needed by assembly language modules.
- * This code generates raw asm output which is post-processed
- * to extract and format the required data.
- */
-#define COMPILE_OFFSETS
-
-#include <xen/config.h>
-#include <xen/perfc.h>
-#include <xen/sched.h>
-#include <asm/fixmap.h>
-#include <asm/hardirq.h>
-#include <xen/multiboot.h>
-
-#define DEFINE(_sym, _val) \
-    __asm__ __volatile__ ( "\n->" #_sym " %0 " #_val : : "i" (_val) )
-#define BLANK() \
-    __asm__ __volatile__ ( "\n->" : : )
-#define OFFSET(_sym, _str, _mem) \
-    DEFINE(_sym, offsetof(_str, _mem));
-
-/* base-2 logarithm */
-#define __L2(_x)  (((_x) & 0x00000002) ?   1 : 0)
-#define __L4(_x)  (((_x) & 0x0000000c) ? ( 2 + __L2( (_x)>> 2)) : __L2( _x))
-#define __L8(_x)  (((_x) & 0x000000f0) ? ( 4 + __L4( (_x)>> 4)) : __L4( _x))
-#define __L16(_x) (((_x) & 0x0000ff00) ? ( 8 + __L8( (_x)>> 8)) : __L8( _x))
-#define LOG_2(_x) (((_x) & 0xffff0000) ? (16 + __L16((_x)>>16)) : __L16(_x))
-
-void __dummy__(void)
-{
-    OFFSET(UREGS_eax, struct cpu_user_regs, eax);
-    OFFSET(UREGS_ebx, struct cpu_user_regs, ebx);
-    OFFSET(UREGS_ecx, struct cpu_user_regs, ecx);
-    OFFSET(UREGS_edx, struct cpu_user_regs, edx);
-    OFFSET(UREGS_esi, struct cpu_user_regs, esi);
-    OFFSET(UREGS_edi, struct cpu_user_regs, edi);
-    OFFSET(UREGS_esp, struct cpu_user_regs, esp);
-    OFFSET(UREGS_ebp, struct cpu_user_regs, ebp);
-    OFFSET(UREGS_eip, struct cpu_user_regs, eip);
-    OFFSET(UREGS_cs, struct cpu_user_regs, cs);
-    OFFSET(UREGS_ds, struct cpu_user_regs, ds);
-    OFFSET(UREGS_es, struct cpu_user_regs, es);
-    OFFSET(UREGS_fs, struct cpu_user_regs, fs);
-    OFFSET(UREGS_gs, struct cpu_user_regs, gs);
-    OFFSET(UREGS_ss, struct cpu_user_regs, ss);
-    OFFSET(UREGS_eflags, struct cpu_user_regs, eflags);
-    OFFSET(UREGS_error_code, struct cpu_user_regs, error_code);
-    OFFSET(UREGS_entry_vector, struct cpu_user_regs, entry_vector);
-    OFFSET(UREGS_saved_upcall_mask, struct cpu_user_regs, saved_upcall_mask);
-    OFFSET(UREGS_kernel_sizeof, struct cpu_user_regs, esp);
-    DEFINE(UREGS_user_sizeof, sizeof(struct cpu_user_regs));
-    BLANK();
-
-    OFFSET(VCPU_processor, struct vcpu, processor);
-    OFFSET(VCPU_vcpu_info, struct vcpu, vcpu_info);
-    OFFSET(VCPU_trap_bounce, struct vcpu, arch.pv_vcpu.trap_bounce);
-    OFFSET(VCPU_thread_flags, struct vcpu, arch.flags);
-    OFFSET(VCPU_event_sel, struct vcpu, arch.pv_vcpu.event_callback_cs);
-    OFFSET(VCPU_event_addr, struct vcpu, arch.pv_vcpu.event_callback_eip);
-    OFFSET(VCPU_failsafe_sel, struct vcpu,
-           arch.pv_vcpu.failsafe_callback_cs);
-    OFFSET(VCPU_failsafe_addr, struct vcpu,
-           arch.pv_vcpu.failsafe_callback_eip);
-    OFFSET(VCPU_kernel_ss, struct vcpu, arch.pv_vcpu.kernel_ss);
-    OFFSET(VCPU_kernel_sp, struct vcpu, arch.pv_vcpu.kernel_sp);
-    OFFSET(VCPU_guest_context_flags, struct vcpu, arch.vgc_flags);
-    OFFSET(VCPU_nmi_pending, struct vcpu, nmi_pending);
-    OFFSET(VCPU_mce_pending, struct vcpu, mce_pending);
-    OFFSET(VCPU_nmi_old_mask, struct vcpu, nmi_state.old_mask);
-    OFFSET(VCPU_mce_old_mask, struct vcpu, mce_state.old_mask);
-    OFFSET(VCPU_async_exception_mask, struct vcpu, async_exception_mask);
-    DEFINE(VCPU_TRAP_NMI, VCPU_TRAP_NMI);
-    DEFINE(VCPU_TRAP_MCE, VCPU_TRAP_MCE);
-    DEFINE(_VGCF_failsafe_disables_events, _VGCF_failsafe_disables_events);
-    BLANK();
-
-    OFFSET(TSS_ss0, struct tss_struct, ss0);
-    OFFSET(TSS_esp0, struct tss_struct, esp0);
-    OFFSET(TSS_ss1, struct tss_struct, ss1);
-    OFFSET(TSS_esp1, struct tss_struct, esp1);
-    DEFINE(TSS_sizeof, sizeof(struct tss_struct));
-    BLANK();
-
-    OFFSET(VCPU_svm_vmcb_pa, struct vcpu, arch.hvm_svm.vmcb_pa);
-    OFFSET(VCPU_svm_vmcb, struct vcpu, arch.hvm_svm.vmcb);
-    OFFSET(VCPU_svm_vmcb_in_sync, struct vcpu, arch.hvm_svm.vmcb_in_sync);
-    BLANK();
-
-    OFFSET(VCPU_vmx_launched, struct vcpu, arch.hvm_vmx.launched);
-    OFFSET(VCPU_vmx_realmode, struct vcpu, arch.hvm_vmx.vmx_realmode);
-    OFFSET(VCPU_vmx_emulate, struct vcpu, arch.hvm_vmx.vmx_emulate);
-    OFFSET(VCPU_vm86_seg_mask, struct vcpu, arch.hvm_vmx.vm86_segment_mask);
-    OFFSET(VCPU_hvm_guest_cr2, struct vcpu, arch.hvm_vcpu.guest_cr[2]);
-    BLANK();
-
-    OFFSET(VCPU_nhvm_guestmode, struct vcpu, arch.hvm_vcpu.nvcpu.nv_guestmode);
-    OFFSET(VCPU_nhvm_p2m, struct vcpu, arch.hvm_vcpu.nvcpu.nv_p2m);
-    OFFSET(VCPU_nsvm_hap_enabled, struct vcpu, arch.hvm_vcpu.nvcpu.u.nsvm.ns_hap_enabled);
-    BLANK();
-
-    OFFSET(VMCB_rax, struct vmcb_struct, rax);
-    OFFSET(VMCB_rip, struct vmcb_struct, rip);
-    OFFSET(VMCB_rsp, struct vmcb_struct, rsp);
-    OFFSET(VMCB_rflags, struct vmcb_struct, rflags);
-    BLANK();
-
-    OFFSET(VCPUINFO_upcall_pending, vcpu_info_t, evtchn_upcall_pending);
-    OFFSET(VCPUINFO_upcall_mask, vcpu_info_t, evtchn_upcall_mask);
-    BLANK();
-
-    OFFSET(CPUINFO_guest_cpu_user_regs, struct cpu_info, guest_cpu_user_regs);
-    OFFSET(CPUINFO_processor_id, struct cpu_info, processor_id);
-    OFFSET(CPUINFO_current_vcpu, struct cpu_info, current_vcpu);
-    DEFINE(CPUINFO_sizeof, sizeof(struct cpu_info));
-    BLANK();
-
-    OFFSET(TRAPBOUNCE_error_code, struct trap_bounce, error_code);
-    OFFSET(TRAPBOUNCE_flags, struct trap_bounce, flags);
-    OFFSET(TRAPBOUNCE_cs, struct trap_bounce, cs);
-    OFFSET(TRAPBOUNCE_eip, struct trap_bounce, eip);
-    BLANK();
-
-#if PERF_COUNTERS
-    DEFINE(ASM_PERFC_hypercalls, PERFC_hypercalls);
-    DEFINE(ASM_PERFC_exceptions, PERFC_exceptions);
-    BLANK();
-#endif
-
-    DEFINE(FIXMAP_apic_base, fix_to_virt(FIX_APIC_BASE));
-    BLANK();
-
-    DEFINE(IRQSTAT_shift, LOG_2(sizeof(irq_cpustat_t)));
-    BLANK();
-
-    OFFSET(CPUINFO86_ext_features, struct cpuinfo_x86, x86_capability[1]);
-    BLANK();
-
-    OFFSET(MB_flags, multiboot_info_t, flags);
-    OFFSET(MB_cmdline, multiboot_info_t, cmdline);
-}
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/x86_32/domain_page.c
--- a/xen/arch/x86/x86_32/domain_page.c	Wed Sep 12 13:24:28 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,279 +0,0 @@
-/******************************************************************************
- * domain_page.h
- * 
- * Allow temporary mapping of domain pages.
- * 
- * Copyright (c) 2003-2006, Keir Fraser <keir@xensource.com>
- */
-
-#include <xen/config.h>
-#include <xen/sched.h>
-#include <xen/mm.h>
-#include <xen/perfc.h>
-#include <xen/domain_page.h>
-#include <asm/current.h>
-#include <asm/flushtlb.h>
-#include <asm/hardirq.h>
-#include <asm/hvm/support.h>
-#include <asm/fixmap.h>
-
-static inline struct vcpu *mapcache_current_vcpu(void)
-{
-    struct vcpu *v;
-
-    /* In the common case we use the mapcache of the running VCPU. */
-    v = current;
-
-    /*
-     * If guest_table is NULL, and we are running a paravirtualised guest,
-     * then it means we are running on the idle domain's page table and must
-     * therefore use its mapcache.
-     */
-    if ( unlikely(!pagetable_get_pfn(v->arch.guest_table)) && !is_hvm_vcpu(v) )
-    {
-        /* If we really are idling, perform lazy context switch now. */
-        if ( (v = idle_vcpu[smp_processor_id()]) == current )
-            sync_local_execstate();
-        /* We must now be running on the idle page table. */
-        ASSERT(read_cr3() == __pa(idle_pg_table));
-    }
-
-    return v;
-}
-
-void *map_domain_page(unsigned long mfn)
-{
-    unsigned long va, flags;
-    unsigned int idx, i;
-    struct vcpu *v;
-    struct mapcache_domain *dcache;
-    struct mapcache_vcpu *vcache;
-    struct vcpu_maphash_entry *hashent;
-
-    perfc_incr(map_domain_page_count);
-
-    v = mapcache_current_vcpu();
-    /* Prevent vcpu pointer being used before initialize. */
-    ASSERT((unsigned long)v != 0xfffff000);
-
-    dcache = &v->domain->arch.mapcache;
-    vcache = &v->arch.mapcache;
-
-    local_irq_save(flags);
-
-    hashent = &vcache->hash[MAPHASH_HASHFN(mfn)];
-    if ( hashent->mfn == mfn )
-    {
-        idx = hashent->idx;
-        hashent->refcnt++;
-        ASSERT(idx < MAPCACHE_ENTRIES);
-        ASSERT(hashent->refcnt != 0);
-        ASSERT(l1e_get_pfn(dcache->l1tab[idx]) == mfn);
-        goto out;
-    }
-
-    spin_lock(&dcache->lock);
-
-    /* Has some other CPU caused a wrap? We must flush if so. */
-    if ( unlikely(dcache->epoch != vcache->shadow_epoch) )
-    {
-        vcache->shadow_epoch = dcache->epoch;
-        if ( NEED_FLUSH(this_cpu(tlbflush_time), dcache->tlbflush_timestamp) )
-        {
-            perfc_incr(domain_page_tlb_flush);
-            flush_tlb_local();
-        }
-    }
-
-    idx = find_next_zero_bit(dcache->inuse, MAPCACHE_ENTRIES, dcache->cursor);
-    if ( unlikely(idx >= MAPCACHE_ENTRIES) )
-    {
-        /* /First/, clean the garbage map and update the inuse list. */
-        for ( i = 0; i < ARRAY_SIZE(dcache->garbage); i++ )
-        {
-            unsigned long x = xchg(&dcache->garbage[i], 0);
-            dcache->inuse[i] &= ~x;
-        }
-
-        /* /Second/, flush TLBs. */
-        perfc_incr(domain_page_tlb_flush);
-        flush_tlb_local();
-        vcache->shadow_epoch = ++dcache->epoch;
-        dcache->tlbflush_timestamp = tlbflush_current_time();
-
-        idx = find_first_zero_bit(dcache->inuse, MAPCACHE_ENTRIES);
-        BUG_ON(idx >= MAPCACHE_ENTRIES);
-    }
-
-    set_bit(idx, dcache->inuse);
-    dcache->cursor = idx + 1;
-
-    spin_unlock(&dcache->lock);
-
-    l1e_write(&dcache->l1tab[idx], l1e_from_pfn(mfn, __PAGE_HYPERVISOR));
-
- out:
-    local_irq_restore(flags);
-    va = MAPCACHE_VIRT_START + (idx << PAGE_SHIFT);
-    return (void *)va;
-}
-
-void unmap_domain_page(const void *va)
-{
-    unsigned int idx;
-    struct vcpu *v;
-    struct mapcache_domain *dcache;
-    unsigned long mfn, flags;
-    struct vcpu_maphash_entry *hashent;
-
-    ASSERT((void *)MAPCACHE_VIRT_START <= va);
-    ASSERT(va < (void *)MAPCACHE_VIRT_END);
-
-    v = mapcache_current_vcpu();
-
-    dcache = &v->domain->arch.mapcache;
-
-    idx = ((unsigned long)va - MAPCACHE_VIRT_START) >> PAGE_SHIFT;
-    mfn = l1e_get_pfn(dcache->l1tab[idx]);
-    hashent = &v->arch.mapcache.hash[MAPHASH_HASHFN(mfn)];
-
-    local_irq_save(flags);
-
-    if ( hashent->idx == idx )
-    {
-        ASSERT(hashent->mfn == mfn);
-        ASSERT(hashent->refcnt != 0);
-        hashent->refcnt--;
-    }
-    else if ( hashent->refcnt == 0 )
-    {
-        if ( hashent->idx != MAPHASHENT_NOTINUSE )
-        {
-            /* /First/, zap the PTE. */
-            ASSERT(l1e_get_pfn(dcache->l1tab[hashent->idx]) == hashent->mfn);
-            l1e_write(&dcache->l1tab[hashent->idx], l1e_empty());
-            /* /Second/, mark as garbage. */
-            set_bit(hashent->idx, dcache->garbage);
-        }
-
-        /* Add newly-freed mapping to the maphash. */
-        hashent->mfn = mfn;
-        hashent->idx = idx;
-    }
-    else
-    {
-        /* /First/, zap the PTE. */
-        l1e_write(&dcache->l1tab[idx], l1e_empty());
-        /* /Second/, mark as garbage. */
-        set_bit(idx, dcache->garbage);
-    }
-
-    local_irq_restore(flags);
-}
-
-void mapcache_domain_init(struct domain *d)
-{
-    d->arch.mapcache.l1tab = d->arch.mm_perdomain_pt +
-        (GDT_LDT_MBYTES << (20 - PAGE_SHIFT));
-    spin_lock_init(&d->arch.mapcache.lock);
-}
-
-void mapcache_vcpu_init(struct vcpu *v)
-{
-    unsigned int i;
-    struct vcpu_maphash_entry *hashent;
-
-    /* Mark all maphash entries as not in use. */
-    for ( i = 0; i < MAPHASH_ENTRIES; i++ )
-    {
-        hashent = &v->arch.mapcache.hash[i];
-        hashent->mfn = ~0UL; /* never valid to map */
-        hashent->idx = MAPHASHENT_NOTINUSE;
-    }
-}
-
-#define GLOBALMAP_BITS (IOREMAP_MBYTES << (20 - PAGE_SHIFT))
-static unsigned long inuse[BITS_TO_LONGS(GLOBALMAP_BITS)];
-static unsigned long garbage[BITS_TO_LONGS(GLOBALMAP_BITS)];
-static unsigned int inuse_cursor;
-static DEFINE_SPINLOCK(globalmap_lock);
-
-void *map_domain_page_global(unsigned long mfn)
-{
-    l2_pgentry_t *pl2e;
-    l1_pgentry_t *pl1e;
-    unsigned int idx, i;
-    unsigned long va;
-
-    ASSERT(!in_irq() && local_irq_is_enabled());
-
-    /* At least half the ioremap space should be available to us. */
-    BUILD_BUG_ON(IOREMAP_VIRT_START + (IOREMAP_MBYTES << 19) >= FIXADDR_START);
-
-    spin_lock(&globalmap_lock);
-
-    idx = find_next_zero_bit(inuse, GLOBALMAP_BITS, inuse_cursor);
-    va = IOREMAP_VIRT_START + (idx << PAGE_SHIFT);
-    if ( unlikely(va >= FIXADDR_START) )
-    {
-        /* /First/, clean the garbage map and update the inuse list. */
-        for ( i = 0; i < ARRAY_SIZE(garbage); i++ )
-        {
-            unsigned long x = xchg(&garbage[i], 0);
-            inuse[i] &= ~x;
-        }
-
-        /* /Second/, flush all TLBs to get rid of stale garbage mappings. */
-        flush_tlb_all();
-
-        idx = find_first_zero_bit(inuse, GLOBALMAP_BITS);
-        va = IOREMAP_VIRT_START + (idx << PAGE_SHIFT);
-        if ( unlikely(va >= FIXADDR_START) )
-        {
-            spin_unlock(&globalmap_lock);
-            return NULL;
-        }
-    }
-
-    set_bit(idx, inuse);
-    inuse_cursor = idx + 1;
-
-    spin_unlock(&globalmap_lock);
-
-    pl2e = virt_to_xen_l2e(va);
-    pl1e = l2e_to_l1e(*pl2e) + l1_table_offset(va);
-    l1e_write(pl1e, l1e_from_pfn(mfn, __PAGE_HYPERVISOR));
-
-    return (void *)va;
-}
-
-void unmap_domain_page_global(const void *va)
-{
-    unsigned long __va = (unsigned long)va;
-    l2_pgentry_t *pl2e;
-    l1_pgentry_t *pl1e;
-    unsigned int idx;
-
-    ASSERT(__va >= IOREMAP_VIRT_START);
-
-    /* /First/, we zap the PTE. */
-    pl2e = virt_to_xen_l2e(__va);
-    pl1e = l2e_to_l1e(*pl2e) + l1_table_offset(__va);
-    l1e_write(pl1e, l1e_empty());
-
-    /* /Second/, we add to the garbage map. */
-    idx = (__va - IOREMAP_VIRT_START) >> PAGE_SHIFT;
-    set_bit(idx, garbage);
-}
-
-/* Translate a map-domain-page'd address to the underlying MFN */
-unsigned long domain_page_map_to_mfn(void *va)
-{
-    l1_pgentry_t *l1e;
-
-    ASSERT( (((unsigned long) va) >= MAPCACHE_VIRT_START) &&
-            (((unsigned long) va) <= MAPCACHE_VIRT_END) );
-    l1e = &__linear_l1_table[
-            l1_linear_offset((unsigned long) va)];
-    return l1e_get_pfn(*l1e);
-}
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/x86_32/entry.S
--- a/xen/arch/x86/x86_32/entry.S	Wed Sep 12 13:24:28 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,757 +0,0 @@
-/*
- * Hypercall and fault low-level handling routines.
- *
- * Copyright (c) 2002-2004, K A Fraser
- * Copyright (c) 1991, 1992 Linus Torvalds
- * 
- * Calling back to a guest OS:
- * ===========================
- * 
- * First, we require that all callbacks (either via a supplied
- * interrupt-descriptor-table, or via the special event or failsafe callbacks
- * in the shared-info-structure) are to ring 1. This just makes life easier,
- * in that it means we don't have to do messy GDT/LDT lookups to find
- * out which the privilege-level of the return code-selector. That code
- * would just be a hassle to write, and would need to account for running
- * off the end of the GDT/LDT, for example. For all callbacks we check
- * that the provided return CS is not == __HYPERVISOR_{CS,DS}. Apart from that 
- * we're safe as don't allow a guest OS to install ring-0 privileges into the
- * GDT/LDT. It's up to the guest OS to ensure all returns via the IDT are to
- * ring 1. If not, we load incorrect SS/ESP values from the TSS (for ring 1
- * rather than the correct ring) and bad things are bound to ensue -- IRET is
- * likely to fault, and we may end up killing the domain (no harm can
- * come to Xen, though).
- *      
- * When doing a callback, we check if the return CS is in ring 0. If so,
- * callback is delayed until next return to ring != 0.
- * If return CS is in ring 1, then we create a callback frame
- * starting at return SS/ESP. The base of the frame does an intra-privilege
- * interrupt-return.
- * If return CS is in ring > 1, we create a callback frame starting
- * at SS/ESP taken from appropriate section of the current TSS. The base
- * of the frame does an inter-privilege interrupt-return.
- * 
- * Note that the "failsafe callback" uses a special stackframe:
- * { return_DS, return_ES, return_FS, return_GS, return_EIP,
- *   return_CS, return_EFLAGS[, return_ESP, return_SS] }
- * That is, original values for DS/ES/FS/GS are placed on stack rather than
- * in DS/ES/FS/GS themselves. Why? It saves us loading them, only to have them
- * saved/restored in guest OS. Furthermore, if we load them we may cause
- * a fault if they are invalid, which is a hassle to deal with. We avoid
- * that problem if we don't load them :-) This property allows us to use
- * the failsafe callback as a fallback: if we ever fault on loading DS/ES/FS/GS
- * on return to ring != 0, we can simply package it up as a return via
- * the failsafe callback, and let the guest OS sort it out (perhaps by
- * killing an application process). Note that we also do this for any
- * faulting IRET -- just let the guest OS handle it via the event
- * callback.
- *
- * We terminate a domain in the following cases:
- *  - creating a callback stack frame (due to bad ring-1 stack).
- *  - faulting IRET on entry to failsafe callback handler.
- * So, each domain must keep its ring-1 %ss/%esp and failsafe callback
- * handler in good order (absolutely no faults allowed!).
- */
-
-#include <xen/config.h>
-#include <xen/errno.h>
-#include <xen/softirq.h>
-#include <asm/asm_defns.h>
-#include <asm/apicdef.h>
-#include <asm/page.h>
-#include <public/xen.h>
-
-        ALIGN
-restore_all_guest:
-        ASSERT_INTERRUPTS_DISABLED
-        testl $X86_EFLAGS_VM,UREGS_eflags(%esp)
-        popl  %ebx
-        popl  %ecx
-        popl  %edx
-        popl  %esi
-        popl  %edi
-        popl  %ebp
-        popl  %eax
-        leal  4(%esp),%esp
-        jnz   .Lrestore_iret_guest
-#ifdef CONFIG_X86_SUPERVISOR_MODE_KERNEL
-        testb $2,UREGS_cs-UREGS_eip(%esp)
-        jnz   .Lrestore_sregs_guest
-        call  restore_ring0_guest
-        jmp   .Lrestore_iret_guest
-#endif
-.Lrestore_sregs_guest:
-.Lft1:  mov  UREGS_ds-UREGS_eip(%esp),%ds
-.Lft2:  mov  UREGS_es-UREGS_eip(%esp),%es
-.Lft3:  mov  UREGS_fs-UREGS_eip(%esp),%fs
-.Lft4:  mov  UREGS_gs-UREGS_eip(%esp),%gs
-.Lrestore_iret_guest:
-.Lft5:  iret
-.section .fixup,"ax"
-.Lfx1:  sti
-        SAVE_ALL_GPRS
-        mov   UREGS_error_code(%esp),%esi
-        pushfl                         # EFLAGS
-        movl  $__HYPERVISOR_CS,%eax
-        pushl %eax                     # CS
-        movl  $.Ldf1,%eax
-        pushl %eax                     # EIP
-        pushl %esi                     # error_code/entry_vector
-        jmp   handle_exception
-.Ldf1:  GET_CURRENT(%ebx)
-        jmp   test_all_events
-failsafe_callback:
-        GET_CURRENT(%ebx)
-        leal  VCPU_trap_bounce(%ebx),%edx
-        movl  VCPU_failsafe_addr(%ebx),%eax
-        movl  %eax,TRAPBOUNCE_eip(%edx)
-        movl  VCPU_failsafe_sel(%ebx),%eax
-        movw  %ax,TRAPBOUNCE_cs(%edx)
-        movb  $TBF_FAILSAFE,TRAPBOUNCE_flags(%edx)
-        bt    $_VGCF_failsafe_disables_events,VCPU_guest_context_flags(%ebx)
-        jnc   1f
-        orb   $TBF_INTERRUPT,TRAPBOUNCE_flags(%edx)
-1:      call  create_bounce_frame
-        xorl  %eax,%eax
-        movl  %eax,UREGS_ds(%esp)
-        movl  %eax,UREGS_es(%esp)
-        movl  %eax,UREGS_fs(%esp)
-        movl  %eax,UREGS_gs(%esp)
-        jmp   test_all_events
-.previous
-        _ASM_PRE_EXTABLE(.Lft1, .Lfx1)
-        _ASM_PRE_EXTABLE(.Lft2, .Lfx1)
-        _ASM_PRE_EXTABLE(.Lft3, .Lfx1)
-        _ASM_PRE_EXTABLE(.Lft4, .Lfx1)
-        _ASM_PRE_EXTABLE(.Lft5, .Lfx1)
-        _ASM_EXTABLE(.Ldf1, failsafe_callback)
-
-        ALIGN
-restore_all_xen:
-        popl %ebx
-        popl %ecx
-        popl %edx
-        popl %esi
-        popl %edi
-        popl %ebp
-        popl %eax
-        addl $4,%esp
-        iret
-
-ENTRY(hypercall)
-        subl $4,%esp
-        FIXUP_RING0_GUEST_STACK
-        SAVE_ALL(,1f)
-1:      sti
-        GET_CURRENT(%ebx)
-        cmpl  $NR_hypercalls,%eax
-        jae   bad_hypercall
-        PERFC_INCR(hypercalls, %eax, %ebx)
-#ifndef NDEBUG
-        /* Create shadow parameters and corrupt those not used by this call. */
-        pushl %eax
-        pushl UREGS_eip+4(%esp)
-        pushl 28(%esp) # EBP
-        pushl 28(%esp) # EDI
-        pushl 28(%esp) # ESI
-        pushl 28(%esp) # EDX
-        pushl 28(%esp) # ECX
-        pushl 28(%esp) # EBX
-        movzb hypercall_args_table(,%eax,1),%ecx
-        leal  (%esp,%ecx,4),%edi
-        subl  $6,%ecx
-        negl  %ecx
-        movl  %eax,%esi
-        movl  $0xDEADBEEF,%eax
-        rep   stosl
-        movl  %esi,%eax
-#define SHADOW_BYTES 32 /* 6 shadow parameters + EIP + hypercall # */
-#else
-        /* 
-         * We need shadow parameters even on non-debug builds. We depend on the
-         * original versions not being clobbered (needed to create a hypercall
-         * continuation). But that isn't guaranteed by the function-call ABI.
-         */ 
-        pushl 20(%esp) # EBP
-        pushl 20(%esp) # EDI
-        pushl 20(%esp) # ESI
-        pushl 20(%esp) # EDX
-        pushl 20(%esp) # ECX
-        pushl 20(%esp) # EBX
-#define SHADOW_BYTES 24 /* 6 shadow parameters */
-#endif
-        cmpb  $0,tb_init_done
-UNLIKELY_START(ne, trace)
-        call  trace_hypercall
-        /* Now restore all the registers that trace_hypercall clobbered */
-        movl  UREGS_eax+SHADOW_BYTES(%esp),%eax /* Hypercall # */
-UNLIKELY_END(trace)
-        call *hypercall_table(,%eax,4)
-        movl  %eax,UREGS_eax+SHADOW_BYTES(%esp) # save the return value
-#undef SHADOW_BYTES
-        addl  $24,%esp     # Discard the shadow parameters
-#ifndef NDEBUG
-        /* Deliberately corrupt real parameter regs used by this hypercall. */
-        popl  %ecx         # Shadow EIP
-        cmpl  %ecx,UREGS_eip+4(%esp)
-        popl  %ecx         # Shadow hypercall index
-        jne   skip_clobber # If EIP has changed then don't clobber
-        movzb hypercall_args_table(,%ecx,1),%ecx
-        movl  %esp,%edi
-        movl  $0xDEADBEEF,%eax
-        rep   stosl
-skip_clobber:
-#endif
-
-test_all_events:
-        xorl %ecx,%ecx
-        notl %ecx
-        cli                             # tests must not race interrupts
-/*test_softirqs:*/  
-        movl VCPU_processor(%ebx),%eax
-        shl  $IRQSTAT_shift,%eax
-        test %ecx,irq_stat(%eax,1)
-        jnz  process_softirqs
-        testb $1,VCPU_mce_pending(%ebx)
-        jnz  process_mce
-.Ltest_guest_nmi:
-        testb $1,VCPU_nmi_pending(%ebx)
-        jnz  process_nmi
-test_guest_events:
-        movl VCPU_vcpu_info(%ebx),%eax
-        movzwl VCPUINFO_upcall_pending(%eax),%eax
-        decl %eax
-        cmpl $0xfe,%eax
-        ja   restore_all_guest
-/*process_guest_events:*/
-        sti
-        leal VCPU_trap_bounce(%ebx),%edx
-        movl VCPU_event_addr(%ebx),%eax
-        movl %eax,TRAPBOUNCE_eip(%edx)
-        movl VCPU_event_sel(%ebx),%eax
-        movw %ax,TRAPBOUNCE_cs(%edx)
-        movb $TBF_INTERRUPT,TRAPBOUNCE_flags(%edx)
-        call create_bounce_frame
-        jmp  test_all_events
-
-        ALIGN
-process_softirqs:
-        sti       
-        call do_softirq
-        jmp  test_all_events
-
-        ALIGN
-/* %ebx: struct vcpu */
-process_mce:
-        testb $1 << VCPU_TRAP_MCE,VCPU_async_exception_mask(%ebx)
-        jnz  .Ltest_guest_nmi
-        sti
-        movb $0,VCPU_mce_pending(%ebx)
-        call set_guest_machinecheck_trapbounce
-        test %eax,%eax
-        jz   test_all_events
-        movzbl VCPU_async_exception_mask(%ebx),%edx # save mask for the
-        movb %dl,VCPU_mce_old_mask(%ebx)            # iret hypercall
-        orl  $1 << VCPU_TRAP_MCE,%edx
-        movb %dl,VCPU_async_exception_mask(%ebx)
-        jmp process_trap
-
-        ALIGN
-/* %ebx: struct vcpu */
-process_nmi:
-        testb $1 << VCPU_TRAP_NMI,VCPU_async_exception_mask(%ebx)
-        jnz  test_guest_events
-        sti
-        movb $0,VCPU_nmi_pending(%ebx)
-        call set_guest_nmi_trapbounce
-        test %eax,%eax
-        jz   test_all_events
-        movzbl VCPU_async_exception_mask(%ebx),%edx # save mask for the
-        movb %dl,VCPU_nmi_old_mask(%ebx)            # iret hypercall
-        orl  $1 << VCPU_TRAP_NMI,%edx
-        movb %dl,VCPU_async_exception_mask(%ebx)
-        /* FALLTHROUGH */
-process_trap:
-        leal VCPU_trap_bounce(%ebx),%edx
-        call create_bounce_frame
-        jmp  test_all_events
-
-bad_hypercall:
-        movl $-ENOSYS,UREGS_eax(%esp)
-        jmp  test_all_events
-
-/* CREATE A BASIC EXCEPTION FRAME ON GUEST OS (RING-1) STACK:            */
-/*   {EIP, CS, EFLAGS, [ESP, SS]}                                        */
-/* %edx == trap_bounce, %ebx == struct vcpu                       */
-/* %eax,%ecx are clobbered. %gs:%esi contain new UREGS_ss/UREGS_esp. */
-create_bounce_frame:
-        ASSERT_INTERRUPTS_ENABLED
-        movl UREGS_eflags+4(%esp),%ecx
-        movb UREGS_cs+4(%esp),%cl
-        testl $(2|X86_EFLAGS_VM),%ecx
-        jz   ring1 /* jump if returning to an existing ring-1 activation */
-        movl VCPU_kernel_sp(%ebx),%esi
-.Lft6:  mov  VCPU_kernel_ss(%ebx),%gs
-        testl $X86_EFLAGS_VM,%ecx
-UNLIKELY_START(nz, bounce_vm86_1)
-        subl $16,%esi       /* push ES/DS/FS/GS (VM86 stack frame) */
-        movl UREGS_es+4(%esp),%eax
-.Lft7:  movl %eax,%gs:(%esi)
-        movl UREGS_ds+4(%esp),%eax
-.Lft8:  movl %eax,%gs:4(%esi)
-        movl UREGS_fs+4(%esp),%eax
-.Lft9:  movl %eax,%gs:8(%esi)
-        movl UREGS_gs+4(%esp),%eax
-.Lft10: movl %eax,%gs:12(%esi)
-UNLIKELY_END(bounce_vm86_1)
-        subl $8,%esi        /* push SS/ESP (inter-priv iret) */
-        movl UREGS_esp+4(%esp),%eax
-.Lft11: movl %eax,%gs:(%esi)
-        movl UREGS_ss+4(%esp),%eax
-.Lft12: movl %eax,%gs:4(%esi)
-        jmp 1f
-ring1:  /* obtain ss/esp from oldss/oldesp -- a ring-1 activation exists */
-        movl UREGS_esp+4(%esp),%esi
-.Lft13: mov  UREGS_ss+4(%esp),%gs
-1:      /* Construct a stack frame: EFLAGS, CS/EIP */
-        movb TRAPBOUNCE_flags(%edx),%cl
-        subl $12,%esi
-        movl UREGS_eip+4(%esp),%eax
-.Lft14: movl %eax,%gs:(%esi)
-        movl VCPU_vcpu_info(%ebx),%eax
-        pushl VCPUINFO_upcall_mask(%eax)
-        testb $TBF_INTERRUPT,%cl
-        setnz %ch                        # TBF_INTERRUPT -> set upcall mask
-        orb  %ch,VCPUINFO_upcall_mask(%eax)
-        popl %eax
-        shll $16,%eax                    # Bits 16-23: saved_upcall_mask
-        movw UREGS_cs+4(%esp),%ax        # Bits  0-15: CS
-#ifdef CONFIG_X86_SUPERVISOR_MODE_KERNEL
-        testw $2,%ax
-        jnz  .Lft15
-        and  $~3,%ax                     # RPL 1 -> RPL 0
-#endif
-.Lft15: movl %eax,%gs:4(%esi)
-        test $0x00FF0000,%eax            # Bits 16-23: saved_upcall_mask
-        setz %ch                         # %ch == !saved_upcall_mask
-        movl UREGS_eflags+4(%esp),%eax
-        andl $~X86_EFLAGS_IF,%eax
-        shlb $1,%ch                      # Bit 9 (EFLAGS.IF)
-        orb  %ch,%ah                     # Fold EFLAGS.IF into %eax
-.Lft16: movl %eax,%gs:8(%esi)
-        test $TBF_EXCEPTION_ERRCODE,%cl
-        jz   1f
-        subl $4,%esi                    # push error_code onto guest frame
-        movl TRAPBOUNCE_error_code(%edx),%eax
-.Lft17: movl %eax,%gs:(%esi)
-1:      testb $TBF_FAILSAFE,%cl
-UNLIKELY_START(nz, bounce_failsafe)
-        subl $16,%esi                # add DS/ES/FS/GS to failsafe stack frame
-        testl $X86_EFLAGS_VM,UREGS_eflags+4(%esp)
-        jnz  .Lvm86_2
-        movl UREGS_ds+4(%esp),%eax   # non-VM86: write real selector values
-.Lft22: movl %eax,%gs:(%esi)
-        movl UREGS_es+4(%esp),%eax
-.Lft23: movl %eax,%gs:4(%esi)
-        movl UREGS_fs+4(%esp),%eax
-.Lft24: movl %eax,%gs:8(%esi)
-        movl UREGS_gs+4(%esp),%eax
-.Lft25: movl %eax,%gs:12(%esi)
-        jmp  .Lnvm86_3
-.Lvm86_2:
-        xorl %eax,%eax               # VM86: we write zero selector values
-.Lft18: movl %eax,%gs:(%esi)
-.Lft19: movl %eax,%gs:4(%esi)
-.Lft20: movl %eax,%gs:8(%esi)
-.Lft21: movl %eax,%gs:12(%esi)
-UNLIKELY_END(bounce_failsafe)
-        testl $X86_EFLAGS_VM,UREGS_eflags+4(%esp)
-UNLIKELY_START(nz, bounce_vm86_3)
-        xorl %eax,%eax      /* zero DS-GS, just as a real CPU would */
-        movl %eax,UREGS_ds+4(%esp)
-        movl %eax,UREGS_es+4(%esp)
-        movl %eax,UREGS_fs+4(%esp)
-        movl %eax,UREGS_gs+4(%esp)
-UNLIKELY_END(bounce_vm86_3)
-.Lnvm86_3:
-        /* Rewrite our stack frame and return to ring 1. */
-        /* IA32 Ref. Vol. 3: TF, VM, RF and NT flags are cleared on trap. */
-        andl $~(X86_EFLAGS_VM|X86_EFLAGS_RF|\
-                X86_EFLAGS_NT|X86_EFLAGS_TF),UREGS_eflags+4(%esp)
-        mov  %gs,UREGS_ss+4(%esp)
-        movl %esi,UREGS_esp+4(%esp)
-        movzwl TRAPBOUNCE_cs(%edx),%eax
-        /* Null selectors (0-3) are not allowed. */
-        testl $~3,%eax
-        jz   domain_crash_synchronous
-        movl %eax,UREGS_cs+4(%esp)
-        movl TRAPBOUNCE_eip(%edx),%eax
-        movl %eax,UREGS_eip+4(%esp)
-        ret
-        _ASM_EXTABLE(.Lft6,  domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft7,  domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft8,  domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft9,  domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft10, domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft11, domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft12, domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft13, domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft14, domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft15, domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft16, domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft17, domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft18, domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft19, domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft20, domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft21, domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft22, domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft23, domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft24, domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft25, domain_crash_synchronous)
-
-domain_crash_synchronous_string:
-        .asciz "domain_crash_sync called from entry.S (%lx)\n"
-
-domain_crash_synchronous:
-        pushl $domain_crash_synchronous_string
-        call  printk
-        jmp   __domain_crash_synchronous
-
-ENTRY(ret_from_intr)
-        GET_CURRENT(%ebx)
-        movl  UREGS_eflags(%esp),%eax
-        movb  UREGS_cs(%esp),%al
-        testl $(3|X86_EFLAGS_VM),%eax
-        jnz   test_all_events
-        jmp   restore_all_xen
-
-ENTRY(page_fault)
-        movw  $TRAP_page_fault,2(%esp)
-handle_exception:
-        FIXUP_RING0_GUEST_STACK
-        SAVE_ALL(1f,2f)
-        .text 1
-        /* Exception within Xen: make sure we have valid %ds,%es. */
-1:      mov   %ecx,%ds
-        mov   %ecx,%es
-        jmp   2f
-        .previous
-2:      testb $X86_EFLAGS_IF>>8,UREGS_eflags+1(%esp)
-        jz    exception_with_ints_disabled
-        sti                             # re-enable interrupts
-1:      xorl  %eax,%eax
-        movw  UREGS_entry_vector(%esp),%ax
-        movl  %esp,%edx
-        pushl %edx                      # push the cpu_user_regs pointer
-        GET_CURRENT(%ebx)
-        PERFC_INCR(exceptions, %eax, %ebx)
-        call  *exception_table(,%eax,4)
-        addl  $4,%esp
-        movl  UREGS_eflags(%esp),%eax
-        movb  UREGS_cs(%esp),%al
-        testl $(3|X86_EFLAGS_VM),%eax
-        jz    restore_all_xen
-        leal  VCPU_trap_bounce(%ebx),%edx
-        testb $TBF_EXCEPTION,TRAPBOUNCE_flags(%edx)
-        jz    test_all_events
-        call  create_bounce_frame
-        movb  $0,TRAPBOUNCE_flags(%edx)
-        jmp   test_all_events
-
-exception_with_ints_disabled:
-        movl  UREGS_eflags(%esp),%eax
-        movb  UREGS_cs(%esp),%al
-        testl $(3|X86_EFLAGS_VM),%eax   # interrupts disabled outside Xen?
-        jnz   FATAL_exception_with_ints_disabled
-        pushl %esp
-        call  search_pre_exception_table
-        addl  $4,%esp
-        testl %eax,%eax                 # no fixup code for faulting EIP?
-        jz    1b
-        movl  %eax,UREGS_eip(%esp)
-        movl  %esp,%esi
-        subl  $4,%esp
-        movl  %esp,%edi
-        movl  $UREGS_kernel_sizeof/4,%ecx
-        rep;  movsl                     # make room for error_code/entry_vector
-        movl  UREGS_error_code(%esp),%eax # error_code/entry_vector
-        movl  %eax,UREGS_kernel_sizeof(%esp)
-        jmp   restore_all_xen           # return to fixup code
-
-FATAL_exception_with_ints_disabled:
-        xorl  %esi,%esi
-        movw  UREGS_entry_vector(%esp),%si
-        movl  %esp,%edx
-        pushl %edx                      # push the cpu_user_regs pointer
-        pushl %esi                      # push the trapnr (entry vector)
-        call  fatal_trap
-        ud2
-                                        
-ENTRY(coprocessor_error)
-        pushl $TRAP_copro_error<<16
-        jmp   handle_exception
-
-ENTRY(simd_coprocessor_error)
-        pushl $TRAP_simd_error<<16
-        jmp   handle_exception
-
-ENTRY(device_not_available)
-        pushl $TRAP_no_device<<16
-        jmp   handle_exception
-
-ENTRY(divide_error)
-        pushl $TRAP_divide_error<<16
-        jmp   handle_exception
-
-ENTRY(debug)
-        pushl $TRAP_debug<<16
-        jmp   handle_exception
-
-ENTRY(int3)
-        pushl $TRAP_int3<<16
-        jmp   handle_exception
-
-ENTRY(overflow)
-        pushl $TRAP_overflow<<16
-        jmp   handle_exception
-
-ENTRY(bounds)
-        pushl $TRAP_bounds<<16
-        jmp   handle_exception
-
-ENTRY(invalid_op)
-        pushl $TRAP_invalid_op<<16
-        jmp   handle_exception
-
-ENTRY(coprocessor_segment_overrun)
-        pushl $TRAP_copro_seg<<16
-        jmp   handle_exception
-
-ENTRY(invalid_TSS)
-        movw  $TRAP_invalid_tss,2(%esp)
-        jmp   handle_exception
-
-ENTRY(segment_not_present)
-        movw  $TRAP_no_segment,2(%esp)
-        jmp   handle_exception
-
-ENTRY(stack_segment)
-        movw  $TRAP_stack_error,2(%esp)
-        jmp   handle_exception
-
-ENTRY(general_protection)
-        movw  $TRAP_gp_fault,2(%esp)
-        jmp   handle_exception
-
-ENTRY(alignment_check)
-        movw  $TRAP_alignment_check,2(%esp)
-        jmp   handle_exception
-
-ENTRY(spurious_interrupt_bug)
-        pushl $TRAP_spurious_int<<16
-        jmp   handle_exception
-
-        .pushsection .init.text, "ax", @progbits
-ENTRY(early_page_fault)
-        SAVE_ALL(1f,1f)
-1:      movl  %esp,%eax
-        pushl %eax
-        call  do_early_page_fault
-        addl  $4,%esp
-        jmp   restore_all_xen
-        .popsection
-
-handle_nmi_mce:
-#ifdef CONFIG_X86_SUPERVISOR_MODE_KERNEL
-        # NMI/MCE entry protocol is incompatible with guest kernel in ring 0.
-        addl  $4,%esp
-        iret
-#else
-        # Save state but do not trash the segment registers!
-        SAVE_ALL(.Lnmi_mce_xen,.Lnmi_mce_common)
-.Lnmi_mce_common:
-        xorl  %eax,%eax
-        movw  UREGS_entry_vector(%esp),%ax
-        movl  %esp,%edx
-        pushl %edx
-        call  *exception_table(,%eax,4)
-        addl  $4,%esp
-        /* 
-         * NB. We may return to Xen context with polluted %ds/%es. But in such
-         * cases we have put guest DS/ES on the guest stack frame, which will
-         * be detected by SAVE_ALL(), or we have rolled back restore_guest.
-         */
-        jmp   ret_from_intr
-.Lnmi_mce_xen:
-        /* Check the outer (guest) context for %ds/%es state validity. */
-        GET_CPUINFO_FIELD(CPUINFO_guest_cpu_user_regs,%ebx)
-        testl $X86_EFLAGS_VM,%ss:UREGS_eflags(%ebx)
-        mov   %ds,%eax
-        mov   %es,%edx
-        jnz   .Lnmi_mce_vm86
-        /* We may have interrupted Xen while messing with %ds/%es... */
-        cmpw  %ax,%cx
-        mov   %ecx,%ds             /* Ensure %ds is valid */
-        cmove UREGS_ds(%ebx),%eax  /* Grab guest DS if it wasn't in %ds */
-        cmpw  %dx,%cx
-        movl  %eax,UREGS_ds(%ebx)  /* Ensure guest frame contains guest DS */
-        cmove UREGS_es(%ebx),%edx  /* Grab guest ES if it wasn't in %es */
-        mov   %ecx,%es             /* Ensure %es is valid */
-        movl  $.Lrestore_sregs_guest,%ecx
-        movl  %edx,UREGS_es(%ebx)  /* Ensure guest frame contains guest ES */
-        cmpl  %ecx,UREGS_eip(%esp)
-        jbe   .Lnmi_mce_common
-        cmpl  $.Lrestore_iret_guest,UREGS_eip(%esp)
-        ja    .Lnmi_mce_common
-        /* Roll outer context restore_guest back to restoring %ds/%es. */
-        movl  %ecx,UREGS_eip(%esp)
-        jmp   .Lnmi_mce_common
-.Lnmi_mce_vm86:
-        /* vm86 is easy: the CPU saved %ds/%es so we can safely stomp them. */
-        mov   %ecx,%ds
-        mov   %ecx,%es
-        jmp   .Lnmi_mce_common
-#endif /* !CONFIG_X86_SUPERVISOR_MODE_KERNEL */
-
-ENTRY(nmi)
-        pushl $TRAP_nmi<<16
-        jmp   handle_nmi_mce
-
-ENTRY(machine_check)
-        pushl $TRAP_machine_check<<16
-        jmp   handle_nmi_mce
-
-ENTRY(setup_vm86_frame)
-        mov %ecx,%ds
-        mov %ecx,%es
-        # Copies the entire stack frame forwards by 16 bytes.
-        .macro copy_vm86_words count=18
-        .if \count
-        pushl ((\count-1)*4)(%esp)
-        popl  ((\count-1)*4)+16(%esp)
-        copy_vm86_words "(\count-1)"
-        .endif
-        .endm
-        copy_vm86_words
-        addl $16,%esp
-        ret
-
-.section .rodata, "a", @progbits
-
-ENTRY(exception_table)
-        .long do_divide_error
-        .long do_debug
-        .long do_nmi
-        .long do_int3
-        .long do_overflow
-        .long do_bounds
-        .long do_invalid_op
-        .long do_device_not_available
-        .long 0 # double fault
-        .long do_coprocessor_segment_overrun
-        .long do_invalid_TSS
-        .long do_segment_not_present
-        .long do_stack_segment
-        .long do_general_protection
-        .long do_page_fault
-        .long do_spurious_interrupt_bug
-        .long do_coprocessor_error
-        .long do_alignment_check
-        .long do_machine_check
-        .long do_simd_coprocessor_error
-
-ENTRY(hypercall_table)
-        .long do_set_trap_table     /*  0 */
-        .long do_mmu_update
-        .long do_set_gdt
-        .long do_stack_switch
-        .long do_set_callbacks
-        .long do_fpu_taskswitch     /*  5 */
-        .long do_sched_op_compat
-        .long do_platform_op
-        .long do_set_debugreg
-        .long do_get_debugreg
-        .long do_update_descriptor  /* 10 */
-        .long do_ni_hypercall
-        .long do_memory_op
-        .long do_multicall
-        .long do_update_va_mapping
-        .long do_set_timer_op       /* 15 */
-        .long do_event_channel_op_compat
-        .long do_xen_version
-        .long do_console_io
-        .long do_physdev_op_compat
-        .long do_grant_table_op     /* 20 */
-        .long do_vm_assist
-        .long do_update_va_mapping_otherdomain
-        .long do_iret
-        .long do_vcpu_op
-        .long do_ni_hypercall       /* 25 */
-        .long do_mmuext_op
-        .long do_xsm_op
-        .long do_nmi_op
-        .long do_sched_op
-        .long do_callback_op        /* 30 */
-        .long do_xenoprof_op
-        .long do_event_channel_op
-        .long do_physdev_op
-        .long do_hvm_op
-        .long do_sysctl             /* 35 */
-        .long do_domctl
-        .long do_kexec_op
-        .long do_tmem_op
-        .rept __HYPERVISOR_arch_0-((.-hypercall_table)/4)
-        .long do_ni_hypercall
-        .endr
-        .long do_mca                /* 48 */
-        .rept NR_hypercalls-((.-hypercall_table)/4)
-        .long do_ni_hypercall
-        .endr
-
-ENTRY(hypercall_args_table)
-        .byte 1 /* do_set_trap_table    */  /*  0 */
-        .byte 4 /* do_mmu_update        */
-        .byte 2 /* do_set_gdt           */
-        .byte 2 /* do_stack_switch      */
-        .byte 4 /* do_set_callbacks     */
-        .byte 1 /* do_fpu_taskswitch    */  /*  5 */
-        .byte 2 /* do_sched_op_compat   */
-        .byte 1 /* do_platform_op       */
-        .byte 2 /* do_set_debugreg      */
-        .byte 1 /* do_get_debugreg      */
-        .byte 4 /* do_update_descriptor */  /* 10 */
-        .byte 0 /* do_ni_hypercall      */
-        .byte 2 /* do_memory_op         */
-        .byte 2 /* do_multicall         */
-        .byte 4 /* do_update_va_mapping */
-        .byte 2 /* do_set_timer_op      */  /* 15 */
-        .byte 1 /* do_event_channel_op_compat */
-        .byte 2 /* do_xen_version       */
-        .byte 3 /* do_console_io        */
-        .byte 1 /* do_physdev_op_compat */
-        .byte 3 /* do_grant_table_op    */  /* 20 */
-        .byte 2 /* do_vm_assist         */
-        .byte 5 /* do_update_va_mapping_otherdomain */
-        .byte 0 /* do_iret              */
-        .byte 3 /* do_vcpu_op           */
-        .byte 0 /* do_ni_hypercall      */  /* 25 */
-        .byte 4 /* do_mmuext_op         */
-        .byte 1 /* do_xsm_op            */
-        .byte 2 /* do_nmi_op            */
-        .byte 2 /* do_sched_op          */
-        .byte 2 /* do_callback_op       */  /* 30 */
-        .byte 2 /* do_xenoprof_op       */
-        .byte 2 /* do_event_channel_op  */
-        .byte 2 /* do_physdev_op        */
-        .byte 2 /* do_hvm_op            */
-        .byte 1 /* do_sysctl            */  /* 35 */
-        .byte 1 /* do_domctl            */
-        .byte 2 /* do_kexec_op          */
-        .byte 1 /* do_tmem_op           */
-        .rept __HYPERVISOR_arch_0-(.-hypercall_args_table)
-        .byte 0 /* do_ni_hypercall      */
-        .endr
-        .byte 1 /* do_mca               */  /* 48 */
-        .rept NR_hypercalls-(.-hypercall_args_table)
-        .byte 0 /* do_ni_hypercall      */
-        .endr
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/x86_32/gdbstub.c
--- a/xen/arch/x86/x86_32/gdbstub.c	Wed Sep 12 13:24:28 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-/*
- * x86-specific gdb stub routines
- * based on x86 cdb(xen/arch/x86/cdb.c), but Extensively modified.
- * 
- * Copyright (C) 2006 Isaku Yamahata <yamahata at valinux co jp>
- *                    VA Linux Systems Japan. K.K.
- *
- * 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 <asm/debugger.h>
-
-void 
-gdb_arch_read_reg_array(struct cpu_user_regs *regs, struct gdb_context *ctx)
-{
-#define GDB_REG(r) gdb_write_to_packet_hex(r, sizeof(r), ctx);
-    GDB_REG(regs->eax);
-    GDB_REG(regs->ecx);
-    GDB_REG(regs->edx);
-    GDB_REG(regs->ebx);
-    GDB_REG(regs->esp);
-    GDB_REG(regs->ebp);
-    GDB_REG(regs->esi);
-    GDB_REG(regs->edi);
-    GDB_REG(regs->eip);
-    GDB_REG(regs->eflags);
-#undef GDB_REG
-#define GDB_SEG_REG(s)  gdb_write_to_packet_hex(s, sizeof(u32), ctx);
-    /* sizeof(segment) = 16bit */
-    /* but gdb requires its return value as 32bit value */
-    GDB_SEG_REG(regs->cs);
-    GDB_SEG_REG(regs->ss);
-    GDB_SEG_REG(regs->ds);
-    GDB_SEG_REG(regs->es);
-    GDB_SEG_REG(regs->fs);
-    GDB_SEG_REG(regs->gs);
-#undef GDB_SEG_REG
-    gdb_send_packet(ctx);
-}
-
-void
-gdb_arch_write_reg_array(struct cpu_user_regs *regs, const char* buf,
-                         struct gdb_context *ctx)
-{
-    /* XXX TODO */
-    gdb_send_reply("E02", ctx);
-}
-
-void
-gdb_arch_read_reg(unsigned long regnum, struct cpu_user_regs *regs,
-                  struct gdb_context *ctx)
-{
-    gdb_send_reply("", ctx);
-}
-
-void
-gdb_arch_write_reg(unsigned long regnum, unsigned long val, 
-                    struct cpu_user_regs *regs, struct gdb_context *ctx)
-{
-    gdb_send_reply("", ctx);
-}
-
-/*
- * Local variables:
- * mode: C
- * c-set-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * End:
- */
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/x86_32/gpr_switch.S
--- a/xen/arch/x86/x86_32/gpr_switch.S	Wed Sep 12 13:24:28 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * GPR context switch between host and guest.
- * Used by IO-port-access emulation stub.
- *
- * Copyright (c) 2006, Novell, Inc.
- */
-
-#include <xen/config.h>
-#include <asm/asm_defns.h>
-
-ENTRY(host_to_guest_gpr_switch)
-        movl  (%esp), %ecx
-        movl  %eax, (%esp)
-        movl  UREGS_edx(%eax), %edx
-        pushl %ebx
-        movl  UREGS_ebx(%eax), %ebx
-        pushl %ebp
-        movl  UREGS_ebp(%eax), %ebp
-        pushl %esi
-        movl  UREGS_esi(%eax), %esi
-        pushl %edi
-        movl  UREGS_edi(%eax), %edi
-        pushl $guest_to_host_gpr_switch
-        pushl %ecx
-        movl  UREGS_ecx(%eax), %ecx
-        movl  UREGS_eax(%eax), %eax
-        ret
-
-ENTRY(guest_to_host_gpr_switch)
-        pushl %edx
-        movl  5*4(%esp), %edx
-        movl  %eax, UREGS_eax(%edx)
-        popl  UREGS_edx(%edx)
-        movl  %edi, UREGS_edi(%edx)
-        popl  %edi
-        movl  %esi, UREGS_esi(%edx)
-        popl  %esi
-        movl  %ebp, UREGS_ebp(%edx)
-        popl  %ebp
-        movl  %ebx, UREGS_ebx(%edx)
-        popl  %ebx
-        movl  %ecx, UREGS_ecx(%edx)
-        popl  %ecx
-        ret
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/x86_32/machine_kexec.c
--- a/xen/arch/x86/x86_32/machine_kexec.c	Wed Sep 12 13:24:28 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-/******************************************************************************
- * machine_kexec.c
- *
- * Xen port written by:
- * - Simon 'Horms' Horman <horms@verge.net.au>
- * - Magnus Damm <magnus@valinux.co.jp>
- */
-
-#include <xen/types.h>
-#include <xen/kernel.h>
-#include <asm/page.h>
-#include <public/kexec.h>
-
-int machine_kexec_get_xen(xen_kexec_range_t *range)
-{
-        range->start = virt_to_maddr(_start);
-        range->size = (unsigned long)xenheap_phys_end -
-                      (unsigned long)range->start;
-        return 0;
-}
-
-/*
- * Local variables:
- * mode: C
- * c-set-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/x86_32/mm.c
--- a/xen/arch/x86/x86_32/mm.c	Wed Sep 12 13:24:28 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,379 +0,0 @@
-/******************************************************************************
- * arch/x86/x86_32/mm.c
- * 
- * Modifications to Linux original are copyright (c) 2004, K A Fraser
- * 
- * 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/config.h>
-#include <xen/lib.h>
-#include <xen/init.h>
-#include <xen/mm.h>
-#include <xen/sched.h>
-#include <xen/guest_access.h>
-#include <asm/current.h>
-#include <asm/page.h>
-#include <asm/flushtlb.h>
-#include <asm/fixmap.h>
-#include <asm/setup.h>
-#include <public/memory.h>
-
-unsigned int __read_mostly PAGE_HYPERVISOR         = __PAGE_HYPERVISOR;
-unsigned int __read_mostly PAGE_HYPERVISOR_NOCACHE = __PAGE_HYPERVISOR_NOCACHE;
-
-static unsigned long __read_mostly mpt_size;
-
-void *alloc_xen_pagetable(void)
-{
-    unsigned long mfn;
-
-    if ( system_state != SYS_STATE_early_boot )
-    {
-        void *v = alloc_xenheap_page();
-
-        BUG_ON(!dom0 && !v);
-        return v;
-    }
-
-    mfn = xenheap_initial_phys_start >> PAGE_SHIFT;
-    xenheap_initial_phys_start += PAGE_SIZE;
-    return mfn_to_virt(mfn);
-}
-
-l2_pgentry_t *virt_to_xen_l2e(unsigned long v)
-{
-    return &idle_pg_table_l2[l2_linear_offset(v)];
-}
-
-void *do_page_walk(struct vcpu *v, unsigned long addr)
-{
-    return NULL;
-}
-
-void __init paging_init(void)
-{
-    unsigned long v;
-    struct page_info *pg;
-    unsigned int i, n;
-
-    if ( cpu_has_pge )
-    {
-        /* Suitable Xen mapping can be GLOBAL. */
-        set_in_cr4(X86_CR4_PGE);
-        PAGE_HYPERVISOR         |= _PAGE_GLOBAL;
-        PAGE_HYPERVISOR_NOCACHE |= _PAGE_GLOBAL;
-        /* Transform early mappings (e.g., the frametable). */
-        for ( v = HYPERVISOR_VIRT_START; v; v += (1 << L2_PAGETABLE_SHIFT) )
-            if ( (l2e_get_flags(idle_pg_table_l2[l2_linear_offset(v)]) &
-                  (_PAGE_PSE|_PAGE_PRESENT)) == (_PAGE_PSE|_PAGE_PRESENT) )
-                l2e_add_flags(idle_pg_table_l2[l2_linear_offset(v)],
-                              _PAGE_GLOBAL);
-        for ( i = 0; i < L1_PAGETABLE_ENTRIES; i++ )
-            l1e_add_flags(l1_identmap[i], _PAGE_GLOBAL);
-    }
-
-    /*
-     * Allocate and map the machine-to-phys table and create read-only mapping 
-     * of MPT for guest-OS use.
-     */
-    mpt_size  = (max_page * BYTES_PER_LONG) + (1UL << L2_PAGETABLE_SHIFT) - 1;
-    mpt_size &= ~((1UL << L2_PAGETABLE_SHIFT) - 1UL);
-#define MFN(x) (((x) << L2_PAGETABLE_SHIFT) / sizeof(unsigned long))
-#define CNT ((sizeof(*frame_table) & -sizeof(*frame_table)) / \
-             sizeof(*machine_to_phys_mapping))
-    BUILD_BUG_ON((sizeof(*frame_table) & ~sizeof(*frame_table)) % \
-                 sizeof(*machine_to_phys_mapping));
-    for ( i = 0; i < (mpt_size >> L2_PAGETABLE_SHIFT); i++ )
-    {
-        for ( n = 0; n < CNT; ++n)
-            if ( mfn_valid(MFN(i) + n * PDX_GROUP_COUNT) )
-                break;
-        if ( n == CNT )
-            continue;
-        if ( (pg = alloc_domheap_pages(NULL, PAGETABLE_ORDER, 0)) == NULL )
-            panic("Not enough memory to bootstrap Xen.\n");
-        l2e_write(&idle_pg_table_l2[l2_linear_offset(RDWR_MPT_VIRT_START) + i],
-                  l2e_from_page(pg, PAGE_HYPERVISOR | _PAGE_PSE));
-        /* NB. Cannot be GLOBAL as shadow_mode_translate reuses this area. */
-        l2e_write(&idle_pg_table_l2[l2_linear_offset(RO_MPT_VIRT_START) + i],
-                  l2e_from_page(
-                      pg, (__PAGE_HYPERVISOR | _PAGE_PSE) & ~_PAGE_RW));
-        /* Fill with INVALID_M2P_ENTRY. */
-        memset((void *)(RDWR_MPT_VIRT_START + (i << L2_PAGETABLE_SHIFT)), 0xFF,
-               1UL << L2_PAGETABLE_SHIFT);
-    }
-#undef CNT
-#undef MFN
-
-    machine_to_phys_mapping_valid = 1;
-
-    /* Create page tables for ioremap()/map_domain_page_global(). */
-    for ( i = 0; i < (IOREMAP_MBYTES >> (L2_PAGETABLE_SHIFT - 20)); i++ )
-    {
-        void *p;
-        l2_pgentry_t *pl2e;
-        pl2e = &idle_pg_table_l2[l2_linear_offset(IOREMAP_VIRT_START) + i];
-        if ( l2e_get_flags(*pl2e) & _PAGE_PRESENT )
-            continue;
-        p = alloc_xenheap_page();
-        clear_page(p);
-        l2e_write(pl2e, l2e_from_page(virt_to_page(p), __PAGE_HYPERVISOR));
-    }
-}
-
-void __init setup_idle_pagetable(void)
-{
-    int i;
-
-    for ( i = 0; i < PDPT_L2_ENTRIES; i++ )
-        l2e_write(&idle_pg_table_l2[l2_linear_offset(PERDOMAIN_VIRT_START)+i],
-                  l2e_from_page(virt_to_page(idle_vcpu[0]->domain->
-                                             arch.mm_perdomain_pt) + i,
-                                __PAGE_HYPERVISOR));
-}
-
-void __init zap_low_mappings(l2_pgentry_t *dom0_l2)
-{
-    int i;
-
-    /* Clear temporary idle mappings from the dom0 initial l2. */
-    for ( i = 0; i < (HYPERVISOR_VIRT_START >> L2_PAGETABLE_SHIFT); i++ )
-        if ( l2e_get_intpte(dom0_l2[i]) ==
-             l2e_get_intpte(idle_pg_table_l2[i]) )
-            l2e_write(&dom0_l2[i], l2e_empty());
-
-    /* Now zap mappings in the idle pagetables. */
-    BUG_ON(l2e_get_pfn(idle_pg_table_l2[0]) != virt_to_mfn(l1_identmap));
-    l2e_write_atomic(&idle_pg_table_l2[0], l2e_empty());
-    destroy_xen_mappings(0, HYPERVISOR_VIRT_START);
-
-    flush_all(FLUSH_TLB_GLOBAL);
-
-    /* Replace with mapping of the boot trampoline only. */
-    map_pages_to_xen(trampoline_phys, trampoline_phys >> PAGE_SHIFT,
-                     PFN_UP(trampoline_end - trampoline_start),
-                     __PAGE_HYPERVISOR);
-}
-
-void __init subarch_init_memory(void)
-{
-    unsigned long m2p_start_mfn;
-    unsigned int i, j;
-    l2_pgentry_t l2e;
-
-    BUILD_BUG_ON(sizeof(struct page_info) != 24);
-
-    /* M2P table is mappable read-only by privileged domains. */
-    for ( i = 0; i < (mpt_size >> L2_PAGETABLE_SHIFT); i++ )
-    {
-        l2e = idle_pg_table_l2[l2_linear_offset(RDWR_MPT_VIRT_START) + i];
-        if ( !(l2e_get_flags(l2e) & _PAGE_PRESENT) )
-            continue;
-        m2p_start_mfn = l2e_get_pfn(l2e);
-        for ( j = 0; j < L2_PAGETABLE_ENTRIES; j++ )
-        {
-            struct page_info *page = mfn_to_page(m2p_start_mfn + j);
-            share_xen_page_with_privileged_guests(page, XENSHARE_readonly);
-        }
-    }
-
-    if ( supervisor_mode_kernel )
-    {
-        /* Guest kernel runs in ring 0, not ring 1. */
-        struct desc_struct *d;
-        d = &boot_cpu_gdt_table[(FLAT_RING1_CS >> 3) - FIRST_RESERVED_GDT_ENTRY];
-        d[0].b &= ~_SEGMENT_DPL;
-        d[1].b &= ~_SEGMENT_DPL;
-    }
-}
-
-long subarch_memory_op(int op, XEN_GUEST_HANDLE(void) arg)
-{
-    struct xen_machphys_mfn_list xmml;
-    unsigned long mfn, last_mfn;
-    unsigned int i, max;
-    l2_pgentry_t l2e;
-    long rc = 0;
-
-    switch ( op )
-    {
-    case XENMEM_machphys_mfn_list:
-        if ( copy_from_guest(&xmml, arg, 1) )
-            return -EFAULT;
-
-        max = min_t(unsigned int, xmml.max_extents, mpt_size >> 21);
-
-        for ( i = 0, last_mfn = 0; i < max; i++ )
-        {
-            l2e = idle_pg_table_l2[l2_linear_offset(
-                RDWR_MPT_VIRT_START + (i << 21))];
-            if ( l2e_get_flags(l2e) & _PAGE_PRESENT )
-                mfn = l2e_get_pfn(l2e);
-            else
-                mfn = last_mfn;
-            ASSERT(mfn);
-            if ( copy_to_guest_offset(xmml.extent_start, i, &mfn, 1) )
-                return -EFAULT;
-            last_mfn = mfn;
-        }
-
-        xmml.nr_extents = i;
-        if ( copy_to_guest(arg, &xmml, 1) )
-            return -EFAULT;
-
-        break;
-
-    default:
-        rc = -ENOSYS;
-        break;
-    }
-
-    return rc;
-}
-
-long do_stack_switch(unsigned long ss, unsigned long esp)
-{
-    struct tss_struct *t = &this_cpu(init_tss);
-
-    fixup_guest_stack_selector(current->domain, ss);
-
-    current->arch.pv_vcpu.kernel_ss = ss;
-    current->arch.pv_vcpu.kernel_sp = esp;
-    t->ss1  = ss;
-    t->esp1 = esp;
-
-    return 0;
-}
-
-/* Returns TRUE if given descriptor is valid for GDT or LDT. */
-int check_descriptor(const struct domain *dom, struct desc_struct *d)
-{
-    unsigned long base, limit;
-    u32 a = d->a, b = d->b;
-    u16 cs;
-
-    /* Let a ring0 guest kernel set any descriptor it wants to. */
-    if ( supervisor_mode_kernel )
-        return 1;
-
-    /* A not-present descriptor will always fault, so is safe. */
-    if ( !(b & _SEGMENT_P) ) 
-        goto good;
-
-    /*
-     * We don't allow a DPL of zero. There is no legitimate reason for 
-     * specifying DPL==0, and it gets rather dangerous if we also accept call 
-     * gates (consider a call gate pointing at another kernel descriptor with 
-     * DPL 0 -- this would get the OS ring-0 privileges).
-     */
-    if ( (b & _SEGMENT_DPL) < (GUEST_KERNEL_RPL(dom) << 13) )
-        d->b = b = (b & ~_SEGMENT_DPL) | (GUEST_KERNEL_RPL(dom) << 13);
-
-    if ( !(b & _SEGMENT_S) )
-    {
-        /*
-         * System segment:
-         *  1. Don't allow interrupt or trap gates as they belong in the IDT.
-         *  2. Don't allow TSS descriptors or task gates as we don't
-         *     virtualise x86 tasks.
-         *  3. Don't allow LDT descriptors because they're unnecessary and
-         *     I'm uneasy about allowing an LDT page to contain LDT
-         *     descriptors. In any case, Xen automatically creates the
-         *     required descriptor when reloading the LDT register.
-         *  4. We allow call gates but they must not jump to a private segment.
-         */
-
-        /* Disallow everything but call gates. */
-        if ( (b & _SEGMENT_TYPE) != 0xc00 )
-            goto bad;
-
-        /* Validate and fix up the target code selector. */
-        cs = a >> 16;
-        fixup_guest_code_selector(dom, cs);
-        if ( !guest_gate_selector_okay(dom, cs) )
-            goto bad;
-        a = d->a = (d->a & 0xffffU) | (cs << 16);
-
-        /* Reserved bits must be zero. */
-        if ( (b & 0xe0) != 0 )
-            goto bad;
-        
-        /* No base/limit check is needed for a call gate. */
-        goto good;
-    }
-    
-    /* Check that base is at least a page away from Xen-private area. */
-    base  = (b&(0xff<<24)) | ((b&0xff)<<16) | (a>>16);
-    if ( base >= (GUEST_SEGMENT_MAX_ADDR - PAGE_SIZE) )
-        goto bad;
-
-    /* Check and truncate the limit if necessary. */
-    limit = (b&0xf0000) | (a&0xffff);
-    limit++; /* We add one because limit is inclusive. */
-    if ( (b & _SEGMENT_G) )
-        limit <<= 12;
-
-    if ( (b & (_SEGMENT_CODE | _SEGMENT_EC)) == _SEGMENT_EC )
-    {
-        /*
-         * DATA, GROWS-DOWN.
-         * Grows-down limit check. 
-         * NB. limit == 0xFFFFF provides no access      (if G=1).
-         *     limit == 0x00000 provides 4GB-4kB access (if G=1).
-         */
-        if ( (base + limit) > base )
-        {
-            limit = -(base & PAGE_MASK);
-            goto truncate;
-        }
-    }
-    else
-    {
-        /*
-         * DATA, GROWS-UP. 
-         * CODE (CONFORMING AND NON-CONFORMING).
-         * Grows-up limit check.
-         * NB. limit == 0xFFFFF provides 4GB access (if G=1).
-         *     limit == 0x00000 provides 4kB access (if G=1).
-         */
-        if ( ((base + limit) <= base) || 
-             ((base + limit) > GUEST_SEGMENT_MAX_ADDR) )
-        {
-            limit = GUEST_SEGMENT_MAX_ADDR - base;
-        truncate:
-            if ( !(b & _SEGMENT_G) )
-                goto bad; /* too dangerous; too hard to work out... */
-            limit = (limit >> 12) - 1;
-            d->a &= ~0x0ffff; d->a |= limit & 0x0ffff;
-            d->b &= ~0xf0000; d->b |= limit & 0xf0000;
-        }
-    }
-
- good:
-    return 1;
- bad:
-    return 0;
-}
-
-/*
- * Local variables:
- * mode: C
- * c-set-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/x86_32/pci.c
--- a/xen/arch/x86/x86_32/pci.c	Wed Sep 12 13:24:28 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/******************************************************************************
- * pci.c
- * 
- * Architecture-dependent PCI access functions.
- */
-
-#include <xen/spinlock.h>
-#include <xen/pci.h>
-#include <xen/init.h>
-#include <asm/io.h>
-
-#define PCI_CONF_ADDRESS(bus, dev, func, reg) \
-    (0x80000000 | (bus << 16) | (dev << 11) | (func << 8) | (reg & ~3))
-
-uint8_t pci_conf_read8(
-    unsigned int seg, unsigned int bus, unsigned int dev, unsigned int func,
-    unsigned int reg)
-{
-    if ( seg || (reg > 255) )
-        return ~0;
-    BUG_ON((bus > 255) || (dev > 31) || (func > 7));
-    return pci_conf_read(PCI_CONF_ADDRESS(bus, dev, func, reg), reg & 3, 1);
-}
-
-uint16_t pci_conf_read16(
-    unsigned int seg, unsigned int bus, unsigned int dev, unsigned int func,
-    unsigned int reg)
-{
-    if ( seg || (reg > 255) )
-        return ~0;
-    BUG_ON((bus > 255) || (dev > 31) || (func > 7));
-    return pci_conf_read(PCI_CONF_ADDRESS(bus, dev, func, reg), reg & 2, 2);
-}
-
-uint32_t pci_conf_read32(
-    unsigned int seg, unsigned int bus, unsigned int dev, unsigned int func,
-    unsigned int reg)
-{
-    if ( seg || (reg > 255) )
-        return ~0;
-    BUG_ON((bus > 255) || (dev > 31) || (func > 7));
-    return pci_conf_read(PCI_CONF_ADDRESS(bus, dev, func, reg), 0, 4);
-}
-
-void pci_conf_write8(
-    unsigned int seg, unsigned int bus, unsigned int dev, unsigned int func,
-    unsigned int reg, uint8_t data)
-{
-    if ( seg )
-        return;
-    BUG_ON((bus > 255) || (dev > 31) || (func > 7) || (reg > 255));
-    pci_conf_write(PCI_CONF_ADDRESS(bus, dev, func, reg), reg & 3, 1, data);
-}
-
-void pci_conf_write16(
-    unsigned int seg, unsigned int bus, unsigned int dev, unsigned int func,
-    unsigned int reg, uint16_t data)
-{
-    if ( seg )
-        return;
-    BUG_ON((bus > 255) || (dev > 31) || (func > 7) || (reg > 255));
-    pci_conf_write(PCI_CONF_ADDRESS(bus, dev, func, reg), reg & 2, 2, data);
-}
-
-void pci_conf_write32(
-    unsigned int seg, unsigned int bus, unsigned int dev, unsigned int func,
-    unsigned int reg, uint32_t data)
-{
-    if ( seg )
-        return;
-    BUG_ON((bus > 255) || (dev > 31) || (func > 7) || (reg > 255));
-    pci_conf_write(PCI_CONF_ADDRESS(bus, dev, func, reg), 0, 4, data);
-}
-
-void __init arch_pci_ro_device(int seg, int bdf)
-{
-}
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/x86_32/seg_fixup.c
--- a/xen/arch/x86/x86_32/seg_fixup.c	Wed Sep 12 13:24:28 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,577 +0,0 @@
-/******************************************************************************
- * arch/x86/x86_32/seg_fixup.c
- * 
- * Support for -ve accesses to pseudo-4GB segments.
- * 
- * Copyright (c) 2004, K A Fraser
- * 
- * 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/config.h>
-#include <xen/init.h>
-#include <xen/sched.h>
-#include <xen/lib.h>
-#include <xen/errno.h>
-#include <xen/mm.h>
-#include <xen/perfc.h>
-#include <asm/current.h>
-#include <asm/processor.h>
-#include <asm/regs.h>
-#include <asm/x86_emulate.h>
-
-/* General instruction properties. */
-#define INSN_SUFFIX_BYTES (7)
-#define OPCODE_BYTE       (1<<4)  
-#define HAS_MODRM         (1<<5)
-
-/* Short forms for the table. */
-#define X  0 /* invalid for some random reason */
-#define O  OPCODE_BYTE
-#define M  HAS_MODRM
-
-static const u8 insn_decode[256] = {
-    /* 0x00 - 0x0F */
-    O|M, O|M, O|M, O|M, X, X, X, X,
-    O|M, O|M, O|M, O|M, X, X, X, X,
-    /* 0x10 - 0x1F */
-    O|M, O|M, O|M, O|M, X, X, X, X,
-    O|M, O|M, O|M, O|M, X, X, X, X,
-    /* 0x20 - 0x2F */
-    O|M, O|M, O|M, O|M, X, X, X, X,
-    O|M, O|M, O|M, O|M, X, X, X, X,
-    /* 0x30 - 0x3F */
-    O|M, O|M, O|M, O|M, X, X, X, X,
-    O|M, O|M, O|M, O|M, X, X, X, X,
-    /* 0x40 - 0x4F */
-    X, X, X, X, X, X, X, X,
-    X, X, X, X, X, X, X, X,
-    /* 0x50 - 0x5F */
-    X, X, X, X, X, X, X, X,
-    X, X, X, X, X, X, X, X,
-    /* 0x60 - 0x6F */
-    X, X, X, X, X, X, X, X,
-    X, O|M|4, X, O|M|1, X, X, X, X,
-    /* 0x70 - 0x7F */
-    X, X, X, X, X, X, X, X,
-    X, X, X, X, X, X, X, X,
-    /* 0x80 - 0x8F */
-    O|M|1, O|M|4, O|M|1, O|M|1, O|M, O|M, O|M, O|M,
-    O|M, O|M, O|M, O|M, O|M, X|M, O|M, O|M,
-    /* 0x90 - 0x9F */
-    X, X, X, X, X, X, X, X,
-    X, X, X, X, X, X, X, X,
-    /* 0xA0 - 0xAF */
-    O|4, O|4, O|4, O|4, X, X, X, X,
-    X, X, X, X, X, X, X, X,
-    /* 0xB0 - 0xBF */
-    X, X, X, X, X, X, X, X,
-    X, X, X, X, X, X, X, X,
-    /* 0xC0 - 0xCF */
-    O|M|1, O|M|1, X, X, X, X, O|M|1, O|M|4,
-    X, X, X, X, X, X, X, X,
-    /* 0xD0 - 0xDF */
-    O|M, O|M, O|M, O|M, X, X, X, X,
-    X, X, X, X, X, X, X, X,
-    /* 0xE0 - 0xEF */
-    X, X, X, X, X, X, X, X,
-    X, X, X, X, X, X, X, X,
-    /* 0xF0 - 0xFF */
-    X, X, X, X, X, X, O|M, O|M,
-    X, X, X, X, X, X, O|M, O|M
-};
-
-static const u8 float_decode[64] = {
-    O|M, O|M, O|M, O|M, O|M, O|M, O|M, O|M, /* 0xD8 */
-    O|M, X, O|M, O|M, O|M, O|M, O|M, O|M, /* 0xD9 */
-    O|M, O|M, O|M, O|M, O|M, O|M, O|M, O|M, /* 0xDA */
-    O|M, X, O|M, O|M, X, O|M, X, O|M, /* 0xDB */
-    O|M, O|M, O|M, O|M, O|M, O|M, O|M, O|M, /* 0xDC */
-    O|M, O|M, O|M, O|M, O|M, X, O|M, O|M, /* 0xDD */
-    O|M, O|M, O|M, O|M, O|M, O|M, O|M, O|M, /* 0xDE */
-    O|M, X, O|M, O|M, O|M, O|M, O|M, O|M, /* 0xDF */
-};
-
-static const u8 twobyte_decode[256] = {
-    /* 0x00 - 0x0F */
-    X, X, X, X, X, X, X, X,
-    X, X, X, X, X, X, X, X,
-    /* 0x10 - 0x1F */
-    X, X, X, X, X, X, X, X,
-    O|M, X, X, X, X, X, X, X,
-    /* 0x20 - 0x2F */
-    X, X, X, X, X, X, X, X,
-    X, X, X, X, X, X, X, X,
-    /* 0x30 - 0x3F */
-    X, X, X, X, X, X, X, X,
-    X, X, X, X, X, X, X, X,
-    /* 0x40 - 0x4F */
-    O|M, O|M, O|M, O|M, O|M, O|M, O|M, O|M,
-    O|M, O|M, O|M, O|M, O|M, O|M, O|M, O|M,
-    /* 0x50 - 0x5F */
-    X, X, X, X, X, X, X, X,
-    X, X, X, X, X, X, X, X,
-    /* 0x60 - 0x6F */
-    X, X, X, X, X, X, X, X,
-    X, X, X, X, X, X, X, X,
-    /* 0x70 - 0x7F */
-    X, X, X, X, X, X, X, X,
-    X, X, X, X, X, X, X, X,
-    /* 0x80 - 0x8F */
-    X, X, X, X, X, X, X, X,
-    X, X, X, X, X, X, X, X,
-    /* 0x90 - 0x9F */
-    O|M, O|M, O|M, O|M, O|M, O|M, O|M, O|M,
-    O|M, O|M, O|M, O|M, O|M, O|M, O|M, O|M,
-    /* 0xA0 - 0xAF */
-    X, X, X, O|M, O|M|1, O|M, O|M, X,
-    X, X, X, O|M, O|M|1, O|M, X, O|M,
-    /* 0xB0 - 0xBF */
-    X, X, X, O|M, X, X, O|M, O|M,
-    X, X, O|M|1, O|M, O|M, O|M, O|M, O|M,
-    /* 0xC0 - 0xCF */
-    O|M, O|M, X, O|M, X, X, X, O|M,
-    X, X, X, X, X, X, X, X,
-    /* 0xD0 - 0xDF */
-    X, X, X, X, X, X, X, X,
-    X, X, X, X, X, X, X, X,
-    /* 0xE0 - 0xEF */
-    X, X, X, X, X, X, X, X,
-    X, X, X, X, X, X, X, X,
-    /* 0xF0 - 0xFF */
-    X, X, X, X, X, X, X, X,
-    X, X, X, X, X, X, X, X
-};
-
-/*
- * Obtain the base and limit associated with the given segment selector.
- * The selector must identify a 32-bit code or data segment. Any segment that
- * appears to be truncated to not overlap with Xen is assumed to be a truncated
- * 4GB segment, and the returned limit reflects this.
- *  @seg   (IN) : Segment selector to decode.
- *  @base  (OUT): Decoded linear base address.
- *  @limit (OUT): Decoded segment limit, in bytes. 0 == unlimited (4GB).
- */
-static int get_baselimit(u16 seg, unsigned long *base, unsigned long *limit)
-{
-    struct vcpu *curr = current;
-    uint32_t    *table, a, b;
-    int          ldt = !!(seg & 4);
-    int          idx = (seg >> 3) & 8191;
-
-    /* Get base and check limit. */
-    if ( ldt )
-    {
-        table = (uint32_t *)LDT_VIRT_START(curr);
-        if ( idx >= curr->arch.pv_vcpu.ldt_ents )
-            goto fail;
-    }
-    else /* gdt */
-    {
-        table = (uint32_t *)GDT_VIRT_START(curr);
-        if ( idx >= curr->arch.pv_vcpu.gdt_ents )
-            goto fail;
-    }
-
-    /* Grab the segment descriptor. */
-    if ( __get_user(a, &table[2*idx+0]) ||
-         __get_user(b, &table[2*idx+1]) )
-        goto fail; /* Barking up the wrong tree. Decode needs a page fault.*/
-
-    /* We only parse 32-bit code and data segments. */
-    if ( (b & (_SEGMENT_P|_SEGMENT_S|_SEGMENT_DB)) != 
-         (_SEGMENT_P|_SEGMENT_S|_SEGMENT_DB) )
-        goto fail;
-
-    /* Decode base and limit. */
-    *base  = (b&(0xff<<24)) | ((b&0xff)<<16) | (a>>16);
-    *limit = ((b & 0xf0000) | (a & 0x0ffff)) + 1;
-    if ( (b & _SEGMENT_G) )
-        *limit <<= 12;
-
-    /*
-     * Anything that looks like a truncated segment we assume ought really
-     * to be a 4GB segment. DANGER!
-     */
-    if ( (GUEST_SEGMENT_MAX_ADDR - (*base + *limit)) < PAGE_SIZE )
-        *limit = 0;
-
-    return 1;
-
- fail:
-    return 0;
-}
-
-/* Turn a segment+offset into a linear address. */
-static int linearise_address(u16 seg, unsigned long off, unsigned long *linear)
-{
-    unsigned long base, limit;
-
-    if ( !get_baselimit(seg, &base, &limit) )
-        return 0;
-
-    if ( off > (limit-1) )
-        return 0;
-
-    *linear = base + off;
-
-    return 1;
-}
-
-static int fixup_seg(u16 seg, unsigned long offset)
-{
-    struct vcpu *curr = current;
-    uint32_t    *table, a, b, base, limit;
-    int          ldt = !!(seg & 4);
-    int          idx = (seg >> 3) & 8191;
-
-    /* Get base and check limit. */
-    if ( ldt )
-    {
-        table = (uint32_t *)LDT_VIRT_START(curr);
-        if ( idx >= curr->arch.pv_vcpu.ldt_ents )
-        {
-            dprintk(XENLOG_DEBUG, "Segment %04x out of LDT range (%u)\n",
-                    seg, curr->arch.pv_vcpu.ldt_ents);
-            goto fail;
-        }
-    }
-    else /* gdt */
-    {
-        table = (uint32_t *)GDT_VIRT_START(curr);
-        if ( idx >= curr->arch.pv_vcpu.gdt_ents )
-        {
-            dprintk(XENLOG_DEBUG, "Segment %04x out of GDT range (%u)\n",
-                    seg, curr->arch.pv_vcpu.gdt_ents);
-            goto fail;
-        }
-    }
-
-    /* Grab the segment descriptor. */
-    if ( __get_user(a, &table[2*idx+0]) ||
-         __get_user(b, &table[2*idx+1]) )
-    {
-        dprintk(XENLOG_DEBUG, "Fault while reading segment %04x\n", seg);
-        goto fail; /* Barking up the wrong tree. Decode needs a page fault.*/
-    }
-
-    /* We only parse 32-bit page-granularity non-privileged data segments. */
-    if ( (b & (_SEGMENT_P|_SEGMENT_S|_SEGMENT_DB|
-               _SEGMENT_G|_SEGMENT_CODE|_SEGMENT_DPL)) != 
-         (_SEGMENT_P|_SEGMENT_S|_SEGMENT_DB|_SEGMENT_G|_SEGMENT_DPL) )
-    {
-        dprintk(XENLOG_DEBUG, "Bad segment %08x:%08x\n", a, b);
-        goto fail;
-    }
-
-    /* Decode base and limit. */
-    base  = (b&(0xff<<24)) | ((b&0xff)<<16) | (a>>16);
-    limit = (((b & 0xf0000) | (a & 0x0ffff)) + 1) << 12;
-
-    if ( b & _SEGMENT_EC )
-    {
-        /* Expands-down: All the way to zero? Assume 4GB if so. */
-        if ( ((base + limit) < PAGE_SIZE) && (offset <= limit)  )
-        {
-            /* Flip to expands-up. */
-            limit = GUEST_SEGMENT_MAX_ADDR - base;
-            goto flip;
-        }
-    }
-    else
-    {
-        /* Expands-up: All the way to Xen space? Assume 4GB if so. */
-        if ( ((GUEST_SEGMENT_MAX_ADDR - (base + limit)) < PAGE_SIZE) &&
-             (offset > limit) )
-        {
-            /* Flip to expands-down. */
-            limit = -(base & PAGE_MASK);
-            goto flip;
-        }
-    }
-
-    dprintk(XENLOG_DEBUG, "None of the above! (%08x:%08x, %08x, %08x, %08x)\n",
-            a, b, base, limit, base+limit);
-
- fail:
-    return 0;
-
- flip:
-    limit = (limit >> 12) - 1;
-    a &= ~0x0ffff; a |= limit & 0x0ffff;
-    b &= ~0xf0000; b |= limit & 0xf0000;
-    b ^= _SEGMENT_EC; /* grows-up <-> grows-down */
-    /* NB. This can't fault. Checked readable above; must also be writable. */
-    write_atomic((uint64_t *)&table[2*idx], ((uint64_t)b<<32) | a);
-    return 1;
-}
-
-/*
- * Called from the general-protection fault handler to attempt to decode
- * and emulate an instruction that depends on 4GB segments.
- */
-int gpf_emulate_4gb(struct cpu_user_regs *regs)
-{
-    struct vcpu   *curr = current;
-    u8             modrm, mod, rm, decode;
-    const u32     *base, *index = NULL;
-    unsigned long  offset;
-    s8             disp8;
-    s32            disp32 = 0;
-    u8            *eip;         /* ptr to instruction start */
-    u8            *pb, b;       /* ptr into instr. / current instr. byte */
-    int            gs_override = 0, scale = 0, opcode = -1;
-    const u8      *table = insn_decode;
-
-    /* WARNING: We only work for ring-3 segments. */
-    if ( unlikely(vm86_mode(regs)) || unlikely(!ring_3(regs)) )
-        goto fail;
-
-    if ( !linearise_address((u16)regs->cs, regs->eip, (unsigned long *)&eip) )
-    {
-        dprintk(XENLOG_DEBUG, "Cannot linearise %04x:%08x\n",
-                regs->cs, regs->eip);
-        goto fail;
-    }
-
-    /* Parse prefix bytes. We're basically looking for segment override. */
-    for ( pb = eip; ; pb++ )
-    {
-        if ( get_user(b, pb) )
-        {
-            dprintk(XENLOG_DEBUG,
-                    "Fault while accessing byte %ld of instruction\n",
-                    (long)(pb-eip));
-            goto page_fault;
-        }
-
-        if ( (pb - eip) >= 15 )
-        {
-            dprintk(XENLOG_DEBUG, "Too many instruction prefixes for a "
-                    "legal instruction\n");
-            goto fail;
-        }
-
-        if ( opcode != -1 )
-        {
-            opcode = (opcode << 8) | b;
-            break;
-        }
-
-        switch ( b )
-        {
-        case 0x67: /* Address-size override */
-        case 0x2e: /* CS override */
-        case 0x3e: /* DS override */
-        case 0x26: /* ES override */
-        case 0x64: /* FS override */
-        case 0x36: /* SS override */
-            dprintk(XENLOG_DEBUG, "Unhandled prefix %02x\n", b);
-            goto fail;
-        case 0x66: /* Operand-size override */
-        case 0xf0: /* LOCK */
-        case 0xf2: /* REPNE/REPNZ */
-        case 0xf3: /* REP/REPE/REPZ */
-            break;
-        case 0x65: /* GS override */
-            gs_override = 1;
-            break;
-        case 0x0f: /* Not really a prefix byte */
-            table = twobyte_decode;
-            opcode = b;
-            break;
-        case 0xd8: /* Math coprocessor instructions.  */
-        case 0xd9:
-        case 0xda:
-        case 0xdb:
-        case 0xdc:
-        case 0xdd:
-        case 0xde:
-        case 0xdf:
-            /* Float opcodes have a secondary opcode in the modrm byte.  */
-            table = float_decode;
-            if ( get_user(modrm, pb + 1) )
-            {
-                dprintk(XENLOG_DEBUG, "Fault while extracting modrm byte\n");
-                goto page_fault;
-            }
-
-            opcode = (b << 8) | modrm;
-            b = ((b & 7) << 3) + ((modrm >> 3) & 7);
-            goto done_prefix;
-
-        default: /* Not a prefix byte */
-            goto done_prefix;
-        }
-    }
- done_prefix:
-
-    if ( !gs_override )
-    {
-        dprintk(XENLOG_DEBUG, "Only instructions with GS override\n");
-        goto fail;
-    }
-
-    decode = table[b];
-    pb++;
-
-    if ( !(decode & OPCODE_BYTE) )
-    {
-        if (opcode == -1)
-            dprintk(XENLOG_DEBUG, "Unsupported opcode %02x\n", b);
-        else
-            dprintk(XENLOG_DEBUG, "Unsupported opcode %02x %02x\n",
-                    opcode >> 8, opcode & 255);
-        goto fail;
-    }
-
-    if ( !(decode & HAS_MODRM) )
-    {
-        /* Must be a <disp32>, or bail. */
-        if ( (decode & INSN_SUFFIX_BYTES) != 4 )
-            goto fail;
-
-        if ( get_user(offset, (u32 *)pb) )
-        {
-            dprintk(XENLOG_DEBUG, "Fault while extracting <moffs32>.\n");
-            goto page_fault;
-        }
-        pb += 4;
-
-        goto skip_modrm;
-    }
-
-    /*
-     * Mod/RM processing.
-     */
-
-    if ( get_user(modrm, pb) )
-    {
-        dprintk(XENLOG_DEBUG, "Fault while extracting modrm byte\n");
-        goto page_fault;
-    }
-
-    pb++;
-
-    mod = (modrm >> 6) & 3;
-    rm  = (modrm >> 0) & 7;
-
-    if ( rm == 4 )
-    {
-        u8 sib;
-
-        if ( get_user(sib, pb) )
-        {
-            dprintk(XENLOG_DEBUG, "Fault while extracting sib byte\n");
-            goto page_fault;
-        }
-
-        pb++;
-
-        rm = sib & 7;
-        if ( (sib & 0x38) != 0x20 )
-            index = decode_register((sib >> 3) & 7, regs, 0);
-        scale = sib >> 6;
-    }
-
-    /* Decode R/M field. */
-    base = decode_register(rm, regs, 0);
-
-    /* Decode Mod field. */
-    switch ( mod )
-    {
-    case 0:
-        if ( rm == 5 ) /* disp32 rather than (EBP) */
-        {
-            base = NULL;
-            if ( get_user(disp32, (u32 *)pb) )
-            {
-                dprintk(XENLOG_DEBUG, "Fault while extracting <base32>.\n");
-                goto page_fault;
-            }
-            pb += 4;
-        }
-        break;
-
-    case 1:
-        if ( get_user(disp8, pb) )
-        {
-            dprintk(XENLOG_DEBUG, "Fault while extracting <disp8>.\n");
-            goto page_fault;
-        }
-        pb++;
-        disp32 = disp8;
-        break;
-
-    case 2:
-        if ( get_user(disp32, (u32 *)pb) )
-        {
-            dprintk(XENLOG_DEBUG, "Fault while extracting <disp32>.\n");
-            goto page_fault;
-        }
-        pb += 4;
-        break;
-
-    case 3:
-        dprintk(XENLOG_DEBUG, "Not a memory operand!\n");
-        goto fail;
-    }
-
-    offset = disp32;
-    if ( base != NULL )
-        offset += *base;
-    if ( index != NULL )
-        offset += *index << scale;
-
- skip_modrm:
-    if ( !fixup_seg((u16)regs->gs, offset) )
-        goto fail;
-
-    /* Success! */
-    perfc_incr(seg_fixups);
-
-    /* If requested, give a callback on otherwise unused vector 15. */
-    if ( VM_ASSIST(curr->domain, VMASST_TYPE_4gb_segments_notify) )
-    {
-        struct trap_info   *ti  = &curr->arch.pv_vcpu.trap_ctxt[15];
-        struct trap_bounce *tb  = &curr->arch.pv_vcpu.trap_bounce;
-
-        tb->flags      = TBF_EXCEPTION | TBF_EXCEPTION_ERRCODE;
-        tb->error_code = pb - eip;
-        tb->cs         = ti->cs;
-        tb->eip        = ti->address;
-        if ( TI_GET_IF(ti) )
-            tb->flags |= TBF_INTERRUPT;
-    }
-
-    return EXCRET_fault_fixed;
-
- fail:
-    return 0;
-
- page_fault:
-    propagate_page_fault((unsigned long)pb, 0); /* read fault */
-    return EXCRET_fault_fixed;
-}
-
-/*
- * Local variables:
- * mode: C
- * c-set-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/x86_32/supervisor_mode_kernel.S
--- a/xen/arch/x86/x86_32/supervisor_mode_kernel.S	Wed Sep 12 13:24:28 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,145 +0,0 @@
-/*
- * Handle stack fixup for guest running in RING 0.
- *
- * Copyright (c) 2006 Ian Campbell
- *
- * When a guest kernel is allowed to run in RING 0 a hypercall,
- * interrupt or exception interrupting the guest kernel will not cause
- * a privilege level change and therefore the stack will not be swapped
- * to the Xen stack.
- *
- * To fix this we look for RING 0 activation frames with a stack
- * pointer below HYPERVISOR_VIRT_START (indicating a guest kernel
- * frame) and fix this up by locating the Xen stack via the TSS
- * and moving the activation frame to the Xen stack. In the process we
- * convert the frame into an inter-privilege frame returning to RING 1
- * so that we can catch and reverse the process on exit.
- */
-
-#include <xen/config.h>
-#include <asm/asm_defns.h>
-#include <public/xen.h>
-
-#define guestreg(field) ((field)-UREGS_eip+36)
-
-        # Upon entry the stack should be the Xen stack and contain:
-        #   %ss, %esp, EFLAGS, %cs|1, %eip, RETURN
-        # On exit the stack should be %ss:%esp (i.e. the guest stack)
-        # and contain:
-        #   EFLAGS, %cs, %eip, RETURN
-        ALIGN
-ENTRY(restore_ring0_guest)
-        pusha
-
-        # Point %gs:%esi to guest stack.
-RRG0:   movw guestreg(UREGS_ss)(%esp),%gs
-        movl guestreg(UREGS_esp)(%esp),%esi
-
-        # Copy EFLAGS, %cs, %eip, RETURN, PUSHA from Xen stack to guest stack.
-        movl $12,%ecx /* 12 32-bit values */
-
-1:      subl $4,%esi
-        movl -4(%esp,%ecx,4),%eax
-RRG1:   movl %eax,%gs:(%esi)
-        loop 1b
-
-RRG2:   andl $~3,%gs:guestreg(UREGS_cs)(%esi)
-
-        movl %gs,%eax
-
-        # We need to do this because these registers are not present
-        # on the guest stack so they cannot be restored by the code in
-        # restore_all_guest.
-RRG3:   mov  guestreg(UREGS_ds)(%esp),%ds
-RRG4:   mov  guestreg(UREGS_es)(%esp),%es
-RRG5:   mov  guestreg(UREGS_fs)(%esp),%fs
-RRG6:   mov  guestreg(UREGS_gs)(%esp),%gs
-
-RRG7:   movl %eax,%ss
-        movl %esi,%esp
-
-        popa
-        ret
-.section __ex_table,"a"
-        .long RRG0,domain_crash_synchronous
-        .long RRG1,domain_crash_synchronous
-        .long RRG2,domain_crash_synchronous
-        .long RRG3,domain_crash_synchronous
-        .long RRG4,domain_crash_synchronous
-        .long RRG5,domain_crash_synchronous
-        .long RRG6,domain_crash_synchronous
-        .long RRG7,domain_crash_synchronous
-.previous
-
-        # Upon entry the stack should be a guest stack and contain:
-        #   EFLAGS, %cs, %eip, ERROR, RETURN
-        # On exit the stack should be the Xen stack and contain:
-        #   %ss, %esp, EFLAGS, %cs|1, %eip, ERROR, RETURN
-        ALIGN
-ENTRY(fixup_ring0_guest_stack)
-        pushl %eax
-        pushl %ecx
-        pushl %ds
-        pushl %gs
-        pushl %esi
-
-        movw  $__HYPERVISOR_DS,%ax
-        movw  %ax,%ds
-
-        # Point %gs:%esi to guest stack frame.
-        movw  %ss,%ax
-        movw  %ax,%gs
-        movl  %esp,%esi
-        # Account for entries on the guest stack:
-        # * Pushed by normal exception/interrupt/hypercall mechanisms
-        #   * EFLAGS, %cs, %eip, ERROR == 4 words.
-        # * Pushed by the fixup routine
-        #   * [RETURN], %eax, %ecx, %ds, %gs and %esi == 6 words.
-        addl $((6+4)*4),%esi
-
-        # %gs:%esi now points to the guest stack before the
-        # interrupt/exception occurred.
-
-        movl  $PER_CPU_GDT_ENTRY*8,%ecx
-        lsll  %ecx,%ecx
-        movl  __per_cpu_offset(,%ecx,4),%ecx
-        addl  $per_cpu__init_tss,%ecx
-
-        # Load Xen stack from TSS.
-        movw  TSS_ss0(%ecx),%ax
-TRP1:   movw  %ax,%ss
-        movl  TSS_esp0(%ecx),%esp
-
-        pushl %gs
-        pushl %esi
-
-        # Move EFLAGS, %cs, %eip, ERROR, RETURN, %eax, %ecx, %ds, %gs, %esi
-        # from guest stack to Xen stack.
-        movl  $10,%ecx
-1:      subl  $4,%esp
-        subl  $4,%esi
-TRP2:   movl  %gs:(%esi),%eax
-        movl  %eax,(%esp)
-        loop  1b
-
-        # CS = CS|1 to simulate RING1 stack frame.
-        orl   $1,32(%esp)
-
-        popl  %esi
-        popl  %gs
-        popl  %ds
-        popl  %ecx
-        popl  %eax
-        ret
-.section __ex_table,"a"
-        .long TRP1,domain_crash_synchronous
-        .long TRP2,domain_crash_synchronous
-.previous
-
-domain_crash_synchronous_string:
-        .asciz "domain_crash_sync called from supervisor_mode_kernel.S (%lx)\n"
-
-domain_crash_synchronous:
-        pushl $domain_crash_synchronous_string
-        call  printk
-        jmp   __domain_crash_synchronous
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/x86_32/traps.c
--- a/xen/arch/x86/x86_32/traps.c	Wed Sep 12 13:24:28 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,637 +0,0 @@
-
-#include <xen/config.h>
-#include <xen/version.h>
-#include <xen/domain_page.h>
-#include <xen/init.h>
-#include <xen/sched.h>
-#include <xen/lib.h>
-#include <xen/console.h>
-#include <xen/mm.h>
-#include <xen/irq.h>
-#include <xen/symbols.h>
-#include <xen/shutdown.h>
-#include <xen/nmi.h>
-#include <xen/cpu.h>
-#include <xen/guest_access.h>
-#include <asm/current.h>
-#include <asm/flushtlb.h>
-#include <asm/traps.h>
-#include <asm/hvm/hvm.h>
-#include <asm/hvm/support.h>
-
-#include <public/callback.h>
-
-static void print_xen_info(void)
-{
-    char taint_str[TAINT_STRING_MAX_LEN];
-    char debug = 'n', *arch = "x86_32p";
-
-#ifndef NDEBUG
-    debug = 'y';
-#endif
-
-    printk("----[ Xen-%d.%d%s  %s  debug=%c  %s ]----\n",
-           xen_major_version(), xen_minor_version(), xen_extra_version(),
-           arch, debug, print_tainted(taint_str));
-}
-
-enum context { CTXT_hypervisor, CTXT_pv_guest, CTXT_hvm_guest };
-
-static void _show_registers(
-    const struct cpu_user_regs *regs, unsigned long crs[8],
-    enum context context, const struct vcpu *v)
-{
-    const static char *context_names[] = {
-        [CTXT_hypervisor] = "hypervisor",
-        [CTXT_pv_guest]   = "pv guest",
-        [CTXT_hvm_guest]  = "hvm guest"
-    };
-
-    printk("EIP:    %04x:[<%08x>]", regs->cs, regs->eip);
-    if ( context == CTXT_hypervisor )
-        print_symbol(" %s", regs->eip);
-    printk("\nEFLAGS: %08x   ", regs->eflags);
-    if ( (context == CTXT_pv_guest) && v && v->vcpu_info )
-        printk("EM: %d   ", !!v->vcpu_info->evtchn_upcall_mask);
-    printk("CONTEXT: %s\n", context_names[context]);
-
-    printk("eax: %08x   ebx: %08x   ecx: %08x   edx: %08x\n",
-           regs->eax, regs->ebx, regs->ecx, regs->edx);
-    printk("esi: %08x   edi: %08x   ebp: %08x   esp: %08x\n",
-           regs->esi, regs->edi, regs->ebp, regs->esp);
-    printk("cr0: %08lx   cr4: %08lx   cr3: %08lx   cr2: %08lx\n",
-           crs[0], crs[4], crs[3], crs[2]);
-    printk("ds: %04x   es: %04x   fs: %04x   gs: %04x   "
-           "ss: %04x   cs: %04x\n",
-           regs->ds, regs->es, regs->fs,
-           regs->gs, regs->ss, regs->cs);
-}
-
-void show_registers(struct cpu_user_regs *regs)
-{
-    struct cpu_user_regs fault_regs = *regs;
-    unsigned long fault_crs[8];
-    enum context context;
-    struct vcpu *v = current;
-
-    if ( is_hvm_vcpu(v) && guest_mode(regs) )
-    {
-        struct segment_register sreg;
-        context = CTXT_hvm_guest;
-        fault_crs[0] = v->arch.hvm_vcpu.guest_cr[0];
-        fault_crs[2] = v->arch.hvm_vcpu.guest_cr[2];
-        fault_crs[3] = v->arch.hvm_vcpu.guest_cr[3];
-        fault_crs[4] = v->arch.hvm_vcpu.guest_cr[4];
-        hvm_get_segment_register(v, x86_seg_cs, &sreg);
-        fault_regs.cs = sreg.sel;
-        hvm_get_segment_register(v, x86_seg_ds, &sreg);
-        fault_regs.ds = sreg.sel;
-        hvm_get_segment_register(v, x86_seg_es, &sreg);
-        fault_regs.es = sreg.sel;
-        hvm_get_segment_register(v, x86_seg_fs, &sreg);
-        fault_regs.fs = sreg.sel;
-        hvm_get_segment_register(v, x86_seg_gs, &sreg);
-        fault_regs.gs = sreg.sel;
-        hvm_get_segment_register(v, x86_seg_ss, &sreg);
-        fault_regs.ss = sreg.sel;
-    }
-    else
-    {
-        if ( !guest_mode(regs) )
-        {
-            context = CTXT_hypervisor;
-            fault_regs.esp = (unsigned long)&regs->esp;
-            fault_regs.ss = read_segment_register(ss);
-            fault_regs.ds = read_segment_register(ds);
-            fault_regs.es = read_segment_register(es);
-            fault_regs.fs = read_segment_register(fs);
-            fault_regs.gs = read_segment_register(gs);
-            fault_crs[2] = read_cr2();
-        }
-        else
-        {
-            context = CTXT_pv_guest;
-            fault_crs[2] = v->vcpu_info->arch.cr2;
-        }
-
-        fault_crs[0] = read_cr0();
-        fault_crs[3] = read_cr3();
-        fault_crs[4] = read_cr4();
-    }
-
-    print_xen_info();
-    printk("CPU:    %d\n", smp_processor_id());
-    _show_registers(&fault_regs, fault_crs, context, v);
-
-    if ( this_cpu(ler_msr) && !guest_mode(regs) )
-    {
-        u32 from, to, hi;
-        rdmsr(this_cpu(ler_msr), from, hi);
-        rdmsr(this_cpu(ler_msr) + 1, to, hi);
-        printk("ler: %08x -> %08x\n", from, to);
-    }
-}
-
-void vcpu_show_registers(const struct vcpu *v)
-{
-    unsigned long crs[8];
-
-    /* No need to handle HVM for now. */
-    if ( is_hvm_vcpu(v) )
-        return;
-
-    crs[0] = v->arch.pv_vcpu.ctrlreg[0];
-    crs[2] = v->vcpu_info->arch.cr2;
-    crs[3] = pagetable_get_paddr(v->arch.guest_table);
-    crs[4] = v->arch.pv_vcpu.ctrlreg[4];
-
-    _show_registers(&v->arch.user_regs, crs, CTXT_pv_guest, v);
-}
-
-void show_page_walk(unsigned long addr)
-{
-    unsigned long pfn, mfn, cr3 = read_cr3();
-    l3_pgentry_t l3e, *l3t;
-    l2_pgentry_t l2e, *l2t;
-    l1_pgentry_t l1e, *l1t;
-
-    printk("Pagetable walk from %08lx:\n", addr);
-
-    mfn = cr3 >> PAGE_SHIFT;
-
-    l3t  = map_domain_page(mfn);
-    l3t += (cr3 & 0xFE0UL) >> 3;
-    l3e = l3t[l3_table_offset(addr)];
-    mfn = l3e_get_pfn(l3e);
-    pfn = mfn_valid(mfn) && machine_to_phys_mapping_valid ?
-          get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
-    printk(" L3[0x%03lx] = %"PRIpte" %08lx\n",
-           l3_table_offset(addr), l3e_get_intpte(l3e), pfn);
-    unmap_domain_page(l3t);
-    if ( !(l3e_get_flags(l3e) & _PAGE_PRESENT) ||
-         !mfn_valid(mfn) )
-        return;
-
-    l2t = map_domain_page(mfn);
-    l2e = l2t[l2_table_offset(addr)];
-    mfn = l2e_get_pfn(l2e);
-    pfn = mfn_valid(mfn) && machine_to_phys_mapping_valid ?
-          get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
-    printk(" L2[0x%03lx] = %"PRIpte" %08lx %s\n",
-           l2_table_offset(addr), l2e_get_intpte(l2e), pfn,
-           (l2e_get_flags(l2e) & _PAGE_PSE) ? "(PSE)" : "");
-    unmap_domain_page(l2t);
-    if ( !(l2e_get_flags(l2e) & _PAGE_PRESENT) ||
-         (l2e_get_flags(l2e) & _PAGE_PSE) ||
-         !mfn_valid(mfn) )
-        return;
-
-    l1t = map_domain_page(mfn);
-    l1e = l1t[l1_table_offset(addr)];
-    mfn = l1e_get_pfn(l1e);
-    pfn = mfn_valid(mfn) && machine_to_phys_mapping_valid ?
-          get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
-    printk(" L1[0x%03lx] = %"PRIpte" %08lx\n",
-           l1_table_offset(addr), l1e_get_intpte(l1e), pfn);
-    unmap_domain_page(l1t);
-}
-
-static DEFINE_PER_CPU_READ_MOSTLY(struct tss_struct *, doublefault_tss);
-static unsigned char __attribute__ ((__section__ (".bss.page_aligned")))
-    boot_cpu_doublefault_space[PAGE_SIZE];
-
-static int cpu_doublefault_tss_callback(
-    struct notifier_block *nfb, unsigned long action, void *hcpu)
-{
-    unsigned int cpu = (unsigned long)hcpu;
-    void *p;
-    int rc = 0;
-
-    switch ( action )
-    {
-    case CPU_UP_PREPARE:
-        per_cpu(doublefault_tss, cpu) = p = alloc_xenheap_page();
-        if ( p == NULL )
-            rc = -ENOMEM;
-        else
-            memset(p, 0, PAGE_SIZE);
-        break;
-    case CPU_UP_CANCELED:
-    case CPU_DEAD:
-        free_xenheap_page(per_cpu(doublefault_tss, cpu));
-        break;
-    default:
-        break;
-    }
-
-    return !rc ? NOTIFY_DONE : notifier_from_errno(rc);
-}
-
-static struct notifier_block cpu_doublefault_tss_nfb = {
-    .notifier_call = cpu_doublefault_tss_callback
-};
-
-void do_double_fault(void)
-{
-    struct tss_struct *tss;
-    unsigned int cpu;
-
-    watchdog_disable();
-
-    console_force_unlock();
-
-    asm ( "lsll %1, %0" : "=r" (cpu) : "rm" (PER_CPU_GDT_ENTRY << 3) );
-
-    /* Find information saved during fault and dump it to the console. */
-    tss = &per_cpu(init_tss, cpu);
-    printk("*** DOUBLE FAULT ***\n");
-    print_xen_info();
-    printk("CPU:    %d\nEIP:    %04x:[<%08x>]",
-           cpu, tss->cs, tss->eip);
-    print_symbol(" %s\n", tss->eip);
-    printk("EFLAGS: %08x\n", tss->eflags);
-    printk("CR3:    %08x\n", tss->__cr3);
-    printk("eax: %08x   ebx: %08x   ecx: %08x   edx: %08x\n",
-           tss->eax, tss->ebx, tss->ecx, tss->edx);
-    printk("esi: %08x   edi: %08x   ebp: %08x   esp: %08x\n",
-           tss->esi, tss->edi, tss->ebp, tss->esp);
-    printk("ds: %04x   es: %04x   fs: %04x   gs: %04x   ss: %04x\n",
-           tss->ds, tss->es, tss->fs, tss->gs, tss->ss);
-    show_stack_overflow(cpu, tss->esp);
-
-    panic("DOUBLE FAULT -- system shutdown\n");
-}
-
-unsigned long do_iret(void)
-{
-    struct cpu_user_regs *regs = guest_cpu_user_regs();
-    struct vcpu *v = current;
-    u32 eflags;
-
-    /* Check worst-case stack frame for overlap with Xen protected area. */
-    if ( unlikely(!access_ok(regs->esp, 40)) )
-        goto exit_and_crash;
-
-    /* Pop and restore EAX (clobbered by hypercall). */
-    if ( unlikely(__copy_from_user(&regs->eax, (void *)regs->esp, 4)) )
-        goto exit_and_crash;
-    regs->esp += 4;
-
-    /* Pop and restore CS and EIP. */
-    if ( unlikely(__copy_from_user(&regs->eip, (void *)regs->esp, 8)) )
-        goto exit_and_crash;
-    regs->esp += 8;
-
-    /*
-     * Pop, fix up and restore EFLAGS. We fix up in a local staging area
-     * to avoid firing the BUG_ON(IOPL) check in arch_get_info_guest.
-     */
-    if ( unlikely(__copy_from_user(&eflags, (void *)regs->esp, 4)) )
-        goto exit_and_crash;
-    regs->esp += 4;
-    regs->eflags = (eflags & ~X86_EFLAGS_IOPL) | X86_EFLAGS_IF;
-
-    if ( vm86_mode(regs) )
-    {
-        /* Return to VM86 mode: pop and restore ESP,SS,ES,DS,FS and GS. */
-        if ( __copy_from_user(&regs->esp, (void *)regs->esp, 24) )
-            goto exit_and_crash;
-    }
-    else if ( unlikely(ring_0(regs)) )
-    {
-        goto exit_and_crash;
-    }
-    else if ( !ring_1(regs) )
-    {
-        /* Return to ring 2/3: pop and restore ESP and SS. */
-        if ( __copy_from_user(&regs->esp, (void *)regs->esp, 8) )
-            goto exit_and_crash;
-    }
-
-    /* Restore upcall mask from supplied EFLAGS.IF. */
-    vcpu_info(v, evtchn_upcall_mask) = !(eflags & X86_EFLAGS_IF);
-
-    async_exception_cleanup(v);
-
-    /*
-     * The hypercall exit path will overwrite EAX with this return
-     * value.
-     */
-    return regs->eax;
-
- exit_and_crash:
-    gdprintk(XENLOG_ERR, "Fatal error\n");
-    domain_crash(v->domain);
-    return 0;
-}
-
-static void set_task_gate(unsigned int n, unsigned int sel)
-{
-    idt_table[n].b = 0;
-    wmb(); /* disable gate /then/ rewrite */
-    idt_table[n].a = sel << 16;
-    wmb(); /* rewrite /then/ enable gate */
-    idt_table[n].b = 0x8500;
-}
-
-void __devinit subarch_percpu_traps_init(void)
-{
-    struct tss_struct *tss;
-    int cpu = smp_processor_id();
-
-    if ( cpu == 0 )
-    {
-        /* The hypercall entry vector is only accessible from ring 1. */
-        _set_gate(idt_table+HYPERCALL_VECTOR, 14, 1, &hypercall);
-
-        this_cpu(doublefault_tss) = (void *)boot_cpu_doublefault_space;
-
-        register_cpu_notifier(&cpu_doublefault_tss_nfb);
-    }
-
-    tss = this_cpu(doublefault_tss);
-    BUG_ON(tss == NULL);
-
-    /*
-     * Make a separate task for double faults. This will get us debug output if
-     * we blow the kernel stack.
-     */
-    tss->ds     = __HYPERVISOR_DS;
-    tss->es     = __HYPERVISOR_DS;
-    tss->ss     = __HYPERVISOR_DS;
-    tss->esp    = (unsigned long)tss + PAGE_SIZE;
-    tss->__cr3  = __pa(idle_pg_table);
-    tss->cs     = __HYPERVISOR_CS;
-    tss->eip    = (unsigned long)do_double_fault;
-    tss->eflags = 2;
-    tss->bitmap = IOBMP_INVALID_OFFSET;
-    _set_tssldt_desc(
-        this_cpu(gdt_table) + DOUBLEFAULT_TSS_ENTRY - FIRST_RESERVED_GDT_ENTRY,
-        (unsigned long)tss, 235, 9);
-
-    set_task_gate(TRAP_double_fault, DOUBLEFAULT_TSS_ENTRY << 3);
-}
-
-void init_int80_direct_trap(struct vcpu *v)
-{
-    struct trap_info *ti = &v->arch.pv_vcpu.trap_ctxt[0x80];
-
-    /*
-     * We can't virtualise interrupt gates, as there's no way to get
-     * the CPU to automatically clear the events_mask variable. Also we
-     * must ensure that the CS is safe to poke into an interrupt gate.
-     *
-     * When running with supervisor_mode_kernel enabled a direct trap
-     * to the guest OS cannot be used because the INT instruction will
-     * switch to the Xen stack and we need to swap back to the guest
-     * kernel stack before passing control to the system call entry point.
-     */
-    if ( TI_GET_IF(ti) || !guest_gate_selector_okay(v->domain, ti->cs) ||
-         supervisor_mode_kernel )
-    {
-        v->arch.pv_vcpu.int80_desc.a = v->arch.pv_vcpu.int80_desc.b = 0;
-        return;
-    }
-
-    v->arch.pv_vcpu.int80_desc.a = (ti->cs << 16) | (ti->address & 0xffff);
-    v->arch.pv_vcpu.int80_desc.b =
-        (ti->address & 0xffff0000) | 0x8f00 | ((TI_GET_DPL(ti) & 3) << 13);
-
-    if ( v == current )
-        set_int80_direct_trap(v);
-}
-
-#ifdef CONFIG_X86_SUPERVISOR_MODE_KERNEL
-static void do_update_sysenter(void *info)
-{
-    xen_callback_t *address = info;
-
-    wrmsr(MSR_IA32_SYSENTER_CS, address->cs, 0);
-    wrmsr(MSR_IA32_SYSENTER_EIP, address->eip, 0);
-}
-#endif
-
-static long register_guest_callback(struct callback_register *reg)
-{
-    long ret = 0;
-    struct vcpu *v = current;
-
-    fixup_guest_code_selector(v->domain, reg->address.cs);
-
-    switch ( reg->type )
-    {
-    case CALLBACKTYPE_event:
-        v->arch.pv_vcpu.event_callback_cs     = reg->address.cs;
-        v->arch.pv_vcpu.event_callback_eip    = reg->address.eip;
-        break;
-
-    case CALLBACKTYPE_failsafe:
-        v->arch.pv_vcpu.failsafe_callback_cs  = reg->address.cs;
-        v->arch.pv_vcpu.failsafe_callback_eip = reg->address.eip;
-        if ( reg->flags & CALLBACKF_mask_events )
-            set_bit(_VGCF_failsafe_disables_events,
-                    &v->arch.vgc_flags);
-        else
-            clear_bit(_VGCF_failsafe_disables_events,
-                      &v->arch.vgc_flags);
-        break;
-
-#ifdef CONFIG_X86_SUPERVISOR_MODE_KERNEL
-    case CALLBACKTYPE_sysenter_deprecated:
-        if ( !cpu_has_sep )
-            ret = -EINVAL;
-        else
-            on_each_cpu(do_update_sysenter, &reg->address, 1);
-        break;
-
-    case CALLBACKTYPE_sysenter:
-        if ( !cpu_has_sep )
-            ret = -EINVAL;
-        else
-            do_update_sysenter(&reg->address);
-        break;
-#endif
-
-    case CALLBACKTYPE_nmi:
-        ret = register_guest_nmi_callback(reg->address.eip);
-        break;
-
-    default:
-        ret = -ENOSYS;
-        break;
-    }
-
-    return ret;
-}
-
-static long unregister_guest_callback(struct callback_unregister *unreg)
-{
-    long ret;
-
-    switch ( unreg->type )
-    {
-    case CALLBACKTYPE_event:
-    case CALLBACKTYPE_failsafe:
-#ifdef CONFIG_X86_SUPERVISOR_MODE_KERNEL
-    case CALLBACKTYPE_sysenter_deprecated:
-    case CALLBACKTYPE_sysenter:
-#endif
-        ret = -EINVAL;
-        break;
-
-    case CALLBACKTYPE_nmi:
-        ret = unregister_guest_nmi_callback();
-        break;
-
-    default:
-        ret = -ENOSYS;
-        break;
-    }
-
-    return ret;
-}
-
-
-long do_callback_op(int cmd, XEN_GUEST_HANDLE(const_void) arg)
-{
-    long ret;
-
-    switch ( cmd )
-    {
-    case CALLBACKOP_register:
-    {
-        struct callback_register reg;
-
-        ret = -EFAULT;
-        if ( copy_from_guest(&reg, arg, 1) )
-            break;
-
-        ret = register_guest_callback(&reg);
-    }
-    break;
-
-    case CALLBACKOP_unregister:
-    {
-        struct callback_unregister unreg;
-
-        ret = -EFAULT;
-        if ( copy_from_guest(&unreg, arg, 1) )
-            break;
-
-        ret = unregister_guest_callback(&unreg);
-    }
-    break;
-
-    default:
-        ret = -ENOSYS;
-        break;
-    }
-
-    return ret;
-}
-
-long do_set_callbacks(unsigned long event_selector,
-                      unsigned long event_address,
-                      unsigned long failsafe_selector,
-                      unsigned long failsafe_address)
-{
-    struct callback_register event = {
-        .type = CALLBACKTYPE_event,
-        .address = { event_selector, event_address },
-    };
-    struct callback_register failsafe = {
-        .type = CALLBACKTYPE_failsafe,
-        .address = { failsafe_selector, failsafe_address },
-    };
-
-    register_guest_callback(&event);
-    register_guest_callback(&failsafe);
-
-    return 0;
-}
-
-static void hypercall_page_initialise_ring0_kernel(void *hypercall_page)
-{
-    char *p;
-    int i;
-
-    /* Fill in all the transfer points with template machine code. */
-
-    for ( i = 0; i < (PAGE_SIZE / 32); i++ )
-    {
-        p = (char *)(hypercall_page + (i * 32));
-
-        *(u8  *)(p+ 0) = 0x9c;      /* pushf */
-        *(u8  *)(p+ 1) = 0xfa;      /* cli */
-        *(u8  *)(p+ 2) = 0xb8;      /* mov $<i>,%eax */
-        *(u32 *)(p+ 3) = i;
-        *(u8  *)(p+ 7) = 0x9a;      /* lcall $__HYPERVISOR_CS,&hypercall */
-        *(u32 *)(p+ 8) = (u32)&hypercall;
-        *(u16 *)(p+12) = (u16)__HYPERVISOR_CS;
-        *(u8  *)(p+14) = 0xc3;      /* ret */
-    }
-
-    /*
-     * HYPERVISOR_iret is special because it doesn't return and expects a
-     * special stack frame. Guests jump at this transfer point instead of
-     * calling it.
-     */
-    p = (char *)(hypercall_page + (__HYPERVISOR_iret * 32));
-    *(u8  *)(p+ 0) = 0x50;      /* push %eax */
-    *(u8  *)(p+ 1) = 0x9c;      /* pushf */
-    *(u8  *)(p+ 2) = 0xfa;      /* cli */
-    *(u8  *)(p+ 3) = 0xb8;      /* mov $<i>,%eax */
-    *(u32 *)(p+ 4) = __HYPERVISOR_iret;
-    *(u8  *)(p+ 8) = 0x9a;      /* lcall $__HYPERVISOR_CS,&hypercall */
-    *(u32 *)(p+ 9) = (u32)&hypercall;
-    *(u16 *)(p+13) = (u16)__HYPERVISOR_CS;
-}
-
-static void hypercall_page_initialise_ring1_kernel(void *hypercall_page)
-{
-    char *p;
-    int i;
-
-    /* Fill in all the transfer points with template machine code. */
-
-    for ( i = 0; i < (PAGE_SIZE / 32); i++ )
-    {
-        p = (char *)(hypercall_page + (i * 32));
-        *(u8  *)(p+ 0) = 0xb8;    /* mov  $<i>,%eax */
-        *(u32 *)(p+ 1) = i;
-        *(u16 *)(p+ 5) = (HYPERCALL_VECTOR << 8) | 0xcd; /* int  $xx */
-        *(u8  *)(p+ 7) = 0xc3;    /* ret */
-    }
-
-    /*
-     * HYPERVISOR_iret is special because it doesn't return and expects a 
-     * special stack frame. Guests jump at this transfer point instead of 
-     * calling it.
-     */
-    p = (char *)(hypercall_page + (__HYPERVISOR_iret * 32));
-    *(u8  *)(p+ 0) = 0x50;    /* push %eax */
-    *(u8  *)(p+ 1) = 0xb8;    /* mov  $__HYPERVISOR_iret,%eax */
-    *(u32 *)(p+ 2) = __HYPERVISOR_iret;
-    *(u16 *)(p+ 6) = (HYPERCALL_VECTOR << 8) | 0xcd; /* int  $xx */
-}
-
-void hypercall_page_initialise(struct domain *d, void *hypercall_page)
-{
-    memset(hypercall_page, 0xCC, PAGE_SIZE);
-    if ( is_hvm_domain(d) )
-        hvm_hypercall_page_initialise(d, hypercall_page);
-    else if ( supervisor_mode_kernel )
-        hypercall_page_initialise_ring0_kernel(hypercall_page);
-    else
-        hypercall_page_initialise_ring1_kernel(hypercall_page);
-}
-
-/*
- * Local variables:
- * mode: C
- * c-set-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
diff -r 05d82fb18335 -r bc8cb4778702 xen/arch/x86/xen.lds.S
--- a/xen/arch/x86/xen.lds.S	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/arch/x86/xen.lds.S	Wed Sep 12 13:29:30 2012 +0100
@@ -18,11 +18,7 @@ ENTRY(efi_start)
 
 #else /* !EFI */
 
-#ifdef __x86_64__
 #define FORMAT "elf64-x86-64"
-#else
-#define FORMAT "elf32-i386"
-#endif
 
 ENTRY(start)
 
@@ -30,11 +26,7 @@ ENTRY(start)
 
 OUTPUT_FORMAT(FORMAT, FORMAT, FORMAT)
 
-#ifdef __x86_64__
 OUTPUT_ARCH(i386:x86-64)
-#else
-OUTPUT_ARCH(i386)
-#endif
 
 PHDRS
 {
@@ -42,7 +34,7 @@ PHDRS
 }
 SECTIONS
 {
-#if defined(__x86_64__) && !defined(EFI)
+#if !defined(EFI)
   . = __XEN_VIRT_START;
   __image_base__ = .;
 #endif
diff -r 05d82fb18335 -r bc8cb4778702 xen/common/Makefile
--- a/xen/common/Makefile	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/common/Makefile	Wed Sep 12 13:29:30 2012 +0100
@@ -56,7 +56,6 @@ obj-$(CONFIG_XENCOMM) += xencomm.o
 
 subdir-$(CONFIG_COMPAT) += compat
 
-subdir-$(x86_32) += hvm
 subdir-$(x86_64) += hvm
 
 subdir-y += libelf
diff -r 05d82fb18335 -r bc8cb4778702 xen/common/tmem.c
--- a/xen/common/tmem.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/common/tmem.c	Wed Sep 12 13:29:30 2012 +0100
@@ -50,7 +50,7 @@
 #define INVERT_SENTINEL(_x,_y) _x->sentinel = ~_y##_SENTINEL
 #define ASSERT_SENTINEL(_x,_y) \
     ASSERT(_x->sentinel != ~_y##_SENTINEL);ASSERT(_x->sentinel == _y##_SENTINEL)
-#if defined(__i386__) || defined(CONFIG_ARM)
+#if defined(CONFIG_ARM)
 #define POOL_SENTINEL 0x87658765
 #define OBJ_SENTINEL 0x12345678
 #define OBJNODE_SENTINEL 0xfedcba09
@@ -1233,11 +1233,7 @@ static client_t *client_create(cli_id_t 
         goto fail;
     }
     client->cli_id = cli_id;
-#ifdef __i386__
-    client->compress = 0;
-#else
     client->compress = tmh_compression_enabled();
-#endif
     client->shared_auth_required = tmh_shared_auth();
     for ( i = 0; i < MAX_GLOBAL_SHARED_POOLS; i++)
         client->shared_auth_uuid[i][0] =
@@ -1460,9 +1456,6 @@ static NOINLINE int do_tmem_put_compress
     ASSERT_SPINLOCK(&pgp->us.obj->obj_spinlock);
     ASSERT(pgp->us.obj->pool != NULL);
     ASSERT(pgp->us.obj->pool->client != NULL);
-#ifdef __i386__
-    return -ENOMEM;
-#endif
 
     if ( pgp->pfp != NULL )
         pgp_free_data(pgp, pgp->us.obj->pool);
@@ -2275,9 +2268,6 @@ static int tmemc_set_var_one(client_t *c
                         arg1, cli_id_str, cli_id);
         break;
     case TMEMC_SET_COMPRESS:
-#ifdef __i386__
-        return -1;
-#endif
         if ( tmh_dedup_enabled() )
         {
             tmh_client_warn("tmem: compression %s for all %ss, cannot be changed when tmem_dedup is enabled\n",
@@ -2892,9 +2882,6 @@ EXPORT void *tmem_relinquish_pages(unsig
 
     if (!tmh_enabled() || !tmh_freeable_pages())
         return NULL;
-#ifdef __i386__
-    return NULL;
-#endif
 
     relinq_attempts++;
     if ( order > 0 )
diff -r 05d82fb18335 -r bc8cb4778702 xen/common/tmem_xen.c
--- a/xen/common/tmem_xen.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/common/tmem_xen.c	Wed Sep 12 13:29:30 2012 +0100
@@ -348,7 +348,6 @@ EXPORT void tmh_scrub_page(struct page_i
         scrub_one_page(pi);
 }
 
-#ifndef __i386__
 static noinline void *tmh_mempool_page_get(unsigned long size)
 {
     struct page_info *pi;
@@ -398,7 +397,6 @@ static void tmh_persistent_pool_page_put
     ASSERT(IS_VALID_PAGE(pi));
     _tmh_free_page_thispool(pi);
 }
-#endif
 
 /******************  XEN-SPECIFIC CLIENT HANDLING ********************/
 
@@ -413,7 +411,6 @@ EXPORT tmh_client_t *tmh_client_init(cli
     for (i = 0, shift = 12; i < 4; shift -=4, i++)
         name[i] = (((unsigned short)cli_id >> shift) & 0xf) + '0';
     name[4] = '\0';
-#ifndef __i386__
     tmh->persistent_pool = xmem_pool_create(name, tmh_persistent_pool_page_get,
         tmh_persistent_pool_page_put, PAGE_SIZE, 0, PAGE_SIZE);
     if ( tmh->persistent_pool == NULL )
@@ -421,23 +418,18 @@ EXPORT tmh_client_t *tmh_client_init(cli
         xfree(tmh);
         return NULL;
     }
-#endif
     return tmh;
 }
 
 EXPORT void tmh_client_destroy(tmh_client_t *tmh)
 {
     ASSERT(tmh->domain->is_dying);
-#ifndef __i386__
     xmem_pool_destroy(tmh->persistent_pool);
-#endif
     tmh->domain = NULL;
 }
 
 /******************  XEN-SPECIFIC HOST INITIALIZATION ********************/
 
-#ifndef __i386__
-
 static int dstmem_order, workmem_order;
 
 static int cpu_callback(
@@ -517,12 +509,3 @@ EXPORT int __init tmh_init(void)
 
     return 1;
 }
-
-#else
-
-EXPORT int __init tmh_init(void)
-{
-    return 1;
-}
-
-#endif
diff -r 05d82fb18335 -r bc8cb4778702 xen/common/wait.c
--- a/xen/common/wait.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/common/wait.c	Wed Sep 12 13:29:30 2012 +0100
@@ -140,7 +140,6 @@ static void __prepare_to_wait(struct wai
     }
 
     asm volatile (
-#ifdef CONFIG_X86_64
         "push %%rax; push %%rbx; push %%rdx; "
         "push %%rbp; push %%r8; push %%r9; push %%r10; push %%r11; "
         "push %%r12; push %%r13; push %%r14; push %%r15; call 1f; "
@@ -151,15 +150,6 @@ static void __prepare_to_wait(struct wai
         "pop %%r15; pop %%r14; pop %%r13; pop %%r12; "
         "pop %%r11; pop %%r10; pop %%r9; pop %%r8; "
         "pop %%rbp; pop %%rdx; pop %%rbx; pop %%rax"
-#else
-        "push %%eax; push %%ebx; push %%edx; "
-        "push %%ebp; call 1f; "
-        "1: mov %%esp,%%esi; addl $2f-1b,(%%esp); "
-        "sub %%esi,%%ecx; cmp %3,%%ecx; jbe 2f; "
-        "xor %%esi,%%esi; jmp 3f; "
-        "2: rep movsb; mov %%esp,%%esi; 3: pop %%eax; "
-        "pop %%ebp; pop %%edx; pop %%ebx; pop %%eax"
-#endif
         : "=&S" (wqv->esp), "=&c" (dummy), "=&D" (dummy)
         : "i" (PAGE_SIZE), "1" (cpu_info), "2" (wqv->stack)
         : "memory" );
diff -r 05d82fb18335 -r bc8cb4778702 xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/drivers/passthrough/vtd/iommu.c	Wed Sep 12 13:29:30 2012 +0100
@@ -880,11 +880,9 @@ static int iommu_page_fault_do_one(struc
                 seg, (source_id >> 8), PCI_SLOT(source_id & 0xFF),
                 PCI_FUNC(source_id & 0xFF), addr, iommu->reg,
                 fault_reason, reason);
-#ifndef __i386__ /* map_domain_page() cannot be used in this context */
 	if (iommu_debug)
             print_vtd_entries(iommu, (source_id >> 8),
                           (source_id & 0xff), (addr >> PAGE_SHIFT));
-#endif
     }
     else
         INTEL_IOMMU_DEBUG(
diff -r 05d82fb18335 -r bc8cb4778702 xen/include/asm-x86/amd.h
--- a/xen/include/asm-x86/amd.h	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/include/asm-x86/amd.h	Wed Sep 12 13:29:30 2012 +0100
@@ -146,11 +146,9 @@
 struct cpuinfo_x86;
 int cpu_has_amd_erratum(const struct cpuinfo_x86 *, int, ...);
 
-#ifdef __x86_64__
 extern s8 opt_allow_unsafe;
 
 void fam10h_check_enable_mmcfg(void);
 void check_enable_amd_mmconf_dmi(void);
-#endif
 
 #endif /* __AMD_H__ */
diff -r 05d82fb18335 -r bc8cb4778702 xen/include/asm-x86/apicdef.h
--- a/xen/include/asm-x86/apicdef.h	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/include/asm-x86/apicdef.h	Wed Sep 12 13:29:30 2012 +0100
@@ -129,11 +129,7 @@
 /* It's only used in x2APIC mode of an x2APIC unit. */
 #define APIC_MSR_BASE 0x800
 
-#ifdef __i386__
- #define MAX_IO_APICS 64
-#else
- #define MAX_IO_APICS 128
-#endif
+#define MAX_IO_APICS 128
 
 /*
  * the local APIC register structure, memory mapped. Not terribly well
diff -r 05d82fb18335 -r bc8cb4778702 xen/include/asm-x86/asm_defns.h
--- a/xen/include/asm-x86/asm_defns.h	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/include/asm-x86/asm_defns.h	Wed Sep 12 13:29:30 2012 +0100
@@ -12,11 +12,7 @@
 void ret_from_intr(void);
 #endif
 
-#ifdef __x86_64__
 #include <asm/x86_64/asm_defns.h>
-#else
-#include <asm/x86_32/asm_defns.h>
-#endif
 
 /* Exception table entry */
 #ifdef __ASSEMBLY__
diff -r 05d82fb18335 -r bc8cb4778702 xen/include/asm-x86/atomic.h
--- a/xen/include/asm-x86/atomic.h	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/include/asm-x86/atomic.h	Wed Sep 12 13:29:30 2012 +0100
@@ -22,22 +22,8 @@ build_write_atomic(write_u8_atomic, "b",
 build_write_atomic(write_u16_atomic, "w", uint16_t, "r", )
 build_write_atomic(write_u32_atomic, "l", uint32_t, "r", )
 
-#ifdef __x86_64__
 build_read_atomic(read_u64_atomic, "q", uint64_t, "=r", )
 build_write_atomic(write_u64_atomic, "q", uint64_t, "r", )
-#else
-static inline uint64_t read_u64_atomic(const volatile uint64_t *addr)
-{
-    uint64_t *__addr = (uint64_t *)addr;
-    return __cmpxchg8b(__addr, 0, 0);
-}
-static inline void write_u64_atomic(volatile uint64_t *addr, uint64_t val)
-{
-    uint64_t old = *addr, new, *__addr = (uint64_t *)addr;
-    while ( (new = __cmpxchg8b(__addr, old, val)) != old )
-        old = new;
-}
-#endif
 
 #undef build_read_atomic
 #undef build_write_atomic
diff -r 05d82fb18335 -r bc8cb4778702 xen/include/asm-x86/bug.h
--- a/xen/include/asm-x86/bug.h	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/include/asm-x86/bug.h	Wed Sep 12 13:29:30 2012 +0100
@@ -1,11 +1,7 @@
 #ifndef __X86_BUG_H__
 #define __X86_BUG_H__
 
-#ifdef __x86_64__
 #include <asm/x86_64/bug.h>
-#else
-#include <asm/x86_32/bug.h>
-#endif
 
 struct bug_frame {
     unsigned char ud2[2];
diff -r 05d82fb18335 -r bc8cb4778702 xen/include/asm-x86/config.h
--- a/xen/include/asm-x86/config.h	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/include/asm-x86/config.h	Wed Sep 12 13:29:30 2012 +0100
@@ -7,13 +7,8 @@
 #ifndef __X86_CONFIG_H__
 #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 LONG_BYTEORDER 3
+#define CONFIG_PAGING_LEVELS 4
 
 #define BYTES_PER_LONG (1 << LONG_BYTEORDER)
 #define BITS_PER_LONG (BYTES_PER_LONG << 3)
@@ -56,17 +51,10 @@
 
 #ifdef MAX_PHYS_CPUS
 #define NR_CPUS MAX_PHYS_CPUS
-#elif defined __i386__
-#define NR_CPUS 128
 #else
 #define NR_CPUS 256
 #endif
 
-#ifdef __i386__
-/* Maximum number of virtual CPUs in multi-processor guests. */
-#define MAX_VIRT_CPUS XEN_LEGACY_MAX_VCPUS
-#endif
-
 /* Maximum we can support with current vLAPIC ID mapping. */
 #define MAX_HVM_VCPUS 128
 
@@ -94,11 +82,7 @@
 #define MEMORY_GUARD
 #endif
 
-#ifdef __i386__
-#define STACK_ORDER 2
-#else
 #define STACK_ORDER 3
-#endif
 #define STACK_SIZE  (PAGE_SIZE << STACK_ORDER)
 
 /* Primary stack is restricted to 8kB by guard pages. */
@@ -123,8 +107,6 @@ extern unsigned char boot_edid_info[128]
 
 #define asmlinkage
 
-#if defined(__x86_64__)
-
 #define CONFIG_X86_64 1
 #define CONFIG_COMPAT 1
 
@@ -286,86 +268,8 @@ extern unsigned char boot_edid_info[128]
 #define __OS          "q"  /* Operation Suffix */
 #define __OP          "r"  /* Operand Prefix */
 
-#elif defined(__i386__)
-
-#define CONFIG_X86_32      1
-#define CONFIG_DOMAIN_PAGE 1
-
-/*
- * Memory layout (high to low):                          PAE-SIZE
- *                                                       ------
- *  I/O remapping area                                   ( 4MB)
- *  Direct-map (1:1) area [Xen code/data/heap]           (12MB)
- *  Per-domain mappings (inc. 4MB map_domain_page cache) ( 8MB)
- *  Shadow linear pagetable                              ( 8MB)
- *  Guest linear pagetable                               ( 8MB)
- *  Machine-to-physical translation table [writable]     (16MB)
- *  Frame-info table                                     (96MB)
- *   * Start of guest inaccessible area
- *  Machine-to-physical translation table [read-only]    (16MB)
- *   * Start of guest unmodifiable area
- */
-
-#define IOREMAP_MBYTES           4
-#define DIRECTMAP_MBYTES        12
-#define MAPCACHE_MBYTES          4
-#define PERDOMAIN_MBYTES         8
-
-#define LINEARPT_MBYTES          8
-#define MACHPHYS_MBYTES         16 /* 1 MB needed per 1 GB memory */
-#define FRAMETABLE_MBYTES       (MACHPHYS_MBYTES * 6)
-
-#define IOREMAP_VIRT_END	_AC(0,UL)
-#define IOREMAP_VIRT_START	(IOREMAP_VIRT_END - (IOREMAP_MBYTES<<20))
-#define DIRECTMAP_VIRT_END	IOREMAP_VIRT_START
-#define DIRECTMAP_VIRT_START	(DIRECTMAP_VIRT_END - (DIRECTMAP_MBYTES<<20))
-#define MAPCACHE_VIRT_END	DIRECTMAP_VIRT_START
-#define MAPCACHE_VIRT_START	(MAPCACHE_VIRT_END - (MAPCACHE_MBYTES<<20))
-#define PERDOMAIN_VIRT_END	DIRECTMAP_VIRT_START
-#define PERDOMAIN_VIRT_START	(PERDOMAIN_VIRT_END - (PERDOMAIN_MBYTES<<20))
-#define SH_LINEAR_PT_VIRT_END	PERDOMAIN_VIRT_START
-#define SH_LINEAR_PT_VIRT_START	(SH_LINEAR_PT_VIRT_END - (LINEARPT_MBYTES<<20))
-#define LINEAR_PT_VIRT_END	SH_LINEAR_PT_VIRT_START
-#define LINEAR_PT_VIRT_START	(LINEAR_PT_VIRT_END - (LINEARPT_MBYTES<<20))
-#define RDWR_MPT_VIRT_END	LINEAR_PT_VIRT_START
-#define RDWR_MPT_VIRT_START	(RDWR_MPT_VIRT_END - (MACHPHYS_MBYTES<<20))
-#define FRAMETABLE_VIRT_END	RDWR_MPT_VIRT_START
-#define FRAMETABLE_SIZE         (FRAMETABLE_MBYTES<<20)
-#define FRAMETABLE_VIRT_START	(FRAMETABLE_VIRT_END - FRAMETABLE_SIZE)
-#define RO_MPT_VIRT_END		FRAMETABLE_VIRT_START
-#define RO_MPT_VIRT_START	(RO_MPT_VIRT_END - (MACHPHYS_MBYTES<<20))
-
-#define DIRECTMAP_PHYS_END	(DIRECTMAP_MBYTES<<20)
-
-/* Maximum linear address accessible via guest memory segments. */
-#define GUEST_SEGMENT_MAX_ADDR  RO_MPT_VIRT_END
-
-/* Hypervisor owns top 168MB of virtual address space. */
-#define HYPERVISOR_VIRT_START   mk_unsigned_long(0xF5800000)
-
-#define L2_PAGETABLE_FIRST_XEN_SLOT \
-    (HYPERVISOR_VIRT_START >> L2_PAGETABLE_SHIFT)
-#define L2_PAGETABLE_LAST_XEN_SLOT  \
-    (~0UL >> L2_PAGETABLE_SHIFT)
-#define L2_PAGETABLE_XEN_SLOTS \
-    (L2_PAGETABLE_LAST_XEN_SLOT - L2_PAGETABLE_FIRST_XEN_SLOT + 1)
-
-#define PGT_base_page_table     PGT_l3_page_table
-
-#define __HYPERVISOR_CS 0xe008
-#define __HYPERVISOR_DS 0xe010
-
-/* For generic assembly code: use macros to define operation/operand sizes. */
-#define __OS          "l"  /* Operation Suffix */
-#define __OP          "e"  /* Operand Prefix */
-
-#endif /* __i386__ */
-
 #ifndef __ASSEMBLY__
 extern unsigned long xen_phys_start;
-#if defined(__i386__)
-extern unsigned long xenheap_phys_end;
-#endif
 #endif
 
 /* GDT/LDT shadow mapping area. The first per-domain-mapping sub-area. */
@@ -391,11 +295,7 @@ extern unsigned long xenheap_phys_end;
 #define PDPT_L2_ENTRIES       \
     ((PDPT_L1_ENTRIES + (1 << PAGETABLE_ORDER) - 1) >> PAGETABLE_ORDER)
 
-#if defined(__x86_64__)
 #define ELFSIZE 64
-#else
-#define ELFSIZE 32
-#endif
 
 #define ARCH_CRASH_SAVE_VMCOREINFO
 
diff -r 05d82fb18335 -r bc8cb4778702 xen/include/asm-x86/cpufeature.h
--- a/xen/include/asm-x86/cpufeature.h	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/include/asm-x86/cpufeature.h	Wed Sep 12 13:29:30 2012 +0100
@@ -165,33 +165,6 @@
 #define CPUID5_ECX_EXTENSIONS_SUPPORTED 0x1
 #define CPUID5_ECX_INTERRUPT_BREAK      0x2
 
-#ifdef __i386__
-#define cpu_has_vme		boot_cpu_has(X86_FEATURE_VME)
-#define cpu_has_de		boot_cpu_has(X86_FEATURE_DE)
-#define cpu_has_pse		boot_cpu_has(X86_FEATURE_PSE)
-#define cpu_has_tsc		boot_cpu_has(X86_FEATURE_TSC)
-#define cpu_has_pge		boot_cpu_has(X86_FEATURE_PGE)
-#define cpu_has_pat		boot_cpu_has(X86_FEATURE_PAT)
-#define cpu_has_apic		boot_cpu_has(X86_FEATURE_APIC)
-#define cpu_has_sep		boot_cpu_has(X86_FEATURE_SEP)
-#define cpu_has_mtrr		boot_cpu_has(X86_FEATURE_MTRR)
-#define cpu_has_mmx		boot_cpu_has(X86_FEATURE_MMX)
-#define cpu_has_fxsr		boot_cpu_has(X86_FEATURE_FXSR)
-#define cpu_has_xmm		boot_cpu_has(X86_FEATURE_XMM)
-#define cpu_has_xmm2		boot_cpu_has(X86_FEATURE_XMM2)
-#define cpu_has_xmm3		boot_cpu_has(X86_FEATURE_XMM3)
-#define cpu_has_ht		boot_cpu_has(X86_FEATURE_HT)
-#define cpu_has_syscall		boot_cpu_has(X86_FEATURE_SYSCALL)
-#define cpu_has_mp		boot_cpu_has(X86_FEATURE_MP)
-#define cpu_has_nx		boot_cpu_has(X86_FEATURE_NX)
-#define cpu_has_k6_mtrr		boot_cpu_has(X86_FEATURE_K6_MTRR)
-#define cpu_has_cyrix_arr	boot_cpu_has(X86_FEATURE_CYRIX_ARR)
-#define cpu_has_centaur_mcr	boot_cpu_has(X86_FEATURE_CENTAUR_MCR)
-#define cpu_has_clflush		boot_cpu_has(X86_FEATURE_CLFLSH)
-#define cpu_has_page1gb		0
-#define cpu_has_efer		(boot_cpu_data.x86_capability[1] & 0x20100800)
-#define cpu_has_fsgsbase	0
-#else /* __x86_64__ */
 #define cpu_has_vme		0
 #define cpu_has_de		1
 #define cpu_has_pse		1
@@ -217,7 +190,6 @@
 #define cpu_has_page1gb		boot_cpu_has(X86_FEATURE_PAGE1GB)
 #define cpu_has_efer		1
 #define cpu_has_fsgsbase	boot_cpu_has(X86_FEATURE_FSGSBASE)
-#endif
 
 #define cpu_has_smep            boot_cpu_has(X86_FEATURE_SMEP)
 
diff -r 05d82fb18335 -r bc8cb4778702 xen/include/asm-x86/current.h
--- a/xen/include/asm-x86/current.h	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/include/asm-x86/current.h	Wed Sep 12 13:29:30 2012 +0100
@@ -19,9 +19,8 @@ struct cpu_info {
     unsigned int processor_id;
     struct vcpu *current_vcpu;
     unsigned long per_cpu_offset;
-#ifdef __x86_64__ /* get_stack_bottom() must be 16-byte aligned */
+    /* get_stack_bottom() must be 16-byte aligned */
     unsigned long __pad_for_stack_bottom;
-#endif
 };
 
 static inline struct cpu_info *get_cpu_info(void)
diff -r 05d82fb18335 -r bc8cb4778702 xen/include/asm-x86/desc.h
--- a/xen/include/asm-x86/desc.h	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/include/asm-x86/desc.h	Wed Sep 12 13:29:30 2012 +0100
@@ -18,8 +18,6 @@
 
 #define LDT_ENTRY_SIZE 8
 
-#if defined(__x86_64__)
-
 #define FLAT_COMPAT_RING1_CS 0xe019  /* GDT index 259 */
 #define FLAT_COMPAT_RING1_DS 0xe021  /* GDT index 260 */
 #define FLAT_COMPAT_RING1_SS 0xe021  /* GDT index 260 */
@@ -38,30 +36,9 @@
 #define LDT_ENTRY (TSS_ENTRY + 2)
 #define PER_CPU_GDT_ENTRY (LDT_ENTRY + 2)
 
-#elif defined(__i386__)
-
-#define FLAT_COMPAT_KERNEL_CS FLAT_KERNEL_CS
-#define FLAT_COMPAT_KERNEL_DS FLAT_KERNEL_DS
-#define FLAT_COMPAT_KERNEL_SS FLAT_KERNEL_SS
-#define FLAT_COMPAT_USER_CS   FLAT_USER_CS
-#define FLAT_COMPAT_USER_DS   FLAT_USER_DS
-#define FLAT_COMPAT_USER_SS   FLAT_USER_SS
-
-#define DOUBLEFAULT_TSS_ENTRY FIRST_RESERVED_GDT_ENTRY
-
-#define TSS_ENTRY (FIRST_RESERVED_GDT_ENTRY + 8)
-#define LDT_ENTRY (TSS_ENTRY + 1)
-#define PER_CPU_GDT_ENTRY (LDT_ENTRY + 1)
-
-#endif
-
 #ifndef __ASSEMBLY__
 
-#if defined(__x86_64__)
 #define GUEST_KERNEL_RPL(d) (is_pv_32bit_domain(d) ? 1 : 3)
-#elif defined(__i386__)
-#define GUEST_KERNEL_RPL(d) ((void)(d), 1)
-#endif
 
 /* Fix up the RPL of a guest segment selector. */
 #define __fixup_guest_selector(d, sel)                             \
@@ -115,11 +92,7 @@
 #define _SEGMENT_S       ( 1<<12) /* System descriptor (yes iff S==0) */
 #define _SEGMENT_DPL     ( 3<<13) /* Descriptor Privilege Level */
 #define _SEGMENT_P       ( 1<<15) /* Segment Present */
-#ifdef __x86_64__
 #define _SEGMENT_L       ( 1<<21) /* 64-bit segment */
-#else
-#define _SEGMENT_L       0
-#endif
 #define _SEGMENT_DB      ( 1<<22) /* 16- or 32-bit segment */
 #define _SEGMENT_G       ( 1<<23) /* Granularity */
 
@@ -129,8 +102,6 @@ struct desc_struct {
     u32 a, b;
 };
 
-#if defined(__x86_64__)
-
 typedef struct {
     u64 a, b;
 } idt_entry_t;
@@ -165,40 +136,6 @@ do {                                    
         (((u32)(addr) & 0x00FF0000U) >> 16);             \
 } while (0)
 
-#elif defined(__i386__)
-
-typedef struct desc_struct idt_entry_t;
-
-#define _set_gate(gate_addr,type,dpl,addr)               \
-do {                                                     \
-    (gate_addr)->b = 0;                                  \
-    wmb(); /* disable gate /then/ rewrite */             \
-    (gate_addr)->a =                                     \
-        ((unsigned long)(addr) & 0xFFFFUL) |             \
-        ((unsigned long)__HYPERVISOR_CS << 16);          \
-    wmb(); /* rewrite /then/ enable gate */              \
-    (gate_addr)->b =                                     \
-        ((unsigned long)(addr) & 0xFFFF0000UL) |         \
-        ((unsigned long)(dpl) << 13) |                   \
-        ((unsigned long)(type) << 8) |                   \
-        (1UL << 15);                                     \
-} while (0)
-
-#define _set_tssldt_desc(desc,addr,limit,type)           \
-do {                                                     \
-    (desc)->b = 0;                                       \
-    wmb(); /* disable entry /then/ rewrite */            \
-    (desc)->a =                                          \
-        ((u32)(addr) << 16) | ((u32)(limit) & 0xFFFF);   \
-    wmb(); /* rewrite /then/ enable entry */             \
-    (desc)->b =                                          \
-        ((u32)(addr) & 0xFF000000U) |                    \
-        ((u32)(type) << 8) | 0x8000U |                   \
-        (((u32)(addr) & 0x00FF0000U) >> 16);             \
-} while (0)
-
-#endif
-
 struct desc_ptr {
 	unsigned short limit;
 	unsigned long base;
diff -r 05d82fb18335 -r bc8cb4778702 xen/include/asm-x86/domain.h
--- a/xen/include/asm-x86/domain.h	Wed Sep 12 13:24:28 2012 +0200
+++ b/xen/include/asm-x86/domain.h	Wed Sep 12 13:29:30 2012 +0100
@@ -13,11 +13,7 @@
 #define has_32bit_shinfo(d)    ((d)->arch.has_32bit_shinfo)
 #define is_pv_32bit_domain(d)  ((d)->arch.is_32bit_pv)
 #define is_pv_32bit_vcpu(v)    (is_pv_32bit_domain((v)->domain))
-#ifdef __x86_64__
 #define is_pv_32on64_domain(d) (is_pv_32bit_domain(d))
-#else
-#define is_pv_32on64_domain(d) (0)
-#endif
 #define is_pv_32on64_vcpu(v)   (is_pv_32on64_domain((v)->domain))
 
 #define is_hvm_pv_evtchn_domain(d) (is_hvm_domain(d) && \
@@ -243,18 +239,11 @@ struct pv_domain
 
 struct arch_domain
 {
-#ifdef CONFIG_X86_64
     struct page_info **mm_perdomain_pt_pages;
     l2_pgentry_t *mm_perdomain_l2;
     l3_pgentry_t *mm_perdomain_l3;
 
     unsigned int hv_compat_vstart;
-#else
-    l1_pgentry_t *mm_perdomain_pt;
-
-    /* map_domain_page() mapping cache. */
-    struct mapcache_domain mapcache;
-#endif
 
     bool_t s3_integrity;
 
@@ -330,7 +319,6 @@ struct arch_domain
 #define has_arch_pdevs(d)    (!list_empty(&(d)->arch.pdev_list))
 #define has_arch_mmios(d)    (!rangeset_is_empty((d)->iomem_caps))
 
-#ifdef CONFIG_X86_64
 #define perdomain_pt_pgidx(v) \
       ((v)->vcpu_id >> (PAGETABLE_ORDER - GDT_LDT_VCPU_SHIFT))
 #define perdomain_ptes(d, v) \
@@ -338,32 +326,6 @@ struct arch_domain
       [perdomain_pt_pgidx(v)]) + (((v)->vcpu_id << GDT_LDT_VCPU_SHIFT) & \
                                   (L1_PAGETABLE_ENTRIES - 1)))
 #define perdomain_pt_page(d, n) ((d)->arch.mm_perdomain_pt_pages[n])
-#else
-#define perdomain_ptes(d, v) \
-    ((d)->arch.mm_perdomain_pt + ((v)->vcpu_id << GDT_LDT_VCPU_SHIFT))
-#define perdomain_pt_page(d, n) \
-    (virt_to_page((d)->arch.mm_perdomain_pt) + (n))
-#endif
-
-
-#ifdef __i386__
-struct pae_l3_cache {
-    /*
-     * Two low-memory (<4GB) PAE L3 tables, used as fallback when the guest
-     * supplies a >=4GB PAE L3 table. We need two because we cannot set up
-     * an L3 table while we are currently running on it (without using
-     * expensive atomic 64-bit operations).
-     */
-    l3_pgentry_t  table[2][4] __attribute__((__aligned__(32)));
-    unsigned long high_mfn;  /* The >=4GB MFN being shadowed. */
-    unsigned int  inuse_idx; /* Which of the two cache slots is in use? */
-    spinlock_t    lock;
-};
-#define pae_l3_cache_init(c) spin_lock_init(&(c)->lock)
-#else /* !defined(__i386__) */
-struct pae_l3_cache { };
-#define pae_l3_cache_init(c) ((void)0)
-#endif
 
 struct pv_vcpu
 {
@@ -379,9 +341,7 @@ struct pv_vcpu
     unsigned long event_callback_eip;
     unsigned long failsafe_callback_eip;
     union {
-#ifdef CONFIG_X86_64
         unsigned long syscall_callback_eip;
-#endif
         struct {
             unsigned int event_callback_cs;
             unsigned int failsafe_callback_cs;
@@ -390,7 +350,6 @@ struct pv_vcpu
 
     unsigned long vm_assist;
 
-#ifdef CONFIG_X86_64
     unsigned long syscall32_callback_eip;
     unsigned long sysenter_callback_eip;
     unsigned short syscall32_callback_cs;
@@ -402,15 +361,10 @@ struct pv_vcpu
     unsigned long fs_base;
     unsigned long gs_base_kernel;
     unsigned long gs_base_user;
-#endif
 
     /* Bounce information for propagating an exception to guest OS. */
     struct trap_bounce trap_bounce;
-#ifdef CONFIG_X86_64
     struct trap_bounce int80_bounce;
-#else
-    struct desc_struct int80_desc;


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

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:56:07 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:56:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTZ9-0004Oz-2f; Fri, 14 Sep 2012 10:56:07 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTZ7-0004Lh-58
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:56:05 +0000
Received: from [85.158.143.35:2796] by server-1.bemta-4.messagelabs.com id
	CF/78-12504-44D03505; Fri, 14 Sep 2012 10:56:04 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-21.messagelabs.com!1347620123!10147396!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18154 invoked from network); 14 Sep 2012 10:55:24 -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;
	14 Sep 2012 10: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 1TCTYR-00013w-Eu
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYR-0000kY-DQ
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:23 +0000
Message-Id: <E1TCTYR-0000kY-DQ@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] console: add EHCI debug port based
	serial console
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347371392 -7200
# Node ID 0d0c55a1975db9c6cac2e9259b5ebea7a7bdbaec
# Parent  776a23fa0e938e4cf3307fc2e3b3f1a9488a5927
console: add EHCI debug port based serial console

Low level hardware interface pieces adapted from Linux.

For setup information, see Linux'es Documentation/x86/earlyprintk.txt
and/or http://www.coreboot.org/EHCI_Debug_Port.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 776a23fa0e93 -r 0d0c55a1975d docs/misc/xen-command-line.markdown
--- a/docs/misc/xen-command-line.markdown	Tue Sep 11 15:47:16 2012 +0200
+++ b/docs/misc/xen-command-line.markdown	Tue Sep 11 15:49:52 2012 +0200
@@ -244,7 +244,7 @@ A typical setup for most situations migh
 Specify the size of the console ring buffer.
 
 ### console
-> `= List of [ vga | com1[H,L] | com2[H,L] | none ]`
+> `= List of [ vga | com1[H,L] | com2[H,L] | dbgp | none ]`
 
 > Default: `console=com1,vga`
 
@@ -260,6 +260,8 @@ the converse; transmitted and received c
 cleared.  This allows a single port to be shared by two subsystems
 (e.g. console and debugger).
 
+`dbgp` indicates that Xen should use a USB debug port.
+
 `none` indicates that Xen should not use a console.  This option only
 makes sense on its own.
 
@@ -352,6 +354,12 @@ combination with the `low_crashinfo` com
 ### credit2\_load\_window\_shift
 > `= <integer>`
 
+### dbgp
+> `= ehci[ <integer> | @pci<bus>:<slot>.<func> ]`
+
+Specify the USB controller to use, either by instance number (when going
+over the PCI busses sequentially) or by PCI device (must be on segment 0).
+
 ### debug\_stack\_lines
 > `= <integer>`
 
diff -r 776a23fa0e93 -r 0d0c55a1975d xen/arch/x86/Rules.mk
--- a/xen/arch/x86/Rules.mk	Tue Sep 11 15:47:16 2012 +0200
+++ b/xen/arch/x86/Rules.mk	Tue Sep 11 15:49:52 2012 +0200
@@ -7,6 +7,7 @@ HAS_CPUFREQ := y
 HAS_PCI := y
 HAS_PASSTHROUGH := y
 HAS_NS16550 := y
+HAS_EHCI := y
 HAS_KEXEC := y
 HAS_GDBSX := y
 xenoprof := y
diff -r 776a23fa0e93 -r 0d0c55a1975d xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c	Tue Sep 11 15:47:16 2012 +0200
+++ b/xen/arch/x86/physdev.c	Tue Sep 11 15:49:52 2012 +0200
@@ -8,6 +8,7 @@
 #include <xen/event.h>
 #include <xen/guest_access.h>
 #include <xen/iocap.h>
+#include <xen/serial.h>
 #include <asm/current.h>
 #include <asm/io_apic.h>
 #include <asm/msi.h>
@@ -722,6 +723,19 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
 
         break;
     }
+
+    case PHYSDEVOP_dbgp_op: {
+        struct physdev_dbgp_op op;
+
+        if ( !IS_PRIV(v->domain) )
+            ret = -EPERM;
+        else if ( copy_from_guest(&op, arg, 1) )
+            ret = -EFAULT;
+        else
+            ret = dbgp_op(&op);
+        break;
+    }
+
     default:
         ret = -ENOSYS;
         break;
diff -r 776a23fa0e93 -r 0d0c55a1975d xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c	Tue Sep 11 15:47:16 2012 +0200
+++ b/xen/arch/x86/setup.c	Tue Sep 11 15:49:52 2012 +0200
@@ -606,6 +606,7 @@ void __init __start_xen(unsigned long mb
     ns16550.io_base = 0x2f8;
     ns16550.irq     = 3;
     ns16550_init(1, &ns16550);
+    ehci_dbgp_init();
     console_init_preirq();
 
     printk("Bootloader: %s\n", loader);
diff -r 776a23fa0e93 -r 0d0c55a1975d xen/drivers/char/Makefile
--- a/xen/drivers/char/Makefile	Tue Sep 11 15:47:16 2012 +0200
+++ b/xen/drivers/char/Makefile	Tue Sep 11 15:49:52 2012 +0200
@@ -1,4 +1,5 @@
 obj-y += console.o
 obj-$(HAS_NS16550) += ns16550.o
 obj-$(HAS_PL011) += pl011.o
+obj-$(HAS_EHCI) += ehci-dbgp.o
 obj-y += serial.o
diff -r 776a23fa0e93 -r 0d0c55a1975d xen/drivers/char/ehci-dbgp.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/drivers/char/ehci-dbgp.c	Tue Sep 11 15:49:52 2012 +0200
@@ -0,0 +1,1577 @@
+/*
+ * Standalone EHCI USB debug driver
+ *
+ * Hardware interface code based on the respective early console driver in
+ * Linux; see the Linux source for authorship and copyrights.
+ */
+
+#include <xen/config.h>
+#include <xen/console.h>
+#include <xen/delay.h>
+#include <xen/errno.h>
+#include <xen/pci.h>
+#include <xen/serial.h>
+#include <asm/byteorder.h>
+#include <asm/io.h>
+#include <asm/fixmap.h>
+#include <public/physdev.h>
+
+/* #define DBGP_DEBUG */
+
+/* EHCI register interface, corresponds to EHCI Revision 0.95 specification */
+
+/* Section 2.2 Host Controller Capability Registers */
+struct ehci_caps {
+    /*
+     * These fields are specified as 8 and 16 bit registers,
+     * but some hosts can't perform 8 or 16 bit PCI accesses.
+     * some hosts treat caplength and hciversion as parts of a 32-bit
+     * register, others treat them as two separate registers, this
+     * affects the memory map for big endian controllers.
+     */
+    u32 hc_capbase;
+#define HC_LENGTH(p)      (0x00ff & (p)) /* bits 7:0 / offset 0x00 */
+#define HC_VERSION(p)     (0xffff & ((p) >> 16)) /* bits 31:16 / offset 0x02 */
+
+    u32 hcs_params;       /* HCSPARAMS - offset 0x04 */
+#define HCS_DEBUG_PORT(p) (((p) >> 20) & 0xf) /* bits 23:20, debug port? */
+#define HCS_INDICATOR(p)  ((p) & (1 << 16))   /* true: has port indicators */
+#define HCS_N_CC(p)       (((p) >> 12) & 0xf) /* bits 15:12, #companion HCs */
+#define HCS_N_PCC(p)      (((p) >> 8) & 0xf)  /* bits 11:8, ports per CC */
+#define HCS_PORTROUTED(p) ((p) & (1 << 7))    /* true: port routing */
+#define HCS_PPC(p)        ((p) & (1 << 4))    /* true: port power control */
+#define HCS_N_PORTS(p)    (((p) >> 0) & 0xf)  /* bits 3:0, ports on HC */
+
+    u32 hcc_params;       /* HCCPARAMS - offset 0x08 */
+/* EHCI 1.1 addendum */
+#define HCC_32FRAME_PERIODIC_LIST(p) ((p) & (1 << 19))
+#define HCC_PER_PORT_CHANGE_EVENT(p) ((p) & (1 << 18))
+#define HCC_LPM(p)        ((p) & (1 << 17))
+#define HCC_HW_PREFETCH(p) ((p) & (1 << 16))
+#define HCC_EXT_CAPS(p)   (((p) >> 8) & 0xff) /* for pci extended caps */
+#define HCC_ISOC_CACHE(p) ((p) & (1 << 7))    /* true: can cache isoc frame */
+#define HCC_ISOC_THRES(p) (((p) >> 4) & 0x7)  /* bits 6:4, uframes cached */
+#define HCC_CANPARK(p)    ((p) & (1 << 2))    /* true: can park on async qh */
+#define HCC_PGM_FRAMELISTLEN(p) ((p) & (1 << 1)) /* true: periodic_size changes */
+#define HCC_64BIT_ADDR(p) ((p) & 1)           /* true: can use 64-bit addr */
+
+    u8  portroute[8];     /* nibbles for routing - offset 0x0C */
+};
+
+/* Section 2.3 Host Controller Operational Registers */
+struct ehci_regs {
+    /* USBCMD: offset 0x00 */
+    u32 command;
+
+/* EHCI 1.1 addendum */
+#define CMD_HIRD        (0xf << 24) /* host initiated resume duration */
+#define CMD_PPCEE       (1 << 15)   /* per port change event enable */
+#define CMD_FSP         (1 << 14)   /* fully synchronized prefetch */
+#define CMD_ASPE        (1 << 13)   /* async schedule prefetch enable */
+#define CMD_PSPE        (1 << 12)   /* periodic schedule prefetch enable */
+/* 23:16 is r/w intr rate, in microframes; default "8" == 1/msec */
+#define CMD_PARK        (1 << 11)   /* enable "park" on async qh */
+#define CMD_PARK_CNT(c) (((c) >> 8) & 3) /* how many transfers to park for */
+#define CMD_LRESET      (1 << 7)    /* partial reset (no ports, etc) */
+#define CMD_IAAD        (1 << 6)    /* "doorbell" interrupt async advance */
+#define CMD_ASE         (1 << 5)    /* async schedule enable */
+#define CMD_PSE         (1 << 4)    /* periodic schedule enable */
+/* 3:2 is periodic frame list size */
+#define CMD_RESET       (1 << 1)    /* reset HC not bus */
+#define CMD_RUN         (1 << 0)    /* start/stop HC */
+
+    /* USBSTS: offset 0x04 */
+    u32 status;
+#define STS_PPCE_MASK   (0xff << 16) /* Per-Port change event 1-16 */
+#define STS_ASS         (1 << 15)   /* Async Schedule Status */
+#define STS_PSS         (1 << 14)   /* Periodic Schedule Status */
+#define STS_RECL        (1 << 13)   /* Reclamation */
+#define STS_HALT        (1 << 12)   /* Not running (any reason) */
+/* some bits reserved */
+    /* these STS_* flags are also intr_enable bits (USBINTR) */
+#define STS_IAA         (1 << 5)    /* Interrupted on async advance */
+#define STS_FATAL       (1 << 4)    /* such as some PCI access errors */
+#define STS_FLR         (1 << 3)    /* frame list rolled over */
+#define STS_PCD         (1 << 2)    /* port change detect */
+#define STS_ERR         (1 << 1)    /* "error" completion (overflow, ...) */
+#define STS_INT         (1 << 0)    /* "normal" completion (short, ...) */
+
+    /* USBINTR: offset 0x08 */
+    u32 intr_enable;
+
+    /* FRINDEX: offset 0x0C */
+    u32 frame_index;    /* current microframe number */
+    /* CTRLDSSEGMENT: offset 0x10 */
+    u32 segment;    /* address bits 63:32 if needed */
+    /* PERIODICLISTBASE: offset 0x14 */
+    u32 frame_list;    /* points to periodic list */
+    /* ASYNCLISTADDR: offset 0x18 */
+    u32 async_next;    /* address of next async queue head */
+
+    u32 reserved[9];
+
+    /* CONFIGFLAG: offset 0x40 */
+    u32 configured_flag;
+#define FLAG_CF         (1 << 0)    /* true: we'll support "high speed" */
+
+    /* PORTSC: offset 0x44 */
+    u32 port_status[0];    /* up to N_PORTS */
+/* EHCI 1.1 addendum */
+#define PORTSC_SUSPEND_STS_ACK   0
+#define PORTSC_SUSPEND_STS_NYET  1
+#define PORTSC_SUSPEND_STS_STALL 2
+#define PORTSC_SUSPEND_STS_ERR   3
+
+#define PORT_DEV_ADDR   (0x7f << 25) /* device address */
+#define PORT_SSTS       (0x3 << 23)  /* suspend status */
+/* 31:23 reserved */
+#define PORT_WKOC_E     (1 << 22)    /* wake on overcurrent (enable) */
+#define PORT_WKDISC_E   (1 << 21)    /* wake on disconnect (enable) */
+#define PORT_WKCONN_E   (1 << 20)    /* wake on connect (enable) */
+/* 19:16 for port testing */
+#define PORT_TEST(x)    (((x) & 0xf) << 16) /* Port Test Control */
+#define PORT_TEST_PKT   PORT_TEST(0x4) /* Port Test Control - packet test */
+#define PORT_TEST_FORCE PORT_TEST(0x5) /* Port Test Control - force enable */
+#define PORT_LED_OFF    (0 << 14)
+#define PORT_LED_AMBER  (1 << 14)
+#define PORT_LED_GREEN  (2 << 14)
+#define PORT_LED_MASK   (3 << 14)
+#define PORT_OWNER      (1 << 13)    /* true: companion hc owns this port */
+#define PORT_POWER      (1 << 12)    /* true: has power (see PPC) */
+#define PORT_USB11(x)   (((x) & (3 << 10)) == (1 << 10)) /* USB 1.1 device */
+/* 11:10 for detecting lowspeed devices (reset vs release ownership) */
+/* 9 reserved */
+#define PORT_LPM        (1 << 9)     /* LPM transaction */
+#define PORT_RESET      (1 << 8)     /* reset port */
+#define PORT_SUSPEND    (1 << 7)     /* suspend port */
+#define PORT_RESUME     (1 << 6)     /* resume it */
+#define PORT_OCC        (1 << 5)     /* over current change */
+#define PORT_OC         (1 << 4)     /* over current active */
+#define PORT_PEC        (1 << 3)     /* port enable change */
+#define PORT_PE         (1 << 2)     /* port enable */
+#define PORT_CSC        (1 << 1)     /* connect status change */
+#define PORT_CONNECT    (1 << 0)     /* device connected */
+#define PORT_RWC_BITS   (PORT_CSC | PORT_PEC | PORT_OCC)
+};
+
+/*
+ * Appendix C, Debug port ... intended for use with special "debug devices"
+ * that can help if there's no serial console.  (nonstandard enumeration.)
+ */
+struct ehci_dbg_port {
+    u32 control;
+#define DBGP_OWNER      (1 << 30)
+#define DBGP_ENABLED    (1 << 28)
+#define DBGP_DONE       (1 << 16)
+#define DBGP_INUSE      (1 << 10)
+#define DBGP_ERRCODE(x) (((x) >> 7) & 0x07)
+# define DBGP_ERR_BAD    1
+# define DBGP_ERR_SIGNAL 2
+#define DBGP_ERROR      (1 << 6)
+#define DBGP_GO         (1 << 5)
+#define DBGP_OUT        (1 << 4)
+#define DBGP_LEN        (0xf << 0)
+#define DBGP_CLAIM      (DBGP_OWNER | DBGP_ENABLED | DBGP_INUSE)
+    u32 pids;
+#define DBGP_PID_GET(x)         (((x) >> 16) & 0xff)
+#define DBGP_PID_SET(data, tok) (((data) << 8) | (tok))
+    u32 data03;
+    u32 data47;
+    u32 address;
+#define DBGP_EPADDR(dev, ep) (((dev) << 8) | (ep))
+};
+
+/* CONTROL REQUEST SUPPORT */
+
+/*
+ * USB directions
+ *
+ * This bit flag is used in endpoint descriptors' bEndpointAddress field.
+ * It's also one of three fields in control requests bRequestType.
+ */
+#define USB_DIR_OUT 0           /* to device */
+#define USB_DIR_IN  0x80        /* to host */
+
+/*
+ * USB types, the second of three bRequestType fields
+ */
+#define USB_TYPE_MASK     (0x03 << 5)
+#define USB_TYPE_STANDARD (0x00 << 5)
+#define USB_TYPE_CLASS    (0x01 << 5)
+#define USB_TYPE_VENDOR   (0x02 << 5)
+#define USB_TYPE_RESERVED (0x03 << 5)
+
+/*
+ * USB recipients, the third of three bRequestType fields
+ */
+#define USB_RECIP_MASK      0x1f
+#define USB_RECIP_DEVICE    0x00
+#define USB_RECIP_INTERFACE 0x01
+#define USB_RECIP_ENDPOINT  0x02
+#define USB_RECIP_OTHER     0x03
+/* From Wireless USB 1.0 */
+#define USB_RECIP_PORT      0x04
+#define USB_RECIP_RPIPE     0x05
+
+/*
+ * Standard requests, for the bRequest field of a SETUP packet.
+ *
+ * These are qualified by the bRequestType field, so that for example
+ * TYPE_CLASS or TYPE_VENDOR specific feature flags could be retrieved
+ * by a GET_STATUS request.
+ */
+#define USB_REQ_GET_STATUS        0x00
+#define USB_REQ_CLEAR_FEATURE     0x01
+#define USB_REQ_SET_FEATURE       0x03
+#define USB_REQ_SET_ADDRESS       0x05
+#define USB_REQ_GET_DESCRIPTOR    0x06
+#define USB_REQ_SET_DESCRIPTOR    0x07
+#define USB_REQ_GET_CONFIGURATION 0x08
+#define USB_REQ_SET_CONFIGURATION 0x09
+#define USB_REQ_GET_INTERFACE     0x0A
+#define USB_REQ_SET_INTERFACE     0x0B
+#define USB_REQ_SYNCH_FRAME       0x0C
+
+#define USB_DEVICE_DEBUG_MODE        6    /* (special devices only) */
+
+/**
+ * struct usb_ctrlrequest - SETUP data for a USB device control request
+ * @bRequestType: matches the USB bmRequestType field
+ * @bRequest: matches the USB bRequest field
+ * @wValue: matches the USB wValue field (le16 byte order)
+ * @wIndex: matches the USB wIndex field (le16 byte order)
+ * @wLength: matches the USB wLength field (le16 byte order)
+ *
+ * This structure is used to send control requests to a USB device.  It matches
+ * the different fields of the USB 2.0 Spec section 9.3, table 9-2.  See the
+ * USB spec for a fuller description of the different fields, and what they are
+ * used for.
+ *
+ * Note that the driver for any interface can issue control requests.
+ * For most devices, interfaces don't coordinate with each other, so
+ * such requests may be made at any time.
+ */
+struct usb_ctrlrequest {
+    u8 bRequestType;
+    u8 bRequest;
+    __le16 wValue;
+    __le16 wIndex;
+    __le16 wLength;
+} __attribute__ ((packed));
+
+/* USB_DT_DEBUG: for special highspeed devices, replacing serial console */
+
+#define USB_DT_DEBUG    0x0a
+
+struct usb_debug_descriptor {
+    u8 bLength;
+    u8 bDescriptorType;
+    /* bulk endpoints with 8 byte maxpacket */
+    u8 bDebugInEndpoint;
+    u8 bDebugOutEndpoint;
+} __attribute__((packed));
+
+#define USB_DEBUG_DEVNUM 127
+
+/*
+ * USB Packet IDs (PIDs)
+ */
+
+/* token */
+#define USB_PID_OUT           0xe1
+#define USB_PID_IN            0x69
+#define USB_PID_SOF           0xa5
+#define USB_PID_SETUP         0x2d
+/* handshake */
+#define USB_PID_ACK           0xd2
+#define USB_PID_NAK           0x5a
+#define USB_PID_STALL         0x1e
+#define USB_PID_NYET          0x96
+/* data */
+#define USB_PID_DATA0         0xc3
+#define USB_PID_DATA1         0x4b
+#define USB_PID_DATA2         0x87
+#define USB_PID_MDATA         0x0f
+/* Special */
+#define USB_PID_PREAMBLE      0x3c
+#define USB_PID_ERR           0x3c
+#define USB_PID_SPLIT         0x78
+#define USB_PID_PING          0xb4
+#define USB_PID_UNDEF_0       0xf0
+
+#define PCI_CLASS_SERIAL_USB_EHCI 0x0c0320
+#define PCI_CAP_ID_EHCI_DEBUG     0x0a
+
+#define HUB_ROOT_RESET_TIME   50    /* times are in msec */
+#define HUB_SHORT_RESET_TIME  10
+#define HUB_LONG_RESET_TIME   200
+#define HUB_RESET_TIMEOUT     500
+
+#define DBGP_MAX_PACKET       8
+#define DBGP_LOOPS            1000
+#define DBGP_TIMEOUT          (250 * 1000) /* us */
+#define DBGP_CHECK_INTERVAL   100 /* us */
+/* This one can be set arbitrarily - only affects input responsiveness: */
+#define DBGP_IDLE_INTERVAL    100 /* ms */
+
+struct ehci_dbgp {
+    struct ehci_dbg_port __iomem *ehci_debug;
+    enum dbgp_state {
+        dbgp_idle,
+        dbgp_out,
+        dbgp_in,
+        dbgp_ctrl,
+        dbgp_unsafe /* cannot use debug device during EHCI reset */
+    } state;
+    unsigned int phys_port;
+    struct {
+        unsigned int endpoint;
+        unsigned int chunk;
+        char buf[DBGP_MAX_PACKET];
+    } out, in;
+    unsigned long timeout;
+    struct timer timer;
+    spinlock_t *lock;
+    bool_t reset_run;
+    u8 bus, slot, func, bar;
+    u16 pci_cr;
+    u32 bar_val;
+    unsigned int cap;
+    struct ehci_regs __iomem *ehci_regs;
+    struct ehci_caps __iomem *ehci_caps;
+};
+
+static int ehci_dbgp_external_startup(struct ehci_dbgp *);
+
+static void ehci_dbgp_status(struct ehci_dbgp *dbgp, const char *str)
+{
+#ifdef DBGP_DEBUG
+#define dbgp_printk printk
+    if ( !dbgp->ehci_debug )
+        return;
+    dbgp_printk("dbgp: %s\n", str);
+    dbgp_printk("  debug control: %08x\n", readl(&dbgp->ehci_debug->control));
+    dbgp_printk("  EHCI cmd     : %08x\n", readl(&dbgp->ehci_regs->command));
+    dbgp_printk("  EHCI conf flg: %08x\n",
+                readl(&dbgp->ehci_regs->configured_flag));
+    dbgp_printk("  EHCI status  : %08x\n", readl(&dbgp->ehci_regs->status));
+    dbgp_printk("  EHCI portsc  : %08x\n",
+                readl(&dbgp->ehci_regs->port_status[dbgp->phys_port - 1]));
+#endif
+}
+
+#ifndef DBGP_DEBUG
+static inline __attribute__ ((format (printf, 1, 2))) void
+dbgp_printk(const char *fmt, ...) { }
+#endif
+
+static inline u32 dbgp_len_update(u32 x, u32 len)
+{
+    return (x & ~DBGP_LEN) | (len & DBGP_LEN) | DBGP_OUT;
+}
+
+static inline u32 dbgp_pid_write_update(u32 x, u32 tok)
+{
+    static u8 data0 = USB_PID_DATA1;
+
+    data0 ^= USB_PID_DATA0 ^ USB_PID_DATA1;
+    return (x & 0xffff0000) | (data0 << 8) | (tok & 0xff);
+}
+
+static inline u32 dbgp_pid_read_update(u32 x, u32 tok)
+{
+    return (x & 0xffffff00) | (tok & 0xff);
+}
+
+static inline void dbgp_set_data(struct ehci_dbg_port __iomem *ehci_debug,
+                                 const void *buf, unsigned int size)
+{
+    const unsigned char *bytes = buf;
+    u32 lo = 0, hi = 0;
+    unsigned int i;
+
+    for ( i = 0; i < 4 && i < size; i++ )
+        lo |= bytes[i] << (8 * i);
+    for ( ; i < 8 && i < size; i++ )
+        hi |= bytes[i] << (8 * (i - 4));
+    writel(lo, &ehci_debug->data03);
+    writel(hi, &ehci_debug->data47);
+}
+
+static inline void dbgp_get_data(struct ehci_dbg_port __iomem *ehci_debug,
+                                 void *buf, int size)
+{
+    unsigned char *bytes = buf;
+    u32 lo = readl(&ehci_debug->data03);
+    u32 hi = readl(&ehci_debug->data47);
+    unsigned int i;
+
+    for ( i = 0; i < 4 && i < size; i++ )
+        bytes[i] = (lo >> (8 * i)) & 0xff;
+    for ( ; i < 8 && i < size; i++ )
+        bytes[i] = (hi >> (8 * (i - 4))) & 0xff;
+}
+
+static void dbgp_issue_command(struct ehci_dbgp *dbgp, u32 ctrl,
+                               enum dbgp_state state)
+{
+    u32 cmd = readl(&dbgp->ehci_regs->command);
+
+    if ( unlikely(!(cmd & CMD_RUN)) )
+    {
+        /*
+         * If the EHCI controller is not in the run state do extended
+         * checks to see if ACPI or some other initialization also
+         * reset the EHCI debug port.
+         */
+        u32 ctrl = readl(&dbgp->ehci_debug->control);
+
+        if ( ctrl & DBGP_ENABLED )
+        {
+            cmd |= CMD_RUN;
+            writel(cmd, &dbgp->ehci_regs->command);
+            dbgp->reset_run = 1;
+        }
+        else if ( dbgp->state != dbgp_unsafe )
+        {
+            dbgp->state = dbgp_unsafe;
+            ehci_dbgp_external_startup(dbgp);
+        }
+    }
+
+    writel(ctrl | DBGP_GO, &dbgp->ehci_debug->control);
+    dbgp->timeout = DBGP_TIMEOUT;
+    if ( dbgp->state != dbgp_unsafe )
+        dbgp->state = state;
+}
+
+static int dbgp_check_for_completion(struct ehci_dbgp *dbgp,
+                                     unsigned int interval, u8 *ppid)
+{
+    u32 ctrl;
+    int ret;
+
+    if ( dbgp->state == dbgp_idle )
+        return 0;
+
+    ctrl = readl(&dbgp->ehci_debug->control) & ~DBGP_GO;
+    if ( !(ctrl & DBGP_DONE) )
+    {
+        if ( dbgp->timeout > interval )
+            dbgp->timeout -= interval;
+        else if ( interval )
+        {
+            /* See the timeout related comment in dbgp_wait_until_done(). */
+            dbgp->state = dbgp_unsafe;
+            dbgp->timeout = 0;
+        }
+        return -DBGP_TIMEOUT;
+    }
+
+    if ( ctrl & DBGP_ERROR )
+    {
+        ret = -DBGP_ERRCODE(ctrl);
+        if ( ret == -DBGP_ERR_BAD && dbgp->timeout > interval )
+            ctrl |= DBGP_GO;
+    }
+    else
+    {
+        u8 pid = DBGP_PID_GET(readl(&dbgp->ehci_debug->pids));
+
+        ret = ctrl & DBGP_LEN;
+        if ( ppid )
+            *ppid = pid;
+        else if ( dbgp->state == dbgp_in )
+        {
+            dbgp_get_data(dbgp->ehci_debug, dbgp->in.buf, ret);
+            dbgp->in.chunk = ret;
+        }
+        else if ( pid == USB_PID_NAK && dbgp->timeout > interval )
+            ctrl |= DBGP_GO;
+    }
+
+    writel(ctrl, &dbgp->ehci_debug->control);
+    if ( ctrl & DBGP_GO )
+    {
+        dbgp->timeout -= interval;
+        return -DBGP_TIMEOUT;
+    }
+
+    if ( unlikely(dbgp->reset_run) )
+    {
+        writel(readl(&dbgp->ehci_regs->command) & ~CMD_RUN,
+               &dbgp->ehci_regs->command);
+        dbgp->reset_run = 0;
+    }
+
+    if ( dbgp->state != dbgp_unsafe )
+        dbgp->state = dbgp_idle;
+
+    return ret;
+}
+
+static int dbgp_wait_until_complete(struct ehci_dbgp *dbgp, u8 *ppid)
+{
+    unsigned int loop = DBGP_TIMEOUT;
+    int ret;
+
+    do {
+        ret = dbgp_check_for_completion(dbgp, 0, ppid);
+        if ( ret != -DBGP_TIMEOUT )
+            break;
+        udelay(1);
+    } while ( --loop );
+
+    if ( !ppid && !loop )
+        dbgp->state = dbgp_unsafe;
+
+    return ret;
+}
+
+static inline void dbgp_mdelay(unsigned int ms)
+{
+    while ( ms-- )
+    {
+        unsigned int i;
+
+        for ( i = 0; i < 1000; i++ )
+            outb(0x1, 0x80);
+    }
+}
+
+static void dbgp_breathe(void)
+{
+    /* Sleep to give the debug port a chance to breathe. */
+    dbgp_mdelay(1);
+}
+
+static int dbgp_wait_until_done(struct ehci_dbgp *dbgp, u32 ctrl,
+                                unsigned int loop)
+{
+    int ret;
+
+    dbgp->timeout = 0;
+
+    for ( ; ; writel(ctrl | DBGP_GO, &dbgp->ehci_debug->control) )
+    {
+        u8 pid;
+
+        ret = dbgp_wait_until_complete(dbgp, &pid);
+        if ( ret < 0 )
+        {
+            /*
+             * A -DBGP_TIMEOUT failure here means the device has failed,
+             * perhaps because it was unplugged, in which case we do not
+             * want to hang the system so the dbgp will be marked as unsafe
+             * to use. EHCI reset is the only way to recover if you unplug
+             * the dbgp device.
+             */
+            if ( ret == -DBGP_TIMEOUT )
+                dbgp->state = dbgp_unsafe;
+            if ( ret != -DBGP_ERR_BAD || !--loop )
+                break;
+        }
+        else
+        {
+            /*
+             * If the port is getting full or it has dropped data
+             * start pacing ourselves, not necessary but it's friendly.
+             */
+            if ( pid == USB_PID_NAK || pid == USB_PID_NYET )
+                dbgp_breathe();
+
+            /* If we got a NACK, reissue the transmission. */
+            if ( pid != USB_PID_NAK || !--loop )
+                break;
+        }
+    }
+
+    return ret;
+}
+
+static int dbgp_bulk_write(struct ehci_dbgp *dbgp,
+                           unsigned int devnum, unsigned int endpoint,
+                           const void *bytes, unsigned int size, u32 *pctrl)
+{
+    u32 addr, pids, ctrl;
+
+    if ( size > DBGP_MAX_PACKET )
+        return -EINVAL;
+
+    addr = DBGP_EPADDR(devnum, endpoint);
+    pids = dbgp_pid_write_update(readl(&dbgp->ehci_debug->pids), USB_PID_OUT);
+    ctrl = dbgp_len_update(readl(&dbgp->ehci_debug->control), size);
+    if ( pctrl )
+        *pctrl = ctrl;
+
+    dbgp_set_data(dbgp->ehci_debug, bytes, size);
+    writel(addr, &dbgp->ehci_debug->address);
+    writel(pids, &dbgp->ehci_debug->pids);
+    dbgp_issue_command(dbgp, ctrl, dbgp_out);
+
+    return 0;
+}
+
+static int dbgp_bulk_read(struct ehci_dbgp *dbgp,
+                          unsigned int devnum, unsigned int endpoint,
+                          unsigned int size, u32 *pctrl)
+{
+    u32 addr, pids, ctrl;
+
+    if ( size > DBGP_MAX_PACKET )
+        return -EINVAL;
+
+    addr = DBGP_EPADDR(devnum, endpoint);
+    pids = dbgp_pid_read_update(readl(&dbgp->ehci_debug->pids), USB_PID_IN);
+    ctrl = readl(&dbgp->ehci_debug->control) & ~DBGP_OUT;
+
+    writel(addr, &dbgp->ehci_debug->address);
+    writel(pids, &dbgp->ehci_debug->pids);
+    if ( likely(!pctrl) )
+        dbgp_issue_command(dbgp, ctrl, dbgp_in);
+    else
+        dbgp_issue_command(dbgp, *pctrl = ctrl, dbgp_ctrl);
+
+    return 0;
+}
+
+static int dbgp_control_msg(struct ehci_dbgp *dbgp, unsigned int devnum,
+                            int requesttype, int request, int value,
+                            int index, void *data, unsigned int size)
+{
+    u32 addr, pids, ctrl;
+    struct usb_ctrlrequest req;
+    bool_t read = (requesttype & USB_DIR_IN) != 0;
+    int ret;
+
+    if ( size > (read ? DBGP_MAX_PACKET : 0) )
+        return -EINVAL;
+
+    /* Compute the control message */
+    req.bRequestType = requesttype;
+    req.bRequest = request;
+    req.wValue = cpu_to_le16(value);
+    req.wIndex = cpu_to_le16(index);
+    req.wLength = cpu_to_le16(size);
+
+    pids = DBGP_PID_SET(USB_PID_DATA0, USB_PID_SETUP);
+    addr = DBGP_EPADDR(devnum, 0);
+    ctrl = dbgp_len_update(readl(&dbgp->ehci_debug->control), sizeof(req));
+
+    /* Send the setup message */
+    dbgp_set_data(dbgp->ehci_debug, &req, sizeof(req));
+    writel(addr, &dbgp->ehci_debug->address);
+    writel(pids, &dbgp->ehci_debug->pids);
+    dbgp_issue_command(dbgp, ctrl, dbgp_ctrl);
+    ret = dbgp_wait_until_done(dbgp, ctrl, DBGP_LOOPS);
+    if ( ret < 0 )
+        return ret;
+
+    /* Read the result */
+    ret = dbgp_bulk_read(dbgp, devnum, 0, size, &ctrl);
+    if ( !ret )
+        ret = dbgp_wait_until_done(dbgp, ctrl, DBGP_LOOPS);
+    if ( ret > 0 )
+    {
+        if ( size > ret )
+            size = ret;
+        dbgp_get_data(dbgp->ehci_debug, data, size);
+    }
+
+    return ret;
+}
+
+static unsigned int __init __find_dbgp(u8 bus, u8 slot, u8 func)
+{
+    u32 class = pci_conf_read32(0, bus, slot, func, PCI_CLASS_REVISION);
+
+    if ( (class >> 8) != PCI_CLASS_SERIAL_USB_EHCI )
+        return 0;
+
+    return pci_find_cap_offset(0, bus, slot, func, PCI_CAP_ID_EHCI_DEBUG);
+}
+
+static unsigned int __init find_dbgp(struct ehci_dbgp *dbgp,
+                                     unsigned int ehci_num)
+{
+    unsigned int bus, slot, func;
+
+    for ( bus = 0; bus < 256; bus++ )
+    {
+        for ( slot = 0; slot < 32; slot++ )
+        {
+            for ( func = 0; func < 8; func++ )
+            {
+                unsigned int cap;
+
+                if ( !pci_device_detect(0, bus, slot, func) )
+                {
+                    if ( !func )
+                        break;
+                    continue;
+                }
+
+                cap = __find_dbgp(bus, slot, func);
+                if ( !cap || ehci_num-- )
+                {
+                    if ( !func && !(pci_conf_read8(0, bus, slot, func,
+                                                   PCI_HEADER_TYPE) & 0x80) )
+                        break;
+                    continue;
+                }
+
+                dbgp->bus = bus;
+                dbgp->slot = slot;
+                dbgp->func = func;
+                return cap;
+            }
+        }
+    }
+
+    return 0;
+}
+
+static int ehci_dbgp_startup(struct ehci_dbgp *dbgp)
+{
+    u32 ctrl, cmd, status;
+    unsigned int loop;
+
+    /* Claim ownership, but do not enable yet */
+    ctrl = readl(&dbgp->ehci_debug->control);
+    ctrl |= DBGP_OWNER;
+    ctrl &= ~(DBGP_ENABLED | DBGP_INUSE);
+    writel(ctrl, &dbgp->ehci_debug->control);
+    udelay(1);
+
+    ehci_dbgp_status(dbgp, "EHCI startup");
+    /* Start the EHCI. */
+    cmd = readl(&dbgp->ehci_regs->command);
+    cmd &= ~(CMD_LRESET | CMD_IAAD | CMD_PSE | CMD_ASE | CMD_RESET);
+    cmd |= CMD_RUN;
+    writel(cmd, &dbgp->ehci_regs->command);
+
+    /* Ensure everything is routed to the EHCI */
+    writel(FLAG_CF, &dbgp->ehci_regs->configured_flag);
+
+    /* Wait until the controller is no longer halted. */
+    loop = 1000;
+    do {
+        status = readl(&dbgp->ehci_regs->status);
+        if ( !(status & STS_HALT) )
+            break;
+        udelay(1);
+    } while ( --loop );
+
+    if ( !loop )
+    {
+        dbgp_printk("EHCI cannot be started\n");
+        return -ENODEV;
+    }
+    dbgp_printk("EHCI started\n");
+
+    return 0;
+}
+
+static int ehci_dbgp_controller_reset(struct ehci_dbgp *dbgp)
+{
+    unsigned int loop = 250 * 1000;
+    u32 cmd;
+
+    /* Reset the EHCI controller */
+    cmd = readl(&dbgp->ehci_regs->command);
+    cmd |= CMD_RESET;
+    writel(cmd, &dbgp->ehci_regs->command);
+    do {
+        cmd = readl(&dbgp->ehci_regs->command);
+    } while ( (cmd & CMD_RESET) && --loop );
+
+    if ( !loop )
+    {
+        dbgp_printk("cannot reset EHCI\n");
+        return -1;
+    }
+    ehci_dbgp_status(dbgp, "ehci reset done");
+
+    return 0;
+}
+
+static int ehci_reset_port(struct ehci_dbgp *dbgp, unsigned int port)
+{
+    u32 portsc, delay_time, delay;
+
+    ehci_dbgp_status(dbgp, "reset port");
+    /* Reset the USB debug port. */
+    portsc = readl(&dbgp->ehci_regs->port_status[port - 1]);
+    portsc &= ~PORT_PE;
+    portsc |= PORT_RESET;
+    writel(portsc, &dbgp->ehci_regs->port_status[port - 1]);
+
+    delay = HUB_ROOT_RESET_TIME;
+    for ( delay_time = 0; delay_time < HUB_RESET_TIMEOUT;
+          delay_time += delay )
+    {
+        dbgp_mdelay(delay);
+        portsc = readl(&dbgp->ehci_regs->port_status[port - 1]);
+        if (!(portsc & PORT_RESET))
+            break;
+    }
+
+    if ( portsc & PORT_RESET )
+    {
+        /* force reset to complete */
+        unsigned int loop = 100 * 1000;
+
+        writel(portsc & ~(PORT_RWC_BITS | PORT_RESET),
+               &dbgp->ehci_regs->port_status[port - 1]);
+        do {
+            udelay(1);
+            portsc = readl(&dbgp->ehci_regs->port_status[port-1]);
+        } while ( (portsc & PORT_RESET) && --loop );
+    }
+
+    /* Device went away? */
+    if ( !(portsc & PORT_CONNECT) )
+        return -ENOTCONN;
+
+    /* bomb out completely if something weird happened */
+    if ( portsc & PORT_CSC )
+        return -EINVAL;
+
+    /* If we've finished resetting, then break out of the loop */
+    if ( !(portsc & PORT_RESET) && (portsc & PORT_PE) )
+        return 0;
+
+    return -EBUSY;
+}
+
+static int ehci_wait_for_port(struct ehci_dbgp *dbgp, unsigned int port)
+{
+    u32 status;
+    unsigned int reps;
+
+    for ( reps = 0; reps < 300; reps++ )
+    {
+        status = readl(&dbgp->ehci_regs->status);
+        if ( status & STS_PCD )
+            break;
+        dbgp_mdelay(1);
+    }
+
+    return ehci_reset_port(dbgp, port) == 0 ? 0 : -ENOTCONN;
+}
+
+/* Return 0 on success
+ * Return -ENODEV for any general failure
+ * Return -EIO if wait for port fails
+ */
+static int ehci_dbgp_external_startup(struct ehci_dbgp *dbgp)
+{
+    unsigned int devnum;
+    struct usb_debug_descriptor dbgp_desc;
+    int ret;
+    u32 ctrl, portsc, cmd;
+    unsigned int dbg_port = dbgp->phys_port;
+    unsigned int tries = 3;
+    unsigned int reset_port_tries = 1;
+    bool_t try_hard_once = 1;
+
+try_port_reset_again:
+    ret = ehci_dbgp_startup(dbgp);
+    if ( ret )
+        return ret;
+
+    /* Wait for a device to show up in the debug port */
+    ret = ehci_wait_for_port(dbgp, dbg_port);
+    if ( ret < 0 )
+    {
+        portsc = readl(&dbgp->ehci_regs->port_status[dbg_port - 1]);
+        if ( !(portsc & PORT_CONNECT) && try_hard_once )
+        {
+            /*
+             * Last ditch effort to try to force enable the debug device by
+             * using the packet test EHCI command to try and wake it up.
+             */
+            try_hard_once = 0;
+            cmd = readl(&dbgp->ehci_regs->command);
+            cmd &= ~CMD_RUN;
+            writel(cmd, &dbgp->ehci_regs->command);
+            portsc = readl(&dbgp->ehci_regs->port_status[dbg_port - 1]);
+            portsc |= PORT_TEST_PKT;
+            writel(portsc, &dbgp->ehci_regs->port_status[dbg_port - 1]);
+            ehci_dbgp_status(dbgp, "Trying to force debug port online");
+            mdelay(50);
+            ehci_dbgp_controller_reset(dbgp);
+            goto try_port_reset_again;
+        }
+        else if ( reset_port_tries-- )
+            goto try_port_reset_again;
+        dbgp_printk("no device found in debug port\n");
+        return -EIO;
+    }
+    ehci_dbgp_status(dbgp, "wait for port done");
+
+    /* Enable the debug port */
+    ctrl = readl(&dbgp->ehci_debug->control);
+    ctrl |= DBGP_CLAIM;
+    writel(ctrl, &dbgp->ehci_debug->control);
+    ctrl = readl(&dbgp->ehci_debug->control);
+    if ( (ctrl & DBGP_CLAIM) != DBGP_CLAIM )
+    {
+        dbgp_printk("no device in debug port\n");
+        writel(ctrl & ~DBGP_CLAIM, &dbgp->ehci_debug->control);
+        return -ENODEV;
+    }
+    ehci_dbgp_status(dbgp, "debug port enabled");
+
+    /* Completely transfer the debug device to the debug controller */
+    portsc = readl(&dbgp->ehci_regs->port_status[dbg_port - 1]);
+    portsc &= ~PORT_PE;
+    writel(portsc, &dbgp->ehci_regs->port_status[dbg_port - 1]);
+
+    dbgp_mdelay(100);
+
+try_again:
+    /* Find the debug device and make it device number 127 */
+    for ( devnum = 0; devnum <= 127; devnum++ )
+    {
+        ret = dbgp_control_msg(dbgp, devnum,
+                               USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_DEVICE,
+                               USB_REQ_GET_DESCRIPTOR, (USB_DT_DEBUG << 8), 0,
+                               &dbgp_desc, sizeof(dbgp_desc));
+        if ( ret > 0 )
+            break;
+    }
+    if ( devnum > 127 )
+    {
+        dbgp_printk("could not find attached debug device\n");
+        goto err;
+    }
+    if ( ret < 0 )
+    {
+        dbgp_printk("attached device is not a debug device\n");
+        goto err;
+    }
+    dbgp->out.endpoint = dbgp_desc.bDebugOutEndpoint;
+    dbgp->in.endpoint = dbgp_desc.bDebugInEndpoint;
+
+    /* Move the device to 127 if it isn't already there. */
+    if ( devnum != USB_DEBUG_DEVNUM )
+    {
+        ret = dbgp_control_msg(dbgp, devnum,
+                               USB_DIR_OUT | USB_TYPE_STANDARD | USB_RECIP_DEVICE,
+                               USB_REQ_SET_ADDRESS, USB_DEBUG_DEVNUM, 0, NULL, 0);
+        if ( ret < 0 )
+        {
+            dbgp_printk("could not move attached device to %d\n",
+                        USB_DEBUG_DEVNUM);
+            goto err;
+        }
+        devnum = USB_DEBUG_DEVNUM;
+        dbgp_printk("debug device renamed to 127\n");
+    }
+
+    /* Enable the debug interface */
+    ret = dbgp_control_msg(dbgp, USB_DEBUG_DEVNUM,
+                           USB_DIR_OUT | USB_TYPE_STANDARD | USB_RECIP_DEVICE,
+                           USB_REQ_SET_FEATURE, USB_DEVICE_DEBUG_MODE,
+                           0, NULL, 0);
+    if ( ret < 0 )
+    {
+        dbgp_printk("could not enable the debug device\n");
+        goto err;
+    }
+    dbgp_printk("debug interface enabled\n");
+
+    /* Perform a small write to get the even/odd data state in sync. */
+    ret = dbgp_bulk_write(dbgp, USB_DEBUG_DEVNUM, dbgp->out.endpoint,
+                          "\n", 1, &ctrl);
+    if ( !ret )
+        ret = dbgp_wait_until_done(dbgp, ctrl, DBGP_LOOPS);
+    if ( ret < 0 )
+    {
+        dbgp_printk("dbgp_bulk_write failed: %d\n", ret);
+        goto err;
+    }
+    dbgp_printk("small write done\n");
+    dbgp->state = dbgp_idle;
+
+    return 0;
+err:
+    if ( tries-- )
+        goto try_again;
+    return -ENODEV;
+}
+
+typedef void (*set_debug_port_t)(struct ehci_dbgp *, unsigned int);
+
+static void default_set_debug_port(struct ehci_dbgp *dbgp, unsigned int port)
+{
+}
+
+static set_debug_port_t __read_mostly set_debug_port = default_set_debug_port;
+
+static void nvidia_set_debug_port(struct ehci_dbgp *dbgp, unsigned int port)
+{
+    u32 dword = pci_conf_read32(0, dbgp->bus, dbgp->slot, dbgp->func, 0x74);
+
+    dword &= ~(0x0f << 12);
+    dword |= (port & 0x0f) << 12;
+    pci_conf_write32(0, dbgp->bus, dbgp->slot, dbgp->func, 0x74, dword);
+    dbgp_printk("set debug port to %u\n", port);
+}
+
+static void __init detect_set_debug_port(struct ehci_dbgp *dbgp)
+{
+    if ( pci_conf_read16(0, dbgp->bus, dbgp->slot, dbgp->func,
+                         PCI_VENDOR_ID) == 0x10de )
+    {
+        dbgp_printk("using nvidia set_debug_port\n");
+        set_debug_port = nvidia_set_debug_port;
+    }
+}
+
+/*
+ * The code in ehci_dbgp_bios_handoff() is derived from the USB PCI
+ * quirk initialization in Linux.
+ */
+#define EHCI_USBLEGSUP_BIOS    (1 << 16) /* BIOS semaphore */
+#define EHCI_USBLEGCTLSTS      4        /* legacy control/status */
+static void ehci_dbgp_bios_handoff(struct ehci_dbgp *dbgp, u32 hcc_params)
+{
+    u32 cap;
+    unsigned int offset = HCC_EXT_CAPS(hcc_params);
+    int msec;
+
+    if ( !offset )
+        return;
+
+    cap = pci_conf_read32(0, dbgp->bus, dbgp->slot, dbgp->func, offset);
+    dbgp_printk("dbgp: EHCI BIOS state %08x\n", cap);
+
+    if ( (cap & 0xff) == 1 && (cap & EHCI_USBLEGSUP_BIOS) )
+    {
+        dbgp_printk("dbgp: BIOS handoff\n");
+        pci_conf_write8(0, dbgp->bus, dbgp->slot, dbgp->func, offset + 3, 1);
+    }
+
+    /* if boot firmware now owns EHCI, spin till it hands it over. */
+    msec = 1000;
+    while ( (cap & EHCI_USBLEGSUP_BIOS) && (msec > 0) )
+    {
+        mdelay(10);
+        msec -= 10;
+        cap = pci_conf_read32(0, dbgp->bus, dbgp->slot, dbgp->func, offset);
+    }
+
+    if ( cap & EHCI_USBLEGSUP_BIOS )
+    {
+        /* well, possibly buggy BIOS... try to shut it down,
+         * and hope nothing goes too wrong */
+        dbgp_printk("dbgp: BIOS handoff failed: %08x\n", cap);
+        pci_conf_write8(0, dbgp->bus, dbgp->slot, dbgp->func, offset + 2, 0);
+    }
+
+    /* just in case, always disable EHCI SMIs */
+    pci_conf_write8(0, dbgp->bus, dbgp->slot, dbgp->func,
+                    offset + EHCI_USBLEGCTLSTS, 0);
+}
+
+static int ehci_dbgp_setup(struct ehci_dbgp *dbgp)
+{
+    u32 ctrl, portsc, hcs_params;
+    unsigned int i, debug_port, new_debug_port = 0, n_ports;
+    unsigned int port_map_tried, playtimes = 3;
+    int ret;
+
+    ehci_dbgp_bios_handoff(dbgp, readl(&dbgp->ehci_caps->hcc_params));
+
+try_next_time:
+    port_map_tried = 0;
+
+try_next_port:
+
+    hcs_params = readl(&dbgp->ehci_caps->hcs_params);
+    debug_port = HCS_DEBUG_PORT(hcs_params);
+    dbgp->phys_port = debug_port;
+    n_ports = HCS_N_PORTS(hcs_params);
+
+    dbgp_printk("debug_port: %u\n", debug_port);
+    dbgp_printk("n_ports:    %u\n", n_ports);
+    ehci_dbgp_status(dbgp, "");
+
+    for ( i = 1; i <= n_ports; i++ )
+    {
+        portsc = readl(&dbgp->ehci_regs->port_status[i-1]);
+        dbgp_printk("portstatus%d: %08x\n", i, portsc);
+    }
+
+    if ( port_map_tried && (new_debug_port != debug_port) )
+    {
+        if ( --playtimes )
+        {
+            set_debug_port(dbgp, new_debug_port);
+            goto try_next_time;
+        }
+        return -1;
+    }
+
+    /* Only reset the controller if it is not already in the
+     * configured state */
+    if ( readl(&dbgp->ehci_regs->configured_flag) & FLAG_CF )
+        ehci_dbgp_status(dbgp, "ehci skip - already configured");
+    else if ( ehci_dbgp_controller_reset(dbgp) != 0 )
+        return -1;
+
+    ret = ehci_dbgp_external_startup(dbgp);
+    if (ret == -EIO)
+        goto next_debug_port;
+
+    if ( ret < 0 )
+    {
+        /* Things didn't work so remove my claim */
+        ctrl = readl(&dbgp->ehci_debug->control);
+        ctrl &= ~(DBGP_CLAIM | DBGP_OUT);
+        writel(ctrl, &dbgp->ehci_debug->control);
+        return -1;
+    }
+
+    return 0;
+
+next_debug_port:
+    port_map_tried |= 1 << (debug_port - 1);
+    new_debug_port = (debug_port % n_ports) + 1;
+    if ( port_map_tried != ((1 << n_ports) - 1) )
+    {
+        set_debug_port(dbgp, new_debug_port);
+        goto try_next_port;
+    }
+    if ( --playtimes )
+    {
+        set_debug_port(dbgp, new_debug_port);
+        goto try_next_time;
+    }
+
+    return -1;
+}
+
+static inline void _ehci_dbgp_flush(struct ehci_dbgp *dbgp)
+{
+    if ( dbgp_bulk_write(dbgp, USB_DEBUG_DEVNUM, dbgp->out.endpoint,
+                         dbgp->out.buf, dbgp->out.chunk, NULL) )
+        BUG();
+    dbgp->out.chunk = 0;
+}
+
+static void ehci_dbgp_flush(struct serial_port *port)
+{
+    struct ehci_dbgp *dbgp = port->uart;
+    s_time_t goal;
+
+    if ( !dbgp->out.chunk || !dbgp->ehci_debug || dbgp->state == dbgp_unsafe )
+        return;
+
+    if ( dbgp->state == dbgp_idle || !port->sync )
+        dbgp_check_for_completion(dbgp, 1, NULL);
+    else
+        dbgp_wait_until_complete(dbgp, NULL);
+
+    if ( dbgp->state == dbgp_idle )
+    {
+        _ehci_dbgp_flush(dbgp);
+
+        if ( port->sync )
+        {
+            dbgp_wait_until_complete(dbgp, NULL);
+            return;
+        }
+    }
+
+    goal = NOW() + MICROSECS(DBGP_CHECK_INTERVAL);
+    if ( dbgp->timer.expires > goal )
+       set_timer(&dbgp->timer, goal);
+}
+
+static void ehci_dbgp_putc(struct serial_port *port, char c)
+{
+    struct ehci_dbgp *dbgp = port->uart;
+
+    if ( unlikely(dbgp->out.chunk >= DBGP_MAX_PACKET) )
+        return;
+
+    dbgp->out.buf[dbgp->out.chunk++] = c;
+
+    if ( dbgp->out.chunk == DBGP_MAX_PACKET )
+        ehci_dbgp_flush(port);
+}
+
+static int ehci_dbgp_tx_empty(struct serial_port *port)
+{
+    struct ehci_dbgp *dbgp = port->uart;
+
+    if ( unlikely(!dbgp->ehci_debug) || unlikely(dbgp->state == dbgp_unsafe) )
+        return port->sync || port->tx_log_everything || !port->txbuf;
+
+    if ( dbgp->out.chunk == DBGP_MAX_PACKET )
+        ehci_dbgp_flush(port);
+    else
+        dbgp_check_for_completion(dbgp, 1, NULL);
+
+    if ( dbgp->state != dbgp_idle && dbgp->out.chunk >= DBGP_MAX_PACKET )
+        return 0;
+
+    port->tx_fifo_size = DBGP_MAX_PACKET - dbgp->out.chunk;
+    if ( dbgp->state == dbgp_idle )
+        port->tx_fifo_size += DBGP_MAX_PACKET;
+
+    return 1;
+}
+
+static int ehci_dbgp_getc(struct serial_port *port, char *pc)
+{
+    struct ehci_dbgp *dbgp = port->uart;
+
+    if ( !dbgp->in.chunk )
+        return 0;
+
+    *pc = *dbgp->in.buf;
+    if ( --dbgp->in.chunk )
+        memmove(dbgp->in.buf, dbgp->in.buf + 1, dbgp->in.chunk);
+
+    return 1;
+}
+
+/* Safe: ehci_dbgp_poll() runs as timer handler, so not reentrant. */
+static struct serial_port *poll_port;
+
+static void _ehci_dbgp_poll(struct cpu_user_regs *regs)
+{
+    struct serial_port *port = poll_port;
+    struct ehci_dbgp *dbgp = port->uart;
+    unsigned long flags;
+    unsigned int timeout = MICROSECS(DBGP_CHECK_INTERVAL);
+    bool_t empty = 0;
+
+    if ( !dbgp->ehci_debug )
+        return;
+
+    if ( spin_trylock_irqsave(&port->tx_lock, flags) )
+    {
+        if ( dbgp->state != dbgp_unsafe )
+            dbgp_check_for_completion(dbgp, DBGP_CHECK_INTERVAL, NULL);
+        if ( dbgp->state == dbgp_idle && dbgp->out.chunk )
+            _ehci_dbgp_flush(dbgp);
+        if ( dbgp->state == dbgp_idle || dbgp->out.chunk < DBGP_MAX_PACKET )
+            empty = 1;
+        spin_unlock_irqrestore(&port->tx_lock, flags);
+    }
+
+    if ( dbgp->in.chunk )
+        serial_rx_interrupt(port, regs);
+
+    if ( empty )
+        serial_tx_interrupt(port, regs);
+
+    if ( spin_trylock_irqsave(&port->tx_lock, flags) )
+    {
+        if ( dbgp->state == dbgp_idle && !dbgp->in.chunk &&
+             !dbgp->out.chunk && port->txbufp == port->txbufc )
+        {
+            if ( dbgp_bulk_read(dbgp, USB_DEBUG_DEVNUM, dbgp->in.endpoint,
+                                DBGP_MAX_PACKET, NULL) )
+                BUG();
+            timeout = MILLISECS(DBGP_IDLE_INTERVAL);
+        }
+        spin_unlock_irqrestore(&port->tx_lock, flags);
+    }
+
+    set_timer(&dbgp->timer, NOW() + timeout);
+}
+
+static void ehci_dbgp_poll(void *data)
+{
+    poll_port = data;
+#ifdef run_in_exception_handler
+    run_in_exception_handler(_ehci_dbgp_poll);
+#else
+    _ehci_dbgp_poll(guest_cpu_user_regs());
+#endif
+}
+
+static bool_t ehci_dbgp_setup_preirq(struct ehci_dbgp *dbgp)
+{
+    if ( !ehci_dbgp_setup(dbgp) )
+        return 1;
+
+    dbgp_printk("ehci_dbgp_setup failed\n");
+    dbgp->ehci_debug = NULL;
+    return 0;
+}
+
+static void __init ehci_dbgp_init_preirq(struct serial_port *port)
+{
+    struct ehci_dbgp *dbgp = port->uart;
+    u32 debug_port, offset;
+    void __iomem *ehci_bar;
+
+    debug_port = pci_conf_read32(0, dbgp->bus, dbgp->slot, dbgp->func,
+                                 dbgp->cap);
+    offset = (debug_port >> 16) & 0xfff;
+
+    /* double check if the mem space is enabled */
+    dbgp->pci_cr = pci_conf_read8(0, dbgp->bus, dbgp->slot, dbgp->func,
+                                  PCI_COMMAND);
+    if ( !(dbgp->pci_cr & PCI_COMMAND_MEMORY) )
+    {
+        dbgp->pci_cr |= PCI_COMMAND_MEMORY;
+        pci_conf_write16(0, dbgp->bus, dbgp->slot, dbgp->func, PCI_COMMAND,
+                         dbgp->pci_cr);
+        dbgp_printk("MMIO for EHCI enabled\n");
+    }
+
+    /*
+     * FIXME I don't have the bar size so just guess PAGE_SIZE is more
+     * than enough.  1k is the biggest that was seen.
+     */
+    set_fixmap_nocache(FIX_EHCI_DBGP, dbgp->bar_val);
+    ehci_bar = (void __iomem *)fix_to_virt(FIX_EHCI_DBGP);
+    ehci_bar += dbgp->bar_val & ~PAGE_MASK;
+    dbgp_printk("ehci_bar: %p\n", ehci_bar);
+
+    dbgp->ehci_caps = ehci_bar;
+    dbgp->ehci_regs = ehci_bar +
+                      HC_LENGTH(readl(&dbgp->ehci_caps->hc_capbase));
+    dbgp->ehci_debug = ehci_bar + offset;
+
+    detect_set_debug_port(dbgp);
+
+    if ( ehci_dbgp_setup_preirq(dbgp) )
+        ehci_dbgp_status(dbgp, "ehci_dbgp_init_preirq complete");
+
+    port->tx_fifo_size = DBGP_MAX_PACKET;
+    dbgp->lock = &port->tx_lock;
+}
+
+static void ehci_dbgp_setup_postirq(struct ehci_dbgp *dbgp)
+{
+    set_timer(&dbgp->timer, NOW() + MILLISECS(1));
+}
+
+static void __init ehci_dbgp_init_postirq(struct serial_port *port)
+{
+    struct ehci_dbgp *dbgp = port->uart;
+
+    if ( !dbgp->ehci_debug )
+        return;
+
+    serial_async_transmit(port);
+
+    init_timer(&dbgp->timer, ehci_dbgp_poll, port, 0);
+
+    ehci_dbgp_setup_postirq(dbgp);
+}
+
+static int ehci_dbgp_check_release(struct ehci_dbgp *dbgp)
+{
+    struct ehci_dbg_port __iomem *ehci_debug = dbgp->ehci_debug;
+    u32 ctrl;
+    unsigned int i;
+
+    if ( !ehci_debug )
+        return 0;
+
+    for ( i = 0; i < DBGP_MAX_PACKET; ++i )
+        if ( dbgp->out.buf[i] )
+            return 1;
+
+    /*
+     * This means the console is not initialized, or should get shutdown
+     * so as to allow for reuse of the USB device, which means it is time
+     * to shutdown the USB debug port.
+     */
+    printk(XENLOG_INFO "Releasing EHCI debug port at %02x:%02x.%u\n",
+           dbgp->bus, dbgp->slot, dbgp->func);
+
+    kill_timer(&dbgp->timer);
+    dbgp->ehci_debug = NULL;
+
+    ctrl = readl(&ehci_debug->control);
+    if ( ctrl & DBGP_ENABLED )
+    {
+        ctrl &= ~DBGP_CLAIM;
+        writel(ctrl, &ehci_debug->control);
+    }
+
+    return 0;
+}
+
+static void __init ehci_dbgp_endboot(struct serial_port *port)
+{
+    ehci_dbgp_check_release(port->uart);
+}
+
+static void ehci_dbgp_suspend(struct serial_port *port)
+{
+    struct ehci_dbgp *dbgp = port->uart;
+
+    if ( !dbgp->ehci_debug )
+        return;
+
+    stop_timer(&dbgp->timer);
+    dbgp->timer.expires = 0;
+
+    dbgp->pci_cr = pci_conf_read16(0, dbgp->bus, dbgp->slot, dbgp->func,
+                                   PCI_COMMAND);
+
+    dbgp->state = dbgp_unsafe;
+}
+
+static void ehci_dbgp_resume(struct serial_port *port)
+{
+    struct ehci_dbgp *dbgp = port->uart;
+
+    if ( !dbgp->ehci_debug )
+        return;
+
+    pci_conf_write32(0, dbgp->bus, dbgp->slot, dbgp->func, dbgp->bar,
+                     dbgp->bar_val);
+    pci_conf_write16(0, dbgp->bus, dbgp->slot, dbgp->func,
+                     PCI_COMMAND, dbgp->pci_cr);
+
+    ehci_dbgp_setup_preirq(dbgp);
+    ehci_dbgp_setup_postirq(dbgp);
+}
+
+static struct uart_driver __read_mostly ehci_dbgp_driver = {
+    .init_preirq  = ehci_dbgp_init_preirq,
+    .init_postirq = ehci_dbgp_init_postirq,
+    .endboot      = ehci_dbgp_endboot,
+    .suspend      = ehci_dbgp_suspend,
+    .resume       = ehci_dbgp_resume,
+    .tx_empty     = ehci_dbgp_tx_empty,
+    .putc         = ehci_dbgp_putc,
+    .flush        = ehci_dbgp_flush,
+    .getc         = ehci_dbgp_getc
+};
+
+static struct ehci_dbgp ehci_dbgp = { .state = dbgp_unsafe, .phys_port = 1 };
+
+static char __initdata opt_dbgp[30];
+string_param("dbgp", opt_dbgp);
+
+void __init ehci_dbgp_init(void)
+{
+    struct ehci_dbgp *dbgp = &ehci_dbgp;
+    u32 debug_port, offset, bar_val;
+    const char *e;
+
+    if ( strncmp(opt_dbgp, "ehci", 4) )
+        return;
+
+    if ( isdigit(opt_dbgp[4]) || !opt_dbgp[4] )
+    {
+        unsigned int num = 0;
+
+        if ( opt_dbgp[4] )
+            simple_strtoul(opt_dbgp + 4, &e, 10);
+
+        dbgp->cap = find_dbgp(dbgp, num);
+        if ( !dbgp->cap )
+            return;
+
+        dbgp_printk("Found EHCI debug port on %02x:%02x.%u\n",
+                    dbgp->bus, dbgp->slot, dbgp->func);
+    }
+    else if ( strncmp(opt_dbgp + 4, "@pci", 4) == 0 )
+    {
+        unsigned long val = simple_strtoul(opt_dbgp + 8, &e, 16);
+
+        dbgp->bus = val;
+        if ( dbgp->bus != val || *e != ':' )
+            return;
+
+        val = simple_strtoul(e + 1, &e, 16);
+        if ( PCI_SLOT(PCI_DEVFN(val, 0)) != val || *e != '.' )
+            return;
+        dbgp->slot = val;
+
+        val = simple_strtoul(e + 1, &e, 16);
+        if ( PCI_FUNC(PCI_DEVFN(0, val)) != val || *e )
+            return;
+        dbgp->func = val;
+
+        if ( !pci_device_detect(0, dbgp->bus, dbgp->slot, dbgp->func) )
+            return;
+
+        dbgp->cap = __find_dbgp(dbgp->bus, dbgp->slot, dbgp->func);
+        if ( !dbgp->cap )
+            return;
+
+        dbgp_printk("Using EHCI debug port on %02x:%02x.%u\n",
+                    dbgp->bus, dbgp->slot, dbgp->func);
+    }
+    else
+        return;
+
+    debug_port = pci_conf_read32(0, dbgp->bus, dbgp->slot, dbgp->func,
+                                 dbgp->cap);
+    dbgp->bar = (debug_port >> 29) & 0x7;
+    dbgp->bar = ((dbgp->bar - 1) * 4) + PCI_BASE_ADDRESS_0;
+    offset = (debug_port >> 16) & 0xfff;
+    dbgp_printk("bar: %02x offset: %03x\n", dbgp->bar, offset);
+    if ( dbgp->bar < PCI_BASE_ADDRESS_0 || dbgp->bar > PCI_BASE_ADDRESS_5 )
+    {
+        dbgp_printk("unsupported/invalid bar\n");
+        return;
+    }
+
+    dbgp->bar_val = bar_val = pci_conf_read32(0, dbgp->bus, dbgp->slot,
+                                              dbgp->func, dbgp->bar);
+    dbgp_printk("bar_val: %08x\n", bar_val);
+    if ( bar_val & ~PCI_BASE_ADDRESS_MEM_MASK )
+    {
+        dbgp_printk("only simple 32-bit MMIO BARs supported\n");
+        return;
+    }
+    bar_val &= PCI_BASE_ADDRESS_MEM_MASK;
+    if ( !bar_val || !(bar_val + (bar_val & -bar_val)) )
+    {
+        dbgp_printk("firmware initialization of MMIO BAR required\n");
+        return;
+    }
+
+    serial_register_uart(SERHND_DBGP, &ehci_dbgp_driver, dbgp);
+}
+
+int dbgp_op(const struct physdev_dbgp_op *op)
+{
+    if ( !ehci_dbgp.ehci_debug )
+        return 0;
+
+    switch ( op->bus )
+    {
+    case PHYSDEVOP_DBGP_BUS_UNKNOWN:
+        break;
+    case PHYSDEVOP_DBGP_BUS_PCI:
+        if ( op->u.pci.seg || ehci_dbgp.bus != op->u.pci.bus ||
+            PCI_DEVFN(ehci_dbgp.slot, ehci_dbgp.func) != op->u.pci.devfn )
+    default:
+            return 0;
+        break;
+    }
+
+    switch ( op->op )
+    {
+    case PHYSDEVOP_DBGP_RESET_PREPARE:
+        spin_lock_irq(ehci_dbgp.lock);
+        ehci_dbgp.state = dbgp_unsafe;
+        dbgp_wait_until_complete(&ehci_dbgp, NULL);
+        spin_unlock_irq(ehci_dbgp.lock);
+
+        return ehci_dbgp_check_release(&ehci_dbgp);
+
+    case PHYSDEVOP_DBGP_RESET_DONE:
+        return ehci_dbgp_external_startup(&ehci_dbgp) ?: 1;
+    }
+
+    return -ENOSYS;
+}
diff -r 776a23fa0e93 -r 0d0c55a1975d xen/drivers/char/serial.c
--- a/xen/drivers/char/serial.c	Tue Sep 11 15:47:16 2012 +0200
+++ b/xen/drivers/char/serial.c	Tue Sep 11 15:49:52 2012 +0200
@@ -265,6 +265,14 @@ int __init serial_parse_handle(char *con
 {
     int handle;
 
+    if ( !strncmp(conf, "dbgp", 4) && (!conf[4] || conf[4] == ',') )
+    {
+        if ( !com[SERHND_DBGP].driver )
+            goto fail;
+
+        return SERHND_DBGP | SERHND_COOKED;
+    }
+
     if ( strncmp(conf, "com", 3) )
         goto fail;
 
diff -r 776a23fa0e93 -r 0d0c55a1975d xen/include/asm-x86/fixmap.h
--- a/xen/include/asm-x86/fixmap.h	Tue Sep 11 15:47:16 2012 +0200
+++ b/xen/include/asm-x86/fixmap.h	Tue Sep 11 15:49:52 2012 +0200
@@ -36,7 +36,15 @@
  * from the end of virtual memory backwards.
  */
 enum fixed_addresses {
-    FIX_RESERVED, /* Index 0 is reserved since fix_to_virt(0) > FIXADDR_TOP. */
+    /* Index 0 is reserved since fix_to_virt(0) == FIXADDR_TOP. */
+    FIX_RESERVED,
+    /*
+     * Indexes using the page tables set up before entering __start_xen()
+     * must be among the first (L1_PAGETABLE_ENTRIES - 1) entries.
+     * These are generally those needed by the various console drivers.
+     */
+    FIX_EHCI_DBGP,
+    /* Everything else should go further down. */
 #ifdef __i386__
     FIX_PAE_HIGHMEM_0,
     FIX_PAE_HIGHMEM_END = FIX_PAE_HIGHMEM_0 + NR_CPUS-1,
diff -r 776a23fa0e93 -r 0d0c55a1975d xen/include/public/physdev.h
--- a/xen/include/public/physdev.h	Tue Sep 11 15:47:16 2012 +0200
+++ b/xen/include/public/physdev.h	Tue Sep 11 15:49:52 2012 +0200
@@ -312,6 +312,24 @@ struct physdev_pci_device {
 typedef struct physdev_pci_device physdev_pci_device_t;
 DEFINE_XEN_GUEST_HANDLE(physdev_pci_device_t);
 
+#define PHYSDEVOP_DBGP_RESET_PREPARE    1
+#define PHYSDEVOP_DBGP_RESET_DONE       2
+
+#define PHYSDEVOP_DBGP_BUS_UNKNOWN      0
+#define PHYSDEVOP_DBGP_BUS_PCI          1
+
+#define PHYSDEVOP_dbgp_op               29
+struct physdev_dbgp_op {
+    /* IN */
+    uint8_t op;
+    uint8_t bus;
+    union {
+        struct physdev_pci_device pci;
+    } u;
+};
+typedef struct physdev_dbgp_op physdev_dbgp_op_t;
+DEFINE_XEN_GUEST_HANDLE(physdev_dbgp_op_t);
+
 /*
  * Notify that some PIRQ-bound event channels have been unmasked.
  * ** This command is obsolete since interface version 0x00030202 and is **
diff -r 776a23fa0e93 -r 0d0c55a1975d xen/include/xen/serial.h
--- a/xen/include/xen/serial.h	Tue Sep 11 15:47:16 2012 +0200
+++ b/xen/include/xen/serial.h	Tue Sep 11 15:49:52 2012 +0200
@@ -69,9 +69,10 @@ struct uart_driver {
 };
 
 /* 'Serial handles' are composed from the following fields. */
-#define SERHND_IDX      (3<<0) /* COM1 or COM2?                           */
+#define SERHND_IDX      (3<<0) /* COM1, COM2, or DBGP?                    */
 # define SERHND_COM1    (0<<0)
 # define SERHND_COM2    (1<<0)
+# define SERHND_DBGP    (2<<0)
 #define SERHND_HI       (1<<2) /* Mux/demux each transferred char by MSB. */
 #define SERHND_LO       (1<<3) /* Ditto, except that the MSB is cleared.  */
 #define SERHND_COOKED   (1<<4) /* Newline/carriage-return translation?    */
@@ -142,9 +143,13 @@ struct ns16550_defaults {
     unsigned long io_base; /* default io_base address */
 };
 void ns16550_init(int index, struct ns16550_defaults *defaults);
+void ehci_dbgp_init(void);
 
 void pl011_init(int index, unsigned long register_base_address);
 
+struct physdev_dbgp_op;
+int dbgp_op(const struct physdev_dbgp_op *);
+
 /* Baud rate was pre-configured before invoking the UART driver. */
 #define BAUD_AUTO (-1)
 

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:56:07 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:56:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTZ9-0004Oz-2f; Fri, 14 Sep 2012 10:56:07 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTZ7-0004Lh-58
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:56:05 +0000
Received: from [85.158.143.35:2796] by server-1.bemta-4.messagelabs.com id
	CF/78-12504-44D03505; Fri, 14 Sep 2012 10:56:04 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-21.messagelabs.com!1347620123!10147396!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18154 invoked from network); 14 Sep 2012 10:55:24 -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;
	14 Sep 2012 10: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 1TCTYR-00013w-Eu
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYR-0000kY-DQ
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:23 +0000
Message-Id: <E1TCTYR-0000kY-DQ@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] console: add EHCI debug port based
	serial console
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347371392 -7200
# Node ID 0d0c55a1975db9c6cac2e9259b5ebea7a7bdbaec
# Parent  776a23fa0e938e4cf3307fc2e3b3f1a9488a5927
console: add EHCI debug port based serial console

Low level hardware interface pieces adapted from Linux.

For setup information, see Linux'es Documentation/x86/earlyprintk.txt
and/or http://www.coreboot.org/EHCI_Debug_Port.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 776a23fa0e93 -r 0d0c55a1975d docs/misc/xen-command-line.markdown
--- a/docs/misc/xen-command-line.markdown	Tue Sep 11 15:47:16 2012 +0200
+++ b/docs/misc/xen-command-line.markdown	Tue Sep 11 15:49:52 2012 +0200
@@ -244,7 +244,7 @@ A typical setup for most situations migh
 Specify the size of the console ring buffer.
 
 ### console
-> `= List of [ vga | com1[H,L] | com2[H,L] | none ]`
+> `= List of [ vga | com1[H,L] | com2[H,L] | dbgp | none ]`
 
 > Default: `console=com1,vga`
 
@@ -260,6 +260,8 @@ the converse; transmitted and received c
 cleared.  This allows a single port to be shared by two subsystems
 (e.g. console and debugger).
 
+`dbgp` indicates that Xen should use a USB debug port.
+
 `none` indicates that Xen should not use a console.  This option only
 makes sense on its own.
 
@@ -352,6 +354,12 @@ combination with the `low_crashinfo` com
 ### credit2\_load\_window\_shift
 > `= <integer>`
 
+### dbgp
+> `= ehci[ <integer> | @pci<bus>:<slot>.<func> ]`
+
+Specify the USB controller to use, either by instance number (when going
+over the PCI busses sequentially) or by PCI device (must be on segment 0).
+
 ### debug\_stack\_lines
 > `= <integer>`
 
diff -r 776a23fa0e93 -r 0d0c55a1975d xen/arch/x86/Rules.mk
--- a/xen/arch/x86/Rules.mk	Tue Sep 11 15:47:16 2012 +0200
+++ b/xen/arch/x86/Rules.mk	Tue Sep 11 15:49:52 2012 +0200
@@ -7,6 +7,7 @@ HAS_CPUFREQ := y
 HAS_PCI := y
 HAS_PASSTHROUGH := y
 HAS_NS16550 := y
+HAS_EHCI := y
 HAS_KEXEC := y
 HAS_GDBSX := y
 xenoprof := y
diff -r 776a23fa0e93 -r 0d0c55a1975d xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c	Tue Sep 11 15:47:16 2012 +0200
+++ b/xen/arch/x86/physdev.c	Tue Sep 11 15:49:52 2012 +0200
@@ -8,6 +8,7 @@
 #include <xen/event.h>
 #include <xen/guest_access.h>
 #include <xen/iocap.h>
+#include <xen/serial.h>
 #include <asm/current.h>
 #include <asm/io_apic.h>
 #include <asm/msi.h>
@@ -722,6 +723,19 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
 
         break;
     }
+
+    case PHYSDEVOP_dbgp_op: {
+        struct physdev_dbgp_op op;
+
+        if ( !IS_PRIV(v->domain) )
+            ret = -EPERM;
+        else if ( copy_from_guest(&op, arg, 1) )
+            ret = -EFAULT;
+        else
+            ret = dbgp_op(&op);
+        break;
+    }
+
     default:
         ret = -ENOSYS;
         break;
diff -r 776a23fa0e93 -r 0d0c55a1975d xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c	Tue Sep 11 15:47:16 2012 +0200
+++ b/xen/arch/x86/setup.c	Tue Sep 11 15:49:52 2012 +0200
@@ -606,6 +606,7 @@ void __init __start_xen(unsigned long mb
     ns16550.io_base = 0x2f8;
     ns16550.irq     = 3;
     ns16550_init(1, &ns16550);
+    ehci_dbgp_init();
     console_init_preirq();
 
     printk("Bootloader: %s\n", loader);
diff -r 776a23fa0e93 -r 0d0c55a1975d xen/drivers/char/Makefile
--- a/xen/drivers/char/Makefile	Tue Sep 11 15:47:16 2012 +0200
+++ b/xen/drivers/char/Makefile	Tue Sep 11 15:49:52 2012 +0200
@@ -1,4 +1,5 @@
 obj-y += console.o
 obj-$(HAS_NS16550) += ns16550.o
 obj-$(HAS_PL011) += pl011.o
+obj-$(HAS_EHCI) += ehci-dbgp.o
 obj-y += serial.o
diff -r 776a23fa0e93 -r 0d0c55a1975d xen/drivers/char/ehci-dbgp.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/drivers/char/ehci-dbgp.c	Tue Sep 11 15:49:52 2012 +0200
@@ -0,0 +1,1577 @@
+/*
+ * Standalone EHCI USB debug driver
+ *
+ * Hardware interface code based on the respective early console driver in
+ * Linux; see the Linux source for authorship and copyrights.
+ */
+
+#include <xen/config.h>
+#include <xen/console.h>
+#include <xen/delay.h>
+#include <xen/errno.h>
+#include <xen/pci.h>
+#include <xen/serial.h>
+#include <asm/byteorder.h>
+#include <asm/io.h>
+#include <asm/fixmap.h>
+#include <public/physdev.h>
+
+/* #define DBGP_DEBUG */
+
+/* EHCI register interface, corresponds to EHCI Revision 0.95 specification */
+
+/* Section 2.2 Host Controller Capability Registers */
+struct ehci_caps {
+    /*
+     * These fields are specified as 8 and 16 bit registers,
+     * but some hosts can't perform 8 or 16 bit PCI accesses.
+     * some hosts treat caplength and hciversion as parts of a 32-bit
+     * register, others treat them as two separate registers, this
+     * affects the memory map for big endian controllers.
+     */
+    u32 hc_capbase;
+#define HC_LENGTH(p)      (0x00ff & (p)) /* bits 7:0 / offset 0x00 */
+#define HC_VERSION(p)     (0xffff & ((p) >> 16)) /* bits 31:16 / offset 0x02 */
+
+    u32 hcs_params;       /* HCSPARAMS - offset 0x04 */
+#define HCS_DEBUG_PORT(p) (((p) >> 20) & 0xf) /* bits 23:20, debug port? */
+#define HCS_INDICATOR(p)  ((p) & (1 << 16))   /* true: has port indicators */
+#define HCS_N_CC(p)       (((p) >> 12) & 0xf) /* bits 15:12, #companion HCs */
+#define HCS_N_PCC(p)      (((p) >> 8) & 0xf)  /* bits 11:8, ports per CC */
+#define HCS_PORTROUTED(p) ((p) & (1 << 7))    /* true: port routing */
+#define HCS_PPC(p)        ((p) & (1 << 4))    /* true: port power control */
+#define HCS_N_PORTS(p)    (((p) >> 0) & 0xf)  /* bits 3:0, ports on HC */
+
+    u32 hcc_params;       /* HCCPARAMS - offset 0x08 */
+/* EHCI 1.1 addendum */
+#define HCC_32FRAME_PERIODIC_LIST(p) ((p) & (1 << 19))
+#define HCC_PER_PORT_CHANGE_EVENT(p) ((p) & (1 << 18))
+#define HCC_LPM(p)        ((p) & (1 << 17))
+#define HCC_HW_PREFETCH(p) ((p) & (1 << 16))
+#define HCC_EXT_CAPS(p)   (((p) >> 8) & 0xff) /* for pci extended caps */
+#define HCC_ISOC_CACHE(p) ((p) & (1 << 7))    /* true: can cache isoc frame */
+#define HCC_ISOC_THRES(p) (((p) >> 4) & 0x7)  /* bits 6:4, uframes cached */
+#define HCC_CANPARK(p)    ((p) & (1 << 2))    /* true: can park on async qh */
+#define HCC_PGM_FRAMELISTLEN(p) ((p) & (1 << 1)) /* true: periodic_size changes */
+#define HCC_64BIT_ADDR(p) ((p) & 1)           /* true: can use 64-bit addr */
+
+    u8  portroute[8];     /* nibbles for routing - offset 0x0C */
+};
+
+/* Section 2.3 Host Controller Operational Registers */
+struct ehci_regs {
+    /* USBCMD: offset 0x00 */
+    u32 command;
+
+/* EHCI 1.1 addendum */
+#define CMD_HIRD        (0xf << 24) /* host initiated resume duration */
+#define CMD_PPCEE       (1 << 15)   /* per port change event enable */
+#define CMD_FSP         (1 << 14)   /* fully synchronized prefetch */
+#define CMD_ASPE        (1 << 13)   /* async schedule prefetch enable */
+#define CMD_PSPE        (1 << 12)   /* periodic schedule prefetch enable */
+/* 23:16 is r/w intr rate, in microframes; default "8" == 1/msec */
+#define CMD_PARK        (1 << 11)   /* enable "park" on async qh */
+#define CMD_PARK_CNT(c) (((c) >> 8) & 3) /* how many transfers to park for */
+#define CMD_LRESET      (1 << 7)    /* partial reset (no ports, etc) */
+#define CMD_IAAD        (1 << 6)    /* "doorbell" interrupt async advance */
+#define CMD_ASE         (1 << 5)    /* async schedule enable */
+#define CMD_PSE         (1 << 4)    /* periodic schedule enable */
+/* 3:2 is periodic frame list size */
+#define CMD_RESET       (1 << 1)    /* reset HC not bus */
+#define CMD_RUN         (1 << 0)    /* start/stop HC */
+
+    /* USBSTS: offset 0x04 */
+    u32 status;
+#define STS_PPCE_MASK   (0xff << 16) /* Per-Port change event 1-16 */
+#define STS_ASS         (1 << 15)   /* Async Schedule Status */
+#define STS_PSS         (1 << 14)   /* Periodic Schedule Status */
+#define STS_RECL        (1 << 13)   /* Reclamation */
+#define STS_HALT        (1 << 12)   /* Not running (any reason) */
+/* some bits reserved */
+    /* these STS_* flags are also intr_enable bits (USBINTR) */
+#define STS_IAA         (1 << 5)    /* Interrupted on async advance */
+#define STS_FATAL       (1 << 4)    /* such as some PCI access errors */
+#define STS_FLR         (1 << 3)    /* frame list rolled over */
+#define STS_PCD         (1 << 2)    /* port change detect */
+#define STS_ERR         (1 << 1)    /* "error" completion (overflow, ...) */
+#define STS_INT         (1 << 0)    /* "normal" completion (short, ...) */
+
+    /* USBINTR: offset 0x08 */
+    u32 intr_enable;
+
+    /* FRINDEX: offset 0x0C */
+    u32 frame_index;    /* current microframe number */
+    /* CTRLDSSEGMENT: offset 0x10 */
+    u32 segment;    /* address bits 63:32 if needed */
+    /* PERIODICLISTBASE: offset 0x14 */
+    u32 frame_list;    /* points to periodic list */
+    /* ASYNCLISTADDR: offset 0x18 */
+    u32 async_next;    /* address of next async queue head */
+
+    u32 reserved[9];
+
+    /* CONFIGFLAG: offset 0x40 */
+    u32 configured_flag;
+#define FLAG_CF         (1 << 0)    /* true: we'll support "high speed" */
+
+    /* PORTSC: offset 0x44 */
+    u32 port_status[0];    /* up to N_PORTS */
+/* EHCI 1.1 addendum */
+#define PORTSC_SUSPEND_STS_ACK   0
+#define PORTSC_SUSPEND_STS_NYET  1
+#define PORTSC_SUSPEND_STS_STALL 2
+#define PORTSC_SUSPEND_STS_ERR   3
+
+#define PORT_DEV_ADDR   (0x7f << 25) /* device address */
+#define PORT_SSTS       (0x3 << 23)  /* suspend status */
+/* 31:23 reserved */
+#define PORT_WKOC_E     (1 << 22)    /* wake on overcurrent (enable) */
+#define PORT_WKDISC_E   (1 << 21)    /* wake on disconnect (enable) */
+#define PORT_WKCONN_E   (1 << 20)    /* wake on connect (enable) */
+/* 19:16 for port testing */
+#define PORT_TEST(x)    (((x) & 0xf) << 16) /* Port Test Control */
+#define PORT_TEST_PKT   PORT_TEST(0x4) /* Port Test Control - packet test */
+#define PORT_TEST_FORCE PORT_TEST(0x5) /* Port Test Control - force enable */
+#define PORT_LED_OFF    (0 << 14)
+#define PORT_LED_AMBER  (1 << 14)
+#define PORT_LED_GREEN  (2 << 14)
+#define PORT_LED_MASK   (3 << 14)
+#define PORT_OWNER      (1 << 13)    /* true: companion hc owns this port */
+#define PORT_POWER      (1 << 12)    /* true: has power (see PPC) */
+#define PORT_USB11(x)   (((x) & (3 << 10)) == (1 << 10)) /* USB 1.1 device */
+/* 11:10 for detecting lowspeed devices (reset vs release ownership) */
+/* 9 reserved */
+#define PORT_LPM        (1 << 9)     /* LPM transaction */
+#define PORT_RESET      (1 << 8)     /* reset port */
+#define PORT_SUSPEND    (1 << 7)     /* suspend port */
+#define PORT_RESUME     (1 << 6)     /* resume it */
+#define PORT_OCC        (1 << 5)     /* over current change */
+#define PORT_OC         (1 << 4)     /* over current active */
+#define PORT_PEC        (1 << 3)     /* port enable change */
+#define PORT_PE         (1 << 2)     /* port enable */
+#define PORT_CSC        (1 << 1)     /* connect status change */
+#define PORT_CONNECT    (1 << 0)     /* device connected */
+#define PORT_RWC_BITS   (PORT_CSC | PORT_PEC | PORT_OCC)
+};
+
+/*
+ * Appendix C, Debug port ... intended for use with special "debug devices"
+ * that can help if there's no serial console.  (nonstandard enumeration.)
+ */
+struct ehci_dbg_port {
+    u32 control;
+#define DBGP_OWNER      (1 << 30)
+#define DBGP_ENABLED    (1 << 28)
+#define DBGP_DONE       (1 << 16)
+#define DBGP_INUSE      (1 << 10)
+#define DBGP_ERRCODE(x) (((x) >> 7) & 0x07)
+# define DBGP_ERR_BAD    1
+# define DBGP_ERR_SIGNAL 2
+#define DBGP_ERROR      (1 << 6)
+#define DBGP_GO         (1 << 5)
+#define DBGP_OUT        (1 << 4)
+#define DBGP_LEN        (0xf << 0)
+#define DBGP_CLAIM      (DBGP_OWNER | DBGP_ENABLED | DBGP_INUSE)
+    u32 pids;
+#define DBGP_PID_GET(x)         (((x) >> 16) & 0xff)
+#define DBGP_PID_SET(data, tok) (((data) << 8) | (tok))
+    u32 data03;
+    u32 data47;
+    u32 address;
+#define DBGP_EPADDR(dev, ep) (((dev) << 8) | (ep))
+};
+
+/* CONTROL REQUEST SUPPORT */
+
+/*
+ * USB directions
+ *
+ * This bit flag is used in endpoint descriptors' bEndpointAddress field.
+ * It's also one of three fields in control requests bRequestType.
+ */
+#define USB_DIR_OUT 0           /* to device */
+#define USB_DIR_IN  0x80        /* to host */
+
+/*
+ * USB types, the second of three bRequestType fields
+ */
+#define USB_TYPE_MASK     (0x03 << 5)
+#define USB_TYPE_STANDARD (0x00 << 5)
+#define USB_TYPE_CLASS    (0x01 << 5)
+#define USB_TYPE_VENDOR   (0x02 << 5)
+#define USB_TYPE_RESERVED (0x03 << 5)
+
+/*
+ * USB recipients, the third of three bRequestType fields
+ */
+#define USB_RECIP_MASK      0x1f
+#define USB_RECIP_DEVICE    0x00
+#define USB_RECIP_INTERFACE 0x01
+#define USB_RECIP_ENDPOINT  0x02
+#define USB_RECIP_OTHER     0x03
+/* From Wireless USB 1.0 */
+#define USB_RECIP_PORT      0x04
+#define USB_RECIP_RPIPE     0x05
+
+/*
+ * Standard requests, for the bRequest field of a SETUP packet.
+ *
+ * These are qualified by the bRequestType field, so that for example
+ * TYPE_CLASS or TYPE_VENDOR specific feature flags could be retrieved
+ * by a GET_STATUS request.
+ */
+#define USB_REQ_GET_STATUS        0x00
+#define USB_REQ_CLEAR_FEATURE     0x01
+#define USB_REQ_SET_FEATURE       0x03
+#define USB_REQ_SET_ADDRESS       0x05
+#define USB_REQ_GET_DESCRIPTOR    0x06
+#define USB_REQ_SET_DESCRIPTOR    0x07
+#define USB_REQ_GET_CONFIGURATION 0x08
+#define USB_REQ_SET_CONFIGURATION 0x09
+#define USB_REQ_GET_INTERFACE     0x0A
+#define USB_REQ_SET_INTERFACE     0x0B
+#define USB_REQ_SYNCH_FRAME       0x0C
+
+#define USB_DEVICE_DEBUG_MODE        6    /* (special devices only) */
+
+/**
+ * struct usb_ctrlrequest - SETUP data for a USB device control request
+ * @bRequestType: matches the USB bmRequestType field
+ * @bRequest: matches the USB bRequest field
+ * @wValue: matches the USB wValue field (le16 byte order)
+ * @wIndex: matches the USB wIndex field (le16 byte order)
+ * @wLength: matches the USB wLength field (le16 byte order)
+ *
+ * This structure is used to send control requests to a USB device.  It matches
+ * the different fields of the USB 2.0 Spec section 9.3, table 9-2.  See the
+ * USB spec for a fuller description of the different fields, and what they are
+ * used for.
+ *
+ * Note that the driver for any interface can issue control requests.
+ * For most devices, interfaces don't coordinate with each other, so
+ * such requests may be made at any time.
+ */
+struct usb_ctrlrequest {
+    u8 bRequestType;
+    u8 bRequest;
+    __le16 wValue;
+    __le16 wIndex;
+    __le16 wLength;
+} __attribute__ ((packed));
+
+/* USB_DT_DEBUG: for special highspeed devices, replacing serial console */
+
+#define USB_DT_DEBUG    0x0a
+
+struct usb_debug_descriptor {
+    u8 bLength;
+    u8 bDescriptorType;
+    /* bulk endpoints with 8 byte maxpacket */
+    u8 bDebugInEndpoint;
+    u8 bDebugOutEndpoint;
+} __attribute__((packed));
+
+#define USB_DEBUG_DEVNUM 127
+
+/*
+ * USB Packet IDs (PIDs)
+ */
+
+/* token */
+#define USB_PID_OUT           0xe1
+#define USB_PID_IN            0x69
+#define USB_PID_SOF           0xa5
+#define USB_PID_SETUP         0x2d
+/* handshake */
+#define USB_PID_ACK           0xd2
+#define USB_PID_NAK           0x5a
+#define USB_PID_STALL         0x1e
+#define USB_PID_NYET          0x96
+/* data */
+#define USB_PID_DATA0         0xc3
+#define USB_PID_DATA1         0x4b
+#define USB_PID_DATA2         0x87
+#define USB_PID_MDATA         0x0f
+/* Special */
+#define USB_PID_PREAMBLE      0x3c
+#define USB_PID_ERR           0x3c
+#define USB_PID_SPLIT         0x78
+#define USB_PID_PING          0xb4
+#define USB_PID_UNDEF_0       0xf0
+
+#define PCI_CLASS_SERIAL_USB_EHCI 0x0c0320
+#define PCI_CAP_ID_EHCI_DEBUG     0x0a
+
+#define HUB_ROOT_RESET_TIME   50    /* times are in msec */
+#define HUB_SHORT_RESET_TIME  10
+#define HUB_LONG_RESET_TIME   200
+#define HUB_RESET_TIMEOUT     500
+
+#define DBGP_MAX_PACKET       8
+#define DBGP_LOOPS            1000
+#define DBGP_TIMEOUT          (250 * 1000) /* us */
+#define DBGP_CHECK_INTERVAL   100 /* us */
+/* This one can be set arbitrarily - only affects input responsiveness: */
+#define DBGP_IDLE_INTERVAL    100 /* ms */
+
+struct ehci_dbgp {
+    struct ehci_dbg_port __iomem *ehci_debug;
+    enum dbgp_state {
+        dbgp_idle,
+        dbgp_out,
+        dbgp_in,
+        dbgp_ctrl,
+        dbgp_unsafe /* cannot use debug device during EHCI reset */
+    } state;
+    unsigned int phys_port;
+    struct {
+        unsigned int endpoint;
+        unsigned int chunk;
+        char buf[DBGP_MAX_PACKET];
+    } out, in;
+    unsigned long timeout;
+    struct timer timer;
+    spinlock_t *lock;
+    bool_t reset_run;
+    u8 bus, slot, func, bar;
+    u16 pci_cr;
+    u32 bar_val;
+    unsigned int cap;
+    struct ehci_regs __iomem *ehci_regs;
+    struct ehci_caps __iomem *ehci_caps;
+};
+
+static int ehci_dbgp_external_startup(struct ehci_dbgp *);
+
+static void ehci_dbgp_status(struct ehci_dbgp *dbgp, const char *str)
+{
+#ifdef DBGP_DEBUG
+#define dbgp_printk printk
+    if ( !dbgp->ehci_debug )
+        return;
+    dbgp_printk("dbgp: %s\n", str);
+    dbgp_printk("  debug control: %08x\n", readl(&dbgp->ehci_debug->control));
+    dbgp_printk("  EHCI cmd     : %08x\n", readl(&dbgp->ehci_regs->command));
+    dbgp_printk("  EHCI conf flg: %08x\n",
+                readl(&dbgp->ehci_regs->configured_flag));
+    dbgp_printk("  EHCI status  : %08x\n", readl(&dbgp->ehci_regs->status));
+    dbgp_printk("  EHCI portsc  : %08x\n",
+                readl(&dbgp->ehci_regs->port_status[dbgp->phys_port - 1]));
+#endif
+}
+
+#ifndef DBGP_DEBUG
+static inline __attribute__ ((format (printf, 1, 2))) void
+dbgp_printk(const char *fmt, ...) { }
+#endif
+
+static inline u32 dbgp_len_update(u32 x, u32 len)
+{
+    return (x & ~DBGP_LEN) | (len & DBGP_LEN) | DBGP_OUT;
+}
+
+static inline u32 dbgp_pid_write_update(u32 x, u32 tok)
+{
+    static u8 data0 = USB_PID_DATA1;
+
+    data0 ^= USB_PID_DATA0 ^ USB_PID_DATA1;
+    return (x & 0xffff0000) | (data0 << 8) | (tok & 0xff);
+}
+
+static inline u32 dbgp_pid_read_update(u32 x, u32 tok)
+{
+    return (x & 0xffffff00) | (tok & 0xff);
+}
+
+static inline void dbgp_set_data(struct ehci_dbg_port __iomem *ehci_debug,
+                                 const void *buf, unsigned int size)
+{
+    const unsigned char *bytes = buf;
+    u32 lo = 0, hi = 0;
+    unsigned int i;
+
+    for ( i = 0; i < 4 && i < size; i++ )
+        lo |= bytes[i] << (8 * i);
+    for ( ; i < 8 && i < size; i++ )
+        hi |= bytes[i] << (8 * (i - 4));
+    writel(lo, &ehci_debug->data03);
+    writel(hi, &ehci_debug->data47);
+}
+
+static inline void dbgp_get_data(struct ehci_dbg_port __iomem *ehci_debug,
+                                 void *buf, int size)
+{
+    unsigned char *bytes = buf;
+    u32 lo = readl(&ehci_debug->data03);
+    u32 hi = readl(&ehci_debug->data47);
+    unsigned int i;
+
+    for ( i = 0; i < 4 && i < size; i++ )
+        bytes[i] = (lo >> (8 * i)) & 0xff;
+    for ( ; i < 8 && i < size; i++ )
+        bytes[i] = (hi >> (8 * (i - 4))) & 0xff;
+}
+
+static void dbgp_issue_command(struct ehci_dbgp *dbgp, u32 ctrl,
+                               enum dbgp_state state)
+{
+    u32 cmd = readl(&dbgp->ehci_regs->command);
+
+    if ( unlikely(!(cmd & CMD_RUN)) )
+    {
+        /*
+         * If the EHCI controller is not in the run state do extended
+         * checks to see if ACPI or some other initialization also
+         * reset the EHCI debug port.
+         */
+        u32 ctrl = readl(&dbgp->ehci_debug->control);
+
+        if ( ctrl & DBGP_ENABLED )
+        {
+            cmd |= CMD_RUN;
+            writel(cmd, &dbgp->ehci_regs->command);
+            dbgp->reset_run = 1;
+        }
+        else if ( dbgp->state != dbgp_unsafe )
+        {
+            dbgp->state = dbgp_unsafe;
+            ehci_dbgp_external_startup(dbgp);
+        }
+    }
+
+    writel(ctrl | DBGP_GO, &dbgp->ehci_debug->control);
+    dbgp->timeout = DBGP_TIMEOUT;
+    if ( dbgp->state != dbgp_unsafe )
+        dbgp->state = state;
+}
+
+static int dbgp_check_for_completion(struct ehci_dbgp *dbgp,
+                                     unsigned int interval, u8 *ppid)
+{
+    u32 ctrl;
+    int ret;
+
+    if ( dbgp->state == dbgp_idle )
+        return 0;
+
+    ctrl = readl(&dbgp->ehci_debug->control) & ~DBGP_GO;
+    if ( !(ctrl & DBGP_DONE) )
+    {
+        if ( dbgp->timeout > interval )
+            dbgp->timeout -= interval;
+        else if ( interval )
+        {
+            /* See the timeout related comment in dbgp_wait_until_done(). */
+            dbgp->state = dbgp_unsafe;
+            dbgp->timeout = 0;
+        }
+        return -DBGP_TIMEOUT;
+    }
+
+    if ( ctrl & DBGP_ERROR )
+    {
+        ret = -DBGP_ERRCODE(ctrl);
+        if ( ret == -DBGP_ERR_BAD && dbgp->timeout > interval )
+            ctrl |= DBGP_GO;
+    }
+    else
+    {
+        u8 pid = DBGP_PID_GET(readl(&dbgp->ehci_debug->pids));
+
+        ret = ctrl & DBGP_LEN;
+        if ( ppid )
+            *ppid = pid;
+        else if ( dbgp->state == dbgp_in )
+        {
+            dbgp_get_data(dbgp->ehci_debug, dbgp->in.buf, ret);
+            dbgp->in.chunk = ret;
+        }
+        else if ( pid == USB_PID_NAK && dbgp->timeout > interval )
+            ctrl |= DBGP_GO;
+    }
+
+    writel(ctrl, &dbgp->ehci_debug->control);
+    if ( ctrl & DBGP_GO )
+    {
+        dbgp->timeout -= interval;
+        return -DBGP_TIMEOUT;
+    }
+
+    if ( unlikely(dbgp->reset_run) )
+    {
+        writel(readl(&dbgp->ehci_regs->command) & ~CMD_RUN,
+               &dbgp->ehci_regs->command);
+        dbgp->reset_run = 0;
+    }
+
+    if ( dbgp->state != dbgp_unsafe )
+        dbgp->state = dbgp_idle;
+
+    return ret;
+}
+
+static int dbgp_wait_until_complete(struct ehci_dbgp *dbgp, u8 *ppid)
+{
+    unsigned int loop = DBGP_TIMEOUT;
+    int ret;
+
+    do {
+        ret = dbgp_check_for_completion(dbgp, 0, ppid);
+        if ( ret != -DBGP_TIMEOUT )
+            break;
+        udelay(1);
+    } while ( --loop );
+
+    if ( !ppid && !loop )
+        dbgp->state = dbgp_unsafe;
+
+    return ret;
+}
+
+static inline void dbgp_mdelay(unsigned int ms)
+{
+    while ( ms-- )
+    {
+        unsigned int i;
+
+        for ( i = 0; i < 1000; i++ )
+            outb(0x1, 0x80);
+    }
+}
+
+static void dbgp_breathe(void)
+{
+    /* Sleep to give the debug port a chance to breathe. */
+    dbgp_mdelay(1);
+}
+
+static int dbgp_wait_until_done(struct ehci_dbgp *dbgp, u32 ctrl,
+                                unsigned int loop)
+{
+    int ret;
+
+    dbgp->timeout = 0;
+
+    for ( ; ; writel(ctrl | DBGP_GO, &dbgp->ehci_debug->control) )
+    {
+        u8 pid;
+
+        ret = dbgp_wait_until_complete(dbgp, &pid);
+        if ( ret < 0 )
+        {
+            /*
+             * A -DBGP_TIMEOUT failure here means the device has failed,
+             * perhaps because it was unplugged, in which case we do not
+             * want to hang the system so the dbgp will be marked as unsafe
+             * to use. EHCI reset is the only way to recover if you unplug
+             * the dbgp device.
+             */
+            if ( ret == -DBGP_TIMEOUT )
+                dbgp->state = dbgp_unsafe;
+            if ( ret != -DBGP_ERR_BAD || !--loop )
+                break;
+        }
+        else
+        {
+            /*
+             * If the port is getting full or it has dropped data
+             * start pacing ourselves, not necessary but it's friendly.
+             */
+            if ( pid == USB_PID_NAK || pid == USB_PID_NYET )
+                dbgp_breathe();
+
+            /* If we got a NACK, reissue the transmission. */
+            if ( pid != USB_PID_NAK || !--loop )
+                break;
+        }
+    }
+
+    return ret;
+}
+
+static int dbgp_bulk_write(struct ehci_dbgp *dbgp,
+                           unsigned int devnum, unsigned int endpoint,
+                           const void *bytes, unsigned int size, u32 *pctrl)
+{
+    u32 addr, pids, ctrl;
+
+    if ( size > DBGP_MAX_PACKET )
+        return -EINVAL;
+
+    addr = DBGP_EPADDR(devnum, endpoint);
+    pids = dbgp_pid_write_update(readl(&dbgp->ehci_debug->pids), USB_PID_OUT);
+    ctrl = dbgp_len_update(readl(&dbgp->ehci_debug->control), size);
+    if ( pctrl )
+        *pctrl = ctrl;
+
+    dbgp_set_data(dbgp->ehci_debug, bytes, size);
+    writel(addr, &dbgp->ehci_debug->address);
+    writel(pids, &dbgp->ehci_debug->pids);
+    dbgp_issue_command(dbgp, ctrl, dbgp_out);
+
+    return 0;
+}
+
+static int dbgp_bulk_read(struct ehci_dbgp *dbgp,
+                          unsigned int devnum, unsigned int endpoint,
+                          unsigned int size, u32 *pctrl)
+{
+    u32 addr, pids, ctrl;
+
+    if ( size > DBGP_MAX_PACKET )
+        return -EINVAL;
+
+    addr = DBGP_EPADDR(devnum, endpoint);
+    pids = dbgp_pid_read_update(readl(&dbgp->ehci_debug->pids), USB_PID_IN);
+    ctrl = readl(&dbgp->ehci_debug->control) & ~DBGP_OUT;
+
+    writel(addr, &dbgp->ehci_debug->address);
+    writel(pids, &dbgp->ehci_debug->pids);
+    if ( likely(!pctrl) )
+        dbgp_issue_command(dbgp, ctrl, dbgp_in);
+    else
+        dbgp_issue_command(dbgp, *pctrl = ctrl, dbgp_ctrl);
+
+    return 0;
+}
+
+static int dbgp_control_msg(struct ehci_dbgp *dbgp, unsigned int devnum,
+                            int requesttype, int request, int value,
+                            int index, void *data, unsigned int size)
+{
+    u32 addr, pids, ctrl;
+    struct usb_ctrlrequest req;
+    bool_t read = (requesttype & USB_DIR_IN) != 0;
+    int ret;
+
+    if ( size > (read ? DBGP_MAX_PACKET : 0) )
+        return -EINVAL;
+
+    /* Compute the control message */
+    req.bRequestType = requesttype;
+    req.bRequest = request;
+    req.wValue = cpu_to_le16(value);
+    req.wIndex = cpu_to_le16(index);
+    req.wLength = cpu_to_le16(size);
+
+    pids = DBGP_PID_SET(USB_PID_DATA0, USB_PID_SETUP);
+    addr = DBGP_EPADDR(devnum, 0);
+    ctrl = dbgp_len_update(readl(&dbgp->ehci_debug->control), sizeof(req));
+
+    /* Send the setup message */
+    dbgp_set_data(dbgp->ehci_debug, &req, sizeof(req));
+    writel(addr, &dbgp->ehci_debug->address);
+    writel(pids, &dbgp->ehci_debug->pids);
+    dbgp_issue_command(dbgp, ctrl, dbgp_ctrl);
+    ret = dbgp_wait_until_done(dbgp, ctrl, DBGP_LOOPS);
+    if ( ret < 0 )
+        return ret;
+
+    /* Read the result */
+    ret = dbgp_bulk_read(dbgp, devnum, 0, size, &ctrl);
+    if ( !ret )
+        ret = dbgp_wait_until_done(dbgp, ctrl, DBGP_LOOPS);
+    if ( ret > 0 )
+    {
+        if ( size > ret )
+            size = ret;
+        dbgp_get_data(dbgp->ehci_debug, data, size);
+    }
+
+    return ret;
+}
+
+static unsigned int __init __find_dbgp(u8 bus, u8 slot, u8 func)
+{
+    u32 class = pci_conf_read32(0, bus, slot, func, PCI_CLASS_REVISION);
+
+    if ( (class >> 8) != PCI_CLASS_SERIAL_USB_EHCI )
+        return 0;
+
+    return pci_find_cap_offset(0, bus, slot, func, PCI_CAP_ID_EHCI_DEBUG);
+}
+
+static unsigned int __init find_dbgp(struct ehci_dbgp *dbgp,
+                                     unsigned int ehci_num)
+{
+    unsigned int bus, slot, func;
+
+    for ( bus = 0; bus < 256; bus++ )
+    {
+        for ( slot = 0; slot < 32; slot++ )
+        {
+            for ( func = 0; func < 8; func++ )
+            {
+                unsigned int cap;
+
+                if ( !pci_device_detect(0, bus, slot, func) )
+                {
+                    if ( !func )
+                        break;
+                    continue;
+                }
+
+                cap = __find_dbgp(bus, slot, func);
+                if ( !cap || ehci_num-- )
+                {
+                    if ( !func && !(pci_conf_read8(0, bus, slot, func,
+                                                   PCI_HEADER_TYPE) & 0x80) )
+                        break;
+                    continue;
+                }
+
+                dbgp->bus = bus;
+                dbgp->slot = slot;
+                dbgp->func = func;
+                return cap;
+            }
+        }
+    }
+
+    return 0;
+}
+
+static int ehci_dbgp_startup(struct ehci_dbgp *dbgp)
+{
+    u32 ctrl, cmd, status;
+    unsigned int loop;
+
+    /* Claim ownership, but do not enable yet */
+    ctrl = readl(&dbgp->ehci_debug->control);
+    ctrl |= DBGP_OWNER;
+    ctrl &= ~(DBGP_ENABLED | DBGP_INUSE);
+    writel(ctrl, &dbgp->ehci_debug->control);
+    udelay(1);
+
+    ehci_dbgp_status(dbgp, "EHCI startup");
+    /* Start the EHCI. */
+    cmd = readl(&dbgp->ehci_regs->command);
+    cmd &= ~(CMD_LRESET | CMD_IAAD | CMD_PSE | CMD_ASE | CMD_RESET);
+    cmd |= CMD_RUN;
+    writel(cmd, &dbgp->ehci_regs->command);
+
+    /* Ensure everything is routed to the EHCI */
+    writel(FLAG_CF, &dbgp->ehci_regs->configured_flag);
+
+    /* Wait until the controller is no longer halted. */
+    loop = 1000;
+    do {
+        status = readl(&dbgp->ehci_regs->status);
+        if ( !(status & STS_HALT) )
+            break;
+        udelay(1);
+    } while ( --loop );
+
+    if ( !loop )
+    {
+        dbgp_printk("EHCI cannot be started\n");
+        return -ENODEV;
+    }
+    dbgp_printk("EHCI started\n");
+
+    return 0;
+}
+
+static int ehci_dbgp_controller_reset(struct ehci_dbgp *dbgp)
+{
+    unsigned int loop = 250 * 1000;
+    u32 cmd;
+
+    /* Reset the EHCI controller */
+    cmd = readl(&dbgp->ehci_regs->command);
+    cmd |= CMD_RESET;
+    writel(cmd, &dbgp->ehci_regs->command);
+    do {
+        cmd = readl(&dbgp->ehci_regs->command);
+    } while ( (cmd & CMD_RESET) && --loop );
+
+    if ( !loop )
+    {
+        dbgp_printk("cannot reset EHCI\n");
+        return -1;
+    }
+    ehci_dbgp_status(dbgp, "ehci reset done");
+
+    return 0;
+}
+
+static int ehci_reset_port(struct ehci_dbgp *dbgp, unsigned int port)
+{
+    u32 portsc, delay_time, delay;
+
+    ehci_dbgp_status(dbgp, "reset port");
+    /* Reset the USB debug port. */
+    portsc = readl(&dbgp->ehci_regs->port_status[port - 1]);
+    portsc &= ~PORT_PE;
+    portsc |= PORT_RESET;
+    writel(portsc, &dbgp->ehci_regs->port_status[port - 1]);
+
+    delay = HUB_ROOT_RESET_TIME;
+    for ( delay_time = 0; delay_time < HUB_RESET_TIMEOUT;
+          delay_time += delay )
+    {
+        dbgp_mdelay(delay);
+        portsc = readl(&dbgp->ehci_regs->port_status[port - 1]);
+        if (!(portsc & PORT_RESET))
+            break;
+    }
+
+    if ( portsc & PORT_RESET )
+    {
+        /* force reset to complete */
+        unsigned int loop = 100 * 1000;
+
+        writel(portsc & ~(PORT_RWC_BITS | PORT_RESET),
+               &dbgp->ehci_regs->port_status[port - 1]);
+        do {
+            udelay(1);
+            portsc = readl(&dbgp->ehci_regs->port_status[port-1]);
+        } while ( (portsc & PORT_RESET) && --loop );
+    }
+
+    /* Device went away? */
+    if ( !(portsc & PORT_CONNECT) )
+        return -ENOTCONN;
+
+    /* bomb out completely if something weird happened */
+    if ( portsc & PORT_CSC )
+        return -EINVAL;
+
+    /* If we've finished resetting, then break out of the loop */
+    if ( !(portsc & PORT_RESET) && (portsc & PORT_PE) )
+        return 0;
+
+    return -EBUSY;
+}
+
+static int ehci_wait_for_port(struct ehci_dbgp *dbgp, unsigned int port)
+{
+    u32 status;
+    unsigned int reps;
+
+    for ( reps = 0; reps < 300; reps++ )
+    {
+        status = readl(&dbgp->ehci_regs->status);
+        if ( status & STS_PCD )
+            break;
+        dbgp_mdelay(1);
+    }
+
+    return ehci_reset_port(dbgp, port) == 0 ? 0 : -ENOTCONN;
+}
+
+/* Return 0 on success
+ * Return -ENODEV for any general failure
+ * Return -EIO if wait for port fails
+ */
+static int ehci_dbgp_external_startup(struct ehci_dbgp *dbgp)
+{
+    unsigned int devnum;
+    struct usb_debug_descriptor dbgp_desc;
+    int ret;
+    u32 ctrl, portsc, cmd;
+    unsigned int dbg_port = dbgp->phys_port;
+    unsigned int tries = 3;
+    unsigned int reset_port_tries = 1;
+    bool_t try_hard_once = 1;
+
+try_port_reset_again:
+    ret = ehci_dbgp_startup(dbgp);
+    if ( ret )
+        return ret;
+
+    /* Wait for a device to show up in the debug port */
+    ret = ehci_wait_for_port(dbgp, dbg_port);
+    if ( ret < 0 )
+    {
+        portsc = readl(&dbgp->ehci_regs->port_status[dbg_port - 1]);
+        if ( !(portsc & PORT_CONNECT) && try_hard_once )
+        {
+            /*
+             * Last ditch effort to try to force enable the debug device by
+             * using the packet test EHCI command to try and wake it up.
+             */
+            try_hard_once = 0;
+            cmd = readl(&dbgp->ehci_regs->command);
+            cmd &= ~CMD_RUN;
+            writel(cmd, &dbgp->ehci_regs->command);
+            portsc = readl(&dbgp->ehci_regs->port_status[dbg_port - 1]);
+            portsc |= PORT_TEST_PKT;
+            writel(portsc, &dbgp->ehci_regs->port_status[dbg_port - 1]);
+            ehci_dbgp_status(dbgp, "Trying to force debug port online");
+            mdelay(50);
+            ehci_dbgp_controller_reset(dbgp);
+            goto try_port_reset_again;
+        }
+        else if ( reset_port_tries-- )
+            goto try_port_reset_again;
+        dbgp_printk("no device found in debug port\n");
+        return -EIO;
+    }
+    ehci_dbgp_status(dbgp, "wait for port done");
+
+    /* Enable the debug port */
+    ctrl = readl(&dbgp->ehci_debug->control);
+    ctrl |= DBGP_CLAIM;
+    writel(ctrl, &dbgp->ehci_debug->control);
+    ctrl = readl(&dbgp->ehci_debug->control);
+    if ( (ctrl & DBGP_CLAIM) != DBGP_CLAIM )
+    {
+        dbgp_printk("no device in debug port\n");
+        writel(ctrl & ~DBGP_CLAIM, &dbgp->ehci_debug->control);
+        return -ENODEV;
+    }
+    ehci_dbgp_status(dbgp, "debug port enabled");
+
+    /* Completely transfer the debug device to the debug controller */
+    portsc = readl(&dbgp->ehci_regs->port_status[dbg_port - 1]);
+    portsc &= ~PORT_PE;
+    writel(portsc, &dbgp->ehci_regs->port_status[dbg_port - 1]);
+
+    dbgp_mdelay(100);
+
+try_again:
+    /* Find the debug device and make it device number 127 */
+    for ( devnum = 0; devnum <= 127; devnum++ )
+    {
+        ret = dbgp_control_msg(dbgp, devnum,
+                               USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_DEVICE,
+                               USB_REQ_GET_DESCRIPTOR, (USB_DT_DEBUG << 8), 0,
+                               &dbgp_desc, sizeof(dbgp_desc));
+        if ( ret > 0 )
+            break;
+    }
+    if ( devnum > 127 )
+    {
+        dbgp_printk("could not find attached debug device\n");
+        goto err;
+    }
+    if ( ret < 0 )
+    {
+        dbgp_printk("attached device is not a debug device\n");
+        goto err;
+    }
+    dbgp->out.endpoint = dbgp_desc.bDebugOutEndpoint;
+    dbgp->in.endpoint = dbgp_desc.bDebugInEndpoint;
+
+    /* Move the device to 127 if it isn't already there. */
+    if ( devnum != USB_DEBUG_DEVNUM )
+    {
+        ret = dbgp_control_msg(dbgp, devnum,
+                               USB_DIR_OUT | USB_TYPE_STANDARD | USB_RECIP_DEVICE,
+                               USB_REQ_SET_ADDRESS, USB_DEBUG_DEVNUM, 0, NULL, 0);
+        if ( ret < 0 )
+        {
+            dbgp_printk("could not move attached device to %d\n",
+                        USB_DEBUG_DEVNUM);
+            goto err;
+        }
+        devnum = USB_DEBUG_DEVNUM;
+        dbgp_printk("debug device renamed to 127\n");
+    }
+
+    /* Enable the debug interface */
+    ret = dbgp_control_msg(dbgp, USB_DEBUG_DEVNUM,
+                           USB_DIR_OUT | USB_TYPE_STANDARD | USB_RECIP_DEVICE,
+                           USB_REQ_SET_FEATURE, USB_DEVICE_DEBUG_MODE,
+                           0, NULL, 0);
+    if ( ret < 0 )
+    {
+        dbgp_printk("could not enable the debug device\n");
+        goto err;
+    }
+    dbgp_printk("debug interface enabled\n");
+
+    /* Perform a small write to get the even/odd data state in sync. */
+    ret = dbgp_bulk_write(dbgp, USB_DEBUG_DEVNUM, dbgp->out.endpoint,
+                          "\n", 1, &ctrl);
+    if ( !ret )
+        ret = dbgp_wait_until_done(dbgp, ctrl, DBGP_LOOPS);
+    if ( ret < 0 )
+    {
+        dbgp_printk("dbgp_bulk_write failed: %d\n", ret);
+        goto err;
+    }
+    dbgp_printk("small write done\n");
+    dbgp->state = dbgp_idle;
+
+    return 0;
+err:
+    if ( tries-- )
+        goto try_again;
+    return -ENODEV;
+}
+
+typedef void (*set_debug_port_t)(struct ehci_dbgp *, unsigned int);
+
+static void default_set_debug_port(struct ehci_dbgp *dbgp, unsigned int port)
+{
+}
+
+static set_debug_port_t __read_mostly set_debug_port = default_set_debug_port;
+
+static void nvidia_set_debug_port(struct ehci_dbgp *dbgp, unsigned int port)
+{
+    u32 dword = pci_conf_read32(0, dbgp->bus, dbgp->slot, dbgp->func, 0x74);
+
+    dword &= ~(0x0f << 12);
+    dword |= (port & 0x0f) << 12;
+    pci_conf_write32(0, dbgp->bus, dbgp->slot, dbgp->func, 0x74, dword);
+    dbgp_printk("set debug port to %u\n", port);
+}
+
+static void __init detect_set_debug_port(struct ehci_dbgp *dbgp)
+{
+    if ( pci_conf_read16(0, dbgp->bus, dbgp->slot, dbgp->func,
+                         PCI_VENDOR_ID) == 0x10de )
+    {
+        dbgp_printk("using nvidia set_debug_port\n");
+        set_debug_port = nvidia_set_debug_port;
+    }
+}
+
+/*
+ * The code in ehci_dbgp_bios_handoff() is derived from the USB PCI
+ * quirk initialization in Linux.
+ */
+#define EHCI_USBLEGSUP_BIOS    (1 << 16) /* BIOS semaphore */
+#define EHCI_USBLEGCTLSTS      4        /* legacy control/status */
+static void ehci_dbgp_bios_handoff(struct ehci_dbgp *dbgp, u32 hcc_params)
+{
+    u32 cap;
+    unsigned int offset = HCC_EXT_CAPS(hcc_params);
+    int msec;
+
+    if ( !offset )
+        return;
+
+    cap = pci_conf_read32(0, dbgp->bus, dbgp->slot, dbgp->func, offset);
+    dbgp_printk("dbgp: EHCI BIOS state %08x\n", cap);
+
+    if ( (cap & 0xff) == 1 && (cap & EHCI_USBLEGSUP_BIOS) )
+    {
+        dbgp_printk("dbgp: BIOS handoff\n");
+        pci_conf_write8(0, dbgp->bus, dbgp->slot, dbgp->func, offset + 3, 1);
+    }
+
+    /* if boot firmware now owns EHCI, spin till it hands it over. */
+    msec = 1000;
+    while ( (cap & EHCI_USBLEGSUP_BIOS) && (msec > 0) )
+    {
+        mdelay(10);
+        msec -= 10;
+        cap = pci_conf_read32(0, dbgp->bus, dbgp->slot, dbgp->func, offset);
+    }
+
+    if ( cap & EHCI_USBLEGSUP_BIOS )
+    {
+        /* well, possibly buggy BIOS... try to shut it down,
+         * and hope nothing goes too wrong */
+        dbgp_printk("dbgp: BIOS handoff failed: %08x\n", cap);
+        pci_conf_write8(0, dbgp->bus, dbgp->slot, dbgp->func, offset + 2, 0);
+    }
+
+    /* just in case, always disable EHCI SMIs */
+    pci_conf_write8(0, dbgp->bus, dbgp->slot, dbgp->func,
+                    offset + EHCI_USBLEGCTLSTS, 0);
+}
+
+static int ehci_dbgp_setup(struct ehci_dbgp *dbgp)
+{
+    u32 ctrl, portsc, hcs_params;
+    unsigned int i, debug_port, new_debug_port = 0, n_ports;
+    unsigned int port_map_tried, playtimes = 3;
+    int ret;
+
+    ehci_dbgp_bios_handoff(dbgp, readl(&dbgp->ehci_caps->hcc_params));
+
+try_next_time:
+    port_map_tried = 0;
+
+try_next_port:
+
+    hcs_params = readl(&dbgp->ehci_caps->hcs_params);
+    debug_port = HCS_DEBUG_PORT(hcs_params);
+    dbgp->phys_port = debug_port;
+    n_ports = HCS_N_PORTS(hcs_params);
+
+    dbgp_printk("debug_port: %u\n", debug_port);
+    dbgp_printk("n_ports:    %u\n", n_ports);
+    ehci_dbgp_status(dbgp, "");
+
+    for ( i = 1; i <= n_ports; i++ )
+    {
+        portsc = readl(&dbgp->ehci_regs->port_status[i-1]);
+        dbgp_printk("portstatus%d: %08x\n", i, portsc);
+    }
+
+    if ( port_map_tried && (new_debug_port != debug_port) )
+    {
+        if ( --playtimes )
+        {
+            set_debug_port(dbgp, new_debug_port);
+            goto try_next_time;
+        }
+        return -1;
+    }
+
+    /* Only reset the controller if it is not already in the
+     * configured state */
+    if ( readl(&dbgp->ehci_regs->configured_flag) & FLAG_CF )
+        ehci_dbgp_status(dbgp, "ehci skip - already configured");
+    else if ( ehci_dbgp_controller_reset(dbgp) != 0 )
+        return -1;
+
+    ret = ehci_dbgp_external_startup(dbgp);
+    if (ret == -EIO)
+        goto next_debug_port;
+
+    if ( ret < 0 )
+    {
+        /* Things didn't work so remove my claim */
+        ctrl = readl(&dbgp->ehci_debug->control);
+        ctrl &= ~(DBGP_CLAIM | DBGP_OUT);
+        writel(ctrl, &dbgp->ehci_debug->control);
+        return -1;
+    }
+
+    return 0;
+
+next_debug_port:
+    port_map_tried |= 1 << (debug_port - 1);
+    new_debug_port = (debug_port % n_ports) + 1;
+    if ( port_map_tried != ((1 << n_ports) - 1) )
+    {
+        set_debug_port(dbgp, new_debug_port);
+        goto try_next_port;
+    }
+    if ( --playtimes )
+    {
+        set_debug_port(dbgp, new_debug_port);
+        goto try_next_time;
+    }
+
+    return -1;
+}
+
+static inline void _ehci_dbgp_flush(struct ehci_dbgp *dbgp)
+{
+    if ( dbgp_bulk_write(dbgp, USB_DEBUG_DEVNUM, dbgp->out.endpoint,
+                         dbgp->out.buf, dbgp->out.chunk, NULL) )
+        BUG();
+    dbgp->out.chunk = 0;
+}
+
+static void ehci_dbgp_flush(struct serial_port *port)
+{
+    struct ehci_dbgp *dbgp = port->uart;
+    s_time_t goal;
+
+    if ( !dbgp->out.chunk || !dbgp->ehci_debug || dbgp->state == dbgp_unsafe )
+        return;
+
+    if ( dbgp->state == dbgp_idle || !port->sync )
+        dbgp_check_for_completion(dbgp, 1, NULL);
+    else
+        dbgp_wait_until_complete(dbgp, NULL);
+
+    if ( dbgp->state == dbgp_idle )
+    {
+        _ehci_dbgp_flush(dbgp);
+
+        if ( port->sync )
+        {
+            dbgp_wait_until_complete(dbgp, NULL);
+            return;
+        }
+    }
+
+    goal = NOW() + MICROSECS(DBGP_CHECK_INTERVAL);
+    if ( dbgp->timer.expires > goal )
+       set_timer(&dbgp->timer, goal);
+}
+
+static void ehci_dbgp_putc(struct serial_port *port, char c)
+{
+    struct ehci_dbgp *dbgp = port->uart;
+
+    if ( unlikely(dbgp->out.chunk >= DBGP_MAX_PACKET) )
+        return;
+
+    dbgp->out.buf[dbgp->out.chunk++] = c;
+
+    if ( dbgp->out.chunk == DBGP_MAX_PACKET )
+        ehci_dbgp_flush(port);
+}
+
+static int ehci_dbgp_tx_empty(struct serial_port *port)
+{
+    struct ehci_dbgp *dbgp = port->uart;
+
+    if ( unlikely(!dbgp->ehci_debug) || unlikely(dbgp->state == dbgp_unsafe) )
+        return port->sync || port->tx_log_everything || !port->txbuf;
+
+    if ( dbgp->out.chunk == DBGP_MAX_PACKET )
+        ehci_dbgp_flush(port);
+    else
+        dbgp_check_for_completion(dbgp, 1, NULL);
+
+    if ( dbgp->state != dbgp_idle && dbgp->out.chunk >= DBGP_MAX_PACKET )
+        return 0;
+
+    port->tx_fifo_size = DBGP_MAX_PACKET - dbgp->out.chunk;
+    if ( dbgp->state == dbgp_idle )
+        port->tx_fifo_size += DBGP_MAX_PACKET;
+
+    return 1;
+}
+
+static int ehci_dbgp_getc(struct serial_port *port, char *pc)
+{
+    struct ehci_dbgp *dbgp = port->uart;
+
+    if ( !dbgp->in.chunk )
+        return 0;
+
+    *pc = *dbgp->in.buf;
+    if ( --dbgp->in.chunk )
+        memmove(dbgp->in.buf, dbgp->in.buf + 1, dbgp->in.chunk);
+
+    return 1;
+}
+
+/* Safe: ehci_dbgp_poll() runs as timer handler, so not reentrant. */
+static struct serial_port *poll_port;
+
+static void _ehci_dbgp_poll(struct cpu_user_regs *regs)
+{
+    struct serial_port *port = poll_port;
+    struct ehci_dbgp *dbgp = port->uart;
+    unsigned long flags;
+    unsigned int timeout = MICROSECS(DBGP_CHECK_INTERVAL);
+    bool_t empty = 0;
+
+    if ( !dbgp->ehci_debug )
+        return;
+
+    if ( spin_trylock_irqsave(&port->tx_lock, flags) )
+    {
+        if ( dbgp->state != dbgp_unsafe )
+            dbgp_check_for_completion(dbgp, DBGP_CHECK_INTERVAL, NULL);
+        if ( dbgp->state == dbgp_idle && dbgp->out.chunk )
+            _ehci_dbgp_flush(dbgp);
+        if ( dbgp->state == dbgp_idle || dbgp->out.chunk < DBGP_MAX_PACKET )
+            empty = 1;
+        spin_unlock_irqrestore(&port->tx_lock, flags);
+    }
+
+    if ( dbgp->in.chunk )
+        serial_rx_interrupt(port, regs);
+
+    if ( empty )
+        serial_tx_interrupt(port, regs);
+
+    if ( spin_trylock_irqsave(&port->tx_lock, flags) )
+    {
+        if ( dbgp->state == dbgp_idle && !dbgp->in.chunk &&
+             !dbgp->out.chunk && port->txbufp == port->txbufc )
+        {
+            if ( dbgp_bulk_read(dbgp, USB_DEBUG_DEVNUM, dbgp->in.endpoint,
+                                DBGP_MAX_PACKET, NULL) )
+                BUG();
+            timeout = MILLISECS(DBGP_IDLE_INTERVAL);
+        }
+        spin_unlock_irqrestore(&port->tx_lock, flags);
+    }
+
+    set_timer(&dbgp->timer, NOW() + timeout);
+}
+
+static void ehci_dbgp_poll(void *data)
+{
+    poll_port = data;
+#ifdef run_in_exception_handler
+    run_in_exception_handler(_ehci_dbgp_poll);
+#else
+    _ehci_dbgp_poll(guest_cpu_user_regs());
+#endif
+}
+
+static bool_t ehci_dbgp_setup_preirq(struct ehci_dbgp *dbgp)
+{
+    if ( !ehci_dbgp_setup(dbgp) )
+        return 1;
+
+    dbgp_printk("ehci_dbgp_setup failed\n");
+    dbgp->ehci_debug = NULL;
+    return 0;
+}
+
+static void __init ehci_dbgp_init_preirq(struct serial_port *port)
+{
+    struct ehci_dbgp *dbgp = port->uart;
+    u32 debug_port, offset;
+    void __iomem *ehci_bar;
+
+    debug_port = pci_conf_read32(0, dbgp->bus, dbgp->slot, dbgp->func,
+                                 dbgp->cap);
+    offset = (debug_port >> 16) & 0xfff;
+
+    /* double check if the mem space is enabled */
+    dbgp->pci_cr = pci_conf_read8(0, dbgp->bus, dbgp->slot, dbgp->func,
+                                  PCI_COMMAND);
+    if ( !(dbgp->pci_cr & PCI_COMMAND_MEMORY) )
+    {
+        dbgp->pci_cr |= PCI_COMMAND_MEMORY;
+        pci_conf_write16(0, dbgp->bus, dbgp->slot, dbgp->func, PCI_COMMAND,
+                         dbgp->pci_cr);
+        dbgp_printk("MMIO for EHCI enabled\n");
+    }
+
+    /*
+     * FIXME I don't have the bar size so just guess PAGE_SIZE is more
+     * than enough.  1k is the biggest that was seen.
+     */
+    set_fixmap_nocache(FIX_EHCI_DBGP, dbgp->bar_val);
+    ehci_bar = (void __iomem *)fix_to_virt(FIX_EHCI_DBGP);
+    ehci_bar += dbgp->bar_val & ~PAGE_MASK;
+    dbgp_printk("ehci_bar: %p\n", ehci_bar);
+
+    dbgp->ehci_caps = ehci_bar;
+    dbgp->ehci_regs = ehci_bar +
+                      HC_LENGTH(readl(&dbgp->ehci_caps->hc_capbase));
+    dbgp->ehci_debug = ehci_bar + offset;
+
+    detect_set_debug_port(dbgp);
+
+    if ( ehci_dbgp_setup_preirq(dbgp) )
+        ehci_dbgp_status(dbgp, "ehci_dbgp_init_preirq complete");
+
+    port->tx_fifo_size = DBGP_MAX_PACKET;
+    dbgp->lock = &port->tx_lock;
+}
+
+static void ehci_dbgp_setup_postirq(struct ehci_dbgp *dbgp)
+{
+    set_timer(&dbgp->timer, NOW() + MILLISECS(1));
+}
+
+static void __init ehci_dbgp_init_postirq(struct serial_port *port)
+{
+    struct ehci_dbgp *dbgp = port->uart;
+
+    if ( !dbgp->ehci_debug )
+        return;
+
+    serial_async_transmit(port);
+
+    init_timer(&dbgp->timer, ehci_dbgp_poll, port, 0);
+
+    ehci_dbgp_setup_postirq(dbgp);
+}
+
+static int ehci_dbgp_check_release(struct ehci_dbgp *dbgp)
+{
+    struct ehci_dbg_port __iomem *ehci_debug = dbgp->ehci_debug;
+    u32 ctrl;
+    unsigned int i;
+
+    if ( !ehci_debug )
+        return 0;
+
+    for ( i = 0; i < DBGP_MAX_PACKET; ++i )
+        if ( dbgp->out.buf[i] )
+            return 1;
+
+    /*
+     * This means the console is not initialized, or should get shutdown
+     * so as to allow for reuse of the USB device, which means it is time
+     * to shutdown the USB debug port.
+     */
+    printk(XENLOG_INFO "Releasing EHCI debug port at %02x:%02x.%u\n",
+           dbgp->bus, dbgp->slot, dbgp->func);
+
+    kill_timer(&dbgp->timer);
+    dbgp->ehci_debug = NULL;
+
+    ctrl = readl(&ehci_debug->control);
+    if ( ctrl & DBGP_ENABLED )
+    {
+        ctrl &= ~DBGP_CLAIM;
+        writel(ctrl, &ehci_debug->control);
+    }
+
+    return 0;
+}
+
+static void __init ehci_dbgp_endboot(struct serial_port *port)
+{
+    ehci_dbgp_check_release(port->uart);
+}
+
+static void ehci_dbgp_suspend(struct serial_port *port)
+{
+    struct ehci_dbgp *dbgp = port->uart;
+
+    if ( !dbgp->ehci_debug )
+        return;
+
+    stop_timer(&dbgp->timer);
+    dbgp->timer.expires = 0;
+
+    dbgp->pci_cr = pci_conf_read16(0, dbgp->bus, dbgp->slot, dbgp->func,
+                                   PCI_COMMAND);
+
+    dbgp->state = dbgp_unsafe;
+}
+
+static void ehci_dbgp_resume(struct serial_port *port)
+{
+    struct ehci_dbgp *dbgp = port->uart;
+
+    if ( !dbgp->ehci_debug )
+        return;
+
+    pci_conf_write32(0, dbgp->bus, dbgp->slot, dbgp->func, dbgp->bar,
+                     dbgp->bar_val);
+    pci_conf_write16(0, dbgp->bus, dbgp->slot, dbgp->func,
+                     PCI_COMMAND, dbgp->pci_cr);
+
+    ehci_dbgp_setup_preirq(dbgp);
+    ehci_dbgp_setup_postirq(dbgp);
+}
+
+static struct uart_driver __read_mostly ehci_dbgp_driver = {
+    .init_preirq  = ehci_dbgp_init_preirq,
+    .init_postirq = ehci_dbgp_init_postirq,
+    .endboot      = ehci_dbgp_endboot,
+    .suspend      = ehci_dbgp_suspend,
+    .resume       = ehci_dbgp_resume,
+    .tx_empty     = ehci_dbgp_tx_empty,
+    .putc         = ehci_dbgp_putc,
+    .flush        = ehci_dbgp_flush,
+    .getc         = ehci_dbgp_getc
+};
+
+static struct ehci_dbgp ehci_dbgp = { .state = dbgp_unsafe, .phys_port = 1 };
+
+static char __initdata opt_dbgp[30];
+string_param("dbgp", opt_dbgp);
+
+void __init ehci_dbgp_init(void)
+{
+    struct ehci_dbgp *dbgp = &ehci_dbgp;
+    u32 debug_port, offset, bar_val;
+    const char *e;
+
+    if ( strncmp(opt_dbgp, "ehci", 4) )
+        return;
+
+    if ( isdigit(opt_dbgp[4]) || !opt_dbgp[4] )
+    {
+        unsigned int num = 0;
+
+        if ( opt_dbgp[4] )
+            simple_strtoul(opt_dbgp + 4, &e, 10);
+
+        dbgp->cap = find_dbgp(dbgp, num);
+        if ( !dbgp->cap )
+            return;
+
+        dbgp_printk("Found EHCI debug port on %02x:%02x.%u\n",
+                    dbgp->bus, dbgp->slot, dbgp->func);
+    }
+    else if ( strncmp(opt_dbgp + 4, "@pci", 4) == 0 )
+    {
+        unsigned long val = simple_strtoul(opt_dbgp + 8, &e, 16);
+
+        dbgp->bus = val;
+        if ( dbgp->bus != val || *e != ':' )
+            return;
+
+        val = simple_strtoul(e + 1, &e, 16);
+        if ( PCI_SLOT(PCI_DEVFN(val, 0)) != val || *e != '.' )
+            return;
+        dbgp->slot = val;
+
+        val = simple_strtoul(e + 1, &e, 16);
+        if ( PCI_FUNC(PCI_DEVFN(0, val)) != val || *e )
+            return;
+        dbgp->func = val;
+
+        if ( !pci_device_detect(0, dbgp->bus, dbgp->slot, dbgp->func) )
+            return;
+
+        dbgp->cap = __find_dbgp(dbgp->bus, dbgp->slot, dbgp->func);
+        if ( !dbgp->cap )
+            return;
+
+        dbgp_printk("Using EHCI debug port on %02x:%02x.%u\n",
+                    dbgp->bus, dbgp->slot, dbgp->func);
+    }
+    else
+        return;
+
+    debug_port = pci_conf_read32(0, dbgp->bus, dbgp->slot, dbgp->func,
+                                 dbgp->cap);
+    dbgp->bar = (debug_port >> 29) & 0x7;
+    dbgp->bar = ((dbgp->bar - 1) * 4) + PCI_BASE_ADDRESS_0;
+    offset = (debug_port >> 16) & 0xfff;
+    dbgp_printk("bar: %02x offset: %03x\n", dbgp->bar, offset);
+    if ( dbgp->bar < PCI_BASE_ADDRESS_0 || dbgp->bar > PCI_BASE_ADDRESS_5 )
+    {
+        dbgp_printk("unsupported/invalid bar\n");
+        return;
+    }
+
+    dbgp->bar_val = bar_val = pci_conf_read32(0, dbgp->bus, dbgp->slot,
+                                              dbgp->func, dbgp->bar);
+    dbgp_printk("bar_val: %08x\n", bar_val);
+    if ( bar_val & ~PCI_BASE_ADDRESS_MEM_MASK )
+    {
+        dbgp_printk("only simple 32-bit MMIO BARs supported\n");
+        return;
+    }
+    bar_val &= PCI_BASE_ADDRESS_MEM_MASK;
+    if ( !bar_val || !(bar_val + (bar_val & -bar_val)) )
+    {
+        dbgp_printk("firmware initialization of MMIO BAR required\n");
+        return;
+    }
+
+    serial_register_uart(SERHND_DBGP, &ehci_dbgp_driver, dbgp);
+}
+
+int dbgp_op(const struct physdev_dbgp_op *op)
+{
+    if ( !ehci_dbgp.ehci_debug )
+        return 0;
+
+    switch ( op->bus )
+    {
+    case PHYSDEVOP_DBGP_BUS_UNKNOWN:
+        break;
+    case PHYSDEVOP_DBGP_BUS_PCI:
+        if ( op->u.pci.seg || ehci_dbgp.bus != op->u.pci.bus ||
+            PCI_DEVFN(ehci_dbgp.slot, ehci_dbgp.func) != op->u.pci.devfn )
+    default:
+            return 0;
+        break;
+    }
+
+    switch ( op->op )
+    {
+    case PHYSDEVOP_DBGP_RESET_PREPARE:
+        spin_lock_irq(ehci_dbgp.lock);
+        ehci_dbgp.state = dbgp_unsafe;
+        dbgp_wait_until_complete(&ehci_dbgp, NULL);
+        spin_unlock_irq(ehci_dbgp.lock);
+
+        return ehci_dbgp_check_release(&ehci_dbgp);
+
+    case PHYSDEVOP_DBGP_RESET_DONE:
+        return ehci_dbgp_external_startup(&ehci_dbgp) ?: 1;
+    }
+
+    return -ENOSYS;
+}
diff -r 776a23fa0e93 -r 0d0c55a1975d xen/drivers/char/serial.c
--- a/xen/drivers/char/serial.c	Tue Sep 11 15:47:16 2012 +0200
+++ b/xen/drivers/char/serial.c	Tue Sep 11 15:49:52 2012 +0200
@@ -265,6 +265,14 @@ int __init serial_parse_handle(char *con
 {
     int handle;
 
+    if ( !strncmp(conf, "dbgp", 4) && (!conf[4] || conf[4] == ',') )
+    {
+        if ( !com[SERHND_DBGP].driver )
+            goto fail;
+
+        return SERHND_DBGP | SERHND_COOKED;
+    }
+
     if ( strncmp(conf, "com", 3) )
         goto fail;
 
diff -r 776a23fa0e93 -r 0d0c55a1975d xen/include/asm-x86/fixmap.h
--- a/xen/include/asm-x86/fixmap.h	Tue Sep 11 15:47:16 2012 +0200
+++ b/xen/include/asm-x86/fixmap.h	Tue Sep 11 15:49:52 2012 +0200
@@ -36,7 +36,15 @@
  * from the end of virtual memory backwards.
  */
 enum fixed_addresses {
-    FIX_RESERVED, /* Index 0 is reserved since fix_to_virt(0) > FIXADDR_TOP. */
+    /* Index 0 is reserved since fix_to_virt(0) == FIXADDR_TOP. */
+    FIX_RESERVED,
+    /*
+     * Indexes using the page tables set up before entering __start_xen()
+     * must be among the first (L1_PAGETABLE_ENTRIES - 1) entries.
+     * These are generally those needed by the various console drivers.
+     */
+    FIX_EHCI_DBGP,
+    /* Everything else should go further down. */
 #ifdef __i386__
     FIX_PAE_HIGHMEM_0,
     FIX_PAE_HIGHMEM_END = FIX_PAE_HIGHMEM_0 + NR_CPUS-1,
diff -r 776a23fa0e93 -r 0d0c55a1975d xen/include/public/physdev.h
--- a/xen/include/public/physdev.h	Tue Sep 11 15:47:16 2012 +0200
+++ b/xen/include/public/physdev.h	Tue Sep 11 15:49:52 2012 +0200
@@ -312,6 +312,24 @@ struct physdev_pci_device {
 typedef struct physdev_pci_device physdev_pci_device_t;
 DEFINE_XEN_GUEST_HANDLE(physdev_pci_device_t);
 
+#define PHYSDEVOP_DBGP_RESET_PREPARE    1
+#define PHYSDEVOP_DBGP_RESET_DONE       2
+
+#define PHYSDEVOP_DBGP_BUS_UNKNOWN      0
+#define PHYSDEVOP_DBGP_BUS_PCI          1
+
+#define PHYSDEVOP_dbgp_op               29
+struct physdev_dbgp_op {
+    /* IN */
+    uint8_t op;
+    uint8_t bus;
+    union {
+        struct physdev_pci_device pci;
+    } u;
+};
+typedef struct physdev_dbgp_op physdev_dbgp_op_t;
+DEFINE_XEN_GUEST_HANDLE(physdev_dbgp_op_t);
+
 /*
  * Notify that some PIRQ-bound event channels have been unmasked.
  * ** This command is obsolete since interface version 0x00030202 and is **
diff -r 776a23fa0e93 -r 0d0c55a1975d xen/include/xen/serial.h
--- a/xen/include/xen/serial.h	Tue Sep 11 15:47:16 2012 +0200
+++ b/xen/include/xen/serial.h	Tue Sep 11 15:49:52 2012 +0200
@@ -69,9 +69,10 @@ struct uart_driver {
 };
 
 /* 'Serial handles' are composed from the following fields. */
-#define SERHND_IDX      (3<<0) /* COM1 or COM2?                           */
+#define SERHND_IDX      (3<<0) /* COM1, COM2, or DBGP?                    */
 # define SERHND_COM1    (0<<0)
 # define SERHND_COM2    (1<<0)
+# define SERHND_DBGP    (2<<0)
 #define SERHND_HI       (1<<2) /* Mux/demux each transferred char by MSB. */
 #define SERHND_LO       (1<<3) /* Ditto, except that the MSB is cleared.  */
 #define SERHND_COOKED   (1<<4) /* Newline/carriage-return translation?    */
@@ -142,9 +143,13 @@ struct ns16550_defaults {
     unsigned long io_base; /* default io_base address */
 };
 void ns16550_init(int index, struct ns16550_defaults *defaults);
+void ehci_dbgp_init(void);
 
 void pl011_init(int index, unsigned long register_base_address);
 
+struct physdev_dbgp_op;
+int dbgp_op(const struct physdev_dbgp_op *);
+
 /* Baud rate was pre-configured before invoking the UART driver. */
 #define BAUD_AUTO (-1)
 

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:56:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:56:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTZL-0004Zz-8h; Fri, 14 Sep 2012 10:56:19 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTZK-0004YW-1f
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:56:18 +0000
Received: from [85.158.143.35:42440] by server-2.bemta-4.messagelabs.com id
	1F/7F-21239-15D03505; Fri, 14 Sep 2012 10:56:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-21.messagelabs.com!1347620120!10147386!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18067 invoked from network); 14 Sep 2012 10:55:21 -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;
	14 Sep 2012 10: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 1TCTYO-00013Y-AO
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYO-0000j3-33
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:20 +0000
Message-Id: <E1TCTYO-0000j3-33@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tmem: properly drop lock on error
	path in do_tmem_op()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347365906 -7200
# Node ID 109ea6a0c23aa0c5df79e3f5658162aed959ffcf
# Parent  83b97a59888b6d2d0f984b8403bd5764dd55c10c
tmem: properly drop lock on error path in do_tmem_op()

Reported-by: Tim Deegan <tim@xen.org>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
---


diff -r 83b97a59888b -r 109ea6a0c23a xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 11 14:18:08 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 11 14:18:26 2012 +0200
@@ -2659,13 +2659,19 @@ EXPORT long do_tmem_op(tmem_cli_op_t uop
     if ( client != NULL && tmh_client_is_dying(client) )
     {
         rc = -ENODEV;
-        goto out;
+        if ( tmh_lock_all )
+            goto out;
+ simple_error:
+        errored_tmem_ops++;
+        return rc;
     }
 
     if ( unlikely(tmh_get_tmemop_from_client(&op, uops) != 0) )
     {
         printk("tmem: can't get tmem struct from %s\n",client_str);
         rc = -EFAULT;
+        if ( !tmh_lock_all )
+            goto simple_error;
         goto out;
     }
 

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 10:56:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 10:56:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCTZL-0004Zz-8h; Fri, 14 Sep 2012 10:56:19 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTZK-0004YW-1f
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:56:18 +0000
Received: from [85.158.143.35:42440] by server-2.bemta-4.messagelabs.com id
	1F/7F-21239-15D03505; Fri, 14 Sep 2012 10:56:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-21.messagelabs.com!1347620120!10147386!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18067 invoked from network); 14 Sep 2012 10:55:21 -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;
	14 Sep 2012 10: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 1TCTYO-00013Y-AO
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCTYO-0000j3-33
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 10:55:20 +0000
Message-Id: <E1TCTYO-0000j3-33@xenbits.xen.org>
Date: Fri, 14 Sep 2012 10:55:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tmem: properly drop lock on error
	path in do_tmem_op()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347365906 -7200
# Node ID 109ea6a0c23aa0c5df79e3f5658162aed959ffcf
# Parent  83b97a59888b6d2d0f984b8403bd5764dd55c10c
tmem: properly drop lock on error path in do_tmem_op()

Reported-by: Tim Deegan <tim@xen.org>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
---


diff -r 83b97a59888b -r 109ea6a0c23a xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 11 14:18:08 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 11 14:18:26 2012 +0200
@@ -2659,13 +2659,19 @@ EXPORT long do_tmem_op(tmem_cli_op_t uop
     if ( client != NULL && tmh_client_is_dying(client) )
     {
         rc = -ENODEV;
-        goto out;
+        if ( tmh_lock_all )
+            goto out;
+ simple_error:
+        errored_tmem_ops++;
+        return rc;
     }
 
     if ( unlikely(tmh_get_tmemop_from_client(&op, uops) != 0) )
     {
         printk("tmem: can't get tmem struct from %s\n",client_str);
         rc = -EFAULT;
+        if ( !tmh_lock_all )
+            goto simple_error;
         goto out;
     }
 

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 21:11:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 21:11:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCdAP-00031A-Sc; Fri, 14 Sep 2012 21:11:13 +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 1TCdAP-00030r-17
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:13 +0000
Received: from [85.158.137.99:60407] by server-5.bemta-3.messagelabs.com id
	E8/6A-13133-07D93505; Fri, 14 Sep 2012 21:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-217.messagelabs.com!1347657069!14569950!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15072 invoked from network); 14 Sep 2012 21:11:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Sep 2012 21: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 1TCdAL-0000Ae-7m
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAL-0008Cn-0Q
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:09 +0000
Message-Id: <E1TCdAL-0008Cn-0Q@xenbits.xen.org>
Date: Fri, 14 Sep 2012 21:11:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libfsimage: add ext4 support for
	CentOS 5.x
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Roger Pau Monne <roger.pau@citrix.com>
# Date 1347613367 -3600
# Node ID 98e1ba6a672a3ef5326c502b0e18f4f1b4b3995f
# Parent  95a971c8058fd10c64973ce767bcb0e490f1a355
libfsimage: add ext4 support for CentOS 5.x

CentOS 5.x forked e2fs ext4 support into a different package called
e4fs, and so headers and library names changed from ext2fs to ext4fs.
Check if ext4fs/ext2fs.h and -lext4fs work, and use that instead of
ext2fs to build libfsimage. This patch assumes that if the ext4fs
library is present it should always be used instead of ext2fs.

This patch includes a rework of the ext2fs check, a new ext4fs check
and a minor modification in libfsimage to use the correct library.

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


diff -r 95a971c8058f -r 98e1ba6a672a config/Tools.mk.in
--- a/config/Tools.mk.in	Fri Sep 14 10:02:46 2012 +0100
+++ b/config/Tools.mk.in	Fri Sep 14 10:02:47 2012 +0100
@@ -57,5 +57,5 @@ CONFIG_SYSTEM_LIBAIO:= @system_aio@
 ZLIB                := @zlib@
 CONFIG_LIBICONV     := @libiconv@
 CONFIG_GCRYPT       := @libgcrypt@
-CONFIG_EXT2FS       := @libext2fs@
+EXTFS_LIBS          := @EXTFS_LIBS@
 CURSES_LIBS         := @CURSES_LIBS@
diff -r 95a971c8058f -r 98e1ba6a672a tools/config.h.in
--- a/tools/config.h.in	Fri Sep 14 10:02:46 2012 +0100
+++ b/tools/config.h.in	Fri Sep 14 10:02:47 2012 +0100
@@ -42,6 +42,9 @@
 /* Define curses header to use */
 #undef INCLUDE_CURSES_H
 
+/* Define extfs header to use */
+#undef INCLUDE_EXTFS_H
+
 /* libutil header file name */
 #undef INCLUDE_LIBUTIL_H
 
diff -r 95a971c8058f -r 98e1ba6a672a tools/configure
--- a/tools/configure	Fri Sep 14 10:02:46 2012 +0100
+++ b/tools/configure	Fri Sep 14 10:02:47 2012 +0100
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.67 for Xen Hypervisor 4.2.
+# Generated by GNU Autoconf 2.67 for Xen Hypervisor 4.3.
 #
 # Report bugs to <xen-devel@lists.xen.org>.
 #
@@ -552,8 +552,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='Xen Hypervisor'
 PACKAGE_TARNAME='xen-hypervisor'
-PACKAGE_VERSION='4.2'
-PACKAGE_STRING='Xen Hypervisor 4.2'
+PACKAGE_VERSION='4.3'
+PACKAGE_STRING='Xen Hypervisor 4.3'
 PACKAGE_BUGREPORT='xen-devel@lists.xen.org'
 PACKAGE_URL=''
 
@@ -603,7 +603,7 @@ PTHREAD_LIBS
 PTHREAD_LDFLAGS
 PTHREAD_CFLAGS
 libgcrypt
-libext2fs
+EXTFS_LIBS
 system_aio
 zlib
 glib_LIBS
@@ -1301,7 +1301,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures Xen Hypervisor 4.2 to adapt to many kinds of systems.
+\`configure' configures Xen Hypervisor 4.3 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1366,7 +1366,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of Xen Hypervisor 4.2:";;
+     short | recursive ) echo "Configuration of Xen Hypervisor 4.3:";;
    esac
   cat <<\_ACEOF
 
@@ -1490,7 +1490,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-Xen Hypervisor configure 4.2
+Xen Hypervisor configure 4.3
 generated by GNU Autoconf 2.67
 
 Copyright (C) 2010 Free Software Foundation, Inc.
@@ -1792,7 +1792,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by Xen Hypervisor $as_me 4.2, which was
+It was created by Xen Hypervisor $as_me 4.3, which was
 generated by GNU Autoconf 2.67.  Invocation command line was
 
   $ $0 $@
@@ -2389,6 +2389,8 @@ case $host_os in *\ *) host_os=`echo "$h
 
 
 
+
+
 # Enable/disable options
 
 # Check whether --enable-githttp was given.
@@ -6325,6 +6327,10 @@ else
   as_fn_error $? "Could not find libcrypto" "$LINENO" 5
 fi
 
+
+ac_fn_c_check_header_mongrel "$LINENO" "ext2fs/ext2fs.h" "ac_cv_header_ext2fs_ext2fs_h" "$ac_includes_default"
+if test "x$ac_cv_header_ext2fs_ext2fs_h" = x""yes; then :
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ext2fs_open2 in -lext2fs" >&5
 $as_echo_n "checking for ext2fs_open2 in -lext2fs... " >&6; }
 if test "${ac_cv_lib_ext2fs_ext2fs_open2+set}" = set; then :
@@ -6362,10 +6368,70 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ext2fs_ext2fs_open2" >&5
 $as_echo "$ac_cv_lib_ext2fs_ext2fs_open2" >&6; }
 if test "x$ac_cv_lib_ext2fs_ext2fs_open2" = x""yes; then :
-  libext2fs="y"
-else
-  libext2fs="n"
-fi
+
+
+$as_echo "#define INCLUDE_EXTFS_H <ext2fs/ext2fs.h>" >>confdefs.h
+
+    EXTFS_LIBS="-lext2fs"
+
+fi
+
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "ext4fs/ext2fs.h" "ac_cv_header_ext4fs_ext2fs_h" "$ac_includes_default"
+if test "x$ac_cv_header_ext4fs_ext2fs_h" = x""yes; then :
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ext2fs_open2 in -lext4fs" >&5
+$as_echo_n "checking for ext2fs_open2 in -lext4fs... " >&6; }
+if test "${ac_cv_lib_ext4fs_ext2fs_open2+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lext4fs  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ext2fs_open2 ();
+int
+main ()
+{
+return ext2fs_open2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_ext4fs_ext2fs_open2=yes
+else
+  ac_cv_lib_ext4fs_ext2fs_open2=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ext4fs_ext2fs_open2" >&5
+$as_echo "$ac_cv_lib_ext4fs_ext2fs_open2" >&6; }
+if test "x$ac_cv_lib_ext4fs_ext2fs_open2" = x""yes; then :
+
+
+$as_echo "#define INCLUDE_EXTFS_H <ext4fs/ext2fs.h>" >>confdefs.h
+
+    EXTFS_LIBS="-lext4fs"
+
+fi
+
+
+fi
+
+
 
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcry_md_hash_buffer in -lgcrypt" >&5
@@ -7192,7 +7258,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by Xen Hypervisor $as_me 4.2, which was
+This file was extended by Xen Hypervisor $as_me 4.3, which was
 generated by GNU Autoconf 2.67.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -7254,7 +7320,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-Xen Hypervisor config.status 4.2
+Xen Hypervisor config.status 4.3
 configured by $0, generated by GNU Autoconf 2.67,
   with options \\"\$ac_cs_config\\"
 
diff -r 95a971c8058f -r 98e1ba6a672a tools/configure.ac
--- a/tools/configure.ac	Fri Sep 14 10:02:46 2012 +0100
+++ b/tools/configure.ac	Fri Sep 14 10:02:47 2012 +0100
@@ -34,6 +34,7 @@ m4_include([m4/pkg.m4])
 m4_include([m4/curses.m4])
 m4_include([m4/pthread.m4])
 m4_include([m4/ptyfuncs.m4])
+m4_include([m4/extfs.m4])
 
 # Enable/disable options
 AX_ARG_DEFAULT_DISABLE([githttp], [Download GIT repositories via HTTP])
@@ -131,8 +132,7 @@ AC_SUBST(zlib)
 AC_CHECK_LIB([aio], [io_setup], [system_aio="y"], [system_aio="n"])
 AC_SUBST(system_aio)
 AC_CHECK_LIB([crypto], [MD5], [], [AC_MSG_ERROR([Could not find libcrypto])])
-AC_CHECK_LIB([ext2fs], [ext2fs_open2], [libext2fs="y"], [libext2fs="n"])
-AC_SUBST(libext2fs)
+AX_CHECK_EXTFS
 AC_CHECK_LIB([gcrypt], [gcry_md_hash_buffer], [libgcrypt="y"], [libgcrypt="n"])
 AC_SUBST(libgcrypt)
 AX_CHECK_PTHREAD
diff -r 95a971c8058f -r 98e1ba6a672a tools/libfsimage/Makefile
--- a/tools/libfsimage/Makefile	Fri Sep 14 10:02:46 2012 +0100
+++ b/tools/libfsimage/Makefile	Fri Sep 14 10:02:47 2012 +0100
@@ -3,7 +3,7 @@ include $(XEN_ROOT)/tools/Rules.mk
 
 SUBDIRS-y = common ufs reiserfs iso9660 fat zfs
 SUBDIRS-$(CONFIG_X86) += xfs
-ifeq ($(CONFIG_EXT2FS), y)
+ifneq ($(EXTFS_LIBS), )
     SUBDIRS-y += ext2fs-lib
 else
     SUBDIRS-y += ext2fs
diff -r 95a971c8058f -r 98e1ba6a672a tools/libfsimage/ext2fs-lib/Makefile
--- a/tools/libfsimage/ext2fs-lib/Makefile	Fri Sep 14 10:02:46 2012 +0100
+++ b/tools/libfsimage/ext2fs-lib/Makefile	Fri Sep 14 10:02:47 2012 +0100
@@ -4,7 +4,10 @@ LIB_SRCS-y = ext2fs-lib.c
 
 FS = ext2fs-lib
 
-FS_LIBDEPS = -lext2fs
+FS_LIBDEPS = $(EXTFS_LIBS)
+
+# Include configure output (config.h) to headers search path
+CFLAGS += -I$(XEN_ROOT)/tools
 
 .PHONY: all
 all: fs-all
diff -r 95a971c8058f -r 98e1ba6a672a tools/libfsimage/ext2fs-lib/ext2fs-lib.c
--- a/tools/libfsimage/ext2fs-lib/ext2fs-lib.c	Fri Sep 14 10:02:46 2012 +0100
+++ b/tools/libfsimage/ext2fs-lib/ext2fs-lib.c	Fri Sep 14 10:02:47 2012 +0100
@@ -21,8 +21,11 @@
  * Use is subject to license terms.
  */
 
+/* Include output from configure */
+#include <config.h>
+
 #include <fsimage_plugin.h>
-#include <ext2fs/ext2fs.h>
+#include INCLUDE_EXTFS_H
 #include <errno.h>
 #include <inttypes.h>
 
diff -r 95a971c8058f -r 98e1ba6a672a tools/m4/extfs.m4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/m4/extfs.m4	Fri Sep 14 10:02:47 2012 +0100
@@ -0,0 +1,20 @@
+AC_DEFUN([AX_CHECK_EXTFS], [
+AC_CHECK_HEADER([ext2fs/ext2fs.h], [
+AC_CHECK_LIB([ext2fs], [ext2fs_open2], [
+    AC_DEFINE([INCLUDE_EXTFS_H], [<ext2fs/ext2fs.h>],
+              [Define extfs header to use])
+    EXTFS_LIBS="-lext2fs"
+])
+])
+dnl This is a temporary hack for CentOS 5.x, which split the ext4 support
+dnl of ext2fs in a different package. Once CentOS 5.x is no longer supported
+dnl we can remove this.
+AC_CHECK_HEADER([ext4fs/ext2fs.h], [
+AC_CHECK_LIB([ext4fs], [ext2fs_open2], [
+    AC_DEFINE([INCLUDE_EXTFS_H], [<ext4fs/ext2fs.h>],
+              [Define extfs header to use])
+    EXTFS_LIBS="-lext4fs"
+])
+])
+AC_SUBST(EXTFS_LIBS)
+])

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 21:11:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 21:11:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCdAP-00031A-Sc; Fri, 14 Sep 2012 21:11:13 +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 1TCdAP-00030r-17
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:13 +0000
Received: from [85.158.137.99:60407] by server-5.bemta-3.messagelabs.com id
	E8/6A-13133-07D93505; Fri, 14 Sep 2012 21:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-217.messagelabs.com!1347657069!14569950!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15072 invoked from network); 14 Sep 2012 21:11:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Sep 2012 21: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 1TCdAL-0000Ae-7m
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAL-0008Cn-0Q
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:09 +0000
Message-Id: <E1TCdAL-0008Cn-0Q@xenbits.xen.org>
Date: Fri, 14 Sep 2012 21:11:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libfsimage: add ext4 support for
	CentOS 5.x
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Roger Pau Monne <roger.pau@citrix.com>
# Date 1347613367 -3600
# Node ID 98e1ba6a672a3ef5326c502b0e18f4f1b4b3995f
# Parent  95a971c8058fd10c64973ce767bcb0e490f1a355
libfsimage: add ext4 support for CentOS 5.x

CentOS 5.x forked e2fs ext4 support into a different package called
e4fs, and so headers and library names changed from ext2fs to ext4fs.
Check if ext4fs/ext2fs.h and -lext4fs work, and use that instead of
ext2fs to build libfsimage. This patch assumes that if the ext4fs
library is present it should always be used instead of ext2fs.

This patch includes a rework of the ext2fs check, a new ext4fs check
and a minor modification in libfsimage to use the correct library.

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


diff -r 95a971c8058f -r 98e1ba6a672a config/Tools.mk.in
--- a/config/Tools.mk.in	Fri Sep 14 10:02:46 2012 +0100
+++ b/config/Tools.mk.in	Fri Sep 14 10:02:47 2012 +0100
@@ -57,5 +57,5 @@ CONFIG_SYSTEM_LIBAIO:= @system_aio@
 ZLIB                := @zlib@
 CONFIG_LIBICONV     := @libiconv@
 CONFIG_GCRYPT       := @libgcrypt@
-CONFIG_EXT2FS       := @libext2fs@
+EXTFS_LIBS          := @EXTFS_LIBS@
 CURSES_LIBS         := @CURSES_LIBS@
diff -r 95a971c8058f -r 98e1ba6a672a tools/config.h.in
--- a/tools/config.h.in	Fri Sep 14 10:02:46 2012 +0100
+++ b/tools/config.h.in	Fri Sep 14 10:02:47 2012 +0100
@@ -42,6 +42,9 @@
 /* Define curses header to use */
 #undef INCLUDE_CURSES_H
 
+/* Define extfs header to use */
+#undef INCLUDE_EXTFS_H
+
 /* libutil header file name */
 #undef INCLUDE_LIBUTIL_H
 
diff -r 95a971c8058f -r 98e1ba6a672a tools/configure
--- a/tools/configure	Fri Sep 14 10:02:46 2012 +0100
+++ b/tools/configure	Fri Sep 14 10:02:47 2012 +0100
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.67 for Xen Hypervisor 4.2.
+# Generated by GNU Autoconf 2.67 for Xen Hypervisor 4.3.
 #
 # Report bugs to <xen-devel@lists.xen.org>.
 #
@@ -552,8 +552,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='Xen Hypervisor'
 PACKAGE_TARNAME='xen-hypervisor'
-PACKAGE_VERSION='4.2'
-PACKAGE_STRING='Xen Hypervisor 4.2'
+PACKAGE_VERSION='4.3'
+PACKAGE_STRING='Xen Hypervisor 4.3'
 PACKAGE_BUGREPORT='xen-devel@lists.xen.org'
 PACKAGE_URL=''
 
@@ -603,7 +603,7 @@ PTHREAD_LIBS
 PTHREAD_LDFLAGS
 PTHREAD_CFLAGS
 libgcrypt
-libext2fs
+EXTFS_LIBS
 system_aio
 zlib
 glib_LIBS
@@ -1301,7 +1301,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures Xen Hypervisor 4.2 to adapt to many kinds of systems.
+\`configure' configures Xen Hypervisor 4.3 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1366,7 +1366,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of Xen Hypervisor 4.2:";;
+     short | recursive ) echo "Configuration of Xen Hypervisor 4.3:";;
    esac
   cat <<\_ACEOF
 
@@ -1490,7 +1490,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-Xen Hypervisor configure 4.2
+Xen Hypervisor configure 4.3
 generated by GNU Autoconf 2.67
 
 Copyright (C) 2010 Free Software Foundation, Inc.
@@ -1792,7 +1792,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by Xen Hypervisor $as_me 4.2, which was
+It was created by Xen Hypervisor $as_me 4.3, which was
 generated by GNU Autoconf 2.67.  Invocation command line was
 
   $ $0 $@
@@ -2389,6 +2389,8 @@ case $host_os in *\ *) host_os=`echo "$h
 
 
 
+
+
 # Enable/disable options
 
 # Check whether --enable-githttp was given.
@@ -6325,6 +6327,10 @@ else
   as_fn_error $? "Could not find libcrypto" "$LINENO" 5
 fi
 
+
+ac_fn_c_check_header_mongrel "$LINENO" "ext2fs/ext2fs.h" "ac_cv_header_ext2fs_ext2fs_h" "$ac_includes_default"
+if test "x$ac_cv_header_ext2fs_ext2fs_h" = x""yes; then :
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ext2fs_open2 in -lext2fs" >&5
 $as_echo_n "checking for ext2fs_open2 in -lext2fs... " >&6; }
 if test "${ac_cv_lib_ext2fs_ext2fs_open2+set}" = set; then :
@@ -6362,10 +6368,70 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ext2fs_ext2fs_open2" >&5
 $as_echo "$ac_cv_lib_ext2fs_ext2fs_open2" >&6; }
 if test "x$ac_cv_lib_ext2fs_ext2fs_open2" = x""yes; then :
-  libext2fs="y"
-else
-  libext2fs="n"
-fi
+
+
+$as_echo "#define INCLUDE_EXTFS_H <ext2fs/ext2fs.h>" >>confdefs.h
+
+    EXTFS_LIBS="-lext2fs"
+
+fi
+
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "ext4fs/ext2fs.h" "ac_cv_header_ext4fs_ext2fs_h" "$ac_includes_default"
+if test "x$ac_cv_header_ext4fs_ext2fs_h" = x""yes; then :
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ext2fs_open2 in -lext4fs" >&5
+$as_echo_n "checking for ext2fs_open2 in -lext4fs... " >&6; }
+if test "${ac_cv_lib_ext4fs_ext2fs_open2+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lext4fs  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ext2fs_open2 ();
+int
+main ()
+{
+return ext2fs_open2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_ext4fs_ext2fs_open2=yes
+else
+  ac_cv_lib_ext4fs_ext2fs_open2=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ext4fs_ext2fs_open2" >&5
+$as_echo "$ac_cv_lib_ext4fs_ext2fs_open2" >&6; }
+if test "x$ac_cv_lib_ext4fs_ext2fs_open2" = x""yes; then :
+
+
+$as_echo "#define INCLUDE_EXTFS_H <ext4fs/ext2fs.h>" >>confdefs.h
+
+    EXTFS_LIBS="-lext4fs"
+
+fi
+
+
+fi
+
+
 
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcry_md_hash_buffer in -lgcrypt" >&5
@@ -7192,7 +7258,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by Xen Hypervisor $as_me 4.2, which was
+This file was extended by Xen Hypervisor $as_me 4.3, which was
 generated by GNU Autoconf 2.67.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -7254,7 +7320,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-Xen Hypervisor config.status 4.2
+Xen Hypervisor config.status 4.3
 configured by $0, generated by GNU Autoconf 2.67,
   with options \\"\$ac_cs_config\\"
 
diff -r 95a971c8058f -r 98e1ba6a672a tools/configure.ac
--- a/tools/configure.ac	Fri Sep 14 10:02:46 2012 +0100
+++ b/tools/configure.ac	Fri Sep 14 10:02:47 2012 +0100
@@ -34,6 +34,7 @@ m4_include([m4/pkg.m4])
 m4_include([m4/curses.m4])
 m4_include([m4/pthread.m4])
 m4_include([m4/ptyfuncs.m4])
+m4_include([m4/extfs.m4])
 
 # Enable/disable options
 AX_ARG_DEFAULT_DISABLE([githttp], [Download GIT repositories via HTTP])
@@ -131,8 +132,7 @@ AC_SUBST(zlib)
 AC_CHECK_LIB([aio], [io_setup], [system_aio="y"], [system_aio="n"])
 AC_SUBST(system_aio)
 AC_CHECK_LIB([crypto], [MD5], [], [AC_MSG_ERROR([Could not find libcrypto])])
-AC_CHECK_LIB([ext2fs], [ext2fs_open2], [libext2fs="y"], [libext2fs="n"])
-AC_SUBST(libext2fs)
+AX_CHECK_EXTFS
 AC_CHECK_LIB([gcrypt], [gcry_md_hash_buffer], [libgcrypt="y"], [libgcrypt="n"])
 AC_SUBST(libgcrypt)
 AX_CHECK_PTHREAD
diff -r 95a971c8058f -r 98e1ba6a672a tools/libfsimage/Makefile
--- a/tools/libfsimage/Makefile	Fri Sep 14 10:02:46 2012 +0100
+++ b/tools/libfsimage/Makefile	Fri Sep 14 10:02:47 2012 +0100
@@ -3,7 +3,7 @@ include $(XEN_ROOT)/tools/Rules.mk
 
 SUBDIRS-y = common ufs reiserfs iso9660 fat zfs
 SUBDIRS-$(CONFIG_X86) += xfs
-ifeq ($(CONFIG_EXT2FS), y)
+ifneq ($(EXTFS_LIBS), )
     SUBDIRS-y += ext2fs-lib
 else
     SUBDIRS-y += ext2fs
diff -r 95a971c8058f -r 98e1ba6a672a tools/libfsimage/ext2fs-lib/Makefile
--- a/tools/libfsimage/ext2fs-lib/Makefile	Fri Sep 14 10:02:46 2012 +0100
+++ b/tools/libfsimage/ext2fs-lib/Makefile	Fri Sep 14 10:02:47 2012 +0100
@@ -4,7 +4,10 @@ LIB_SRCS-y = ext2fs-lib.c
 
 FS = ext2fs-lib
 
-FS_LIBDEPS = -lext2fs
+FS_LIBDEPS = $(EXTFS_LIBS)
+
+# Include configure output (config.h) to headers search path
+CFLAGS += -I$(XEN_ROOT)/tools
 
 .PHONY: all
 all: fs-all
diff -r 95a971c8058f -r 98e1ba6a672a tools/libfsimage/ext2fs-lib/ext2fs-lib.c
--- a/tools/libfsimage/ext2fs-lib/ext2fs-lib.c	Fri Sep 14 10:02:46 2012 +0100
+++ b/tools/libfsimage/ext2fs-lib/ext2fs-lib.c	Fri Sep 14 10:02:47 2012 +0100
@@ -21,8 +21,11 @@
  * Use is subject to license terms.
  */
 
+/* Include output from configure */
+#include <config.h>
+
 #include <fsimage_plugin.h>
-#include <ext2fs/ext2fs.h>
+#include INCLUDE_EXTFS_H
 #include <errno.h>
 #include <inttypes.h>
 
diff -r 95a971c8058f -r 98e1ba6a672a tools/m4/extfs.m4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/m4/extfs.m4	Fri Sep 14 10:02:47 2012 +0100
@@ -0,0 +1,20 @@
+AC_DEFUN([AX_CHECK_EXTFS], [
+AC_CHECK_HEADER([ext2fs/ext2fs.h], [
+AC_CHECK_LIB([ext2fs], [ext2fs_open2], [
+    AC_DEFINE([INCLUDE_EXTFS_H], [<ext2fs/ext2fs.h>],
+              [Define extfs header to use])
+    EXTFS_LIBS="-lext2fs"
+])
+])
+dnl This is a temporary hack for CentOS 5.x, which split the ext4 support
+dnl of ext2fs in a different package. Once CentOS 5.x is no longer supported
+dnl we can remove this.
+AC_CHECK_HEADER([ext4fs/ext2fs.h], [
+AC_CHECK_LIB([ext4fs], [ext2fs_open2], [
+    AC_DEFINE([INCLUDE_EXTFS_H], [<ext4fs/ext2fs.h>],
+              [Define extfs header to use])
+    EXTFS_LIBS="-lext4fs"
+])
+])
+AC_SUBST(EXTFS_LIBS)
+])

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 21:11:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 21:11:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCdAO-00030t-Q2; Fri, 14 Sep 2012 21:11:12 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAN-00030m-W8
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:12 +0000
Received: from [85.158.143.35:2113] by server-3.bemta-4.messagelabs.com id
	FB/84-08232-F6D93505; Fri, 14 Sep 2012 21:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1347657069!6601273!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17172 invoked from network); 14 Sep 2012 21: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;
	14 Sep 2012 21: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 1TCdAK-0000Ab-TK
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAK-0008CW-7B
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:08 +0000
Message-Id: <E1TCdAK-0008CW-7B@xenbits.xen.org>
Date: Fri, 14 Sep 2012 21:11:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: handle errors from
	xc_sharing_* info functions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <Ian.Campbell@citrix.com>
# Date 1347613366 -3600
# Node ID 95a971c8058fd10c64973ce767bcb0e490f1a355
# Parent  5613018f93b1e80106655c75d8c40d28bd05323d
libxl: handle errors from xc_sharing_* info functions

On a 32 bit hypervisor xl info currently reports:
sharing_freed_memory   : 72057594037927935
sharing_used_memory    : 72057594037927935

Eat the ENOSYS and turn it into 0. Log and propagate other errors.

I don't have a 32 bit system handy, so tested on x86_64 with a libxc
hacked to return -ENOSYS and -EINVAL.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 5613018f93b1 -r 95a971c8058f tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Thu Sep 13 20:13:36 2012 +0100
+++ b/tools/libxl/libxl.c	Fri Sep 14 10:02:46 2012 +0100
@@ -3622,6 +3622,7 @@ int libxl_get_physinfo(libxl_ctx *ctx, l
 {
     xc_physinfo_t xcphysinfo = { 0 };
     int rc;
+    long l;
 
     rc = xc_physinfo(ctx->xch, &xcphysinfo);
     if (rc != 0) {
@@ -3636,8 +3637,24 @@ int libxl_get_physinfo(libxl_ctx *ctx, l
     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);
+    l = xc_sharing_freed_pages(ctx->xch);
+    if (l == -ENOSYS) {
+        l = 0;
+    } else if (l < 0) {
+        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, l,
+                            "getting sharing freed pages");
+        return ERROR_FAIL;
+    }
+    physinfo->sharing_freed_pages = l;
+    l = xc_sharing_used_frames(ctx->xch);
+    if (l == -ENOSYS) {
+        l = 0;
+    } else if (l < 0) {
+        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, l,
+                            "getting sharing used frames");
+        return ERROR_FAIL;
+    }
+    physinfo->sharing_used_frames = l;
     physinfo->nr_nodes = xcphysinfo.nr_nodes;
     memcpy(physinfo->hw_cap,xcphysinfo.hw_cap, sizeof(physinfo->hw_cap));
 

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 21:11:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 21:11:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCdAO-00030t-Q2; Fri, 14 Sep 2012 21:11:12 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAN-00030m-W8
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:12 +0000
Received: from [85.158.143.35:2113] by server-3.bemta-4.messagelabs.com id
	FB/84-08232-F6D93505; Fri, 14 Sep 2012 21:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1347657069!6601273!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17172 invoked from network); 14 Sep 2012 21: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;
	14 Sep 2012 21: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 1TCdAK-0000Ab-TK
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAK-0008CW-7B
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:08 +0000
Message-Id: <E1TCdAK-0008CW-7B@xenbits.xen.org>
Date: Fri, 14 Sep 2012 21:11:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: handle errors from
	xc_sharing_* info functions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <Ian.Campbell@citrix.com>
# Date 1347613366 -3600
# Node ID 95a971c8058fd10c64973ce767bcb0e490f1a355
# Parent  5613018f93b1e80106655c75d8c40d28bd05323d
libxl: handle errors from xc_sharing_* info functions

On a 32 bit hypervisor xl info currently reports:
sharing_freed_memory   : 72057594037927935
sharing_used_memory    : 72057594037927935

Eat the ENOSYS and turn it into 0. Log and propagate other errors.

I don't have a 32 bit system handy, so tested on x86_64 with a libxc
hacked to return -ENOSYS and -EINVAL.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 5613018f93b1 -r 95a971c8058f tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Thu Sep 13 20:13:36 2012 +0100
+++ b/tools/libxl/libxl.c	Fri Sep 14 10:02:46 2012 +0100
@@ -3622,6 +3622,7 @@ int libxl_get_physinfo(libxl_ctx *ctx, l
 {
     xc_physinfo_t xcphysinfo = { 0 };
     int rc;
+    long l;
 
     rc = xc_physinfo(ctx->xch, &xcphysinfo);
     if (rc != 0) {
@@ -3636,8 +3637,24 @@ int libxl_get_physinfo(libxl_ctx *ctx, l
     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);
+    l = xc_sharing_freed_pages(ctx->xch);
+    if (l == -ENOSYS) {
+        l = 0;
+    } else if (l < 0) {
+        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, l,
+                            "getting sharing freed pages");
+        return ERROR_FAIL;
+    }
+    physinfo->sharing_freed_pages = l;
+    l = xc_sharing_used_frames(ctx->xch);
+    if (l == -ENOSYS) {
+        l = 0;
+    } else if (l < 0) {
+        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, l,
+                            "getting sharing used frames");
+        return ERROR_FAIL;
+    }
+    physinfo->sharing_used_frames = l;
     physinfo->nr_nodes = xcphysinfo.nr_nodes;
     memcpy(physinfo->hw_cap,xcphysinfo.hw_cap, sizeof(physinfo->hw_cap));
 

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 21:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 21:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCdAQ-00031L-Vb; Fri, 14 Sep 2012 21:11:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAP-00030m-JF
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:13 +0000
Received: from [85.158.143.35:34925] by server-3.bemta-4.messagelabs.com id
	AE/84-08232-17D93505; Fri, 14 Sep 2012 21:11:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-21.messagelabs.com!1347657071!15850177!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27102 invoked from network); 14 Sep 2012 21:11: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;
	14 Sep 2012 21:11: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 1TCdAN-0000An-10
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAM-0008E9-Pa
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:10 +0000
Message-Id: <E1TCdAM-0008E9-Pa@xenbits.xen.org>
Date: Fri, 14 Sep 2012 21:11:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl: do not leak cpupool names.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1347613370 -3600
# Node ID 6ba5dd84143983ffca1d30894e32f84d0cb1e474
# Parent  ff6d9494403908d43bf61ce11bc1a5daa21133c7
xl: do not leak cpupool names.

Valgrind reports:
==3076== 7 bytes in 1 blocks are definitely lost in loss record 1 of 1
==3076==    at 0x402458C: malloc (vg_replace_malloc.c:270)
==3076==    by 0x406F86D: libxl_cpupoolid_to_name (libxl_utils.c:102)
==3076==    by 0x8058742: parse_config_data (xl_cmdimpl.c:639)
==3076==    by 0x805BD56: create_domain (xl_cmdimpl.c:1838)
==3076==    by 0x805DAED: main_create (xl_cmdimpl.c:3903)
==3076==    by 0x804D39D: main (xl.c:285)

And indeed there are several places where xl uses
libxl_cpupoolid_to_name as a boolean to test if the pool name is
valid and leaks the name if it is. Introduce an is_valid helper and
use that instead.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Juergen Gross<juergen.gross@ts.fujitsu.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r ff6d94944039 -r 6ba5dd841439 tools/libxl/libxl_utils.c
--- a/tools/libxl/libxl_utils.c	Fri Sep 14 10:02:49 2012 +0100
+++ b/tools/libxl/libxl_utils.c	Fri Sep 14 10:02:50 2012 +0100
@@ -103,6 +103,17 @@ char *libxl_cpupoolid_to_name(libxl_ctx 
     return s;
 }
 
+/* This is a bit horrid but without xs_exists it seems like the only way. */
+int libxl_cpupoolid_is_valid(libxl_ctx *ctx, uint32_t poolid)
+{
+    int ret;
+    char *s = libxl_cpupoolid_to_name(ctx, poolid);
+
+    ret = (s != NULL);
+    free(s);
+    return ret;
+}
+
 char *libxl__cpupoolid_to_name(libxl__gc *gc, uint32_t poolid)
 {
     char *s = libxl_cpupoolid_to_name(libxl__gc_owner(gc), poolid);
diff -r ff6d94944039 -r 6ba5dd841439 tools/libxl/libxl_utils.h
--- a/tools/libxl/libxl_utils.h	Fri Sep 14 10:02:49 2012 +0100
+++ b/tools/libxl/libxl_utils.h	Fri Sep 14 10:02:50 2012 +0100
@@ -24,6 +24,7 @@ int libxl_name_to_domid(libxl_ctx *ctx, 
 char *libxl_domid_to_name(libxl_ctx *ctx, uint32_t domid);
 int libxl_name_to_cpupoolid(libxl_ctx *ctx, const char *name, uint32_t *poolid);
 char *libxl_cpupoolid_to_name(libxl_ctx *ctx, uint32_t poolid);
+int libxl_cpupoolid_is_valid(libxl_ctx *ctx, uint32_t poolid);
 int libxl_get_stubdom_id(libxl_ctx *ctx, int guest_domid);
 int libxl_is_stubdom(libxl_ctx *ctx, uint32_t domid, uint32_t *target_domid);
 int libxl_create_logfile(libxl_ctx *ctx, const char *name, char **full_name);
diff -r ff6d94944039 -r 6ba5dd841439 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Fri Sep 14 10:02:49 2012 +0100
+++ b/tools/libxl/xl_cmdimpl.c	Fri Sep 14 10:02:50 2012 +0100
@@ -636,7 +636,7 @@ static void parse_config_data(const char
         c_info->poolid = -1;
         cpupool_qualifier_to_cpupoolid(buf, &c_info->poolid, NULL);
     }
-    if (!libxl_cpupoolid_to_name(ctx, c_info->poolid)) {
+    if (!libxl_cpupoolid_is_valid(ctx, c_info->poolid)) {
         fprintf(stderr, "Illegal pool specified\n");
         exit(1);
     }
@@ -4740,7 +4740,7 @@ static int sched_domain_output(libxl_sch
 
     if (cpupool) {
         if (cpupool_qualifier_to_cpupoolid(cpupool, &poolid, NULL) ||
-            !libxl_cpupoolid_to_name(ctx, poolid)) {
+            !libxl_cpupoolid_is_valid(ctx, poolid)) {
             fprintf(stderr, "unknown cpupool \'%s\'\n", cpupool);
             return -ERROR_FAIL;
         }
@@ -4870,7 +4870,7 @@ int main_sched_credit(int argc, char **a
 
         if (cpupool) {
             if (cpupool_qualifier_to_cpupoolid(cpupool, &poolid, NULL) ||
-                !libxl_cpupoolid_to_name(ctx, poolid)) {
+                !libxl_cpupoolid_is_valid(ctx, poolid)) {
                 fprintf(stderr, "unknown cpupool \'%s\'\n", cpupool);
                 return -ERROR_FAIL;
             }
@@ -6297,7 +6297,7 @@ int main_cpupooldestroy(int argc, char *
     pool = argv[optind];
 
     if (cpupool_qualifier_to_cpupoolid(pool, &poolid, NULL) ||
-        !libxl_cpupoolid_to_name(ctx, poolid)) {
+        !libxl_cpupoolid_is_valid(ctx, poolid)) {
         fprintf(stderr, "unknown cpupool \'%s\'\n", pool);
         return -ERROR_FAIL;
     }
@@ -6318,7 +6318,7 @@ int main_cpupoolrename(int argc, char **
     pool = argv[optind++];
 
     if (cpupool_qualifier_to_cpupoolid(pool, &poolid, NULL) ||
-        !libxl_cpupoolid_to_name(ctx, poolid)) {
+        !libxl_cpupoolid_is_valid(ctx, poolid)) {
         fprintf(stderr, "unknown cpupool \'%s\'\n", pool);
         return -ERROR_FAIL;
     }
@@ -6355,7 +6355,7 @@ int main_cpupoolcpuadd(int argc, char **
     }
 
     if (cpupool_qualifier_to_cpupoolid(pool, &poolid, NULL) ||
-        !libxl_cpupoolid_to_name(ctx, poolid)) {
+        !libxl_cpupoolid_is_valid(ctx, poolid)) {
         fprintf(stderr, "unknown cpupool \'%s\'\n", pool);
         return -ERROR_FAIL;
     }
@@ -6399,7 +6399,7 @@ int main_cpupoolcpuremove(int argc, char
     }
 
     if (cpupool_qualifier_to_cpupoolid(pool, &poolid, NULL) ||
-        !libxl_cpupoolid_to_name(ctx, poolid)) {
+        !libxl_cpupoolid_is_valid(ctx, poolid)) {
         fprintf(stderr, "unknown cpupool \'%s\'\n", pool);
         return -ERROR_FAIL;
     }
@@ -6442,7 +6442,7 @@ int main_cpupoolmigrate(int argc, char *
     }
 
     if (cpupool_qualifier_to_cpupoolid(pool, &poolid, NULL) ||
-        !libxl_cpupoolid_to_name(ctx, poolid)) {
+        !libxl_cpupoolid_is_valid(ctx, poolid)) {
         fprintf(stderr, "unknown cpupool \'%s\'\n", pool);
         return -ERROR_FAIL;
     }
diff -r ff6d94944039 -r 6ba5dd841439 tools/libxl/xl_sxp.c
--- a/tools/libxl/xl_sxp.c	Fri Sep 14 10:02:49 2012 +0100
+++ b/tools/libxl/xl_sxp.c	Fri Sep 14 10:02:50 2012 +0100
@@ -37,6 +37,7 @@ void printf_info_sexp(int domid, libxl_d
 
     libxl_domain_create_info *c_info = &d_config->c_info;
     libxl_domain_build_info *b_info = &d_config->b_info;
+    char *pool;
 
     printf("(domain\n\t(domid %d)\n", domid);
     printf("\t(create_info)\n");
@@ -54,8 +55,10 @@ void printf_info_sexp(int domid, libxl_d
     } else {
         printf("\t(uuid <unknown>)\n");
     }
-
-    printf("\t(cpupool %s)\n", libxl_cpupoolid_to_name(ctx, c_info->poolid));
+    pool = libxl_cpupoolid_to_name(ctx, c_info->poolid);
+    if (pool)
+        printf("\t(cpupool %s)\n", pool);
+    free(pool);
     if (c_info->xsdata)
         printf("\t(xsdata contains data)\n");
     else

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 21:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 21:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCdAQ-00031L-Vb; Fri, 14 Sep 2012 21:11:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAP-00030m-JF
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:13 +0000
Received: from [85.158.143.35:34925] by server-3.bemta-4.messagelabs.com id
	AE/84-08232-17D93505; Fri, 14 Sep 2012 21:11:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-21.messagelabs.com!1347657071!15850177!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27102 invoked from network); 14 Sep 2012 21:11: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;
	14 Sep 2012 21:11: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 1TCdAN-0000An-10
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAM-0008E9-Pa
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:10 +0000
Message-Id: <E1TCdAM-0008E9-Pa@xenbits.xen.org>
Date: Fri, 14 Sep 2012 21:11:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl: do not leak cpupool names.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1347613370 -3600
# Node ID 6ba5dd84143983ffca1d30894e32f84d0cb1e474
# Parent  ff6d9494403908d43bf61ce11bc1a5daa21133c7
xl: do not leak cpupool names.

Valgrind reports:
==3076== 7 bytes in 1 blocks are definitely lost in loss record 1 of 1
==3076==    at 0x402458C: malloc (vg_replace_malloc.c:270)
==3076==    by 0x406F86D: libxl_cpupoolid_to_name (libxl_utils.c:102)
==3076==    by 0x8058742: parse_config_data (xl_cmdimpl.c:639)
==3076==    by 0x805BD56: create_domain (xl_cmdimpl.c:1838)
==3076==    by 0x805DAED: main_create (xl_cmdimpl.c:3903)
==3076==    by 0x804D39D: main (xl.c:285)

And indeed there are several places where xl uses
libxl_cpupoolid_to_name as a boolean to test if the pool name is
valid and leaks the name if it is. Introduce an is_valid helper and
use that instead.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Juergen Gross<juergen.gross@ts.fujitsu.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r ff6d94944039 -r 6ba5dd841439 tools/libxl/libxl_utils.c
--- a/tools/libxl/libxl_utils.c	Fri Sep 14 10:02:49 2012 +0100
+++ b/tools/libxl/libxl_utils.c	Fri Sep 14 10:02:50 2012 +0100
@@ -103,6 +103,17 @@ char *libxl_cpupoolid_to_name(libxl_ctx 
     return s;
 }
 
+/* This is a bit horrid but without xs_exists it seems like the only way. */
+int libxl_cpupoolid_is_valid(libxl_ctx *ctx, uint32_t poolid)
+{
+    int ret;
+    char *s = libxl_cpupoolid_to_name(ctx, poolid);
+
+    ret = (s != NULL);
+    free(s);
+    return ret;
+}
+
 char *libxl__cpupoolid_to_name(libxl__gc *gc, uint32_t poolid)
 {
     char *s = libxl_cpupoolid_to_name(libxl__gc_owner(gc), poolid);
diff -r ff6d94944039 -r 6ba5dd841439 tools/libxl/libxl_utils.h
--- a/tools/libxl/libxl_utils.h	Fri Sep 14 10:02:49 2012 +0100
+++ b/tools/libxl/libxl_utils.h	Fri Sep 14 10:02:50 2012 +0100
@@ -24,6 +24,7 @@ int libxl_name_to_domid(libxl_ctx *ctx, 
 char *libxl_domid_to_name(libxl_ctx *ctx, uint32_t domid);
 int libxl_name_to_cpupoolid(libxl_ctx *ctx, const char *name, uint32_t *poolid);
 char *libxl_cpupoolid_to_name(libxl_ctx *ctx, uint32_t poolid);
+int libxl_cpupoolid_is_valid(libxl_ctx *ctx, uint32_t poolid);
 int libxl_get_stubdom_id(libxl_ctx *ctx, int guest_domid);
 int libxl_is_stubdom(libxl_ctx *ctx, uint32_t domid, uint32_t *target_domid);
 int libxl_create_logfile(libxl_ctx *ctx, const char *name, char **full_name);
diff -r ff6d94944039 -r 6ba5dd841439 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Fri Sep 14 10:02:49 2012 +0100
+++ b/tools/libxl/xl_cmdimpl.c	Fri Sep 14 10:02:50 2012 +0100
@@ -636,7 +636,7 @@ static void parse_config_data(const char
         c_info->poolid = -1;
         cpupool_qualifier_to_cpupoolid(buf, &c_info->poolid, NULL);
     }
-    if (!libxl_cpupoolid_to_name(ctx, c_info->poolid)) {
+    if (!libxl_cpupoolid_is_valid(ctx, c_info->poolid)) {
         fprintf(stderr, "Illegal pool specified\n");
         exit(1);
     }
@@ -4740,7 +4740,7 @@ static int sched_domain_output(libxl_sch
 
     if (cpupool) {
         if (cpupool_qualifier_to_cpupoolid(cpupool, &poolid, NULL) ||
-            !libxl_cpupoolid_to_name(ctx, poolid)) {
+            !libxl_cpupoolid_is_valid(ctx, poolid)) {
             fprintf(stderr, "unknown cpupool \'%s\'\n", cpupool);
             return -ERROR_FAIL;
         }
@@ -4870,7 +4870,7 @@ int main_sched_credit(int argc, char **a
 
         if (cpupool) {
             if (cpupool_qualifier_to_cpupoolid(cpupool, &poolid, NULL) ||
-                !libxl_cpupoolid_to_name(ctx, poolid)) {
+                !libxl_cpupoolid_is_valid(ctx, poolid)) {
                 fprintf(stderr, "unknown cpupool \'%s\'\n", cpupool);
                 return -ERROR_FAIL;
             }
@@ -6297,7 +6297,7 @@ int main_cpupooldestroy(int argc, char *
     pool = argv[optind];
 
     if (cpupool_qualifier_to_cpupoolid(pool, &poolid, NULL) ||
-        !libxl_cpupoolid_to_name(ctx, poolid)) {
+        !libxl_cpupoolid_is_valid(ctx, poolid)) {
         fprintf(stderr, "unknown cpupool \'%s\'\n", pool);
         return -ERROR_FAIL;
     }
@@ -6318,7 +6318,7 @@ int main_cpupoolrename(int argc, char **
     pool = argv[optind++];
 
     if (cpupool_qualifier_to_cpupoolid(pool, &poolid, NULL) ||
-        !libxl_cpupoolid_to_name(ctx, poolid)) {
+        !libxl_cpupoolid_is_valid(ctx, poolid)) {
         fprintf(stderr, "unknown cpupool \'%s\'\n", pool);
         return -ERROR_FAIL;
     }
@@ -6355,7 +6355,7 @@ int main_cpupoolcpuadd(int argc, char **
     }
 
     if (cpupool_qualifier_to_cpupoolid(pool, &poolid, NULL) ||
-        !libxl_cpupoolid_to_name(ctx, poolid)) {
+        !libxl_cpupoolid_is_valid(ctx, poolid)) {
         fprintf(stderr, "unknown cpupool \'%s\'\n", pool);
         return -ERROR_FAIL;
     }
@@ -6399,7 +6399,7 @@ int main_cpupoolcpuremove(int argc, char
     }
 
     if (cpupool_qualifier_to_cpupoolid(pool, &poolid, NULL) ||
-        !libxl_cpupoolid_to_name(ctx, poolid)) {
+        !libxl_cpupoolid_is_valid(ctx, poolid)) {
         fprintf(stderr, "unknown cpupool \'%s\'\n", pool);
         return -ERROR_FAIL;
     }
@@ -6442,7 +6442,7 @@ int main_cpupoolmigrate(int argc, char *
     }
 
     if (cpupool_qualifier_to_cpupoolid(pool, &poolid, NULL) ||
-        !libxl_cpupoolid_to_name(ctx, poolid)) {
+        !libxl_cpupoolid_is_valid(ctx, poolid)) {
         fprintf(stderr, "unknown cpupool \'%s\'\n", pool);
         return -ERROR_FAIL;
     }
diff -r ff6d94944039 -r 6ba5dd841439 tools/libxl/xl_sxp.c
--- a/tools/libxl/xl_sxp.c	Fri Sep 14 10:02:49 2012 +0100
+++ b/tools/libxl/xl_sxp.c	Fri Sep 14 10:02:50 2012 +0100
@@ -37,6 +37,7 @@ void printf_info_sexp(int domid, libxl_d
 
     libxl_domain_create_info *c_info = &d_config->c_info;
     libxl_domain_build_info *b_info = &d_config->b_info;
+    char *pool;
 
     printf("(domain\n\t(domid %d)\n", domid);
     printf("\t(create_info)\n");
@@ -54,8 +55,10 @@ void printf_info_sexp(int domid, libxl_d
     } else {
         printf("\t(uuid <unknown>)\n");
     }
-
-    printf("\t(cpupool %s)\n", libxl_cpupoolid_to_name(ctx, c_info->poolid));
+    pool = libxl_cpupoolid_to_name(ctx, c_info->poolid);
+    if (pool)
+        printf("\t(cpupool %s)\n", pool);
+    free(pool);
     if (c_info->xsdata)
         printf("\t(xsdata contains data)\n");
     else

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 21:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 21:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCdAT-00031s-5J; Fri, 14 Sep 2012 21:11:17 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAR-00031J-7k
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:15 +0000
Received: from [85.158.139.83:62704] by server-4.bemta-5.messagelabs.com id
	BA/32-23042-27D93505; Fri, 14 Sep 2012 21:11:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1347657072!29911681!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6088 invoked from network); 14 Sep 2012 21:11:13 -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 Sep 2012 21:11: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 1TCdAO-0000Aw-Mm
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAO-0008Fl-I1
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:12 +0000
Message-Id: <E1TCdAO-0008Fl-I1@xenbits.xen.org>
Date: Fri, 14 Sep 2012 21:11:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: Fix missing dependency in api
	check rule
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1347613372 -3600
# Node ID c51229d1522ec273710f4d248bc3bcb6ebeb1e54
# Parent  0b03d56240250d2ad5ef9e2d0c37d3b7c76922db
libxl: Fix missing dependency in api check rule

Without this, the api check cpp run might happen before the various
autogenerated files which are #include by libxl.h are ready.

We need to remove the api-ok file from AUTOINCS to avoid a circular
dependency.  Instead, we list it explicitly as a dependency of the
object files.  The result is that the api check is the last thing to
be done before make considers the preparation done and can start work
on compiling .c files into .o's.

Reported-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Tested-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 0b03d5624025 -r c51229d1522e tools/libxl/Makefile
--- a/tools/libxl/Makefile	Fri Sep 14 10:02:51 2012 +0100
+++ b/tools/libxl/Makefile	Fri Sep 14 10:02:52 2012 +0100
@@ -74,8 +74,7 @@ LIBXL_OBJS += _libxl_types.o libxl_flask
 $(LIBXL_OBJS): CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest) $(CFLAGS_libxenstore) $(CFLAGS_libblktapctl) -include $(XEN_ROOT)/tools/config.h
 
 AUTOINCS= libxlu_cfg_y.h libxlu_cfg_l.h _libxl_list.h _paths.h \
-	_libxl_save_msgs_callout.h _libxl_save_msgs_helper.h \
-        libxl.api-ok
+	_libxl_save_msgs_callout.h _libxl_save_msgs_helper.h
 AUTOSRCS= libxlu_cfg_y.c libxlu_cfg_l.c
 AUTOSRCS += _libxl_save_msgs_callout.c _libxl_save_msgs_helper.c
 LIBXLU_OBJS = libxlu_cfg_y.o libxlu_cfg_l.o libxlu_cfg.o \
@@ -102,7 +101,8 @@ testidl.c: libxl_types.idl gentest.py li
 all: $(CLIENTS) libxenlight.so libxenlight.a libxlutil.so libxlutil.a \
 	$(AUTOSRCS) $(AUTOINCS)
 
-$(LIBXL_OBJS) $(LIBXLU_OBJS) $(XL_OBJS) $(SAVE_HELPER_OBJS): $(AUTOINCS)
+$(LIBXL_OBJS) $(LIBXLU_OBJS) $(XL_OBJS) $(SAVE_HELPER_OBJS): \
+	$(AUTOINCS) libxl.api-ok
 
 %.c %.h:: %.y
 	@rm -f $*.[ch]
@@ -119,7 +119,7 @@ libxl.api-ok: check-libxl-api-rules _lib
 	$(PERL) $^
 	touch $@
 
-_%.api-for-check: %.h
+_%.api-for-check: %.h $(AUTOINCS)
 	$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_$*.o) -c -E $< $(APPEND_CFLAGS) \
 		-DLIBXL_EXTERNAL_CALLERS_ONLY=LIBXL_EXTERNAL_CALLERS_ONLY \
 		>$@.new

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 21:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 21:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCdAT-00031s-5J; Fri, 14 Sep 2012 21:11:17 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAR-00031J-7k
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:15 +0000
Received: from [85.158.139.83:62704] by server-4.bemta-5.messagelabs.com id
	BA/32-23042-27D93505; Fri, 14 Sep 2012 21:11:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1347657072!29911681!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6088 invoked from network); 14 Sep 2012 21:11:13 -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 Sep 2012 21:11: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 1TCdAO-0000Aw-Mm
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAO-0008Fl-I1
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:12 +0000
Message-Id: <E1TCdAO-0008Fl-I1@xenbits.xen.org>
Date: Fri, 14 Sep 2012 21:11:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: Fix missing dependency in api
	check rule
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1347613372 -3600
# Node ID c51229d1522ec273710f4d248bc3bcb6ebeb1e54
# Parent  0b03d56240250d2ad5ef9e2d0c37d3b7c76922db
libxl: Fix missing dependency in api check rule

Without this, the api check cpp run might happen before the various
autogenerated files which are #include by libxl.h are ready.

We need to remove the api-ok file from AUTOINCS to avoid a circular
dependency.  Instead, we list it explicitly as a dependency of the
object files.  The result is that the api check is the last thing to
be done before make considers the preparation done and can start work
on compiling .c files into .o's.

Reported-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Tested-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 0b03d5624025 -r c51229d1522e tools/libxl/Makefile
--- a/tools/libxl/Makefile	Fri Sep 14 10:02:51 2012 +0100
+++ b/tools/libxl/Makefile	Fri Sep 14 10:02:52 2012 +0100
@@ -74,8 +74,7 @@ LIBXL_OBJS += _libxl_types.o libxl_flask
 $(LIBXL_OBJS): CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest) $(CFLAGS_libxenstore) $(CFLAGS_libblktapctl) -include $(XEN_ROOT)/tools/config.h
 
 AUTOINCS= libxlu_cfg_y.h libxlu_cfg_l.h _libxl_list.h _paths.h \
-	_libxl_save_msgs_callout.h _libxl_save_msgs_helper.h \
-        libxl.api-ok
+	_libxl_save_msgs_callout.h _libxl_save_msgs_helper.h
 AUTOSRCS= libxlu_cfg_y.c libxlu_cfg_l.c
 AUTOSRCS += _libxl_save_msgs_callout.c _libxl_save_msgs_helper.c
 LIBXLU_OBJS = libxlu_cfg_y.o libxlu_cfg_l.o libxlu_cfg.o \
@@ -102,7 +101,8 @@ testidl.c: libxl_types.idl gentest.py li
 all: $(CLIENTS) libxenlight.so libxenlight.a libxlutil.so libxlutil.a \
 	$(AUTOSRCS) $(AUTOINCS)
 
-$(LIBXL_OBJS) $(LIBXLU_OBJS) $(XL_OBJS) $(SAVE_HELPER_OBJS): $(AUTOINCS)
+$(LIBXL_OBJS) $(LIBXLU_OBJS) $(XL_OBJS) $(SAVE_HELPER_OBJS): \
+	$(AUTOINCS) libxl.api-ok
 
 %.c %.h:: %.y
 	@rm -f $*.[ch]
@@ -119,7 +119,7 @@ libxl.api-ok: check-libxl-api-rules _lib
 	$(PERL) $^
 	touch $@
 
-_%.api-for-check: %.h
+_%.api-for-check: %.h $(AUTOINCS)
 	$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_$*.o) -c -E $< $(APPEND_CFLAGS) \
 		-DLIBXL_EXTERNAL_CALLERS_ONLY=LIBXL_EXTERNAL_CALLERS_ONLY \
 		>$@.new

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 21:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 21:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCdAT-00031j-28; Fri, 14 Sep 2012 21:11:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAR-00031K-C9
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:15 +0000
Received: from [85.158.143.99:29613] by server-1.bemta-4.messagelabs.com id
	E1/F2-12504-27D93505; Fri, 14 Sep 2012 21:11:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-216.messagelabs.com!1347657071!19193175!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28933 invoked from network); 14 Sep 2012 21:11:12 -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;
	14 Sep 2012 21:11: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 1TCdAN-0000Aq-H8
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAN-0008EU-Aa
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:11 +0000
Message-Id: <E1TCdAN-0008EU-Aa@xenbits.xen.org>
Date: Fri, 14 Sep 2012 21:11:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xentop.c: Change curses painting
	behavior to avoid flicker
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jason McCarver <slam@parasite.cc>
# Date 1347613371 -3600
# Node ID 116f5c34354b9013ddee6066d8dcfeed6dad19f0
# Parent  6ba5dd84143983ffca1d30894e32f84d0cb1e474
xentop.c: Change curses painting behavior to avoid flicker

Currently, xentop calls clear() before drawing the screen and calling
refresh().  This causes the entire screen to be repainted from scratch
on each call to refresh().  It is inefficient and causes visible flicker
when using xentop.

This patch fixes this by calling erase() instead of clear() which overwrites
the current screen with blanks instead.  The screen is then drawn as usual
in the top() function and refresh() is called.  This method allows curses
to only repaint the characters that have changed since the last call
to refresh(), thus avoiding the flicker and sending fewer characters to
the terminal.

In the event the screen becomes corrupted, this patch accepts a CTRL-L
keystroke from the user which will call clear() and force a repaint of
the entire screen.

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


diff -r 6ba5dd841439 -r 116f5c34354b tools/xenstat/xentop/xentop.c
--- a/tools/xenstat/xentop/xentop.c	Fri Sep 14 10:02:50 2012 +0100
+++ b/tools/xenstat/xentop/xentop.c	Fri Sep 14 10:02:51 2012 +0100
@@ -57,6 +57,7 @@
 #endif
 
 #define KEY_ESCAPE '\x1B'
+#define KEY_REPAINT '\x0C'
 
 #ifdef HOST_SunOS
 /* Old curses library on Solaris takes non-const strings. Also, ERR interferes
@@ -383,6 +384,9 @@ static int handle_key(int ch)
 		case 'd': case 'D':
 			set_prompt("Delay(sec)", set_delay);
 			break;
+		case KEY_REPAINT:
+			clear();
+			break;
 		case 'q': case 'Q': case KEY_ESCAPE:
 			return 0;
 		}
@@ -1201,7 +1205,7 @@ int main(int argc, char **argv)
 		do {
 			gettimeofday(&curtime, NULL);
 			if(ch != ERR || (curtime.tv_sec - oldtime.tv_sec) >= delay) {
-				clear();
+				erase();
 				top();
 				oldtime = curtime;
 				refresh();

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 21:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 21:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCdAT-00031j-28; Fri, 14 Sep 2012 21:11:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAR-00031K-C9
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:15 +0000
Received: from [85.158.143.99:29613] by server-1.bemta-4.messagelabs.com id
	E1/F2-12504-27D93505; Fri, 14 Sep 2012 21:11:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-216.messagelabs.com!1347657071!19193175!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28933 invoked from network); 14 Sep 2012 21:11:12 -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;
	14 Sep 2012 21:11: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 1TCdAN-0000Aq-H8
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAN-0008EU-Aa
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:11 +0000
Message-Id: <E1TCdAN-0008EU-Aa@xenbits.xen.org>
Date: Fri, 14 Sep 2012 21:11:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xentop.c: Change curses painting
	behavior to avoid flicker
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jason McCarver <slam@parasite.cc>
# Date 1347613371 -3600
# Node ID 116f5c34354b9013ddee6066d8dcfeed6dad19f0
# Parent  6ba5dd84143983ffca1d30894e32f84d0cb1e474
xentop.c: Change curses painting behavior to avoid flicker

Currently, xentop calls clear() before drawing the screen and calling
refresh().  This causes the entire screen to be repainted from scratch
on each call to refresh().  It is inefficient and causes visible flicker
when using xentop.

This patch fixes this by calling erase() instead of clear() which overwrites
the current screen with blanks instead.  The screen is then drawn as usual
in the top() function and refresh() is called.  This method allows curses
to only repaint the characters that have changed since the last call
to refresh(), thus avoiding the flicker and sending fewer characters to
the terminal.

In the event the screen becomes corrupted, this patch accepts a CTRL-L
keystroke from the user which will call clear() and force a repaint of
the entire screen.

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


diff -r 6ba5dd841439 -r 116f5c34354b tools/xenstat/xentop/xentop.c
--- a/tools/xenstat/xentop/xentop.c	Fri Sep 14 10:02:50 2012 +0100
+++ b/tools/xenstat/xentop/xentop.c	Fri Sep 14 10:02:51 2012 +0100
@@ -57,6 +57,7 @@
 #endif
 
 #define KEY_ESCAPE '\x1B'
+#define KEY_REPAINT '\x0C'
 
 #ifdef HOST_SunOS
 /* Old curses library on Solaris takes non-const strings. Also, ERR interferes
@@ -383,6 +384,9 @@ static int handle_key(int ch)
 		case 'd': case 'D':
 			set_prompt("Delay(sec)", set_delay);
 			break;
+		case KEY_REPAINT:
+			clear();
+			break;
 		case 'q': case 'Q': case KEY_ESCAPE:
 			return 0;
 		}
@@ -1201,7 +1205,7 @@ int main(int argc, char **argv)
 		do {
 			gettimeofday(&curtime, NULL);
 			if(ch != ERR || (curtime.tv_sec - oldtime.tv_sec) >= delay) {
-				clear();
+				erase();
 				top();
 				oldtime = curtime;
 				refresh();

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 21:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 21:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCdAT-000321-8n; Fri, 14 Sep 2012 21:11:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAS-00030m-4D
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:16 +0000
Received: from [85.158.143.99:29635] by server-3.bemta-4.messagelabs.com id
	73/94-08232-37D93505; Fri, 14 Sep 2012 21:11:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1347657073!25132360!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9120 invoked from network); 14 Sep 2012 21:11:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Sep 2012 21:11: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 1TCdAP-0000Az-93
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAP-0008GJ-3Z
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:13 +0000
Message-Id: <E1TCdAP-0008GJ-3Z@xenbits.xen.org>
Date: Fri, 14 Sep 2012 21:11:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: Tolerate xl config files
	missing trailing newline
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1347614715 -3600
# Node ID 28bb7ba5faf6c80d93d845b35a3626af4449f874
# Parent  c51229d1522ec273710f4d248bc3bcb6ebeb1e54
libxl: Tolerate xl config files missing trailing newline

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


diff -r c51229d1522e -r 28bb7ba5faf6 tools/libxl/libxlu_cfg_y.c
--- a/tools/libxl/libxlu_cfg_y.c	Fri Sep 14 10:02:52 2012 +0100
+++ b/tools/libxl/libxlu_cfg_y.c	Fri Sep 14 10:25:15 2012 +0100
@@ -373,18 +373,18 @@ union yyalloc
 #endif
 
 /* YYFINAL -- State number of the termination state.  */
-#define YYFINAL  2
+#define YYFINAL  3
 /* YYLAST -- Last index in YYTABLE.  */
-#define YYLAST   23
+#define YYLAST   24
 
 /* YYNTOKENS -- Number of terminals.  */
 #define YYNTOKENS  12
 /* YYNNTS -- Number of nonterminals.  */
-#define YYNNTS  9
+#define YYNNTS  11
 /* YYNRULES -- Number of rules.  */
-#define YYNRULES  19
+#define YYNRULES  22
 /* YYNRULES -- Number of states.  */
-#define YYNSTATES  28
+#define YYNSTATES  30
 
 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
 #define YYUNDEFTOK  2
@@ -430,26 +430,28 @@ static const yytype_uint8 yytranslate[] 
    YYRHS.  */
 static const yytype_uint8 yyprhs[] =
 {
-       0,     0,     3,     4,     7,    12,    14,    17,    19,    21,
-      23,    28,    30,    32,    33,    35,    39,    42,    48,    49
+       0,     0,     3,     5,     8,     9,    12,    15,    17,    20,
+      24,    26,    28,    30,    35,    37,    39,    40,    42,    46,
+      49,    55,    56
 };
 
 /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
 static const yytype_int8 yyrhs[] =
 {
-      13,     0,    -1,    -1,    13,    14,    -1,     3,     7,    16,
-      15,    -1,    15,    -1,     1,     6,    -1,     6,    -1,     8,
-      -1,    17,    -1,     9,    20,    18,    10,    -1,     4,    -1,
-       5,    -1,    -1,    19,    -1,    19,    11,    20,    -1,    17,
-      20,    -1,    19,    11,    20,    17,    20,    -1,    -1,    20,
-       6,    -1
+      13,     0,    -1,    14,    -1,    14,    16,    -1,    -1,    14,
+      15,    -1,    16,    17,    -1,    17,    -1,     1,     6,    -1,
+       3,     7,    18,    -1,     6,    -1,     8,    -1,    19,    -1,
+       9,    22,    20,    10,    -1,     4,    -1,     5,    -1,    -1,
+      21,    -1,    21,    11,    22,    -1,    19,    22,    -1,    21,
+      11,    22,    19,    22,    -1,    -1,    22,     6,    -1
 };
 
 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
 static const yytype_uint8 yyrline[] =
 {
-       0,    47,    47,    48,    50,    52,    53,    55,    56,    58,
-      59,    61,    62,    64,    65,    66,    68,    69,    71,    73
+       0,    47,    47,    48,    50,    51,    53,    54,    55,    57,
+      59,    60,    62,    63,    65,    66,    68,    69,    70,    72,
+      73,    75,    77
 };
 #endif
 
@@ -459,8 +461,8 @@ static const yytype_uint8 yyrline[] =
 static const char *const yytname[] =
 {
   "$end", "error", "$undefined", "IDENT", "STRING", "NUMBER", "NEWLINE",
-  "'='", "';'", "'['", "']'", "','", "$accept", "file", "assignment",
-  "endstmt", "value", "atom", "valuelist", "values", "nlok", 0
+  "'='", "';'", "'['", "']'", "','", "$accept", "file", "stmts", "stmt",
+  "assignment", "endstmt", "value", "atom", "valuelist", "values", "nlok", 0
 };
 #endif
 
@@ -477,15 +479,17 @@ static const yytype_uint16 yytoknum[] =
 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
 static const yytype_uint8 yyr1[] =
 {
-       0,    12,    13,    13,    14,    14,    14,    15,    15,    16,
-      16,    17,    17,    18,    18,    18,    19,    19,    20,    20
+       0,    12,    13,    13,    14,    14,    15,    15,    15,    16,
+      17,    17,    18,    18,    19,    19,    20,    20,    20,    21,
+      21,    22,    22
 };
 
 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
 static const yytype_uint8 yyr2[] =
 {
-       0,     2,     0,     2,     4,     1,     2,     1,     1,     1,
-       4,     1,     1,     0,     1,     3,     2,     5,     0,     2
+       0,     2,     1,     2,     0,     2,     2,     1,     2,     3,
+       1,     1,     1,     4,     1,     1,     0,     1,     3,     2,
+       5,     0,     2
 };
 
 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
@@ -493,59 +497,61 @@ static const yytype_uint8 yyr2[] =
    means the default is an error.  */
 static const yytype_uint8 yydefact[] =
 {
-       2,     0,     1,     0,     0,     7,     8,     3,     5,     6,
-       0,    11,    12,    18,     0,     9,    13,     4,    19,    18,
-       0,    14,    16,    10,    18,    15,    18,    17
+       4,     0,     0,     1,     0,     0,    10,    11,     5,     3,
+       7,     8,     0,     6,    14,    15,    21,     9,    12,    16,
+      22,    21,     0,    17,    19,    13,    21,    18,    21,    20
 };
 
 /* YYDEFGOTO[NTERM-NUM].  */
 static const yytype_int8 yydefgoto[] =
 {
-      -1,     1,     7,     8,    14,    15,    20,    21,    16
+      -1,     1,     2,     8,     9,    10,    17,    18,    22,    23,
+      19
 };
 
 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
    STATE-NUM.  */
-#define YYPACT_NINF -17
+#define YYPACT_NINF -18
 static const yytype_int8 yypact[] =
 {
-     -17,     2,   -17,    -5,    -3,   -17,   -17,   -17,   -17,   -17,
-      10,   -17,   -17,   -17,    14,   -17,    12,   -17,   -17,   -17,
-      11,    -4,     6,   -17,   -17,    12,   -17,     6
+     -18,     4,     0,   -18,    -1,     6,   -18,   -18,   -18,     3,
+     -18,   -18,    11,   -18,   -18,   -18,   -18,   -18,   -18,    13,
+     -18,   -18,    12,    10,    17,   -18,   -18,    13,   -18,    17
 };
 
 /* YYPGOTO[NTERM-NUM].  */
 static const yytype_int8 yypgoto[] =
 {
-     -17,   -17,   -17,     9,   -17,   -16,   -17,   -17,   -13
+     -18,   -18,   -18,   -18,   -18,    15,   -18,   -17,   -18,   -18,
+     -14
 };
 
 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
    positive, shift that token.  If negative, reduce the rule which
    number is the opposite.  If zero, do what YYDEFACT says.
    If YYTABLE_NINF, syntax error.  */
-#define YYTABLE_NINF -1
-static const yytype_uint8 yytable[] =
+#define YYTABLE_NINF -3
+static const yytype_int8 yytable[] =
 {
-      19,     9,     2,     3,    10,     4,    22,    24,     5,    26,
-       6,    25,    18,    27,    11,    12,    11,    12,    18,    13,
-       5,    23,     6,    17
+      -2,     4,    21,     5,     3,    11,     6,    24,     7,     6,
+      28,     7,    27,    12,    29,    14,    15,    14,    15,    20,
+      16,    26,    25,    20,    13
 };
 
 static const yytype_uint8 yycheck[] =
 {
-      16,     6,     0,     1,     7,     3,    19,    11,     6,    25,
-       8,    24,     6,    26,     4,     5,     4,     5,     6,     9,
-       6,    10,     8,    14
+       0,     1,    19,     3,     0,     6,     6,    21,     8,     6,
+      27,     8,    26,     7,    28,     4,     5,     4,     5,     6,
+       9,    11,    10,     6,     9
 };
 
 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
    symbol of state STATE-NUM.  */
 static const yytype_uint8 yystos[] =
 {
-       0,    13,     0,     1,     3,     6,     8,    14,    15,     6,
-       7,     4,     5,     9,    16,    17,    20,    15,     6,    17,
-      18,    19,    20,    10,    11,    20,    17,    20
+       0,    13,    14,     0,     1,     3,     6,     8,    15,    16,
+      17,     6,     7,    17,     4,     5,     9,    18,    19,    22,
+       6,    19,    20,    21,    22,    10,    11,    22,    19,    22
 };
 
 #define yyerrok		(yyerrstatus = 0)
@@ -1077,7 +1083,7 @@ yydestruct (yymsg, yytype, yyvaluep, yyl
 	{ free((yyvaluep->string)); };
 
 /* Line 1000 of yacc.c  */
-#line 1081 "libxlu_cfg_y.c"
+#line 1087 "libxlu_cfg_y.c"
 	break;
       case 4: /* "STRING" */
 
@@ -1086,7 +1092,7 @@ yydestruct (yymsg, yytype, yyvaluep, yyl
 	{ free((yyvaluep->string)); };
 
 /* Line 1000 of yacc.c  */
-#line 1090 "libxlu_cfg_y.c"
+#line 1096 "libxlu_cfg_y.c"
 	break;
       case 5: /* "NUMBER" */
 
@@ -1095,43 +1101,43 @@ yydestruct (yymsg, yytype, yyvaluep, yyl
 	{ free((yyvaluep->string)); };
 
 /* Line 1000 of yacc.c  */
-#line 1099 "libxlu_cfg_y.c"
+#line 1105 "libxlu_cfg_y.c"
 	break;
-      case 16: /* "value" */
+      case 18: /* "value" */
 
 /* Line 1000 of yacc.c  */
 #line 43 "libxlu_cfg_y.y"
 	{ xlu__cfg_set_free((yyvaluep->setting)); };
 
 /* Line 1000 of yacc.c  */
-#line 1108 "libxlu_cfg_y.c"
+#line 1114 "libxlu_cfg_y.c"
 	break;
-      case 17: /* "atom" */
+      case 19: /* "atom" */
 
 /* Line 1000 of yacc.c  */
 #line 40 "libxlu_cfg_y.y"
 	{ free((yyvaluep->string)); };
 
 /* Line 1000 of yacc.c  */
-#line 1117 "libxlu_cfg_y.c"
+#line 1123 "libxlu_cfg_y.c"
 	break;
-      case 18: /* "valuelist" */
+      case 20: /* "valuelist" */
 
 /* Line 1000 of yacc.c  */
 #line 43 "libxlu_cfg_y.y"
 	{ xlu__cfg_set_free((yyvaluep->setting)); };
 
 /* Line 1000 of yacc.c  */
-#line 1126 "libxlu_cfg_y.c"
+#line 1132 "libxlu_cfg_y.c"
 	break;
-      case 19: /* "values" */
+      case 21: /* "values" */
 
 /* Line 1000 of yacc.c  */
 #line 43 "libxlu_cfg_y.y"
 	{ xlu__cfg_set_free((yyvaluep->setting)); };
 
 /* Line 1000 of yacc.c  */
-#line 1135 "libxlu_cfg_y.c"
+#line 1141 "libxlu_cfg_y.c"
 	break;
 
       default:
@@ -1459,80 +1465,80 @@ yyreduce:
   YY_REDUCE_PRINT (yyn);
   switch (yyn)
     {
-        case 4:
+        case 9:
 
 /* Line 1455 of yacc.c  */
-#line 51 "libxlu_cfg_y.y"
-    { xlu__cfg_set_store(ctx,(yyvsp[(1) - (4)].string),(yyvsp[(3) - (4)].setting),(yylsp[(3) - (4)]).first_line); ;}
-    break;
-
-  case 9:
-
-/* Line 1455 of yacc.c  */
-#line 58 "libxlu_cfg_y.y"
-    { (yyval.setting)= xlu__cfg_set_mk(ctx,1,(yyvsp[(1) - (1)].string)); ;}
-    break;
-
-  case 10:
-
-/* Line 1455 of yacc.c  */
-#line 59 "libxlu_cfg_y.y"
-    { (yyval.setting)= (yyvsp[(3) - (4)].setting); ;}
-    break;
-
-  case 11:
-
-/* Line 1455 of yacc.c  */
-#line 61 "libxlu_cfg_y.y"
-    { (yyval.string)= (yyvsp[(1) - (1)].string); ;}
+#line 57 "libxlu_cfg_y.y"
+    { xlu__cfg_set_store(ctx,(yyvsp[(1) - (3)].string),(yyvsp[(3) - (3)].setting),(yylsp[(3) - (3)]).first_line); ;}
     break;
 
   case 12:
 
 /* Line 1455 of yacc.c  */
 #line 62 "libxlu_cfg_y.y"
-    { (yyval.string)= (yyvsp[(1) - (1)].string); ;}
+    { (yyval.setting)= xlu__cfg_set_mk(ctx,1,(yyvsp[(1) - (1)].string)); ;}
     break;
 
   case 13:
 
 /* Line 1455 of yacc.c  */
-#line 64 "libxlu_cfg_y.y"
-    { (yyval.setting)= xlu__cfg_set_mk(ctx,0,0); ;}
+#line 63 "libxlu_cfg_y.y"
+    { (yyval.setting)= (yyvsp[(3) - (4)].setting); ;}
     break;
 
   case 14:
 
 /* Line 1455 of yacc.c  */
 #line 65 "libxlu_cfg_y.y"
-    { (yyval.setting)= (yyvsp[(1) - (1)].setting); ;}
+    { (yyval.string)= (yyvsp[(1) - (1)].string); ;}
     break;
 
   case 15:
 
 /* Line 1455 of yacc.c  */
 #line 66 "libxlu_cfg_y.y"
-    { (yyval.setting)= (yyvsp[(1) - (3)].setting); ;}
+    { (yyval.string)= (yyvsp[(1) - (1)].string); ;}
     break;
 
   case 16:
 
 /* Line 1455 of yacc.c  */
 #line 68 "libxlu_cfg_y.y"
-    { (yyval.setting)= xlu__cfg_set_mk(ctx,2,(yyvsp[(1) - (2)].string)); ;}
+    { (yyval.setting)= xlu__cfg_set_mk(ctx,0,0); ;}
     break;
 
   case 17:
 
 /* Line 1455 of yacc.c  */
 #line 69 "libxlu_cfg_y.y"
+    { (yyval.setting)= (yyvsp[(1) - (1)].setting); ;}
+    break;
+
+  case 18:
+
+/* Line 1455 of yacc.c  */
+#line 70 "libxlu_cfg_y.y"
+    { (yyval.setting)= (yyvsp[(1) - (3)].setting); ;}
+    break;
+
+  case 19:
+
+/* Line 1455 of yacc.c  */
+#line 72 "libxlu_cfg_y.y"
+    { (yyval.setting)= xlu__cfg_set_mk(ctx,2,(yyvsp[(1) - (2)].string)); ;}
+    break;
+
+  case 20:
+
+/* Line 1455 of yacc.c  */
+#line 73 "libxlu_cfg_y.y"
     { xlu__cfg_set_add(ctx,(yyvsp[(1) - (5)].setting),(yyvsp[(4) - (5)].string)); (yyval.setting)= (yyvsp[(1) - (5)].setting); ;}
     break;
 
 
 
 /* Line 1455 of yacc.c  */
-#line 1536 "libxlu_cfg_y.c"
+#line 1542 "libxlu_cfg_y.c"
       default: break;
     }
   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
diff -r c51229d1522e -r 28bb7ba5faf6 tools/libxl/libxlu_cfg_y.y
--- a/tools/libxl/libxlu_cfg_y.y	Fri Sep 14 10:02:52 2012 +0100
+++ b/tools/libxl/libxlu_cfg_y.y	Fri Sep 14 10:25:15 2012 +0100
@@ -44,14 +44,18 @@
 
 %%
 
-file: /* empty */
- |     file assignment
+file:  stmts
+ |     stmts assignment
 
-assignment: IDENT '=' value endstmt
-                            { xlu__cfg_set_store(ctx,$1,$3,@3.first_line); }
+stmts:  /* empty */
+ |      stmts stmt
+
+stmt:   assignment endstmt
  |      endstmt
  |      error NEWLINE
 
+assignment: IDENT '=' value { xlu__cfg_set_store(ctx,$1,$3,@3.first_line); }
+
 endstmt: NEWLINE
  |      ';'
 

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 21:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 21:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCdAT-000321-8n; Fri, 14 Sep 2012 21:11:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAS-00030m-4D
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:16 +0000
Received: from [85.158.143.99:29635] by server-3.bemta-4.messagelabs.com id
	73/94-08232-37D93505; Fri, 14 Sep 2012 21:11:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1347657073!25132360!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9120 invoked from network); 14 Sep 2012 21:11:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Sep 2012 21:11: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 1TCdAP-0000Az-93
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAP-0008GJ-3Z
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:13 +0000
Message-Id: <E1TCdAP-0008GJ-3Z@xenbits.xen.org>
Date: Fri, 14 Sep 2012 21:11:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: Tolerate xl config files
	missing trailing newline
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1347614715 -3600
# Node ID 28bb7ba5faf6c80d93d845b35a3626af4449f874
# Parent  c51229d1522ec273710f4d248bc3bcb6ebeb1e54
libxl: Tolerate xl config files missing trailing newline

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


diff -r c51229d1522e -r 28bb7ba5faf6 tools/libxl/libxlu_cfg_y.c
--- a/tools/libxl/libxlu_cfg_y.c	Fri Sep 14 10:02:52 2012 +0100
+++ b/tools/libxl/libxlu_cfg_y.c	Fri Sep 14 10:25:15 2012 +0100
@@ -373,18 +373,18 @@ union yyalloc
 #endif
 
 /* YYFINAL -- State number of the termination state.  */
-#define YYFINAL  2
+#define YYFINAL  3
 /* YYLAST -- Last index in YYTABLE.  */
-#define YYLAST   23
+#define YYLAST   24
 
 /* YYNTOKENS -- Number of terminals.  */
 #define YYNTOKENS  12
 /* YYNNTS -- Number of nonterminals.  */
-#define YYNNTS  9
+#define YYNNTS  11
 /* YYNRULES -- Number of rules.  */
-#define YYNRULES  19
+#define YYNRULES  22
 /* YYNRULES -- Number of states.  */
-#define YYNSTATES  28
+#define YYNSTATES  30
 
 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
 #define YYUNDEFTOK  2
@@ -430,26 +430,28 @@ static const yytype_uint8 yytranslate[] 
    YYRHS.  */
 static const yytype_uint8 yyprhs[] =
 {
-       0,     0,     3,     4,     7,    12,    14,    17,    19,    21,
-      23,    28,    30,    32,    33,    35,    39,    42,    48,    49
+       0,     0,     3,     5,     8,     9,    12,    15,    17,    20,
+      24,    26,    28,    30,    35,    37,    39,    40,    42,    46,
+      49,    55,    56
 };
 
 /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
 static const yytype_int8 yyrhs[] =
 {
-      13,     0,    -1,    -1,    13,    14,    -1,     3,     7,    16,
-      15,    -1,    15,    -1,     1,     6,    -1,     6,    -1,     8,
-      -1,    17,    -1,     9,    20,    18,    10,    -1,     4,    -1,
-       5,    -1,    -1,    19,    -1,    19,    11,    20,    -1,    17,
-      20,    -1,    19,    11,    20,    17,    20,    -1,    -1,    20,
-       6,    -1
+      13,     0,    -1,    14,    -1,    14,    16,    -1,    -1,    14,
+      15,    -1,    16,    17,    -1,    17,    -1,     1,     6,    -1,
+       3,     7,    18,    -1,     6,    -1,     8,    -1,    19,    -1,
+       9,    22,    20,    10,    -1,     4,    -1,     5,    -1,    -1,
+      21,    -1,    21,    11,    22,    -1,    19,    22,    -1,    21,
+      11,    22,    19,    22,    -1,    -1,    22,     6,    -1
 };
 
 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
 static const yytype_uint8 yyrline[] =
 {
-       0,    47,    47,    48,    50,    52,    53,    55,    56,    58,
-      59,    61,    62,    64,    65,    66,    68,    69,    71,    73
+       0,    47,    47,    48,    50,    51,    53,    54,    55,    57,
+      59,    60,    62,    63,    65,    66,    68,    69,    70,    72,
+      73,    75,    77
 };
 #endif
 
@@ -459,8 +461,8 @@ static const yytype_uint8 yyrline[] =
 static const char *const yytname[] =
 {
   "$end", "error", "$undefined", "IDENT", "STRING", "NUMBER", "NEWLINE",
-  "'='", "';'", "'['", "']'", "','", "$accept", "file", "assignment",
-  "endstmt", "value", "atom", "valuelist", "values", "nlok", 0
+  "'='", "';'", "'['", "']'", "','", "$accept", "file", "stmts", "stmt",
+  "assignment", "endstmt", "value", "atom", "valuelist", "values", "nlok", 0
 };
 #endif
 
@@ -477,15 +479,17 @@ static const yytype_uint16 yytoknum[] =
 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
 static const yytype_uint8 yyr1[] =
 {
-       0,    12,    13,    13,    14,    14,    14,    15,    15,    16,
-      16,    17,    17,    18,    18,    18,    19,    19,    20,    20
+       0,    12,    13,    13,    14,    14,    15,    15,    15,    16,
+      17,    17,    18,    18,    19,    19,    20,    20,    20,    21,
+      21,    22,    22
 };
 
 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
 static const yytype_uint8 yyr2[] =
 {
-       0,     2,     0,     2,     4,     1,     2,     1,     1,     1,
-       4,     1,     1,     0,     1,     3,     2,     5,     0,     2
+       0,     2,     1,     2,     0,     2,     2,     1,     2,     3,
+       1,     1,     1,     4,     1,     1,     0,     1,     3,     2,
+       5,     0,     2
 };
 
 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
@@ -493,59 +497,61 @@ static const yytype_uint8 yyr2[] =
    means the default is an error.  */
 static const yytype_uint8 yydefact[] =
 {
-       2,     0,     1,     0,     0,     7,     8,     3,     5,     6,
-       0,    11,    12,    18,     0,     9,    13,     4,    19,    18,
-       0,    14,    16,    10,    18,    15,    18,    17
+       4,     0,     0,     1,     0,     0,    10,    11,     5,     3,
+       7,     8,     0,     6,    14,    15,    21,     9,    12,    16,
+      22,    21,     0,    17,    19,    13,    21,    18,    21,    20
 };
 
 /* YYDEFGOTO[NTERM-NUM].  */
 static const yytype_int8 yydefgoto[] =
 {
-      -1,     1,     7,     8,    14,    15,    20,    21,    16
+      -1,     1,     2,     8,     9,    10,    17,    18,    22,    23,
+      19
 };
 
 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
    STATE-NUM.  */
-#define YYPACT_NINF -17
+#define YYPACT_NINF -18
 static const yytype_int8 yypact[] =
 {
-     -17,     2,   -17,    -5,    -3,   -17,   -17,   -17,   -17,   -17,
-      10,   -17,   -17,   -17,    14,   -17,    12,   -17,   -17,   -17,
-      11,    -4,     6,   -17,   -17,    12,   -17,     6
+     -18,     4,     0,   -18,    -1,     6,   -18,   -18,   -18,     3,
+     -18,   -18,    11,   -18,   -18,   -18,   -18,   -18,   -18,    13,
+     -18,   -18,    12,    10,    17,   -18,   -18,    13,   -18,    17
 };
 
 /* YYPGOTO[NTERM-NUM].  */
 static const yytype_int8 yypgoto[] =
 {
-     -17,   -17,   -17,     9,   -17,   -16,   -17,   -17,   -13
+     -18,   -18,   -18,   -18,   -18,    15,   -18,   -17,   -18,   -18,
+     -14
 };
 
 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
    positive, shift that token.  If negative, reduce the rule which
    number is the opposite.  If zero, do what YYDEFACT says.
    If YYTABLE_NINF, syntax error.  */
-#define YYTABLE_NINF -1
-static const yytype_uint8 yytable[] =
+#define YYTABLE_NINF -3
+static const yytype_int8 yytable[] =
 {
-      19,     9,     2,     3,    10,     4,    22,    24,     5,    26,
-       6,    25,    18,    27,    11,    12,    11,    12,    18,    13,
-       5,    23,     6,    17
+      -2,     4,    21,     5,     3,    11,     6,    24,     7,     6,
+      28,     7,    27,    12,    29,    14,    15,    14,    15,    20,
+      16,    26,    25,    20,    13
 };
 
 static const yytype_uint8 yycheck[] =
 {
-      16,     6,     0,     1,     7,     3,    19,    11,     6,    25,
-       8,    24,     6,    26,     4,     5,     4,     5,     6,     9,
-       6,    10,     8,    14
+       0,     1,    19,     3,     0,     6,     6,    21,     8,     6,
+      27,     8,    26,     7,    28,     4,     5,     4,     5,     6,
+       9,    11,    10,     6,     9
 };
 
 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
    symbol of state STATE-NUM.  */
 static const yytype_uint8 yystos[] =
 {
-       0,    13,     0,     1,     3,     6,     8,    14,    15,     6,
-       7,     4,     5,     9,    16,    17,    20,    15,     6,    17,
-      18,    19,    20,    10,    11,    20,    17,    20
+       0,    13,    14,     0,     1,     3,     6,     8,    15,    16,
+      17,     6,     7,    17,     4,     5,     9,    18,    19,    22,
+       6,    19,    20,    21,    22,    10,    11,    22,    19,    22
 };
 
 #define yyerrok		(yyerrstatus = 0)
@@ -1077,7 +1083,7 @@ yydestruct (yymsg, yytype, yyvaluep, yyl
 	{ free((yyvaluep->string)); };
 
 /* Line 1000 of yacc.c  */
-#line 1081 "libxlu_cfg_y.c"
+#line 1087 "libxlu_cfg_y.c"
 	break;
       case 4: /* "STRING" */
 
@@ -1086,7 +1092,7 @@ yydestruct (yymsg, yytype, yyvaluep, yyl
 	{ free((yyvaluep->string)); };
 
 /* Line 1000 of yacc.c  */
-#line 1090 "libxlu_cfg_y.c"
+#line 1096 "libxlu_cfg_y.c"
 	break;
       case 5: /* "NUMBER" */
 
@@ -1095,43 +1101,43 @@ yydestruct (yymsg, yytype, yyvaluep, yyl
 	{ free((yyvaluep->string)); };
 
 /* Line 1000 of yacc.c  */
-#line 1099 "libxlu_cfg_y.c"
+#line 1105 "libxlu_cfg_y.c"
 	break;
-      case 16: /* "value" */
+      case 18: /* "value" */
 
 /* Line 1000 of yacc.c  */
 #line 43 "libxlu_cfg_y.y"
 	{ xlu__cfg_set_free((yyvaluep->setting)); };
 
 /* Line 1000 of yacc.c  */
-#line 1108 "libxlu_cfg_y.c"
+#line 1114 "libxlu_cfg_y.c"
 	break;
-      case 17: /* "atom" */
+      case 19: /* "atom" */
 
 /* Line 1000 of yacc.c  */
 #line 40 "libxlu_cfg_y.y"
 	{ free((yyvaluep->string)); };
 
 /* Line 1000 of yacc.c  */
-#line 1117 "libxlu_cfg_y.c"
+#line 1123 "libxlu_cfg_y.c"
 	break;
-      case 18: /* "valuelist" */
+      case 20: /* "valuelist" */
 
 /* Line 1000 of yacc.c  */
 #line 43 "libxlu_cfg_y.y"
 	{ xlu__cfg_set_free((yyvaluep->setting)); };
 
 /* Line 1000 of yacc.c  */
-#line 1126 "libxlu_cfg_y.c"
+#line 1132 "libxlu_cfg_y.c"
 	break;
-      case 19: /* "values" */
+      case 21: /* "values" */
 
 /* Line 1000 of yacc.c  */
 #line 43 "libxlu_cfg_y.y"
 	{ xlu__cfg_set_free((yyvaluep->setting)); };
 
 /* Line 1000 of yacc.c  */
-#line 1135 "libxlu_cfg_y.c"
+#line 1141 "libxlu_cfg_y.c"
 	break;
 
       default:
@@ -1459,80 +1465,80 @@ yyreduce:
   YY_REDUCE_PRINT (yyn);
   switch (yyn)
     {
-        case 4:
+        case 9:
 
 /* Line 1455 of yacc.c  */
-#line 51 "libxlu_cfg_y.y"
-    { xlu__cfg_set_store(ctx,(yyvsp[(1) - (4)].string),(yyvsp[(3) - (4)].setting),(yylsp[(3) - (4)]).first_line); ;}
-    break;
-
-  case 9:
-
-/* Line 1455 of yacc.c  */
-#line 58 "libxlu_cfg_y.y"
-    { (yyval.setting)= xlu__cfg_set_mk(ctx,1,(yyvsp[(1) - (1)].string)); ;}
-    break;
-
-  case 10:
-
-/* Line 1455 of yacc.c  */
-#line 59 "libxlu_cfg_y.y"
-    { (yyval.setting)= (yyvsp[(3) - (4)].setting); ;}
-    break;
-
-  case 11:
-
-/* Line 1455 of yacc.c  */
-#line 61 "libxlu_cfg_y.y"
-    { (yyval.string)= (yyvsp[(1) - (1)].string); ;}
+#line 57 "libxlu_cfg_y.y"
+    { xlu__cfg_set_store(ctx,(yyvsp[(1) - (3)].string),(yyvsp[(3) - (3)].setting),(yylsp[(3) - (3)]).first_line); ;}
     break;
 
   case 12:
 
 /* Line 1455 of yacc.c  */
 #line 62 "libxlu_cfg_y.y"
-    { (yyval.string)= (yyvsp[(1) - (1)].string); ;}
+    { (yyval.setting)= xlu__cfg_set_mk(ctx,1,(yyvsp[(1) - (1)].string)); ;}
     break;
 
   case 13:
 
 /* Line 1455 of yacc.c  */
-#line 64 "libxlu_cfg_y.y"
-    { (yyval.setting)= xlu__cfg_set_mk(ctx,0,0); ;}
+#line 63 "libxlu_cfg_y.y"
+    { (yyval.setting)= (yyvsp[(3) - (4)].setting); ;}
     break;
 
   case 14:
 
 /* Line 1455 of yacc.c  */
 #line 65 "libxlu_cfg_y.y"
-    { (yyval.setting)= (yyvsp[(1) - (1)].setting); ;}
+    { (yyval.string)= (yyvsp[(1) - (1)].string); ;}
     break;
 
   case 15:
 
 /* Line 1455 of yacc.c  */
 #line 66 "libxlu_cfg_y.y"
-    { (yyval.setting)= (yyvsp[(1) - (3)].setting); ;}
+    { (yyval.string)= (yyvsp[(1) - (1)].string); ;}
     break;
 
   case 16:
 
 /* Line 1455 of yacc.c  */
 #line 68 "libxlu_cfg_y.y"
-    { (yyval.setting)= xlu__cfg_set_mk(ctx,2,(yyvsp[(1) - (2)].string)); ;}
+    { (yyval.setting)= xlu__cfg_set_mk(ctx,0,0); ;}
     break;
 
   case 17:
 
 /* Line 1455 of yacc.c  */
 #line 69 "libxlu_cfg_y.y"
+    { (yyval.setting)= (yyvsp[(1) - (1)].setting); ;}
+    break;
+
+  case 18:
+
+/* Line 1455 of yacc.c  */
+#line 70 "libxlu_cfg_y.y"
+    { (yyval.setting)= (yyvsp[(1) - (3)].setting); ;}
+    break;
+
+  case 19:
+
+/* Line 1455 of yacc.c  */
+#line 72 "libxlu_cfg_y.y"
+    { (yyval.setting)= xlu__cfg_set_mk(ctx,2,(yyvsp[(1) - (2)].string)); ;}
+    break;
+
+  case 20:
+
+/* Line 1455 of yacc.c  */
+#line 73 "libxlu_cfg_y.y"
     { xlu__cfg_set_add(ctx,(yyvsp[(1) - (5)].setting),(yyvsp[(4) - (5)].string)); (yyval.setting)= (yyvsp[(1) - (5)].setting); ;}
     break;
 
 
 
 /* Line 1455 of yacc.c  */
-#line 1536 "libxlu_cfg_y.c"
+#line 1542 "libxlu_cfg_y.c"
       default: break;
     }
   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
diff -r c51229d1522e -r 28bb7ba5faf6 tools/libxl/libxlu_cfg_y.y
--- a/tools/libxl/libxlu_cfg_y.y	Fri Sep 14 10:02:52 2012 +0100
+++ b/tools/libxl/libxlu_cfg_y.y	Fri Sep 14 10:25:15 2012 +0100
@@ -44,14 +44,18 @@
 
 %%
 
-file: /* empty */
- |     file assignment
+file:  stmts
+ |     stmts assignment
 
-assignment: IDENT '=' value endstmt
-                            { xlu__cfg_set_store(ctx,$1,$3,@3.first_line); }
+stmts:  /* empty */
+ |      stmts stmt
+
+stmt:   assignment endstmt
  |      endstmt
  |      error NEWLINE
 
+assignment: IDENT '=' value { xlu__cfg_set_store(ctx,$1,$3,@3.first_line); }
+
 endstmt: NEWLINE
  |      ';'
 

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 21:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 21:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCdAU-00033Y-Ma; Fri, 14 Sep 2012 21:11:18 +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 1TCdAT-00031h-5T
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:17 +0000
Received: from [85.158.138.51:24072] by server-2.bemta-3.messagelabs.com id
	FA/36-04862-47D93505; Fri, 14 Sep 2012 21:11:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-174.messagelabs.com!1347657074!30115777!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3732 invoked from network); 14 Sep 2012 21:11:15 -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;
	14 Sep 2012 21:11: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 1TCdAP-0000B2-SY
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAP-0008Gk-MM
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:13 +0000
Message-Id: <E1TCdAP-0008Gk-MM@xenbits.xen.org>
Date: Fri, 14 Sep 2012 21:11:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] amd iommu: use base platform MSI
	implementation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347625046 -7200
# Node ID 5e4a00b4114c1c391b3d91d578d7fc2ac47600cb
# Parent  28bb7ba5faf6c80d93d845b35a3626af4449f874
amd iommu: use base platform MSI implementation

Given that here, other than for VT-d, the MSI interface gets surfaced
through a normal PCI device, the code should use as much as possible of
the "normal" MSI support code.

Further, the code can (and should) follow the "normal" MSI code in
distinguishing the maskable and non-maskable cases at the IRQ
controller level rather than checking the respective flag in the
individual actors.

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


diff -r 28bb7ba5faf6 -r 5e4a00b4114c xen/arch/x86/msi.c
--- a/xen/arch/x86/msi.c	Fri Sep 14 10:25:15 2012 +0100
+++ b/xen/arch/x86/msi.c	Fri Sep 14 14:17:26 2012 +0200
@@ -13,6 +13,7 @@
 #include <xen/delay.h>
 #include <xen/sched.h>
 #include <xen/acpi.h>
+#include <xen/cpu.h>
 #include <xen/errno.h>
 #include <xen/pci.h>
 #include <xen/pci_regs.h>
@@ -32,8 +33,9 @@
 #include <xsm/xsm.h>
 
 /* bitmap indicate which fixed map is free */
-DEFINE_SPINLOCK(msix_fixmap_lock);
-DECLARE_BITMAP(msix_fixmap_pages, FIX_MSIX_MAX_PAGES);
+static DEFINE_SPINLOCK(msix_fixmap_lock);
+static DECLARE_BITMAP(msix_fixmap_pages, FIX_MSIX_MAX_PAGES);
+static DEFINE_PER_CPU(cpumask_var_t, scratch_mask);
 
 static int msix_fixmap_alloc(void)
 {
@@ -126,13 +128,17 @@ void msi_compose_msg(struct irq_desc *de
     unsigned dest;
     int vector = desc->arch.vector;
 
-    if ( cpumask_empty(desc->arch.cpu_mask) ) {
+    memset(msg, 0, sizeof(*msg));
+    if ( !cpumask_intersects(desc->arch.cpu_mask, &cpu_online_map) ) {
         dprintk(XENLOG_ERR,"%s, compose msi message error!!\n", __func__);
         return;
     }
 
     if ( vector ) {
-        dest = cpu_mask_to_apicid(desc->arch.cpu_mask);
+        cpumask_t *mask = this_cpu(scratch_mask);
+
+        cpumask_and(mask, desc->arch.cpu_mask, &cpu_online_map);
+        dest = cpu_mask_to_apicid(mask);
 
         msg->address_hi = MSI_ADDR_BASE_HI;
         msg->address_lo =
@@ -281,23 +287,27 @@ static void set_msi_affinity(struct irq_
     write_msi_msg(msi_desc, &msg);
 }
 
+void __msi_set_enable(u16 seg, u8 bus, u8 slot, u8 func, int pos, int enable)
+{
+    u16 control = pci_conf_read16(seg, bus, slot, func, pos + PCI_MSI_FLAGS);
+
+    control &= ~PCI_MSI_FLAGS_ENABLE;
+    if ( enable )
+        control |= PCI_MSI_FLAGS_ENABLE;
+    pci_conf_write16(seg, bus, slot, func, pos + PCI_MSI_FLAGS, control);
+}
+
 static void msi_set_enable(struct pci_dev *dev, int enable)
 {
     int pos;
-    u16 control, seg = dev->seg;
+    u16 seg = dev->seg;
     u8 bus = dev->bus;
     u8 slot = PCI_SLOT(dev->devfn);
     u8 func = PCI_FUNC(dev->devfn);
 
     pos = pci_find_cap_offset(seg, bus, slot, func, PCI_CAP_ID_MSI);
     if ( pos )
-    {
-        control = pci_conf_read16(seg, bus, slot, func, pos + PCI_MSI_FLAGS);
-        control &= ~PCI_MSI_FLAGS_ENABLE;
-        if ( enable )
-            control |= PCI_MSI_FLAGS_ENABLE;
-        pci_conf_write16(seg, bus, slot, func, pos + PCI_MSI_FLAGS, control);
-    }
+        __msi_set_enable(seg, bus, slot, func, pos, enable);
 }
 
 static void msix_set_enable(struct pci_dev *dev, int enable)
@@ -379,12 +389,12 @@ static int msi_get_mask_bit(const struct
     return -1;
 }
 
-static void mask_msi_irq(struct irq_desc *desc)
+void mask_msi_irq(struct irq_desc *desc)
 {
     msi_set_mask_bit(desc, 1);
 }
 
-static void unmask_msi_irq(struct irq_desc *desc)
+void unmask_msi_irq(struct irq_desc *desc)
 {
     msi_set_mask_bit(desc, 0);
 }
@@ -395,7 +405,7 @@ static unsigned int startup_msi_irq(stru
     return 0;
 }
 
-static void ack_nonmaskable_msi_irq(struct irq_desc *desc)
+void ack_nonmaskable_msi_irq(struct irq_desc *desc)
 {
     irq_complete_move(desc);
     move_native_irq(desc);
@@ -407,7 +417,7 @@ static void ack_maskable_msi_irq(struct 
     ack_APIC_irq(); /* ACKTYPE_NONE */
 }
 
-static void end_nonmaskable_msi_irq(struct irq_desc *desc, u8 vector)
+void end_nonmaskable_msi_irq(struct irq_desc *desc, u8 vector)
 {
     ack_APIC_irq(); /* ACKTYPE_EOI */
 }
@@ -1071,6 +1081,40 @@ unsigned int pci_msix_get_table_len(stru
     return len;
 }
 
+static int msi_cpu_callback(
+    struct notifier_block *nfb, unsigned long action, void *hcpu)
+{
+    unsigned int cpu = (unsigned long)hcpu;
+
+    switch ( action )
+    {
+    case CPU_UP_PREPARE:
+        if ( !alloc_cpumask_var(&per_cpu(scratch_mask, cpu)) )
+            return notifier_from_errno(ENOMEM);
+        break;
+    case CPU_UP_CANCELED:
+    case CPU_DEAD:
+        free_cpumask_var(per_cpu(scratch_mask, cpu));
+        break;
+    default:
+        break;
+    }
+
+    return NOTIFY_DONE;
+}
+
+static struct notifier_block msi_cpu_nfb = {
+    .notifier_call = msi_cpu_callback
+};
+
+void __init early_msi_init(void)
+{
+    register_cpu_notifier(&msi_cpu_nfb);
+    if ( msi_cpu_callback(&msi_cpu_nfb, CPU_UP_PREPARE, NULL) &
+         NOTIFY_STOP_MASK )
+        BUG();
+}
+
 static void dump_msi(unsigned char key)
 {
     unsigned int irq;
diff -r 28bb7ba5faf6 -r 5e4a00b4114c xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c	Fri Sep 14 10:25:15 2012 +0100
+++ b/xen/arch/x86/setup.c	Fri Sep 14 14:17:26 2012 +0200
@@ -33,6 +33,7 @@
 #include <asm/processor.h>
 #include <asm/mpspec.h>
 #include <asm/apic.h>
+#include <asm/msi.h>
 #include <asm/desc.h>
 #include <asm/paging.h>
 #include <asm/e820.h>
@@ -1199,6 +1200,8 @@ void __init __start_xen(unsigned long mb
 
     acpi_mmcfg_init();
 
+    early_msi_init();
+
     iommu_setup();    /* setup iommu if available */
 
     smp_prepare_cpus(max_cpus);
diff -r 28bb7ba5faf6 -r 5e4a00b4114c xen/drivers/passthrough/amd/iommu_detect.c
--- a/xen/drivers/passthrough/amd/iommu_detect.c	Fri Sep 14 10:25:15 2012 +0100
+++ b/xen/drivers/passthrough/amd/iommu_detect.c	Fri Sep 14 14:17:26 2012 +0200
@@ -31,7 +31,6 @@ static int __init get_iommu_msi_capabili
     u16 seg, u8 bus, u8 dev, u8 func, struct amd_iommu *iommu)
 {
     int pos;
-    u16 control;
 
     pos = pci_find_cap_offset(seg, bus, dev, func, PCI_CAP_ID_MSI);
 
@@ -41,9 +40,6 @@ static int __init get_iommu_msi_capabili
     AMD_IOMMU_DEBUG("Found MSI capability block at %#x\n", pos);
 
     iommu->msi_cap = pos;
-    control = pci_conf_read16(seg, bus, dev, func,
-                              iommu->msi_cap + PCI_MSI_FLAGS);
-    iommu->maskbit = control & PCI_MSI_FLAGS_MASKBIT;
     return 0;
 }
 
diff -r 28bb7ba5faf6 -r 5e4a00b4114c xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c	Fri Sep 14 10:25:15 2012 +0100
+++ b/xen/drivers/passthrough/amd/iommu_init.c	Fri Sep 14 14:17:26 2012 +0200
@@ -467,20 +467,9 @@ static void iommu_msi_set_affinity(struc
         return;
     }
 
-    memset(&msg, 0, sizeof(msg)); 
-    msg.data = MSI_DATA_VECTOR(desc->arch.vector) & 0xff;
-    msg.data |= 1 << 14;
-    msg.data |= (INT_DELIVERY_MODE != dest_LowestPrio) ?
-        MSI_DATA_DELIVERY_FIXED:
-        MSI_DATA_DELIVERY_LOWPRI;
-
-    msg.address_hi =0;
-    msg.address_lo = (MSI_ADDRESS_HEADER << (MSI_ADDRESS_HEADER_SHIFT + 8)); 
-    msg.address_lo |= INT_DEST_MODE ? MSI_ADDR_DESTMODE_LOGIC:
-                    MSI_ADDR_DESTMODE_PHYS;
-    msg.address_lo |= (INT_DELIVERY_MODE != dest_LowestPrio) ?
-                    MSI_ADDR_REDIRECTION_CPU:
-                    MSI_ADDR_REDIRECTION_LOWPRI;
+    msi_compose_msg(desc, &msg);
+    /* Is this override really needed? */
+    msg.address_lo &= ~MSI_ADDR_DEST_ID_MASK;
     msg.address_lo |= MSI_ADDR_DEST_ID(dest & 0xff);
 
     pci_conf_write32(seg, bus, dev, func,
@@ -494,18 +483,8 @@ static void iommu_msi_set_affinity(struc
 
 static void amd_iommu_msi_enable(struct amd_iommu *iommu, int flag)
 {
-    u16 control;
-    int bus = PCI_BUS(iommu->bdf);
-    int dev = PCI_SLOT(iommu->bdf);
-    int func = PCI_FUNC(iommu->bdf);
-
-    control = pci_conf_read16(iommu->seg, bus, dev, func,
-        iommu->msi_cap + PCI_MSI_FLAGS);
-    control &= ~PCI_MSI_FLAGS_ENABLE;
-    if ( flag )
-        control |= flag;
-    pci_conf_write16(iommu->seg, bus, dev, func,
-        iommu->msi_cap + PCI_MSI_FLAGS, control);
+    __msi_set_enable(iommu->seg, PCI_BUS(iommu->bdf), PCI_SLOT(iommu->bdf),
+                     PCI_FUNC(iommu->bdf), iommu->msi_cap, flag);
 }
 
 static void iommu_msi_unmask(struct irq_desc *desc)
@@ -513,10 +492,6 @@ static void iommu_msi_unmask(struct irq_
     unsigned long flags;
     struct amd_iommu *iommu = desc->action->dev_id;
 
-    /* FIXME: do not support mask bits at the moment */
-    if ( iommu->maskbit )
-        return;
-
     spin_lock_irqsave(&iommu->lock, flags);
     amd_iommu_msi_enable(iommu, IOMMU_CONTROL_ENABLED);
     spin_unlock_irqrestore(&iommu->lock, flags);
@@ -529,10 +504,6 @@ static void iommu_msi_mask(struct irq_de
 
     irq_complete_move(desc);
 
-    /* FIXME: do not support mask bits at the moment */
-    if ( iommu->maskbit )
-        return;
-
     spin_lock_irqsave(&iommu->lock, flags);
     amd_iommu_msi_enable(iommu, IOMMU_CONTROL_DISABLED);
     spin_unlock_irqrestore(&iommu->lock, flags);
@@ -562,6 +533,37 @@ static hw_irq_controller iommu_msi_type 
     .set_affinity = iommu_msi_set_affinity,
 };
 
+static unsigned int iommu_maskable_msi_startup(struct irq_desc *desc)
+{
+    iommu_msi_unmask(desc);
+    unmask_msi_irq(desc);
+    return 0;
+}
+
+static void iommu_maskable_msi_shutdown(struct irq_desc *desc)
+{
+    mask_msi_irq(desc);
+    iommu_msi_mask(desc);
+}
+
+/*
+ * While the names may appear mismatched, we indeed want to use the non-
+ * maskable flavors here, as we want the ACK to be issued in ->end().
+ */
+#define iommu_maskable_msi_ack ack_nonmaskable_msi_irq
+#define iommu_maskable_msi_end end_nonmaskable_msi_irq
+
+static hw_irq_controller iommu_maskable_msi_type = {
+    .typename = "IOMMU-M-MSI",
+    .startup = iommu_maskable_msi_startup,
+    .shutdown = iommu_maskable_msi_shutdown,
+    .enable = unmask_msi_irq,
+    .disable = mask_msi_irq,
+    .ack = iommu_maskable_msi_ack,
+    .end = iommu_maskable_msi_end,
+    .set_affinity = iommu_msi_set_affinity,
+};
+
 static void parse_event_log_entry(struct amd_iommu *iommu, u32 entry[])
 {
     u16 domain_id, device_id, bdf, cword, flags;
@@ -784,6 +786,7 @@ static void iommu_interrupt_handler(int 
 static int __init set_iommu_interrupt_handler(struct amd_iommu *iommu)
 {
     int irq, ret;
+    u16 control;
 
     irq = create_irq(NUMA_NO_NODE);
     if ( irq <= 0 )
@@ -792,7 +795,11 @@ static int __init set_iommu_interrupt_ha
         return 0;
     }
     
-    irq_desc[irq].handler = &iommu_msi_type;
+    control = pci_conf_read16(iommu->seg, PCI_BUS(iommu->bdf),
+                              PCI_SLOT(iommu->bdf), PCI_FUNC(iommu->bdf),
+                              iommu->msi_cap + PCI_MSI_FLAGS);
+    irq_desc[irq].handler = control & PCI_MSI_FLAGS_MASKBIT ?
+                            &iommu_maskable_msi_type : &iommu_msi_type;
     ret = request_irq(irq, iommu_interrupt_handler, 0, "amd_iommu", iommu);
     if ( ret )
     {
diff -r 28bb7ba5faf6 -r 5e4a00b4114c xen/include/asm-x86/amd-iommu.h
--- a/xen/include/asm-x86/amd-iommu.h	Fri Sep 14 10:25:15 2012 +0100
+++ b/xen/include/asm-x86/amd-iommu.h	Fri Sep 14 14:17:26 2012 +0200
@@ -83,6 +83,7 @@ struct amd_iommu {
     u16 seg;
     u16 bdf;
     u16 cap_offset;
+    u8 msi_cap;
     iommu_cap_t cap;
 
     u8 ht_flags;
@@ -101,9 +102,6 @@ struct amd_iommu {
     uint64_t exclusion_base;
     uint64_t exclusion_limit;
 
-    int msi_cap;
-    int maskbit;
-
     int enabled;
     int irq;
 };
diff -r 28bb7ba5faf6 -r 5e4a00b4114c xen/include/asm-x86/msi.h
--- a/xen/include/asm-x86/msi.h	Fri Sep 14 10:25:15 2012 +0100
+++ b/xen/include/asm-x86/msi.h	Fri Sep 14 14:17:26 2012 +0200
@@ -208,6 +208,12 @@ struct msg_address {
 	__u32 	hi_address;
 } __attribute__ ((packed));
 
+void early_msi_init(void);
 void msi_compose_msg(struct irq_desc *, struct msi_msg *);
+void __msi_set_enable(u16 seg, u8 bus, u8 slot, u8 func, int pos, int enable);
+void mask_msi_irq(struct irq_desc *);
+void unmask_msi_irq(struct irq_desc *);
+void ack_nonmaskable_msi_irq(struct irq_desc *);
+void end_nonmaskable_msi_irq(struct irq_desc *, u8 vector);
 
 #endif /* __ASM_MSI_H */

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 21:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 21:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCdAU-00033Y-Ma; Fri, 14 Sep 2012 21:11:18 +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 1TCdAT-00031h-5T
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:17 +0000
Received: from [85.158.138.51:24072] by server-2.bemta-3.messagelabs.com id
	FA/36-04862-47D93505; Fri, 14 Sep 2012 21:11:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-174.messagelabs.com!1347657074!30115777!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3732 invoked from network); 14 Sep 2012 21:11:15 -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;
	14 Sep 2012 21:11: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 1TCdAP-0000B2-SY
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAP-0008Gk-MM
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:13 +0000
Message-Id: <E1TCdAP-0008Gk-MM@xenbits.xen.org>
Date: Fri, 14 Sep 2012 21:11:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] amd iommu: use base platform MSI
	implementation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347625046 -7200
# Node ID 5e4a00b4114c1c391b3d91d578d7fc2ac47600cb
# Parent  28bb7ba5faf6c80d93d845b35a3626af4449f874
amd iommu: use base platform MSI implementation

Given that here, other than for VT-d, the MSI interface gets surfaced
through a normal PCI device, the code should use as much as possible of
the "normal" MSI support code.

Further, the code can (and should) follow the "normal" MSI code in
distinguishing the maskable and non-maskable cases at the IRQ
controller level rather than checking the respective flag in the
individual actors.

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


diff -r 28bb7ba5faf6 -r 5e4a00b4114c xen/arch/x86/msi.c
--- a/xen/arch/x86/msi.c	Fri Sep 14 10:25:15 2012 +0100
+++ b/xen/arch/x86/msi.c	Fri Sep 14 14:17:26 2012 +0200
@@ -13,6 +13,7 @@
 #include <xen/delay.h>
 #include <xen/sched.h>
 #include <xen/acpi.h>
+#include <xen/cpu.h>
 #include <xen/errno.h>
 #include <xen/pci.h>
 #include <xen/pci_regs.h>
@@ -32,8 +33,9 @@
 #include <xsm/xsm.h>
 
 /* bitmap indicate which fixed map is free */
-DEFINE_SPINLOCK(msix_fixmap_lock);
-DECLARE_BITMAP(msix_fixmap_pages, FIX_MSIX_MAX_PAGES);
+static DEFINE_SPINLOCK(msix_fixmap_lock);
+static DECLARE_BITMAP(msix_fixmap_pages, FIX_MSIX_MAX_PAGES);
+static DEFINE_PER_CPU(cpumask_var_t, scratch_mask);
 
 static int msix_fixmap_alloc(void)
 {
@@ -126,13 +128,17 @@ void msi_compose_msg(struct irq_desc *de
     unsigned dest;
     int vector = desc->arch.vector;
 
-    if ( cpumask_empty(desc->arch.cpu_mask) ) {
+    memset(msg, 0, sizeof(*msg));
+    if ( !cpumask_intersects(desc->arch.cpu_mask, &cpu_online_map) ) {
         dprintk(XENLOG_ERR,"%s, compose msi message error!!\n", __func__);
         return;
     }
 
     if ( vector ) {
-        dest = cpu_mask_to_apicid(desc->arch.cpu_mask);
+        cpumask_t *mask = this_cpu(scratch_mask);
+
+        cpumask_and(mask, desc->arch.cpu_mask, &cpu_online_map);
+        dest = cpu_mask_to_apicid(mask);
 
         msg->address_hi = MSI_ADDR_BASE_HI;
         msg->address_lo =
@@ -281,23 +287,27 @@ static void set_msi_affinity(struct irq_
     write_msi_msg(msi_desc, &msg);
 }
 
+void __msi_set_enable(u16 seg, u8 bus, u8 slot, u8 func, int pos, int enable)
+{
+    u16 control = pci_conf_read16(seg, bus, slot, func, pos + PCI_MSI_FLAGS);
+
+    control &= ~PCI_MSI_FLAGS_ENABLE;
+    if ( enable )
+        control |= PCI_MSI_FLAGS_ENABLE;
+    pci_conf_write16(seg, bus, slot, func, pos + PCI_MSI_FLAGS, control);
+}
+
 static void msi_set_enable(struct pci_dev *dev, int enable)
 {
     int pos;
-    u16 control, seg = dev->seg;
+    u16 seg = dev->seg;
     u8 bus = dev->bus;
     u8 slot = PCI_SLOT(dev->devfn);
     u8 func = PCI_FUNC(dev->devfn);
 
     pos = pci_find_cap_offset(seg, bus, slot, func, PCI_CAP_ID_MSI);
     if ( pos )
-    {
-        control = pci_conf_read16(seg, bus, slot, func, pos + PCI_MSI_FLAGS);
-        control &= ~PCI_MSI_FLAGS_ENABLE;
-        if ( enable )
-            control |= PCI_MSI_FLAGS_ENABLE;
-        pci_conf_write16(seg, bus, slot, func, pos + PCI_MSI_FLAGS, control);
-    }
+        __msi_set_enable(seg, bus, slot, func, pos, enable);
 }
 
 static void msix_set_enable(struct pci_dev *dev, int enable)
@@ -379,12 +389,12 @@ static int msi_get_mask_bit(const struct
     return -1;
 }
 
-static void mask_msi_irq(struct irq_desc *desc)
+void mask_msi_irq(struct irq_desc *desc)
 {
     msi_set_mask_bit(desc, 1);
 }
 
-static void unmask_msi_irq(struct irq_desc *desc)
+void unmask_msi_irq(struct irq_desc *desc)
 {
     msi_set_mask_bit(desc, 0);
 }
@@ -395,7 +405,7 @@ static unsigned int startup_msi_irq(stru
     return 0;
 }
 
-static void ack_nonmaskable_msi_irq(struct irq_desc *desc)
+void ack_nonmaskable_msi_irq(struct irq_desc *desc)
 {
     irq_complete_move(desc);
     move_native_irq(desc);
@@ -407,7 +417,7 @@ static void ack_maskable_msi_irq(struct 
     ack_APIC_irq(); /* ACKTYPE_NONE */
 }
 
-static void end_nonmaskable_msi_irq(struct irq_desc *desc, u8 vector)
+void end_nonmaskable_msi_irq(struct irq_desc *desc, u8 vector)
 {
     ack_APIC_irq(); /* ACKTYPE_EOI */
 }
@@ -1071,6 +1081,40 @@ unsigned int pci_msix_get_table_len(stru
     return len;
 }
 
+static int msi_cpu_callback(
+    struct notifier_block *nfb, unsigned long action, void *hcpu)
+{
+    unsigned int cpu = (unsigned long)hcpu;
+
+    switch ( action )
+    {
+    case CPU_UP_PREPARE:
+        if ( !alloc_cpumask_var(&per_cpu(scratch_mask, cpu)) )
+            return notifier_from_errno(ENOMEM);
+        break;
+    case CPU_UP_CANCELED:
+    case CPU_DEAD:
+        free_cpumask_var(per_cpu(scratch_mask, cpu));
+        break;
+    default:
+        break;
+    }
+
+    return NOTIFY_DONE;
+}
+
+static struct notifier_block msi_cpu_nfb = {
+    .notifier_call = msi_cpu_callback
+};
+
+void __init early_msi_init(void)
+{
+    register_cpu_notifier(&msi_cpu_nfb);
+    if ( msi_cpu_callback(&msi_cpu_nfb, CPU_UP_PREPARE, NULL) &
+         NOTIFY_STOP_MASK )
+        BUG();
+}
+
 static void dump_msi(unsigned char key)
 {
     unsigned int irq;
diff -r 28bb7ba5faf6 -r 5e4a00b4114c xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c	Fri Sep 14 10:25:15 2012 +0100
+++ b/xen/arch/x86/setup.c	Fri Sep 14 14:17:26 2012 +0200
@@ -33,6 +33,7 @@
 #include <asm/processor.h>
 #include <asm/mpspec.h>
 #include <asm/apic.h>
+#include <asm/msi.h>
 #include <asm/desc.h>
 #include <asm/paging.h>
 #include <asm/e820.h>
@@ -1199,6 +1200,8 @@ void __init __start_xen(unsigned long mb
 
     acpi_mmcfg_init();
 
+    early_msi_init();
+
     iommu_setup();    /* setup iommu if available */
 
     smp_prepare_cpus(max_cpus);
diff -r 28bb7ba5faf6 -r 5e4a00b4114c xen/drivers/passthrough/amd/iommu_detect.c
--- a/xen/drivers/passthrough/amd/iommu_detect.c	Fri Sep 14 10:25:15 2012 +0100
+++ b/xen/drivers/passthrough/amd/iommu_detect.c	Fri Sep 14 14:17:26 2012 +0200
@@ -31,7 +31,6 @@ static int __init get_iommu_msi_capabili
     u16 seg, u8 bus, u8 dev, u8 func, struct amd_iommu *iommu)
 {
     int pos;
-    u16 control;
 
     pos = pci_find_cap_offset(seg, bus, dev, func, PCI_CAP_ID_MSI);
 
@@ -41,9 +40,6 @@ static int __init get_iommu_msi_capabili
     AMD_IOMMU_DEBUG("Found MSI capability block at %#x\n", pos);
 
     iommu->msi_cap = pos;
-    control = pci_conf_read16(seg, bus, dev, func,
-                              iommu->msi_cap + PCI_MSI_FLAGS);
-    iommu->maskbit = control & PCI_MSI_FLAGS_MASKBIT;
     return 0;
 }
 
diff -r 28bb7ba5faf6 -r 5e4a00b4114c xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c	Fri Sep 14 10:25:15 2012 +0100
+++ b/xen/drivers/passthrough/amd/iommu_init.c	Fri Sep 14 14:17:26 2012 +0200
@@ -467,20 +467,9 @@ static void iommu_msi_set_affinity(struc
         return;
     }
 
-    memset(&msg, 0, sizeof(msg)); 
-    msg.data = MSI_DATA_VECTOR(desc->arch.vector) & 0xff;
-    msg.data |= 1 << 14;
-    msg.data |= (INT_DELIVERY_MODE != dest_LowestPrio) ?
-        MSI_DATA_DELIVERY_FIXED:
-        MSI_DATA_DELIVERY_LOWPRI;
-
-    msg.address_hi =0;
-    msg.address_lo = (MSI_ADDRESS_HEADER << (MSI_ADDRESS_HEADER_SHIFT + 8)); 
-    msg.address_lo |= INT_DEST_MODE ? MSI_ADDR_DESTMODE_LOGIC:
-                    MSI_ADDR_DESTMODE_PHYS;
-    msg.address_lo |= (INT_DELIVERY_MODE != dest_LowestPrio) ?
-                    MSI_ADDR_REDIRECTION_CPU:
-                    MSI_ADDR_REDIRECTION_LOWPRI;
+    msi_compose_msg(desc, &msg);
+    /* Is this override really needed? */
+    msg.address_lo &= ~MSI_ADDR_DEST_ID_MASK;
     msg.address_lo |= MSI_ADDR_DEST_ID(dest & 0xff);
 
     pci_conf_write32(seg, bus, dev, func,
@@ -494,18 +483,8 @@ static void iommu_msi_set_affinity(struc
 
 static void amd_iommu_msi_enable(struct amd_iommu *iommu, int flag)
 {
-    u16 control;
-    int bus = PCI_BUS(iommu->bdf);
-    int dev = PCI_SLOT(iommu->bdf);
-    int func = PCI_FUNC(iommu->bdf);
-
-    control = pci_conf_read16(iommu->seg, bus, dev, func,
-        iommu->msi_cap + PCI_MSI_FLAGS);
-    control &= ~PCI_MSI_FLAGS_ENABLE;
-    if ( flag )
-        control |= flag;
-    pci_conf_write16(iommu->seg, bus, dev, func,
-        iommu->msi_cap + PCI_MSI_FLAGS, control);
+    __msi_set_enable(iommu->seg, PCI_BUS(iommu->bdf), PCI_SLOT(iommu->bdf),
+                     PCI_FUNC(iommu->bdf), iommu->msi_cap, flag);
 }
 
 static void iommu_msi_unmask(struct irq_desc *desc)
@@ -513,10 +492,6 @@ static void iommu_msi_unmask(struct irq_
     unsigned long flags;
     struct amd_iommu *iommu = desc->action->dev_id;
 
-    /* FIXME: do not support mask bits at the moment */
-    if ( iommu->maskbit )
-        return;
-
     spin_lock_irqsave(&iommu->lock, flags);
     amd_iommu_msi_enable(iommu, IOMMU_CONTROL_ENABLED);
     spin_unlock_irqrestore(&iommu->lock, flags);
@@ -529,10 +504,6 @@ static void iommu_msi_mask(struct irq_de
 
     irq_complete_move(desc);
 
-    /* FIXME: do not support mask bits at the moment */
-    if ( iommu->maskbit )
-        return;
-
     spin_lock_irqsave(&iommu->lock, flags);
     amd_iommu_msi_enable(iommu, IOMMU_CONTROL_DISABLED);
     spin_unlock_irqrestore(&iommu->lock, flags);
@@ -562,6 +533,37 @@ static hw_irq_controller iommu_msi_type 
     .set_affinity = iommu_msi_set_affinity,
 };
 
+static unsigned int iommu_maskable_msi_startup(struct irq_desc *desc)
+{
+    iommu_msi_unmask(desc);
+    unmask_msi_irq(desc);
+    return 0;
+}
+
+static void iommu_maskable_msi_shutdown(struct irq_desc *desc)
+{
+    mask_msi_irq(desc);
+    iommu_msi_mask(desc);
+}
+
+/*
+ * While the names may appear mismatched, we indeed want to use the non-
+ * maskable flavors here, as we want the ACK to be issued in ->end().
+ */
+#define iommu_maskable_msi_ack ack_nonmaskable_msi_irq
+#define iommu_maskable_msi_end end_nonmaskable_msi_irq
+
+static hw_irq_controller iommu_maskable_msi_type = {
+    .typename = "IOMMU-M-MSI",
+    .startup = iommu_maskable_msi_startup,
+    .shutdown = iommu_maskable_msi_shutdown,
+    .enable = unmask_msi_irq,
+    .disable = mask_msi_irq,
+    .ack = iommu_maskable_msi_ack,
+    .end = iommu_maskable_msi_end,
+    .set_affinity = iommu_msi_set_affinity,
+};
+
 static void parse_event_log_entry(struct amd_iommu *iommu, u32 entry[])
 {
     u16 domain_id, device_id, bdf, cword, flags;
@@ -784,6 +786,7 @@ static void iommu_interrupt_handler(int 
 static int __init set_iommu_interrupt_handler(struct amd_iommu *iommu)
 {
     int irq, ret;
+    u16 control;
 
     irq = create_irq(NUMA_NO_NODE);
     if ( irq <= 0 )
@@ -792,7 +795,11 @@ static int __init set_iommu_interrupt_ha
         return 0;
     }
     
-    irq_desc[irq].handler = &iommu_msi_type;
+    control = pci_conf_read16(iommu->seg, PCI_BUS(iommu->bdf),
+                              PCI_SLOT(iommu->bdf), PCI_FUNC(iommu->bdf),
+                              iommu->msi_cap + PCI_MSI_FLAGS);
+    irq_desc[irq].handler = control & PCI_MSI_FLAGS_MASKBIT ?
+                            &iommu_maskable_msi_type : &iommu_msi_type;
     ret = request_irq(irq, iommu_interrupt_handler, 0, "amd_iommu", iommu);
     if ( ret )
     {
diff -r 28bb7ba5faf6 -r 5e4a00b4114c xen/include/asm-x86/amd-iommu.h
--- a/xen/include/asm-x86/amd-iommu.h	Fri Sep 14 10:25:15 2012 +0100
+++ b/xen/include/asm-x86/amd-iommu.h	Fri Sep 14 14:17:26 2012 +0200
@@ -83,6 +83,7 @@ struct amd_iommu {
     u16 seg;
     u16 bdf;
     u16 cap_offset;
+    u8 msi_cap;
     iommu_cap_t cap;
 
     u8 ht_flags;
@@ -101,9 +102,6 @@ struct amd_iommu {
     uint64_t exclusion_base;
     uint64_t exclusion_limit;
 
-    int msi_cap;
-    int maskbit;
-
     int enabled;
     int irq;
 };
diff -r 28bb7ba5faf6 -r 5e4a00b4114c xen/include/asm-x86/msi.h
--- a/xen/include/asm-x86/msi.h	Fri Sep 14 10:25:15 2012 +0100
+++ b/xen/include/asm-x86/msi.h	Fri Sep 14 14:17:26 2012 +0200
@@ -208,6 +208,12 @@ struct msg_address {
 	__u32 	hi_address;
 } __attribute__ ((packed));
 
+void early_msi_init(void);
 void msi_compose_msg(struct irq_desc *, struct msi_msg *);
+void __msi_set_enable(u16 seg, u8 bus, u8 slot, u8 func, int pos, int enable);
+void mask_msi_irq(struct irq_desc *);
+void unmask_msi_irq(struct irq_desc *);
+void ack_nonmaskable_msi_irq(struct irq_desc *);
+void end_nonmaskable_msi_irq(struct irq_desc *, u8 vector);
 
 #endif /* __ASM_MSI_H */

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 21:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 21:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCdAU-00033T-JW; Fri, 14 Sep 2012 21:11:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAS-00031g-VN
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:17 +0000
Received: from [85.158.139.83:51917] by server-8.bemta-5.messagelabs.com id
	AA/89-15219-47D93505; Fri, 14 Sep 2012 21:11:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-182.messagelabs.com!1347657072!23234509!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.7 required=7.0 tests=BODY_RANDOM_LONG,HOT_NASTY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26693 invoked from network); 14 Sep 2012 21:11:13 -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;
	14 Sep 2012 21:11: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 1TCdAO-0000At-5D
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAO-0008F6-0R
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:12 +0000
Message-Id: <E1TCdAO-0008F6-0R@xenbits.xen.org>
Date: Fri, 14 Sep 2012 21:11:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: flesh out xl.cfg documentation,
	correct typos, reorganize
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Matt Wilson <msw@amazon.com>
# Date 1347613371 -3600
# Node ID 0b03d56240250d2ad5ef9e2d0c37d3b7c76922db
# Parent  116f5c34354b9013ddee6066d8dcfeed6dad19f0
docs: flesh out xl.cfg documentation, correct typos, reorganize

Some highlights:
 * Correct some markup errors:
       Around line 663:
           '=item' outside of any '=over'
       Around line 671:
           You forgot a '=back' before '=head3'
 * Add documentation for msitranslate, power_mgnt, acpi_s3, aspi_s4,
   gfx_passthru, nomigrate, etc.
 * Reorganize items in "unclassified" sections like cpuid,
   gfx_passthru to where they belong
 * Correct link L<> references so they can be resolved within the
   document
 * Remove placeholders for deprecated options device_model and vif2
 * Remove placeholder for "sched" and "node", as these are options for
   cpupool configuration. Perhaps cpupool configuration deserves
   a section in this document.
 * Rename "global" options to "general"
 * Add section headers to group general VM options.

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


diff -r 116f5c34354b -r 0b03d5624025 docs/man/xl.cfg.pod.5
--- a/docs/man/xl.cfg.pod.5	Fri Sep 14 10:02:51 2012 +0100
+++ b/docs/man/xl.cfg.pod.5	Fri Sep 14 10:02:51 2012 +0100
@@ -17,7 +17,7 @@ domain.
 
 A domain config file consists of a series of C<KEY=VALUE> pairs.
 
-Some C<KEY>s are mandatory, others are global options which apply to
+Some C<KEY>s are mandatory, others are general options which apply to
 any guest type while others relate only to specific guest types
 (e.g. PV or HVM guests).
 
@@ -80,21 +80,14 @@ operating systems.
 
 =back
 
-=head2 Global Options
+=head2 General Options
 
 The following options apply to guests of any type.
 
+=head3 CPU Allocation
+
 =over 4
 
-=item B<uuid="UUID">
-
-Specifies the UUID of the domain.  If not specified, a fresh unique
-UUID will be generated.
-
-=item B<vncviewer=BOOLEAN>
-
-Automatically spawn a vncviewer when creating/restoring a guest
-
 =item B<pool="CPUPOOLNAME">
 
 Put the guest's vcpus into the named cpu pool.
@@ -138,6 +131,12 @@ node) by pinning it to the cpus of those
 utilized with the goals of maximizing performance for the domain and, at
 the same time, achieving efficient utilization of the host's CPUs and RAM.
 
+=back
+
+=head3 CPU Scheduling
+
+=over 4
+
 =item B<cpu_weight=WEIGHT>
 
 A domain with a weight of 512 will get twice as much CPU as a domain
@@ -176,6 +175,12 @@ Honoured by the sedf scheduler.
 Flag for allowing domain to run in extra time.
 Honoured by the sedf scheduler.
 
+=back
+
+=head3 Memory Allocation
+
+=over 4
+
 =item B<memory=MBYTES>
 
 Start the guest with MBYTES megabytes of RAM.
@@ -190,6 +195,12 @@ if the values of B<memory=> and B<maxmem
 A "pre-ballooned" HVM guest needs a balloon driver, without a balloon driver
 it will crash.
 
+=back
+
+=head3 Event Actions
+
+=over 4
+
 =item B<on_poweroff="ACTION">
 
 Specifies what should be done with the domain if it shuts itself down.
@@ -200,12 +211,12 @@ The C<ACTION>s are:
 =item B<destroy>
 
 destroy the domain
-     
+
 =item B<restart>
 
 destroy the domain and immediately create a new domain with the same
 configuration
-        
+
 =item B<rename-restart>
 
 rename the domain which terminated, and then immediately create a new
@@ -244,10 +255,28 @@ Default is C<destroy>.
 
 Action to take if the domain crashes.  Default is C<destroy>.
 
+=back
+
+=head3 Other Options
+
+=over 4
+
+=item B<uuid="UUID">
+
+Specifies the UUID of the domain.  If not specified, a fresh unique
+UUID will be generated.
+
 =item B<seclabel="LABEL">
 
 Assign an XSM security label to this domain.
 
+=item B<nomigrate=BOOLEAN>
+
+Disable migration of this domain.  This enables certain other features
+which are incompatible with migration. Currently this is limited to
+enabling the invariant TSC feature flag in cpuid results when TSC is
+not emulated.
+
 =back
 
 =head2 Devices
@@ -309,7 +338,20 @@ Specifies the password for the VNC serve
 =item C<sdl=BOOLEAN>
 
 Specifies that the display should be presented via an X window (using
-Simple DirectMedia Layer). The default is to not enable this mode
+Simple DirectMedia Layer). The default is to not enable this mode.
+
+=item C<display=DISPLAY>
+
+Specifies the X Window display that should be used when the sdl option
+is used. Note: passing this value to the device-model is not currently
+implemented, so providing this option will have no effect.
+
+=item C<xauthority=XAUTHORITY>
+
+Specifies the path to the X authority file that should be used to
+connect to the X server when the sdl option is used. Note: passing
+this value to the device-model is not currently implemented, so
+providing this option will have no effect.
 
 =item C<opengl=BOOLEAN>
 
@@ -324,19 +366,9 @@ display. If the input method does not ea
 (e.g. this is often the case when using VNC) then this allows us to
 correctly map the input keys into keycodes seen by the guest. The
 specific values which are accepted are defined by the version of the
-device-model which you are using. See L<Keymaps> below or consult the
+device-model which you are using. See L</"Keymaps"> below or consult the
 L<qemu(1)> manpage. The default is B<en-us>.
 
-=item C<display=XXX>
-
-XXX written to xenstore backend for vfb but does not appear to be used
-anywhere?
-
-=item C<authority=XXX>
-
-XXX written to xenstore backend for vfb but does not appear to be used
-anywhere?
-
 =back
 
 =item B<pci=[ "PCI_SPEC_STRING", "PCI_SPEC_STRING", ... ]>
@@ -348,7 +380,7 @@ has the form C<[DDDD:]BB:DD.F[@VSLOT],KE
 
 =item B<DDDD:BB:DD.F>
 
-identifies the PCI device from the host perspective in domain
+Identifies the PCI device from the host perspective in domain
 (B<DDDD>), Bus (B<BB>), Device (B<DD>) and Function (B<F>) syntax. This is
 the same scheme as used in the output of C<lspci> for the device in
 question. Note: By default C<lspci> will omit the domain (B<DDDD>) if it
@@ -357,9 +389,9 @@ is zero and it is optional here also. Yo
 
 =item B<@VSLOT>
 
-specifies the virtual device where the guest will see this
+Specifies the virtual device where the guest will see this
 device. This is equivalent to the B<DD> which the guest sees. In a
-guest B<DDDD> and B<BB> are C<0000:00>. XXX how does this really work?
+guest B<DDDD> and B<BB> are C<0000:00>.
 
 =item B<KEY=VALUE>
 
@@ -367,14 +399,6 @@ Possible B<KEY>s are:
 
 =over 4
 
-=item B<msitranslate=BOOLEAN>
-
-XXX
-
-=item B<power_mgmt=BOOLEAN>
-
-XXX
-
 =item B<permissive=BOOLEAN>
 
 (PV only) By default pciback only allows PV guests to write "known
@@ -386,6 +410,19 @@ caution: it gives the guest much more co
 may have security or stability implications.  It is recommended to
 enable this option only for trusted VMs under administrator control.
 
+=item B<msitranslate=BOOLEAN>
+
+Specifies that MSI-INTx translation should be turned on for the PCI
+device. When enabled, MSI-INTx translation will always enable MSI on
+the PCI device regardless whether the guest uses INTx or MSI. Some
+device drivers, such as NVIDIA's, detect an inconsistency and do not
+function when this option is enabled. Therefore the default is 0.
+
+=item B<power_mgmt=BOOLEAN>
+
+(HVM only) Specifies that the VM should be able to program the
+D0-D3hot power management states for the PCI device. 0 by default.
+
 =back
 
 =back
@@ -393,19 +430,65 @@ enable this option only for trusted VMs 
 =item B<pci_permissive=BOOLEAN>
 
 (PV only) Changes the default value of 'permissive' for all PCI
-devices for this VM.  This can still be overridden on a per-device
-basis. This option should be enabled with caution: it gives the guest
-much more control over the device, which may have security or
-stability implications.  It is recommended to enable this option only
-for trusted VMs under administrator control.  See the "pci=" section
-for more information on the "permissive" flag.
+devices passed through to this VM. See L<permissive|/"permissive_boolean">
+above.
 
-=back
+=item B<pci_msitranslate=BOOLEAN>
+
+Changes the default value of 'msitranslate' for all PCI devices passed
+through to this VM. See L<msitranslate|/"msitranslate_boolean"> above.
+
+=item B<pci_power_mgmt=BOOLEAN>
+
+(HVM only) Changes the default value of 'power_mgmt' for all PCI
+devices passed through to this VM. See L<power_mgt|/"power_mgmt_boolean">
+above.
+
+=item B<gfx_passthru=BOOLEAN>
+
+Enable graphics device PCI passthrough. This option makes an assigned
+PCI graphics card become primary graphics card in the VM. The QEMU
+emulated graphics adapter is disabled and the VNC console for the VM
+will not have any graphics output. All graphics output, including boot
+time QEMU BIOS messages from the VM, will go to the physical outputs
+of the passedthrough physical graphics card.
+
+The graphics card PCI device to passthrough is chosen with B<pci>
+option, exactly in the same way as normal Xen PCI device
+passthrough/assignment is done.  Note that gfx_passthru does not do
+any kind of sharing of the GPU, so you can only assign the GPU to one
+single VM at a time.
+
+gfx_passthru also enables various legacy VGA memory ranges, BARs, MMIOs,
+and ioports to be passed thru to the VM, since those are required
+for correct operation of things like VGA BIOS, text mode, VBE, etc.
+
+Enabling gfx_passthru option also copies the physical graphics card
+video BIOS to the guest memory, and executes the VBIOS in the guest
+to initialize the graphics card.
+
+Most graphics adapters require vendor specific tweaks for properly
+working graphics passthrough. See the XenVGAPassthroughTestedAdapters
+L<http://wiki.xen.org/wiki/XenVGAPassthroughTestedAdapters> wiki page
+for currently supported graphics cards for gfx_passthru.
+
+gfx_passthru is currently only supported with the qemu-xen-traditional
+device-model. Upstream qemu-xen device-model currently does not have
+support for gfx_passthru.
+
+Note that some graphics adapters (AMD/ATI cards, for example) do not
+necessarily require gfx_passthru option, so you can use the normal Xen
+PCI passthrough to assign the graphics card as a secondary graphics
+card to the VM. The QEMU-emulated graphics card remains the primary
+graphics card, and VNC output is available from the QEMU-emulated
+primary adapter.
+
+More information about Xen gfx_passthru feature is available
+on the XenVGAPassthrough L<http://wiki.xen.org/wiki/XenVGAPassthrough>
+wiki page.
 
 =item B<ioports=[ "IOPORT_RANGE", "IOPORT_RANGE", ... ]>
 
-=over 4
-
 Allow guest to access specific legacy I/O ports. Each B<IOPORT_RANGE>
 is given in hexadecimal and may either a span e.g. C<2f8-2ff>
 (inclusive) or a single I/O port C<2f8>.
@@ -413,12 +496,8 @@ is given in hexadecimal and may either a
 It is recommended to use this option only for trusted VMs under
 administrator control.
 
-=back
-
 =item B<irqs=[ NUMBER, NUMBER, ... ]>
 
-=over 4
-
 Allow a guest to access specific physical IRQs.
 
 It is recommended to use this option only for trusted VMs under
@@ -471,12 +550,12 @@ address space consists of a single conti
 option is specified the virtual e820 instead reflects the host e820
 and contains the same PCI holes. The total amount of RAM represented
 by the memory map is always the same, this option configures only how
-it is layed out.
+it is laid out.
 
 Exposing the host e820 to the guest gives the guest kernel the
 opportunity to set aside the required part of its pseudo-physical
 address space in order to provide address space to map passedthrough
-PCI devices. It is guest Operating System dependant whether this
+PCI devices. It is guest Operating System dependent whether this
 option is required, specifically it is required when using a mainline
 Linux ("pvops") kernel. This option defaults to true if any PCI
 passthrough devices are configured and false otherwise. If you do not
@@ -600,6 +679,16 @@ by most modern guest Operating Systems. 
 default and usually you should omit it. However it may be necessary to
 disable ACPI for compatibility with some guest Operating Systems.
 
+=item B<acpi_s3=BOOLEAN>
+
+Include the S3 (suspend-to-ram) power state in the virtual firmware
+ACPI table. 1 by default.
+
+=item B<acpi_s4=BOOLEAN>
+
+Include S4 (suspend-to-disk) power state in the virtual firmware ACPI
+table. 1 by default.
+
 =item B<apic=BOOLEAN>
 
 Include information regarding APIC (Advanced Programmable Interrupt
@@ -637,414 +726,6 @@ of Xen) within a Xen guest or to support
 which uses hardware virtualisation extensions (e.g. Windows XP
 compatibility mode on more modern Windows OS).
 
-=back 
-
-=head3 Guest Virtual Time Controls
-
-=over 4
-
-=item B<tsc_mode="MODE">
-
-
-Specifies how the TSC (Time Stamp Counter) should be provided to the
-guest (X86 only). Specifying this option as a number is
-deprecated. Options are:
-
-=over 4
-
-=item B<"default">
-
-Guest rdtsc/p executed natively when monotonicity can be guaranteed
-and emulated otherwise (with frequency scaled if necessary).
-
-=item B<"always_emulate">
-
-Guest rdtsc/p always emulated at 1GHz (kernel and user). Guest rdtsc/p
-always emulated and the virtual TSC will appear to increment (kernel
-and user) at a fixed 1GHz rate, regardless of the PCPU HZ rate or
-power state; Although there is an overhead associated with emulation
-this will NOT affect underlying CPU performance.
-
-=item B<"native">
-
-Guest rdtsc always executed natively (no monotonicity/frequency
-guarantees); guest rdtscp emulated at native frequency if unsupported
-by h/w, else executed natively.
-
-=item B<"native_paravirt">
-
-Same as B<native>, except xen manages TSC_AUX register so guest can
-determine when a restore/migration has occurred and assumes guest
-obtains/uses pvclock-like mechanism to adjust for monotonicity and
-frequency changes.
-
-=back
-
-=back
-
-Please see F<docs/misc/tscmode.txt> for more information on this option.
-
-=item B<localtime=BOOLEAN>
-
-Set the real time clock to local time or to UTC. 0 by default, i.e. set to UTC.
-
-=item B<rtc_timeoffset=SECONDS>
-
-Set the real time clock offset in seconds. 0 by default.
-
-=head3 Support for Paravirtualisation of HVM Guests
-
-The following options allow Paravirtualised features (such as devices)
-to be exposed to the guest Operating System in an HVM guest.
-Utilising these features requires specific guest support but when
-available they will result in improved performance.
-
-=over 4
-
-=item B<xen_platform_pci=BOOLEAN>
-
-Enable or disable the Xen platform PCI device.  The presence of this
-virtual device enables a guest Operating System (subject to the
-availability of suitable drivers) to make use of paravirtualisation
-features such as disk and network devices etc. Enabling these drivers
-improves performance and is strongly recommended when available. PV
-drivers are available for various Operating Systems including HVM
-Linux L<http://wiki.xen.org/wiki/XenLinuxPVonHVMdrivers> and Microsoft
-Windows L<http://wiki.xen.org/wiki/XenWindowsGplPv>.
-
-=item B<viridian=BOOLEAN>
-
-Turns on or off the exposure of MicroSoft Hyper-V (AKA viridian)
-compatible enlightenments to the guest.  These can improve performance
-of Microsoft Windows guests from Windows Vista and Windows 2008
-onwards and setting this option for such guests is strongly
-recommended. This option should be harmless for other versions of
-Windows (although it won't give any benefit) and the majority of other
-non-Windows OSes. However it is known to be incompatible with some
-other Operating Systems and in some circumstance can prevent Xen's own
-paravirtualisation interfaces for HVM guests from being used.
-
-=back
-
-=head3 Emulated VGA Graphics Device
-
-The following options control the features of the emulated graphics
-device.  Many of these options behave similarly to the equivalent key
-in the B<VFB_SPEC_STRING> for configuring virtual frame buffer devices
-(see above).
-
-=over 4
-
-=item B<videoram=MBYTES>
-
-Sets the amount of RAM which the emulated video card will contain,
-which in turn limits the resolutions and bit depths which will be
-available. This option is only available when using the B<stdvga>
-option (see below).
-The default amount of video ram for stdvga is 8MB which is sufficient
-for e.g. 1600x1200 at 32bpp.
-
-When using the emulated Cirrus graphics card (B<stdvga=0>)
-the amount of video ram is fixed at 4MB which is sufficient
-for 1024x768 at 32 bpp.
-
-videoram option is currently only available when using the
-qemu-xen-traditional device-model. Upstream qemu-xen device-model
-currently doesn't support changing the amount of video memory
-for the emulated graphics device.
-
-=item B<stdvga=BOOLEAN>
-
-Select a standard VGA card with VBE (VESA BIOS Extensions) as the
-emulated graphics device. The default is false which means to emulate
-a Cirrus Logic GD5446 VGA card. If your guest supports VBE 2.0 or
-later (e.g. Windows XP onwards) then you should enable this.
-stdvga supports more video ram and bigger resolutions than Cirrus.
-
-=item B<vnc=BOOLEAN>
-
-Allow access to the display via the VNC protocol.  This enables the
-other VNC-related settings.  The default is to enable this.
-
-=item B<vnclisten="ADDRESS[:DISPLAYNUM]">
-
-Specifies the IP address, and optionally VNC display number, to use.
-
-=item B<vncdisplay=DISPLAYNUM>
-
-Specifies the VNC display number to use. The actual TCP port number
-will be DISPLAYNUM+5900.
-
-=item B<vncunused=BOOLEAN>
-
-Requests that the VNC display setup search for a free TCP port to use.
-The actual display used can be accessed with C<xl vncviewer>.
-
-=item B<vncpasswd="PASSWORD">
-
-Specifies the password for the VNC server.
-
-=item B<keymap="LANG">
-
-Configure the keymap to use for the keyboard associated with this
-display. If the input method does not easily support raw keycodes
-(e.g. this is often the case when using VNC) then this allows us to
-correctly map the input keys into keycodes seen by the guest. The
-specific values which are accepted are defined by the version of the
-device-model which you are using. See L<Keymaps> below of consult the
-L<qemu(1)> manpage. The default is B<en-us>.
-
-=item B<sdl=BOOLEAN>
-
-Specifies that the display should be presented via an X window (using
-Simple DirectMedia Layer). The default is not to enable this mode.
-
-=item B<opengl=BOOLEAN>
-
-Enable OpenGL acceleration of the SDL display. Only effects machines
-using B<device_model_version="qemu-xen-traditional"> and only if the
-device-model was compiled with OpenGL support. Disabled by default.
-
-=item B<nographic=BOOLEAN>
-
-Enable or disable the virtual graphics device.  The default is to
-provide a VGA graphics device but this option can be used to disable
-it.
-
-=back
-
-=head3 Spice Graphics Support
-
-The following options control the features of SPICE.
-
-=over 4
-
-=item B<spice=BOOLEAN>
-
-Allow access to the display via the SPICE protocol.  This enables the
-other SPICE-related settings.
-
-=item B<spicehost="ADDRESS">
-
-Specify the interface address to listen on if given, otherwise any
-interface.
-
-=item B<spiceport=NUMBER>
-
-Specify the port to listen on by the SPICE server if the SPICE is
-enabled.
-
-=item B<spicetls_port=NUMBER>
-
-Specify the secure port to listen on by the SPICE server if the SPICE
-is enabled. At least one of the spiceport or spicetls_port must be
-given if SPICE is enabled.  NB. the options depending on spicetls_port
-have not been supported.
-
-=item B<spicedisable_ticketing=BOOLEAN>
-
-Enable client connection without password. The default is false. If
-it's false (set to 0), spicepasswd must be set.
-
-=item B<spicepasswd="PASSWORD">
-
-Specify the ticket password which is used by a client for connection.
-
-=item B<spiceagent_mouse=BOOLEAN>
-
-Whether SPICE agent is used for client mouse mode. The default is true
-(turn on)
-
-=back
-
-=head3 Miscellaneous Emulated Hardware
-
-=over 4
-
-=item B<serial=DEVICE>
-
-Redirect the virtual serial port to B<DEVICE>. Please see the
-B<-serial> option in the L<qemu(1)> manpage for details of the valid
-B<DEVICE> options. Default is B<vc> when in graphical mode and
-B<stdio> if B<nographics=1> is used.
-
-=item B<soundhw=DEVICE>
-
-Select the virtual sound card to expose to the guest. The valid
-devices are defined by the device model configuration, please see the
-L<qemu(1)> manpage for details. The default is not to export any sound
-device.
-
-=item B<usb=BOOLEAN>
-
-Enables or disables a USB bus in the guest.
-
-=item B<usbdevice=DEVICE>
-
-Adds B<DEVICE> to the USB bus. The USB bus must also be enabled using
-B<usb=1>. The most common use for this option is B<usbdevice=tablet>
-which adds pointer device using absolute coordinates. Such devices
-function better than relative coordinate devices (such as a standard
-mouse) since many methods of exporting guest graphics (such as VNC)
-work better in this mode. Note that this is independent of the actual
-pointer device you are using on the host/client side. XXX should/could
-be a list of devices.
-
-=back
-
-=head3 Unclassified HVM Specific Options
-
-These HVM specific options have not yet been documented or
-classified. They almost certainly belong in a more appropriate
-section.
-
-=over 4
-
-=item B<vpt_align=BOOLEAN>
-
-Align the Virtual Platform Timer ??? XXX Reduces interrupts?
-
-=item B<timer_mode=NUMBER>
-
-Set mode for Virtual Timers XXX ??? should be an enum of particular
-values. See C<HVM_PARAM_TIMER_MODE> in
-F<xen/include/public/hvm/params.h>.
-
-=back
-
-=head2 Device-Model Options
-
-The following options control the selection of the device-model.  This
-is the component which provides emulation of the virtual devices to an
-HVM guest.  For a PV guest a device-model is sometimes used to provide
-backends for certain PV devices (most usually a virtual framebuffer
-device).
-
-=over 4
-
-=item B<device_model_version="DEVICE-MODEL">
-
-Selects which variant of the device-model should be used for this
-guest. Valid values are:
-
-=over 4
-
-=item B<qemu-xen-traditional>
-
-Use the device-model based upon the historical Xen fork of Qemu.  This
-device-model is currently the default.
-
-=item B<qemu-xen>
-
-use the device-model merged into the upstream Qemu project.  This
-device-model will become the default in a future version of Xen.
-
-=back
-
-It is recommended to accept the default value for new guests.  If
-you have existing guests then, depending on the nature of the guest
-Operating System, you may wish to force them to use the device
-model which they were installed with.
-
-=item B<device_model_override="PATH">
-
-Override the path to the binary to be used as the device-model. The
-binary provided here MUST be consistent with the
-`device_model_version` which you have specified. You should not
-normally need to specify this option.
-
-=item B<device_model_stubdomain_override=BOOLEAN>
-
-Override the use of stubdomain based device-model.  Normally this will
-be automatically selected based upon the other features and options
-you have selected.
-
-=item B<device_model_stubdomain_seclabel="LABEL">
-
-Assign an XSM security label to the device-model stubdomain.
-
-=item B<device_model_args=[ "ARG", "ARG", ...]>
-
-Pass additional arbitrary options on the device-model command
-line. Each element in the list is passed as an option to the
-device-model.
-
-=item B<device_model_args_pv=[ "ARG", "ARG", ...]>
-
-Pass additional arbitrary options on the device-model command line for
-a PV device model only. Each element in the list is passed as an
-option to the device-model.
-
-=item B<device_model_args_hvm=[ "ARG", "ARG", ...]>
-
-Pass additional arbitrary options on the device-model command line for
-an HVM device model only. Each element in the list is passed as an
-option to the device-model.
-
-=back
-
-=head2 Unclassified General Options
-
-These have not yet been fully documented or classified. They almost
-certainly belong in a more appropriate section.
-
-=over 4
-
-=item B<gfx_passthru=BOOLEAN>
-
-Enable graphics device PCI passthrough. This option makes the passthru
-graphics card become primary graphics card in the VM, so the Qemu emulated
-graphics adapter is disabled, and the VNC console for the VM won't have
-any graphics output. All graphics output, including boot time Qemu BIOS
-messages from the VM, will go to the physical outputs of the passed thru
-physical graphics card.
-
-Graphics card PCI device to passthru is chosen with B<pci> option,
-exactly in the same way as normal Xen PCI device passthru/assignment is done.
-Note that gfx_passthru doesn't do any kind of sharing
-of the GPU, so you can only assign the GPU to one single VM at a time.
-
-gfx_passthru also enables various legacy VGA memory ranges, BARs, MMIOs,
-and ioports to be passed thru to the VM, since those are required
-for correct operation of things like VGA BIOS, text mode, VBE, etc.
-
-Enabling gfx_passthru option also copies the physical graphics card
-video BIOS to the guest memory, and executes the VBIOS in the guest
-to get the graphics card initialized.
-
-Most graphics adapters require vendor specific tweaks for properly
-working graphics passthru. See the XenVGAPassthroughTestedAdapters
-L<http://wiki.xen.org/wiki/XenVGAPassthroughTestedAdapters>
-wiki page for currently supported graphics cards for gfx_passthru.
-
-gfx_passthru is currently only supported with the qemu-xen-traditional
-device-model. Upstream qemu-xen device-model currently doesn't have
-support for gfx_passthru.
-
-Note that some graphics adapters (AMD/ATI cards, for example) don't
-necessarily require gfx_passthru option, so you can use the normal
-Xen PCI passthru to assign the graphics card as a secondary graphics card
-to the VM. Qemu emulated graphics card stays as the primary graphics card,
-and you get VNC output from the Qemu-emulated primary adapter.
-
-More information about Xen gfx_passthru feature is available
-on the XenVGAPassthrough L<http://wiki.xen.org/wiki/XenVGAPassthrough>
-wiki page.
-
-=item B<nomigrate=BOOLEAN>
-
-Disable migration of this domain.  This enables certain other features
-which are incompatible with migration (currently certain TSC modes XXX
-?).
-
-=item B<pci_msitranslate=BOOLEAN>
-
-XXX
-
-=item B<pci_power_mgmt=BOOLEAN>
-
-XXX
-
 =item B<cpuid="LIBXL_STRING"> or B<cpuid=[ "XEND_STRING", "XEND_STRING" ]>
 
 Configure the value returned when a guest executes CPUID instruction.
@@ -1093,29 +774,375 @@ libxl: 'host,tm=0,sse3=0'
 More info about the CPUID instruction can be found in the processor manuals, and
 in Wikipedia: L<http://en.wikipedia.org/wiki/CPUID>
 
-=item B<acpi_s3=BOOLEAN>
+=back 
 
-XXX
+=head3 Guest Virtual Time Controls
 
-=item B<acpi_s3=BOOLEAN>
+=over 4
 
-XXX
+=item B<tsc_mode="MODE">
 
-=item B<nodes=XXX>
 
-XXX
+Specifies how the TSC (Time Stamp Counter) should be provided to the
+guest (X86 only). Specifying this option as a number is
+deprecated. Options are:
 
-=item B<sched=XXX>
+=over 4
 
-XXX
+=item B<"default">
 
-=item B<device_model=XXX>
+Guest rdtsc/p executed natively when monotonicity can be guaranteed
+and emulated otherwise (with frequency scaled if necessary).
 
-XXX deprecated
+=item B<"always_emulate">
 
-=item B<vif2=XXX>
+Guest rdtsc/p always emulated at 1GHz (kernel and user). Guest rdtsc/p
+always emulated and the virtual TSC will appear to increment (kernel
+and user) at a fixed 1GHz rate, regardless of the PCPU HZ rate or
+power state; Although there is an overhead associated with emulation
+this will NOT affect underlying CPU performance.
 
-XXX deprecated
+=item B<"native">
+
+Guest rdtsc always executed natively (no monotonicity/frequency
+guarantees); guest rdtscp emulated at native frequency if unsupported
+by h/w, else executed natively.
+
+=item B<"native_paravirt">
+
+Same as B<native>, except xen manages TSC_AUX register so guest can
+determine when a restore/migration has occurred and assumes guest
+obtains/uses pvclock-like mechanism to adjust for monotonicity and
+frequency changes.
+
+=back
+
+Please see F<docs/misc/tscmode.txt> for more information on this option.
+
+=item B<localtime=BOOLEAN>
+
+Set the real time clock to local time or to UTC. 0 by default, i.e. set to UTC.
+
+=item B<rtc_timeoffset=SECONDS>
+
+Set the real time clock offset in seconds. 0 by default.
+
+
+=item B<vpt_align=BOOLEAN>
+
+Specifies that periodic Virtual Platform Timers should be aligned to
+reduce guest interrupts. Enabling this option can reduce power
+consumption, especially when a guest uses a high timer interrupt
+frequency (HZ) values. The default is 1.
+
+=item B<timer_mode=MODE>
+
+Specifies the mode for Virtual Timers. The valid values are as follows:
+
+=over 4
+
+=item B<"delay_for_missed_ticks">
+
+Delay for missed ticks. Do not advance a vcpu's time beyond the
+correct delivery time for interrupts that have been missed due to
+preemption. Deliver missed interrupts when the vcpu is rescheduled and
+advance the vcpu's virtual time stepwise for each one.
+
+=item B<"no_delay_for_missed_ticks">
+
+No delay for missed ticks. As above, missed interrupts are delivered,
+but guest time always tracks wallclock (i.e., real) time while doing
+so.
+
+=item B<"no_missed_ticks_pending">
+
+No missed interrupts are held pending. Instead, to ensure ticks are
+delivered at some non-zero rate, if we detect missed ticks then the
+internal tick alarm is not disabled if the VCPU is preempted during
+the next tick period.
+
+=item B<"one_missed_tick_pending">
+
+One missed tick pending. Missed interrupts are collapsed
+together and delivered as one 'late tick'.  Guest time always tracks
+wallclock (i.e., real) time.
+
+=back
+
+=back
+
+=head3 Support for Paravirtualisation of HVM Guests
+
+The following options allow Paravirtualised features (such as devices)
+to be exposed to the guest Operating System in an HVM guest.
+Utilising these features requires specific guest support but when
+available they will result in improved performance.
+
+=over 4
+
+=item B<xen_platform_pci=BOOLEAN>
+
+Enable or disable the Xen platform PCI device.  The presence of this
+virtual device enables a guest Operating System (subject to the
+availability of suitable drivers) to make use of paravirtualisation
+features such as disk and network devices etc. Enabling these drivers
+improves performance and is strongly recommended when available. PV
+drivers are available for various Operating Systems including HVM
+Linux L<http://wiki.xen.org/wiki/XenLinuxPVonHVMdrivers> and Microsoft
+Windows L<http://wiki.xen.org/wiki/XenWindowsGplPv>.
+
+=item B<viridian=BOOLEAN>
+
+Turns on or off the exposure of MicroSoft Hyper-V (AKA viridian)
+compatible enlightenments to the guest.  These can improve performance
+of Microsoft Windows guests from Windows Vista and Windows 2008
+onwards and setting this option for such guests is strongly
+recommended. This option should be harmless for other versions of
+Windows (although it will not give any benefit) and the majority of
+other non-Windows OSes. However it is known to be incompatible with
+some other Operating Systems and in some circumstance can prevent
+Xen's own paravirtualisation interfaces for HVM guests from being
+used.
+
+=back
+
+=head3 Emulated VGA Graphics Device
+
+The following options control the features of the emulated graphics
+device.  Many of these options behave similarly to the equivalent key
+in the B<VFB_SPEC_STRING> for configuring virtual frame buffer devices
+(see above).
+
+=over 4
+
+=item B<videoram=MBYTES>
+
+Sets the amount of RAM which the emulated video card will contain,
+which in turn limits the resolutions and bit depths which will be
+available. This option is only available when using the B<stdvga>
+option (see below).
+The default amount of video ram for stdvga is 8MB which is sufficient
+for e.g. 1600x1200 at 32bpp.
+
+When using the emulated Cirrus graphics card (B<stdvga=0>)
+the amount of video ram is fixed at 4MB which is sufficient
+for 1024x768 at 32 bpp.
+
+videoram option is currently only available when using the
+qemu-xen-traditional device-model. Upstream qemu-xen device-model
+currently does not support changing the amount of video memory for the
+emulated graphics device.
+
+=item B<stdvga=BOOLEAN>
+
+Select a standard VGA card with VBE (VESA BIOS Extensions) as the
+emulated graphics device. The default is false which means to emulate
+a Cirrus Logic GD5446 VGA card. If your guest supports VBE 2.0 or
+later (e.g. Windows XP onwards) then you should enable this.
+stdvga supports more video ram and bigger resolutions than Cirrus.
+
+=item B<vnc=BOOLEAN>
+
+Allow access to the display via the VNC protocol.  This enables the
+other VNC-related settings.  The default is to enable this.
+
+=item B<vncviewer=BOOLEAN>
+
+Automatically spawn a vncviewer when creating/restoring a guest.
+
+=item B<vnclisten="ADDRESS[:DISPLAYNUM]">
+
+Specifies the IP address, and optionally VNC display number, to use.
+
+=item B<vncdisplay=DISPLAYNUM>
+
+Specifies the VNC display number to use. The actual TCP port number
+will be DISPLAYNUM+5900.
+
+=item B<vncunused=BOOLEAN>
+
+Requests that the VNC display setup search for a free TCP port to use.
+The actual display used can be accessed with C<xl vncviewer>.
+
+=item B<vncpasswd="PASSWORD">
+
+Specifies the password for the VNC server.
+
+=item B<keymap="LANG">
+
+Configure the keymap to use for the keyboard associated with this
+display. If the input method does not easily support raw keycodes
+(e.g. this is often the case when using VNC) then this allows us to
+correctly map the input keys into keycodes seen by the guest. The
+specific values which are accepted are defined by the version of the
+device-model which you are using. See L</"Keymaps"> below or consult the
+L<qemu(1)> manpage. The default is B<en-us>.
+
+=item B<sdl=BOOLEAN>
+
+Specifies that the display should be presented via an X window (using
+Simple DirectMedia Layer). The default is not to enable this mode.
+
+=item B<opengl=BOOLEAN>
+
+Enable OpenGL acceleration of the SDL display. Only effects machines
+using B<device_model_version="qemu-xen-traditional"> and only if the
+device-model was compiled with OpenGL support. 0 by default.
+
+=item B<nographic=BOOLEAN>
+
+Enable or disable the virtual graphics device.  The default is to
+provide a VGA graphics device but this option can be used to disable
+it.
+
+=back
+
+=head3 Spice Graphics Support
+
+The following options control the features of SPICE.
+
+=over 4
+
+=item B<spice=BOOLEAN>
+
+Allow access to the display via the SPICE protocol.  This enables the
+other SPICE-related settings.
+
+=item B<spicehost="ADDRESS">
+
+Specify the interface address to listen on if given, otherwise any
+interface.
+
+=item B<spiceport=NUMBER>
+
+Specify the port to listen on by the SPICE server if the SPICE is
+enabled.
+
+=item B<spicetls_port=NUMBER>
+
+Specify the secure port to listen on by the SPICE server if the SPICE
+is enabled. At least one of the spiceport or spicetls_port must be
+given if SPICE is enabled.  NB. the options depending on spicetls_port
+have not been supported.
+
+=item B<spicedisable_ticketing=BOOLEAN>
+
+Enable client connection without password. When disabled, spicepasswd
+must be set. The default is 0.
+
+=item B<spicepasswd="PASSWORD">
+
+Specify the ticket password which is used by a client for connection.
+
+=item B<spiceagent_mouse=BOOLEAN>
+
+Whether SPICE agent is used for client mouse mode. The default is true
+(turn on)
+
+=back
+
+=head3 Miscellaneous Emulated Hardware
+
+=over 4
+
+=item B<serial=DEVICE>
+
+Redirect the virtual serial port to B<DEVICE>. Please see the
+B<-serial> option in the L<qemu(1)> manpage for details of the valid
+B<DEVICE> options. Default is B<vc> when in graphical mode and
+B<stdio> if B<nographics=1> is used.
+
+=item B<soundhw=DEVICE>
+
+Select the virtual sound card to expose to the guest. The valid
+devices are defined by the device model configuration, please see the
+L<qemu(1)> manpage for details. The default is not to export any sound
+device.
+
+=item B<usb=BOOLEAN>
+
+Enables or disables a USB bus in the guest.
+
+=item B<usbdevice=DEVICE>
+
+Adds B<DEVICE> to the USB bus. The USB bus must also be enabled using
+B<usb=1>. The most common use for this option is B<usbdevice=tablet>
+which adds pointer device using absolute coordinates. Such devices
+function better than relative coordinate devices (such as a standard
+mouse) since many methods of exporting guest graphics (such as VNC)
+work better in this mode. Note that this is independent of the actual
+pointer device you are using on the host/client side.
+
+=back
+
+=head2 Device-Model Options
+
+The following options control the selection of the device-model.  This
+is the component which provides emulation of the virtual devices to an
+HVM guest.  For a PV guest a device-model is sometimes used to provide
+backends for certain PV devices (most usually a virtual framebuffer
+device).
+
+=over 4
+
+=item B<device_model_version="DEVICE-MODEL">
+
+Selects which variant of the device-model should be used for this
+guest. Valid values are:
+
+=over 4
+
+=item B<qemu-xen-traditional>
+
+Use the device-model based upon the historical Xen fork of Qemu.  This
+device-model is currently the default.
+
+=item B<qemu-xen>
+
+use the device-model merged into the upstream QEMU project.  This
+device-model will become the default in a future version of Xen.
+
+=back
+
+It is recommended to accept the default value for new guests.  If
+you have existing guests then, depending on the nature of the guest
+Operating System, you may wish to force them to use the device
+model which they were installed with.
+
+=item B<device_model_override="PATH">
+
+Override the path to the binary to be used as the device-model. The
+binary provided here MUST be consistent with the
+`device_model_version` which you have specified. You should not
+normally need to specify this option.
+
+=item B<device_model_stubdomain_override=BOOLEAN>
+
+Override the use of stubdomain based device-model.  Normally this will
+be automatically selected based upon the other features and options
+you have selected.
+
+=item B<device_model_stubdomain_seclabel="LABEL">
+
+Assign an XSM security label to the device-model stubdomain.
+
+=item B<device_model_args=[ "ARG", "ARG", ...]>
+
+Pass additional arbitrary options on the device-model command
+line. Each element in the list is passed as an option to the
+device-model.
+
+=item B<device_model_args_pv=[ "ARG", "ARG", ...]>
+
+Pass additional arbitrary options on the device-model command line for
+a PV device model only. Each element in the list is passed as an
+option to the device-model.
+
+=item B<device_model_args_hvm=[ "ARG", "ARG", ...]>
+
+Pass additional arbitrary options on the device-model command line for
+an HVM device model only. Each element in the list is passed as an
+option to the device-model.
 
 =back
 
@@ -1138,27 +1165,26 @@ See L<qemu(1)> for more information.
 
 =item L<xl(1)>
 
+=item L<xlcpupool.cfg(5)>
+
 =item F<xl-disk-configuration>
 
 =item F<xl-network-configuration>
 
+=item F<docs/misc/tscmode.txt>
+
 =back
 
 =head1 FILES
 
 F</etc/xen/NAME.cfg>
 F</var/xen/dump/NAME>
-F<docs/misc/tscmode.txt>
 
 =head1 BUGS
 
-This document is a work in progress and contains items which require
-further documentation and which are generally incomplete (marked with
-XXX).  However all options are included here whether or not they are
-fully documented.
-
-Patches to improve incomplete items (or any other item) would be
-gratefully received on the xen-devel@lists.xen.org mailing
+This document may contain items which require further
+documentation. Patches to improve incomplete items (or any other item)
+are gratefully received on the xen-devel@lists.xen.org mailing
 list. Please see L<http://wiki.xen.org/wiki/SubmittingXenPatches> for
 information on how to submit a patch to Xen.
 

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 21:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 21:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCdAU-00033T-JW; Fri, 14 Sep 2012 21:11:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAS-00031g-VN
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:17 +0000
Received: from [85.158.139.83:51917] by server-8.bemta-5.messagelabs.com id
	AA/89-15219-47D93505; Fri, 14 Sep 2012 21:11:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-182.messagelabs.com!1347657072!23234509!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.7 required=7.0 tests=BODY_RANDOM_LONG,HOT_NASTY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26693 invoked from network); 14 Sep 2012 21:11:13 -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;
	14 Sep 2012 21:11: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 1TCdAO-0000At-5D
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAO-0008F6-0R
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:12 +0000
Message-Id: <E1TCdAO-0008F6-0R@xenbits.xen.org>
Date: Fri, 14 Sep 2012 21:11:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: flesh out xl.cfg documentation,
	correct typos, reorganize
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Matt Wilson <msw@amazon.com>
# Date 1347613371 -3600
# Node ID 0b03d56240250d2ad5ef9e2d0c37d3b7c76922db
# Parent  116f5c34354b9013ddee6066d8dcfeed6dad19f0
docs: flesh out xl.cfg documentation, correct typos, reorganize

Some highlights:
 * Correct some markup errors:
       Around line 663:
           '=item' outside of any '=over'
       Around line 671:
           You forgot a '=back' before '=head3'
 * Add documentation for msitranslate, power_mgnt, acpi_s3, aspi_s4,
   gfx_passthru, nomigrate, etc.
 * Reorganize items in "unclassified" sections like cpuid,
   gfx_passthru to where they belong
 * Correct link L<> references so they can be resolved within the
   document
 * Remove placeholders for deprecated options device_model and vif2
 * Remove placeholder for "sched" and "node", as these are options for
   cpupool configuration. Perhaps cpupool configuration deserves
   a section in this document.
 * Rename "global" options to "general"
 * Add section headers to group general VM options.

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


diff -r 116f5c34354b -r 0b03d5624025 docs/man/xl.cfg.pod.5
--- a/docs/man/xl.cfg.pod.5	Fri Sep 14 10:02:51 2012 +0100
+++ b/docs/man/xl.cfg.pod.5	Fri Sep 14 10:02:51 2012 +0100
@@ -17,7 +17,7 @@ domain.
 
 A domain config file consists of a series of C<KEY=VALUE> pairs.
 
-Some C<KEY>s are mandatory, others are global options which apply to
+Some C<KEY>s are mandatory, others are general options which apply to
 any guest type while others relate only to specific guest types
 (e.g. PV or HVM guests).
 
@@ -80,21 +80,14 @@ operating systems.
 
 =back
 
-=head2 Global Options
+=head2 General Options
 
 The following options apply to guests of any type.
 
+=head3 CPU Allocation
+
 =over 4
 
-=item B<uuid="UUID">
-
-Specifies the UUID of the domain.  If not specified, a fresh unique
-UUID will be generated.
-
-=item B<vncviewer=BOOLEAN>
-
-Automatically spawn a vncviewer when creating/restoring a guest
-
 =item B<pool="CPUPOOLNAME">
 
 Put the guest's vcpus into the named cpu pool.
@@ -138,6 +131,12 @@ node) by pinning it to the cpus of those
 utilized with the goals of maximizing performance for the domain and, at
 the same time, achieving efficient utilization of the host's CPUs and RAM.
 
+=back
+
+=head3 CPU Scheduling
+
+=over 4
+
 =item B<cpu_weight=WEIGHT>
 
 A domain with a weight of 512 will get twice as much CPU as a domain
@@ -176,6 +175,12 @@ Honoured by the sedf scheduler.
 Flag for allowing domain to run in extra time.
 Honoured by the sedf scheduler.
 
+=back
+
+=head3 Memory Allocation
+
+=over 4
+
 =item B<memory=MBYTES>
 
 Start the guest with MBYTES megabytes of RAM.
@@ -190,6 +195,12 @@ if the values of B<memory=> and B<maxmem
 A "pre-ballooned" HVM guest needs a balloon driver, without a balloon driver
 it will crash.
 
+=back
+
+=head3 Event Actions
+
+=over 4
+
 =item B<on_poweroff="ACTION">
 
 Specifies what should be done with the domain if it shuts itself down.
@@ -200,12 +211,12 @@ The C<ACTION>s are:
 =item B<destroy>
 
 destroy the domain
-     
+
 =item B<restart>
 
 destroy the domain and immediately create a new domain with the same
 configuration
-        
+
 =item B<rename-restart>
 
 rename the domain which terminated, and then immediately create a new
@@ -244,10 +255,28 @@ Default is C<destroy>.
 
 Action to take if the domain crashes.  Default is C<destroy>.
 
+=back
+
+=head3 Other Options
+
+=over 4
+
+=item B<uuid="UUID">
+
+Specifies the UUID of the domain.  If not specified, a fresh unique
+UUID will be generated.
+
 =item B<seclabel="LABEL">
 
 Assign an XSM security label to this domain.
 
+=item B<nomigrate=BOOLEAN>
+
+Disable migration of this domain.  This enables certain other features
+which are incompatible with migration. Currently this is limited to
+enabling the invariant TSC feature flag in cpuid results when TSC is
+not emulated.
+
 =back
 
 =head2 Devices
@@ -309,7 +338,20 @@ Specifies the password for the VNC serve
 =item C<sdl=BOOLEAN>
 
 Specifies that the display should be presented via an X window (using
-Simple DirectMedia Layer). The default is to not enable this mode
+Simple DirectMedia Layer). The default is to not enable this mode.
+
+=item C<display=DISPLAY>
+
+Specifies the X Window display that should be used when the sdl option
+is used. Note: passing this value to the device-model is not currently
+implemented, so providing this option will have no effect.
+
+=item C<xauthority=XAUTHORITY>
+
+Specifies the path to the X authority file that should be used to
+connect to the X server when the sdl option is used. Note: passing
+this value to the device-model is not currently implemented, so
+providing this option will have no effect.
 
 =item C<opengl=BOOLEAN>
 
@@ -324,19 +366,9 @@ display. If the input method does not ea
 (e.g. this is often the case when using VNC) then this allows us to
 correctly map the input keys into keycodes seen by the guest. The
 specific values which are accepted are defined by the version of the
-device-model which you are using. See L<Keymaps> below or consult the
+device-model which you are using. See L</"Keymaps"> below or consult the
 L<qemu(1)> manpage. The default is B<en-us>.
 
-=item C<display=XXX>
-
-XXX written to xenstore backend for vfb but does not appear to be used
-anywhere?
-
-=item C<authority=XXX>
-
-XXX written to xenstore backend for vfb but does not appear to be used
-anywhere?
-
 =back
 
 =item B<pci=[ "PCI_SPEC_STRING", "PCI_SPEC_STRING", ... ]>
@@ -348,7 +380,7 @@ has the form C<[DDDD:]BB:DD.F[@VSLOT],KE
 
 =item B<DDDD:BB:DD.F>
 
-identifies the PCI device from the host perspective in domain
+Identifies the PCI device from the host perspective in domain
 (B<DDDD>), Bus (B<BB>), Device (B<DD>) and Function (B<F>) syntax. This is
 the same scheme as used in the output of C<lspci> for the device in
 question. Note: By default C<lspci> will omit the domain (B<DDDD>) if it
@@ -357,9 +389,9 @@ is zero and it is optional here also. Yo
 
 =item B<@VSLOT>
 
-specifies the virtual device where the guest will see this
+Specifies the virtual device where the guest will see this
 device. This is equivalent to the B<DD> which the guest sees. In a
-guest B<DDDD> and B<BB> are C<0000:00>. XXX how does this really work?
+guest B<DDDD> and B<BB> are C<0000:00>.
 
 =item B<KEY=VALUE>
 
@@ -367,14 +399,6 @@ Possible B<KEY>s are:
 
 =over 4
 
-=item B<msitranslate=BOOLEAN>
-
-XXX
-
-=item B<power_mgmt=BOOLEAN>
-
-XXX
-
 =item B<permissive=BOOLEAN>
 
 (PV only) By default pciback only allows PV guests to write "known
@@ -386,6 +410,19 @@ caution: it gives the guest much more co
 may have security or stability implications.  It is recommended to
 enable this option only for trusted VMs under administrator control.
 
+=item B<msitranslate=BOOLEAN>
+
+Specifies that MSI-INTx translation should be turned on for the PCI
+device. When enabled, MSI-INTx translation will always enable MSI on
+the PCI device regardless whether the guest uses INTx or MSI. Some
+device drivers, such as NVIDIA's, detect an inconsistency and do not
+function when this option is enabled. Therefore the default is 0.
+
+=item B<power_mgmt=BOOLEAN>
+
+(HVM only) Specifies that the VM should be able to program the
+D0-D3hot power management states for the PCI device. 0 by default.
+
 =back
 
 =back
@@ -393,19 +430,65 @@ enable this option only for trusted VMs 
 =item B<pci_permissive=BOOLEAN>
 
 (PV only) Changes the default value of 'permissive' for all PCI
-devices for this VM.  This can still be overridden on a per-device
-basis. This option should be enabled with caution: it gives the guest
-much more control over the device, which may have security or
-stability implications.  It is recommended to enable this option only
-for trusted VMs under administrator control.  See the "pci=" section
-for more information on the "permissive" flag.
+devices passed through to this VM. See L<permissive|/"permissive_boolean">
+above.
 
-=back
+=item B<pci_msitranslate=BOOLEAN>
+
+Changes the default value of 'msitranslate' for all PCI devices passed
+through to this VM. See L<msitranslate|/"msitranslate_boolean"> above.
+
+=item B<pci_power_mgmt=BOOLEAN>
+
+(HVM only) Changes the default value of 'power_mgmt' for all PCI
+devices passed through to this VM. See L<power_mgt|/"power_mgmt_boolean">
+above.
+
+=item B<gfx_passthru=BOOLEAN>
+
+Enable graphics device PCI passthrough. This option makes an assigned
+PCI graphics card become primary graphics card in the VM. The QEMU
+emulated graphics adapter is disabled and the VNC console for the VM
+will not have any graphics output. All graphics output, including boot
+time QEMU BIOS messages from the VM, will go to the physical outputs
+of the passedthrough physical graphics card.
+
+The graphics card PCI device to passthrough is chosen with B<pci>
+option, exactly in the same way as normal Xen PCI device
+passthrough/assignment is done.  Note that gfx_passthru does not do
+any kind of sharing of the GPU, so you can only assign the GPU to one
+single VM at a time.
+
+gfx_passthru also enables various legacy VGA memory ranges, BARs, MMIOs,
+and ioports to be passed thru to the VM, since those are required
+for correct operation of things like VGA BIOS, text mode, VBE, etc.
+
+Enabling gfx_passthru option also copies the physical graphics card
+video BIOS to the guest memory, and executes the VBIOS in the guest
+to initialize the graphics card.
+
+Most graphics adapters require vendor specific tweaks for properly
+working graphics passthrough. See the XenVGAPassthroughTestedAdapters
+L<http://wiki.xen.org/wiki/XenVGAPassthroughTestedAdapters> wiki page
+for currently supported graphics cards for gfx_passthru.
+
+gfx_passthru is currently only supported with the qemu-xen-traditional
+device-model. Upstream qemu-xen device-model currently does not have
+support for gfx_passthru.
+
+Note that some graphics adapters (AMD/ATI cards, for example) do not
+necessarily require gfx_passthru option, so you can use the normal Xen
+PCI passthrough to assign the graphics card as a secondary graphics
+card to the VM. The QEMU-emulated graphics card remains the primary
+graphics card, and VNC output is available from the QEMU-emulated
+primary adapter.
+
+More information about Xen gfx_passthru feature is available
+on the XenVGAPassthrough L<http://wiki.xen.org/wiki/XenVGAPassthrough>
+wiki page.
 
 =item B<ioports=[ "IOPORT_RANGE", "IOPORT_RANGE", ... ]>
 
-=over 4
-
 Allow guest to access specific legacy I/O ports. Each B<IOPORT_RANGE>
 is given in hexadecimal and may either a span e.g. C<2f8-2ff>
 (inclusive) or a single I/O port C<2f8>.
@@ -413,12 +496,8 @@ is given in hexadecimal and may either a
 It is recommended to use this option only for trusted VMs under
 administrator control.
 
-=back
-
 =item B<irqs=[ NUMBER, NUMBER, ... ]>
 
-=over 4
-
 Allow a guest to access specific physical IRQs.
 
 It is recommended to use this option only for trusted VMs under
@@ -471,12 +550,12 @@ address space consists of a single conti
 option is specified the virtual e820 instead reflects the host e820
 and contains the same PCI holes. The total amount of RAM represented
 by the memory map is always the same, this option configures only how
-it is layed out.
+it is laid out.
 
 Exposing the host e820 to the guest gives the guest kernel the
 opportunity to set aside the required part of its pseudo-physical
 address space in order to provide address space to map passedthrough
-PCI devices. It is guest Operating System dependant whether this
+PCI devices. It is guest Operating System dependent whether this
 option is required, specifically it is required when using a mainline
 Linux ("pvops") kernel. This option defaults to true if any PCI
 passthrough devices are configured and false otherwise. If you do not
@@ -600,6 +679,16 @@ by most modern guest Operating Systems. 
 default and usually you should omit it. However it may be necessary to
 disable ACPI for compatibility with some guest Operating Systems.
 
+=item B<acpi_s3=BOOLEAN>
+
+Include the S3 (suspend-to-ram) power state in the virtual firmware
+ACPI table. 1 by default.
+
+=item B<acpi_s4=BOOLEAN>
+
+Include S4 (suspend-to-disk) power state in the virtual firmware ACPI
+table. 1 by default.
+
 =item B<apic=BOOLEAN>
 
 Include information regarding APIC (Advanced Programmable Interrupt
@@ -637,414 +726,6 @@ of Xen) within a Xen guest or to support
 which uses hardware virtualisation extensions (e.g. Windows XP
 compatibility mode on more modern Windows OS).
 
-=back 
-
-=head3 Guest Virtual Time Controls
-
-=over 4
-
-=item B<tsc_mode="MODE">
-
-
-Specifies how the TSC (Time Stamp Counter) should be provided to the
-guest (X86 only). Specifying this option as a number is
-deprecated. Options are:
-
-=over 4
-
-=item B<"default">
-
-Guest rdtsc/p executed natively when monotonicity can be guaranteed
-and emulated otherwise (with frequency scaled if necessary).
-
-=item B<"always_emulate">
-
-Guest rdtsc/p always emulated at 1GHz (kernel and user). Guest rdtsc/p
-always emulated and the virtual TSC will appear to increment (kernel
-and user) at a fixed 1GHz rate, regardless of the PCPU HZ rate or
-power state; Although there is an overhead associated with emulation
-this will NOT affect underlying CPU performance.
-
-=item B<"native">
-
-Guest rdtsc always executed natively (no monotonicity/frequency
-guarantees); guest rdtscp emulated at native frequency if unsupported
-by h/w, else executed natively.
-
-=item B<"native_paravirt">
-
-Same as B<native>, except xen manages TSC_AUX register so guest can
-determine when a restore/migration has occurred and assumes guest
-obtains/uses pvclock-like mechanism to adjust for monotonicity and
-frequency changes.
-
-=back
-
-=back
-
-Please see F<docs/misc/tscmode.txt> for more information on this option.
-
-=item B<localtime=BOOLEAN>
-
-Set the real time clock to local time or to UTC. 0 by default, i.e. set to UTC.
-
-=item B<rtc_timeoffset=SECONDS>
-
-Set the real time clock offset in seconds. 0 by default.
-
-=head3 Support for Paravirtualisation of HVM Guests
-
-The following options allow Paravirtualised features (such as devices)
-to be exposed to the guest Operating System in an HVM guest.
-Utilising these features requires specific guest support but when
-available they will result in improved performance.
-
-=over 4
-
-=item B<xen_platform_pci=BOOLEAN>
-
-Enable or disable the Xen platform PCI device.  The presence of this
-virtual device enables a guest Operating System (subject to the
-availability of suitable drivers) to make use of paravirtualisation
-features such as disk and network devices etc. Enabling these drivers
-improves performance and is strongly recommended when available. PV
-drivers are available for various Operating Systems including HVM
-Linux L<http://wiki.xen.org/wiki/XenLinuxPVonHVMdrivers> and Microsoft
-Windows L<http://wiki.xen.org/wiki/XenWindowsGplPv>.
-
-=item B<viridian=BOOLEAN>
-
-Turns on or off the exposure of MicroSoft Hyper-V (AKA viridian)
-compatible enlightenments to the guest.  These can improve performance
-of Microsoft Windows guests from Windows Vista and Windows 2008
-onwards and setting this option for such guests is strongly
-recommended. This option should be harmless for other versions of
-Windows (although it won't give any benefit) and the majority of other
-non-Windows OSes. However it is known to be incompatible with some
-other Operating Systems and in some circumstance can prevent Xen's own
-paravirtualisation interfaces for HVM guests from being used.
-
-=back
-
-=head3 Emulated VGA Graphics Device
-
-The following options control the features of the emulated graphics
-device.  Many of these options behave similarly to the equivalent key
-in the B<VFB_SPEC_STRING> for configuring virtual frame buffer devices
-(see above).
-
-=over 4
-
-=item B<videoram=MBYTES>
-
-Sets the amount of RAM which the emulated video card will contain,
-which in turn limits the resolutions and bit depths which will be
-available. This option is only available when using the B<stdvga>
-option (see below).
-The default amount of video ram for stdvga is 8MB which is sufficient
-for e.g. 1600x1200 at 32bpp.
-
-When using the emulated Cirrus graphics card (B<stdvga=0>)
-the amount of video ram is fixed at 4MB which is sufficient
-for 1024x768 at 32 bpp.
-
-videoram option is currently only available when using the
-qemu-xen-traditional device-model. Upstream qemu-xen device-model
-currently doesn't support changing the amount of video memory
-for the emulated graphics device.
-
-=item B<stdvga=BOOLEAN>
-
-Select a standard VGA card with VBE (VESA BIOS Extensions) as the
-emulated graphics device. The default is false which means to emulate
-a Cirrus Logic GD5446 VGA card. If your guest supports VBE 2.0 or
-later (e.g. Windows XP onwards) then you should enable this.
-stdvga supports more video ram and bigger resolutions than Cirrus.
-
-=item B<vnc=BOOLEAN>
-
-Allow access to the display via the VNC protocol.  This enables the
-other VNC-related settings.  The default is to enable this.
-
-=item B<vnclisten="ADDRESS[:DISPLAYNUM]">
-
-Specifies the IP address, and optionally VNC display number, to use.
-
-=item B<vncdisplay=DISPLAYNUM>
-
-Specifies the VNC display number to use. The actual TCP port number
-will be DISPLAYNUM+5900.
-
-=item B<vncunused=BOOLEAN>
-
-Requests that the VNC display setup search for a free TCP port to use.
-The actual display used can be accessed with C<xl vncviewer>.
-
-=item B<vncpasswd="PASSWORD">
-
-Specifies the password for the VNC server.
-
-=item B<keymap="LANG">
-
-Configure the keymap to use for the keyboard associated with this
-display. If the input method does not easily support raw keycodes
-(e.g. this is often the case when using VNC) then this allows us to
-correctly map the input keys into keycodes seen by the guest. The
-specific values which are accepted are defined by the version of the
-device-model which you are using. See L<Keymaps> below of consult the
-L<qemu(1)> manpage. The default is B<en-us>.
-
-=item B<sdl=BOOLEAN>
-
-Specifies that the display should be presented via an X window (using
-Simple DirectMedia Layer). The default is not to enable this mode.
-
-=item B<opengl=BOOLEAN>
-
-Enable OpenGL acceleration of the SDL display. Only effects machines
-using B<device_model_version="qemu-xen-traditional"> and only if the
-device-model was compiled with OpenGL support. Disabled by default.
-
-=item B<nographic=BOOLEAN>
-
-Enable or disable the virtual graphics device.  The default is to
-provide a VGA graphics device but this option can be used to disable
-it.
-
-=back
-
-=head3 Spice Graphics Support
-
-The following options control the features of SPICE.
-
-=over 4
-
-=item B<spice=BOOLEAN>
-
-Allow access to the display via the SPICE protocol.  This enables the
-other SPICE-related settings.
-
-=item B<spicehost="ADDRESS">
-
-Specify the interface address to listen on if given, otherwise any
-interface.
-
-=item B<spiceport=NUMBER>
-
-Specify the port to listen on by the SPICE server if the SPICE is
-enabled.
-
-=item B<spicetls_port=NUMBER>
-
-Specify the secure port to listen on by the SPICE server if the SPICE
-is enabled. At least one of the spiceport or spicetls_port must be
-given if SPICE is enabled.  NB. the options depending on spicetls_port
-have not been supported.
-
-=item B<spicedisable_ticketing=BOOLEAN>
-
-Enable client connection without password. The default is false. If
-it's false (set to 0), spicepasswd must be set.
-
-=item B<spicepasswd="PASSWORD">
-
-Specify the ticket password which is used by a client for connection.
-
-=item B<spiceagent_mouse=BOOLEAN>
-
-Whether SPICE agent is used for client mouse mode. The default is true
-(turn on)
-
-=back
-
-=head3 Miscellaneous Emulated Hardware
-
-=over 4
-
-=item B<serial=DEVICE>
-
-Redirect the virtual serial port to B<DEVICE>. Please see the
-B<-serial> option in the L<qemu(1)> manpage for details of the valid
-B<DEVICE> options. Default is B<vc> when in graphical mode and
-B<stdio> if B<nographics=1> is used.
-
-=item B<soundhw=DEVICE>
-
-Select the virtual sound card to expose to the guest. The valid
-devices are defined by the device model configuration, please see the
-L<qemu(1)> manpage for details. The default is not to export any sound
-device.
-
-=item B<usb=BOOLEAN>
-
-Enables or disables a USB bus in the guest.
-
-=item B<usbdevice=DEVICE>
-
-Adds B<DEVICE> to the USB bus. The USB bus must also be enabled using
-B<usb=1>. The most common use for this option is B<usbdevice=tablet>
-which adds pointer device using absolute coordinates. Such devices
-function better than relative coordinate devices (such as a standard
-mouse) since many methods of exporting guest graphics (such as VNC)
-work better in this mode. Note that this is independent of the actual
-pointer device you are using on the host/client side. XXX should/could
-be a list of devices.
-
-=back
-
-=head3 Unclassified HVM Specific Options
-
-These HVM specific options have not yet been documented or
-classified. They almost certainly belong in a more appropriate
-section.
-
-=over 4
-
-=item B<vpt_align=BOOLEAN>
-
-Align the Virtual Platform Timer ??? XXX Reduces interrupts?
-
-=item B<timer_mode=NUMBER>
-
-Set mode for Virtual Timers XXX ??? should be an enum of particular
-values. See C<HVM_PARAM_TIMER_MODE> in
-F<xen/include/public/hvm/params.h>.
-
-=back
-
-=head2 Device-Model Options
-
-The following options control the selection of the device-model.  This
-is the component which provides emulation of the virtual devices to an
-HVM guest.  For a PV guest a device-model is sometimes used to provide
-backends for certain PV devices (most usually a virtual framebuffer
-device).
-
-=over 4
-
-=item B<device_model_version="DEVICE-MODEL">
-
-Selects which variant of the device-model should be used for this
-guest. Valid values are:
-
-=over 4
-
-=item B<qemu-xen-traditional>
-
-Use the device-model based upon the historical Xen fork of Qemu.  This
-device-model is currently the default.
-
-=item B<qemu-xen>
-
-use the device-model merged into the upstream Qemu project.  This
-device-model will become the default in a future version of Xen.
-
-=back
-
-It is recommended to accept the default value for new guests.  If
-you have existing guests then, depending on the nature of the guest
-Operating System, you may wish to force them to use the device
-model which they were installed with.
-
-=item B<device_model_override="PATH">
-
-Override the path to the binary to be used as the device-model. The
-binary provided here MUST be consistent with the
-`device_model_version` which you have specified. You should not
-normally need to specify this option.
-
-=item B<device_model_stubdomain_override=BOOLEAN>
-
-Override the use of stubdomain based device-model.  Normally this will
-be automatically selected based upon the other features and options
-you have selected.
-
-=item B<device_model_stubdomain_seclabel="LABEL">
-
-Assign an XSM security label to the device-model stubdomain.
-
-=item B<device_model_args=[ "ARG", "ARG", ...]>
-
-Pass additional arbitrary options on the device-model command
-line. Each element in the list is passed as an option to the
-device-model.
-
-=item B<device_model_args_pv=[ "ARG", "ARG", ...]>
-
-Pass additional arbitrary options on the device-model command line for
-a PV device model only. Each element in the list is passed as an
-option to the device-model.
-
-=item B<device_model_args_hvm=[ "ARG", "ARG", ...]>
-
-Pass additional arbitrary options on the device-model command line for
-an HVM device model only. Each element in the list is passed as an
-option to the device-model.
-
-=back
-
-=head2 Unclassified General Options
-
-These have not yet been fully documented or classified. They almost
-certainly belong in a more appropriate section.
-
-=over 4
-
-=item B<gfx_passthru=BOOLEAN>
-
-Enable graphics device PCI passthrough. This option makes the passthru
-graphics card become primary graphics card in the VM, so the Qemu emulated
-graphics adapter is disabled, and the VNC console for the VM won't have
-any graphics output. All graphics output, including boot time Qemu BIOS
-messages from the VM, will go to the physical outputs of the passed thru
-physical graphics card.
-
-Graphics card PCI device to passthru is chosen with B<pci> option,
-exactly in the same way as normal Xen PCI device passthru/assignment is done.
-Note that gfx_passthru doesn't do any kind of sharing
-of the GPU, so you can only assign the GPU to one single VM at a time.
-
-gfx_passthru also enables various legacy VGA memory ranges, BARs, MMIOs,
-and ioports to be passed thru to the VM, since those are required
-for correct operation of things like VGA BIOS, text mode, VBE, etc.
-
-Enabling gfx_passthru option also copies the physical graphics card
-video BIOS to the guest memory, and executes the VBIOS in the guest
-to get the graphics card initialized.
-
-Most graphics adapters require vendor specific tweaks for properly
-working graphics passthru. See the XenVGAPassthroughTestedAdapters
-L<http://wiki.xen.org/wiki/XenVGAPassthroughTestedAdapters>
-wiki page for currently supported graphics cards for gfx_passthru.
-
-gfx_passthru is currently only supported with the qemu-xen-traditional
-device-model. Upstream qemu-xen device-model currently doesn't have
-support for gfx_passthru.
-
-Note that some graphics adapters (AMD/ATI cards, for example) don't
-necessarily require gfx_passthru option, so you can use the normal
-Xen PCI passthru to assign the graphics card as a secondary graphics card
-to the VM. Qemu emulated graphics card stays as the primary graphics card,
-and you get VNC output from the Qemu-emulated primary adapter.
-
-More information about Xen gfx_passthru feature is available
-on the XenVGAPassthrough L<http://wiki.xen.org/wiki/XenVGAPassthrough>
-wiki page.
-
-=item B<nomigrate=BOOLEAN>
-
-Disable migration of this domain.  This enables certain other features
-which are incompatible with migration (currently certain TSC modes XXX
-?).
-
-=item B<pci_msitranslate=BOOLEAN>
-
-XXX
-
-=item B<pci_power_mgmt=BOOLEAN>
-
-XXX
-
 =item B<cpuid="LIBXL_STRING"> or B<cpuid=[ "XEND_STRING", "XEND_STRING" ]>
 
 Configure the value returned when a guest executes CPUID instruction.
@@ -1093,29 +774,375 @@ libxl: 'host,tm=0,sse3=0'
 More info about the CPUID instruction can be found in the processor manuals, and
 in Wikipedia: L<http://en.wikipedia.org/wiki/CPUID>
 
-=item B<acpi_s3=BOOLEAN>
+=back 
 
-XXX
+=head3 Guest Virtual Time Controls
 
-=item B<acpi_s3=BOOLEAN>
+=over 4
 
-XXX
+=item B<tsc_mode="MODE">
 
-=item B<nodes=XXX>
 
-XXX
+Specifies how the TSC (Time Stamp Counter) should be provided to the
+guest (X86 only). Specifying this option as a number is
+deprecated. Options are:
 
-=item B<sched=XXX>
+=over 4
 
-XXX
+=item B<"default">
 
-=item B<device_model=XXX>
+Guest rdtsc/p executed natively when monotonicity can be guaranteed
+and emulated otherwise (with frequency scaled if necessary).
 
-XXX deprecated
+=item B<"always_emulate">
 
-=item B<vif2=XXX>
+Guest rdtsc/p always emulated at 1GHz (kernel and user). Guest rdtsc/p
+always emulated and the virtual TSC will appear to increment (kernel
+and user) at a fixed 1GHz rate, regardless of the PCPU HZ rate or
+power state; Although there is an overhead associated with emulation
+this will NOT affect underlying CPU performance.
 
-XXX deprecated
+=item B<"native">
+
+Guest rdtsc always executed natively (no monotonicity/frequency
+guarantees); guest rdtscp emulated at native frequency if unsupported
+by h/w, else executed natively.
+
+=item B<"native_paravirt">
+
+Same as B<native>, except xen manages TSC_AUX register so guest can
+determine when a restore/migration has occurred and assumes guest
+obtains/uses pvclock-like mechanism to adjust for monotonicity and
+frequency changes.
+
+=back
+
+Please see F<docs/misc/tscmode.txt> for more information on this option.
+
+=item B<localtime=BOOLEAN>
+
+Set the real time clock to local time or to UTC. 0 by default, i.e. set to UTC.
+
+=item B<rtc_timeoffset=SECONDS>
+
+Set the real time clock offset in seconds. 0 by default.
+
+
+=item B<vpt_align=BOOLEAN>
+
+Specifies that periodic Virtual Platform Timers should be aligned to
+reduce guest interrupts. Enabling this option can reduce power
+consumption, especially when a guest uses a high timer interrupt
+frequency (HZ) values. The default is 1.
+
+=item B<timer_mode=MODE>
+
+Specifies the mode for Virtual Timers. The valid values are as follows:
+
+=over 4
+
+=item B<"delay_for_missed_ticks">
+
+Delay for missed ticks. Do not advance a vcpu's time beyond the
+correct delivery time for interrupts that have been missed due to
+preemption. Deliver missed interrupts when the vcpu is rescheduled and
+advance the vcpu's virtual time stepwise for each one.
+
+=item B<"no_delay_for_missed_ticks">
+
+No delay for missed ticks. As above, missed interrupts are delivered,
+but guest time always tracks wallclock (i.e., real) time while doing
+so.
+
+=item B<"no_missed_ticks_pending">
+
+No missed interrupts are held pending. Instead, to ensure ticks are
+delivered at some non-zero rate, if we detect missed ticks then the
+internal tick alarm is not disabled if the VCPU is preempted during
+the next tick period.
+
+=item B<"one_missed_tick_pending">
+
+One missed tick pending. Missed interrupts are collapsed
+together and delivered as one 'late tick'.  Guest time always tracks
+wallclock (i.e., real) time.
+
+=back
+
+=back
+
+=head3 Support for Paravirtualisation of HVM Guests
+
+The following options allow Paravirtualised features (such as devices)
+to be exposed to the guest Operating System in an HVM guest.
+Utilising these features requires specific guest support but when
+available they will result in improved performance.
+
+=over 4
+
+=item B<xen_platform_pci=BOOLEAN>
+
+Enable or disable the Xen platform PCI device.  The presence of this
+virtual device enables a guest Operating System (subject to the
+availability of suitable drivers) to make use of paravirtualisation
+features such as disk and network devices etc. Enabling these drivers
+improves performance and is strongly recommended when available. PV
+drivers are available for various Operating Systems including HVM
+Linux L<http://wiki.xen.org/wiki/XenLinuxPVonHVMdrivers> and Microsoft
+Windows L<http://wiki.xen.org/wiki/XenWindowsGplPv>.
+
+=item B<viridian=BOOLEAN>
+
+Turns on or off the exposure of MicroSoft Hyper-V (AKA viridian)
+compatible enlightenments to the guest.  These can improve performance
+of Microsoft Windows guests from Windows Vista and Windows 2008
+onwards and setting this option for such guests is strongly
+recommended. This option should be harmless for other versions of
+Windows (although it will not give any benefit) and the majority of
+other non-Windows OSes. However it is known to be incompatible with
+some other Operating Systems and in some circumstance can prevent
+Xen's own paravirtualisation interfaces for HVM guests from being
+used.
+
+=back
+
+=head3 Emulated VGA Graphics Device
+
+The following options control the features of the emulated graphics
+device.  Many of these options behave similarly to the equivalent key
+in the B<VFB_SPEC_STRING> for configuring virtual frame buffer devices
+(see above).
+
+=over 4
+
+=item B<videoram=MBYTES>
+
+Sets the amount of RAM which the emulated video card will contain,
+which in turn limits the resolutions and bit depths which will be
+available. This option is only available when using the B<stdvga>
+option (see below).
+The default amount of video ram for stdvga is 8MB which is sufficient
+for e.g. 1600x1200 at 32bpp.
+
+When using the emulated Cirrus graphics card (B<stdvga=0>)
+the amount of video ram is fixed at 4MB which is sufficient
+for 1024x768 at 32 bpp.
+
+videoram option is currently only available when using the
+qemu-xen-traditional device-model. Upstream qemu-xen device-model
+currently does not support changing the amount of video memory for the
+emulated graphics device.
+
+=item B<stdvga=BOOLEAN>
+
+Select a standard VGA card with VBE (VESA BIOS Extensions) as the
+emulated graphics device. The default is false which means to emulate
+a Cirrus Logic GD5446 VGA card. If your guest supports VBE 2.0 or
+later (e.g. Windows XP onwards) then you should enable this.
+stdvga supports more video ram and bigger resolutions than Cirrus.
+
+=item B<vnc=BOOLEAN>
+
+Allow access to the display via the VNC protocol.  This enables the
+other VNC-related settings.  The default is to enable this.
+
+=item B<vncviewer=BOOLEAN>
+
+Automatically spawn a vncviewer when creating/restoring a guest.
+
+=item B<vnclisten="ADDRESS[:DISPLAYNUM]">
+
+Specifies the IP address, and optionally VNC display number, to use.
+
+=item B<vncdisplay=DISPLAYNUM>
+
+Specifies the VNC display number to use. The actual TCP port number
+will be DISPLAYNUM+5900.
+
+=item B<vncunused=BOOLEAN>
+
+Requests that the VNC display setup search for a free TCP port to use.
+The actual display used can be accessed with C<xl vncviewer>.
+
+=item B<vncpasswd="PASSWORD">
+
+Specifies the password for the VNC server.
+
+=item B<keymap="LANG">
+
+Configure the keymap to use for the keyboard associated with this
+display. If the input method does not easily support raw keycodes
+(e.g. this is often the case when using VNC) then this allows us to
+correctly map the input keys into keycodes seen by the guest. The
+specific values which are accepted are defined by the version of the
+device-model which you are using. See L</"Keymaps"> below or consult the
+L<qemu(1)> manpage. The default is B<en-us>.
+
+=item B<sdl=BOOLEAN>
+
+Specifies that the display should be presented via an X window (using
+Simple DirectMedia Layer). The default is not to enable this mode.
+
+=item B<opengl=BOOLEAN>
+
+Enable OpenGL acceleration of the SDL display. Only effects machines
+using B<device_model_version="qemu-xen-traditional"> and only if the
+device-model was compiled with OpenGL support. 0 by default.
+
+=item B<nographic=BOOLEAN>
+
+Enable or disable the virtual graphics device.  The default is to
+provide a VGA graphics device but this option can be used to disable
+it.
+
+=back
+
+=head3 Spice Graphics Support
+
+The following options control the features of SPICE.
+
+=over 4
+
+=item B<spice=BOOLEAN>
+
+Allow access to the display via the SPICE protocol.  This enables the
+other SPICE-related settings.
+
+=item B<spicehost="ADDRESS">
+
+Specify the interface address to listen on if given, otherwise any
+interface.
+
+=item B<spiceport=NUMBER>
+
+Specify the port to listen on by the SPICE server if the SPICE is
+enabled.
+
+=item B<spicetls_port=NUMBER>
+
+Specify the secure port to listen on by the SPICE server if the SPICE
+is enabled. At least one of the spiceport or spicetls_port must be
+given if SPICE is enabled.  NB. the options depending on spicetls_port
+have not been supported.
+
+=item B<spicedisable_ticketing=BOOLEAN>
+
+Enable client connection without password. When disabled, spicepasswd
+must be set. The default is 0.
+
+=item B<spicepasswd="PASSWORD">
+
+Specify the ticket password which is used by a client for connection.
+
+=item B<spiceagent_mouse=BOOLEAN>
+
+Whether SPICE agent is used for client mouse mode. The default is true
+(turn on)
+
+=back
+
+=head3 Miscellaneous Emulated Hardware
+
+=over 4
+
+=item B<serial=DEVICE>
+
+Redirect the virtual serial port to B<DEVICE>. Please see the
+B<-serial> option in the L<qemu(1)> manpage for details of the valid
+B<DEVICE> options. Default is B<vc> when in graphical mode and
+B<stdio> if B<nographics=1> is used.
+
+=item B<soundhw=DEVICE>
+
+Select the virtual sound card to expose to the guest. The valid
+devices are defined by the device model configuration, please see the
+L<qemu(1)> manpage for details. The default is not to export any sound
+device.
+
+=item B<usb=BOOLEAN>
+
+Enables or disables a USB bus in the guest.
+
+=item B<usbdevice=DEVICE>
+
+Adds B<DEVICE> to the USB bus. The USB bus must also be enabled using
+B<usb=1>. The most common use for this option is B<usbdevice=tablet>
+which adds pointer device using absolute coordinates. Such devices
+function better than relative coordinate devices (such as a standard
+mouse) since many methods of exporting guest graphics (such as VNC)
+work better in this mode. Note that this is independent of the actual
+pointer device you are using on the host/client side.
+
+=back
+
+=head2 Device-Model Options
+
+The following options control the selection of the device-model.  This
+is the component which provides emulation of the virtual devices to an
+HVM guest.  For a PV guest a device-model is sometimes used to provide
+backends for certain PV devices (most usually a virtual framebuffer
+device).
+
+=over 4
+
+=item B<device_model_version="DEVICE-MODEL">
+
+Selects which variant of the device-model should be used for this
+guest. Valid values are:
+
+=over 4
+
+=item B<qemu-xen-traditional>
+
+Use the device-model based upon the historical Xen fork of Qemu.  This
+device-model is currently the default.
+
+=item B<qemu-xen>
+
+use the device-model merged into the upstream QEMU project.  This
+device-model will become the default in a future version of Xen.
+
+=back
+
+It is recommended to accept the default value for new guests.  If
+you have existing guests then, depending on the nature of the guest
+Operating System, you may wish to force them to use the device
+model which they were installed with.
+
+=item B<device_model_override="PATH">
+
+Override the path to the binary to be used as the device-model. The
+binary provided here MUST be consistent with the
+`device_model_version` which you have specified. You should not
+normally need to specify this option.
+
+=item B<device_model_stubdomain_override=BOOLEAN>
+
+Override the use of stubdomain based device-model.  Normally this will
+be automatically selected based upon the other features and options
+you have selected.
+
+=item B<device_model_stubdomain_seclabel="LABEL">
+
+Assign an XSM security label to the device-model stubdomain.
+
+=item B<device_model_args=[ "ARG", "ARG", ...]>
+
+Pass additional arbitrary options on the device-model command
+line. Each element in the list is passed as an option to the
+device-model.
+
+=item B<device_model_args_pv=[ "ARG", "ARG", ...]>
+
+Pass additional arbitrary options on the device-model command line for
+a PV device model only. Each element in the list is passed as an
+option to the device-model.
+
+=item B<device_model_args_hvm=[ "ARG", "ARG", ...]>
+
+Pass additional arbitrary options on the device-model command line for
+an HVM device model only. Each element in the list is passed as an
+option to the device-model.
 
 =back
 
@@ -1138,27 +1165,26 @@ See L<qemu(1)> for more information.
 
 =item L<xl(1)>
 
+=item L<xlcpupool.cfg(5)>
+
 =item F<xl-disk-configuration>
 
 =item F<xl-network-configuration>
 
+=item F<docs/misc/tscmode.txt>
+
 =back
 
 =head1 FILES
 
 F</etc/xen/NAME.cfg>
 F</var/xen/dump/NAME>
-F<docs/misc/tscmode.txt>
 
 =head1 BUGS
 
-This document is a work in progress and contains items which require
-further documentation and which are generally incomplete (marked with
-XXX).  However all options are included here whether or not they are
-fully documented.
-
-Patches to improve incomplete items (or any other item) would be
-gratefully received on the xen-devel@lists.xen.org mailing
+This document may contain items which require further
+documentation. Patches to improve incomplete items (or any other item)
+are gratefully received on the xen-devel@lists.xen.org mailing
 list. Please see L<http://wiki.xen.org/wiki/SubmittingXenPatches> for
 information on how to submit a patch to Xen.
 

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 21:11:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 21:11:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCdAU-00033M-HA; Fri, 14 Sep 2012 21:11:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAT-00030m-16
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:17 +0000
Received: from [85.158.143.35:35035] by server-3.bemta-4.messagelabs.com id
	75/94-08232-47D93505; Fri, 14 Sep 2012 21:11:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-21.messagelabs.com!1347657074!7341490!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1575 invoked from network); 14 Sep 2012 21:11:15 -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;
	14 Sep 2012 21:11: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 1TCdAQ-0000B5-LH
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAQ-0008H7-9T
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:14 +0000
Message-Id: <E1TCdAQ-0008H7-9T@xenbits.xen.org>
Date: Fri, 14 Sep 2012 21:11:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] VT-d: use msi_compose_msg()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347625208 -7200
# Node ID 7f507c5e3a5c9a514286266837749e65704a4447
# Parent  5e4a00b4114c1c391b3d91d578d7fc2ac47600cb
VT-d: use msi_compose_msg()

... instead of open coding it.

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


diff -r 5e4a00b4114c -r 7f507c5e3a5c xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c	Fri Sep 14 14:17:26 2012 +0200
+++ b/xen/drivers/passthrough/vtd/iommu.c	Fri Sep 14 14:20:08 2012 +0200
@@ -1074,22 +1074,11 @@ static void dma_msi_set_affinity(struct 
         return;
     }
 
-    memset(&msg, 0, sizeof(msg)); 
-    msg.data = MSI_DATA_VECTOR(desc->arch.vector) & 0xff;
-    msg.data |= 1 << 14;
-    msg.data |= (INT_DELIVERY_MODE != dest_LowestPrio) ?
-        MSI_DATA_DELIVERY_FIXED:
-        MSI_DATA_DELIVERY_LOWPRI;
-
-    /* Follow MSI setting */
+    msi_compose_msg(desc, &msg);
+    /* Are these overrides really needed? */
     if (x2apic_enabled)
         msg.address_hi = dest & 0xFFFFFF00;
-    msg.address_lo = (MSI_ADDRESS_HEADER << (MSI_ADDRESS_HEADER_SHIFT + 8));
-    msg.address_lo |= INT_DEST_MODE ? MSI_ADDR_DESTMODE_LOGIC:
-                    MSI_ADDR_DESTMODE_PHYS;
-    msg.address_lo |= (INT_DELIVERY_MODE != dest_LowestPrio) ?
-                    MSI_ADDR_REDIRECTION_CPU:
-                    MSI_ADDR_REDIRECTION_LOWPRI;
+    msg.address_lo &= ~MSI_ADDR_DEST_ID_MASK;
     msg.address_lo |= MSI_ADDR_DEST_ID(dest & 0xff);
 
     spin_lock_irqsave(&iommu->register_lock, flags);
diff -r 5e4a00b4114c -r 7f507c5e3a5c xen/include/asm-x86/msi.h
--- a/xen/include/asm-x86/msi.h	Fri Sep 14 14:17:26 2012 +0200
+++ b/xen/include/asm-x86/msi.h	Fri Sep 14 14:20:08 2012 +0200
@@ -149,18 +149,6 @@ int msi_free_irq(struct msi_desc *entry)
 /*
  * MSI Defined Data Structures
  */
-#define MSI_ADDRESS_HEADER		0xfee
-#define MSI_ADDRESS_HEADER_SHIFT	12
-#define MSI_ADDRESS_HEADER_MASK		0xfff000
-#define MSI_ADDRESS_DEST_ID_MASK	0xfff0000f
-#define MSI_TARGET_CPU_MASK		0xff
-#define MSI_TARGET_CPU_SHIFT		12
-#define MSI_DELIVERY_MODE		0
-#define MSI_LEVEL_MODE			1	/* Edge always assert */
-#define MSI_TRIGGER_MODE		0	/* MSI is edge sensitive */
-#define MSI_PHYSICAL_MODE		0
-#define MSI_LOGICAL_MODE		1
-#define MSI_REDIRECTION_HINT_MODE	0
 
 struct msg_data {
 #if defined(__LITTLE_ENDIAN_BITFIELD)

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 21:11:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 21:11:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCdAU-00033M-HA; Fri, 14 Sep 2012 21:11:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAT-00030m-16
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:17 +0000
Received: from [85.158.143.35:35035] by server-3.bemta-4.messagelabs.com id
	75/94-08232-47D93505; Fri, 14 Sep 2012 21:11:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-21.messagelabs.com!1347657074!7341490!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1575 invoked from network); 14 Sep 2012 21:11:15 -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;
	14 Sep 2012 21:11: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 1TCdAQ-0000B5-LH
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAQ-0008H7-9T
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:14 +0000
Message-Id: <E1TCdAQ-0008H7-9T@xenbits.xen.org>
Date: Fri, 14 Sep 2012 21:11:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] VT-d: use msi_compose_msg()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347625208 -7200
# Node ID 7f507c5e3a5c9a514286266837749e65704a4447
# Parent  5e4a00b4114c1c391b3d91d578d7fc2ac47600cb
VT-d: use msi_compose_msg()

... instead of open coding it.

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


diff -r 5e4a00b4114c -r 7f507c5e3a5c xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c	Fri Sep 14 14:17:26 2012 +0200
+++ b/xen/drivers/passthrough/vtd/iommu.c	Fri Sep 14 14:20:08 2012 +0200
@@ -1074,22 +1074,11 @@ static void dma_msi_set_affinity(struct 
         return;
     }
 
-    memset(&msg, 0, sizeof(msg)); 
-    msg.data = MSI_DATA_VECTOR(desc->arch.vector) & 0xff;
-    msg.data |= 1 << 14;
-    msg.data |= (INT_DELIVERY_MODE != dest_LowestPrio) ?
-        MSI_DATA_DELIVERY_FIXED:
-        MSI_DATA_DELIVERY_LOWPRI;
-
-    /* Follow MSI setting */
+    msi_compose_msg(desc, &msg);
+    /* Are these overrides really needed? */
     if (x2apic_enabled)
         msg.address_hi = dest & 0xFFFFFF00;
-    msg.address_lo = (MSI_ADDRESS_HEADER << (MSI_ADDRESS_HEADER_SHIFT + 8));
-    msg.address_lo |= INT_DEST_MODE ? MSI_ADDR_DESTMODE_LOGIC:
-                    MSI_ADDR_DESTMODE_PHYS;
-    msg.address_lo |= (INT_DELIVERY_MODE != dest_LowestPrio) ?
-                    MSI_ADDR_REDIRECTION_CPU:
-                    MSI_ADDR_REDIRECTION_LOWPRI;
+    msg.address_lo &= ~MSI_ADDR_DEST_ID_MASK;
     msg.address_lo |= MSI_ADDR_DEST_ID(dest & 0xff);
 
     spin_lock_irqsave(&iommu->register_lock, flags);
diff -r 5e4a00b4114c -r 7f507c5e3a5c xen/include/asm-x86/msi.h
--- a/xen/include/asm-x86/msi.h	Fri Sep 14 14:17:26 2012 +0200
+++ b/xen/include/asm-x86/msi.h	Fri Sep 14 14:20:08 2012 +0200
@@ -149,18 +149,6 @@ int msi_free_irq(struct msi_desc *entry)
 /*
  * MSI Defined Data Structures
  */
-#define MSI_ADDRESS_HEADER		0xfee
-#define MSI_ADDRESS_HEADER_SHIFT	12
-#define MSI_ADDRESS_HEADER_MASK		0xfff000
-#define MSI_ADDRESS_DEST_ID_MASK	0xfff0000f
-#define MSI_TARGET_CPU_MASK		0xff
-#define MSI_TARGET_CPU_SHIFT		12
-#define MSI_DELIVERY_MODE		0
-#define MSI_LEVEL_MODE			1	/* Edge always assert */
-#define MSI_TRIGGER_MODE		0	/* MSI is edge sensitive */
-#define MSI_PHYSICAL_MODE		0
-#define MSI_LOGICAL_MODE		1
-#define MSI_REDIRECTION_HINT_MODE	0
 
 struct msg_data {
 #if defined(__LITTLE_ENDIAN_BITFIELD)

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 21:11:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 21:11:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCdAU-00033H-EV; Fri, 14 Sep 2012 21:11:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAS-00031T-TL
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:17 +0000
Received: from [85.158.143.35:34979] by server-2.bemta-4.messagelabs.com id
	06/5C-21239-37D93505; Fri, 14 Sep 2012 21:11:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-21.messagelabs.com!1347657070!10221870!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6770 invoked from network); 14 Sep 2012 21:11:10 -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;
	14 Sep 2012 21: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 1TCdAL-0000Ah-Nk
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAL-0008D4-IY
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:09 +0000
Message-Id: <E1TCdAL-0008D4-IY@xenbits.xen.org>
Date: Fri, 14 Sep 2012 21:11:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: fix usage of backend
	parameter and run_hotplug_scripts
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Roger Pau Monne <roger.pau@citrix.com>
# Date 1347613368 -3600
# Node ID 259c4e9d8adf0ba8731d09c496ebec85b0e2c1aa
# Parent  98e1ba6a672a3ef5326c502b0e18f4f1b4b3995f
libxl: fix usage of backend parameter and run_hotplug_scripts

vif interfaces allows the user to specify the domain that should run
the backend (also known as driver domain) using the 'backend'
parameter. This is not compatible with run_hotplug_scripts=1, since
libxl can only run the hotplug scripts from the Domain 0.

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


diff -r 98e1ba6a672a -r 259c4e9d8adf tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Fri Sep 14 10:02:47 2012 +0100
+++ b/tools/libxl/libxl.c	Fri Sep 14 10:02:48 2012 +0100
@@ -2476,6 +2476,8 @@ out:
 int libxl__device_nic_setdefault(libxl__gc *gc, libxl_device_nic *nic,
                                  uint32_t domid)
 {
+    int run_hotplug_scripts;
+
     if (!nic->mtu)
         nic->mtu = 1492;
     if (!nic->model) {
@@ -2505,6 +2507,18 @@ int libxl__device_nic_setdefault(libxl__
                                   libxl__xen_script_dir_path()) < 0 )
         return ERROR_FAIL;
 
+    run_hotplug_scripts = libxl__hotplug_settings(gc, XBT_NULL);
+    if (run_hotplug_scripts < 0) {
+        LOG(ERROR, "unable to get current hotplug scripts execution setting");
+        return run_hotplug_scripts;
+    }
+    if (nic->backend_domid != LIBXL_TOOLSTACK_DOMID && run_hotplug_scripts) {
+        LOG(ERROR, "cannot use a backend domain different than %d if"
+                   "hotplug scripts are executed from libxl",
+                   LIBXL_TOOLSTACK_DOMID);
+        return ERROR_FAIL;
+    }
+
     switch (libxl__domain_type(gc, domid)) {
     case LIBXL_DOMAIN_TYPE_HVM:
         if (!nic->nictype)

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 21:11:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 21:11:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCdAU-00033H-EV; Fri, 14 Sep 2012 21:11:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAS-00031T-TL
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:17 +0000
Received: from [85.158.143.35:34979] by server-2.bemta-4.messagelabs.com id
	06/5C-21239-37D93505; Fri, 14 Sep 2012 21:11:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-21.messagelabs.com!1347657070!10221870!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6770 invoked from network); 14 Sep 2012 21:11:10 -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;
	14 Sep 2012 21: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 1TCdAL-0000Ah-Nk
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAL-0008D4-IY
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:09 +0000
Message-Id: <E1TCdAL-0008D4-IY@xenbits.xen.org>
Date: Fri, 14 Sep 2012 21:11:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: fix usage of backend
	parameter and run_hotplug_scripts
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Roger Pau Monne <roger.pau@citrix.com>
# Date 1347613368 -3600
# Node ID 259c4e9d8adf0ba8731d09c496ebec85b0e2c1aa
# Parent  98e1ba6a672a3ef5326c502b0e18f4f1b4b3995f
libxl: fix usage of backend parameter and run_hotplug_scripts

vif interfaces allows the user to specify the domain that should run
the backend (also known as driver domain) using the 'backend'
parameter. This is not compatible with run_hotplug_scripts=1, since
libxl can only run the hotplug scripts from the Domain 0.

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


diff -r 98e1ba6a672a -r 259c4e9d8adf tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Fri Sep 14 10:02:47 2012 +0100
+++ b/tools/libxl/libxl.c	Fri Sep 14 10:02:48 2012 +0100
@@ -2476,6 +2476,8 @@ out:
 int libxl__device_nic_setdefault(libxl__gc *gc, libxl_device_nic *nic,
                                  uint32_t domid)
 {
+    int run_hotplug_scripts;
+
     if (!nic->mtu)
         nic->mtu = 1492;
     if (!nic->model) {
@@ -2505,6 +2507,18 @@ int libxl__device_nic_setdefault(libxl__
                                   libxl__xen_script_dir_path()) < 0 )
         return ERROR_FAIL;
 
+    run_hotplug_scripts = libxl__hotplug_settings(gc, XBT_NULL);
+    if (run_hotplug_scripts < 0) {
+        LOG(ERROR, "unable to get current hotplug scripts execution setting");
+        return run_hotplug_scripts;
+    }
+    if (nic->backend_domid != LIBXL_TOOLSTACK_DOMID && run_hotplug_scripts) {
+        LOG(ERROR, "cannot use a backend domain different than %d if"
+                   "hotplug scripts are executed from libxl",
+                   LIBXL_TOOLSTACK_DOMID);
+        return ERROR_FAIL;
+    }
+
     switch (libxl__domain_type(gc, domid)) {
     case LIBXL_DOMAIN_TYPE_HVM:
         if (!nic->nictype)

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 21:11:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 21:11:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCdAW-00036K-SW; Fri, 14 Sep 2012 21:11:20 +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 1TCdAU-00032t-K5
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:18 +0000
Received: from [85.158.138.51:9927] by server-11.bemta-3.messagelabs.com id
	B1/EA-30250-57D93505; Fri, 14 Sep 2012 21:11:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-174.messagelabs.com!1347657075!30115779!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3757 invoked from network); 14 Sep 2012 21:11:16 -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;
	14 Sep 2012 21:11: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 1TCdAR-0000B8-Dt
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAR-0008HY-0K
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:15 +0000
Message-Id: <E1TCdAR-0008HY-0K@xenbits.xen.org>
Date: Fri, 14 Sep 2012 21:11:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/hvm: don't use indirect calls
	without need
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347625522 -7200
# Node ID 191db43e50cfc919681a406d313b570d3b3d2d2e
# Parent  7f507c5e3a5c9a514286266837749e65704a4447
x86/hvm: don't use indirect calls without need

Direct calls perform better, so we should prefer them and use indirect
ones only when there indeed is a need for indirection.

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


diff -r 7f507c5e3a5c -r 191db43e50cf xen/arch/x86/apic.c
--- a/xen/arch/x86/apic.c	Fri Sep 14 14:20:08 2012 +0200
+++ b/xen/arch/x86/apic.c	Fri Sep 14 14:25:22 2012 +0200
@@ -1373,7 +1373,7 @@ void error_interrupt(struct cpu_user_reg
 void pmu_apic_interrupt(struct cpu_user_regs *regs)
 {
     ack_APIC_irq();
-    hvm_do_pmu_interrupt(regs);
+    vpmu_do_interrupt(regs);
 }
 
 /*
diff -r 7f507c5e3a5c -r 191db43e50cf xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c	Fri Sep 14 14:20:08 2012 +0200
+++ b/xen/arch/x86/hvm/svm/svm.c	Fri Sep 14 14:25:22 2012 +0200
@@ -73,6 +73,8 @@ bool_t cpu_has_lmsl;
 #define set_segment_register(name, value)  \
     asm volatile ( "movw %%ax ,%%" STR(name) "" : : "a" (value) )
 
+static void svm_update_guest_efer(struct vcpu *);
+
 static struct hvm_function_table svm_function_table;
 
 /* va of hardware host save area     */
@@ -269,9 +271,9 @@ static int svm_vmcb_restore(struct vcpu 
     v->arch.hvm_vcpu.guest_cr[2] = c->cr2;
     v->arch.hvm_vcpu.guest_cr[3] = c->cr3;
     v->arch.hvm_vcpu.guest_cr[4] = c->cr4;
-    hvm_update_guest_cr(v, 0);
-    hvm_update_guest_cr(v, 2);
-    hvm_update_guest_cr(v, 4);
+    svm_update_guest_cr(v, 0);
+    svm_update_guest_cr(v, 2);
+    svm_update_guest_cr(v, 4);
 
     /* Load sysenter MSRs into both VMCB save area and VCPU fields. */
     vmcb->sysenter_cs = v->arch.hvm_svm.guest_sysenter_cs = c->sysenter_cs;
@@ -330,7 +332,7 @@ static void svm_load_cpu_state(struct vc
     vmcb->cstar      = data->msr_cstar;
     vmcb->sfmask     = data->msr_syscall_mask;
     v->arch.hvm_vcpu.guest_efer = data->msr_efer;
-    hvm_update_guest_efer(v);
+    svm_update_guest_efer(v);
 
     hvm_set_guest_tsc(v, data->tsc);
 }
@@ -426,12 +428,7 @@ static int svm_guest_x86_mode(struct vcp
     return (likely(vmcb->cs.attr.fields.db) ? 4 : 2);
 }
 
-static void svm_update_host_cr3(struct vcpu *v)
-{
-    /* SVM doesn't have a HOST_CR3 equivalent to update. */
-}
-
-static void svm_update_guest_cr(struct vcpu *v, unsigned int cr)
+void svm_update_guest_cr(struct vcpu *v, unsigned int cr)
 {
     struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb;
     uint64_t value;
@@ -1124,11 +1121,6 @@ static int svm_event_pending(struct vcpu
     return vmcb->eventinj.fields.v;
 }
 
-static int svm_do_pmu_interrupt(struct cpu_user_regs *regs)
-{
-    return vpmu_do_interrupt(regs);
-}
-
 static void svm_cpu_dead(unsigned int cpu)
 {
     free_xenheap_page(per_cpu(hsa, cpu));
@@ -1990,7 +1982,6 @@ static struct hvm_function_table __read_
     .get_segment_register = svm_get_segment_register,
     .set_segment_register = svm_set_segment_register,
     .get_shadow_gs_base   = svm_get_shadow_gs_base,
-    .update_host_cr3      = svm_update_host_cr3,
     .update_guest_cr      = svm_update_guest_cr,
     .update_guest_efer    = svm_update_guest_efer,
     .set_guest_pat        = svm_set_guest_pat,
@@ -1999,7 +1990,6 @@ static struct hvm_function_table __read_
     .inject_trap          = svm_inject_trap,
     .init_hypercall_page  = svm_init_hypercall_page,
     .event_pending        = svm_event_pending,
-    .do_pmu_interrupt     = svm_do_pmu_interrupt,
     .cpuid_intercept      = svm_cpuid_intercept,
     .wbinvd_intercept     = svm_wbinvd_intercept,
     .fpu_dirty_intercept  = svm_fpu_dirty_intercept,
diff -r 7f507c5e3a5c -r 191db43e50cf xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Fri Sep 14 14:20:08 2012 +0200
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Fri Sep 14 14:25:22 2012 +0200
@@ -681,8 +681,8 @@ static void vmx_ctxt_switch_to(struct vc
         .fields = { .type = 0xb, .s = 0, .dpl = 0, .p = 1, .avl = 0,    \
                     .l = 0, .db = 0, .g = 0, .pad = 0 } }).bytes)
 
-static void vmx_get_segment_register(struct vcpu *v, enum x86_segment seg,
-                                     struct segment_register *reg)
+void vmx_get_segment_register(struct vcpu *v, enum x86_segment seg,
+                              struct segment_register *reg)
 {
     uint32_t attr = 0;
 
@@ -1412,11 +1412,6 @@ static int vmx_event_pending(struct vcpu
     return (__vmread(VM_ENTRY_INTR_INFO) & INTR_INFO_VALID_MASK);
 }
 
-static int vmx_do_pmu_interrupt(struct cpu_user_regs *regs)
-{
-    return vpmu_do_interrupt(regs);
-}
-
 static void vmx_set_uc_mode(struct vcpu *v)
 {
     if ( paging_mode_hap(v->domain) )
@@ -1478,7 +1473,6 @@ static struct hvm_function_table __read_
     .inject_trap          = vmx_inject_trap,
     .init_hypercall_page  = vmx_init_hypercall_page,
     .event_pending        = vmx_event_pending,
-    .do_pmu_interrupt     = vmx_do_pmu_interrupt,
     .cpu_up               = vmx_cpu_up,
     .cpu_down             = vmx_cpu_down,
     .cpuid_intercept      = vmx_cpuid_intercept,
@@ -1593,7 +1587,7 @@ static void vmx_cpuid_intercept(
     {
         case 0x80000001:
             /* SYSCALL is visible iff running in long mode. */
-            hvm_get_segment_register(v, x86_seg_cs, &cs);
+            vmx_get_segment_register(v, x86_seg_cs, &cs);
             if ( cs.attr.fields.l )
                 *edx |= cpufeat_mask(X86_FEATURE_SYSCALL);
             else
diff -r 7f507c5e3a5c -r 191db43e50cf xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Fri Sep 14 14:20:08 2012 +0200
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Fri Sep 14 14:25:22 2012 +0200
@@ -287,8 +287,6 @@ static int vmx_inst_check_privilege(stru
     struct vcpu *v = current;
     struct segment_register cs;
 
-    hvm_get_segment_register(v, x86_seg_cs, &cs);
-
     if ( vmxop_check )
     {
         if ( !(v->arch.hvm_vcpu.guest_cr[0] & X86_CR0_PE) ||
@@ -298,6 +296,8 @@ static int vmx_inst_check_privilege(stru
     else if ( !vcpu_2_nvmx(v).vmxon_region_pa )
         goto invalid_op;
 
+    vmx_get_segment_register(v, x86_seg_cs, &cs);
+
     if ( (regs->eflags & X86_EFLAGS_VM) ||
          (hvm_long_mode_enabled(v) && cs.attr.fields.l == 0) )
         goto invalid_op;
@@ -354,13 +354,13 @@ static int decode_vmx_inst(struct cpu_us
 
         if ( hvm_long_mode_enabled(v) )
         {
-            hvm_get_segment_register(v, x86_seg_cs, &seg);
+            vmx_get_segment_register(v, x86_seg_cs, &seg);
             mode_64bit = seg.attr.fields.l;
         }
 
         if ( info.fields.segment > VMX_SREG_GS )
             goto gp_fault;
-        hvm_get_segment_register(v, sreg_to_index[info.fields.segment], &seg);
+        vmx_get_segment_register(v, sreg_to_index[info.fields.segment], &seg);
         seg_base = seg.base;
 
         base = info.fields.base_reg_invalid ? 0 :
diff -r 7f507c5e3a5c -r 191db43e50cf xen/include/asm-x86/hvm/hvm.h
--- a/xen/include/asm-x86/hvm/hvm.h	Fri Sep 14 14:20:08 2012 +0200
+++ b/xen/include/asm-x86/hvm/hvm.h	Fri Sep 14 14:25:22 2012 +0200
@@ -137,7 +137,6 @@ struct hvm_function_table {
     void (*init_hypercall_page)(struct domain *d, void *hypercall_page);
 
     int  (*event_pending)(struct vcpu *v);
-    int  (*do_pmu_interrupt)(struct cpu_user_regs *regs);
 
     int  (*cpu_up_prepare)(unsigned int cpu);
     void (*cpu_dead)(unsigned int cpu);
@@ -266,7 +265,8 @@ hvm_guest_x86_mode(struct vcpu *v)
 static inline void
 hvm_update_host_cr3(struct vcpu *v)
 {
-    hvm_funcs.update_host_cr3(v);
+    if ( hvm_funcs.update_host_cr3 )
+        hvm_funcs.update_host_cr3(v);
 }
 
 static inline void hvm_update_guest_cr(struct vcpu *v, unsigned int cr)
@@ -330,11 +330,6 @@ static inline int hvm_event_pending(stru
     return hvm_funcs.event_pending(v);
 }
 
-static inline int hvm_do_pmu_interrupt(struct cpu_user_regs *regs)
-{
-    return hvm_funcs.do_pmu_interrupt(regs);
-}
-
 /* These reserved bits in lower 32 remain 0 after any load of CR0 */
 #define HVM_CR0_GUEST_RESERVED_BITS             \
     (~((unsigned long)                          \
diff -r 7f507c5e3a5c -r 191db43e50cf xen/include/asm-x86/hvm/svm/svm.h
--- a/xen/include/asm-x86/hvm/svm/svm.h	Fri Sep 14 14:20:08 2012 +0200
+++ b/xen/include/asm-x86/hvm/svm/svm.h	Fri Sep 14 14:25:22 2012 +0200
@@ -66,6 +66,7 @@ static inline void svm_invlpga(unsigned 
 
 unsigned long *svm_msrbit(unsigned long *msr_bitmap, uint32_t msr);
 void __update_guest_eip(struct cpu_user_regs *regs, unsigned int inst_len);
+void svm_update_guest_cr(struct vcpu *, unsigned int cr);
 
 extern u32 svm_feature_flags;
 
diff -r 7f507c5e3a5c -r 191db43e50cf xen/include/asm-x86/hvm/vmx/vmx.h
--- a/xen/include/asm-x86/hvm/vmx/vmx.h	Fri Sep 14 14:20:08 2012 +0200
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h	Fri Sep 14 14:25:22 2012 +0200
@@ -387,6 +387,8 @@ static inline int __vmxon(u64 addr)
     return rc;
 }
 
+void vmx_get_segment_register(struct vcpu *, enum x86_segment,
+                              struct segment_register *);
 void vmx_inject_extint(int trap);
 void vmx_inject_nmi(void);
 

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 21:11:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 21:11:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCdAW-00036K-SW; Fri, 14 Sep 2012 21:11:20 +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 1TCdAU-00032t-K5
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:18 +0000
Received: from [85.158.138.51:9927] by server-11.bemta-3.messagelabs.com id
	B1/EA-30250-57D93505; Fri, 14 Sep 2012 21:11:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-174.messagelabs.com!1347657075!30115779!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3757 invoked from network); 14 Sep 2012 21:11:16 -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;
	14 Sep 2012 21:11: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 1TCdAR-0000B8-Dt
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAR-0008HY-0K
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:15 +0000
Message-Id: <E1TCdAR-0008HY-0K@xenbits.xen.org>
Date: Fri, 14 Sep 2012 21:11:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/hvm: don't use indirect calls
	without need
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347625522 -7200
# Node ID 191db43e50cfc919681a406d313b570d3b3d2d2e
# Parent  7f507c5e3a5c9a514286266837749e65704a4447
x86/hvm: don't use indirect calls without need

Direct calls perform better, so we should prefer them and use indirect
ones only when there indeed is a need for indirection.

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


diff -r 7f507c5e3a5c -r 191db43e50cf xen/arch/x86/apic.c
--- a/xen/arch/x86/apic.c	Fri Sep 14 14:20:08 2012 +0200
+++ b/xen/arch/x86/apic.c	Fri Sep 14 14:25:22 2012 +0200
@@ -1373,7 +1373,7 @@ void error_interrupt(struct cpu_user_reg
 void pmu_apic_interrupt(struct cpu_user_regs *regs)
 {
     ack_APIC_irq();
-    hvm_do_pmu_interrupt(regs);
+    vpmu_do_interrupt(regs);
 }
 
 /*
diff -r 7f507c5e3a5c -r 191db43e50cf xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c	Fri Sep 14 14:20:08 2012 +0200
+++ b/xen/arch/x86/hvm/svm/svm.c	Fri Sep 14 14:25:22 2012 +0200
@@ -73,6 +73,8 @@ bool_t cpu_has_lmsl;
 #define set_segment_register(name, value)  \
     asm volatile ( "movw %%ax ,%%" STR(name) "" : : "a" (value) )
 
+static void svm_update_guest_efer(struct vcpu *);
+
 static struct hvm_function_table svm_function_table;
 
 /* va of hardware host save area     */
@@ -269,9 +271,9 @@ static int svm_vmcb_restore(struct vcpu 
     v->arch.hvm_vcpu.guest_cr[2] = c->cr2;
     v->arch.hvm_vcpu.guest_cr[3] = c->cr3;
     v->arch.hvm_vcpu.guest_cr[4] = c->cr4;
-    hvm_update_guest_cr(v, 0);
-    hvm_update_guest_cr(v, 2);
-    hvm_update_guest_cr(v, 4);
+    svm_update_guest_cr(v, 0);
+    svm_update_guest_cr(v, 2);
+    svm_update_guest_cr(v, 4);
 
     /* Load sysenter MSRs into both VMCB save area and VCPU fields. */
     vmcb->sysenter_cs = v->arch.hvm_svm.guest_sysenter_cs = c->sysenter_cs;
@@ -330,7 +332,7 @@ static void svm_load_cpu_state(struct vc
     vmcb->cstar      = data->msr_cstar;
     vmcb->sfmask     = data->msr_syscall_mask;
     v->arch.hvm_vcpu.guest_efer = data->msr_efer;
-    hvm_update_guest_efer(v);
+    svm_update_guest_efer(v);
 
     hvm_set_guest_tsc(v, data->tsc);
 }
@@ -426,12 +428,7 @@ static int svm_guest_x86_mode(struct vcp
     return (likely(vmcb->cs.attr.fields.db) ? 4 : 2);
 }
 
-static void svm_update_host_cr3(struct vcpu *v)
-{
-    /* SVM doesn't have a HOST_CR3 equivalent to update. */
-}
-
-static void svm_update_guest_cr(struct vcpu *v, unsigned int cr)
+void svm_update_guest_cr(struct vcpu *v, unsigned int cr)
 {
     struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb;
     uint64_t value;
@@ -1124,11 +1121,6 @@ static int svm_event_pending(struct vcpu
     return vmcb->eventinj.fields.v;
 }
 
-static int svm_do_pmu_interrupt(struct cpu_user_regs *regs)
-{
-    return vpmu_do_interrupt(regs);
-}
-
 static void svm_cpu_dead(unsigned int cpu)
 {
     free_xenheap_page(per_cpu(hsa, cpu));
@@ -1990,7 +1982,6 @@ static struct hvm_function_table __read_
     .get_segment_register = svm_get_segment_register,
     .set_segment_register = svm_set_segment_register,
     .get_shadow_gs_base   = svm_get_shadow_gs_base,
-    .update_host_cr3      = svm_update_host_cr3,
     .update_guest_cr      = svm_update_guest_cr,
     .update_guest_efer    = svm_update_guest_efer,
     .set_guest_pat        = svm_set_guest_pat,
@@ -1999,7 +1990,6 @@ static struct hvm_function_table __read_
     .inject_trap          = svm_inject_trap,
     .init_hypercall_page  = svm_init_hypercall_page,
     .event_pending        = svm_event_pending,
-    .do_pmu_interrupt     = svm_do_pmu_interrupt,
     .cpuid_intercept      = svm_cpuid_intercept,
     .wbinvd_intercept     = svm_wbinvd_intercept,
     .fpu_dirty_intercept  = svm_fpu_dirty_intercept,
diff -r 7f507c5e3a5c -r 191db43e50cf xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Fri Sep 14 14:20:08 2012 +0200
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Fri Sep 14 14:25:22 2012 +0200
@@ -681,8 +681,8 @@ static void vmx_ctxt_switch_to(struct vc
         .fields = { .type = 0xb, .s = 0, .dpl = 0, .p = 1, .avl = 0,    \
                     .l = 0, .db = 0, .g = 0, .pad = 0 } }).bytes)
 
-static void vmx_get_segment_register(struct vcpu *v, enum x86_segment seg,
-                                     struct segment_register *reg)
+void vmx_get_segment_register(struct vcpu *v, enum x86_segment seg,
+                              struct segment_register *reg)
 {
     uint32_t attr = 0;
 
@@ -1412,11 +1412,6 @@ static int vmx_event_pending(struct vcpu
     return (__vmread(VM_ENTRY_INTR_INFO) & INTR_INFO_VALID_MASK);
 }
 
-static int vmx_do_pmu_interrupt(struct cpu_user_regs *regs)
-{
-    return vpmu_do_interrupt(regs);
-}
-
 static void vmx_set_uc_mode(struct vcpu *v)
 {
     if ( paging_mode_hap(v->domain) )
@@ -1478,7 +1473,6 @@ static struct hvm_function_table __read_
     .inject_trap          = vmx_inject_trap,
     .init_hypercall_page  = vmx_init_hypercall_page,
     .event_pending        = vmx_event_pending,
-    .do_pmu_interrupt     = vmx_do_pmu_interrupt,
     .cpu_up               = vmx_cpu_up,
     .cpu_down             = vmx_cpu_down,
     .cpuid_intercept      = vmx_cpuid_intercept,
@@ -1593,7 +1587,7 @@ static void vmx_cpuid_intercept(
     {
         case 0x80000001:
             /* SYSCALL is visible iff running in long mode. */
-            hvm_get_segment_register(v, x86_seg_cs, &cs);
+            vmx_get_segment_register(v, x86_seg_cs, &cs);
             if ( cs.attr.fields.l )
                 *edx |= cpufeat_mask(X86_FEATURE_SYSCALL);
             else
diff -r 7f507c5e3a5c -r 191db43e50cf xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Fri Sep 14 14:20:08 2012 +0200
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Fri Sep 14 14:25:22 2012 +0200
@@ -287,8 +287,6 @@ static int vmx_inst_check_privilege(stru
     struct vcpu *v = current;
     struct segment_register cs;
 
-    hvm_get_segment_register(v, x86_seg_cs, &cs);
-
     if ( vmxop_check )
     {
         if ( !(v->arch.hvm_vcpu.guest_cr[0] & X86_CR0_PE) ||
@@ -298,6 +296,8 @@ static int vmx_inst_check_privilege(stru
     else if ( !vcpu_2_nvmx(v).vmxon_region_pa )
         goto invalid_op;
 
+    vmx_get_segment_register(v, x86_seg_cs, &cs);
+
     if ( (regs->eflags & X86_EFLAGS_VM) ||
          (hvm_long_mode_enabled(v) && cs.attr.fields.l == 0) )
         goto invalid_op;
@@ -354,13 +354,13 @@ static int decode_vmx_inst(struct cpu_us
 
         if ( hvm_long_mode_enabled(v) )
         {
-            hvm_get_segment_register(v, x86_seg_cs, &seg);
+            vmx_get_segment_register(v, x86_seg_cs, &seg);
             mode_64bit = seg.attr.fields.l;
         }
 
         if ( info.fields.segment > VMX_SREG_GS )
             goto gp_fault;
-        hvm_get_segment_register(v, sreg_to_index[info.fields.segment], &seg);
+        vmx_get_segment_register(v, sreg_to_index[info.fields.segment], &seg);
         seg_base = seg.base;
 
         base = info.fields.base_reg_invalid ? 0 :
diff -r 7f507c5e3a5c -r 191db43e50cf xen/include/asm-x86/hvm/hvm.h
--- a/xen/include/asm-x86/hvm/hvm.h	Fri Sep 14 14:20:08 2012 +0200
+++ b/xen/include/asm-x86/hvm/hvm.h	Fri Sep 14 14:25:22 2012 +0200
@@ -137,7 +137,6 @@ struct hvm_function_table {
     void (*init_hypercall_page)(struct domain *d, void *hypercall_page);
 
     int  (*event_pending)(struct vcpu *v);
-    int  (*do_pmu_interrupt)(struct cpu_user_regs *regs);
 
     int  (*cpu_up_prepare)(unsigned int cpu);
     void (*cpu_dead)(unsigned int cpu);
@@ -266,7 +265,8 @@ hvm_guest_x86_mode(struct vcpu *v)
 static inline void
 hvm_update_host_cr3(struct vcpu *v)
 {
-    hvm_funcs.update_host_cr3(v);
+    if ( hvm_funcs.update_host_cr3 )
+        hvm_funcs.update_host_cr3(v);
 }
 
 static inline void hvm_update_guest_cr(struct vcpu *v, unsigned int cr)
@@ -330,11 +330,6 @@ static inline int hvm_event_pending(stru
     return hvm_funcs.event_pending(v);
 }
 
-static inline int hvm_do_pmu_interrupt(struct cpu_user_regs *regs)
-{
-    return hvm_funcs.do_pmu_interrupt(regs);
-}
-
 /* These reserved bits in lower 32 remain 0 after any load of CR0 */
 #define HVM_CR0_GUEST_RESERVED_BITS             \
     (~((unsigned long)                          \
diff -r 7f507c5e3a5c -r 191db43e50cf xen/include/asm-x86/hvm/svm/svm.h
--- a/xen/include/asm-x86/hvm/svm/svm.h	Fri Sep 14 14:20:08 2012 +0200
+++ b/xen/include/asm-x86/hvm/svm/svm.h	Fri Sep 14 14:25:22 2012 +0200
@@ -66,6 +66,7 @@ static inline void svm_invlpga(unsigned 
 
 unsigned long *svm_msrbit(unsigned long *msr_bitmap, uint32_t msr);
 void __update_guest_eip(struct cpu_user_regs *regs, unsigned int inst_len);
+void svm_update_guest_cr(struct vcpu *, unsigned int cr);
 
 extern u32 svm_feature_flags;
 
diff -r 7f507c5e3a5c -r 191db43e50cf xen/include/asm-x86/hvm/vmx/vmx.h
--- a/xen/include/asm-x86/hvm/vmx/vmx.h	Fri Sep 14 14:20:08 2012 +0200
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h	Fri Sep 14 14:25:22 2012 +0200
@@ -387,6 +387,8 @@ static inline int __vmxon(u64 addr)
     return rc;
 }
 
+void vmx_get_segment_register(struct vcpu *, enum x86_segment,
+                              struct segment_register *);
 void vmx_inject_extint(int trap);
 void vmx_inject_nmi(void);
 

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 21:11:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 21:11:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCdAW-00036Q-Uk; Fri, 14 Sep 2012 21:11: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 1TCdAU-000315-Rj
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-27.messagelabs.com!1347657070!4104039!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15646 invoked from network); 14 Sep 2012 21:11:11 -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;
	14 Sep 2012 21:11: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 1TCdAM-0000Ak-BA
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAM-0008DK-5L
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:10 +0000
Message-Id: <E1TCdAM-0008DK-5L@xenbits.xen.org>
Date: Fri, 14 Sep 2012 21:11:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl: error if vif backend!=0 is used
	with run_hotplug_scripts
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Roger Pau Monne <roger.pau@citrix.com>
# Date 1347613369 -3600
# Node ID ff6d9494403908d43bf61ce11bc1a5daa21133c7
# Parent  259c4e9d8adf0ba8731d09c496ebec85b0e2c1aa
xl: error if vif backend!=0 is used with run_hotplug_scripts

Print an error and exit if backend!=0 is used in conjunction with
run_hotplug_scripts. Currently libxl can only execute hotplug scripts
from the toolstack domain (the same domain xl is running from).

Added a description and workaround of this issue on
xl-network-configuration.

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


diff -r 259c4e9d8adf -r ff6d94944039 docs/misc/xl-network-configuration.markdown
--- a/docs/misc/xl-network-configuration.markdown	Fri Sep 14 10:02:48 2012 +0100
+++ b/docs/misc/xl-network-configuration.markdown	Fri Sep 14 10:02:49 2012 +0100
@@ -122,8 +122,10 @@ specified IP address to be used by the g
 ### backend
 
 Specifies the backend domain which this device should attach to. This
-defaults to domain 0. Specifying another domain requires setting up a
-driver domain which is outside the scope of this document.
+defaults to domain 0. This option does not work if `run_hotplug_scripts`
+is not disabled in xl.conf (see xl.conf(5) man page for more information
+on this option). Specifying another domain requires setting up a driver
+domain which is outside the scope of this document.
 
 ### rate
 
diff -r 259c4e9d8adf -r ff6d94944039 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Fri Sep 14 10:02:48 2012 +0100
+++ b/tools/libxl/xl_cmdimpl.c	Fri Sep 14 10:02:49 2012 +0100
@@ -1096,6 +1096,13 @@ static void parse_config_data(const char
                         fprintf(stderr, "Specified backend domain does not exist, defaulting to Dom0\n");
                         nic->backend_domid = 0;
                     }
+                    if (nic->backend_domid != 0 && run_hotplug_scripts) {
+                        fprintf(stderr, "ERROR: the vif 'backend=' option "
+                                "cannot be used in conjunction with "
+                                "run_hotplug_scripts, please set "
+                                "run_hotplug_scripts to 0 in xl.conf\n");
+                        exit(EXIT_FAILURE);
+                    }
                 } else if (!strcmp(p, "rate")) {
                     parse_vif_rate(&config, (p2 + 1), nic);
                 } else if (!strcmp(p, "accel")) {

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 21:11:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 21:11:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCdAW-00036Q-Uk; Fri, 14 Sep 2012 21:11: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 1TCdAU-000315-Rj
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-27.messagelabs.com!1347657070!4104039!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15646 invoked from network); 14 Sep 2012 21:11:11 -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;
	14 Sep 2012 21:11: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 1TCdAM-0000Ak-BA
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAM-0008DK-5L
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:10 +0000
Message-Id: <E1TCdAM-0008DK-5L@xenbits.xen.org>
Date: Fri, 14 Sep 2012 21:11:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl: error if vif backend!=0 is used
	with run_hotplug_scripts
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Roger Pau Monne <roger.pau@citrix.com>
# Date 1347613369 -3600
# Node ID ff6d9494403908d43bf61ce11bc1a5daa21133c7
# Parent  259c4e9d8adf0ba8731d09c496ebec85b0e2c1aa
xl: error if vif backend!=0 is used with run_hotplug_scripts

Print an error and exit if backend!=0 is used in conjunction with
run_hotplug_scripts. Currently libxl can only execute hotplug scripts
from the toolstack domain (the same domain xl is running from).

Added a description and workaround of this issue on
xl-network-configuration.

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


diff -r 259c4e9d8adf -r ff6d94944039 docs/misc/xl-network-configuration.markdown
--- a/docs/misc/xl-network-configuration.markdown	Fri Sep 14 10:02:48 2012 +0100
+++ b/docs/misc/xl-network-configuration.markdown	Fri Sep 14 10:02:49 2012 +0100
@@ -122,8 +122,10 @@ specified IP address to be used by the g
 ### backend
 
 Specifies the backend domain which this device should attach to. This
-defaults to domain 0. Specifying another domain requires setting up a
-driver domain which is outside the scope of this document.
+defaults to domain 0. This option does not work if `run_hotplug_scripts`
+is not disabled in xl.conf (see xl.conf(5) man page for more information
+on this option). Specifying another domain requires setting up a driver
+domain which is outside the scope of this document.
 
 ### rate
 
diff -r 259c4e9d8adf -r ff6d94944039 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Fri Sep 14 10:02:48 2012 +0100
+++ b/tools/libxl/xl_cmdimpl.c	Fri Sep 14 10:02:49 2012 +0100
@@ -1096,6 +1096,13 @@ static void parse_config_data(const char
                         fprintf(stderr, "Specified backend domain does not exist, defaulting to Dom0\n");
                         nic->backend_domid = 0;
                     }
+                    if (nic->backend_domid != 0 && run_hotplug_scripts) {
+                        fprintf(stderr, "ERROR: the vif 'backend=' option "
+                                "cannot be used in conjunction with "
+                                "run_hotplug_scripts, please set "
+                                "run_hotplug_scripts to 0 in xl.conf\n");
+                        exit(EXIT_FAILURE);
+                    }
                 } else if (!strcmp(p, "rate")) {
                     parse_vif_rate(&config, (p2 + 1), nic);
                 } else if (!strcmp(p, "accel")) {

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 21:11:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 21:11:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCdAY-000374-3q; Fri, 14 Sep 2012 21:11:22 +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 1TCdAW-00032t-Fr
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:20 +0000
Received: from [85.158.138.51:24147] by server-11.bemta-3.messagelabs.com id
	29/EA-30250-87D93505; Fri, 14 Sep 2012 21:11:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-174.messagelabs.com!1347657076!24275965!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30031 invoked from network); 14 Sep 2012 21:11:17 -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;
	14 Sep 2012 21:11: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 1TCdAS-0000BE-Lu
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAS-0008IJ-EE
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:16 +0000
Message-Id: <E1TCdAS-0008IJ-EE@xenbits.xen.org>
Date: Fri, 14 Sep 2012 21:11:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/hvm: mark save/restore
	registration code __init
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347625823 -7200
# Node ID a177725aa49228be5c9dcb9b5a99b890d979334f
# Parent  9882802e9a69e564dcd8ddfd5ea0943b2d045caf
x86/hvm: mark save/restore registration code __init

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


diff -r 9882802e9a69 -r a177725aa492 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Fri Sep 14 14:28:59 2012 +0200
+++ b/xen/arch/x86/hvm/hvm.c	Fri Sep 14 14:30:23 2012 +0200
@@ -991,7 +991,7 @@ static int hvm_load_cpu_xsave_states(str
 /* We need variable length data chunk for xsave area, hence customized
  * declaration other than HVM_REGISTER_SAVE_RESTORE.
  */
-static int __hvm_register_CPU_XSAVE_save_and_restore(void)
+static int __init __hvm_register_CPU_XSAVE_save_and_restore(void)
 {
     hvm_register_savevm(CPU_XSAVE_CODE,
                         "CPU_XSAVE",
diff -r 9882802e9a69 -r a177725aa492 xen/common/hvm/save.c
--- a/xen/common/hvm/save.c	Fri Sep 14 14:28:59 2012 +0200
+++ b/xen/common/hvm/save.c	Fri Sep 14 14:30:23 2012 +0200
@@ -40,11 +40,11 @@ static struct {
 } hvm_sr_handlers [HVM_SAVE_CODE_MAX + 1] = {{NULL, NULL, "<?>"},};
 
 /* Init-time function to add entries to that list */
-void hvm_register_savevm(uint16_t typecode, 
-                         const char *name,
-                         hvm_save_handler save_state,
-                         hvm_load_handler load_state,
-                         size_t size, int kind)
+void __init hvm_register_savevm(uint16_t typecode,
+                                const char *name,
+                                hvm_save_handler save_state,
+                                hvm_load_handler load_state,
+                                size_t size, int kind)
 {
     ASSERT(typecode <= HVM_SAVE_CODE_MAX);
     ASSERT(hvm_sr_handlers[typecode].save == NULL);
diff -r 9882802e9a69 -r a177725aa492 xen/include/xen/hvm/save.h
--- a/xen/include/xen/hvm/save.h	Fri Sep 14 14:28:59 2012 +0200
+++ b/xen/include/xen/hvm/save.h	Fri Sep 14 14:30:23 2012 +0200
@@ -19,6 +19,7 @@
 #define __XEN_HVM_SAVE_H__
 
 #include <xen/types.h>
+#include <xen/init.h>
 #include <public/xen.h>
 #include <public/hvm/save.h>
 
@@ -108,7 +109,7 @@ void hvm_register_savevm(uint16_t typeco
 /* Syntactic sugar around that function: specify the max number of
  * saves, and this calculates the size of buffer needed */
 #define HVM_REGISTER_SAVE_RESTORE(_x, _save, _load, _num, _k)             \
-static int __hvm_register_##_x##_save_and_restore(void)                   \
+static int __init __hvm_register_##_x##_save_and_restore(void)            \
 {                                                                         \
     hvm_register_savevm(HVM_SAVE_CODE(_x),                                \
                         #_x,                                              \

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 21:11:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 21:11:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCdAY-000374-3q; Fri, 14 Sep 2012 21:11:22 +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 1TCdAW-00032t-Fr
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:20 +0000
Received: from [85.158.138.51:24147] by server-11.bemta-3.messagelabs.com id
	29/EA-30250-87D93505; Fri, 14 Sep 2012 21:11:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-174.messagelabs.com!1347657076!24275965!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30031 invoked from network); 14 Sep 2012 21:11:17 -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;
	14 Sep 2012 21:11: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 1TCdAS-0000BE-Lu
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAS-0008IJ-EE
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:16 +0000
Message-Id: <E1TCdAS-0008IJ-EE@xenbits.xen.org>
Date: Fri, 14 Sep 2012 21:11:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/hvm: mark save/restore
	registration code __init
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347625823 -7200
# Node ID a177725aa49228be5c9dcb9b5a99b890d979334f
# Parent  9882802e9a69e564dcd8ddfd5ea0943b2d045caf
x86/hvm: mark save/restore registration code __init

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


diff -r 9882802e9a69 -r a177725aa492 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Fri Sep 14 14:28:59 2012 +0200
+++ b/xen/arch/x86/hvm/hvm.c	Fri Sep 14 14:30:23 2012 +0200
@@ -991,7 +991,7 @@ static int hvm_load_cpu_xsave_states(str
 /* We need variable length data chunk for xsave area, hence customized
  * declaration other than HVM_REGISTER_SAVE_RESTORE.
  */
-static int __hvm_register_CPU_XSAVE_save_and_restore(void)
+static int __init __hvm_register_CPU_XSAVE_save_and_restore(void)
 {
     hvm_register_savevm(CPU_XSAVE_CODE,
                         "CPU_XSAVE",
diff -r 9882802e9a69 -r a177725aa492 xen/common/hvm/save.c
--- a/xen/common/hvm/save.c	Fri Sep 14 14:28:59 2012 +0200
+++ b/xen/common/hvm/save.c	Fri Sep 14 14:30:23 2012 +0200
@@ -40,11 +40,11 @@ static struct {
 } hvm_sr_handlers [HVM_SAVE_CODE_MAX + 1] = {{NULL, NULL, "<?>"},};
 
 /* Init-time function to add entries to that list */
-void hvm_register_savevm(uint16_t typecode, 
-                         const char *name,
-                         hvm_save_handler save_state,
-                         hvm_load_handler load_state,
-                         size_t size, int kind)
+void __init hvm_register_savevm(uint16_t typecode,
+                                const char *name,
+                                hvm_save_handler save_state,
+                                hvm_load_handler load_state,
+                                size_t size, int kind)
 {
     ASSERT(typecode <= HVM_SAVE_CODE_MAX);
     ASSERT(hvm_sr_handlers[typecode].save == NULL);
diff -r 9882802e9a69 -r a177725aa492 xen/include/xen/hvm/save.h
--- a/xen/include/xen/hvm/save.h	Fri Sep 14 14:28:59 2012 +0200
+++ b/xen/include/xen/hvm/save.h	Fri Sep 14 14:30:23 2012 +0200
@@ -19,6 +19,7 @@
 #define __XEN_HVM_SAVE_H__
 
 #include <xen/types.h>
+#include <xen/init.h>
 #include <public/xen.h>
 #include <public/hvm/save.h>
 
@@ -108,7 +109,7 @@ void hvm_register_savevm(uint16_t typeco
 /* Syntactic sugar around that function: specify the max number of
  * saves, and this calculates the size of buffer needed */
 #define HVM_REGISTER_SAVE_RESTORE(_x, _save, _load, _num, _k)             \
-static int __hvm_register_##_x##_save_and_restore(void)                   \
+static int __init __hvm_register_##_x##_save_and_restore(void)            \
 {                                                                         \
     hvm_register_savevm(HVM_SAVE_CODE(_x),                                \
                         #_x,                                              \

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 21:11:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 21:11:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCdAY-00036v-19; Fri, 14 Sep 2012 21:11:22 +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 1TCdAV-00034G-IZ
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:20 +0000
Received: from [85.158.137.99:60560] by server-8.bemta-3.messagelabs.com id
	1F/AA-24700-67D93505; Fri, 14 Sep 2012 21:11:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-217.messagelabs.com!1347657076!14602637!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14678 invoked from network); 14 Sep 2012 21:11:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Sep 2012 21:11: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 1TCdAR-0000BB-Ue
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAR-0008Hr-SQ
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:15 +0000
Message-Id: <E1TCdAR-0008Hr-SQ@xenbits.xen.org>
Date: Fri, 14 Sep 2012 21:11:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/hvm: constify static data where
	possible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347625739 -7200
# Node ID 9882802e9a69e564dcd8ddfd5ea0943b2d045caf
# Parent  191db43e50cfc919681a406d313b570d3b3d2d2e
x86/hvm: constify static data where possible

In a few cases this also extends to making them static in the first
place.

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


diff -r 191db43e50cf -r 9882802e9a69 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Fri Sep 14 14:25:22 2012 +0200
+++ b/xen/arch/x86/hvm/hvm.c	Fri Sep 14 14:28:59 2012 +0200
@@ -3168,7 +3168,7 @@ static long hvm_physdev_op_compat32(
     }
 }
 
-static hvm_hypercall_t *hvm_hypercall64_table[NR_hypercalls] = {
+static hvm_hypercall_t *const hvm_hypercall64_table[NR_hypercalls] = {
     [ __HYPERVISOR_memory_op ] = (hvm_hypercall_t *)hvm_memory_op,
     [ __HYPERVISOR_grant_table_op ] = (hvm_hypercall_t *)hvm_grant_table_op,
     [ __HYPERVISOR_vcpu_op ] = (hvm_hypercall_t *)hvm_vcpu_op,
@@ -3185,7 +3185,7 @@ static hvm_hypercall_t *hvm_hypercall64_
 #define COMPAT_CALL(x)                                        \
     [ __HYPERVISOR_ ## x ] = (hvm_hypercall_t *) compat_ ## x
 
-static hvm_hypercall_t *hvm_hypercall32_table[NR_hypercalls] = {
+static hvm_hypercall_t *const hvm_hypercall32_table[NR_hypercalls] = {
     [ __HYPERVISOR_memory_op ] = (hvm_hypercall_t *)hvm_memory_op_compat32,
     [ __HYPERVISOR_grant_table_op ] = (hvm_hypercall_t *)hvm_grant_table_op_compat32,
     [ __HYPERVISOR_vcpu_op ] = (hvm_hypercall_t *)hvm_vcpu_op_compat32,
diff -r 191db43e50cf -r 9882802e9a69 xen/arch/x86/hvm/mtrr.c
--- a/xen/arch/x86/hvm/mtrr.c	Fri Sep 14 14:25:22 2012 +0200
+++ b/xen/arch/x86/hvm/mtrr.c	Fri Sep 14 14:28:59 2012 +0200
@@ -34,14 +34,14 @@ static uint32_t size_or_mask;
 #define pat_cr_2_paf(pat_cr,n)  ((((uint64_t)pat_cr) >> ((n)<<3)) & 0xff)
 
 /* PAT entry to PTE flags (PAT, PCD, PWT bits). */
-static uint8_t pat_entry_2_pte_flags[8] = {
+static const uint8_t pat_entry_2_pte_flags[8] = {
     0,           _PAGE_PWT,
     _PAGE_PCD,   _PAGE_PCD | _PAGE_PWT,
     _PAGE_PAT,   _PAGE_PAT | _PAGE_PWT,
     _PAGE_PAT | _PAGE_PCD, _PAGE_PAT | _PAGE_PCD | _PAGE_PWT };
 
 /* Effective mm type lookup table, according to MTRR and PAT. */
-static uint8_t mm_type_tbl[MTRR_NUM_TYPES][PAT_TYPE_NUMS] = {
+static const uint8_t mm_type_tbl[MTRR_NUM_TYPES][PAT_TYPE_NUMS] = {
 /********PAT(UC,WC,RS,RS,WT,WP,WB,UC-)*/
 /* RS means reserved type(2,3), and type is hardcoded here */
  /*MTRR(UC):(UC,WC,RS,RS,UC,UC,UC,UC)*/
diff -r 191db43e50cf -r 9882802e9a69 xen/arch/x86/hvm/stdvga.c
--- a/xen/arch/x86/hvm/stdvga.c	Fri Sep 14 14:25:22 2012 +0200
+++ b/xen/arch/x86/hvm/stdvga.c	Fri Sep 14 14:28:59 2012 +0200
@@ -59,7 +59,7 @@ static const uint32_t mask16[16] = {
 };
 
 /* force some bits to zero */
-const uint8_t sr_mask[8] = {
+static const uint8_t sr_mask[8] = {
     (uint8_t)~0xfc,
     (uint8_t)~0xc2,
     (uint8_t)~0xf0,
@@ -70,7 +70,7 @@ const uint8_t sr_mask[8] = {
     (uint8_t)~0x00,
 };
 
-const uint8_t gr_mask[9] = {
+static const uint8_t gr_mask[9] = {
     (uint8_t)~0xf0, /* 0x00 */
     (uint8_t)~0xf0, /* 0x01 */
     (uint8_t)~0xf0, /* 0x02 */
diff -r 191db43e50cf -r 9882802e9a69 xen/arch/x86/hvm/svm/emulate.c
--- a/xen/arch/x86/hvm/svm/emulate.c	Fri Sep 14 14:25:22 2012 +0200
+++ b/xen/arch/x86/hvm/svm/emulate.c	Fri Sep 14 14:28:59 2012 +0200
@@ -107,7 +107,7 @@ MAKE_INSTR(STGI,   3, 0x0f, 0x01, 0xdc);
 MAKE_INSTR(CLGI,   3, 0x0f, 0x01, 0xdd);
 MAKE_INSTR(INVLPGA,3, 0x0f, 0x01, 0xdf);
 
-static const u8 *opc_bytes[INSTR_MAX_COUNT] = 
+static const u8 *const opc_bytes[INSTR_MAX_COUNT] =
 {
     [INSTR_INVD]   = OPCODE_INVD,
     [INSTR_WBINVD] = OPCODE_WBINVD,
diff -r 191db43e50cf -r 9882802e9a69 xen/arch/x86/hvm/svm/vpmu.c
--- a/xen/arch/x86/hvm/svm/vpmu.c	Fri Sep 14 14:25:22 2012 +0200
+++ b/xen/arch/x86/hvm/svm/vpmu.c	Fri Sep 14 14:28:59 2012 +0200
@@ -44,13 +44,13 @@
 #define set_guest_mode(msr) (msr |= (1ULL << MSR_F10H_EVNTSEL_GO_SHIFT))
 #define is_overflowed(msr) (!((msr) & (1ULL << (MSR_F10H_COUNTER_LENGTH-1))))
 
-static int __read_mostly num_counters = 0;
-static u32 __read_mostly *counters = NULL;
-static u32 __read_mostly *ctrls = NULL;
-static bool_t __read_mostly k7_counters_mirrored = 0;
+static unsigned int __read_mostly num_counters;
+static const u32 __read_mostly *counters;
+static const u32 __read_mostly *ctrls;
+static bool_t __read_mostly k7_counters_mirrored;
 
 /* PMU Counter MSRs. */
-u32 AMD_F10H_COUNTERS[] = {
+static const u32 AMD_F10H_COUNTERS[] = {
     MSR_K7_PERFCTR0,
     MSR_K7_PERFCTR1,
     MSR_K7_PERFCTR2,
@@ -58,14 +58,14 @@ u32 AMD_F10H_COUNTERS[] = {
 };
 
 /* PMU Control MSRs. */
-u32 AMD_F10H_CTRLS[] = {
+static const u32 AMD_F10H_CTRLS[] = {
     MSR_K7_EVNTSEL0,
     MSR_K7_EVNTSEL1,
     MSR_K7_EVNTSEL2,
     MSR_K7_EVNTSEL3
 };
 
-u32 AMD_F15H_COUNTERS[] = {
+static const u32 AMD_F15H_COUNTERS[] = {
     MSR_AMD_FAM15H_PERFCTR0,
     MSR_AMD_FAM15H_PERFCTR1,
     MSR_AMD_FAM15H_PERFCTR2,
@@ -74,7 +74,7 @@ u32 AMD_F15H_COUNTERS[] = {
     MSR_AMD_FAM15H_PERFCTR5
 };
 
-u32 AMD_F15H_CTRLS[] = {
+static const u32 AMD_F15H_CTRLS[] = {
     MSR_AMD_FAM15H_EVNTSEL0,
     MSR_AMD_FAM15H_EVNTSEL1,
     MSR_AMD_FAM15H_EVNTSEL2,
@@ -161,7 +161,7 @@ static int amd_vpmu_do_interrupt(struct 
 
 static inline void context_restore(struct vcpu *v)
 {
-    u64 i;
+    unsigned int i;
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
     struct amd_vpmu_context *ctxt = vpmu->context;
 
@@ -198,7 +198,7 @@ static void amd_vpmu_restore(struct vcpu
 
 static inline void context_save(struct vcpu *v)
 {
-    int i;
+    unsigned int i;
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
     struct amd_vpmu_context *ctxt = vpmu->context;
 
@@ -225,7 +225,7 @@ static void amd_vpmu_save(struct vcpu *v
 
 static void context_update(unsigned int msr, u64 msr_content)
 {
-    int i;
+    unsigned int i;
     struct vcpu *v = current;
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
     struct amd_vpmu_context *ctxt = vpmu->context;
@@ -294,7 +294,7 @@ static int amd_vpmu_do_rdmsr(unsigned in
 
 static int amd_vpmu_initialise(struct vcpu *v)
 {
-    struct amd_vpmu_context *ctxt = NULL;
+    struct amd_vpmu_context *ctxt;
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
     uint8_t family = current_cpu_data.x86;
 
@@ -323,7 +323,7 @@ static int amd_vpmu_initialise(struct vc
 	 }
     }
 
-    ctxt = xzalloc_bytes(sizeof(struct amd_vpmu_context));
+    ctxt = xzalloc(struct amd_vpmu_context);
     if ( !ctxt )
     {
         gdprintk(XENLOG_WARNING, "Insufficient memory for PMU, "
@@ -332,7 +332,7 @@ static int amd_vpmu_initialise(struct vc
         return -ENOMEM;
     }
 
-    vpmu->context = (void *)ctxt;
+    vpmu->context = ctxt;
     vpmu_set(vpmu, VPMU_CONTEXT_ALLOCATED);
     return 0;
 }
diff -r 191db43e50cf -r 9882802e9a69 xen/arch/x86/hvm/vlapic.c
--- a/xen/arch/x86/hvm/vlapic.c	Fri Sep 14 14:25:22 2012 +0200
+++ b/xen/arch/x86/hvm/vlapic.c	Fri Sep 14 14:28:59 2012 +0200
@@ -53,7 +53,7 @@
     LVT_MASK | APIC_MODE_MASK | APIC_INPUT_POLARITY |\
     APIC_LVT_REMOTE_IRR | APIC_LVT_LEVEL_TRIGGER
 
-static unsigned int vlapic_lvt_mask[VLAPIC_LVT_NUM] =
+static const unsigned int vlapic_lvt_mask[VLAPIC_LVT_NUM] =
 {
      /* LVTT */
      LVT_MASK | APIC_TIMER_MODE_MASK,
diff -r 191db43e50cf -r 9882802e9a69 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Fri Sep 14 14:25:22 2012 +0200
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Fri Sep 14 14:28:59 2012 +0200
@@ -147,7 +147,7 @@ static void vmx_vcpu_destroy(struct vcpu
 
 static DEFINE_PER_CPU(struct vmx_msr_state, host_msr_state);
 
-static u32 msr_index[] =
+static const u32 msr_index[] =
 {
     MSR_LSTAR, MSR_STAR, MSR_SYSCALL_MASK
 };
diff -r 191db43e50cf -r 9882802e9a69 xen/arch/x86/hvm/vmx/vpmu_core2.c
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c	Fri Sep 14 14:25:22 2012 +0200
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c	Fri Sep 14 14:28:59 2012 +0200
@@ -101,28 +101,30 @@ static void handle_pmc_quirk(u64 msr_con
     }
 }
 
-u32 core2_counters_msr[] =   {
+static const u32 core2_counters_msr[] = {
     MSR_CORE_PERF_FIXED_CTR0,
     MSR_CORE_PERF_FIXED_CTR1,
-    MSR_CORE_PERF_FIXED_CTR2};
+    MSR_CORE_PERF_FIXED_CTR2
+};
 
 /* Core 2 Non-architectual Performance Control MSRs. */
-u32 core2_ctrls_msr[] = {
+static const u32 core2_ctrls_msr[] = {
     MSR_CORE_PERF_FIXED_CTR_CTRL,
     MSR_IA32_PEBS_ENABLE,
-    MSR_IA32_DS_AREA};
+    MSR_IA32_DS_AREA
+};
 
 struct pmumsr {
     unsigned int num;
-    u32 *msr;
+    const u32 *msr;
 };
 
-struct pmumsr core2_counters = {
+static const struct pmumsr core2_counters = {
     3,
     core2_counters_msr
 };
 
-struct pmumsr core2_ctrls = {
+static const struct pmumsr core2_ctrls = {
     3,
     core2_ctrls_msr
 };
diff -r 191db43e50cf -r 9882802e9a69 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Fri Sep 14 14:25:22 2012 +0200
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Fri Sep 14 14:28:59 2012 +0200
@@ -107,7 +107,7 @@ uint32_t nvmx_vcpu_asid(struct vcpu *v)
     return 0;
 }
 
-enum x86_segment sreg_to_index[] = {
+static const enum x86_segment sreg_to_index[] = {
     [VMX_SREG_ES] = x86_seg_es,
     [VMX_SREG_CS] = x86_seg_cs,
     [VMX_SREG_SS] = x86_seg_ss,
@@ -629,7 +629,7 @@ u64 nvmx_get_tsc_offset(struct vcpu *v)
 /*
  * Context synchronized between shadow and virtual VMCS.
  */
-static unsigned long vmcs_gstate_field[] = {
+static const u16 vmcs_gstate_field[] = {
     /* 16 BITS */
     GUEST_ES_SELECTOR,
     GUEST_CS_SELECTOR,
@@ -690,7 +690,7 @@ static unsigned long vmcs_gstate_field[]
 /*
  * Context: shadow -> virtual VMCS
  */
-static unsigned long vmcs_ro_field[] = {
+static const u16 vmcs_ro_field[] = {
     GUEST_PHYSICAL_ADDRESS,
     VM_INSTRUCTION_ERROR,
     VM_EXIT_REASON,
@@ -705,9 +705,9 @@ static unsigned long vmcs_ro_field[] = {
 };
 
 static struct vmcs_host_to_guest {
-    unsigned long host_field;
-    unsigned long guest_field;
-} vmcs_h2g_field[] = {
+    u16 host_field;
+    u16 guest_field;
+} const vmcs_h2g_field[] = {
     {HOST_ES_SELECTOR, GUEST_ES_SELECTOR},
     {HOST_CS_SELECTOR, GUEST_CS_SELECTOR},
     {HOST_SS_SELECTOR, GUEST_SS_SELECTOR},

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

From xen-changelog-bounces@lists.xen.org Fri Sep 14 21:11:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Sep 2012 21:11:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCdAY-00036v-19; Fri, 14 Sep 2012 21:11:22 +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 1TCdAV-00034G-IZ
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:20 +0000
Received: from [85.158.137.99:60560] by server-8.bemta-3.messagelabs.com id
	1F/AA-24700-67D93505; Fri, 14 Sep 2012 21:11:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-217.messagelabs.com!1347657076!14602637!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14678 invoked from network); 14 Sep 2012 21:11:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Sep 2012 21:11: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 1TCdAR-0000BB-Ue
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCdAR-0008Hr-SQ
	for xen-changelog@lists.xensource.com; Fri, 14 Sep 2012 21:11:15 +0000
Message-Id: <E1TCdAR-0008Hr-SQ@xenbits.xen.org>
Date: Fri, 14 Sep 2012 21:11:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/hvm: constify static data where
	possible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347625739 -7200
# Node ID 9882802e9a69e564dcd8ddfd5ea0943b2d045caf
# Parent  191db43e50cfc919681a406d313b570d3b3d2d2e
x86/hvm: constify static data where possible

In a few cases this also extends to making them static in the first
place.

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


diff -r 191db43e50cf -r 9882802e9a69 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Fri Sep 14 14:25:22 2012 +0200
+++ b/xen/arch/x86/hvm/hvm.c	Fri Sep 14 14:28:59 2012 +0200
@@ -3168,7 +3168,7 @@ static long hvm_physdev_op_compat32(
     }
 }
 
-static hvm_hypercall_t *hvm_hypercall64_table[NR_hypercalls] = {
+static hvm_hypercall_t *const hvm_hypercall64_table[NR_hypercalls] = {
     [ __HYPERVISOR_memory_op ] = (hvm_hypercall_t *)hvm_memory_op,
     [ __HYPERVISOR_grant_table_op ] = (hvm_hypercall_t *)hvm_grant_table_op,
     [ __HYPERVISOR_vcpu_op ] = (hvm_hypercall_t *)hvm_vcpu_op,
@@ -3185,7 +3185,7 @@ static hvm_hypercall_t *hvm_hypercall64_
 #define COMPAT_CALL(x)                                        \
     [ __HYPERVISOR_ ## x ] = (hvm_hypercall_t *) compat_ ## x
 
-static hvm_hypercall_t *hvm_hypercall32_table[NR_hypercalls] = {
+static hvm_hypercall_t *const hvm_hypercall32_table[NR_hypercalls] = {
     [ __HYPERVISOR_memory_op ] = (hvm_hypercall_t *)hvm_memory_op_compat32,
     [ __HYPERVISOR_grant_table_op ] = (hvm_hypercall_t *)hvm_grant_table_op_compat32,
     [ __HYPERVISOR_vcpu_op ] = (hvm_hypercall_t *)hvm_vcpu_op_compat32,
diff -r 191db43e50cf -r 9882802e9a69 xen/arch/x86/hvm/mtrr.c
--- a/xen/arch/x86/hvm/mtrr.c	Fri Sep 14 14:25:22 2012 +0200
+++ b/xen/arch/x86/hvm/mtrr.c	Fri Sep 14 14:28:59 2012 +0200
@@ -34,14 +34,14 @@ static uint32_t size_or_mask;
 #define pat_cr_2_paf(pat_cr,n)  ((((uint64_t)pat_cr) >> ((n)<<3)) & 0xff)
 
 /* PAT entry to PTE flags (PAT, PCD, PWT bits). */
-static uint8_t pat_entry_2_pte_flags[8] = {
+static const uint8_t pat_entry_2_pte_flags[8] = {
     0,           _PAGE_PWT,
     _PAGE_PCD,   _PAGE_PCD | _PAGE_PWT,
     _PAGE_PAT,   _PAGE_PAT | _PAGE_PWT,
     _PAGE_PAT | _PAGE_PCD, _PAGE_PAT | _PAGE_PCD | _PAGE_PWT };
 
 /* Effective mm type lookup table, according to MTRR and PAT. */
-static uint8_t mm_type_tbl[MTRR_NUM_TYPES][PAT_TYPE_NUMS] = {
+static const uint8_t mm_type_tbl[MTRR_NUM_TYPES][PAT_TYPE_NUMS] = {
 /********PAT(UC,WC,RS,RS,WT,WP,WB,UC-)*/
 /* RS means reserved type(2,3), and type is hardcoded here */
  /*MTRR(UC):(UC,WC,RS,RS,UC,UC,UC,UC)*/
diff -r 191db43e50cf -r 9882802e9a69 xen/arch/x86/hvm/stdvga.c
--- a/xen/arch/x86/hvm/stdvga.c	Fri Sep 14 14:25:22 2012 +0200
+++ b/xen/arch/x86/hvm/stdvga.c	Fri Sep 14 14:28:59 2012 +0200
@@ -59,7 +59,7 @@ static const uint32_t mask16[16] = {
 };
 
 /* force some bits to zero */
-const uint8_t sr_mask[8] = {
+static const uint8_t sr_mask[8] = {
     (uint8_t)~0xfc,
     (uint8_t)~0xc2,
     (uint8_t)~0xf0,
@@ -70,7 +70,7 @@ const uint8_t sr_mask[8] = {
     (uint8_t)~0x00,
 };
 
-const uint8_t gr_mask[9] = {
+static const uint8_t gr_mask[9] = {
     (uint8_t)~0xf0, /* 0x00 */
     (uint8_t)~0xf0, /* 0x01 */
     (uint8_t)~0xf0, /* 0x02 */
diff -r 191db43e50cf -r 9882802e9a69 xen/arch/x86/hvm/svm/emulate.c
--- a/xen/arch/x86/hvm/svm/emulate.c	Fri Sep 14 14:25:22 2012 +0200
+++ b/xen/arch/x86/hvm/svm/emulate.c	Fri Sep 14 14:28:59 2012 +0200
@@ -107,7 +107,7 @@ MAKE_INSTR(STGI,   3, 0x0f, 0x01, 0xdc);
 MAKE_INSTR(CLGI,   3, 0x0f, 0x01, 0xdd);
 MAKE_INSTR(INVLPGA,3, 0x0f, 0x01, 0xdf);
 
-static const u8 *opc_bytes[INSTR_MAX_COUNT] = 
+static const u8 *const opc_bytes[INSTR_MAX_COUNT] =
 {
     [INSTR_INVD]   = OPCODE_INVD,
     [INSTR_WBINVD] = OPCODE_WBINVD,
diff -r 191db43e50cf -r 9882802e9a69 xen/arch/x86/hvm/svm/vpmu.c
--- a/xen/arch/x86/hvm/svm/vpmu.c	Fri Sep 14 14:25:22 2012 +0200
+++ b/xen/arch/x86/hvm/svm/vpmu.c	Fri Sep 14 14:28:59 2012 +0200
@@ -44,13 +44,13 @@
 #define set_guest_mode(msr) (msr |= (1ULL << MSR_F10H_EVNTSEL_GO_SHIFT))
 #define is_overflowed(msr) (!((msr) & (1ULL << (MSR_F10H_COUNTER_LENGTH-1))))
 
-static int __read_mostly num_counters = 0;
-static u32 __read_mostly *counters = NULL;
-static u32 __read_mostly *ctrls = NULL;
-static bool_t __read_mostly k7_counters_mirrored = 0;
+static unsigned int __read_mostly num_counters;
+static const u32 __read_mostly *counters;
+static const u32 __read_mostly *ctrls;
+static bool_t __read_mostly k7_counters_mirrored;
 
 /* PMU Counter MSRs. */
-u32 AMD_F10H_COUNTERS[] = {
+static const u32 AMD_F10H_COUNTERS[] = {
     MSR_K7_PERFCTR0,
     MSR_K7_PERFCTR1,
     MSR_K7_PERFCTR2,
@@ -58,14 +58,14 @@ u32 AMD_F10H_COUNTERS[] = {
 };
 
 /* PMU Control MSRs. */
-u32 AMD_F10H_CTRLS[] = {
+static const u32 AMD_F10H_CTRLS[] = {
     MSR_K7_EVNTSEL0,
     MSR_K7_EVNTSEL1,
     MSR_K7_EVNTSEL2,
     MSR_K7_EVNTSEL3
 };
 
-u32 AMD_F15H_COUNTERS[] = {
+static const u32 AMD_F15H_COUNTERS[] = {
     MSR_AMD_FAM15H_PERFCTR0,
     MSR_AMD_FAM15H_PERFCTR1,
     MSR_AMD_FAM15H_PERFCTR2,
@@ -74,7 +74,7 @@ u32 AMD_F15H_COUNTERS[] = {
     MSR_AMD_FAM15H_PERFCTR5
 };
 
-u32 AMD_F15H_CTRLS[] = {
+static const u32 AMD_F15H_CTRLS[] = {
     MSR_AMD_FAM15H_EVNTSEL0,
     MSR_AMD_FAM15H_EVNTSEL1,
     MSR_AMD_FAM15H_EVNTSEL2,
@@ -161,7 +161,7 @@ static int amd_vpmu_do_interrupt(struct 
 
 static inline void context_restore(struct vcpu *v)
 {
-    u64 i;
+    unsigned int i;
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
     struct amd_vpmu_context *ctxt = vpmu->context;
 
@@ -198,7 +198,7 @@ static void amd_vpmu_restore(struct vcpu
 
 static inline void context_save(struct vcpu *v)
 {
-    int i;
+    unsigned int i;
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
     struct amd_vpmu_context *ctxt = vpmu->context;
 
@@ -225,7 +225,7 @@ static void amd_vpmu_save(struct vcpu *v
 
 static void context_update(unsigned int msr, u64 msr_content)
 {
-    int i;
+    unsigned int i;
     struct vcpu *v = current;
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
     struct amd_vpmu_context *ctxt = vpmu->context;
@@ -294,7 +294,7 @@ static int amd_vpmu_do_rdmsr(unsigned in
 
 static int amd_vpmu_initialise(struct vcpu *v)
 {
-    struct amd_vpmu_context *ctxt = NULL;
+    struct amd_vpmu_context *ctxt;
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
     uint8_t family = current_cpu_data.x86;
 
@@ -323,7 +323,7 @@ static int amd_vpmu_initialise(struct vc
 	 }
     }
 
-    ctxt = xzalloc_bytes(sizeof(struct amd_vpmu_context));
+    ctxt = xzalloc(struct amd_vpmu_context);
     if ( !ctxt )
     {
         gdprintk(XENLOG_WARNING, "Insufficient memory for PMU, "
@@ -332,7 +332,7 @@ static int amd_vpmu_initialise(struct vc
         return -ENOMEM;
     }
 
-    vpmu->context = (void *)ctxt;
+    vpmu->context = ctxt;
     vpmu_set(vpmu, VPMU_CONTEXT_ALLOCATED);
     return 0;
 }
diff -r 191db43e50cf -r 9882802e9a69 xen/arch/x86/hvm/vlapic.c
--- a/xen/arch/x86/hvm/vlapic.c	Fri Sep 14 14:25:22 2012 +0200
+++ b/xen/arch/x86/hvm/vlapic.c	Fri Sep 14 14:28:59 2012 +0200
@@ -53,7 +53,7 @@
     LVT_MASK | APIC_MODE_MASK | APIC_INPUT_POLARITY |\
     APIC_LVT_REMOTE_IRR | APIC_LVT_LEVEL_TRIGGER
 
-static unsigned int vlapic_lvt_mask[VLAPIC_LVT_NUM] =
+static const unsigned int vlapic_lvt_mask[VLAPIC_LVT_NUM] =
 {
      /* LVTT */
      LVT_MASK | APIC_TIMER_MODE_MASK,
diff -r 191db43e50cf -r 9882802e9a69 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Fri Sep 14 14:25:22 2012 +0200
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Fri Sep 14 14:28:59 2012 +0200
@@ -147,7 +147,7 @@ static void vmx_vcpu_destroy(struct vcpu
 
 static DEFINE_PER_CPU(struct vmx_msr_state, host_msr_state);
 
-static u32 msr_index[] =
+static const u32 msr_index[] =
 {
     MSR_LSTAR, MSR_STAR, MSR_SYSCALL_MASK
 };
diff -r 191db43e50cf -r 9882802e9a69 xen/arch/x86/hvm/vmx/vpmu_core2.c
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c	Fri Sep 14 14:25:22 2012 +0200
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c	Fri Sep 14 14:28:59 2012 +0200
@@ -101,28 +101,30 @@ static void handle_pmc_quirk(u64 msr_con
     }
 }
 
-u32 core2_counters_msr[] =   {
+static const u32 core2_counters_msr[] = {
     MSR_CORE_PERF_FIXED_CTR0,
     MSR_CORE_PERF_FIXED_CTR1,
-    MSR_CORE_PERF_FIXED_CTR2};
+    MSR_CORE_PERF_FIXED_CTR2
+};
 
 /* Core 2 Non-architectual Performance Control MSRs. */
-u32 core2_ctrls_msr[] = {
+static const u32 core2_ctrls_msr[] = {
     MSR_CORE_PERF_FIXED_CTR_CTRL,
     MSR_IA32_PEBS_ENABLE,
-    MSR_IA32_DS_AREA};
+    MSR_IA32_DS_AREA
+};
 
 struct pmumsr {
     unsigned int num;
-    u32 *msr;
+    const u32 *msr;
 };
 
-struct pmumsr core2_counters = {
+static const struct pmumsr core2_counters = {
     3,
     core2_counters_msr
 };
 
-struct pmumsr core2_ctrls = {
+static const struct pmumsr core2_ctrls = {
     3,
     core2_ctrls_msr
 };
diff -r 191db43e50cf -r 9882802e9a69 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Fri Sep 14 14:25:22 2012 +0200
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Fri Sep 14 14:28:59 2012 +0200
@@ -107,7 +107,7 @@ uint32_t nvmx_vcpu_asid(struct vcpu *v)
     return 0;
 }
 
-enum x86_segment sreg_to_index[] = {
+static const enum x86_segment sreg_to_index[] = {
     [VMX_SREG_ES] = x86_seg_es,
     [VMX_SREG_CS] = x86_seg_cs,
     [VMX_SREG_SS] = x86_seg_ss,
@@ -629,7 +629,7 @@ u64 nvmx_get_tsc_offset(struct vcpu *v)
 /*
  * Context synchronized between shadow and virtual VMCS.
  */
-static unsigned long vmcs_gstate_field[] = {
+static const u16 vmcs_gstate_field[] = {
     /* 16 BITS */
     GUEST_ES_SELECTOR,
     GUEST_CS_SELECTOR,
@@ -690,7 +690,7 @@ static unsigned long vmcs_gstate_field[]
 /*
  * Context: shadow -> virtual VMCS
  */
-static unsigned long vmcs_ro_field[] = {
+static const u16 vmcs_ro_field[] = {
     GUEST_PHYSICAL_ADDRESS,
     VM_INSTRUCTION_ERROR,
     VM_EXIT_REASON,
@@ -705,9 +705,9 @@ static unsigned long vmcs_ro_field[] = {
 };
 
 static struct vmcs_host_to_guest {
-    unsigned long host_field;
-    unsigned long guest_field;
-} vmcs_h2g_field[] = {
+    u16 host_field;
+    u16 guest_field;
+} const vmcs_h2g_field[] = {
     {HOST_ES_SELECTOR, GUEST_ES_SELECTOR},
     {HOST_CS_SELECTOR, GUEST_CS_SELECTOR},
     {HOST_SS_SELECTOR, GUEST_SS_SELECTOR},

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

From xen-changelog-bounces@lists.xen.org Sat Sep 15 03:22:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 15 Sep 2012 03:22:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCixQ-00016D-6O; Sat, 15 Sep 2012 03:22:12 +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 1TCixO-000167-Rb
	for xen-changelog@lists.xensource.com; Sat, 15 Sep 2012 03:22:11 +0000
Received: from [85.158.137.99:3741] by server-11.bemta-3.messagelabs.com id
	6A/77-30250-264F3505; Sat, 15 Sep 2012 03:22:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-217.messagelabs.com!1347679328!17760081!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18615 invoked from network); 15 Sep 2012 03:22:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Sep 2012 03:22: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 1TCixM-0004z7-4Q
	for xen-changelog@lists.xensource.com; Sat, 15 Sep 2012 03:22:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCixL-0000iP-QM
	for xen-changelog@lists.xensource.com; Sat, 15 Sep 2012 03:22:07 +0000
Message-Id: <E1TCixL-0000iP-QM@xenbits.xen.org>
Date: Sat, 15 Sep 2012 03:22:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hvmloader: Do not zero the wallclock
	fields in shared-info.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347648477 -3600
# Node ID 12fa949b90603f057d458e370284471412afb0ba
# Parent  a177725aa49228be5c9dcb9b5a99b890d979334f
hvmloader: Do not zero the wallclock fields in shared-info.

These fields need to be valid at all times. Hypervisor ensures this
even across 32/64-bit guest transitions.

This fixes a bug where wallclock time is incorrect for booting 32-bit
HVM guests.

This should be backported to Xen 4.1 and 4.2.

Signed-off-by: Keir Fraser <keir@xen.org>
Tested-and-Reported-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---


diff -r a177725aa492 -r 12fa949b9060 tools/firmware/hvmloader/xenbus.c
--- a/tools/firmware/hvmloader/xenbus.c	Fri Sep 14 14:30:23 2012 +0200
+++ b/tools/firmware/hvmloader/xenbus.c	Fri Sep 14 19:47:57 2012 +0100
@@ -64,6 +64,8 @@ void xenbus_setup(void)
 /* Reset the xenbus connection so the next kernel can start again. */
 void xenbus_shutdown(void)
 {
+    struct shared_info *shinfo = get_shared_info();
+
     ASSERT(rings != NULL);
 
     /* We zero out the whole ring -- the backend can handle this, and it's 
@@ -72,7 +74,9 @@ void xenbus_shutdown(void)
     memset(rings, 0, sizeof *rings);
 
     /* Clear the event-channel state too. */
-    memset(get_shared_info(), 0, PAGE_SIZE);
+    memset(shinfo->vcpu_info, 0, sizeof(shinfo->vcpu_info));
+    memset(shinfo->evtchn_pending, 0, sizeof(shinfo->evtchn_pending));
+    memset(shinfo->evtchn_mask, 0, sizeof(shinfo->evtchn_mask));
 
     rings = NULL;
 }

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

From xen-changelog-bounces@lists.xen.org Sat Sep 15 03:22:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 15 Sep 2012 03:22:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TCixQ-00016D-6O; Sat, 15 Sep 2012 03:22:12 +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 1TCixO-000167-Rb
	for xen-changelog@lists.xensource.com; Sat, 15 Sep 2012 03:22:11 +0000
Received: from [85.158.137.99:3741] by server-11.bemta-3.messagelabs.com id
	6A/77-30250-264F3505; Sat, 15 Sep 2012 03:22:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-217.messagelabs.com!1347679328!17760081!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18615 invoked from network); 15 Sep 2012 03:22:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Sep 2012 03:22: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 1TCixM-0004z7-4Q
	for xen-changelog@lists.xensource.com; Sat, 15 Sep 2012 03:22:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TCixL-0000iP-QM
	for xen-changelog@lists.xensource.com; Sat, 15 Sep 2012 03:22:07 +0000
Message-Id: <E1TCixL-0000iP-QM@xenbits.xen.org>
Date: Sat, 15 Sep 2012 03:22:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hvmloader: Do not zero the wallclock
	fields in shared-info.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347648477 -3600
# Node ID 12fa949b90603f057d458e370284471412afb0ba
# Parent  a177725aa49228be5c9dcb9b5a99b890d979334f
hvmloader: Do not zero the wallclock fields in shared-info.

These fields need to be valid at all times. Hypervisor ensures this
even across 32/64-bit guest transitions.

This fixes a bug where wallclock time is incorrect for booting 32-bit
HVM guests.

This should be backported to Xen 4.1 and 4.2.

Signed-off-by: Keir Fraser <keir@xen.org>
Tested-and-Reported-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---


diff -r a177725aa492 -r 12fa949b9060 tools/firmware/hvmloader/xenbus.c
--- a/tools/firmware/hvmloader/xenbus.c	Fri Sep 14 14:30:23 2012 +0200
+++ b/tools/firmware/hvmloader/xenbus.c	Fri Sep 14 19:47:57 2012 +0100
@@ -64,6 +64,8 @@ void xenbus_setup(void)
 /* Reset the xenbus connection so the next kernel can start again. */
 void xenbus_shutdown(void)
 {
+    struct shared_info *shinfo = get_shared_info();
+
     ASSERT(rings != NULL);
 
     /* We zero out the whole ring -- the backend can handle this, and it's 
@@ -72,7 +74,9 @@ void xenbus_shutdown(void)
     memset(rings, 0, sizeof *rings);
 
     /* Clear the event-channel state too. */
-    memset(get_shared_info(), 0, PAGE_SIZE);
+    memset(shinfo->vcpu_info, 0, sizeof(shinfo->vcpu_info));
+    memset(shinfo->evtchn_pending, 0, sizeof(shinfo->evtchn_pending));
+    memset(shinfo->evtchn_mask, 0, sizeof(shinfo->evtchn_mask));
 
     rings = NULL;
 }

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

From xen-changelog-bounces@lists.xen.org Mon Sep 17 21:55:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Sep 2012 21: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.xen.org>)
	id 1TDjHh-00013R-Vk; Mon, 17 Sep 2012 21:55:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDjHf-00012k-Q5
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:16 +0000
Received: from [85.158.143.99:18532] by server-1.bemta-4.messagelabs.com id
	07/90-12504-34C97505; Mon, 17 Sep 2012 21:55:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-216.messagelabs.com!1347918912!30718929!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2053 invoked from network); 17 Sep 2012 21:55:13 -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;
	17 Sep 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 1TDjHc-0003qX-2J
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDjHb-000100-T0
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:11 +0000
Message-Id: <E1TDjHb-000100-T0@xenbits.xen.org>
Date: Mon, 17 Sep 2012 21:55:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: Enable -Wshadow.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <Ian.Campbell@citrix.com>
# Date 1347877020 -3600
# Node ID fa8c8c2373b679542aa4179492296cd982e28b7d
# Parent  98ca21138ce8f60a1a862860f9d6a709a5235a0f
libxl: Enable -Wshadow.

It was convenient to invent $(CFLAGS_LIBXL) to do this.

Various renamings to avoid shadowing standard functions:
  - index(3)
  - listen(2)
  - link(2)
  - abort(3)
  - abs(3)

Reduced the scope of some variables to avoid conflicts.

Change to libxc is due to the nested hypercall buf macros in
set_xen_guest_handle (used in libxl) using the same local private vars.

Build tested only.

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


diff -r 98ca21138ce8 -r fa8c8c2373b6 tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h	Mon Sep 17 11:16:59 2012 +0100
+++ b/tools/libxc/xenctrl.h	Mon Sep 17 11:17:00 2012 +0100
@@ -235,11 +235,13 @@ typedef struct xc_hypercall_buffer xc_hy
 /*
  * Returns the hypercall_buffer associated with a variable.
  */
-#define HYPERCALL_BUFFER(_name)                                                              \
-    ({  xc_hypercall_buffer_t _val1;                                                         \
-        typeof(XC__HYPERCALL_BUFFER_NAME(_name)) *_val2 = &XC__HYPERCALL_BUFFER_NAME(_name); \
-        (void)(&_val1 == _val2);                                                             \
-        (_val2)->param_shadow ? (_val2)->param_shadow : (_val2);                             \
+#define HYPERCALL_BUFFER(_name)                                 \
+    ({  xc_hypercall_buffer_t _hcbuf_buf1;                      \
+        typeof(XC__HYPERCALL_BUFFER_NAME(_name)) *_hcbuf_buf2 = \
+                &XC__HYPERCALL_BUFFER_NAME(_name);              \
+        (void)(&_hcbuf_buf1 == _hcbuf_buf2);                    \
+        (_hcbuf_buf2)->param_shadow ?                           \
+                (_hcbuf_buf2)->param_shadow : (_hcbuf_buf2);    \
      })
 
 #define HYPERCALL_BUFFER_INIT_NO_BOUNCE .dir = 0, .sz = 0, .ubuf = (void *)-1
@@ -273,11 +275,12 @@ typedef struct xc_hypercall_buffer xc_hy
  * Get the hypercall buffer data pointer in a form suitable for use
  * directly as a hypercall argument.
  */
-#define HYPERCALL_BUFFER_AS_ARG(_name)                                             \
-    ({  xc_hypercall_buffer_t _val1;                                               \
-        typeof(XC__HYPERCALL_BUFFER_NAME(_name)) *_val2 = HYPERCALL_BUFFER(_name); \
-        (void)(&_val1 == _val2);                                                   \
-        (unsigned long)(_val2)->hbuf;                                              \
+#define HYPERCALL_BUFFER_AS_ARG(_name)                          \
+    ({  xc_hypercall_buffer_t _hcbuf_arg1;                      \
+        typeof(XC__HYPERCALL_BUFFER_NAME(_name)) *_hcbuf_arg2 = \
+                HYPERCALL_BUFFER(_name);                        \
+        (void)(&_hcbuf_arg1 == _hcbuf_arg2);                    \
+        (unsigned long)(_hcbuf_arg2)->hbuf;                     \
      })
 
 /*
@@ -285,12 +288,13 @@ typedef struct xc_hypercall_buffer xc_hy
  * data pointer has been correctly allocated.
  */
 #undef set_xen_guest_handle
-#define set_xen_guest_handle(_hnd, _val)                                         \
-    do {                                                                         \
-        xc_hypercall_buffer_t _val1;                                             \
-        typeof(XC__HYPERCALL_BUFFER_NAME(_val)) *_val2 = HYPERCALL_BUFFER(_val); \
-        (void) (&_val1 == _val2);                                                 \
-        set_xen_guest_handle_raw(_hnd, (_val2)->hbuf);                           \
+#define set_xen_guest_handle(_hnd, _val)                        \
+    do {                                                        \
+        xc_hypercall_buffer_t _hcbuf_hnd1;                      \
+        typeof(XC__HYPERCALL_BUFFER_NAME(_val)) *_hcbuf_hnd2 =  \
+                HYPERCALL_BUFFER(_val);                         \
+        (void) (&_hcbuf_hnd1 == _hcbuf_hnd2);                   \
+        set_xen_guest_handle_raw(_hnd, (_hcbuf_hnd2)->hbuf);    \
     } while (0)
 
 /* Use with set_xen_guest_handle in place of NULL */
diff -r 98ca21138ce8 -r fa8c8c2373b6 tools/libxl/Makefile
--- a/tools/libxl/Makefile	Mon Sep 17 11:16:59 2012 +0100
+++ b/tools/libxl/Makefile	Mon Sep 17 11:17:00 2012 +0100
@@ -22,6 +22,12 @@ endif
 LIBXL_LIBS =
 LIBXL_LIBS = $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenstore) $(LDLIBS_libblktapctl) $(PTYFUNCS_LIBS) $(LIBUUID_LIBS)
 
+CFLAGS_LIBXL += $(CFLAGS_libxenctrl)
+CFLAGS_LIBXL += $(CFLAGS_libxenguest)
+CFLAGS_LIBXL += $(CFLAGS_libxenstore)
+CFLAGS_LIBXL += $(CFLAGS_libblktapctl) 
+CFLAGS_LIBXL += -Wshadow
+
 CFLAGS += $(PTHREAD_CFLAGS)
 LDFLAGS += $(PTHREAD_LDFLAGS)
 LIBXL_LIBS += $(PTHREAD_LIBS)
@@ -71,7 +77,7 @@ LIBXL_OBJS = flexarray.o libxl.o libxl_c
 			libxl_qmp.o libxl_event.o libxl_fork.o $(LIBXL_OBJS-y)
 LIBXL_OBJS += _libxl_types.o libxl_flask.o _libxl_types_internal.o
 
-$(LIBXL_OBJS): CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest) $(CFLAGS_libxenstore) $(CFLAGS_libblktapctl) -include $(XEN_ROOT)/tools/config.h
+$(LIBXL_OBJS): CFLAGS += $(CFLAGS_LIBXL) -include $(XEN_ROOT)/tools/config.h
 
 AUTOINCS= libxlu_cfg_y.h libxlu_cfg_l.h _libxl_list.h _paths.h \
 	_libxl_save_msgs_callout.h _libxl_save_msgs_helper.h
diff -r 98ca21138ce8 -r fa8c8c2373b6 tools/libxl/flexarray.c
--- a/tools/libxl/flexarray.c	Mon Sep 17 11:16:59 2012 +0100
+++ b/tools/libxl/flexarray.c	Mon Sep 17 11:17:00 2012 +0100
@@ -48,19 +48,19 @@ int flexarray_grow(flexarray_t *array, i
     return 0;
 }
 
-int flexarray_set(flexarray_t *array, unsigned int index, void *ptr)
+int flexarray_set(flexarray_t *array, unsigned int idx, void *ptr)
 {
-    if (index >= array->size) {
+    if (idx >= array->size) {
         int newsize;
         if (!array->autogrow)
             return 1;
-        newsize = (array->size * 2 < index) ? index + 1 : array->size * 2;
+        newsize = (array->size * 2 < idx) ? idx + 1 : array->size * 2;
         if (flexarray_grow(array, newsize - array->size))
             return 2;
     }
-    if ( index + 1 > array->count )
-        array->count = index + 1;
-    array->data[index] = ptr;
+    if ( idx + 1 > array->count )
+        array->count = idx + 1;
+    array->data[idx] = ptr;
     return 0;
 }
 
@@ -92,11 +92,11 @@ int flexarray_vappend(flexarray_t *array
     return ret;
 }
 
-int flexarray_get(flexarray_t *array, int index, void **ptr)
+int flexarray_get(flexarray_t *array, int idx, void **ptr)
 {
-    if (index >= array->size)
+    if (idx >= array->size)
         return 1;
-    *ptr = array->data[index];
+    *ptr = array->data[idx];
     return 0;
 }
 
diff -r 98ca21138ce8 -r fa8c8c2373b6 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Mon Sep 17 11:16:59 2012 +0100
+++ b/tools/libxl/libxl.c	Mon Sep 17 11:17:00 2012 +0100
@@ -665,7 +665,7 @@ out:
 libxl_vminfo * libxl_list_vm(libxl_ctx *ctx, int *nb_vm_out)
 {
     libxl_vminfo *ptr;
-    int index, i, ret;
+    int idx, i, ret;
     xc_domaininfo_t info[1024];
     int size = 1024;
 
@@ -678,15 +678,15 @@ libxl_vminfo * libxl_list_vm(libxl_ctx *
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "geting domain info list");
         return NULL;
     }
-    for (index = i = 0; i < ret; i++) {
+    for (idx = i = 0; i < ret; i++) {
         if (libxl_is_stubdom(ctx, info[i].domain, NULL))
             continue;
-        memcpy(&(ptr[index].uuid), info[i].handle, sizeof(xen_domain_handle_t));
-        ptr[index].domid = info[i].domain;
-
-        index++;
-    }
-    *nb_vm_out = index;
+        memcpy(&(ptr[idx].uuid), info[i].handle, sizeof(xen_domain_handle_t));
+        ptr[idx].domid = info[i].domain;
+
+        idx++;
+    }
+    *nb_vm_out = idx;
     return ptr;
 }
 
@@ -3354,7 +3354,7 @@ int libxl_set_memory_target(libxl_ctx *c
         int32_t target_memkb, int relative, int enforce)
 {
     GC_INIT(ctx);
-    int rc = 1, abort = 0;
+    int rc = 1, abort_transaction = 0;
     uint32_t memorykb = 0, videoram = 0;
     uint32_t current_target_memkb = 0, new_target_memkb = 0;
     char *memmax, *endptr, *videoram_s = NULL, *target = NULL;
@@ -3373,7 +3373,7 @@ retry_transaction:
         xs_transaction_end(ctx->xsh, t, 1);
         rc = libxl__fill_dom0_memory_info(gc, &current_target_memkb);
         if (rc < 0) {
-            abort = 1;
+            abort_transaction = 1;
             goto out;
         }
         goto retry_transaction;
@@ -3381,7 +3381,7 @@ retry_transaction:
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
                 "cannot get target memory info from %s/memory/target\n",
                 dompath);
-        abort = 1;
+        abort_transaction = 1;
         goto out;
     } else {
         current_target_memkb = strtoul(target, &endptr, 10);
@@ -3389,7 +3389,7 @@ retry_transaction:
             LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
                     "invalid memory target %s from %s/memory/target\n",
                     target, dompath);
-            abort = 1;
+            abort_transaction = 1;
             goto out;
         }
     }
@@ -3399,7 +3399,7 @@ retry_transaction:
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
                 "cannot get memory info from %s/memory/static-max\n",
                 dompath);
-        abort = 1;
+        abort_transaction = 1;
         goto out;
     }
     memorykb = strtoul(memmax, &endptr, 10);
@@ -3407,7 +3407,7 @@ retry_transaction:
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
                 "invalid max memory %s from %s/memory/static-max\n",
                 memmax, dompath);
-        abort = 1;
+        abort_transaction = 1;
         goto out;
     }
 
@@ -3422,7 +3422,7 @@ retry_transaction:
         LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
                 "memory_dynamic_max must be less than or equal to"
                 " memory_static_max\n");
-        abort = 1;
+        abort_transaction = 1;
         goto out;
     }
 
@@ -3430,7 +3430,7 @@ retry_transaction:
         LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
                 "new target %d for dom0 is below the minimum threshold\n",
                  new_target_memkb);
-        abort = 1;
+        abort_transaction = 1;
         goto out;
     }
     videoram_s = libxl__xs_read(gc, t, libxl__sprintf(gc,
@@ -3445,7 +3445,7 @@ retry_transaction:
             LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
                     "xc_domain_setmaxmem domid=%d memkb=%d failed "
                     "rc=%d\n", domid, memorykb + LIBXL_MAXMEM_CONSTANT, rc);
-            abort = 1;
+            abort_transaction = 1;
             goto out;
         }
     }
@@ -3458,7 +3458,7 @@ retry_transaction:
                 "xc_domain_set_pod_target domid=%d, memkb=%d "
                 "failed rc=%d\n", domid, new_target_memkb / 4,
                 rc);
-        abort = 1;
+        abort_transaction = 1;
         goto out;
     }
 
@@ -3466,7 +3466,7 @@ retry_transaction:
                 dompath), "%"PRIu32, new_target_memkb);
     rc = xc_domain_getinfolist(ctx->xch, domid, 1, &info);
     if (rc != 1 || info.domain != domid) {
-        abort = 1;
+        abort_transaction = 1;
         goto out;
     }
     xcinfo2xlinfo(&info, &ptr);
@@ -3475,7 +3475,8 @@ retry_transaction:
             "%"PRIu32, new_target_memkb / 1024);
 
 out:
-    if (!xs_transaction_end(ctx->xsh, t, abort) && !abort)
+    if (!xs_transaction_end(ctx->xsh, t, abort_transaction)
+        && !abort_transaction)
         if (errno == EAGAIN)
             goto retry_transaction;
 
diff -r 98ca21138ce8 -r fa8c8c2373b6 tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c	Mon Sep 17 11:16:59 2012 +0100
+++ b/tools/libxl/libxl_dm.c	Mon Sep 17 11:17:00 2012 +0100
@@ -366,7 +366,7 @@ static char ** libxl__build_device_model
     }
     if (vnc) {
         int display = 0;
-        const char *listen = "127.0.0.1";
+        const char *addr = "127.0.0.1";
         char *vncarg = NULL;
 
         flexarray_append(dm_args, "-vnc");
@@ -374,16 +374,16 @@ static char ** libxl__build_device_model
         if (vnc->display) {
             display = vnc->display;
             if (vnc->listen && strchr(vnc->listen, ':') == NULL) {
-                listen = vnc->listen;
+                addr = vnc->listen;
             }
         } else if (vnc->listen) {
-            listen = vnc->listen;
+            addr = vnc->listen;
         }
 
-        if (strchr(listen, ':') != NULL)
-            vncarg = libxl__sprintf(gc, "%s", listen);
+        if (strchr(addr, ':') != NULL)
+            vncarg = libxl__sprintf(gc, "%s", addr);
         else
-            vncarg = libxl__sprintf(gc, "%s:%d", listen, display);
+            vncarg = libxl__sprintf(gc, "%s:%d", addr, display);
         if (vnc->passwd && vnc->passwd[0]) {
             vncarg = libxl__sprintf(gc, "%s,password", vncarg);
         }
diff -r 98ca21138ce8 -r fa8c8c2373b6 tools/libxl/libxl_event.c
--- a/tools/libxl/libxl_event.c	Mon Sep 17 11:16:59 2012 +0100
+++ b/tools/libxl/libxl_event.c	Mon Sep 17 11:17:00 2012 +0100
@@ -167,15 +167,15 @@ static void time_insert_finite(libxl__gc
 }
 
 static int time_register_finite(libxl__gc *gc, libxl__ev_time *ev,
-                                struct timeval abs)
+                                struct timeval absolute)
 {
     int rc;
 
-    rc = OSEVENT_HOOK(timeout_register, &ev->for_app_reg, abs, ev);
+    rc = OSEVENT_HOOK(timeout_register, &ev->for_app_reg, absolute, ev);
     if (rc) return rc;
 
     ev->infinite = 0;
-    ev->abs = abs;
+    ev->abs = absolute;
     time_insert_finite(gc, ev);
 
     return 0;
@@ -202,16 +202,16 @@ static void time_done_debug(libxl__gc *g
 
 int libxl__ev_time_register_abs(libxl__gc *gc, libxl__ev_time *ev,
                                 libxl__ev_time_callback *func,
-                                struct timeval abs)
+                                struct timeval absolute)
 {
     int rc;
 
     CTX_LOCK;
 
     DBG("ev_time=%p register abs=%lu.%06lu",
-        ev, (unsigned long)abs.tv_sec, (unsigned long)abs.tv_usec);
+        ev, (unsigned long)absolute.tv_sec, (unsigned long)absolute.tv_usec);
 
-    rc = time_register_finite(gc, ev, abs);
+    rc = time_register_finite(gc, ev, absolute);
     if (rc) goto out;
 
     ev->func = func;
@@ -228,7 +228,7 @@ int libxl__ev_time_register_rel(libxl__g
                                 libxl__ev_time_callback *func,
                                 int milliseconds /* as for poll(2) */)
 {
-    struct timeval abs;
+    struct timeval absolute;
     int rc;
 
     CTX_LOCK;
@@ -238,10 +238,10 @@ int libxl__ev_time_register_rel(libxl__g
     if (milliseconds < 0) {
         ev->infinite = 1;
     } else {
-        rc = time_rel_to_abs(gc, milliseconds, &abs);
+        rc = time_rel_to_abs(gc, milliseconds, &absolute);
         if (rc) goto out;
 
-        rc = time_register_finite(gc, ev, abs);
+        rc = time_register_finite(gc, ev, absolute);
         if (rc) goto out;
     }
 
@@ -255,26 +255,26 @@ int libxl__ev_time_register_rel(libxl__g
 }
 
 int libxl__ev_time_modify_abs(libxl__gc *gc, libxl__ev_time *ev,
-                              struct timeval abs)
+                              struct timeval absolute)
 {
     int rc;
 
     CTX_LOCK;
 
     DBG("ev_time=%p modify abs==%lu.%06lu",
-        ev, (unsigned long)abs.tv_sec, (unsigned long)abs.tv_usec);
+        ev, (unsigned long)absolute.tv_sec, (unsigned long)absolute.tv_usec);
 
     assert(libxl__ev_time_isregistered(ev));
 
     if (ev->infinite) {
-        rc = time_register_finite(gc, ev, abs);
+        rc = time_register_finite(gc, ev, absolute);
         if (rc) goto out;
     } else {
-        rc = OSEVENT_HOOK(timeout_modify, &ev->for_app_reg, abs);
+        rc = OSEVENT_HOOK(timeout_modify, &ev->for_app_reg, absolute);
         if (rc) goto out;
 
         LIBXL_TAILQ_REMOVE(&CTX->etimes, ev, entry);
-        ev->abs = abs;
+        ev->abs = absolute;
         time_insert_finite(gc, ev);
     }
 
@@ -288,7 +288,7 @@ int libxl__ev_time_modify_abs(libxl__gc 
 int libxl__ev_time_modify_rel(libxl__gc *gc, libxl__ev_time *ev,
                               int milliseconds)
 {
-    struct timeval abs;
+    struct timeval absolute;
     int rc;
 
     CTX_LOCK;
@@ -304,10 +304,10 @@ int libxl__ev_time_modify_rel(libxl__gc 
         goto out;
     }
 
-    rc = time_rel_to_abs(gc, milliseconds, &abs);
+    rc = time_rel_to_abs(gc, milliseconds, &absolute);
     if (rc) goto out;
 
-    rc = libxl__ev_time_modify_abs(gc, ev, abs);
+    rc = libxl__ev_time_modify_abs(gc, ev, absolute);
     if (rc) goto out;
 
     rc = 0;
diff -r 98ca21138ce8 -r fa8c8c2373b6 tools/libxl/libxl_exec.c
--- a/tools/libxl/libxl_exec.c	Mon Sep 17 11:16:59 2012 +0100
+++ b/tools/libxl/libxl_exec.c	Mon Sep 17 11:17:00 2012 +0100
@@ -35,7 +35,7 @@ static void check_open_fds(const char *w
 #ifdef __linux__
         size_t len;
         char path[PATH_MAX];
-        char link[PATH_MAX+1];
+        char linkpath[PATH_MAX+1];
 #endif
         flags = fcntl(i, F_GETFD);
         if ( flags == -1 ) {
@@ -52,11 +52,11 @@ static void check_open_fds(const char *w
 
 #ifdef __linux__
         snprintf(path, PATH_MAX, "/proc/%d/fd/%d", getpid(), i);
-        len = readlink(path, link, PATH_MAX);
+        len = readlink(path, linkpath, PATH_MAX);
         if (len > 0) {
-            link[len] = '\0';
+            linkpath[len] = '\0';
             fprintf(stderr, "libxl: execing %s: fd %d is open to %s with flags %#x\n",
-                    what, i, link, flags);
+                    what, i, linkpath, flags);
         } else
 #endif
             fprintf(stderr, "libxl: execing %s: fd %d is open with flags %#x\n",
diff -r 98ca21138ce8 -r fa8c8c2373b6 tools/libxl/libxl_json.c
--- a/tools/libxl/libxl_json.c	Mon Sep 17 11:16:59 2012 +0100
+++ b/tools/libxl/libxl_json.c	Mon Sep 17 11:17:00 2012 +0100
@@ -275,7 +275,7 @@ static int json_object_append_to(libxl__
 
 void libxl__json_object_free(libxl__gc *gc, libxl__json_object *obj)
 {
-    int index = 0;
+    int idx = 0;
 
     if (obj == NULL)
         return;
@@ -287,8 +287,8 @@ void libxl__json_object_free(libxl__gc *
     case JSON_MAP: {
         libxl__json_map_node *node = NULL;
 
-        for (index = 0; index < obj->u.map->count; index++) {
-            if (flexarray_get(obj->u.map, index, (void**)&node) != 0)
+        for (idx = 0; idx < obj->u.map->count; idx++) {
+            if (flexarray_get(obj->u.map, idx, (void**)&node) != 0)
                 break;
             libxl__json_object_free(gc, node->obj);
             free(node->map_key);
@@ -302,8 +302,8 @@ void libxl__json_object_free(libxl__gc *
         libxl__json_object *node = NULL;
         break;
 
-        for (index = 0; index < obj->u.array->count; index++) {
-            if (flexarray_get(obj->u.array, index, (void**)&node) != 0)
+        for (idx = 0; idx < obj->u.array->count; idx++) {
+            if (flexarray_get(obj->u.array, idx, (void**)&node) != 0)
                 break;
             libxl__json_object_free(gc, node);
             node = NULL;
@@ -359,14 +359,14 @@ const libxl__json_object *libxl__json_ma
                                           libxl__json_node_type expected_type)
 {
     flexarray_t *maps = NULL;
-    int index = 0;
+    int idx = 0;
 
     if (libxl__json_object_is_map(o)) {
         libxl__json_map_node *node = NULL;
 
         maps = o->u.map;
-        for (index = 0; index < maps->count; index++) {
-            if (flexarray_get(maps, index, (void**)&node) != 0)
+        for (idx = 0; idx < maps->count; idx++) {
+            if (flexarray_get(maps, idx, (void**)&node) != 0)
                 return NULL;
             if (strcmp(key, node->map_key) == 0) {
                 if (expected_type == JSON_ANY
diff -r 98ca21138ce8 -r fa8c8c2373b6 tools/libxl/libxl_pci.c
--- a/tools/libxl/libxl_pci.c	Mon Sep 17 11:16:59 2012 +0100
+++ b/tools/libxl/libxl_pci.c	Mon Sep 17 11:17:00 2012 +0100
@@ -167,7 +167,6 @@ static int libxl__device_pci_remove_xens
     char *be_path, *num_devs_path, *num_devs, *xsdev, *tmp, *tmppath;
     int num, i, j;
     xs_transaction_t t;
-    unsigned int domain = 0, bus = 0, dev = 0, func = 0;
 
     be_path = libxl__sprintf(gc, "%s/backend/pci/%d/0", libxl__xs_get_dompath(gc, 0), domid);
     num_devs_path = libxl__sprintf(gc, "%s/num_devs", be_path);
@@ -188,6 +187,7 @@ static int libxl__device_pci_remove_xens
     }
 
     for (i = 0; i < num; i++) {
+        unsigned int domain = 0, bus = 0, dev = 0, func = 0;
         xsdev = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/dev-%d", be_path, i));
         sscanf(xsdev, PCI_BDF, &domain, &bus, &dev, &func);
         if (domain == pcidev->domain && bus == pcidev->bus &&
diff -r 98ca21138ce8 -r fa8c8c2373b6 tools/libxl/libxl_qmp.c
--- a/tools/libxl/libxl_qmp.c	Mon Sep 17 11:16:59 2012 +0100
+++ b/tools/libxl/libxl_qmp.c	Mon Sep 17 11:17:00 2012 +0100
@@ -171,7 +171,7 @@ static int qmp_register_vnc_callback(lib
 {
     GC_INIT(qmp->ctx);
     const libxl__json_object *obj;
-    const char *listen, *port;
+    const char *addr, *port;
     int rc = -1;
 
     if (!libxl__json_object_is_map(o)) {
@@ -184,17 +184,17 @@ static int qmp_register_vnc_callback(lib
     }
 
     obj = libxl__json_map_get("host", o, JSON_STRING);
-    listen = libxl__json_object_get_string(obj);
+    addr = libxl__json_object_get_string(obj);
     obj = libxl__json_map_get("service", o, JSON_STRING);
     port = libxl__json_object_get_string(obj);
 
-    if (!listen || !port) {
+    if (!addr || !port) {
         LIBXL__LOG(qmp->ctx, LIBXL__LOG_ERROR,
                    "Failed to retreive VNC connect information.");
         goto out;
     }
 
-    rc = qmp_write_domain_console_item(gc, qmp->domid, "vnc-listen", listen);
+    rc = qmp_write_domain_console_item(gc, qmp->domid, "vnc-listen", addr);
     if (!rc)
         rc = qmp_write_domain_console_item(gc, qmp->domid, "vnc-port", port);
 

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

From xen-changelog-bounces@lists.xen.org Mon Sep 17 21:55:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Sep 2012 21: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.xen.org>)
	id 1TDjHh-00013R-Vk; Mon, 17 Sep 2012 21:55:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDjHf-00012k-Q5
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:16 +0000
Received: from [85.158.143.99:18532] by server-1.bemta-4.messagelabs.com id
	07/90-12504-34C97505; Mon, 17 Sep 2012 21:55:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-216.messagelabs.com!1347918912!30718929!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2053 invoked from network); 17 Sep 2012 21:55:13 -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;
	17 Sep 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 1TDjHc-0003qX-2J
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDjHb-000100-T0
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:11 +0000
Message-Id: <E1TDjHb-000100-T0@xenbits.xen.org>
Date: Mon, 17 Sep 2012 21:55:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: Enable -Wshadow.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <Ian.Campbell@citrix.com>
# Date 1347877020 -3600
# Node ID fa8c8c2373b679542aa4179492296cd982e28b7d
# Parent  98ca21138ce8f60a1a862860f9d6a709a5235a0f
libxl: Enable -Wshadow.

It was convenient to invent $(CFLAGS_LIBXL) to do this.

Various renamings to avoid shadowing standard functions:
  - index(3)
  - listen(2)
  - link(2)
  - abort(3)
  - abs(3)

Reduced the scope of some variables to avoid conflicts.

Change to libxc is due to the nested hypercall buf macros in
set_xen_guest_handle (used in libxl) using the same local private vars.

Build tested only.

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


diff -r 98ca21138ce8 -r fa8c8c2373b6 tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h	Mon Sep 17 11:16:59 2012 +0100
+++ b/tools/libxc/xenctrl.h	Mon Sep 17 11:17:00 2012 +0100
@@ -235,11 +235,13 @@ typedef struct xc_hypercall_buffer xc_hy
 /*
  * Returns the hypercall_buffer associated with a variable.
  */
-#define HYPERCALL_BUFFER(_name)                                                              \
-    ({  xc_hypercall_buffer_t _val1;                                                         \
-        typeof(XC__HYPERCALL_BUFFER_NAME(_name)) *_val2 = &XC__HYPERCALL_BUFFER_NAME(_name); \
-        (void)(&_val1 == _val2);                                                             \
-        (_val2)->param_shadow ? (_val2)->param_shadow : (_val2);                             \
+#define HYPERCALL_BUFFER(_name)                                 \
+    ({  xc_hypercall_buffer_t _hcbuf_buf1;                      \
+        typeof(XC__HYPERCALL_BUFFER_NAME(_name)) *_hcbuf_buf2 = \
+                &XC__HYPERCALL_BUFFER_NAME(_name);              \
+        (void)(&_hcbuf_buf1 == _hcbuf_buf2);                    \
+        (_hcbuf_buf2)->param_shadow ?                           \
+                (_hcbuf_buf2)->param_shadow : (_hcbuf_buf2);    \
      })
 
 #define HYPERCALL_BUFFER_INIT_NO_BOUNCE .dir = 0, .sz = 0, .ubuf = (void *)-1
@@ -273,11 +275,12 @@ typedef struct xc_hypercall_buffer xc_hy
  * Get the hypercall buffer data pointer in a form suitable for use
  * directly as a hypercall argument.
  */
-#define HYPERCALL_BUFFER_AS_ARG(_name)                                             \
-    ({  xc_hypercall_buffer_t _val1;                                               \
-        typeof(XC__HYPERCALL_BUFFER_NAME(_name)) *_val2 = HYPERCALL_BUFFER(_name); \
-        (void)(&_val1 == _val2);                                                   \
-        (unsigned long)(_val2)->hbuf;                                              \
+#define HYPERCALL_BUFFER_AS_ARG(_name)                          \
+    ({  xc_hypercall_buffer_t _hcbuf_arg1;                      \
+        typeof(XC__HYPERCALL_BUFFER_NAME(_name)) *_hcbuf_arg2 = \
+                HYPERCALL_BUFFER(_name);                        \
+        (void)(&_hcbuf_arg1 == _hcbuf_arg2);                    \
+        (unsigned long)(_hcbuf_arg2)->hbuf;                     \
      })
 
 /*
@@ -285,12 +288,13 @@ typedef struct xc_hypercall_buffer xc_hy
  * data pointer has been correctly allocated.
  */
 #undef set_xen_guest_handle
-#define set_xen_guest_handle(_hnd, _val)                                         \
-    do {                                                                         \
-        xc_hypercall_buffer_t _val1;                                             \
-        typeof(XC__HYPERCALL_BUFFER_NAME(_val)) *_val2 = HYPERCALL_BUFFER(_val); \
-        (void) (&_val1 == _val2);                                                 \
-        set_xen_guest_handle_raw(_hnd, (_val2)->hbuf);                           \
+#define set_xen_guest_handle(_hnd, _val)                        \
+    do {                                                        \
+        xc_hypercall_buffer_t _hcbuf_hnd1;                      \
+        typeof(XC__HYPERCALL_BUFFER_NAME(_val)) *_hcbuf_hnd2 =  \
+                HYPERCALL_BUFFER(_val);                         \
+        (void) (&_hcbuf_hnd1 == _hcbuf_hnd2);                   \
+        set_xen_guest_handle_raw(_hnd, (_hcbuf_hnd2)->hbuf);    \
     } while (0)
 
 /* Use with set_xen_guest_handle in place of NULL */
diff -r 98ca21138ce8 -r fa8c8c2373b6 tools/libxl/Makefile
--- a/tools/libxl/Makefile	Mon Sep 17 11:16:59 2012 +0100
+++ b/tools/libxl/Makefile	Mon Sep 17 11:17:00 2012 +0100
@@ -22,6 +22,12 @@ endif
 LIBXL_LIBS =
 LIBXL_LIBS = $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenstore) $(LDLIBS_libblktapctl) $(PTYFUNCS_LIBS) $(LIBUUID_LIBS)
 
+CFLAGS_LIBXL += $(CFLAGS_libxenctrl)
+CFLAGS_LIBXL += $(CFLAGS_libxenguest)
+CFLAGS_LIBXL += $(CFLAGS_libxenstore)
+CFLAGS_LIBXL += $(CFLAGS_libblktapctl) 
+CFLAGS_LIBXL += -Wshadow
+
 CFLAGS += $(PTHREAD_CFLAGS)
 LDFLAGS += $(PTHREAD_LDFLAGS)
 LIBXL_LIBS += $(PTHREAD_LIBS)
@@ -71,7 +77,7 @@ LIBXL_OBJS = flexarray.o libxl.o libxl_c
 			libxl_qmp.o libxl_event.o libxl_fork.o $(LIBXL_OBJS-y)
 LIBXL_OBJS += _libxl_types.o libxl_flask.o _libxl_types_internal.o
 
-$(LIBXL_OBJS): CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest) $(CFLAGS_libxenstore) $(CFLAGS_libblktapctl) -include $(XEN_ROOT)/tools/config.h
+$(LIBXL_OBJS): CFLAGS += $(CFLAGS_LIBXL) -include $(XEN_ROOT)/tools/config.h
 
 AUTOINCS= libxlu_cfg_y.h libxlu_cfg_l.h _libxl_list.h _paths.h \
 	_libxl_save_msgs_callout.h _libxl_save_msgs_helper.h
diff -r 98ca21138ce8 -r fa8c8c2373b6 tools/libxl/flexarray.c
--- a/tools/libxl/flexarray.c	Mon Sep 17 11:16:59 2012 +0100
+++ b/tools/libxl/flexarray.c	Mon Sep 17 11:17:00 2012 +0100
@@ -48,19 +48,19 @@ int flexarray_grow(flexarray_t *array, i
     return 0;
 }
 
-int flexarray_set(flexarray_t *array, unsigned int index, void *ptr)
+int flexarray_set(flexarray_t *array, unsigned int idx, void *ptr)
 {
-    if (index >= array->size) {
+    if (idx >= array->size) {
         int newsize;
         if (!array->autogrow)
             return 1;
-        newsize = (array->size * 2 < index) ? index + 1 : array->size * 2;
+        newsize = (array->size * 2 < idx) ? idx + 1 : array->size * 2;
         if (flexarray_grow(array, newsize - array->size))
             return 2;
     }
-    if ( index + 1 > array->count )
-        array->count = index + 1;
-    array->data[index] = ptr;
+    if ( idx + 1 > array->count )
+        array->count = idx + 1;
+    array->data[idx] = ptr;
     return 0;
 }
 
@@ -92,11 +92,11 @@ int flexarray_vappend(flexarray_t *array
     return ret;
 }
 
-int flexarray_get(flexarray_t *array, int index, void **ptr)
+int flexarray_get(flexarray_t *array, int idx, void **ptr)
 {
-    if (index >= array->size)
+    if (idx >= array->size)
         return 1;
-    *ptr = array->data[index];
+    *ptr = array->data[idx];
     return 0;
 }
 
diff -r 98ca21138ce8 -r fa8c8c2373b6 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Mon Sep 17 11:16:59 2012 +0100
+++ b/tools/libxl/libxl.c	Mon Sep 17 11:17:00 2012 +0100
@@ -665,7 +665,7 @@ out:
 libxl_vminfo * libxl_list_vm(libxl_ctx *ctx, int *nb_vm_out)
 {
     libxl_vminfo *ptr;
-    int index, i, ret;
+    int idx, i, ret;
     xc_domaininfo_t info[1024];
     int size = 1024;
 
@@ -678,15 +678,15 @@ libxl_vminfo * libxl_list_vm(libxl_ctx *
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "geting domain info list");
         return NULL;
     }
-    for (index = i = 0; i < ret; i++) {
+    for (idx = i = 0; i < ret; i++) {
         if (libxl_is_stubdom(ctx, info[i].domain, NULL))
             continue;
-        memcpy(&(ptr[index].uuid), info[i].handle, sizeof(xen_domain_handle_t));
-        ptr[index].domid = info[i].domain;
-
-        index++;
-    }
-    *nb_vm_out = index;
+        memcpy(&(ptr[idx].uuid), info[i].handle, sizeof(xen_domain_handle_t));
+        ptr[idx].domid = info[i].domain;
+
+        idx++;
+    }
+    *nb_vm_out = idx;
     return ptr;
 }
 
@@ -3354,7 +3354,7 @@ int libxl_set_memory_target(libxl_ctx *c
         int32_t target_memkb, int relative, int enforce)
 {
     GC_INIT(ctx);
-    int rc = 1, abort = 0;
+    int rc = 1, abort_transaction = 0;
     uint32_t memorykb = 0, videoram = 0;
     uint32_t current_target_memkb = 0, new_target_memkb = 0;
     char *memmax, *endptr, *videoram_s = NULL, *target = NULL;
@@ -3373,7 +3373,7 @@ retry_transaction:
         xs_transaction_end(ctx->xsh, t, 1);
         rc = libxl__fill_dom0_memory_info(gc, &current_target_memkb);
         if (rc < 0) {
-            abort = 1;
+            abort_transaction = 1;
             goto out;
         }
         goto retry_transaction;
@@ -3381,7 +3381,7 @@ retry_transaction:
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
                 "cannot get target memory info from %s/memory/target\n",
                 dompath);
-        abort = 1;
+        abort_transaction = 1;
         goto out;
     } else {
         current_target_memkb = strtoul(target, &endptr, 10);
@@ -3389,7 +3389,7 @@ retry_transaction:
             LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
                     "invalid memory target %s from %s/memory/target\n",
                     target, dompath);
-            abort = 1;
+            abort_transaction = 1;
             goto out;
         }
     }
@@ -3399,7 +3399,7 @@ retry_transaction:
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
                 "cannot get memory info from %s/memory/static-max\n",
                 dompath);
-        abort = 1;
+        abort_transaction = 1;
         goto out;
     }
     memorykb = strtoul(memmax, &endptr, 10);
@@ -3407,7 +3407,7 @@ retry_transaction:
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
                 "invalid max memory %s from %s/memory/static-max\n",
                 memmax, dompath);
-        abort = 1;
+        abort_transaction = 1;
         goto out;
     }
 
@@ -3422,7 +3422,7 @@ retry_transaction:
         LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
                 "memory_dynamic_max must be less than or equal to"
                 " memory_static_max\n");
-        abort = 1;
+        abort_transaction = 1;
         goto out;
     }
 
@@ -3430,7 +3430,7 @@ retry_transaction:
         LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
                 "new target %d for dom0 is below the minimum threshold\n",
                  new_target_memkb);
-        abort = 1;
+        abort_transaction = 1;
         goto out;
     }
     videoram_s = libxl__xs_read(gc, t, libxl__sprintf(gc,
@@ -3445,7 +3445,7 @@ retry_transaction:
             LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
                     "xc_domain_setmaxmem domid=%d memkb=%d failed "
                     "rc=%d\n", domid, memorykb + LIBXL_MAXMEM_CONSTANT, rc);
-            abort = 1;
+            abort_transaction = 1;
             goto out;
         }
     }
@@ -3458,7 +3458,7 @@ retry_transaction:
                 "xc_domain_set_pod_target domid=%d, memkb=%d "
                 "failed rc=%d\n", domid, new_target_memkb / 4,
                 rc);
-        abort = 1;
+        abort_transaction = 1;
         goto out;
     }
 
@@ -3466,7 +3466,7 @@ retry_transaction:
                 dompath), "%"PRIu32, new_target_memkb);
     rc = xc_domain_getinfolist(ctx->xch, domid, 1, &info);
     if (rc != 1 || info.domain != domid) {
-        abort = 1;
+        abort_transaction = 1;
         goto out;
     }
     xcinfo2xlinfo(&info, &ptr);
@@ -3475,7 +3475,8 @@ retry_transaction:
             "%"PRIu32, new_target_memkb / 1024);
 
 out:
-    if (!xs_transaction_end(ctx->xsh, t, abort) && !abort)
+    if (!xs_transaction_end(ctx->xsh, t, abort_transaction)
+        && !abort_transaction)
         if (errno == EAGAIN)
             goto retry_transaction;
 
diff -r 98ca21138ce8 -r fa8c8c2373b6 tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c	Mon Sep 17 11:16:59 2012 +0100
+++ b/tools/libxl/libxl_dm.c	Mon Sep 17 11:17:00 2012 +0100
@@ -366,7 +366,7 @@ static char ** libxl__build_device_model
     }
     if (vnc) {
         int display = 0;
-        const char *listen = "127.0.0.1";
+        const char *addr = "127.0.0.1";
         char *vncarg = NULL;
 
         flexarray_append(dm_args, "-vnc");
@@ -374,16 +374,16 @@ static char ** libxl__build_device_model
         if (vnc->display) {
             display = vnc->display;
             if (vnc->listen && strchr(vnc->listen, ':') == NULL) {
-                listen = vnc->listen;
+                addr = vnc->listen;
             }
         } else if (vnc->listen) {
-            listen = vnc->listen;
+            addr = vnc->listen;
         }
 
-        if (strchr(listen, ':') != NULL)
-            vncarg = libxl__sprintf(gc, "%s", listen);
+        if (strchr(addr, ':') != NULL)
+            vncarg = libxl__sprintf(gc, "%s", addr);
         else
-            vncarg = libxl__sprintf(gc, "%s:%d", listen, display);
+            vncarg = libxl__sprintf(gc, "%s:%d", addr, display);
         if (vnc->passwd && vnc->passwd[0]) {
             vncarg = libxl__sprintf(gc, "%s,password", vncarg);
         }
diff -r 98ca21138ce8 -r fa8c8c2373b6 tools/libxl/libxl_event.c
--- a/tools/libxl/libxl_event.c	Mon Sep 17 11:16:59 2012 +0100
+++ b/tools/libxl/libxl_event.c	Mon Sep 17 11:17:00 2012 +0100
@@ -167,15 +167,15 @@ static void time_insert_finite(libxl__gc
 }
 
 static int time_register_finite(libxl__gc *gc, libxl__ev_time *ev,
-                                struct timeval abs)
+                                struct timeval absolute)
 {
     int rc;
 
-    rc = OSEVENT_HOOK(timeout_register, &ev->for_app_reg, abs, ev);
+    rc = OSEVENT_HOOK(timeout_register, &ev->for_app_reg, absolute, ev);
     if (rc) return rc;
 
     ev->infinite = 0;
-    ev->abs = abs;
+    ev->abs = absolute;
     time_insert_finite(gc, ev);
 
     return 0;
@@ -202,16 +202,16 @@ static void time_done_debug(libxl__gc *g
 
 int libxl__ev_time_register_abs(libxl__gc *gc, libxl__ev_time *ev,
                                 libxl__ev_time_callback *func,
-                                struct timeval abs)
+                                struct timeval absolute)
 {
     int rc;
 
     CTX_LOCK;
 
     DBG("ev_time=%p register abs=%lu.%06lu",
-        ev, (unsigned long)abs.tv_sec, (unsigned long)abs.tv_usec);
+        ev, (unsigned long)absolute.tv_sec, (unsigned long)absolute.tv_usec);
 
-    rc = time_register_finite(gc, ev, abs);
+    rc = time_register_finite(gc, ev, absolute);
     if (rc) goto out;
 
     ev->func = func;
@@ -228,7 +228,7 @@ int libxl__ev_time_register_rel(libxl__g
                                 libxl__ev_time_callback *func,
                                 int milliseconds /* as for poll(2) */)
 {
-    struct timeval abs;
+    struct timeval absolute;
     int rc;
 
     CTX_LOCK;
@@ -238,10 +238,10 @@ int libxl__ev_time_register_rel(libxl__g
     if (milliseconds < 0) {
         ev->infinite = 1;
     } else {
-        rc = time_rel_to_abs(gc, milliseconds, &abs);
+        rc = time_rel_to_abs(gc, milliseconds, &absolute);
         if (rc) goto out;
 
-        rc = time_register_finite(gc, ev, abs);
+        rc = time_register_finite(gc, ev, absolute);
         if (rc) goto out;
     }
 
@@ -255,26 +255,26 @@ int libxl__ev_time_register_rel(libxl__g
 }
 
 int libxl__ev_time_modify_abs(libxl__gc *gc, libxl__ev_time *ev,
-                              struct timeval abs)
+                              struct timeval absolute)
 {
     int rc;
 
     CTX_LOCK;
 
     DBG("ev_time=%p modify abs==%lu.%06lu",
-        ev, (unsigned long)abs.tv_sec, (unsigned long)abs.tv_usec);
+        ev, (unsigned long)absolute.tv_sec, (unsigned long)absolute.tv_usec);
 
     assert(libxl__ev_time_isregistered(ev));
 
     if (ev->infinite) {
-        rc = time_register_finite(gc, ev, abs);
+        rc = time_register_finite(gc, ev, absolute);
         if (rc) goto out;
     } else {
-        rc = OSEVENT_HOOK(timeout_modify, &ev->for_app_reg, abs);
+        rc = OSEVENT_HOOK(timeout_modify, &ev->for_app_reg, absolute);
         if (rc) goto out;
 
         LIBXL_TAILQ_REMOVE(&CTX->etimes, ev, entry);
-        ev->abs = abs;
+        ev->abs = absolute;
         time_insert_finite(gc, ev);
     }
 
@@ -288,7 +288,7 @@ int libxl__ev_time_modify_abs(libxl__gc 
 int libxl__ev_time_modify_rel(libxl__gc *gc, libxl__ev_time *ev,
                               int milliseconds)
 {
-    struct timeval abs;
+    struct timeval absolute;
     int rc;
 
     CTX_LOCK;
@@ -304,10 +304,10 @@ int libxl__ev_time_modify_rel(libxl__gc 
         goto out;
     }
 
-    rc = time_rel_to_abs(gc, milliseconds, &abs);
+    rc = time_rel_to_abs(gc, milliseconds, &absolute);
     if (rc) goto out;
 
-    rc = libxl__ev_time_modify_abs(gc, ev, abs);
+    rc = libxl__ev_time_modify_abs(gc, ev, absolute);
     if (rc) goto out;
 
     rc = 0;
diff -r 98ca21138ce8 -r fa8c8c2373b6 tools/libxl/libxl_exec.c
--- a/tools/libxl/libxl_exec.c	Mon Sep 17 11:16:59 2012 +0100
+++ b/tools/libxl/libxl_exec.c	Mon Sep 17 11:17:00 2012 +0100
@@ -35,7 +35,7 @@ static void check_open_fds(const char *w
 #ifdef __linux__
         size_t len;
         char path[PATH_MAX];
-        char link[PATH_MAX+1];
+        char linkpath[PATH_MAX+1];
 #endif
         flags = fcntl(i, F_GETFD);
         if ( flags == -1 ) {
@@ -52,11 +52,11 @@ static void check_open_fds(const char *w
 
 #ifdef __linux__
         snprintf(path, PATH_MAX, "/proc/%d/fd/%d", getpid(), i);
-        len = readlink(path, link, PATH_MAX);
+        len = readlink(path, linkpath, PATH_MAX);
         if (len > 0) {
-            link[len] = '\0';
+            linkpath[len] = '\0';
             fprintf(stderr, "libxl: execing %s: fd %d is open to %s with flags %#x\n",
-                    what, i, link, flags);
+                    what, i, linkpath, flags);
         } else
 #endif
             fprintf(stderr, "libxl: execing %s: fd %d is open with flags %#x\n",
diff -r 98ca21138ce8 -r fa8c8c2373b6 tools/libxl/libxl_json.c
--- a/tools/libxl/libxl_json.c	Mon Sep 17 11:16:59 2012 +0100
+++ b/tools/libxl/libxl_json.c	Mon Sep 17 11:17:00 2012 +0100
@@ -275,7 +275,7 @@ static int json_object_append_to(libxl__
 
 void libxl__json_object_free(libxl__gc *gc, libxl__json_object *obj)
 {
-    int index = 0;
+    int idx = 0;
 
     if (obj == NULL)
         return;
@@ -287,8 +287,8 @@ void libxl__json_object_free(libxl__gc *
     case JSON_MAP: {
         libxl__json_map_node *node = NULL;
 
-        for (index = 0; index < obj->u.map->count; index++) {
-            if (flexarray_get(obj->u.map, index, (void**)&node) != 0)
+        for (idx = 0; idx < obj->u.map->count; idx++) {
+            if (flexarray_get(obj->u.map, idx, (void**)&node) != 0)
                 break;
             libxl__json_object_free(gc, node->obj);
             free(node->map_key);
@@ -302,8 +302,8 @@ void libxl__json_object_free(libxl__gc *
         libxl__json_object *node = NULL;
         break;
 
-        for (index = 0; index < obj->u.array->count; index++) {
-            if (flexarray_get(obj->u.array, index, (void**)&node) != 0)
+        for (idx = 0; idx < obj->u.array->count; idx++) {
+            if (flexarray_get(obj->u.array, idx, (void**)&node) != 0)
                 break;
             libxl__json_object_free(gc, node);
             node = NULL;
@@ -359,14 +359,14 @@ const libxl__json_object *libxl__json_ma
                                           libxl__json_node_type expected_type)
 {
     flexarray_t *maps = NULL;
-    int index = 0;
+    int idx = 0;
 
     if (libxl__json_object_is_map(o)) {
         libxl__json_map_node *node = NULL;
 
         maps = o->u.map;
-        for (index = 0; index < maps->count; index++) {
-            if (flexarray_get(maps, index, (void**)&node) != 0)
+        for (idx = 0; idx < maps->count; idx++) {
+            if (flexarray_get(maps, idx, (void**)&node) != 0)
                 return NULL;
             if (strcmp(key, node->map_key) == 0) {
                 if (expected_type == JSON_ANY
diff -r 98ca21138ce8 -r fa8c8c2373b6 tools/libxl/libxl_pci.c
--- a/tools/libxl/libxl_pci.c	Mon Sep 17 11:16:59 2012 +0100
+++ b/tools/libxl/libxl_pci.c	Mon Sep 17 11:17:00 2012 +0100
@@ -167,7 +167,6 @@ static int libxl__device_pci_remove_xens
     char *be_path, *num_devs_path, *num_devs, *xsdev, *tmp, *tmppath;
     int num, i, j;
     xs_transaction_t t;
-    unsigned int domain = 0, bus = 0, dev = 0, func = 0;
 
     be_path = libxl__sprintf(gc, "%s/backend/pci/%d/0", libxl__xs_get_dompath(gc, 0), domid);
     num_devs_path = libxl__sprintf(gc, "%s/num_devs", be_path);
@@ -188,6 +187,7 @@ static int libxl__device_pci_remove_xens
     }
 
     for (i = 0; i < num; i++) {
+        unsigned int domain = 0, bus = 0, dev = 0, func = 0;
         xsdev = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/dev-%d", be_path, i));
         sscanf(xsdev, PCI_BDF, &domain, &bus, &dev, &func);
         if (domain == pcidev->domain && bus == pcidev->bus &&
diff -r 98ca21138ce8 -r fa8c8c2373b6 tools/libxl/libxl_qmp.c
--- a/tools/libxl/libxl_qmp.c	Mon Sep 17 11:16:59 2012 +0100
+++ b/tools/libxl/libxl_qmp.c	Mon Sep 17 11:17:00 2012 +0100
@@ -171,7 +171,7 @@ static int qmp_register_vnc_callback(lib
 {
     GC_INIT(qmp->ctx);
     const libxl__json_object *obj;
-    const char *listen, *port;
+    const char *addr, *port;
     int rc = -1;
 
     if (!libxl__json_object_is_map(o)) {
@@ -184,17 +184,17 @@ static int qmp_register_vnc_callback(lib
     }
 
     obj = libxl__json_map_get("host", o, JSON_STRING);
-    listen = libxl__json_object_get_string(obj);
+    addr = libxl__json_object_get_string(obj);
     obj = libxl__json_map_get("service", o, JSON_STRING);
     port = libxl__json_object_get_string(obj);
 
-    if (!listen || !port) {
+    if (!addr || !port) {
         LIBXL__LOG(qmp->ctx, LIBXL__LOG_ERROR,
                    "Failed to retreive VNC connect information.");
         goto out;
     }
 
-    rc = qmp_write_domain_console_item(gc, qmp->domid, "vnc-listen", listen);
+    rc = qmp_write_domain_console_item(gc, qmp->domid, "vnc-listen", addr);
     if (!rc)
         rc = qmp_write_domain_console_item(gc, qmp->domid, "vnc-port", port);
 

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

From xen-changelog-bounces@lists.xen.org Mon Sep 17 21:55:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Sep 2012 21: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.xen.org>)
	id 1TDjHg-000134-TC; Mon, 17 Sep 2012 21:55:16 +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 1TDjHf-00012d-0V
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:15 +0000
Received: from [85.158.138.51:26593] by server-9.bemta-3.messagelabs.com id
	46/94-15390-24C97505; Mon, 17 Sep 2012 21:55:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-174.messagelabs.com!1347918911!29145855!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1641 invoked from network); 17 Sep 2012 21:55:12 -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;
	17 Sep 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 1TDjHa-0003qR-TT
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDjHa-0000zW-EP
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:10 +0000
Message-Id: <E1TDjHa-0000zW-EP@xenbits.xen.org>
Date: Mon, 17 Sep 2012 21:55:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpm: make argument parsing and
	error handling more consistent
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347869399 -7200
# Node ID 51408c3528030309e8f064bf6a3c96b37de7dc96
# Parent  12fa949b90603f057d458e370284471412afb0ba
xenpm: make argument parsing and error handling more consistent

Specifically, what values are or aren't accepted as CPU identifier, and
how the values get interpreted should be consistent across sub-commands
(intended behavior now: non-negative values are okay, and along with
omitting the argument, specifying "all" will also be accepted).

For error handling, error messages should get consistently issued to
stderr, and the tool should now (hopefully) produce an exit code of
zero only in the (partial) success case (there may still be a small
number of questionable cases).

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


diff -r 12fa949b9060 -r 51408c352803 tools/misc/xenpm.c
--- a/tools/misc/xenpm.c	Fri Sep 14 19:47:57 2012 +0100
+++ b/tools/misc/xenpm.c	Mon Sep 17 10:09:59 2012 +0200
@@ -36,7 +36,7 @@
 #define CPUFREQ_TURBO_ENABLED       1
 
 static xc_interface *xc_handle;
-static int max_cpu_nr;
+static unsigned int max_cpu_nr;
 
 /* help message */
 void show_help(void)
@@ -77,6 +77,33 @@ void help_func(int argc, char *argv[])
     show_help();
 }
 
+static void parse_cpuid(const char *arg, int *cpuid)
+{
+    if ( sscanf(arg, "%d", cpuid) != 1 || *cpuid < 0 )
+    {
+        if ( strcasecmp(arg, "all") )
+        {
+            fprintf(stderr, "Invalid CPU identifier: '%s'\n", arg);
+            exit(EINVAL);
+        }
+        *cpuid = -1;
+    }
+}
+
+static void parse_cpuid_and_int(int argc, char *argv[],
+                                int *cpuid, int *val, const char *what)
+{
+    if ( argc > 1 )
+        parse_cpuid(argv[0], cpuid);
+
+    if ( argc == 0 || sscanf(argv[argc > 1], "%d", val) != 1 )
+    {
+        fprintf(stderr, argc ? "Invalid %s '%s'\n" : "Missing %s\n",
+                what, argv[argc > 1]);
+        exit(EINVAL);
+    }
+}
+
 static void print_cxstat(int cpuid, struct xc_cx_stat *cxstat)
 {
     int i;
@@ -166,7 +193,8 @@ static int show_cxstat_by_cpuid(xc_inter
     if ( ret )
     {
         if ( ret == -ENODEV )
-            printf("Either xen cpuidle is disabled or no valid information is registered!\n");
+            fprintf(stderr,
+                    "Either Xen cpuidle is disabled or no valid information is registered!\n");
         return ret;
     }
 
@@ -181,11 +209,8 @@ void cxstat_func(int argc, char *argv[])
 {
     int cpuid = -1;
 
-    if ( argc > 0 && sscanf(argv[0], "%d", &cpuid) != 1 )
-        cpuid = -1;
-
-    if ( cpuid >= max_cpu_nr )
-        cpuid = -1;
+    if ( argc > 0 )
+        parse_cpuid(argv[0], &cpuid);
 
     show_max_cstate(xc_handle);
 
@@ -294,11 +319,8 @@ void pxstat_func(int argc, char *argv[])
 {
     int cpuid = -1;
 
-    if ( argc > 0 && sscanf(argv[0], "%d", &cpuid) != 1 )
-        cpuid = -1;
-
-    if ( cpuid >= max_cpu_nr )
-        cpuid = -1;
+    if ( argc > 0 )
+        parse_cpuid(argv[0], &cpuid);
 
     if ( cpuid < 0 )
     {
@@ -338,10 +360,10 @@ static void signal_int_handler(int signo
 	goto out;
     }
 
-    if ( gettimeofday(&tv, NULL) == -1 )
+    if ( gettimeofday(&tv, NULL) )
     {
         fprintf(stderr, "failed to get timeofday\n");
-        goto out ;
+        goto out;
     }
     usec_end = tv.tv_sec * 1000000UL + tv.tv_usec;
 
@@ -541,7 +563,7 @@ void start_gather_func(int argc, char *a
             printf("Timeout set to %d seconds\n", timeout);
     }
 
-    if ( gettimeofday(&tv, NULL) == -1 )
+    if ( gettimeofday(&tv, NULL) )
     {
         fprintf(stderr, "failed to get timeofday\n");
         return ;
@@ -766,11 +788,8 @@ void cpufreq_para_func(int argc, char *a
 {
     int cpuid = -1;
 
-    if ( argc > 0 && sscanf(argv[0], "%d", &cpuid) != 1 )
-        cpuid = -1;
-
-    if ( cpuid >= max_cpu_nr )
-        cpuid = -1;
+    if ( argc > 0 )
+        parse_cpuid(argv[0], &cpuid);
 
     if ( cpuid < 0 )
     {
@@ -788,26 +807,22 @@ void scaling_max_freq_func(int argc, cha
 {
     int cpuid = -1, freq = -1;
 
-    if ( (argc >= 2 && (sscanf(argv[1], "%d", &freq) != 1 ||
-                        sscanf(argv[0], "%d", &cpuid) != 1)) ||
-         (argc == 1 && sscanf(argv[0], "%d", &freq) != 1 ) ||
-         argc == 0 )
-    {
-        fprintf(stderr, "failed to set scaling max freq\n");
-        return ;
-    }
+    parse_cpuid_and_int(argc, argv, &cpuid, &freq, "frequency");
 
     if ( cpuid < 0 )
     {
         int i;
         for ( i = 0; i < max_cpu_nr; i++ )
             if ( xc_set_cpufreq_para(xc_handle, i, SCALING_MAX_FREQ, freq) )
-                fprintf(stderr, "[CPU%d] failed to set scaling max freq\n", i);
+                fprintf(stderr,
+                        "[CPU%d] failed to set scaling max freq (%d - %s)\n",
+                        i, errno, strerror(errno));
     }
     else
     {
         if ( xc_set_cpufreq_para(xc_handle, cpuid, SCALING_MAX_FREQ, freq) )
-            fprintf(stderr, "failed to set scaling max freq\n");
+            fprintf(stderr, "failed to set scaling max freq (%d - %s)\n",
+                    errno, strerror(errno));
     }
 }
 
@@ -815,26 +830,22 @@ void scaling_min_freq_func(int argc, cha
 {
     int cpuid = -1, freq = -1;
 
-    if ( (argc >= 2 && (sscanf(argv[1], "%d", &freq) != 1 ||
-                        sscanf(argv[0], "%d", &cpuid) != 1) ) ||
-         (argc == 1 && sscanf(argv[0], "%d", &freq) != 1 ) ||
-         argc == 0 )
-    {
-        fprintf(stderr, "failed to set scaling min freq\n");
-        return ;
-    }
+    parse_cpuid_and_int(argc, argv, &cpuid, &freq, "frequency");
 
     if ( cpuid < 0 )
     {
         int i;
         for ( i = 0; i < max_cpu_nr; i++ )
             if ( xc_set_cpufreq_para(xc_handle, i, SCALING_MIN_FREQ, freq) )
-                fprintf(stderr, "[CPU%d] failed to set scaling min freq\n", i);
+                fprintf(stderr,
+                        "[CPU%d] failed to set scaling min freq (%d - %s)\n",
+                        i, errno, strerror(errno));
     }
     else
     {
         if ( xc_set_cpufreq_para(xc_handle, cpuid, SCALING_MIN_FREQ, freq) )
-            fprintf(stderr, "failed to set scaling min freq\n");
+            fprintf(stderr, "failed to set scaling min freq (%d - %s)\n",
+                    errno, strerror(errno));
     }
 }
 
@@ -842,26 +853,22 @@ void scaling_speed_func(int argc, char *
 {
     int cpuid = -1, speed = -1;
 
-    if ( (argc >= 2 && (sscanf(argv[1], "%d", &speed) != 1 ||
-                        sscanf(argv[0], "%d", &cpuid) != 1) ) ||
-         (argc == 1 && sscanf(argv[0], "%d", &speed) != 1 ) ||
-         argc == 0 )
-    {
-        fprintf(stderr, "failed to set scaling speed\n");
-        return ;
-    }
+    parse_cpuid_and_int(argc, argv, &cpuid, &speed, "speed");
 
     if ( cpuid < 0 )
     {
         int i;
         for ( i = 0; i < max_cpu_nr; i++ )
             if ( xc_set_cpufreq_para(xc_handle, i, SCALING_SETSPEED, speed) )
-                fprintf(stderr, "[CPU%d] failed to set scaling speed\n", i);
+                fprintf(stderr,
+                        "[CPU%d] failed to set scaling speed (%d - %s)\n",
+                        i, errno, strerror(errno));
     }
     else
     {
         if ( xc_set_cpufreq_para(xc_handle, cpuid, SCALING_SETSPEED, speed) )
-            fprintf(stderr, "failed to set scaling speed\n");
+            fprintf(stderr, "failed to set scaling speed (%d - %s)\n",
+                    errno, strerror(errno));
     }
 }
 
@@ -869,14 +876,7 @@ void scaling_sampling_rate_func(int argc
 {
     int cpuid = -1, rate = -1;
 
-    if ( (argc >= 2 && (sscanf(argv[1], "%d", &rate) != 1 ||
-                        sscanf(argv[0], "%d", &cpuid) != 1) ) ||
-         (argc == 1 && sscanf(argv[0], "%d", &rate) != 1 ) ||
-         argc == 0 )
-    {
-        fprintf(stderr, "failed to set scaling sampling rate\n");
-        return ;
-    }
+    parse_cpuid_and_int(argc, argv, &cpuid, &rate, "rate");
 
     if ( cpuid < 0 )
     {
@@ -884,12 +884,14 @@ void scaling_sampling_rate_func(int argc
         for ( i = 0; i < max_cpu_nr; i++ )
             if ( xc_set_cpufreq_para(xc_handle, i, SAMPLING_RATE, rate) )
                 fprintf(stderr,
-                        "[CPU%d] failed to set scaling sampling rate\n", i);
+                        "[CPU%d] failed to set scaling sampling rate (%d - %s)\n",
+                        i, errno, strerror(errno));
     }
     else
     {
         if ( xc_set_cpufreq_para(xc_handle, cpuid, SAMPLING_RATE, rate) )
-            fprintf(stderr, "failed to set scaling sampling rate\n");
+            fprintf(stderr, "failed to set scaling sampling rate (%d - %s)\n",
+                    errno, strerror(errno));
     }
 }
 
@@ -897,14 +899,7 @@ void scaling_up_threshold_func(int argc,
 {
     int cpuid = -1, threshold = -1;
 
-    if ( (argc >= 2 && (sscanf(argv[1], "%d", &threshold) != 1 ||
-                        sscanf(argv[0], "%d", &cpuid) != 1) ) ||
-         (argc == 1 && sscanf(argv[0], "%d", &threshold) != 1 ) ||
-         argc == 0 )
-    {
-        fprintf(stderr, "failed to set up scaling threshold\n");
-        return ;
-    }
+    parse_cpuid_and_int(argc, argv, &cpuid, &threshold, "threshold");
 
     if ( cpuid < 0 )
     {
@@ -912,57 +907,49 @@ void scaling_up_threshold_func(int argc,
         for ( i = 0; i < max_cpu_nr; i++ )
             if ( xc_set_cpufreq_para(xc_handle, i, UP_THRESHOLD, threshold) )
                 fprintf(stderr,
-                        "[CPU%d] failed to set up scaling threshold\n", i);
+                        "[CPU%d] failed to set up scaling threshold (%d - %s)\n",
+                        i, errno, strerror(errno));
     }
     else
     {
         if ( xc_set_cpufreq_para(xc_handle, cpuid, UP_THRESHOLD, threshold) )
-            fprintf(stderr, "failed to set up scaling threshold\n");
+            fprintf(stderr, "failed to set up scaling threshold (%d - %s)\n",
+                    errno, strerror(errno));
     }
 }
 
 void scaling_governor_func(int argc, char *argv[])
 {
     int cpuid = -1;
-    char *name = NULL;
+    char *name;
 
     if ( argc >= 2 )
     {
-        name = strdup(argv[1]);
-        if ( name == NULL )
-            goto out;
-        if ( sscanf(argv[0], "%d", &cpuid) != 1 )
-        {
-            free(name);
-            goto out;
-        }
+        parse_cpuid(argv[0], &cpuid);
+        name = argv[1];
     }
     else if ( argc > 0 )
+        name = argv[0];
+    else
     {
-        name = strdup(argv[0]);
-        if ( name == NULL )
-            goto out;
+        fprintf(stderr, "Missing argument(s)\n");
+        exit(EINVAL);
     }
-    else
-        goto out;
 
     if ( cpuid < 0 )
     {
         int i;
         for ( i = 0; i < max_cpu_nr; i++ )
             if ( xc_set_cpufreq_gov(xc_handle, i, name) )
-                fprintf(stderr, "[CPU%d] failed to set governor name\n", i);
+                fprintf(stderr, "[CPU%d] failed to set governor name (%d - %s)\n",
+                        i, errno, strerror(errno));
     }
     else
     {
         if ( xc_set_cpufreq_gov(xc_handle, cpuid, name) )
-            fprintf(stderr, "failed to set governor name\n");
+            fprintf(stderr, "failed to set governor name (%d - %s)\n",
+                    errno, strerror(errno));
     }
-
-    free(name);
-    return ;
-out:
-    fprintf(stderr, "failed to set governor name\n");
 }
 
 void cpu_topology_func(int argc, char *argv[])
@@ -971,7 +958,7 @@ void cpu_topology_func(int argc, char *a
     DECLARE_HYPERCALL_BUFFER(uint32_t, cpu_to_socket);
     DECLARE_HYPERCALL_BUFFER(uint32_t, cpu_to_node);
     xc_topologyinfo_t info = { 0 };
-    int i;
+    int i, rc = ENOMEM;
 
     cpu_to_core = xc_hypercall_buffer_alloc(xc_handle, cpu_to_core, sizeof(*cpu_to_core) * MAX_NR_CPU);
     cpu_to_socket = xc_hypercall_buffer_alloc(xc_handle, cpu_to_socket, sizeof(*cpu_to_socket) * MAX_NR_CPU);
@@ -990,7 +977,9 @@ void cpu_topology_func(int argc, char *a
 
     if ( xc_topologyinfo(xc_handle, &info) )
     {
-        printf("Can not get Xen CPU topology: %d\n", errno);
+        rc = errno;
+        fprintf(stderr, "Cannot get Xen CPU topology (%d - %s)\n",
+                errno, strerror(errno));
         goto out;
     }
 
@@ -1005,116 +994,95 @@ void cpu_topology_func(int argc, char *a
         printf("CPU%d\t %d\t %d\t %d\n",
                i, cpu_to_core[i], cpu_to_socket[i], cpu_to_node[i]);
     }
+    rc = 0;
 out:
     xc_hypercall_buffer_free(xc_handle, cpu_to_core);
     xc_hypercall_buffer_free(xc_handle, cpu_to_socket);
     xc_hypercall_buffer_free(xc_handle, cpu_to_node);
+    if ( rc )
+        exit(rc);
 }
 
 void set_sched_smt_func(int argc, char *argv[])
 {
-    int value, rc;
+    int value;
 
-    if (argc != 1){
-        show_help();
-        exit(-1);
+    if ( argc != 1 ) {
+        fprintf(stderr, "Missing or invalid argument(s)\n");
+        exit(EINVAL);
     }
 
-    if ( !strncmp(argv[0], "disable", sizeof("disable")) )
-    {
+    if ( !strcasecmp(argv[0], "disable") )
         value = 0;
-    }
-    else if ( !strncmp(argv[0], "enable", sizeof("enable")) )
-    {
+    else if ( !strcasecmp(argv[0], "enable") )
         value = 1;
-    }
     else
     {
-        show_help();
-        exit(-1);
+        fprintf(stderr, "Invalid argument: %s\n", argv[0]);
+        exit(EINVAL);
     }
 
-    rc = xc_set_sched_opt_smt(xc_handle, value);
-    printf("%s sched_smt_power_savings %s\n", argv[0],
-                    rc? "failed":"succeeded" );
-
-    return;
+    if ( !xc_set_sched_opt_smt(xc_handle, value) )
+        printf("%s sched_smt_power_savings succeeded\n", argv[0]);
+    else
+        fprintf(stderr, "%s sched_smt_power_savings failed (%d - %s)\n",
+                argv[0], errno, strerror(errno));
 }
 
 void set_vcpu_migration_delay_func(int argc, char *argv[])
 {
     int value;
-    int rc;
 
-    if (argc != 1){
-        show_help();
-        exit(-1);
+    if ( argc != 1 || (value = atoi(argv[0])) < 0 ) {
+        fprintf(stderr, "Missing or invalid argument(s)\n");
+        exit(EINVAL);
     }
 
-    value = atoi(argv[0]);
-
-    if (value < 0)
-    {
-        printf("Please try non-negative vcpu migration delay\n");
-        exit(-1);
-    }
-
-    rc = xc_set_vcpu_migration_delay(xc_handle, value);
-    printf("%s to set vcpu migration delay to %d us\n",
-                    rc? "Fail":"Succeed", value );
-
-    return;
+    if ( !xc_set_vcpu_migration_delay(xc_handle, value) )
+        printf("set vcpu migration delay to %d us succeeded\n", value);
+    else
+        fprintf(stderr, "set vcpu migration delay failed (%d - %s)\n",
+                errno, strerror(errno));
 }
 
 void get_vcpu_migration_delay_func(int argc, char *argv[])
 {
     uint32_t value;
-    int rc;
 
-    if (argc != 0){
-        show_help();
-        exit(-1);
-    }
+    if ( argc )
+        fprintf(stderr, "Ignoring argument(s)\n");
 
-    rc = xc_get_vcpu_migration_delay(xc_handle, &value);
-    if (!rc)
-    {
-        printf("Schduler vcpu migration delay is %d us\n", value);
-    }
+    if ( !xc_get_vcpu_migration_delay(xc_handle, &value) )
+        printf("Scheduler vcpu migration delay is %d us\n", value);
     else
-    {
-        printf("Failed to get scheduler vcpu migration delay, errno=%d\n", errno);
-    }
-
-    return;
+        fprintf(stderr,
+                "Failed to get scheduler vcpu migration delay (%d - %s)\n",
+                errno, strerror(errno));
 }
 
 void set_max_cstate_func(int argc, char *argv[])
 {
-    int value, rc;
+    int value;
 
     if ( argc != 1 || sscanf(argv[0], "%d", &value) != 1 || value < 0 )
     {
-        show_help();
-        exit(-1);
+        fprintf(stderr, "Missing or invalid argument(s)\n");
+        exit(EINVAL);
     }
 
-    rc = xc_set_cpuidle_max_cstate(xc_handle, (uint32_t)value);
-    printf("set max_cstate to C%d %s\n", value,
-                    rc? "failed":"succeeded" );
-
-    return;
+    if ( !xc_set_cpuidle_max_cstate(xc_handle, (uint32_t)value) )
+        printf("set max_cstate to C%d succeeded\n", value);
+    else
+        fprintf(stderr, "set max_cstate to C%d failed (%d - %s)\n",
+                value, errno, strerror(errno));
 }
 
 void enable_turbo_mode(int argc, char *argv[])
 {
     int cpuid = -1;
 
-    if ( argc > 0 && sscanf(argv[0], "%d", &cpuid) != 1 )
-        cpuid = -1;
-
-    if ( cpuid >= max_cpu_nr )
-        cpuid = -1;
+    if ( argc > 0 )
+        parse_cpuid(argv[0], &cpuid);
 
     if ( cpuid < 0 )
     {
@@ -1122,21 +1090,22 @@ void enable_turbo_mode(int argc, char *a
          * only make effects on dbs governor */
         int i;
         for ( i = 0; i < max_cpu_nr; i++ )
-            xc_enable_turbo(xc_handle, i);
+            if ( xc_enable_turbo(xc_handle, i) )
+                fprintf(stderr,
+                        "[CPU%d] failed to enable turbo mode (%d - %s)\n",
+                        i, errno, strerror(errno));
     }
-    else
-        xc_enable_turbo(xc_handle, cpuid);
+    else if ( xc_enable_turbo(xc_handle, cpuid) )
+        fprintf(stderr, "failed to enable turbo mode (%d - %s)\n",
+                errno, strerror(errno));
 }
 
 void disable_turbo_mode(int argc, char *argv[])
 {
     int cpuid = -1;
 
-    if ( argc > 0 && sscanf(argv[0], "%d", &cpuid) != 1 )
-        cpuid = -1;
-
-    if ( cpuid >= max_cpu_nr )
-        cpuid = -1;
+    if ( argc > 0 )
+        parse_cpuid(argv[0], &cpuid);
 
     if ( cpuid < 0 )
     {
@@ -1144,10 +1113,14 @@ void disable_turbo_mode(int argc, char *
          * only make effects on dbs governor */
         int i;
         for ( i = 0; i < max_cpu_nr; i++ )
-            xc_disable_turbo(xc_handle, i);
+            if ( xc_disable_turbo(xc_handle, i) )
+                fprintf(stderr,
+                        "[CPU%d] failed to disable turbo mode (%d - %s)\n",
+                        i, errno, strerror(errno));
     }
-    else
-        xc_disable_turbo(xc_handle, cpuid);
+    else if ( xc_disable_turbo(xc_handle, cpuid) )
+        fprintf(stderr, "failed to disable turbo mode (%d - %s)\n",
+                errno, strerror(errno));
 }
 
 struct {
@@ -1191,15 +1164,17 @@ int main(int argc, char *argv[])
     if ( !xc_handle )
     {
         fprintf(stderr, "failed to get the handler\n");
-        return 0;
+        return EIO;
     }
 
     ret = xc_physinfo(xc_handle, &physinfo);
     if ( ret )
     {
-        fprintf(stderr, "failed to get the processor information\n");
+        ret = errno;
+        fprintf(stderr, "failed to get processor information (%d - %s)\n",
+                ret, strerror(ret));
         xc_interface_close(xc_handle);
-        return 0;
+        return ret;
     }
     max_cpu_nr = physinfo.nr_cpus;
 
@@ -1214,14 +1189,18 @@ int main(int argc, char *argv[])
         for ( i = 0; i < nr_matches; i++ )
             fprintf(stderr, " %s", main_options[matches_main_options[i]].name);
         fprintf(stderr, "\n");
+        ret = EINVAL;
     }
     else if ( nr_matches == 1 )
         /* dispatch to the corresponding function handler */
         main_options[matches_main_options[0]].function(argc - 2, argv + 2);
     else
+    {
         show_help();
+        ret = EINVAL;
+    }
 
     xc_interface_close(xc_handle);
-    return 0;
+    return ret;
 }
 

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

From xen-changelog-bounces@lists.xen.org Mon Sep 17 21:55:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Sep 2012 21: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.xen.org>)
	id 1TDjHg-000134-TC; Mon, 17 Sep 2012 21:55:16 +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 1TDjHf-00012d-0V
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:15 +0000
Received: from [85.158.138.51:26593] by server-9.bemta-3.messagelabs.com id
	46/94-15390-24C97505; Mon, 17 Sep 2012 21:55:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-174.messagelabs.com!1347918911!29145855!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1641 invoked from network); 17 Sep 2012 21:55:12 -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;
	17 Sep 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 1TDjHa-0003qR-TT
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDjHa-0000zW-EP
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:10 +0000
Message-Id: <E1TDjHa-0000zW-EP@xenbits.xen.org>
Date: Mon, 17 Sep 2012 21:55:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpm: make argument parsing and
	error handling more consistent
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347869399 -7200
# Node ID 51408c3528030309e8f064bf6a3c96b37de7dc96
# Parent  12fa949b90603f057d458e370284471412afb0ba
xenpm: make argument parsing and error handling more consistent

Specifically, what values are or aren't accepted as CPU identifier, and
how the values get interpreted should be consistent across sub-commands
(intended behavior now: non-negative values are okay, and along with
omitting the argument, specifying "all" will also be accepted).

For error handling, error messages should get consistently issued to
stderr, and the tool should now (hopefully) produce an exit code of
zero only in the (partial) success case (there may still be a small
number of questionable cases).

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


diff -r 12fa949b9060 -r 51408c352803 tools/misc/xenpm.c
--- a/tools/misc/xenpm.c	Fri Sep 14 19:47:57 2012 +0100
+++ b/tools/misc/xenpm.c	Mon Sep 17 10:09:59 2012 +0200
@@ -36,7 +36,7 @@
 #define CPUFREQ_TURBO_ENABLED       1
 
 static xc_interface *xc_handle;
-static int max_cpu_nr;
+static unsigned int max_cpu_nr;
 
 /* help message */
 void show_help(void)
@@ -77,6 +77,33 @@ void help_func(int argc, char *argv[])
     show_help();
 }
 
+static void parse_cpuid(const char *arg, int *cpuid)
+{
+    if ( sscanf(arg, "%d", cpuid) != 1 || *cpuid < 0 )
+    {
+        if ( strcasecmp(arg, "all") )
+        {
+            fprintf(stderr, "Invalid CPU identifier: '%s'\n", arg);
+            exit(EINVAL);
+        }
+        *cpuid = -1;
+    }
+}
+
+static void parse_cpuid_and_int(int argc, char *argv[],
+                                int *cpuid, int *val, const char *what)
+{
+    if ( argc > 1 )
+        parse_cpuid(argv[0], cpuid);
+
+    if ( argc == 0 || sscanf(argv[argc > 1], "%d", val) != 1 )
+    {
+        fprintf(stderr, argc ? "Invalid %s '%s'\n" : "Missing %s\n",
+                what, argv[argc > 1]);
+        exit(EINVAL);
+    }
+}
+
 static void print_cxstat(int cpuid, struct xc_cx_stat *cxstat)
 {
     int i;
@@ -166,7 +193,8 @@ static int show_cxstat_by_cpuid(xc_inter
     if ( ret )
     {
         if ( ret == -ENODEV )
-            printf("Either xen cpuidle is disabled or no valid information is registered!\n");
+            fprintf(stderr,
+                    "Either Xen cpuidle is disabled or no valid information is registered!\n");
         return ret;
     }
 
@@ -181,11 +209,8 @@ void cxstat_func(int argc, char *argv[])
 {
     int cpuid = -1;
 
-    if ( argc > 0 && sscanf(argv[0], "%d", &cpuid) != 1 )
-        cpuid = -1;
-
-    if ( cpuid >= max_cpu_nr )
-        cpuid = -1;
+    if ( argc > 0 )
+        parse_cpuid(argv[0], &cpuid);
 
     show_max_cstate(xc_handle);
 
@@ -294,11 +319,8 @@ void pxstat_func(int argc, char *argv[])
 {
     int cpuid = -1;
 
-    if ( argc > 0 && sscanf(argv[0], "%d", &cpuid) != 1 )
-        cpuid = -1;
-
-    if ( cpuid >= max_cpu_nr )
-        cpuid = -1;
+    if ( argc > 0 )
+        parse_cpuid(argv[0], &cpuid);
 
     if ( cpuid < 0 )
     {
@@ -338,10 +360,10 @@ static void signal_int_handler(int signo
 	goto out;
     }
 
-    if ( gettimeofday(&tv, NULL) == -1 )
+    if ( gettimeofday(&tv, NULL) )
     {
         fprintf(stderr, "failed to get timeofday\n");
-        goto out ;
+        goto out;
     }
     usec_end = tv.tv_sec * 1000000UL + tv.tv_usec;
 
@@ -541,7 +563,7 @@ void start_gather_func(int argc, char *a
             printf("Timeout set to %d seconds\n", timeout);
     }
 
-    if ( gettimeofday(&tv, NULL) == -1 )
+    if ( gettimeofday(&tv, NULL) )
     {
         fprintf(stderr, "failed to get timeofday\n");
         return ;
@@ -766,11 +788,8 @@ void cpufreq_para_func(int argc, char *a
 {
     int cpuid = -1;
 
-    if ( argc > 0 && sscanf(argv[0], "%d", &cpuid) != 1 )
-        cpuid = -1;
-
-    if ( cpuid >= max_cpu_nr )
-        cpuid = -1;
+    if ( argc > 0 )
+        parse_cpuid(argv[0], &cpuid);
 
     if ( cpuid < 0 )
     {
@@ -788,26 +807,22 @@ void scaling_max_freq_func(int argc, cha
 {
     int cpuid = -1, freq = -1;
 
-    if ( (argc >= 2 && (sscanf(argv[1], "%d", &freq) != 1 ||
-                        sscanf(argv[0], "%d", &cpuid) != 1)) ||
-         (argc == 1 && sscanf(argv[0], "%d", &freq) != 1 ) ||
-         argc == 0 )
-    {
-        fprintf(stderr, "failed to set scaling max freq\n");
-        return ;
-    }
+    parse_cpuid_and_int(argc, argv, &cpuid, &freq, "frequency");
 
     if ( cpuid < 0 )
     {
         int i;
         for ( i = 0; i < max_cpu_nr; i++ )
             if ( xc_set_cpufreq_para(xc_handle, i, SCALING_MAX_FREQ, freq) )
-                fprintf(stderr, "[CPU%d] failed to set scaling max freq\n", i);
+                fprintf(stderr,
+                        "[CPU%d] failed to set scaling max freq (%d - %s)\n",
+                        i, errno, strerror(errno));
     }
     else
     {
         if ( xc_set_cpufreq_para(xc_handle, cpuid, SCALING_MAX_FREQ, freq) )
-            fprintf(stderr, "failed to set scaling max freq\n");
+            fprintf(stderr, "failed to set scaling max freq (%d - %s)\n",
+                    errno, strerror(errno));
     }
 }
 
@@ -815,26 +830,22 @@ void scaling_min_freq_func(int argc, cha
 {
     int cpuid = -1, freq = -1;
 
-    if ( (argc >= 2 && (sscanf(argv[1], "%d", &freq) != 1 ||
-                        sscanf(argv[0], "%d", &cpuid) != 1) ) ||
-         (argc == 1 && sscanf(argv[0], "%d", &freq) != 1 ) ||
-         argc == 0 )
-    {
-        fprintf(stderr, "failed to set scaling min freq\n");
-        return ;
-    }
+    parse_cpuid_and_int(argc, argv, &cpuid, &freq, "frequency");
 
     if ( cpuid < 0 )
     {
         int i;
         for ( i = 0; i < max_cpu_nr; i++ )
             if ( xc_set_cpufreq_para(xc_handle, i, SCALING_MIN_FREQ, freq) )
-                fprintf(stderr, "[CPU%d] failed to set scaling min freq\n", i);
+                fprintf(stderr,
+                        "[CPU%d] failed to set scaling min freq (%d - %s)\n",
+                        i, errno, strerror(errno));
     }
     else
     {
         if ( xc_set_cpufreq_para(xc_handle, cpuid, SCALING_MIN_FREQ, freq) )
-            fprintf(stderr, "failed to set scaling min freq\n");
+            fprintf(stderr, "failed to set scaling min freq (%d - %s)\n",
+                    errno, strerror(errno));
     }
 }
 
@@ -842,26 +853,22 @@ void scaling_speed_func(int argc, char *
 {
     int cpuid = -1, speed = -1;
 
-    if ( (argc >= 2 && (sscanf(argv[1], "%d", &speed) != 1 ||
-                        sscanf(argv[0], "%d", &cpuid) != 1) ) ||
-         (argc == 1 && sscanf(argv[0], "%d", &speed) != 1 ) ||
-         argc == 0 )
-    {
-        fprintf(stderr, "failed to set scaling speed\n");
-        return ;
-    }
+    parse_cpuid_and_int(argc, argv, &cpuid, &speed, "speed");
 
     if ( cpuid < 0 )
     {
         int i;
         for ( i = 0; i < max_cpu_nr; i++ )
             if ( xc_set_cpufreq_para(xc_handle, i, SCALING_SETSPEED, speed) )
-                fprintf(stderr, "[CPU%d] failed to set scaling speed\n", i);
+                fprintf(stderr,
+                        "[CPU%d] failed to set scaling speed (%d - %s)\n",
+                        i, errno, strerror(errno));
     }
     else
     {
         if ( xc_set_cpufreq_para(xc_handle, cpuid, SCALING_SETSPEED, speed) )
-            fprintf(stderr, "failed to set scaling speed\n");
+            fprintf(stderr, "failed to set scaling speed (%d - %s)\n",
+                    errno, strerror(errno));
     }
 }
 
@@ -869,14 +876,7 @@ void scaling_sampling_rate_func(int argc
 {
     int cpuid = -1, rate = -1;
 
-    if ( (argc >= 2 && (sscanf(argv[1], "%d", &rate) != 1 ||
-                        sscanf(argv[0], "%d", &cpuid) != 1) ) ||
-         (argc == 1 && sscanf(argv[0], "%d", &rate) != 1 ) ||
-         argc == 0 )
-    {
-        fprintf(stderr, "failed to set scaling sampling rate\n");
-        return ;
-    }
+    parse_cpuid_and_int(argc, argv, &cpuid, &rate, "rate");
 
     if ( cpuid < 0 )
     {
@@ -884,12 +884,14 @@ void scaling_sampling_rate_func(int argc
         for ( i = 0; i < max_cpu_nr; i++ )
             if ( xc_set_cpufreq_para(xc_handle, i, SAMPLING_RATE, rate) )
                 fprintf(stderr,
-                        "[CPU%d] failed to set scaling sampling rate\n", i);
+                        "[CPU%d] failed to set scaling sampling rate (%d - %s)\n",
+                        i, errno, strerror(errno));
     }
     else
     {
         if ( xc_set_cpufreq_para(xc_handle, cpuid, SAMPLING_RATE, rate) )
-            fprintf(stderr, "failed to set scaling sampling rate\n");
+            fprintf(stderr, "failed to set scaling sampling rate (%d - %s)\n",
+                    errno, strerror(errno));
     }
 }
 
@@ -897,14 +899,7 @@ void scaling_up_threshold_func(int argc,
 {
     int cpuid = -1, threshold = -1;
 
-    if ( (argc >= 2 && (sscanf(argv[1], "%d", &threshold) != 1 ||
-                        sscanf(argv[0], "%d", &cpuid) != 1) ) ||
-         (argc == 1 && sscanf(argv[0], "%d", &threshold) != 1 ) ||
-         argc == 0 )
-    {
-        fprintf(stderr, "failed to set up scaling threshold\n");
-        return ;
-    }
+    parse_cpuid_and_int(argc, argv, &cpuid, &threshold, "threshold");
 
     if ( cpuid < 0 )
     {
@@ -912,57 +907,49 @@ void scaling_up_threshold_func(int argc,
         for ( i = 0; i < max_cpu_nr; i++ )
             if ( xc_set_cpufreq_para(xc_handle, i, UP_THRESHOLD, threshold) )
                 fprintf(stderr,
-                        "[CPU%d] failed to set up scaling threshold\n", i);
+                        "[CPU%d] failed to set up scaling threshold (%d - %s)\n",
+                        i, errno, strerror(errno));
     }
     else
     {
         if ( xc_set_cpufreq_para(xc_handle, cpuid, UP_THRESHOLD, threshold) )
-            fprintf(stderr, "failed to set up scaling threshold\n");
+            fprintf(stderr, "failed to set up scaling threshold (%d - %s)\n",
+                    errno, strerror(errno));
     }
 }
 
 void scaling_governor_func(int argc, char *argv[])
 {
     int cpuid = -1;
-    char *name = NULL;
+    char *name;
 
     if ( argc >= 2 )
     {
-        name = strdup(argv[1]);
-        if ( name == NULL )
-            goto out;
-        if ( sscanf(argv[0], "%d", &cpuid) != 1 )
-        {
-            free(name);
-            goto out;
-        }
+        parse_cpuid(argv[0], &cpuid);
+        name = argv[1];
     }
     else if ( argc > 0 )
+        name = argv[0];
+    else
     {
-        name = strdup(argv[0]);
-        if ( name == NULL )
-            goto out;
+        fprintf(stderr, "Missing argument(s)\n");
+        exit(EINVAL);
     }
-    else
-        goto out;
 
     if ( cpuid < 0 )
     {
         int i;
         for ( i = 0; i < max_cpu_nr; i++ )
             if ( xc_set_cpufreq_gov(xc_handle, i, name) )
-                fprintf(stderr, "[CPU%d] failed to set governor name\n", i);
+                fprintf(stderr, "[CPU%d] failed to set governor name (%d - %s)\n",
+                        i, errno, strerror(errno));
     }
     else
     {
         if ( xc_set_cpufreq_gov(xc_handle, cpuid, name) )
-            fprintf(stderr, "failed to set governor name\n");
+            fprintf(stderr, "failed to set governor name (%d - %s)\n",
+                    errno, strerror(errno));
     }
-
-    free(name);
-    return ;
-out:
-    fprintf(stderr, "failed to set governor name\n");
 }
 
 void cpu_topology_func(int argc, char *argv[])
@@ -971,7 +958,7 @@ void cpu_topology_func(int argc, char *a
     DECLARE_HYPERCALL_BUFFER(uint32_t, cpu_to_socket);
     DECLARE_HYPERCALL_BUFFER(uint32_t, cpu_to_node);
     xc_topologyinfo_t info = { 0 };
-    int i;
+    int i, rc = ENOMEM;
 
     cpu_to_core = xc_hypercall_buffer_alloc(xc_handle, cpu_to_core, sizeof(*cpu_to_core) * MAX_NR_CPU);
     cpu_to_socket = xc_hypercall_buffer_alloc(xc_handle, cpu_to_socket, sizeof(*cpu_to_socket) * MAX_NR_CPU);
@@ -990,7 +977,9 @@ void cpu_topology_func(int argc, char *a
 
     if ( xc_topologyinfo(xc_handle, &info) )
     {
-        printf("Can not get Xen CPU topology: %d\n", errno);
+        rc = errno;
+        fprintf(stderr, "Cannot get Xen CPU topology (%d - %s)\n",
+                errno, strerror(errno));
         goto out;
     }
 
@@ -1005,116 +994,95 @@ void cpu_topology_func(int argc, char *a
         printf("CPU%d\t %d\t %d\t %d\n",
                i, cpu_to_core[i], cpu_to_socket[i], cpu_to_node[i]);
     }
+    rc = 0;
 out:
     xc_hypercall_buffer_free(xc_handle, cpu_to_core);
     xc_hypercall_buffer_free(xc_handle, cpu_to_socket);
     xc_hypercall_buffer_free(xc_handle, cpu_to_node);
+    if ( rc )
+        exit(rc);
 }
 
 void set_sched_smt_func(int argc, char *argv[])
 {
-    int value, rc;
+    int value;
 
-    if (argc != 1){
-        show_help();
-        exit(-1);
+    if ( argc != 1 ) {
+        fprintf(stderr, "Missing or invalid argument(s)\n");
+        exit(EINVAL);
     }
 
-    if ( !strncmp(argv[0], "disable", sizeof("disable")) )
-    {
+    if ( !strcasecmp(argv[0], "disable") )
         value = 0;
-    }
-    else if ( !strncmp(argv[0], "enable", sizeof("enable")) )
-    {
+    else if ( !strcasecmp(argv[0], "enable") )
         value = 1;
-    }
     else
     {
-        show_help();
-        exit(-1);
+        fprintf(stderr, "Invalid argument: %s\n", argv[0]);
+        exit(EINVAL);
     }
 
-    rc = xc_set_sched_opt_smt(xc_handle, value);
-    printf("%s sched_smt_power_savings %s\n", argv[0],
-                    rc? "failed":"succeeded" );
-
-    return;
+    if ( !xc_set_sched_opt_smt(xc_handle, value) )
+        printf("%s sched_smt_power_savings succeeded\n", argv[0]);
+    else
+        fprintf(stderr, "%s sched_smt_power_savings failed (%d - %s)\n",
+                argv[0], errno, strerror(errno));
 }
 
 void set_vcpu_migration_delay_func(int argc, char *argv[])
 {
     int value;
-    int rc;
 
-    if (argc != 1){
-        show_help();
-        exit(-1);
+    if ( argc != 1 || (value = atoi(argv[0])) < 0 ) {
+        fprintf(stderr, "Missing or invalid argument(s)\n");
+        exit(EINVAL);
     }
 
-    value = atoi(argv[0]);
-
-    if (value < 0)
-    {
-        printf("Please try non-negative vcpu migration delay\n");
-        exit(-1);
-    }
-
-    rc = xc_set_vcpu_migration_delay(xc_handle, value);
-    printf("%s to set vcpu migration delay to %d us\n",
-                    rc? "Fail":"Succeed", value );
-
-    return;
+    if ( !xc_set_vcpu_migration_delay(xc_handle, value) )
+        printf("set vcpu migration delay to %d us succeeded\n", value);
+    else
+        fprintf(stderr, "set vcpu migration delay failed (%d - %s)\n",
+                errno, strerror(errno));
 }
 
 void get_vcpu_migration_delay_func(int argc, char *argv[])
 {
     uint32_t value;
-    int rc;
 
-    if (argc != 0){
-        show_help();
-        exit(-1);
-    }
+    if ( argc )
+        fprintf(stderr, "Ignoring argument(s)\n");
 
-    rc = xc_get_vcpu_migration_delay(xc_handle, &value);
-    if (!rc)
-    {
-        printf("Schduler vcpu migration delay is %d us\n", value);
-    }
+    if ( !xc_get_vcpu_migration_delay(xc_handle, &value) )
+        printf("Scheduler vcpu migration delay is %d us\n", value);
     else
-    {
-        printf("Failed to get scheduler vcpu migration delay, errno=%d\n", errno);
-    }
-
-    return;
+        fprintf(stderr,
+                "Failed to get scheduler vcpu migration delay (%d - %s)\n",
+                errno, strerror(errno));
 }
 
 void set_max_cstate_func(int argc, char *argv[])
 {
-    int value, rc;
+    int value;
 
     if ( argc != 1 || sscanf(argv[0], "%d", &value) != 1 || value < 0 )
     {
-        show_help();
-        exit(-1);
+        fprintf(stderr, "Missing or invalid argument(s)\n");
+        exit(EINVAL);
     }
 
-    rc = xc_set_cpuidle_max_cstate(xc_handle, (uint32_t)value);
-    printf("set max_cstate to C%d %s\n", value,
-                    rc? "failed":"succeeded" );
-
-    return;
+    if ( !xc_set_cpuidle_max_cstate(xc_handle, (uint32_t)value) )
+        printf("set max_cstate to C%d succeeded\n", value);
+    else
+        fprintf(stderr, "set max_cstate to C%d failed (%d - %s)\n",
+                value, errno, strerror(errno));
 }
 
 void enable_turbo_mode(int argc, char *argv[])
 {
     int cpuid = -1;
 
-    if ( argc > 0 && sscanf(argv[0], "%d", &cpuid) != 1 )
-        cpuid = -1;
-
-    if ( cpuid >= max_cpu_nr )
-        cpuid = -1;
+    if ( argc > 0 )
+        parse_cpuid(argv[0], &cpuid);
 
     if ( cpuid < 0 )
     {
@@ -1122,21 +1090,22 @@ void enable_turbo_mode(int argc, char *a
          * only make effects on dbs governor */
         int i;
         for ( i = 0; i < max_cpu_nr; i++ )
-            xc_enable_turbo(xc_handle, i);
+            if ( xc_enable_turbo(xc_handle, i) )
+                fprintf(stderr,
+                        "[CPU%d] failed to enable turbo mode (%d - %s)\n",
+                        i, errno, strerror(errno));
     }
-    else
-        xc_enable_turbo(xc_handle, cpuid);
+    else if ( xc_enable_turbo(xc_handle, cpuid) )
+        fprintf(stderr, "failed to enable turbo mode (%d - %s)\n",
+                errno, strerror(errno));
 }
 
 void disable_turbo_mode(int argc, char *argv[])
 {
     int cpuid = -1;
 
-    if ( argc > 0 && sscanf(argv[0], "%d", &cpuid) != 1 )
-        cpuid = -1;
-
-    if ( cpuid >= max_cpu_nr )
-        cpuid = -1;
+    if ( argc > 0 )
+        parse_cpuid(argv[0], &cpuid);
 
     if ( cpuid < 0 )
     {
@@ -1144,10 +1113,14 @@ void disable_turbo_mode(int argc, char *
          * only make effects on dbs governor */
         int i;
         for ( i = 0; i < max_cpu_nr; i++ )
-            xc_disable_turbo(xc_handle, i);
+            if ( xc_disable_turbo(xc_handle, i) )
+                fprintf(stderr,
+                        "[CPU%d] failed to disable turbo mode (%d - %s)\n",
+                        i, errno, strerror(errno));
     }
-    else
-        xc_disable_turbo(xc_handle, cpuid);
+    else if ( xc_disable_turbo(xc_handle, cpuid) )
+        fprintf(stderr, "failed to disable turbo mode (%d - %s)\n",
+                errno, strerror(errno));
 }
 
 struct {
@@ -1191,15 +1164,17 @@ int main(int argc, char *argv[])
     if ( !xc_handle )
     {
         fprintf(stderr, "failed to get the handler\n");
-        return 0;
+        return EIO;
     }
 
     ret = xc_physinfo(xc_handle, &physinfo);
     if ( ret )
     {
-        fprintf(stderr, "failed to get the processor information\n");
+        ret = errno;
+        fprintf(stderr, "failed to get processor information (%d - %s)\n",
+                ret, strerror(ret));
         xc_interface_close(xc_handle);
-        return 0;
+        return ret;
     }
     max_cpu_nr = physinfo.nr_cpus;
 
@@ -1214,14 +1189,18 @@ int main(int argc, char *argv[])
         for ( i = 0; i < nr_matches; i++ )
             fprintf(stderr, " %s", main_options[matches_main_options[i]].name);
         fprintf(stderr, "\n");
+        ret = EINVAL;
     }
     else if ( nr_matches == 1 )
         /* dispatch to the corresponding function handler */
         main_options[matches_main_options[0]].function(argc - 2, argv + 2);
     else
+    {
         show_help();
+        ret = EINVAL;
+    }
 
     xc_interface_close(xc_handle);
-    return 0;
+    return ret;
 }
 

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

From xen-changelog-bounces@lists.xen.org Mon Sep 17 21:55:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Sep 2012 21: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.xen.org>)
	id 1TDjHi-00013X-2T; Mon, 17 Sep 2012 21:55:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDjHh-00012k-0X
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:17 +0000
Received: from [85.158.143.35:42775] by server-1.bemta-4.messagelabs.com id
	B9/90-12504-44C97505; Mon, 17 Sep 2012 21:55:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-21.messagelabs.com!1347918914!18731793!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 372 invoked from network); 17 Sep 2012 21:55:15 -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;
	17 Sep 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 1TDjHd-0003qa-N4
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDjHd-00010y-A5
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:13 +0000
Message-Id: <E1TDjHd-00010y-A5@xenbits.xen.org>
Date: Mon, 17 Sep 2012 21:55:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl: prepare to enable Wshadow
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1347877021 -3600
# Node ID d91998a12405be7fe93102fc1b67a52bec492723
# Parent  fa8c8c2373b679542aa4179492296cd982e28b7d
xl: prepare to enable Wshadow

Takes care of everything other than the global domid clashes.

Avoid galobal functions
  - stime(2)
  - time(2)

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


diff -r fa8c8c2373b6 -r d91998a12405 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Mon Sep 17 11:17:00 2012 +0100
+++ b/tools/libxl/xl_cmdimpl.c	Mon Sep 17 11:17:01 2012 +0100
@@ -676,7 +676,7 @@ static void parse_config_data(const char
         b_info->max_vcpus = l;
 
     if (!xlu_cfg_get_list (config, "cpus", &cpus, 0, 1)) {
-        int i, n_cpus = 0;
+        int n_cpus = 0;
 
         if (libxl_cpu_bitmap_alloc(ctx, &b_info->cpumap, 0)) {
             fprintf(stderr, "Unable to allocate cpumap\n");
@@ -1200,7 +1200,6 @@ skip_vfb:
     }
 
     if (!xlu_cfg_get_list (config, "pci", &pcis, 0, 0)) {
-        int i;
         d_config->num_pcidevs = 0;
         d_config->pcidevs = NULL;
         for(i = 0; (buf = xlu_cfg_get_listitem (pcis, i)) != NULL; i++) {
@@ -1223,7 +1222,6 @@ skip_vfb:
     switch (xlu_cfg_get_list(config, "cpuid", &cpuids, 0, 1)) {
     case 0:
         {
-            int i;
             const char *errstr;
 
             for (i = 0; (buf = xlu_cfg_get_listitem(cpuids, i)) != NULL; i++) {
@@ -1546,7 +1544,7 @@ static int preserve_domain(uint32_t *r_d
 {
     time_t now;
     struct tm tm;
-    char stime[24];
+    char strtime[24];
 
     libxl_uuid new_uuid;
 
@@ -1564,7 +1562,7 @@ static int preserve_domain(uint32_t *r_d
         return 0;
     }
 
-    if (!strftime(&stime[0], sizeof(stime), "-%Y%m%dT%H%MZ", &tm)) {
+    if (!strftime(&strtime[0], sizeof(strtime), "-%Y%m%dT%H%MZ", &tm)) {
         LOG("Failed to format time as a string");
         return 0;
     }
@@ -1572,9 +1570,9 @@ static int preserve_domain(uint32_t *r_d
     libxl_uuid_generate(&new_uuid);
 
     LOG("Preserving domain %d %s with suffix%s",
-        *r_domid, d_config->c_info.name, stime);
+        *r_domid, d_config->c_info.name, strtime);
     rc = libxl_domain_preserve(ctx, *r_domid, &d_config->c_info,
-                               stime, new_uuid);
+                               strtime, new_uuid);
 
     /*
      * Although the domain still exists it is no longer the one we are
@@ -2690,7 +2688,8 @@ static void destroy_domain(const char *p
     if (rc) { fprintf(stderr,"destroy failed (rc=%d)\n",rc); exit(-1); }
 }
 
-static void shutdown_domain(const char *p, int wait, int fallback_trigger)
+static void shutdown_domain(const char *p, int wait_for_it,
+                            int fallback_trigger)
 {
     int rc;
     libxl_event *event;
@@ -2712,7 +2711,7 @@ static void shutdown_domain(const char *
         fprintf(stderr,"shutdown failed (rc=%d)\n",rc);exit(-1);
     }
 
-    if (wait) {
+    if (wait_for_it) {
         libxl_evgen_domain_death *deathw;
 
         rc = libxl_evenable_domain_death(ctx, domid, 0, &deathw);
@@ -3678,7 +3677,7 @@ int main_destroy(int argc, char **argv)
 int main_shutdown(int argc, char **argv)
 {
     int opt;
-    int wait = 0;
+    int wait_for_it = 0;
     int fallback_trigger = 0;
 
     while ((opt = def_getopt(argc, argv, "wF", "shutdown", 1)) != -1) {
@@ -3686,7 +3685,7 @@ int main_shutdown(int argc, char **argv)
         case 0: case 2:
             return opt;
         case 'w':
-            wait = 1;
+            wait_for_it = 1;
             break;
         case 'F':
             fallback_trigger = 1;
@@ -3694,7 +3693,7 @@ int main_shutdown(int argc, char **argv)
         }
     }
 
-    shutdown_domain(argv[optind], wait, fallback_trigger);
+    shutdown_domain(argv[optind], wait_for_it, fallback_trigger);
     return 0;
 }
 
@@ -4454,7 +4453,7 @@ static void output_topologyinfo(void)
     return;
 }
 
-static void info(int numa)
+static void print_info(int numa)
 {
     output_nodeinfo();
 
@@ -4497,7 +4496,7 @@ int main_info(int argc, char **argv)
         }
     }
 
-    info(numa);
+    print_info(numa);
     return 0;
 }
 
@@ -5566,19 +5565,19 @@ int main_blockdetach(int argc, char **ar
     return rc;
 }
 
-static char *uptime_to_string(unsigned long time, int short_mode)
+static char *uptime_to_string(unsigned long uptime, int short_mode)
 {
     int sec, min, hour, day;
     char *time_string;
     int ret;
 
-    day = (int)(time / 86400);
-    time -= (day * 86400);
-    hour = (int)(time / 3600);
-    time -= (hour * 3600);
-    min = (int)(time / 60);
-    time -= (min * 60);
-    sec = time;
+    day = (int)(uptime / 86400);
+    uptime -= (day * 86400);
+    hour = (int)(uptime / 3600);
+    uptime -= (hour * 3600);
+    min = (int)(uptime / 60);
+    uptime -= (min * 60);
+    sec = uptime;
 
     if (short_mode)
         if (day > 1)
diff -r fa8c8c2373b6 -r d91998a12405 tools/libxl/xl_sxp.c
--- a/tools/libxl/xl_sxp.c	Mon Sep 17 11:17:00 2012 +0100
+++ b/tools/libxl/xl_sxp.c	Mon Sep 17 11:17:01 2012 +0100
@@ -78,7 +78,6 @@ void printf_info_sexp(int domid, libxl_d
            libxl_defbool_to_string(b_info->disable_migrate));
 
     if (c_info->type == LIBXL_DOMAIN_TYPE_PV && b_info->u.pv.bootloader) {
-        int i;
         printf("\t(bootloader %s)\n", b_info->u.pv.bootloader);
         if (b_info->u.pv.bootloader_args) {
             printf("\t(bootloader_args");

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

From xen-changelog-bounces@lists.xen.org Mon Sep 17 21:55:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Sep 2012 21: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.xen.org>)
	id 1TDjHi-00013X-2T; Mon, 17 Sep 2012 21:55:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDjHh-00012k-0X
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:17 +0000
Received: from [85.158.143.35:42775] by server-1.bemta-4.messagelabs.com id
	B9/90-12504-44C97505; Mon, 17 Sep 2012 21:55:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-21.messagelabs.com!1347918914!18731793!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 372 invoked from network); 17 Sep 2012 21:55:15 -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;
	17 Sep 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 1TDjHd-0003qa-N4
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDjHd-00010y-A5
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:13 +0000
Message-Id: <E1TDjHd-00010y-A5@xenbits.xen.org>
Date: Mon, 17 Sep 2012 21:55:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl: prepare to enable Wshadow
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1347877021 -3600
# Node ID d91998a12405be7fe93102fc1b67a52bec492723
# Parent  fa8c8c2373b679542aa4179492296cd982e28b7d
xl: prepare to enable Wshadow

Takes care of everything other than the global domid clashes.

Avoid galobal functions
  - stime(2)
  - time(2)

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


diff -r fa8c8c2373b6 -r d91998a12405 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Mon Sep 17 11:17:00 2012 +0100
+++ b/tools/libxl/xl_cmdimpl.c	Mon Sep 17 11:17:01 2012 +0100
@@ -676,7 +676,7 @@ static void parse_config_data(const char
         b_info->max_vcpus = l;
 
     if (!xlu_cfg_get_list (config, "cpus", &cpus, 0, 1)) {
-        int i, n_cpus = 0;
+        int n_cpus = 0;
 
         if (libxl_cpu_bitmap_alloc(ctx, &b_info->cpumap, 0)) {
             fprintf(stderr, "Unable to allocate cpumap\n");
@@ -1200,7 +1200,6 @@ skip_vfb:
     }
 
     if (!xlu_cfg_get_list (config, "pci", &pcis, 0, 0)) {
-        int i;
         d_config->num_pcidevs = 0;
         d_config->pcidevs = NULL;
         for(i = 0; (buf = xlu_cfg_get_listitem (pcis, i)) != NULL; i++) {
@@ -1223,7 +1222,6 @@ skip_vfb:
     switch (xlu_cfg_get_list(config, "cpuid", &cpuids, 0, 1)) {
     case 0:
         {
-            int i;
             const char *errstr;
 
             for (i = 0; (buf = xlu_cfg_get_listitem(cpuids, i)) != NULL; i++) {
@@ -1546,7 +1544,7 @@ static int preserve_domain(uint32_t *r_d
 {
     time_t now;
     struct tm tm;
-    char stime[24];
+    char strtime[24];
 
     libxl_uuid new_uuid;
 
@@ -1564,7 +1562,7 @@ static int preserve_domain(uint32_t *r_d
         return 0;
     }
 
-    if (!strftime(&stime[0], sizeof(stime), "-%Y%m%dT%H%MZ", &tm)) {
+    if (!strftime(&strtime[0], sizeof(strtime), "-%Y%m%dT%H%MZ", &tm)) {
         LOG("Failed to format time as a string");
         return 0;
     }
@@ -1572,9 +1570,9 @@ static int preserve_domain(uint32_t *r_d
     libxl_uuid_generate(&new_uuid);
 
     LOG("Preserving domain %d %s with suffix%s",
-        *r_domid, d_config->c_info.name, stime);
+        *r_domid, d_config->c_info.name, strtime);
     rc = libxl_domain_preserve(ctx, *r_domid, &d_config->c_info,
-                               stime, new_uuid);
+                               strtime, new_uuid);
 
     /*
      * Although the domain still exists it is no longer the one we are
@@ -2690,7 +2688,8 @@ static void destroy_domain(const char *p
     if (rc) { fprintf(stderr,"destroy failed (rc=%d)\n",rc); exit(-1); }
 }
 
-static void shutdown_domain(const char *p, int wait, int fallback_trigger)
+static void shutdown_domain(const char *p, int wait_for_it,
+                            int fallback_trigger)
 {
     int rc;
     libxl_event *event;
@@ -2712,7 +2711,7 @@ static void shutdown_domain(const char *
         fprintf(stderr,"shutdown failed (rc=%d)\n",rc);exit(-1);
     }
 
-    if (wait) {
+    if (wait_for_it) {
         libxl_evgen_domain_death *deathw;
 
         rc = libxl_evenable_domain_death(ctx, domid, 0, &deathw);
@@ -3678,7 +3677,7 @@ int main_destroy(int argc, char **argv)
 int main_shutdown(int argc, char **argv)
 {
     int opt;
-    int wait = 0;
+    int wait_for_it = 0;
     int fallback_trigger = 0;
 
     while ((opt = def_getopt(argc, argv, "wF", "shutdown", 1)) != -1) {
@@ -3686,7 +3685,7 @@ int main_shutdown(int argc, char **argv)
         case 0: case 2:
             return opt;
         case 'w':
-            wait = 1;
+            wait_for_it = 1;
             break;
         case 'F':
             fallback_trigger = 1;
@@ -3694,7 +3693,7 @@ int main_shutdown(int argc, char **argv)
         }
     }
 
-    shutdown_domain(argv[optind], wait, fallback_trigger);
+    shutdown_domain(argv[optind], wait_for_it, fallback_trigger);
     return 0;
 }
 
@@ -4454,7 +4453,7 @@ static void output_topologyinfo(void)
     return;
 }
 
-static void info(int numa)
+static void print_info(int numa)
 {
     output_nodeinfo();
 
@@ -4497,7 +4496,7 @@ int main_info(int argc, char **argv)
         }
     }
 
-    info(numa);
+    print_info(numa);
     return 0;
 }
 
@@ -5566,19 +5565,19 @@ int main_blockdetach(int argc, char **ar
     return rc;
 }
 
-static char *uptime_to_string(unsigned long time, int short_mode)
+static char *uptime_to_string(unsigned long uptime, int short_mode)
 {
     int sec, min, hour, day;
     char *time_string;
     int ret;
 
-    day = (int)(time / 86400);
-    time -= (day * 86400);
-    hour = (int)(time / 3600);
-    time -= (hour * 3600);
-    min = (int)(time / 60);
-    time -= (min * 60);
-    sec = time;
+    day = (int)(uptime / 86400);
+    uptime -= (day * 86400);
+    hour = (int)(uptime / 3600);
+    uptime -= (hour * 3600);
+    min = (int)(uptime / 60);
+    uptime -= (min * 60);
+    sec = uptime;
 
     if (short_mode)
         if (day > 1)
diff -r fa8c8c2373b6 -r d91998a12405 tools/libxl/xl_sxp.c
--- a/tools/libxl/xl_sxp.c	Mon Sep 17 11:17:00 2012 +0100
+++ b/tools/libxl/xl_sxp.c	Mon Sep 17 11:17:01 2012 +0100
@@ -78,7 +78,6 @@ void printf_info_sexp(int domid, libxl_d
            libxl_defbool_to_string(b_info->disable_migrate));
 
     if (c_info->type == LIBXL_DOMAIN_TYPE_PV && b_info->u.pv.bootloader) {
-        int i;
         printf("\t(bootloader %s)\n", b_info->u.pv.bootloader);
         if (b_info->u.pv.bootloader_args) {
             printf("\t(bootloader_args");

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

From xen-changelog-bounces@lists.xen.org Mon Sep 17 21:55:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Sep 2012 21: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.xen.org>)
	id 1TDjHk-00014G-7L; Mon, 17 Sep 2012 21:55:20 +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 1TDjHi-00013N-8X
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:18 +0000
Received: from [85.158.138.51:61443] by server-5.bemta-3.messagelabs.com id
	33/6D-13133-54C97505; Mon, 17 Sep 2012 21:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-174.messagelabs.com!1347918915!24591041!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31291 invoked from network); 17 Sep 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;
	17 Sep 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 1TDjHe-0003qg-WB
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDjHe-00011S-Ut
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:14 +0000
Message-Id: <E1TDjHe-00011S-Ut@xenbits.xen.org>
Date: Mon, 17 Sep 2012 21:55:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Fix libxenstore memory leak when
	USE_PTHREAD is not defined
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1347877023 -3600
# Node ID cd2a831d0a415e247d44f8a12a13d038ec541da0
# Parent  4f3303d3de6935fd1e8c55a3327b6216f207b98c
Fix libxenstore memory leak when USE_PTHREAD is not defined

Redefine usage of pthread_cleanup_push and _pop, to explicitly call free for
heap objects in error paths.

By the way, set a suitable errno value for an error path that had none.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 4f3303d3de69 -r cd2a831d0a41 tools/xenstore/xs.c
--- a/tools/xenstore/xs.c	Mon Sep 17 11:17:02 2012 +0100
+++ b/tools/xenstore/xs.c	Mon Sep 17 11:17:03 2012 +0100
@@ -110,6 +110,11 @@ struct xs_handle {
 
 #define read_thread_exists(h)	(h->read_thr_exists)
 
+/* Because pthread_cleanup_p* are not available when USE_PTHREAD is
+ * disabled, use these macros which convert appropriately. */
+#define cleanup_push_heap(p)        cleanup_push(free, p)
+#define cleanup_pop_heap(run, p)    cleanup_pop((run))
+
 static void *read_thread(void *arg);
 
 #else /* !defined(USE_PTHREAD) */
@@ -130,6 +135,9 @@ struct xs_handle {
 #define cleanup_pop(run)	((void)0)
 #define read_thread_exists(h)	(0)
 
+#define cleanup_push_heap(p)        ((void)0)
+#define cleanup_pop_heap(run, p)    do { if ((run)) free(p); } while(0)
+
 #endif
 
 static int read_message(struct xs_handle *h, int nonblocking);
@@ -1059,7 +1067,7 @@ static int read_message(struct xs_handle
 	msg = malloc(sizeof(*msg));
 	if (msg == NULL)
 		goto error;
-	cleanup_push(free, msg);
+	cleanup_push_heap(msg);
 	if (!read_all(h->fd, &msg->hdr, sizeof(msg->hdr), nonblocking)) { /* Cancellation point */
 		saved_errno = errno;
 		goto error_freemsg;
@@ -1069,7 +1077,7 @@ static int read_message(struct xs_handle
 	body = msg->body = malloc(msg->hdr.len + 1);
 	if (body == NULL)
 		goto error_freemsg;
-	cleanup_push(free, body);
+	cleanup_push_heap(body);
 	if (!read_all(h->fd, body, msg->hdr.len, 0)) { /* Cancellation point */
 		saved_errno = errno;
 		goto error_freebody;
@@ -1098,6 +1106,7 @@ static int read_message(struct xs_handle
 		/* There should only ever be one response pending! */
 		if (!list_empty(&h->reply_list)) {
 			mutex_unlock(&h->reply_mutex);
+			saved_errno = EEXIST;
 			goto error_freebody;
 		}
 
@@ -1110,9 +1119,9 @@ static int read_message(struct xs_handle
 	ret = 0;
 
 error_freebody:
-	cleanup_pop(ret == -1);
+	cleanup_pop_heap(ret == -1, body);
 error_freemsg:
-	cleanup_pop(ret == -1);
+	cleanup_pop_heap(ret == -1, msg);
 error:
 	errno = saved_errno;
 

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

From xen-changelog-bounces@lists.xen.org Mon Sep 17 21:55:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Sep 2012 21: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.xen.org>)
	id 1TDjHk-00014G-7L; Mon, 17 Sep 2012 21:55:20 +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 1TDjHi-00013N-8X
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:18 +0000
Received: from [85.158.138.51:61443] by server-5.bemta-3.messagelabs.com id
	33/6D-13133-54C97505; Mon, 17 Sep 2012 21:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-174.messagelabs.com!1347918915!24591041!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31291 invoked from network); 17 Sep 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;
	17 Sep 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 1TDjHe-0003qg-WB
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDjHe-00011S-Ut
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:14 +0000
Message-Id: <E1TDjHe-00011S-Ut@xenbits.xen.org>
Date: Mon, 17 Sep 2012 21:55:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Fix libxenstore memory leak when
	USE_PTHREAD is not defined
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1347877023 -3600
# Node ID cd2a831d0a415e247d44f8a12a13d038ec541da0
# Parent  4f3303d3de6935fd1e8c55a3327b6216f207b98c
Fix libxenstore memory leak when USE_PTHREAD is not defined

Redefine usage of pthread_cleanup_push and _pop, to explicitly call free for
heap objects in error paths.

By the way, set a suitable errno value for an error path that had none.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 4f3303d3de69 -r cd2a831d0a41 tools/xenstore/xs.c
--- a/tools/xenstore/xs.c	Mon Sep 17 11:17:02 2012 +0100
+++ b/tools/xenstore/xs.c	Mon Sep 17 11:17:03 2012 +0100
@@ -110,6 +110,11 @@ struct xs_handle {
 
 #define read_thread_exists(h)	(h->read_thr_exists)
 
+/* Because pthread_cleanup_p* are not available when USE_PTHREAD is
+ * disabled, use these macros which convert appropriately. */
+#define cleanup_push_heap(p)        cleanup_push(free, p)
+#define cleanup_pop_heap(run, p)    cleanup_pop((run))
+
 static void *read_thread(void *arg);
 
 #else /* !defined(USE_PTHREAD) */
@@ -130,6 +135,9 @@ struct xs_handle {
 #define cleanup_pop(run)	((void)0)
 #define read_thread_exists(h)	(0)
 
+#define cleanup_push_heap(p)        ((void)0)
+#define cleanup_pop_heap(run, p)    do { if ((run)) free(p); } while(0)
+
 #endif
 
 static int read_message(struct xs_handle *h, int nonblocking);
@@ -1059,7 +1067,7 @@ static int read_message(struct xs_handle
 	msg = malloc(sizeof(*msg));
 	if (msg == NULL)
 		goto error;
-	cleanup_push(free, msg);
+	cleanup_push_heap(msg);
 	if (!read_all(h->fd, &msg->hdr, sizeof(msg->hdr), nonblocking)) { /* Cancellation point */
 		saved_errno = errno;
 		goto error_freemsg;
@@ -1069,7 +1077,7 @@ static int read_message(struct xs_handle
 	body = msg->body = malloc(msg->hdr.len + 1);
 	if (body == NULL)
 		goto error_freemsg;
-	cleanup_push(free, body);
+	cleanup_push_heap(body);
 	if (!read_all(h->fd, body, msg->hdr.len, 0)) { /* Cancellation point */
 		saved_errno = errno;
 		goto error_freebody;
@@ -1098,6 +1106,7 @@ static int read_message(struct xs_handle
 		/* There should only ever be one response pending! */
 		if (!list_empty(&h->reply_list)) {
 			mutex_unlock(&h->reply_mutex);
+			saved_errno = EEXIST;
 			goto error_freebody;
 		}
 
@@ -1110,9 +1119,9 @@ static int read_message(struct xs_handle
 	ret = 0;
 
 error_freebody:
-	cleanup_pop(ret == -1);
+	cleanup_pop_heap(ret == -1, body);
 error_freemsg:
-	cleanup_pop(ret == -1);
+	cleanup_pop_heap(ret == -1, msg);
 error:
 	errno = saved_errno;
 

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

From xen-changelog-bounces@lists.xen.org Mon Sep 17 21:55:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Sep 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.xen.org>)
	id 1TDjHk-00014N-AA; Mon, 17 Sep 2012 21:55:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDjHj-00013l-1V
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:19 +0000
Received: from [85.158.139.211:49071] by server-4.bemta-5.messagelabs.com id
	F9/B9-23042-64C97505; Mon, 17 Sep 2012 21:55:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-206.messagelabs.com!1347918916!18899158!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30841 invoked from network); 17 Sep 2012 21:55:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Sep 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 1TDjHf-0003qj-Pa
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDjHf-00011h-FR
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:15 +0000
Message-Id: <E1TDjHf-00011h-FR@xenbits.xen.org>
Date: Mon, 17 Sep 2012 21:55:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] .*ignore: drop ia64 entries
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1347877024 -3600
# Node ID 2082884b43ab6dd59516625d409b45e035664495
# Parent  cd2a831d0a415e247d44f8a12a13d038ec541da0
.*ignore: drop ia64 entries

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r cd2a831d0a41 -r 2082884b43ab .gitignore
--- a/.gitignore	Mon Sep 17 11:17:03 2012 +0100
+++ b/.gitignore	Mon Sep 17 11:17:04 2012 +0100
@@ -64,10 +64,7 @@ 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/include/list.h
@@ -174,13 +171,6 @@ tools/hotplug/common/hotplugpath.sh
 tools/include/xen/*
 tools/include/xen-foreign/*.(c|h|size)
 tools/include/xen-foreign/checker
-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
@@ -309,9 +299,6 @@ 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
@@ -325,10 +312,6 @@ 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
@@ -348,7 +331,6 @@ 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
diff -r cd2a831d0a41 -r 2082884b43ab .hgignore
--- a/.hgignore	Mon Sep 17 11:17:03 2012 +0100
+++ b/.hgignore	Mon Sep 17 11:17:04 2012 +0100
@@ -64,11 +64,8 @@
 ^docs/xen-api/vm_lifecycle.eps$
 ^docs/xen-api/xenapi-datamodel-graph.eps$
 ^docs/xen-api/xenapi.out$
-^extras/mini-os/arch/ia64/gen_off.s$
 ^extras/mini-os/include/list\.h$
 ^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.*$
@@ -168,13 +165,6 @@
 ^tools/include/xen/.*$
 ^tools/include/xen-foreign/.*\.(c|h|size)$
 ^tools/include/xen-foreign/checker$
-^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$
@@ -338,9 +328,6 @@
 ^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$
@@ -354,10 +341,6 @@
 ^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$

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

From xen-changelog-bounces@lists.xen.org Mon Sep 17 21:55:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Sep 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.xen.org>)
	id 1TDjHk-00014N-AA; Mon, 17 Sep 2012 21:55:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDjHj-00013l-1V
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:19 +0000
Received: from [85.158.139.211:49071] by server-4.bemta-5.messagelabs.com id
	F9/B9-23042-64C97505; Mon, 17 Sep 2012 21:55:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-206.messagelabs.com!1347918916!18899158!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30841 invoked from network); 17 Sep 2012 21:55:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Sep 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 1TDjHf-0003qj-Pa
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDjHf-00011h-FR
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:15 +0000
Message-Id: <E1TDjHf-00011h-FR@xenbits.xen.org>
Date: Mon, 17 Sep 2012 21:55:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] .*ignore: drop ia64 entries
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1347877024 -3600
# Node ID 2082884b43ab6dd59516625d409b45e035664495
# Parent  cd2a831d0a415e247d44f8a12a13d038ec541da0
.*ignore: drop ia64 entries

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r cd2a831d0a41 -r 2082884b43ab .gitignore
--- a/.gitignore	Mon Sep 17 11:17:03 2012 +0100
+++ b/.gitignore	Mon Sep 17 11:17:04 2012 +0100
@@ -64,10 +64,7 @@ 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/include/list.h
@@ -174,13 +171,6 @@ tools/hotplug/common/hotplugpath.sh
 tools/include/xen/*
 tools/include/xen-foreign/*.(c|h|size)
 tools/include/xen-foreign/checker
-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
@@ -309,9 +299,6 @@ 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
@@ -325,10 +312,6 @@ 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
@@ -348,7 +331,6 @@ 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
diff -r cd2a831d0a41 -r 2082884b43ab .hgignore
--- a/.hgignore	Mon Sep 17 11:17:03 2012 +0100
+++ b/.hgignore	Mon Sep 17 11:17:04 2012 +0100
@@ -64,11 +64,8 @@
 ^docs/xen-api/vm_lifecycle.eps$
 ^docs/xen-api/xenapi-datamodel-graph.eps$
 ^docs/xen-api/xenapi.out$
-^extras/mini-os/arch/ia64/gen_off.s$
 ^extras/mini-os/include/list\.h$
 ^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.*$
@@ -168,13 +165,6 @@
 ^tools/include/xen/.*$
 ^tools/include/xen-foreign/.*\.(c|h|size)$
 ^tools/include/xen-foreign/checker$
-^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$
@@ -338,9 +328,6 @@
 ^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$
@@ -354,10 +341,6 @@
 ^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$

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

From xen-changelog-bounces@lists.xen.org Mon Sep 17 21:55:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Sep 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.xen.org>)
	id 1TDjHl-00015R-KU; Mon, 17 Sep 2012 21:55:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDjHj-00013l-HS
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:19 +0000
Received: from [85.158.139.211:25833] by server-4.bemta-5.messagelabs.com id
	CA/B9-23042-64C97505; Mon, 17 Sep 2012 21:55:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-206.messagelabs.com!1347918914!18962640!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28654 invoked from network); 17 Sep 2012 21:55:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Sep 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 1TDjHe-0003qd-Hq
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDjHe-00011D-1Z
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:14 +0000
Message-Id: <E1TDjHe-00011D-1Z@xenbits.xen.org>
Date: Mon, 17 Sep 2012 21:55:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl: Remove global domid and enable
	-Wshadow
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1347877022 -3600
# Node ID 4f3303d3de6935fd1e8c55a3327b6216f207b98c
# Parent  d91998a12405be7fe93102fc1b67a52bec492723
xl: Remove global domid and enable -Wshadow

Lots of functions loop over a list of domain and others take a domid as
a parameter, shadowing the global one and leading to all sorts of
confusion.

Therefore remove the global domid and explicitly pass it around as
necessary.

Adds a domid to the parameters for many functions and switches many
others from taking a char * domain specifier to taking a domid, pushing
the domid lookup to the toplevel.

Replaces some open-coded domain_qualifier_to_domid error checking with
find_domain.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
[ ijc -- annotate find_domain() with warn_unused_result and fix the
         handful of errors. ]
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r d91998a12405 -r 4f3303d3de69 tools/libxl/Makefile
--- a/tools/libxl/Makefile	Mon Sep 17 11:17:01 2012 +0100
+++ b/tools/libxl/Makefile	Mon Sep 17 11:17:02 2012 +0100
@@ -89,10 +89,13 @@ LIBXLU_OBJS = libxlu_cfg_y.o libxlu_cfg_
 
 CLIENTS = xl testidl libxl-save-helper
 
+CFLAGS_XL += $(CFLAGS_libxenlight)
+CFLAGS_XL += -Wshadow
+
 XL_OBJS = xl.o xl_cmdimpl.o xl_cmdtable.o xl_sxp.o
 $(XL_OBJS) _libxl.api-for-check: \
             CFLAGS += $(CFLAGS_libxenctrl) # For xentoollog.h
-$(XL_OBJS): CFLAGS += $(CFLAGS_libxenlight)
+$(XL_OBJS): CFLAGS += $(CFLAGS_XL)
 $(XL_OBJS): CFLAGS += -include $(XEN_ROOT)/tools/config.h # libxl_json.h needs it.
 
 SAVE_HELPER_OBJS = libxl_save_helper.o _libxl_save_msgs_helper.o
diff -r d91998a12405 -r 4f3303d3de69 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Mon Sep 17 11:17:01 2012 +0100
+++ b/tools/libxl/xl_cmdimpl.c	Mon Sep 17 11:17:02 2012 +0100
@@ -67,9 +67,7 @@ libxl_ctx *ctx;
 
 xlchild children[child_max];
 
-/* when we operate on a domain, it is this one: */
 #define INVALID_DOMID ~0
-static uint32_t domid = INVALID_DOMID;
 static const char *common_domname;
 static int fd_lock = -1;
 
@@ -197,8 +195,10 @@ static int cpupool_qualifier_to_cpupooli
     return was_name ? libxl_name_to_cpupoolid(ctx, p, poolid_r) : 0;
 }
 
-static void find_domain(const char *p)
-{
+static uint32_t find_domain(const char *p) __attribute__((warn_unused_result));
+static uint32_t find_domain(const char *p)
+{
+    uint32_t domid;
     int rc, was_name;
 
     rc = domain_qualifier_to_domid(p, &domid, &was_name);
@@ -207,6 +207,7 @@ static void find_domain(const char *p)
         exit(2);
     }
     common_domname = was_name ? p : libxl_domid_to_name(ctx, domid);
+    return domid;
 }
 
 static int vncviewer(uint32_t domid, int autopass)
@@ -1583,7 +1584,7 @@ static int preserve_domain(uint32_t *r_d
     return rc == 0 ? 1 : 0;
 }
 
-static int freemem(libxl_domain_build_info *b_info)
+static int freemem(uint32_t domid, libxl_domain_build_info *b_info)
 {
     int rc, retries = 3;
     uint32_t need_memkb, free_memkb;
@@ -1663,7 +1664,7 @@ static void autoconnect_console(libxl_ct
     _exit(1);
 }
 
-static int domain_wait_event(libxl_event **event_r)
+static int domain_wait_event(uint32_t domid, libxl_event **event_r)
 {
     int ret;
     for (;;) {
@@ -1697,8 +1698,10 @@ static void evdisable_disk_ejects(libxl_
     }
 }
 
-static int create_domain(struct domain_create *dom_info)
-{
+static uint32_t create_domain(struct domain_create *dom_info)
+{
+    uint32_t domid = INVALID_DOMID;
+
     libxl_domain_config d_config;
 
     int debug = dom_info->debug;
@@ -1874,7 +1877,7 @@ start:
     if (rc < 0)
         goto error_out;
 
-    ret = freemem(&d_config.b_info);
+    ret = freemem(domid, &d_config.b_info);
     if (ret < 0) {
         fprintf(stderr, "failed to free memory for the domain\n");
         ret = ERROR_FAIL;
@@ -2024,7 +2027,7 @@ start:
     }
     while (1) {
         libxl_event *event;
-        ret = domain_wait_event(&event);
+        ret = domain_wait_event(domid, &event);
         if (ret) goto out;
 
         switch (event->type) {
@@ -2236,13 +2239,11 @@ static int def_getopt(int argc, char * c
     return -1;
 }
 
-static int set_memory_max(const char *p, const char *mem)
+static int set_memory_max(uint32_t domid, const char *mem)
 {
     int64_t memorykb;
     int rc;
 
-    find_domain(p);
-
     memorykb = parse_mem_size_kb(mem);
     if (memorykb == -1) {
         fprintf(stderr, "invalid memory size: %s\n", mem);
@@ -2256,17 +2257,18 @@ static int set_memory_max(const char *p,
 
 int main_memmax(int argc, char **argv)
 {
+    uint32_t domid;
     int opt = 0;
-    char *p = NULL, *mem;
+    char *mem;
     int rc;
 
     if ((opt = def_getopt(argc, argv, "", "mem-max", 2)) != -1)
         return opt;
 
-    p = argv[optind];
+    domid = find_domain(argv[optind]);
     mem = argv[optind + 1];
 
-    rc = set_memory_max(p, mem);
+    rc = set_memory_max(domid, mem);
     if (rc) {
         fprintf(stderr, "cannot set domid %d static max memory to : %s\n", domid, mem);
         return 1;
@@ -2275,12 +2277,10 @@ int main_memmax(int argc, char **argv)
     return 0;
 }
 
-static void set_memory_target(const char *p, const char *mem)
+static void set_memory_target(uint32_t domid, const char *mem)
 {
     long long int memorykb;
 
-    find_domain(p);
-
     memorykb = parse_mem_size_kb(mem);
     if (memorykb == -1)  {
         fprintf(stderr, "invalid memory size: %s\n", mem);
@@ -2292,26 +2292,26 @@ static void set_memory_target(const char
 
 int main_memset(int argc, char **argv)
 {
+    uint32_t domid;
     int opt = 0;
-    const char *p = NULL, *mem;
+    const char *mem;
 
     if ((opt = def_getopt(argc, argv, "", "mem-set", 2)) != -1)
         return opt;
 
-    p = argv[optind];
+    domid = find_domain(argv[optind]);
     mem = argv[optind + 1];
 
-    set_memory_target(p, mem);
+    set_memory_target(domid, mem);
     return 0;
 }
 
-static void cd_insert(const char *dom, const char *virtdev, char *phys)
+static void cd_insert(uint32_t domid, const char *virtdev, char *phys)
 {
     libxl_device_disk disk; /* we don't free disk's contents */
     char *buf = NULL;
     XLU_Config *config = 0;
 
-    find_domain(dom);
 
     if (asprintf(&buf, "vdev=%s,access=r,devtype=cdrom,target=%s",
                  virtdev, phys ? phys : "") < 0) {
@@ -2331,38 +2331,41 @@ static void cd_insert(const char *dom, c
 
 int main_cd_eject(int argc, char **argv)
 {
+    uint32_t domid;
     int opt = 0;
-    const char *p = NULL, *virtdev;
+    const char *virtdev;
 
     if ((opt = def_getopt(argc, argv, "", "cd-eject", 2)) != -1)
         return opt;
 
-    p = argv[optind];
+    domid = find_domain(argv[optind]);
     virtdev = argv[optind + 1];
 
-    cd_insert(p, virtdev, NULL);
+    cd_insert(domid, virtdev, NULL);
     return 0;
 }
 
 int main_cd_insert(int argc, char **argv)
 {
+    uint32_t domid;
     int opt = 0;
-    const char *p = NULL, *virtdev;
+    const char *virtdev;
     char *file = NULL; /* modified by cd_insert tokenising it */
 
     if ((opt = def_getopt(argc, argv, "", "cd-insert", 3)) != -1)
         return opt;
 
-    p = argv[optind];
+    domid = find_domain(argv[optind]);
     virtdev = argv[optind + 1];
     file = argv[optind + 2];
 
-    cd_insert(p, virtdev, file);
+    cd_insert(domid, virtdev, file);
     return 0;
 }
 
 int main_console(int argc, char **argv)
 {
+    uint32_t domid;
     int opt = 0, num = 0;
     libxl_console_type type = 0;
 
@@ -2386,7 +2389,7 @@ int main_console(int argc, char **argv)
         }
     }
 
-    find_domain(argv[optind]);
+    domid = find_domain(argv[optind]);
     if (!type)
         libxl_primary_console_exec(ctx, domid);
     else
@@ -2403,6 +2406,7 @@ int main_vncviewer(int argc, char **argv
         {"help", 0, 0, 'h'},
         {0, 0, 0, 0}
     };
+    uint32_t domid;
     int opt, autopass = 0;
 
     while (1) {
@@ -2428,20 +2432,18 @@ int main_vncviewer(int argc, char **argv
         return 2;
     }
 
-    find_domain(argv[optind]);
+    domid = find_domain(argv[optind]);
 
     if (vncviewer(domid, autopass))
         return 1;
     return 0;
 }
 
-static void pcilist(const char *dom)
+static void pcilist(uint32_t domid)
 {
     libxl_device_pci *pcidevs;
     int num, i;
 
-    find_domain(dom);
-
     pcidevs = libxl_device_pci_list(ctx, domid, &num);
     if (pcidevs == NULL)
         return;
@@ -2457,27 +2459,25 @@ static void pcilist(const char *dom)
 
 int main_pcilist(int argc, char **argv)
 {
+    uint32_t domid;
     int opt;
-    const char *domname = NULL;
 
     if ((opt = def_getopt(argc, argv, "", "pci-list", 1)) != -1)
         return opt;
 
-    domname = argv[optind];
-
-    pcilist(domname);
+    domid = find_domain(argv[optind]);
+
+    pcilist(domid);
     return 0;
 }
 
-static void pcidetach(const char *dom, const char *bdf, int force)
+static void pcidetach(uint32_t domid, const char *bdf, int force)
 {
     libxl_device_pci pcidev;
     XLU_Config *config;
 
-    find_domain(dom);
-
     libxl_device_pci_init(&pcidev);
-    
+
     config = xlu_cfg_init(stderr, "command line");
     if (!config) { perror("xlu_cfg_inig"); exit(-1); }
 
@@ -2496,9 +2496,10 @@ static void pcidetach(const char *dom, c
 
 int main_pcidetach(int argc, char **argv)
 {
+    uint32_t domid;
     int opt;
     int force = 0;
-    const char *domname = NULL, *bdf = NULL;
+    const char *bdf = NULL;
 
     while ((opt = def_getopt(argc, argv, "f", "pci-detach", 2)) != -1) {
         switch (opt) {
@@ -2510,19 +2511,17 @@ int main_pcidetach(int argc, char **argv
         }
     }
 
-    domname = argv[optind];
+    domid = find_domain(argv[optind]);
     bdf = argv[optind + 1];
 
-    pcidetach(domname, bdf, force);
+    pcidetach(domid, bdf, force);
     return 0;
 }
-static void pciattach(const char *dom, const char *bdf, const char *vs)
+static void pciattach(uint32_t domid, const char *bdf, const char *vs)
 {
     libxl_device_pci pcidev;
     XLU_Config *config;
 
-    find_domain(dom);
-
     libxl_device_pci_init(&pcidev);
 
     config = xlu_cfg_init(stderr, "command line");
@@ -2540,19 +2539,20 @@ static void pciattach(const char *dom, c
 
 int main_pciattach(int argc, char **argv)
 {
+    uint32_t domid;
     int opt;
-    const char *domname = NULL, *bdf = NULL, *vs = NULL;
+    const char *bdf = NULL, *vs = NULL;
 
     if ((opt = def_getopt(argc, argv, "", "pci-attach", 2)) != -1)
         return opt;
 
-    domname = argv[optind];
+    domid = find_domain(argv[optind]);
     bdf = argv[optind + 1];
 
     if (optind + 1 < argc)
         vs = argv[optind + 2];
 
-    pciattach(domname, bdf, vs);
+    pciattach(domid, bdf, vs);
     return 0;
 }
 
@@ -2664,22 +2664,20 @@ int main_pciassignable_remove(int argc, 
     return 0;
 }
 
-static void pause_domain(const char *p)
-{
-    find_domain(p);
+static void pause_domain(uint32_t domid)
+{
     libxl_domain_pause(ctx, domid);
 }
 
-static void unpause_domain(const char *p)
-{
-    find_domain(p);
+static void unpause_domain(uint32_t domid)
+{
     libxl_domain_unpause(ctx, domid);
 }
 
-static void destroy_domain(const char *p)
+static void destroy_domain(uint32_t domid)
 {
     int rc;
-    find_domain(p);
+
     if (domid == 0) {
         fprintf(stderr, "Cannot destroy privileged domain 0.\n\n");
         exit(-1);
@@ -2688,13 +2686,12 @@ static void destroy_domain(const char *p
     if (rc) { fprintf(stderr,"destroy failed (rc=%d)\n",rc); exit(-1); }
 }
 
-static void shutdown_domain(const char *p, int wait_for_it,
+static void shutdown_domain(uint32_t domid, int wait_for_it,
                             int fallback_trigger)
 {
     int rc;
     libxl_event *event;
 
-    find_domain(p);
     rc=libxl_domain_shutdown(ctx, domid);
     if (rc == ERROR_NOPARAVIRT) {
         if (fallback_trigger) {
@@ -2721,7 +2718,7 @@ static void shutdown_domain(const char *
         }
 
         for (;;) {
-            rc = domain_wait_event(&event);
+            rc = domain_wait_event(domid, &event);
             if (rc) exit(-1);
 
             switch (event->type) {
@@ -2748,10 +2745,10 @@ static void shutdown_domain(const char *
     }
 }
 
-static void reboot_domain(const char *p, int fallback_trigger)
+static void reboot_domain(uint32_t domid, int fallback_trigger)
 {
     int rc;
-    find_domain(p);
+
     rc=libxl_domain_reboot(ctx, domid);
     if (rc == ERROR_NOPARAVIRT) {
         if (fallback_trigger) {
@@ -2808,7 +2805,7 @@ static void list_domains_details(const l
         if (default_output_format == OUTPUT_FORMAT_JSON)
             s = printf_info_one_json(hand, info[i].domid, &d_config);
         else
-            printf_info_sexp(domid, &d_config);
+            printf_info_sexp(info[i].domid, &d_config);
         libxl_domain_config_dispose(&d_config);
         free(data);
         free(config_source);
@@ -2910,15 +2907,13 @@ static void list_vm(void)
     libxl_vminfo_list_free(info, nb_vm);
 }
 
-static void save_domain_core_begin(const char *domain_spec,
+static void save_domain_core_begin(uint32_t domid,
                                    const char *override_config_file,
                                    uint8_t **config_data_r,
                                    int *config_len_r)
 {
     int rc;
 
-    find_domain(domain_spec);
-
     /* configuration file in optional data: */
 
     if (override_config_file) {
@@ -2975,14 +2970,15 @@ static void save_domain_core_writeconfig
             hdr.optional_data_len);
 }
 
-static int save_domain(const char *p, const char *filename, int checkpoint,
+static int save_domain(uint32_t domid, const char *filename, int checkpoint,
                 const char *override_config_file)
 {
     int fd;
     uint8_t *config_data;
     int config_len;
 
-    save_domain_core_begin(p, override_config_file, &config_data, &config_len);
+    save_domain_core_begin(domid, override_config_file,
+                           &config_data, &config_len);
 
     if (!config_len) {
         fputs(" Savefile will not contain xl domain config\n", stderr);
@@ -3152,7 +3148,7 @@ static void migrate_do_preamble(int send
 
 }
 
-static void migrate_domain(const char *domain_spec, const char *rune,
+static void migrate_domain(uint32_t domid, const char *rune,
                            const char *override_config_file)
 {
     pid_t child = -1;
@@ -3163,7 +3159,7 @@ static void migrate_domain(const char *d
     uint8_t *config_data;
     int config_len;
 
-    save_domain_core_begin(domain_spec, override_config_file,
+    save_domain_core_begin(domid, override_config_file,
                            &config_data, &config_len);
 
     if (!config_len) {
@@ -3290,10 +3286,10 @@ static void migrate_domain(const char *d
     exit(-ERROR_BADFAIL);
 }
 
-static void core_dump_domain(const char *domain_spec, const char *filename)
+static void core_dump_domain(uint32_t domid, const char *filename)
 {
     int rc;
-    find_domain(domain_spec);
+
     rc=libxl_domain_core_dump(ctx, domid, filename, NULL);
     if (rc) { fprintf(stderr,"core dump failed (rc=%d)\n",rc);exit(-1); }
 }
@@ -3301,6 +3297,7 @@ static void core_dump_domain(const char 
 static void migrate_receive(int debug, int daemonize, int monitor,
                             int send_fd, int recv_fd, int remus)
 {
+    uint32_t domid;
     int rc, rc2;
     char rc_buf;
     char *migration_domname;
@@ -3332,6 +3329,8 @@ static void migrate_receive(int debug, i
         exit(-rc);
     }
 
+    domid = rc;
+
     if (remus) {
         /* If we are here, it means that the sender (primary) has crashed.
          * TODO: Split-Brain Check.
@@ -3550,7 +3549,8 @@ int main_migrate_receive(int argc, char 
 
 int main_save(int argc, char **argv)
 {
-    const char *filename, *p;
+    uint32_t domid;
+    const char *filename;
     const char *config_filename = NULL;
     int checkpoint = 0;
     int opt;
@@ -3570,18 +3570,18 @@ int main_save(int argc, char **argv)
         return 2;
     }
 
-    p = argv[optind];
+    domid = find_domain(argv[optind]);
     filename = argv[optind + 1];
     if ( argc - optind >= 3 )
         config_filename = argv[optind + 2];
 
-    save_domain(p, filename, checkpoint, config_filename);
+    save_domain(domid, filename, checkpoint, config_filename);
     return 0;
 }
 
 int main_migrate(int argc, char **argv)
 {
-    const char *p = NULL;
+    uint32_t domid;
     const char *config_filename = NULL;
     const char *ssh_command = "ssh";
     char *rune = NULL;
@@ -3611,7 +3611,7 @@ int main_migrate(int argc, char **argv)
         }
     }
 
-    p = argv[optind];
+    domid = find_domain(argv[optind]);
     host = argv[optind + 1];
 
     if (!ssh_command[0]) {
@@ -3624,7 +3624,7 @@ int main_migrate(int argc, char **argv)
             return 1;
     }
 
-    migrate_domain(p, rune, config_filename);
+    migrate_domain(domid, rune, config_filename);
     return 0;
 }
 
@@ -3635,7 +3635,7 @@ int main_dump_core(int argc, char **argv
     if ((opt = def_getopt(argc, argv, "", "dump-core", 2)) != -1)
         return opt;
 
-    core_dump_domain(argv[optind], argv[optind + 1]);
+    core_dump_domain(find_domain(argv[optind]), argv[optind + 1]);
     return 0;
 }
 
@@ -3646,7 +3646,7 @@ int main_pause(int argc, char **argv)
     if ((opt = def_getopt(argc, argv, "", "pause", 1)) != -1)
         return opt;
 
-    pause_domain(argv[optind]);
+    pause_domain(find_domain(argv[optind]));
 
     return 0;
 }
@@ -3658,7 +3658,7 @@ int main_unpause(int argc, char **argv)
     if ((opt = def_getopt(argc, argv, "", "unpause", 1)) != -1)
         return opt;
 
-    unpause_domain(argv[optind]);
+    unpause_domain(find_domain(argv[optind]));
 
     return 0;
 }
@@ -3670,7 +3670,7 @@ int main_destroy(int argc, char **argv)
     if ((opt = def_getopt(argc, argv, "", "destroy", 1)) != -1)
         return opt;
 
-    destroy_domain(argv[optind]);
+    destroy_domain(find_domain(argv[optind]));
     return 0;
 }
 
@@ -3693,7 +3693,7 @@ int main_shutdown(int argc, char **argv)
         }
     }
 
-    shutdown_domain(argv[optind], wait_for_it, fallback_trigger);
+    shutdown_domain(find_domain(argv[optind]), wait_for_it, fallback_trigger);
     return 0;
 }
 
@@ -3712,7 +3712,7 @@ int main_reboot(int argc, char **argv)
         }
     }
 
-    reboot_domain(argv[optind], fallback_trigger);
+    reboot_domain(find_domain(argv[optind]), fallback_trigger);
     return 0;
 }
 
@@ -3766,7 +3766,7 @@ int main_list(int argc, char **argv)
         }
         info_free = info;
     } else if (optind == argc-1) {
-        find_domain(argv[optind]);
+        uint32_t domid = 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",
@@ -3915,6 +3915,7 @@ int main_create(int argc, char **argv)
 
 int main_config_update(int argc, char **argv)
 {
+    uint32_t domid;
     const char *filename = NULL;
     char *p;
     char extra_config[1024];
@@ -3936,7 +3937,7 @@ int main_config_update(int argc, char **
         exit(1);
     }
 
-    find_domain(argv[1]);
+    domid = find_domain(argv[1]);
     argc--; argv++;
 
     if (argv[1] && argv[1][0] != '-' && !strchr(argv[1], '=')) {
@@ -4027,12 +4028,10 @@ int main_config_update(int argc, char **
     return 0;
 }
 
-static void button_press(const char *p, const char *b)
+static void button_press(uint32_t domid, const char *b)
 {
     libxl_trigger trigger;
 
-    find_domain(p);
-
     if (!strcmp(b, "power")) {
         trigger = LIBXL_TRIGGER_POWER;
     } else if (!strcmp(b, "sleep")) {
@@ -4055,7 +4054,7 @@ int main_button_press(int argc, char **a
     if ((opt = def_getopt(argc, argv, "", "button-press", 2)) != -1)
         return opt;
 
-    button_press(argv[optind], argv[optind + 1]);
+    button_press(find_domain(argv[optind]), argv[optind + 1]);
 
     return 0;
 }
@@ -4181,11 +4180,7 @@ static void vcpulist(int argc, char **ar
         libxl_dominfo_list_free(dominfo, nb_domain);
     } else {
         for (; argc > 0; ++argv, --argc) {
-            if (domain_qualifier_to_domid(*argv, &domid, 0) < 0) {
-                fprintf(stderr, "%s is an invalid domain identifier\n", *argv);
-                goto vcpulist_out;
-            }
-
+            uint32_t domid = find_domain(*argv);
             print_domain_vcpuinfo(domid, physinfo.nr_cpus);
         }
     }
@@ -4204,7 +4199,7 @@ int main_vcpulist(int argc, char **argv)
     return 0;
 }
 
-static void vcpupin(const char *d, const char *vcpu, char *cpu)
+static void vcpupin(uint32_t domid, const char *vcpu, char *cpu)
 {
     libxl_vcpuinfo *vcpuinfo;
     libxl_bitmap cpumap;
@@ -4222,8 +4217,6 @@ static void vcpupin(const char *d, const
         vcpuid = -1;
     }
 
-    find_domain(d);
-
     if (libxl_cpu_bitmap_alloc(ctx, &cpumap, 0)) {
         goto vcpupin_out;
     }
@@ -4263,11 +4256,11 @@ int main_vcpupin(int argc, char **argv)
     if ((opt = def_getopt(argc, argv, "", "vcpu-pin", 3)) != -1)
         return opt;
 
-    vcpupin(argv[optind], argv[optind+1] , argv[optind+2]);
+    vcpupin(find_domain(argv[optind]), argv[optind+1] , argv[optind+2]);
     return 0;
 }
 
-static void vcpuset(const char *d, const char* nr_vcpus)
+static void vcpuset(uint32_t domid, const char* nr_vcpus)
 {
     char *endptr;
     unsigned int max_vcpus, i;
@@ -4279,8 +4272,6 @@ static void vcpuset(const char *d, const
         return;
     }
 
-    find_domain(d);
-
     if (libxl_cpu_bitmap_alloc(ctx, &cpumap, 0)) {
         fprintf(stderr, "libxl_cpu_bitmap_alloc failed\n");
         return;
@@ -4301,7 +4292,7 @@ int main_vcpuset(int argc, char **argv)
     if ((opt = def_getopt(argc, argv, "", "vcpu-set", 2)) != -1)
         return opt;
 
-    vcpuset(argv[optind], argv[optind+1]);
+    vcpuset(find_domain(argv[optind]), argv[optind+1]);
     return 0;
 }
 
@@ -4538,7 +4529,7 @@ int main_sharing(int argc, char **argv)
         }
         info_free = info;
     } else if (optind == argc-1) {
-        find_domain(argv[optind]);
+        uint32_t domid = 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",
@@ -4898,7 +4889,7 @@ int main_sched_credit(int argc, char **a
                                     sched_credit_pool_output,
                                     cpupool);
     } else {
-        find_domain(dom);
+        uint32_t domid = find_domain(dom);
 
         if (!opt_w && !opt_c) { /* output credit scheduler info */
             sched_credit_domain_output(-1);
@@ -4975,7 +4966,7 @@ int main_sched_credit2(int argc, char **
                                     sched_default_pool_output,
                                     cpupool);
     } else {
-        find_domain(dom);
+        uint32_t domid = find_domain(dom);
 
         if (!opt_w) { /* output credit2 scheduler info */
             sched_credit2_domain_output(-1);
@@ -5078,7 +5069,7 @@ int main_sched_sedf(int argc, char **arg
                                     sched_default_pool_output,
                                     cpupool);
     } else {
-        find_domain(dom);
+        uint32_t domid = find_domain(dom);
 
         if (!opt_p && !opt_s && !opt_l && !opt_e && !opt_w) {
             /* output sedf scheduler info */
@@ -5118,6 +5109,7 @@ int main_sched_sedf(int argc, char **arg
 
 int main_domid(int argc, char **argv)
 {
+    uint32_t domid;
     int opt;
     const char *domname = NULL;
 
@@ -5138,6 +5130,7 @@ int main_domid(int argc, char **argv)
 
 int main_domname(int argc, char **argv)
 {
+    uint32_t domid;
     int opt;
     char *domname = NULL;
     char *endptr = NULL;
@@ -5166,18 +5159,17 @@ int main_domname(int argc, char **argv)
 
 int main_rename(int argc, char **argv)
 {
+    uint32_t domid;
     int opt;
-    const char *dom;
-    const char *new_name;
+    const char *dom, *new_name;
 
     if ((opt = def_getopt(argc, argv, "", "rename", 2)) != -1)
         return opt;
 
     dom = argv[optind++];
-
-    find_domain(dom);
     new_name = argv[optind];
 
+    domid = find_domain(dom);
     if (libxl_domain_rename(ctx, domid, common_domname, new_name)) {
         fprintf(stderr, "Can't rename domain '%s'.\n", dom);
         return 1;
@@ -5188,9 +5180,9 @@ int main_rename(int argc, char **argv)
 
 int main_trigger(int argc, char **argv)
 {
+    uint32_t domid;
     int opt;
     char *endptr = NULL;
-    const char *dom = NULL;
     int vcpuid = 0;
     const char *trigger_name = NULL;
     libxl_trigger trigger;
@@ -5198,9 +5190,7 @@ int main_trigger(int argc, char **argv)
     if ((opt = def_getopt(argc, argv, "", "trigger", 2)) != -1)
         return opt;
 
-    dom = argv[optind++];
-
-    find_domain(dom);
+    domid = find_domain(argv[optind++]);
 
     trigger_name = argv[optind++];
     if (libxl_trigger_from_string(trigger_name, &trigger)) {
@@ -5223,16 +5213,14 @@ int main_trigger(int argc, char **argv)
 
 int main_sysrq(int argc, char **argv)
 {
+    uint32_t domid;
     int opt;
     const char *sysrq = NULL;
-    const char *dom = NULL;
 
     if ((opt = def_getopt(argc, argv, "", "sysrq", 2)) != -1)
         return opt;
 
-    dom = argv[optind++];
-
-    find_domain(dom);
+    domid = find_domain(argv[optind++]);
 
     sysrq = argv[optind];
 
@@ -5306,6 +5294,7 @@ int main_top(int argc, char **argv)
 
 int main_networkattach(int argc, char **argv)
 {
+    uint32_t domid;
     int opt;
     libxl_device_nic nic;
     XLU_Config *config = 0;
@@ -5322,10 +5311,7 @@ int main_networkattach(int argc, char **
         return 0;
     }
 
-    if (domain_qualifier_to_domid(argv[optind], &domid, 0) < 0) {
-        fprintf(stderr, "%s is an invalid domain identifier\n", argv[optind]);
-        return 1;
-    }
+    domid = find_domain(argv[optind]);
 
     config= xlu_cfg_init(stderr, "command line");
     if (!config) {
@@ -5411,10 +5397,7 @@ int main_networklist(int argc, char **ar
     printf("%-3s %-2s %-17s %-6s %-5s %-6s %5s/%-5s %-30s\n",
            "Idx", "BE", "Mac Addr.", "handle", "state", "evt-ch", "tx-", "rx-ring-ref", "BE-path");
     for (argv += optind, argc -= optind; argc > 0; --argc, ++argv) {
-        if (domain_qualifier_to_domid(*argv, &domid, 0) < 0) {
-            fprintf(stderr, "%s is an invalid domain identifier\n", *argv);
-            continue;
-        }
+        uint32_t domid = find_domain(*argv);
         nics = libxl_device_nic_list(ctx, domid, &nb);
         if (!nics) {
             continue;
@@ -5440,16 +5423,14 @@ int main_networklist(int argc, char **ar
 
 int main_networkdetach(int argc, char **argv)
 {
+    uint32_t domid;
     int opt;
     libxl_device_nic nic;
 
     if ((opt = def_getopt(argc, argv, "", "network-detach", 2)) != -1)
         return opt;
 
-    if (domain_qualifier_to_domid(argv[optind], &domid, 0) < 0) {
-        fprintf(stderr, "%s is an invalid domain identifier\n", argv[optind]);
-        return 1;
-    }
+    domid = find_domain(argv[optind]);
 
     if (!strchr(argv[optind+1], ':')) {
         if (libxl_devid_to_device_nic(ctx, domid, atoi(argv[optind+1]), &nic)) {
@@ -5518,6 +5499,7 @@ int main_blocklist(int argc, char **argv
     printf("%-5s %-3s %-6s %-5s %-6s %-8s %-30s\n",
            "Vdev", "BE", "handle", "state", "evt-ch", "ring-ref", "BE-path");
     for (argv += optind, argc -= optind; argc > 0; --argc, ++argv) {
+        uint32_t domid;
         if (domain_qualifier_to_domid(*argv, &domid, 0) < 0) {
             fprintf(stderr, "%s is an invalid domain identifier\n", *argv);
             continue;
@@ -5543,16 +5525,15 @@ int main_blocklist(int argc, char **argv
 
 int main_blockdetach(int argc, char **argv)
 {
+    uint32_t domid;
     int opt, rc = 0;
     libxl_device_disk disk;
 
     if ((opt = def_getopt(argc, argv, "", "block-detach", 2)) != -1)
         return opt;
 
-    if (domain_qualifier_to_domid(argv[optind], &domid, 0) < 0) {
-        fprintf(stderr, "%s is an invalid domain identifier\n", argv[optind]);
-        return 1;
-    }
+    domid = find_domain(argv[optind]);
+
     if (libxl_vdev_to_device_disk(ctx, domid, argv[optind+1], &disk)) {
         fprintf(stderr, "Error: Device %s not connected.\n", argv[optind+1]);
         return 1;
@@ -5726,7 +5707,7 @@ static void print_uptime(int short_mode,
 
 int main_uptime(int argc, char **argv)
 {
-    const char *dom = NULL;
+    const char *dom;
     int short_mode = 0;
     uint32_t domains[100];
     int nb_doms = 0;
@@ -5742,10 +5723,8 @@ int main_uptime(int argc, char **argv)
         }
     }
 
-    for (;(dom = argv[optind]) != NULL; nb_doms++,optind++) {
-        find_domain(dom);
-        domains[nb_doms] = domid;
-    }
+    for (;(dom = argv[optind]) != NULL; nb_doms++,optind++)
+        domains[nb_doms] = find_domain(dom);
 
     print_uptime(short_mode, domains, nb_doms);
 
@@ -5754,6 +5733,7 @@ int main_uptime(int argc, char **argv)
 
 int main_tmem_list(int argc, char **argv)
 {
+    uint32_t domid;
     const char *dom = NULL;
     char *buf = NULL;
     int use_long = 0;
@@ -5781,9 +5761,9 @@ int main_tmem_list(int argc, char **argv
     }
 
     if (all)
-        domid = -1;
+        domid = INVALID_DOMID;
     else
-        find_domain(dom);
+        domid = find_domain(dom);
 
     buf = libxl_tmem_list(ctx, domid, use_long);
     if (buf == NULL)
@@ -5796,6 +5776,7 @@ int main_tmem_list(int argc, char **argv
 
 int main_tmem_freeze(int argc, char **argv)
 {
+    uint32_t domid;
     const char *dom = NULL;
     int all = 0;
     int opt;
@@ -5818,9 +5799,9 @@ int main_tmem_freeze(int argc, char **ar
     }
 
     if (all)
-        domid = -1;
+        domid = INVALID_DOMID;
     else
-        find_domain(dom);
+        domid = find_domain(dom);
 
     libxl_tmem_freeze(ctx, domid);
     return 0;
@@ -5828,6 +5809,7 @@ int main_tmem_freeze(int argc, char **ar
 
 int main_tmem_thaw(int argc, char **argv)
 {
+    uint32_t domid;
     const char *dom = NULL;
     int all = 0;
     int opt;
@@ -5850,9 +5832,9 @@ int main_tmem_thaw(int argc, char **argv
     }
 
     if (all)
-        domid = -1;
+        domid = INVALID_DOMID;
     else
-        find_domain(dom);
+        domid = find_domain(dom);
 
     libxl_tmem_thaw(ctx, domid);
     return 0;
@@ -5860,6 +5842,7 @@ int main_tmem_thaw(int argc, char **argv
 
 int main_tmem_set(int argc, char **argv)
 {
+    uint32_t domid;
     const char *dom = NULL;
     uint32_t weight = 0, cap = 0, compress = 0;
     int opt_w = 0, opt_c = 0, opt_p = 0;
@@ -5896,9 +5879,9 @@ int main_tmem_set(int argc, char **argv)
     }
 
     if (all)
-        domid = -1;
+        domid = INVALID_DOMID;
     else
-        find_domain(dom);
+        domid = find_domain(dom);
 
     if (!opt_w && !opt_c && !opt_p) {
         fprintf(stderr, "No set value specified.\n\n");
@@ -5918,6 +5901,7 @@ int main_tmem_set(int argc, char **argv)
 
 int main_tmem_shared_auth(int argc, char **argv)
 {
+    uint32_t domid;
     const char *autharg = NULL;
     char *endptr = NULL;
     const char *dom = NULL;
@@ -5950,9 +5934,9 @@ int main_tmem_shared_auth(int argc, char
     }
 
     if (all)
-        domid = -1;
+        domid = INVALID_DOMID;
     else
-        find_domain(dom);
+        domid = find_domain(dom);
 
     if (uuid == NULL || autharg == NULL) {
         fprintf(stderr, "No uuid or auth specified.\n\n");
@@ -6705,9 +6689,10 @@ done:
 
 int main_remus(int argc, char **argv)
 {
+    uint32_t domid;
     int opt, rc, daemonize = 1;
     const char *ssh_command = "ssh";
-    char *host = NULL, *rune = NULL, *domain = NULL;
+    char *host = NULL, *rune = NULL;
     libxl_domain_remus_info r_info;
     int send_fd = -1, recv_fd = -1;
     pid_t child = -1;
@@ -6743,11 +6728,10 @@ int main_remus(int argc, char **argv)
         }
     }
 
-    domain = argv[optind];
+    domid = find_domain(argv[optind]);
     host = argv[optind + 1];
 
     if (r_info.blackhole) {
-        find_domain(domain);
         send_fd = open("/dev/null", O_RDWR, 0644);
         if (send_fd < 0) {
             perror("failed to open /dev/null");
@@ -6764,7 +6748,7 @@ int main_remus(int argc, char **argv)
                 return 1;
         }
 
-        save_domain_core_begin(domain, NULL, &config_data, &config_len);
+        save_domain_core_begin(domid, NULL, &config_data, &config_len);
 
         if (!config_len) {
             fprintf(stderr, "No config file stored for running domain and "

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

From xen-changelog-bounces@lists.xen.org Mon Sep 17 21:55:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Sep 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.xen.org>)
	id 1TDjHl-00015R-KU; Mon, 17 Sep 2012 21:55:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDjHj-00013l-HS
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:19 +0000
Received: from [85.158.139.211:25833] by server-4.bemta-5.messagelabs.com id
	CA/B9-23042-64C97505; Mon, 17 Sep 2012 21:55:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-206.messagelabs.com!1347918914!18962640!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28654 invoked from network); 17 Sep 2012 21:55:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Sep 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 1TDjHe-0003qd-Hq
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDjHe-00011D-1Z
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:14 +0000
Message-Id: <E1TDjHe-00011D-1Z@xenbits.xen.org>
Date: Mon, 17 Sep 2012 21:55:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl: Remove global domid and enable
	-Wshadow
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1347877022 -3600
# Node ID 4f3303d3de6935fd1e8c55a3327b6216f207b98c
# Parent  d91998a12405be7fe93102fc1b67a52bec492723
xl: Remove global domid and enable -Wshadow

Lots of functions loop over a list of domain and others take a domid as
a parameter, shadowing the global one and leading to all sorts of
confusion.

Therefore remove the global domid and explicitly pass it around as
necessary.

Adds a domid to the parameters for many functions and switches many
others from taking a char * domain specifier to taking a domid, pushing
the domid lookup to the toplevel.

Replaces some open-coded domain_qualifier_to_domid error checking with
find_domain.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
[ ijc -- annotate find_domain() with warn_unused_result and fix the
         handful of errors. ]
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r d91998a12405 -r 4f3303d3de69 tools/libxl/Makefile
--- a/tools/libxl/Makefile	Mon Sep 17 11:17:01 2012 +0100
+++ b/tools/libxl/Makefile	Mon Sep 17 11:17:02 2012 +0100
@@ -89,10 +89,13 @@ LIBXLU_OBJS = libxlu_cfg_y.o libxlu_cfg_
 
 CLIENTS = xl testidl libxl-save-helper
 
+CFLAGS_XL += $(CFLAGS_libxenlight)
+CFLAGS_XL += -Wshadow
+
 XL_OBJS = xl.o xl_cmdimpl.o xl_cmdtable.o xl_sxp.o
 $(XL_OBJS) _libxl.api-for-check: \
             CFLAGS += $(CFLAGS_libxenctrl) # For xentoollog.h
-$(XL_OBJS): CFLAGS += $(CFLAGS_libxenlight)
+$(XL_OBJS): CFLAGS += $(CFLAGS_XL)
 $(XL_OBJS): CFLAGS += -include $(XEN_ROOT)/tools/config.h # libxl_json.h needs it.
 
 SAVE_HELPER_OBJS = libxl_save_helper.o _libxl_save_msgs_helper.o
diff -r d91998a12405 -r 4f3303d3de69 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Mon Sep 17 11:17:01 2012 +0100
+++ b/tools/libxl/xl_cmdimpl.c	Mon Sep 17 11:17:02 2012 +0100
@@ -67,9 +67,7 @@ libxl_ctx *ctx;
 
 xlchild children[child_max];
 
-/* when we operate on a domain, it is this one: */
 #define INVALID_DOMID ~0
-static uint32_t domid = INVALID_DOMID;
 static const char *common_domname;
 static int fd_lock = -1;
 
@@ -197,8 +195,10 @@ static int cpupool_qualifier_to_cpupooli
     return was_name ? libxl_name_to_cpupoolid(ctx, p, poolid_r) : 0;
 }
 
-static void find_domain(const char *p)
-{
+static uint32_t find_domain(const char *p) __attribute__((warn_unused_result));
+static uint32_t find_domain(const char *p)
+{
+    uint32_t domid;
     int rc, was_name;
 
     rc = domain_qualifier_to_domid(p, &domid, &was_name);
@@ -207,6 +207,7 @@ static void find_domain(const char *p)
         exit(2);
     }
     common_domname = was_name ? p : libxl_domid_to_name(ctx, domid);
+    return domid;
 }
 
 static int vncviewer(uint32_t domid, int autopass)
@@ -1583,7 +1584,7 @@ static int preserve_domain(uint32_t *r_d
     return rc == 0 ? 1 : 0;
 }
 
-static int freemem(libxl_domain_build_info *b_info)
+static int freemem(uint32_t domid, libxl_domain_build_info *b_info)
 {
     int rc, retries = 3;
     uint32_t need_memkb, free_memkb;
@@ -1663,7 +1664,7 @@ static void autoconnect_console(libxl_ct
     _exit(1);
 }
 
-static int domain_wait_event(libxl_event **event_r)
+static int domain_wait_event(uint32_t domid, libxl_event **event_r)
 {
     int ret;
     for (;;) {
@@ -1697,8 +1698,10 @@ static void evdisable_disk_ejects(libxl_
     }
 }
 
-static int create_domain(struct domain_create *dom_info)
-{
+static uint32_t create_domain(struct domain_create *dom_info)
+{
+    uint32_t domid = INVALID_DOMID;
+
     libxl_domain_config d_config;
 
     int debug = dom_info->debug;
@@ -1874,7 +1877,7 @@ start:
     if (rc < 0)
         goto error_out;
 
-    ret = freemem(&d_config.b_info);
+    ret = freemem(domid, &d_config.b_info);
     if (ret < 0) {
         fprintf(stderr, "failed to free memory for the domain\n");
         ret = ERROR_FAIL;
@@ -2024,7 +2027,7 @@ start:
     }
     while (1) {
         libxl_event *event;
-        ret = domain_wait_event(&event);
+        ret = domain_wait_event(domid, &event);
         if (ret) goto out;
 
         switch (event->type) {
@@ -2236,13 +2239,11 @@ static int def_getopt(int argc, char * c
     return -1;
 }
 
-static int set_memory_max(const char *p, const char *mem)
+static int set_memory_max(uint32_t domid, const char *mem)
 {
     int64_t memorykb;
     int rc;
 
-    find_domain(p);
-
     memorykb = parse_mem_size_kb(mem);
     if (memorykb == -1) {
         fprintf(stderr, "invalid memory size: %s\n", mem);
@@ -2256,17 +2257,18 @@ static int set_memory_max(const char *p,
 
 int main_memmax(int argc, char **argv)
 {
+    uint32_t domid;
     int opt = 0;
-    char *p = NULL, *mem;
+    char *mem;
     int rc;
 
     if ((opt = def_getopt(argc, argv, "", "mem-max", 2)) != -1)
         return opt;
 
-    p = argv[optind];
+    domid = find_domain(argv[optind]);
     mem = argv[optind + 1];
 
-    rc = set_memory_max(p, mem);
+    rc = set_memory_max(domid, mem);
     if (rc) {
         fprintf(stderr, "cannot set domid %d static max memory to : %s\n", domid, mem);
         return 1;
@@ -2275,12 +2277,10 @@ int main_memmax(int argc, char **argv)
     return 0;
 }
 
-static void set_memory_target(const char *p, const char *mem)
+static void set_memory_target(uint32_t domid, const char *mem)
 {
     long long int memorykb;
 
-    find_domain(p);
-
     memorykb = parse_mem_size_kb(mem);
     if (memorykb == -1)  {
         fprintf(stderr, "invalid memory size: %s\n", mem);
@@ -2292,26 +2292,26 @@ static void set_memory_target(const char
 
 int main_memset(int argc, char **argv)
 {
+    uint32_t domid;
     int opt = 0;
-    const char *p = NULL, *mem;
+    const char *mem;
 
     if ((opt = def_getopt(argc, argv, "", "mem-set", 2)) != -1)
         return opt;
 
-    p = argv[optind];
+    domid = find_domain(argv[optind]);
     mem = argv[optind + 1];
 
-    set_memory_target(p, mem);
+    set_memory_target(domid, mem);
     return 0;
 }
 
-static void cd_insert(const char *dom, const char *virtdev, char *phys)
+static void cd_insert(uint32_t domid, const char *virtdev, char *phys)
 {
     libxl_device_disk disk; /* we don't free disk's contents */
     char *buf = NULL;
     XLU_Config *config = 0;
 
-    find_domain(dom);
 
     if (asprintf(&buf, "vdev=%s,access=r,devtype=cdrom,target=%s",
                  virtdev, phys ? phys : "") < 0) {
@@ -2331,38 +2331,41 @@ static void cd_insert(const char *dom, c
 
 int main_cd_eject(int argc, char **argv)
 {
+    uint32_t domid;
     int opt = 0;
-    const char *p = NULL, *virtdev;
+    const char *virtdev;
 
     if ((opt = def_getopt(argc, argv, "", "cd-eject", 2)) != -1)
         return opt;
 
-    p = argv[optind];
+    domid = find_domain(argv[optind]);
     virtdev = argv[optind + 1];
 
-    cd_insert(p, virtdev, NULL);
+    cd_insert(domid, virtdev, NULL);
     return 0;
 }
 
 int main_cd_insert(int argc, char **argv)
 {
+    uint32_t domid;
     int opt = 0;
-    const char *p = NULL, *virtdev;
+    const char *virtdev;
     char *file = NULL; /* modified by cd_insert tokenising it */
 
     if ((opt = def_getopt(argc, argv, "", "cd-insert", 3)) != -1)
         return opt;
 
-    p = argv[optind];
+    domid = find_domain(argv[optind]);
     virtdev = argv[optind + 1];
     file = argv[optind + 2];
 
-    cd_insert(p, virtdev, file);
+    cd_insert(domid, virtdev, file);
     return 0;
 }
 
 int main_console(int argc, char **argv)
 {
+    uint32_t domid;
     int opt = 0, num = 0;
     libxl_console_type type = 0;
 
@@ -2386,7 +2389,7 @@ int main_console(int argc, char **argv)
         }
     }
 
-    find_domain(argv[optind]);
+    domid = find_domain(argv[optind]);
     if (!type)
         libxl_primary_console_exec(ctx, domid);
     else
@@ -2403,6 +2406,7 @@ int main_vncviewer(int argc, char **argv
         {"help", 0, 0, 'h'},
         {0, 0, 0, 0}
     };
+    uint32_t domid;
     int opt, autopass = 0;
 
     while (1) {
@@ -2428,20 +2432,18 @@ int main_vncviewer(int argc, char **argv
         return 2;
     }
 
-    find_domain(argv[optind]);
+    domid = find_domain(argv[optind]);
 
     if (vncviewer(domid, autopass))
         return 1;
     return 0;
 }
 
-static void pcilist(const char *dom)
+static void pcilist(uint32_t domid)
 {
     libxl_device_pci *pcidevs;
     int num, i;
 
-    find_domain(dom);
-
     pcidevs = libxl_device_pci_list(ctx, domid, &num);
     if (pcidevs == NULL)
         return;
@@ -2457,27 +2459,25 @@ static void pcilist(const char *dom)
 
 int main_pcilist(int argc, char **argv)
 {
+    uint32_t domid;
     int opt;
-    const char *domname = NULL;
 
     if ((opt = def_getopt(argc, argv, "", "pci-list", 1)) != -1)
         return opt;
 
-    domname = argv[optind];
-
-    pcilist(domname);
+    domid = find_domain(argv[optind]);
+
+    pcilist(domid);
     return 0;
 }
 
-static void pcidetach(const char *dom, const char *bdf, int force)
+static void pcidetach(uint32_t domid, const char *bdf, int force)
 {
     libxl_device_pci pcidev;
     XLU_Config *config;
 
-    find_domain(dom);
-
     libxl_device_pci_init(&pcidev);
-    
+
     config = xlu_cfg_init(stderr, "command line");
     if (!config) { perror("xlu_cfg_inig"); exit(-1); }
 
@@ -2496,9 +2496,10 @@ static void pcidetach(const char *dom, c
 
 int main_pcidetach(int argc, char **argv)
 {
+    uint32_t domid;
     int opt;
     int force = 0;
-    const char *domname = NULL, *bdf = NULL;
+    const char *bdf = NULL;
 
     while ((opt = def_getopt(argc, argv, "f", "pci-detach", 2)) != -1) {
         switch (opt) {
@@ -2510,19 +2511,17 @@ int main_pcidetach(int argc, char **argv
         }
     }
 
-    domname = argv[optind];
+    domid = find_domain(argv[optind]);
     bdf = argv[optind + 1];
 
-    pcidetach(domname, bdf, force);
+    pcidetach(domid, bdf, force);
     return 0;
 }
-static void pciattach(const char *dom, const char *bdf, const char *vs)
+static void pciattach(uint32_t domid, const char *bdf, const char *vs)
 {
     libxl_device_pci pcidev;
     XLU_Config *config;
 
-    find_domain(dom);
-
     libxl_device_pci_init(&pcidev);
 
     config = xlu_cfg_init(stderr, "command line");
@@ -2540,19 +2539,20 @@ static void pciattach(const char *dom, c
 
 int main_pciattach(int argc, char **argv)
 {
+    uint32_t domid;
     int opt;
-    const char *domname = NULL, *bdf = NULL, *vs = NULL;
+    const char *bdf = NULL, *vs = NULL;
 
     if ((opt = def_getopt(argc, argv, "", "pci-attach", 2)) != -1)
         return opt;
 
-    domname = argv[optind];
+    domid = find_domain(argv[optind]);
     bdf = argv[optind + 1];
 
     if (optind + 1 < argc)
         vs = argv[optind + 2];
 
-    pciattach(domname, bdf, vs);
+    pciattach(domid, bdf, vs);
     return 0;
 }
 
@@ -2664,22 +2664,20 @@ int main_pciassignable_remove(int argc, 
     return 0;
 }
 
-static void pause_domain(const char *p)
-{
-    find_domain(p);
+static void pause_domain(uint32_t domid)
+{
     libxl_domain_pause(ctx, domid);
 }
 
-static void unpause_domain(const char *p)
-{
-    find_domain(p);
+static void unpause_domain(uint32_t domid)
+{
     libxl_domain_unpause(ctx, domid);
 }
 
-static void destroy_domain(const char *p)
+static void destroy_domain(uint32_t domid)
 {
     int rc;
-    find_domain(p);
+
     if (domid == 0) {
         fprintf(stderr, "Cannot destroy privileged domain 0.\n\n");
         exit(-1);
@@ -2688,13 +2686,12 @@ static void destroy_domain(const char *p
     if (rc) { fprintf(stderr,"destroy failed (rc=%d)\n",rc); exit(-1); }
 }
 
-static void shutdown_domain(const char *p, int wait_for_it,
+static void shutdown_domain(uint32_t domid, int wait_for_it,
                             int fallback_trigger)
 {
     int rc;
     libxl_event *event;
 
-    find_domain(p);
     rc=libxl_domain_shutdown(ctx, domid);
     if (rc == ERROR_NOPARAVIRT) {
         if (fallback_trigger) {
@@ -2721,7 +2718,7 @@ static void shutdown_domain(const char *
         }
 
         for (;;) {
-            rc = domain_wait_event(&event);
+            rc = domain_wait_event(domid, &event);
             if (rc) exit(-1);
 
             switch (event->type) {
@@ -2748,10 +2745,10 @@ static void shutdown_domain(const char *
     }
 }
 
-static void reboot_domain(const char *p, int fallback_trigger)
+static void reboot_domain(uint32_t domid, int fallback_trigger)
 {
     int rc;
-    find_domain(p);
+
     rc=libxl_domain_reboot(ctx, domid);
     if (rc == ERROR_NOPARAVIRT) {
         if (fallback_trigger) {
@@ -2808,7 +2805,7 @@ static void list_domains_details(const l
         if (default_output_format == OUTPUT_FORMAT_JSON)
             s = printf_info_one_json(hand, info[i].domid, &d_config);
         else
-            printf_info_sexp(domid, &d_config);
+            printf_info_sexp(info[i].domid, &d_config);
         libxl_domain_config_dispose(&d_config);
         free(data);
         free(config_source);
@@ -2910,15 +2907,13 @@ static void list_vm(void)
     libxl_vminfo_list_free(info, nb_vm);
 }
 
-static void save_domain_core_begin(const char *domain_spec,
+static void save_domain_core_begin(uint32_t domid,
                                    const char *override_config_file,
                                    uint8_t **config_data_r,
                                    int *config_len_r)
 {
     int rc;
 
-    find_domain(domain_spec);
-
     /* configuration file in optional data: */
 
     if (override_config_file) {
@@ -2975,14 +2970,15 @@ static void save_domain_core_writeconfig
             hdr.optional_data_len);
 }
 
-static int save_domain(const char *p, const char *filename, int checkpoint,
+static int save_domain(uint32_t domid, const char *filename, int checkpoint,
                 const char *override_config_file)
 {
     int fd;
     uint8_t *config_data;
     int config_len;
 
-    save_domain_core_begin(p, override_config_file, &config_data, &config_len);
+    save_domain_core_begin(domid, override_config_file,
+                           &config_data, &config_len);
 
     if (!config_len) {
         fputs(" Savefile will not contain xl domain config\n", stderr);
@@ -3152,7 +3148,7 @@ static void migrate_do_preamble(int send
 
 }
 
-static void migrate_domain(const char *domain_spec, const char *rune,
+static void migrate_domain(uint32_t domid, const char *rune,
                            const char *override_config_file)
 {
     pid_t child = -1;
@@ -3163,7 +3159,7 @@ static void migrate_domain(const char *d
     uint8_t *config_data;
     int config_len;
 
-    save_domain_core_begin(domain_spec, override_config_file,
+    save_domain_core_begin(domid, override_config_file,
                            &config_data, &config_len);
 
     if (!config_len) {
@@ -3290,10 +3286,10 @@ static void migrate_domain(const char *d
     exit(-ERROR_BADFAIL);
 }
 
-static void core_dump_domain(const char *domain_spec, const char *filename)
+static void core_dump_domain(uint32_t domid, const char *filename)
 {
     int rc;
-    find_domain(domain_spec);
+
     rc=libxl_domain_core_dump(ctx, domid, filename, NULL);
     if (rc) { fprintf(stderr,"core dump failed (rc=%d)\n",rc);exit(-1); }
 }
@@ -3301,6 +3297,7 @@ static void core_dump_domain(const char 
 static void migrate_receive(int debug, int daemonize, int monitor,
                             int send_fd, int recv_fd, int remus)
 {
+    uint32_t domid;
     int rc, rc2;
     char rc_buf;
     char *migration_domname;
@@ -3332,6 +3329,8 @@ static void migrate_receive(int debug, i
         exit(-rc);
     }
 
+    domid = rc;
+
     if (remus) {
         /* If we are here, it means that the sender (primary) has crashed.
          * TODO: Split-Brain Check.
@@ -3550,7 +3549,8 @@ int main_migrate_receive(int argc, char 
 
 int main_save(int argc, char **argv)
 {
-    const char *filename, *p;
+    uint32_t domid;
+    const char *filename;
     const char *config_filename = NULL;
     int checkpoint = 0;
     int opt;
@@ -3570,18 +3570,18 @@ int main_save(int argc, char **argv)
         return 2;
     }
 
-    p = argv[optind];
+    domid = find_domain(argv[optind]);
     filename = argv[optind + 1];
     if ( argc - optind >= 3 )
         config_filename = argv[optind + 2];
 
-    save_domain(p, filename, checkpoint, config_filename);
+    save_domain(domid, filename, checkpoint, config_filename);
     return 0;
 }
 
 int main_migrate(int argc, char **argv)
 {
-    const char *p = NULL;
+    uint32_t domid;
     const char *config_filename = NULL;
     const char *ssh_command = "ssh";
     char *rune = NULL;
@@ -3611,7 +3611,7 @@ int main_migrate(int argc, char **argv)
         }
     }
 
-    p = argv[optind];
+    domid = find_domain(argv[optind]);
     host = argv[optind + 1];
 
     if (!ssh_command[0]) {
@@ -3624,7 +3624,7 @@ int main_migrate(int argc, char **argv)
             return 1;
     }
 
-    migrate_domain(p, rune, config_filename);
+    migrate_domain(domid, rune, config_filename);
     return 0;
 }
 
@@ -3635,7 +3635,7 @@ int main_dump_core(int argc, char **argv
     if ((opt = def_getopt(argc, argv, "", "dump-core", 2)) != -1)
         return opt;
 
-    core_dump_domain(argv[optind], argv[optind + 1]);
+    core_dump_domain(find_domain(argv[optind]), argv[optind + 1]);
     return 0;
 }
 
@@ -3646,7 +3646,7 @@ int main_pause(int argc, char **argv)
     if ((opt = def_getopt(argc, argv, "", "pause", 1)) != -1)
         return opt;
 
-    pause_domain(argv[optind]);
+    pause_domain(find_domain(argv[optind]));
 
     return 0;
 }
@@ -3658,7 +3658,7 @@ int main_unpause(int argc, char **argv)
     if ((opt = def_getopt(argc, argv, "", "unpause", 1)) != -1)
         return opt;
 
-    unpause_domain(argv[optind]);
+    unpause_domain(find_domain(argv[optind]));
 
     return 0;
 }
@@ -3670,7 +3670,7 @@ int main_destroy(int argc, char **argv)
     if ((opt = def_getopt(argc, argv, "", "destroy", 1)) != -1)
         return opt;
 
-    destroy_domain(argv[optind]);
+    destroy_domain(find_domain(argv[optind]));
     return 0;
 }
 
@@ -3693,7 +3693,7 @@ int main_shutdown(int argc, char **argv)
         }
     }
 
-    shutdown_domain(argv[optind], wait_for_it, fallback_trigger);
+    shutdown_domain(find_domain(argv[optind]), wait_for_it, fallback_trigger);
     return 0;
 }
 
@@ -3712,7 +3712,7 @@ int main_reboot(int argc, char **argv)
         }
     }
 
-    reboot_domain(argv[optind], fallback_trigger);
+    reboot_domain(find_domain(argv[optind]), fallback_trigger);
     return 0;
 }
 
@@ -3766,7 +3766,7 @@ int main_list(int argc, char **argv)
         }
         info_free = info;
     } else if (optind == argc-1) {
-        find_domain(argv[optind]);
+        uint32_t domid = 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",
@@ -3915,6 +3915,7 @@ int main_create(int argc, char **argv)
 
 int main_config_update(int argc, char **argv)
 {
+    uint32_t domid;
     const char *filename = NULL;
     char *p;
     char extra_config[1024];
@@ -3936,7 +3937,7 @@ int main_config_update(int argc, char **
         exit(1);
     }
 
-    find_domain(argv[1]);
+    domid = find_domain(argv[1]);
     argc--; argv++;
 
     if (argv[1] && argv[1][0] != '-' && !strchr(argv[1], '=')) {
@@ -4027,12 +4028,10 @@ int main_config_update(int argc, char **
     return 0;
 }
 
-static void button_press(const char *p, const char *b)
+static void button_press(uint32_t domid, const char *b)
 {
     libxl_trigger trigger;
 
-    find_domain(p);
-
     if (!strcmp(b, "power")) {
         trigger = LIBXL_TRIGGER_POWER;
     } else if (!strcmp(b, "sleep")) {
@@ -4055,7 +4054,7 @@ int main_button_press(int argc, char **a
     if ((opt = def_getopt(argc, argv, "", "button-press", 2)) != -1)
         return opt;
 
-    button_press(argv[optind], argv[optind + 1]);
+    button_press(find_domain(argv[optind]), argv[optind + 1]);
 
     return 0;
 }
@@ -4181,11 +4180,7 @@ static void vcpulist(int argc, char **ar
         libxl_dominfo_list_free(dominfo, nb_domain);
     } else {
         for (; argc > 0; ++argv, --argc) {
-            if (domain_qualifier_to_domid(*argv, &domid, 0) < 0) {
-                fprintf(stderr, "%s is an invalid domain identifier\n", *argv);
-                goto vcpulist_out;
-            }
-
+            uint32_t domid = find_domain(*argv);
             print_domain_vcpuinfo(domid, physinfo.nr_cpus);
         }
     }
@@ -4204,7 +4199,7 @@ int main_vcpulist(int argc, char **argv)
     return 0;
 }
 
-static void vcpupin(const char *d, const char *vcpu, char *cpu)
+static void vcpupin(uint32_t domid, const char *vcpu, char *cpu)
 {
     libxl_vcpuinfo *vcpuinfo;
     libxl_bitmap cpumap;
@@ -4222,8 +4217,6 @@ static void vcpupin(const char *d, const
         vcpuid = -1;
     }
 
-    find_domain(d);
-
     if (libxl_cpu_bitmap_alloc(ctx, &cpumap, 0)) {
         goto vcpupin_out;
     }
@@ -4263,11 +4256,11 @@ int main_vcpupin(int argc, char **argv)
     if ((opt = def_getopt(argc, argv, "", "vcpu-pin", 3)) != -1)
         return opt;
 
-    vcpupin(argv[optind], argv[optind+1] , argv[optind+2]);
+    vcpupin(find_domain(argv[optind]), argv[optind+1] , argv[optind+2]);
     return 0;
 }
 
-static void vcpuset(const char *d, const char* nr_vcpus)
+static void vcpuset(uint32_t domid, const char* nr_vcpus)
 {
     char *endptr;
     unsigned int max_vcpus, i;
@@ -4279,8 +4272,6 @@ static void vcpuset(const char *d, const
         return;
     }
 
-    find_domain(d);
-
     if (libxl_cpu_bitmap_alloc(ctx, &cpumap, 0)) {
         fprintf(stderr, "libxl_cpu_bitmap_alloc failed\n");
         return;
@@ -4301,7 +4292,7 @@ int main_vcpuset(int argc, char **argv)
     if ((opt = def_getopt(argc, argv, "", "vcpu-set", 2)) != -1)
         return opt;
 
-    vcpuset(argv[optind], argv[optind+1]);
+    vcpuset(find_domain(argv[optind]), argv[optind+1]);
     return 0;
 }
 
@@ -4538,7 +4529,7 @@ int main_sharing(int argc, char **argv)
         }
         info_free = info;
     } else if (optind == argc-1) {
-        find_domain(argv[optind]);
+        uint32_t domid = 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",
@@ -4898,7 +4889,7 @@ int main_sched_credit(int argc, char **a
                                     sched_credit_pool_output,
                                     cpupool);
     } else {
-        find_domain(dom);
+        uint32_t domid = find_domain(dom);
 
         if (!opt_w && !opt_c) { /* output credit scheduler info */
             sched_credit_domain_output(-1);
@@ -4975,7 +4966,7 @@ int main_sched_credit2(int argc, char **
                                     sched_default_pool_output,
                                     cpupool);
     } else {
-        find_domain(dom);
+        uint32_t domid = find_domain(dom);
 
         if (!opt_w) { /* output credit2 scheduler info */
             sched_credit2_domain_output(-1);
@@ -5078,7 +5069,7 @@ int main_sched_sedf(int argc, char **arg
                                     sched_default_pool_output,
                                     cpupool);
     } else {
-        find_domain(dom);
+        uint32_t domid = find_domain(dom);
 
         if (!opt_p && !opt_s && !opt_l && !opt_e && !opt_w) {
             /* output sedf scheduler info */
@@ -5118,6 +5109,7 @@ int main_sched_sedf(int argc, char **arg
 
 int main_domid(int argc, char **argv)
 {
+    uint32_t domid;
     int opt;
     const char *domname = NULL;
 
@@ -5138,6 +5130,7 @@ int main_domid(int argc, char **argv)
 
 int main_domname(int argc, char **argv)
 {
+    uint32_t domid;
     int opt;
     char *domname = NULL;
     char *endptr = NULL;
@@ -5166,18 +5159,17 @@ int main_domname(int argc, char **argv)
 
 int main_rename(int argc, char **argv)
 {
+    uint32_t domid;
     int opt;
-    const char *dom;
-    const char *new_name;
+    const char *dom, *new_name;
 
     if ((opt = def_getopt(argc, argv, "", "rename", 2)) != -1)
         return opt;
 
     dom = argv[optind++];
-
-    find_domain(dom);
     new_name = argv[optind];
 
+    domid = find_domain(dom);
     if (libxl_domain_rename(ctx, domid, common_domname, new_name)) {
         fprintf(stderr, "Can't rename domain '%s'.\n", dom);
         return 1;
@@ -5188,9 +5180,9 @@ int main_rename(int argc, char **argv)
 
 int main_trigger(int argc, char **argv)
 {
+    uint32_t domid;
     int opt;
     char *endptr = NULL;
-    const char *dom = NULL;
     int vcpuid = 0;
     const char *trigger_name = NULL;
     libxl_trigger trigger;
@@ -5198,9 +5190,7 @@ int main_trigger(int argc, char **argv)
     if ((opt = def_getopt(argc, argv, "", "trigger", 2)) != -1)
         return opt;
 
-    dom = argv[optind++];
-
-    find_domain(dom);
+    domid = find_domain(argv[optind++]);
 
     trigger_name = argv[optind++];
     if (libxl_trigger_from_string(trigger_name, &trigger)) {
@@ -5223,16 +5213,14 @@ int main_trigger(int argc, char **argv)
 
 int main_sysrq(int argc, char **argv)
 {
+    uint32_t domid;
     int opt;
     const char *sysrq = NULL;
-    const char *dom = NULL;
 
     if ((opt = def_getopt(argc, argv, "", "sysrq", 2)) != -1)
         return opt;
 
-    dom = argv[optind++];
-
-    find_domain(dom);
+    domid = find_domain(argv[optind++]);
 
     sysrq = argv[optind];
 
@@ -5306,6 +5294,7 @@ int main_top(int argc, char **argv)
 
 int main_networkattach(int argc, char **argv)
 {
+    uint32_t domid;
     int opt;
     libxl_device_nic nic;
     XLU_Config *config = 0;
@@ -5322,10 +5311,7 @@ int main_networkattach(int argc, char **
         return 0;
     }
 
-    if (domain_qualifier_to_domid(argv[optind], &domid, 0) < 0) {
-        fprintf(stderr, "%s is an invalid domain identifier\n", argv[optind]);
-        return 1;
-    }
+    domid = find_domain(argv[optind]);
 
     config= xlu_cfg_init(stderr, "command line");
     if (!config) {
@@ -5411,10 +5397,7 @@ int main_networklist(int argc, char **ar
     printf("%-3s %-2s %-17s %-6s %-5s %-6s %5s/%-5s %-30s\n",
            "Idx", "BE", "Mac Addr.", "handle", "state", "evt-ch", "tx-", "rx-ring-ref", "BE-path");
     for (argv += optind, argc -= optind; argc > 0; --argc, ++argv) {
-        if (domain_qualifier_to_domid(*argv, &domid, 0) < 0) {
-            fprintf(stderr, "%s is an invalid domain identifier\n", *argv);
-            continue;
-        }
+        uint32_t domid = find_domain(*argv);
         nics = libxl_device_nic_list(ctx, domid, &nb);
         if (!nics) {
             continue;
@@ -5440,16 +5423,14 @@ int main_networklist(int argc, char **ar
 
 int main_networkdetach(int argc, char **argv)
 {
+    uint32_t domid;
     int opt;
     libxl_device_nic nic;
 
     if ((opt = def_getopt(argc, argv, "", "network-detach", 2)) != -1)
         return opt;
 
-    if (domain_qualifier_to_domid(argv[optind], &domid, 0) < 0) {
-        fprintf(stderr, "%s is an invalid domain identifier\n", argv[optind]);
-        return 1;
-    }
+    domid = find_domain(argv[optind]);
 
     if (!strchr(argv[optind+1], ':')) {
         if (libxl_devid_to_device_nic(ctx, domid, atoi(argv[optind+1]), &nic)) {
@@ -5518,6 +5499,7 @@ int main_blocklist(int argc, char **argv
     printf("%-5s %-3s %-6s %-5s %-6s %-8s %-30s\n",
            "Vdev", "BE", "handle", "state", "evt-ch", "ring-ref", "BE-path");
     for (argv += optind, argc -= optind; argc > 0; --argc, ++argv) {
+        uint32_t domid;
         if (domain_qualifier_to_domid(*argv, &domid, 0) < 0) {
             fprintf(stderr, "%s is an invalid domain identifier\n", *argv);
             continue;
@@ -5543,16 +5525,15 @@ int main_blocklist(int argc, char **argv
 
 int main_blockdetach(int argc, char **argv)
 {
+    uint32_t domid;
     int opt, rc = 0;
     libxl_device_disk disk;
 
     if ((opt = def_getopt(argc, argv, "", "block-detach", 2)) != -1)
         return opt;
 
-    if (domain_qualifier_to_domid(argv[optind], &domid, 0) < 0) {
-        fprintf(stderr, "%s is an invalid domain identifier\n", argv[optind]);
-        return 1;
-    }
+    domid = find_domain(argv[optind]);
+
     if (libxl_vdev_to_device_disk(ctx, domid, argv[optind+1], &disk)) {
         fprintf(stderr, "Error: Device %s not connected.\n", argv[optind+1]);
         return 1;
@@ -5726,7 +5707,7 @@ static void print_uptime(int short_mode,
 
 int main_uptime(int argc, char **argv)
 {
-    const char *dom = NULL;
+    const char *dom;
     int short_mode = 0;
     uint32_t domains[100];
     int nb_doms = 0;
@@ -5742,10 +5723,8 @@ int main_uptime(int argc, char **argv)
         }
     }
 
-    for (;(dom = argv[optind]) != NULL; nb_doms++,optind++) {
-        find_domain(dom);
-        domains[nb_doms] = domid;
-    }
+    for (;(dom = argv[optind]) != NULL; nb_doms++,optind++)
+        domains[nb_doms] = find_domain(dom);
 
     print_uptime(short_mode, domains, nb_doms);
 
@@ -5754,6 +5733,7 @@ int main_uptime(int argc, char **argv)
 
 int main_tmem_list(int argc, char **argv)
 {
+    uint32_t domid;
     const char *dom = NULL;
     char *buf = NULL;
     int use_long = 0;
@@ -5781,9 +5761,9 @@ int main_tmem_list(int argc, char **argv
     }
 
     if (all)
-        domid = -1;
+        domid = INVALID_DOMID;
     else
-        find_domain(dom);
+        domid = find_domain(dom);
 
     buf = libxl_tmem_list(ctx, domid, use_long);
     if (buf == NULL)
@@ -5796,6 +5776,7 @@ int main_tmem_list(int argc, char **argv
 
 int main_tmem_freeze(int argc, char **argv)
 {
+    uint32_t domid;
     const char *dom = NULL;
     int all = 0;
     int opt;
@@ -5818,9 +5799,9 @@ int main_tmem_freeze(int argc, char **ar
     }
 
     if (all)
-        domid = -1;
+        domid = INVALID_DOMID;
     else
-        find_domain(dom);
+        domid = find_domain(dom);
 
     libxl_tmem_freeze(ctx, domid);
     return 0;
@@ -5828,6 +5809,7 @@ int main_tmem_freeze(int argc, char **ar
 
 int main_tmem_thaw(int argc, char **argv)
 {
+    uint32_t domid;
     const char *dom = NULL;
     int all = 0;
     int opt;
@@ -5850,9 +5832,9 @@ int main_tmem_thaw(int argc, char **argv
     }
 
     if (all)
-        domid = -1;
+        domid = INVALID_DOMID;
     else
-        find_domain(dom);
+        domid = find_domain(dom);
 
     libxl_tmem_thaw(ctx, domid);
     return 0;
@@ -5860,6 +5842,7 @@ int main_tmem_thaw(int argc, char **argv
 
 int main_tmem_set(int argc, char **argv)
 {
+    uint32_t domid;
     const char *dom = NULL;
     uint32_t weight = 0, cap = 0, compress = 0;
     int opt_w = 0, opt_c = 0, opt_p = 0;
@@ -5896,9 +5879,9 @@ int main_tmem_set(int argc, char **argv)
     }
 
     if (all)
-        domid = -1;
+        domid = INVALID_DOMID;
     else
-        find_domain(dom);
+        domid = find_domain(dom);
 
     if (!opt_w && !opt_c && !opt_p) {
         fprintf(stderr, "No set value specified.\n\n");
@@ -5918,6 +5901,7 @@ int main_tmem_set(int argc, char **argv)
 
 int main_tmem_shared_auth(int argc, char **argv)
 {
+    uint32_t domid;
     const char *autharg = NULL;
     char *endptr = NULL;
     const char *dom = NULL;
@@ -5950,9 +5934,9 @@ int main_tmem_shared_auth(int argc, char
     }
 
     if (all)
-        domid = -1;
+        domid = INVALID_DOMID;
     else
-        find_domain(dom);
+        domid = find_domain(dom);
 
     if (uuid == NULL || autharg == NULL) {
         fprintf(stderr, "No uuid or auth specified.\n\n");
@@ -6705,9 +6689,10 @@ done:
 
 int main_remus(int argc, char **argv)
 {
+    uint32_t domid;
     int opt, rc, daemonize = 1;
     const char *ssh_command = "ssh";
-    char *host = NULL, *rune = NULL, *domain = NULL;
+    char *host = NULL, *rune = NULL;
     libxl_domain_remus_info r_info;
     int send_fd = -1, recv_fd = -1;
     pid_t child = -1;
@@ -6743,11 +6728,10 @@ int main_remus(int argc, char **argv)
         }
     }
 
-    domain = argv[optind];
+    domid = find_domain(argv[optind]);
     host = argv[optind + 1];
 
     if (r_info.blackhole) {
-        find_domain(domain);
         send_fd = open("/dev/null", O_RDWR, 0644);
         if (send_fd < 0) {
             perror("failed to open /dev/null");
@@ -6764,7 +6748,7 @@ int main_remus(int argc, char **argv)
                 return 1;
         }
 
-        save_domain_core_begin(domain, NULL, &config_data, &config_len);
+        save_domain_core_begin(domid, NULL, &config_data, &config_len);
 
         if (!config_len) {
             fprintf(stderr, "No config file stored for running domain and "

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

From xen-changelog-bounces@lists.xen.org Mon Sep 17 21:55:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Sep 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.xen.org>)
	id 1TDjHl-00015G-Cg; Mon, 17 Sep 2012 21:55:21 +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 1TDjHj-00013u-Gt
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:19 +0000
Received: from [85.158.138.51:61475] by server-6.bemta-3.messagelabs.com id
	1F/78-29694-64C97505; Mon, 17 Sep 2012 21:55:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-174.messagelabs.com!1347918916!22847322!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11132 invoked from network); 17 Sep 2012 21:55:17 -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;
	17 Sep 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 1TDjHg-0003qm-43
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDjHf-00011w-WD
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:16 +0000
Message-Id: <E1TDjHf-00011w-WD@xenbits.xen.org>
Date: Mon, 17 Sep 2012 21:55:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools: drop ia64 only foreign
	structs from headers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1347877025 -3600
# Node ID 3bf63fcfacd1945381d34911d10b298e0df3883e
# Parent  2082884b43ab6dd59516625d409b45e035664495
tools: drop ia64 only foreign structs from headers

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 2082884b43ab -r 3bf63fcfacd1 tools/include/xen-foreign/reference.size
--- a/tools/include/xen-foreign/reference.size	Mon Sep 17 11:17:04 2012 +0100
+++ b/tools/include/xen-foreign/reference.size	Mon Sep 17 11:17:05 2012 +0100
@@ -3,12 +3,7 @@ structs                   |  x86_32  x86
 
 start_info                |    1112    1168
 trap_info                 |       8      16
-pt_fpreg                  |       -       -
 cpu_user_regs             |      68     200
-xen_ia64_boot_param       |       -       -
-ia64_tr_entry             |       -       -
-vcpu_tr_regs              |       -       -
-vcpu_guest_context_regs   |       -       -
 vcpu_guest_context        |    2800    5168
 arch_vcpu_info            |      24      16
 vcpu_time_info            |      32      32
diff -r 2082884b43ab -r 3bf63fcfacd1 tools/include/xen-foreign/structs.py
--- a/tools/include/xen-foreign/structs.py	Mon Sep 17 11:17:04 2012 +0100
+++ b/tools/include/xen-foreign/structs.py	Mon Sep 17 11:17:05 2012 +0100
@@ -5,12 +5,7 @@ unions  = [ "vcpu_cr_regs",
 
 structs = [ "start_info",
             "trap_info",
-            "pt_fpreg",
             "cpu_user_regs",
-            "xen_ia64_boot_param",
-            "ia64_tr_entry",
-            "vcpu_tr_regs",
-            "vcpu_guest_context_regs",
             "vcpu_guest_context",
             "arch_vcpu_info",
             "vcpu_time_info",
@@ -48,9 +43,6 @@ defines = [ "__i386__",
             "_VGCF_online",
             "VGCF_online",
 
-            # ia64
-            "VGCF_EXTRA_REGS",
-
             # all archs
             "xen_pfn_to_cr3",
             "xen_cr3_to_pfn",

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

From xen-changelog-bounces@lists.xen.org Mon Sep 17 21:55:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Sep 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.xen.org>)
	id 1TDjHl-00015L-HL; Mon, 17 Sep 2012 21: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 1TDjHj-00012Z-Gb
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-27.messagelabs.com!1347918911!11398357!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7958 invoked from network); 17 Sep 2012 21:55:12 -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;
	17 Sep 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 1TDjHb-0003qU-AU
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDjHb-0000zl-1n
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:11 +0000
Message-Id: <E1TDjHb-0000zl-1n@xenbits.xen.org>
Date: Mon, 17 Sep 2012 21:55:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl: free libxl context,
	logger and lockfile using atexit handler
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1347877019 -3600
# Node ID 98ca21138ce8f60a1a862860f9d6a709a5235a0f
# Parent  51408c3528030309e8f064bf6a3c96b37de7dc96
xl: free libxl context, logger and lockfile using atexit handler

xl frequently just calls exit(3), especially on error. Try to clean
up some of our global state to make tools like valgrind more useful.

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


diff -r 51408c352803 -r 98ca21138ce8 tools/libxl/xl.c
--- a/tools/libxl/xl.c	Mon Sep 17 10:09:59 2012 +0200
+++ b/tools/libxl/xl.c	Mon Sep 17 11:16:59 2012 +0100
@@ -191,6 +191,22 @@ void xl_ctx_alloc(void) {
     libxl_childproc_setmode(ctx, &childproc_hooks, 0);
 }
 
+static void xl_ctx_free(void)
+{
+    if (ctx) {
+        libxl_ctx_free(ctx);
+        ctx = NULL;
+    }
+    if (logger) {
+        xtl_logger_destroy((xentoollog_logger*)logger);
+        logger = NULL;
+    }
+    if (lockfile) {
+        free(lockfile);
+        lockfile = NULL;
+    }
+}
+
 int main(int argc, char **argv)
 {
     int opt = 0;
@@ -229,6 +245,8 @@ int main(int argc, char **argv)
     logger = xtl_createlogger_stdiostream(stderr, minmsglevel,  0);
     if (!logger) exit(1);
 
+    atexit(xl_ctx_free);
+
     xl_ctx_alloc();
 
     ret = libxl_read_file_contents(ctx, XL_GLOBAL_CONFIG,
@@ -274,8 +292,6 @@ int main(int argc, char **argv)
     }
 
  xit:
-    libxl_ctx_free(ctx);
-    xtl_logger_destroy((xentoollog_logger*)logger);
     return ret;
 }
 

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

From xen-changelog-bounces@lists.xen.org Mon Sep 17 21:55:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Sep 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.xen.org>)
	id 1TDjHl-00015L-HL; Mon, 17 Sep 2012 21: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 1TDjHj-00012Z-Gb
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-27.messagelabs.com!1347918911!11398357!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7958 invoked from network); 17 Sep 2012 21:55:12 -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;
	17 Sep 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 1TDjHb-0003qU-AU
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDjHb-0000zl-1n
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:11 +0000
Message-Id: <E1TDjHb-0000zl-1n@xenbits.xen.org>
Date: Mon, 17 Sep 2012 21:55:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl: free libxl context,
	logger and lockfile using atexit handler
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1347877019 -3600
# Node ID 98ca21138ce8f60a1a862860f9d6a709a5235a0f
# Parent  51408c3528030309e8f064bf6a3c96b37de7dc96
xl: free libxl context, logger and lockfile using atexit handler

xl frequently just calls exit(3), especially on error. Try to clean
up some of our global state to make tools like valgrind more useful.

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


diff -r 51408c352803 -r 98ca21138ce8 tools/libxl/xl.c
--- a/tools/libxl/xl.c	Mon Sep 17 10:09:59 2012 +0200
+++ b/tools/libxl/xl.c	Mon Sep 17 11:16:59 2012 +0100
@@ -191,6 +191,22 @@ void xl_ctx_alloc(void) {
     libxl_childproc_setmode(ctx, &childproc_hooks, 0);
 }
 
+static void xl_ctx_free(void)
+{
+    if (ctx) {
+        libxl_ctx_free(ctx);
+        ctx = NULL;
+    }
+    if (logger) {
+        xtl_logger_destroy((xentoollog_logger*)logger);
+        logger = NULL;
+    }
+    if (lockfile) {
+        free(lockfile);
+        lockfile = NULL;
+    }
+}
+
 int main(int argc, char **argv)
 {
     int opt = 0;
@@ -229,6 +245,8 @@ int main(int argc, char **argv)
     logger = xtl_createlogger_stdiostream(stderr, minmsglevel,  0);
     if (!logger) exit(1);
 
+    atexit(xl_ctx_free);
+
     xl_ctx_alloc();
 
     ret = libxl_read_file_contents(ctx, XL_GLOBAL_CONFIG,
@@ -274,8 +292,6 @@ int main(int argc, char **argv)
     }
 
  xit:
-    libxl_ctx_free(ctx);
-    xtl_logger_destroy((xentoollog_logger*)logger);
     return ret;
 }
 

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

From xen-changelog-bounces@lists.xen.org Mon Sep 17 21:55:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Sep 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.xen.org>)
	id 1TDjHl-00015G-Cg; Mon, 17 Sep 2012 21:55:21 +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 1TDjHj-00013u-Gt
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:19 +0000
Received: from [85.158.138.51:61475] by server-6.bemta-3.messagelabs.com id
	1F/78-29694-64C97505; Mon, 17 Sep 2012 21:55:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-174.messagelabs.com!1347918916!22847322!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11132 invoked from network); 17 Sep 2012 21:55:17 -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;
	17 Sep 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 1TDjHg-0003qm-43
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDjHf-00011w-WD
	for xen-changelog@lists.xensource.com; Mon, 17 Sep 2012 21:55:16 +0000
Message-Id: <E1TDjHf-00011w-WD@xenbits.xen.org>
Date: Mon, 17 Sep 2012 21:55:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools: drop ia64 only foreign
	structs from headers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1347877025 -3600
# Node ID 3bf63fcfacd1945381d34911d10b298e0df3883e
# Parent  2082884b43ab6dd59516625d409b45e035664495
tools: drop ia64 only foreign structs from headers

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 2082884b43ab -r 3bf63fcfacd1 tools/include/xen-foreign/reference.size
--- a/tools/include/xen-foreign/reference.size	Mon Sep 17 11:17:04 2012 +0100
+++ b/tools/include/xen-foreign/reference.size	Mon Sep 17 11:17:05 2012 +0100
@@ -3,12 +3,7 @@ structs                   |  x86_32  x86
 
 start_info                |    1112    1168
 trap_info                 |       8      16
-pt_fpreg                  |       -       -
 cpu_user_regs             |      68     200
-xen_ia64_boot_param       |       -       -
-ia64_tr_entry             |       -       -
-vcpu_tr_regs              |       -       -
-vcpu_guest_context_regs   |       -       -
 vcpu_guest_context        |    2800    5168
 arch_vcpu_info            |      24      16
 vcpu_time_info            |      32      32
diff -r 2082884b43ab -r 3bf63fcfacd1 tools/include/xen-foreign/structs.py
--- a/tools/include/xen-foreign/structs.py	Mon Sep 17 11:17:04 2012 +0100
+++ b/tools/include/xen-foreign/structs.py	Mon Sep 17 11:17:05 2012 +0100
@@ -5,12 +5,7 @@ unions  = [ "vcpu_cr_regs",
 
 structs = [ "start_info",
             "trap_info",
-            "pt_fpreg",
             "cpu_user_regs",
-            "xen_ia64_boot_param",
-            "ia64_tr_entry",
-            "vcpu_tr_regs",
-            "vcpu_guest_context_regs",
             "vcpu_guest_context",
             "arch_vcpu_info",
             "vcpu_time_info",
@@ -48,9 +43,6 @@ defines = [ "__i386__",
             "_VGCF_online",
             "VGCF_online",
 
-            # ia64
-            "VGCF_EXTRA_REGS",
-
             # all archs
             "xen_pfn_to_cr3",
             "xen_cr3_to_pfn",

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

From xen-changelog-bounces@lists.xen.org Tue Sep 18 01:44:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Sep 2012 01:44:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TDmrG-00026R-DU; Tue, 18 Sep 2012 01:44: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 1TDmrF-00026C-Iu
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 01:44:13 +0000
Received: from [85.158.137.99:43365] by server-12.bemta-3.messagelabs.com id
	E8/26-10384-CE1D7505; Tue, 18 Sep 2012 01:44:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-217.messagelabs.com!1347932651!13325098!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28010 invoked from network); 18 Sep 2012 01:44:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Sep 2012 01:44: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 1TDmrC-0006vv-N3
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 01:44:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDmrC-0007Ec-8t
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 01:44:10 +0000
Message-Id: <E1TDmrC-0007Ec-8t@xenbits.xen.org>
Date: Tue, 18 Sep 2012 01:44:09 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Added tag RELEASE-4.2.0 for
	changeset af176624c3ae
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347870305 -3600
# Node ID fcf43d9649cdd01f6185b32f2ac747e3b52b4e50
# Parent  af176624c3ae86141a4ad8617b5ec2a834a6c626
Added tag RELEASE-4.2.0 for changeset af176624c3ae
---


diff -r af176624c3ae -r fcf43d9649cd .hgtags
--- a/.hgtags	Mon Sep 17 09:24:34 2012 +0100
+++ b/.hgtags	Mon Sep 17 09:25:05 2012 +0100
@@ -58,3 +58,4 @@ d44f290e81df5f78f0e3545742e3c4ff5415b0a7
 68640a3c99cefa86ae70fc49871025864e5671f2 4.2.0-rc4
 528f0708b6db392e10303b7ed2ab529bb8b512b7 4.2.0-branched
 14164c5f22c88a9dc1cfd7178f84a7fab2b82aa8 4.2.0-rc5
+af176624c3ae86141a4ad8617b5ec2a834a6c626 RELEASE-4.2.0

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

From xen-changelog-bounces@lists.xen.org Tue Sep 18 01:44:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Sep 2012 01:44:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TDmrG-00026R-DU; Tue, 18 Sep 2012 01:44: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 1TDmrF-00026C-Iu
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 01:44:13 +0000
Received: from [85.158.137.99:43365] by server-12.bemta-3.messagelabs.com id
	E8/26-10384-CE1D7505; Tue, 18 Sep 2012 01:44:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-217.messagelabs.com!1347932651!13325098!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28010 invoked from network); 18 Sep 2012 01:44:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Sep 2012 01:44: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 1TDmrC-0006vv-N3
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 01:44:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDmrC-0007Ec-8t
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 01:44:10 +0000
Message-Id: <E1TDmrC-0007Ec-8t@xenbits.xen.org>
Date: Tue, 18 Sep 2012 01:44:09 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Added tag RELEASE-4.2.0 for
	changeset af176624c3ae
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347870305 -3600
# Node ID fcf43d9649cdd01f6185b32f2ac747e3b52b4e50
# Parent  af176624c3ae86141a4ad8617b5ec2a834a6c626
Added tag RELEASE-4.2.0 for changeset af176624c3ae
---


diff -r af176624c3ae -r fcf43d9649cd .hgtags
--- a/.hgtags	Mon Sep 17 09:24:34 2012 +0100
+++ b/.hgtags	Mon Sep 17 09:25:05 2012 +0100
@@ -58,3 +58,4 @@ d44f290e81df5f78f0e3545742e3c4ff5415b0a7
 68640a3c99cefa86ae70fc49871025864e5671f2 4.2.0-rc4
 528f0708b6db392e10303b7ed2ab529bb8b512b7 4.2.0-branched
 14164c5f22c88a9dc1cfd7178f84a7fab2b82aa8 4.2.0-rc5
+af176624c3ae86141a4ad8617b5ec2a834a6c626 RELEASE-4.2.0

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

From xen-changelog-bounces@lists.xen.org Tue Sep 18 01:44:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Sep 2012 01:44:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TDmrG-00026M-At; Tue, 18 Sep 2012 01:44:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDmrF-00026B-0U
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 01:44:13 +0000
Received: from [85.158.139.211:60799] by server-6.bemta-5.messagelabs.com id
	C9/D5-21336-CE1D7505; Tue, 18 Sep 2012 01:44:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-206.messagelabs.com!1347932650!18945621!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2688 invoked from network); 18 Sep 2012 01:44:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Sep 2012 01: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 1TDmrC-0006vs-17
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 01:44:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDmrB-0007EL-Lh
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 01:44:09 +0000
Message-Id: <E1TDmrB-0007EL-Lh@xenbits.xen.org>
Date: Tue, 18 Sep 2012 01:44:09 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Update Xen version to 4.2.0
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347870274 -3600
# Node ID af176624c3ae86141a4ad8617b5ec2a834a6c626
# Parent  4027d31caeb0955cf72e8df85e5dc89777761939
Update Xen version to 4.2.0
---


diff -r 4027d31caeb0 -r af176624c3ae Config.mk
--- a/Config.mk	Thu Sep 13 12:21:09 2012 +0100
+++ b/Config.mk	Mon Sep 17 09:24:34 2012 +0100
@@ -202,7 +202,7 @@ QEMU_UPSTREAM_URL ?= git://xenbits.xen.o
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 OVMF_UPSTREAM_REVISION ?= b0855f925c6e2e0b21fbb03fab4b5fb5b6876871
-QEMU_UPSTREAM_REVISION ?= qemu-xen-4.2.0-rc5
+QEMU_UPSTREAM_REVISION ?= qemu-xen-4.2.0
 SEABIOS_UPSTREAM_TAG ?= rel-1.6.3.2
 # Sun Mar 11 09:27:07 2012 -0400
 # Update version to 1.6.3.2
@@ -214,7 +214,7 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= xen-4.2.0-rc5
+QEMU_TAG ?= xen-4.2.0
 
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.
diff -r 4027d31caeb0 -r af176624c3ae xen/Makefile
--- a/xen/Makefile	Thu Sep 13 12:21:09 2012 +0100
+++ b/xen/Makefile	Mon Sep 17 09:24:34 2012 +0100
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 2
-export XEN_EXTRAVERSION ?= .0-rc5$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .0$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 

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

From xen-changelog-bounces@lists.xen.org Tue Sep 18 01:44:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Sep 2012 01:44:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TDmrG-00026M-At; Tue, 18 Sep 2012 01:44:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDmrF-00026B-0U
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 01:44:13 +0000
Received: from [85.158.139.211:60799] by server-6.bemta-5.messagelabs.com id
	C9/D5-21336-CE1D7505; Tue, 18 Sep 2012 01:44:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-206.messagelabs.com!1347932650!18945621!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2688 invoked from network); 18 Sep 2012 01:44:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Sep 2012 01: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 1TDmrC-0006vs-17
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 01:44:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDmrB-0007EL-Lh
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 01:44:09 +0000
Message-Id: <E1TDmrB-0007EL-Lh@xenbits.xen.org>
Date: Tue, 18 Sep 2012 01:44:09 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Update Xen version to 4.2.0
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347870274 -3600
# Node ID af176624c3ae86141a4ad8617b5ec2a834a6c626
# Parent  4027d31caeb0955cf72e8df85e5dc89777761939
Update Xen version to 4.2.0
---


diff -r 4027d31caeb0 -r af176624c3ae Config.mk
--- a/Config.mk	Thu Sep 13 12:21:09 2012 +0100
+++ b/Config.mk	Mon Sep 17 09:24:34 2012 +0100
@@ -202,7 +202,7 @@ QEMU_UPSTREAM_URL ?= git://xenbits.xen.o
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 OVMF_UPSTREAM_REVISION ?= b0855f925c6e2e0b21fbb03fab4b5fb5b6876871
-QEMU_UPSTREAM_REVISION ?= qemu-xen-4.2.0-rc5
+QEMU_UPSTREAM_REVISION ?= qemu-xen-4.2.0
 SEABIOS_UPSTREAM_TAG ?= rel-1.6.3.2
 # Sun Mar 11 09:27:07 2012 -0400
 # Update version to 1.6.3.2
@@ -214,7 +214,7 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= xen-4.2.0-rc5
+QEMU_TAG ?= xen-4.2.0
 
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.
diff -r 4027d31caeb0 -r af176624c3ae xen/Makefile
--- a/xen/Makefile	Thu Sep 13 12:21:09 2012 +0100
+++ b/xen/Makefile	Mon Sep 17 09:24:34 2012 +0100
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 2
-export XEN_EXTRAVERSION ?= .0-rc5$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .0$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 

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

From xen-changelog-bounces@lists.xen.org Tue Sep 18 01:44:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Sep 2012 01:44:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TDmrM-00027M-GA; Tue, 18 Sep 2012 01:44: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 1TDmrK-00026D-LM
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 01:44:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-27.messagelabs.com!1347932651!11412984!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22490 invoked from network); 18 Sep 2012 01:44:12 -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;
	18 Sep 2012 01:44: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 1TDmrC-0006vy-Vv
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 01:44:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDmrC-0007Er-Q3
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 01:44:10 +0000
Message-Id: <E1TDmrC-0007Er-Q3@xenbits.xen.org>
Date: Tue, 18 Sep 2012 01:44:10 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Added signature for changeset
	af176624c3ae
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347870324 -3600
# Node ID 357bd4bb295017b1113c402af97316624707b30c
# Parent  fcf43d9649cdd01f6185b32f2ac747e3b52b4e50
Added signature for changeset af176624c3ae
---


diff -r fcf43d9649cd -r 357bd4bb2950 .hgsigs
--- a/.hgsigs	Mon Sep 17 09:25:05 2012 +0100
+++ b/.hgsigs	Mon Sep 17 09:25:24 2012 +0100
@@ -10,3 +10,4 @@ f4c47bcc01e13cb2e3b4b71fd588d86278875442
 d44f290e81df5f78f0e3545742e3c4ff5415b0a7 0 iQEcBAABAgAGBQJQNji7AAoJEIP+FMlX6CvZvBcIAJPiA6ydvolYCvZsfGgafqCpcpG3f+PbUOwQRWfUcaKHPWFKnwRkmx9MAP9tEjXFNZcbimktDrofmee6XfLb8NLnCcHWZT8trRXYTNw2lM6DpK+AROUpAcShF3gCHQEtCJC6+NArD75aUkUji3awbGlhplHbyWvgvSSULhga+2xfYszRC7eI/g+7/f4JNkvqeWllAtd9fwftXaGhQi2V4LT5IimpJI7PivlDi0wi+BtqXHcmZhlnw3zpR51NRujsMVTNZMqe733kGdt8Y8j3vvsfXBye4+YAkEKFrzW3jTYlA9ws71oNVvWmwmOjOHpx6ASfquP3hhAoiHvb2c6Wims=
 68640a3c99cefa86ae70fc49871025864e5671f2 0 iQEcBAABAgAGBQJQSdgUAAoJEIP+FMlX6CvZeWUH/1SeYnKXtkt7n+WuMyF2LvCzZQApmOo+hqVB7m0Pe4Yh9bEq1PAE+sJOAoQIBklCpY3WFsNGQN8yIbYyWRzbIM7oavknwoUoSn50zMk12HczqHigXvhL/eOghRKNsK9BrQnRV+byNHRjzSHPReNxpzueKBOTrCMlXtYMDb94swc+hatEDItT4TwZcaNPri3kiWND0DPmOk58Ke96ml9rpomS1ff976hYAZl+N1Q3Pt998SXiaglZ9EeL0Y8cY759XqZII4D4o6/oQW8MzWrQZr4woHHU7MfK3OWslelzP486esHyyjotEWeelhgl/RjIl0crNBbmCWU15BOAw7wSZh4=
 14164c5f22c88a9dc1cfd7178f84a7fab2b82aa8 0 iQEcBAABAgAGBQJQUcGjAAoJEIP+FMlX6CvZvX4H/1QV1VSW//dsv8IVCHPnHO4njlqYNUgIRycS4EuCJ8SrFLgfR77y3DwJg1D+JrYIT80QfzNeU3g/bcqz+0koD/P7joV4ONFkrB7pHSfACmMY7nfQ1Z2qHePAfBQ+cVdx6rXEYkFAbPjOz6kAP3LmpRLPasU46H+oG1zKHRgc0uhNN3Vit7eIhx/hDvY2YZDjuIWCQpmJylRlJsvMbpk2CjLiy4nXMNTKd1nlTNPTuRISsVBLx/ToquWtiO2a2EVRE4E+JhRGHNdFwXBRfV1XDDVNNRj+SvDvyWs29WKEOfVyGpgAKd29j/5YPzuHqmCcCfNxuN6lDHL6NxtwjZdDJao=
+af176624c3ae86141a4ad8617b5ec2a834a6c626 0 iQEcBAABAgAGBQJQVt5zAAoJEIP+FMlX6CvZ2q4H/2eEMxgwzflIPj88Y/jE1z8dTJ8E2l2FTBziMlmFYkmsiqx+BlGz9kk610DQo4mJoHrRSZOcZX0/NNUuCZntRizEorBQUcBEOBJQgTLzaxatPR49W5N7gOgqwNuWplKV0Aor7X0qX+wFZ4kZdBuqOimV7Mw43L1LsskcuDmqi8Ipvbf+JjnRPXpeTlxBOD+52ZhAirxvpA+LZfLIIYV9lx3SB7z7okxlBS+rlyL+h9cuwthWO3545QPlwXcSBY9r9m9/5ZtAiID5935JDdZGd7Dt/ZmikVs9xE6QHrHmWZFDfqgGPOmYFmVhJxk1xwwUbor3qaiUjTwfjM+zAIqtNv4=

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

From xen-changelog-bounces@lists.xen.org Tue Sep 18 01:44:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Sep 2012 01:44:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TDmrM-00027M-GA; Tue, 18 Sep 2012 01:44: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 1TDmrK-00026D-LM
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 01:44:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-27.messagelabs.com!1347932651!11412984!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22490 invoked from network); 18 Sep 2012 01:44:12 -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;
	18 Sep 2012 01:44: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 1TDmrC-0006vy-Vv
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 01:44:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDmrC-0007Er-Q3
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 01:44:10 +0000
Message-Id: <E1TDmrC-0007Er-Q3@xenbits.xen.org>
Date: Tue, 18 Sep 2012 01:44:10 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Added signature for changeset
	af176624c3ae
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1347870324 -3600
# Node ID 357bd4bb295017b1113c402af97316624707b30c
# Parent  fcf43d9649cdd01f6185b32f2ac747e3b52b4e50
Added signature for changeset af176624c3ae
---


diff -r fcf43d9649cd -r 357bd4bb2950 .hgsigs
--- a/.hgsigs	Mon Sep 17 09:25:05 2012 +0100
+++ b/.hgsigs	Mon Sep 17 09:25:24 2012 +0100
@@ -10,3 +10,4 @@ f4c47bcc01e13cb2e3b4b71fd588d86278875442
 d44f290e81df5f78f0e3545742e3c4ff5415b0a7 0 iQEcBAABAgAGBQJQNji7AAoJEIP+FMlX6CvZvBcIAJPiA6ydvolYCvZsfGgafqCpcpG3f+PbUOwQRWfUcaKHPWFKnwRkmx9MAP9tEjXFNZcbimktDrofmee6XfLb8NLnCcHWZT8trRXYTNw2lM6DpK+AROUpAcShF3gCHQEtCJC6+NArD75aUkUji3awbGlhplHbyWvgvSSULhga+2xfYszRC7eI/g+7/f4JNkvqeWllAtd9fwftXaGhQi2V4LT5IimpJI7PivlDi0wi+BtqXHcmZhlnw3zpR51NRujsMVTNZMqe733kGdt8Y8j3vvsfXBye4+YAkEKFrzW3jTYlA9ws71oNVvWmwmOjOHpx6ASfquP3hhAoiHvb2c6Wims=
 68640a3c99cefa86ae70fc49871025864e5671f2 0 iQEcBAABAgAGBQJQSdgUAAoJEIP+FMlX6CvZeWUH/1SeYnKXtkt7n+WuMyF2LvCzZQApmOo+hqVB7m0Pe4Yh9bEq1PAE+sJOAoQIBklCpY3WFsNGQN8yIbYyWRzbIM7oavknwoUoSn50zMk12HczqHigXvhL/eOghRKNsK9BrQnRV+byNHRjzSHPReNxpzueKBOTrCMlXtYMDb94swc+hatEDItT4TwZcaNPri3kiWND0DPmOk58Ke96ml9rpomS1ff976hYAZl+N1Q3Pt998SXiaglZ9EeL0Y8cY759XqZII4D4o6/oQW8MzWrQZr4woHHU7MfK3OWslelzP486esHyyjotEWeelhgl/RjIl0crNBbmCWU15BOAw7wSZh4=
 14164c5f22c88a9dc1cfd7178f84a7fab2b82aa8 0 iQEcBAABAgAGBQJQUcGjAAoJEIP+FMlX6CvZvX4H/1QV1VSW//dsv8IVCHPnHO4njlqYNUgIRycS4EuCJ8SrFLgfR77y3DwJg1D+JrYIT80QfzNeU3g/bcqz+0koD/P7joV4ONFkrB7pHSfACmMY7nfQ1Z2qHePAfBQ+cVdx6rXEYkFAbPjOz6kAP3LmpRLPasU46H+oG1zKHRgc0uhNN3Vit7eIhx/hDvY2YZDjuIWCQpmJylRlJsvMbpk2CjLiy4nXMNTKd1nlTNPTuRISsVBLx/ToquWtiO2a2EVRE4E+JhRGHNdFwXBRfV1XDDVNNRj+SvDvyWs29WKEOfVyGpgAKd29j/5YPzuHqmCcCfNxuN6lDHL6NxtwjZdDJao=
+af176624c3ae86141a4ad8617b5ec2a834a6c626 0 iQEcBAABAgAGBQJQVt5zAAoJEIP+FMlX6CvZ2q4H/2eEMxgwzflIPj88Y/jE1z8dTJ8E2l2FTBziMlmFYkmsiqx+BlGz9kk610DQo4mJoHrRSZOcZX0/NNUuCZntRizEorBQUcBEOBJQgTLzaxatPR49W5N7gOgqwNuWplKV0Aor7X0qX+wFZ4kZdBuqOimV7Mw43L1LsskcuDmqi8Ipvbf+JjnRPXpeTlxBOD+52ZhAirxvpA+LZfLIIYV9lx3SB7z7okxlBS+rlyL+h9cuwthWO3545QPlwXcSBY9r9m9/5ZtAiID5935JDdZGd7Dt/ZmikVs9xE6QHrHmWZFDfqgGPOmYFmVhJxk1xwwUbor3qaiUjTwfjM+zAIqtNv4=

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

From xen-changelog-bounces@lists.xen.org Tue Sep 18 08:22:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Sep 2012 08:22:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TDt4R-0007ok-04; Tue, 18 Sep 2012 08:22:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDt4Q-0007oH-53
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:14 +0000
Received: from [85.158.143.99:12859] by server-1.bemta-4.messagelabs.com id
	4D/0D-12504-43F28505; Tue, 18 Sep 2012 08:22:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-216.messagelabs.com!1347956531!30189698!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14459 invoked from network); 18 Sep 2012 08:22:12 -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;
	18 Sep 2012 08: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 1TDt4M-0004Jf-S1
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDt4M-0000h8-KM
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:10 +0000
Message-Id: <E1TDt4M-0000h8-KM@xenbits.xen.org>
Date: Tue, 18 Sep 2012 08:22:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: add virtual x2apic support for
	apicv
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jiongxi Li <jiongxi.li@intel.com>
# Date 1347912362 -3600
# Node ID c2578dd96b8318e108fff0f340411135dedaa47d
# Parent  713b8849b11afa05f1dde157a3f5086fa3aaad08
xen: add virtual x2apic support for apicv

basically to benefit from apicv, we need clear MSR bitmap for
corresponding x2apic MSRs:
  0x800 - 0x8ff: no read intercept for apicv register virtualization
  TPR,EOI,SELF-IPI: no write intercept for virtual interrupt
    delivery

Signed-off-by: Jiongxi Li <jiongxi.li@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 713b8849b11a -r c2578dd96b83 xen/arch/x86/hvm/vmx/vmcs.c
--- a/xen/arch/x86/hvm/vmx/vmcs.c	Mon Sep 17 21:05:11 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vmcs.c	Mon Sep 17 21:06:02 2012 +0100
@@ -643,7 +643,7 @@ static void vmx_set_host_env(struct vcpu
               (unsigned long)&get_cpu_info()->guest_cpu_user_regs.error_code);
 }
 
-void vmx_disable_intercept_for_msr(struct vcpu *v, u32 msr)
+void vmx_disable_intercept_for_msr(struct vcpu *v, u32 msr, int type)
 {
     unsigned long *msr_bitmap = v->arch.hvm_vmx.msr_bitmap;
 
@@ -658,14 +658,18 @@ void vmx_disable_intercept_for_msr(struc
      */
     if ( msr <= 0x1fff )
     {
-        __clear_bit(msr, msr_bitmap + 0x000/BYTES_PER_LONG); /* read-low */
-        __clear_bit(msr, msr_bitmap + 0x800/BYTES_PER_LONG); /* write-low */
+        if (type & MSR_TYPE_R)
+            __clear_bit(msr, msr_bitmap + 0x000/BYTES_PER_LONG); /* read-low */
+        if (type & MSR_TYPE_W)
+            __clear_bit(msr, msr_bitmap + 0x800/BYTES_PER_LONG); /* write-low */
     }
     else if ( (msr >= 0xc0000000) && (msr <= 0xc0001fff) )
     {
         msr &= 0x1fff;
-        __clear_bit(msr, msr_bitmap + 0x400/BYTES_PER_LONG); /* read-high */
-        __clear_bit(msr, msr_bitmap + 0xc00/BYTES_PER_LONG); /* write-high */
+        if (type & MSR_TYPE_R)
+            __clear_bit(msr, msr_bitmap + 0x400/BYTES_PER_LONG); /* read-high */
+        if (type & MSR_TYPE_W)
+            __clear_bit(msr, msr_bitmap + 0xc00/BYTES_PER_LONG); /* write-high */
     }
 }
 
@@ -761,13 +765,25 @@ static int construct_vmcs(struct vcpu *v
         v->arch.hvm_vmx.msr_bitmap = msr_bitmap;
         __vmwrite(MSR_BITMAP, virt_to_maddr(msr_bitmap));
 
-        vmx_disable_intercept_for_msr(v, MSR_FS_BASE);
-        vmx_disable_intercept_for_msr(v, MSR_GS_BASE);
-        vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_CS);
-        vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_ESP);
-        vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_EIP);
+        vmx_disable_intercept_for_msr(v, MSR_FS_BASE, MSR_TYPE_R | MSR_TYPE_W);
+        vmx_disable_intercept_for_msr(v, MSR_GS_BASE, MSR_TYPE_R | MSR_TYPE_W);
+        vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_CS, MSR_TYPE_R | MSR_TYPE_W);
+        vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_ESP, MSR_TYPE_R | MSR_TYPE_W);
+        vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_EIP, MSR_TYPE_R | MSR_TYPE_W);
         if ( cpu_has_vmx_pat && paging_mode_hap(d) )
-            vmx_disable_intercept_for_msr(v, MSR_IA32_CR_PAT);
+            vmx_disable_intercept_for_msr(v, MSR_IA32_CR_PAT, MSR_TYPE_R | MSR_TYPE_W);
+        if ( cpu_has_vmx_apic_reg_virt )
+        {
+            int msr;
+            for (msr = MSR_IA32_APICBASE_MSR; msr <= MSR_IA32_APICBASE_MSR + 0xff; msr++)
+                vmx_disable_intercept_for_msr(v, msr, MSR_TYPE_R);
+        }
+        if ( cpu_has_vmx_virtual_intr_delivery )
+        {
+            vmx_disable_intercept_for_msr(v, MSR_IA32_APICTPR_MSR, MSR_TYPE_W);
+            vmx_disable_intercept_for_msr(v, MSR_IA32_APICEOI_MSR, MSR_TYPE_W);
+            vmx_disable_intercept_for_msr(v, MSR_IA32_APICSELF_MSR, MSR_TYPE_W);
+        }
     }
 
     /* I/O access bitmap. */
diff -r 713b8849b11a -r c2578dd96b83 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Mon Sep 17 21:05:11 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Mon Sep 17 21:06:02 2012 +0100
@@ -1962,7 +1962,7 @@ static int vmx_msr_write_intercept(unsig
             for ( ; (rc == 0) && lbr->count; lbr++ )
                 for ( i = 0; (rc == 0) && (i < lbr->count); i++ )
                     if ( (rc = vmx_add_guest_msr(lbr->base + i)) == 0 )
-                        vmx_disable_intercept_for_msr(v, lbr->base + i);
+                        vmx_disable_intercept_for_msr(v, lbr->base + i, MSR_TYPE_R | MSR_TYPE_W);
         }
 
         if ( (rc < 0) ||
diff -r 713b8849b11a -r c2578dd96b83 xen/include/asm-x86/hvm/vmx/vmcs.h
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h	Mon Sep 17 21:05:11 2012 +0100
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h	Mon Sep 17 21:06:02 2012 +0100
@@ -405,7 +405,9 @@ enum vmcs_field {
 
 #define VMCS_VPID_WIDTH 16
 
-void vmx_disable_intercept_for_msr(struct vcpu *v, u32 msr);
+#define MSR_TYPE_R 1
+#define MSR_TYPE_W 2
+void vmx_disable_intercept_for_msr(struct vcpu *v, u32 msr, int type);
 int vmx_read_guest_msr(u32 msr, u64 *val);
 int vmx_write_guest_msr(u32 msr, u64 val);
 int vmx_add_guest_msr(u32 msr);
diff -r 713b8849b11a -r c2578dd96b83 xen/include/asm-x86/msr-index.h
--- a/xen/include/asm-x86/msr-index.h	Mon Sep 17 21:05:11 2012 +0100
+++ b/xen/include/asm-x86/msr-index.h	Mon Sep 17 21:06:02 2012 +0100
@@ -291,6 +291,9 @@
 #define MSR_IA32_APICBASE_ENABLE	(1<<11)
 #define MSR_IA32_APICBASE_BASE		(0xfffff<<12)
 #define MSR_IA32_APICBASE_MSR           0x800
+#define MSR_IA32_APICTPR_MSR            0x808
+#define MSR_IA32_APICEOI_MSR            0x80b
+#define MSR_IA32_APICSELF_MSR           0x83f
 
 #define MSR_IA32_UCODE_WRITE		0x00000079
 #define MSR_IA32_UCODE_REV		0x0000008b

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

From xen-changelog-bounces@lists.xen.org Tue Sep 18 08:22:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Sep 2012 08:22:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TDt4R-0007ok-04; Tue, 18 Sep 2012 08:22:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDt4Q-0007oH-53
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:14 +0000
Received: from [85.158.143.99:12859] by server-1.bemta-4.messagelabs.com id
	4D/0D-12504-43F28505; Tue, 18 Sep 2012 08:22:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-216.messagelabs.com!1347956531!30189698!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14459 invoked from network); 18 Sep 2012 08:22:12 -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;
	18 Sep 2012 08: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 1TDt4M-0004Jf-S1
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDt4M-0000h8-KM
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:10 +0000
Message-Id: <E1TDt4M-0000h8-KM@xenbits.xen.org>
Date: Tue, 18 Sep 2012 08:22:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: add virtual x2apic support for
	apicv
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jiongxi Li <jiongxi.li@intel.com>
# Date 1347912362 -3600
# Node ID c2578dd96b8318e108fff0f340411135dedaa47d
# Parent  713b8849b11afa05f1dde157a3f5086fa3aaad08
xen: add virtual x2apic support for apicv

basically to benefit from apicv, we need clear MSR bitmap for
corresponding x2apic MSRs:
  0x800 - 0x8ff: no read intercept for apicv register virtualization
  TPR,EOI,SELF-IPI: no write intercept for virtual interrupt
    delivery

Signed-off-by: Jiongxi Li <jiongxi.li@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 713b8849b11a -r c2578dd96b83 xen/arch/x86/hvm/vmx/vmcs.c
--- a/xen/arch/x86/hvm/vmx/vmcs.c	Mon Sep 17 21:05:11 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vmcs.c	Mon Sep 17 21:06:02 2012 +0100
@@ -643,7 +643,7 @@ static void vmx_set_host_env(struct vcpu
               (unsigned long)&get_cpu_info()->guest_cpu_user_regs.error_code);
 }
 
-void vmx_disable_intercept_for_msr(struct vcpu *v, u32 msr)
+void vmx_disable_intercept_for_msr(struct vcpu *v, u32 msr, int type)
 {
     unsigned long *msr_bitmap = v->arch.hvm_vmx.msr_bitmap;
 
@@ -658,14 +658,18 @@ void vmx_disable_intercept_for_msr(struc
      */
     if ( msr <= 0x1fff )
     {
-        __clear_bit(msr, msr_bitmap + 0x000/BYTES_PER_LONG); /* read-low */
-        __clear_bit(msr, msr_bitmap + 0x800/BYTES_PER_LONG); /* write-low */
+        if (type & MSR_TYPE_R)
+            __clear_bit(msr, msr_bitmap + 0x000/BYTES_PER_LONG); /* read-low */
+        if (type & MSR_TYPE_W)
+            __clear_bit(msr, msr_bitmap + 0x800/BYTES_PER_LONG); /* write-low */
     }
     else if ( (msr >= 0xc0000000) && (msr <= 0xc0001fff) )
     {
         msr &= 0x1fff;
-        __clear_bit(msr, msr_bitmap + 0x400/BYTES_PER_LONG); /* read-high */
-        __clear_bit(msr, msr_bitmap + 0xc00/BYTES_PER_LONG); /* write-high */
+        if (type & MSR_TYPE_R)
+            __clear_bit(msr, msr_bitmap + 0x400/BYTES_PER_LONG); /* read-high */
+        if (type & MSR_TYPE_W)
+            __clear_bit(msr, msr_bitmap + 0xc00/BYTES_PER_LONG); /* write-high */
     }
 }
 
@@ -761,13 +765,25 @@ static int construct_vmcs(struct vcpu *v
         v->arch.hvm_vmx.msr_bitmap = msr_bitmap;
         __vmwrite(MSR_BITMAP, virt_to_maddr(msr_bitmap));
 
-        vmx_disable_intercept_for_msr(v, MSR_FS_BASE);
-        vmx_disable_intercept_for_msr(v, MSR_GS_BASE);
-        vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_CS);
-        vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_ESP);
-        vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_EIP);
+        vmx_disable_intercept_for_msr(v, MSR_FS_BASE, MSR_TYPE_R | MSR_TYPE_W);
+        vmx_disable_intercept_for_msr(v, MSR_GS_BASE, MSR_TYPE_R | MSR_TYPE_W);
+        vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_CS, MSR_TYPE_R | MSR_TYPE_W);
+        vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_ESP, MSR_TYPE_R | MSR_TYPE_W);
+        vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_EIP, MSR_TYPE_R | MSR_TYPE_W);
         if ( cpu_has_vmx_pat && paging_mode_hap(d) )
-            vmx_disable_intercept_for_msr(v, MSR_IA32_CR_PAT);
+            vmx_disable_intercept_for_msr(v, MSR_IA32_CR_PAT, MSR_TYPE_R | MSR_TYPE_W);
+        if ( cpu_has_vmx_apic_reg_virt )
+        {
+            int msr;
+            for (msr = MSR_IA32_APICBASE_MSR; msr <= MSR_IA32_APICBASE_MSR + 0xff; msr++)
+                vmx_disable_intercept_for_msr(v, msr, MSR_TYPE_R);
+        }
+        if ( cpu_has_vmx_virtual_intr_delivery )
+        {
+            vmx_disable_intercept_for_msr(v, MSR_IA32_APICTPR_MSR, MSR_TYPE_W);
+            vmx_disable_intercept_for_msr(v, MSR_IA32_APICEOI_MSR, MSR_TYPE_W);
+            vmx_disable_intercept_for_msr(v, MSR_IA32_APICSELF_MSR, MSR_TYPE_W);
+        }
     }
 
     /* I/O access bitmap. */
diff -r 713b8849b11a -r c2578dd96b83 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Mon Sep 17 21:05:11 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Mon Sep 17 21:06:02 2012 +0100
@@ -1962,7 +1962,7 @@ static int vmx_msr_write_intercept(unsig
             for ( ; (rc == 0) && lbr->count; lbr++ )
                 for ( i = 0; (rc == 0) && (i < lbr->count); i++ )
                     if ( (rc = vmx_add_guest_msr(lbr->base + i)) == 0 )
-                        vmx_disable_intercept_for_msr(v, lbr->base + i);
+                        vmx_disable_intercept_for_msr(v, lbr->base + i, MSR_TYPE_R | MSR_TYPE_W);
         }
 
         if ( (rc < 0) ||
diff -r 713b8849b11a -r c2578dd96b83 xen/include/asm-x86/hvm/vmx/vmcs.h
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h	Mon Sep 17 21:05:11 2012 +0100
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h	Mon Sep 17 21:06:02 2012 +0100
@@ -405,7 +405,9 @@ enum vmcs_field {
 
 #define VMCS_VPID_WIDTH 16
 
-void vmx_disable_intercept_for_msr(struct vcpu *v, u32 msr);
+#define MSR_TYPE_R 1
+#define MSR_TYPE_W 2
+void vmx_disable_intercept_for_msr(struct vcpu *v, u32 msr, int type);
 int vmx_read_guest_msr(u32 msr, u64 *val);
 int vmx_write_guest_msr(u32 msr, u64 val);
 int vmx_add_guest_msr(u32 msr);
diff -r 713b8849b11a -r c2578dd96b83 xen/include/asm-x86/msr-index.h
--- a/xen/include/asm-x86/msr-index.h	Mon Sep 17 21:05:11 2012 +0100
+++ b/xen/include/asm-x86/msr-index.h	Mon Sep 17 21:06:02 2012 +0100
@@ -291,6 +291,9 @@
 #define MSR_IA32_APICBASE_ENABLE	(1<<11)
 #define MSR_IA32_APICBASE_BASE		(0xfffff<<12)
 #define MSR_IA32_APICBASE_MSR           0x800
+#define MSR_IA32_APICTPR_MSR            0x808
+#define MSR_IA32_APICEOI_MSR            0x80b
+#define MSR_IA32_APICSELF_MSR           0x83f
 
 #define MSR_IA32_UCODE_WRITE		0x00000079
 #define MSR_IA32_UCODE_REV		0x0000008b

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

From xen-changelog-bounces@lists.xen.org Tue Sep 18 08:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Sep 2012 08:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TDt4S-0007pK-9Q; Tue, 18 Sep 2012 08:22:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDt4R-0007oV-1i
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:15 +0000
Received: from [85.158.143.35:15418] by server-2.bemta-4.messagelabs.com id
	A1/96-06610-63F28505; Tue, 18 Sep 2012 08:22:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-21.messagelabs.com!1347956530!14152188!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2690 invoked from network); 18 Sep 2012 08:22:11 -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;
	18 Sep 2012 08: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 1TDt4L-0004JZ-KB
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDt4L-0000ge-Fe
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:09 +0000
Message-Id: <E1TDt4L-0000ge-Fe@xenbits.xen.org>
Date: Tue, 18 Sep 2012 08:22:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: enable APIC-Register
	Virtualization
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jiongxi Li <jiongxi.li@intel.com>
# Date 1347912248 -3600
# Node ID ec60de627945f17ec2ce5c14e1224b59403875f7
# Parent  62de66cec48a1716bb700912da451a26296b8d1e
xen: enable APIC-Register Virtualization

Add APIC register virtualization support
 - APIC read doesn't cause VM-Exit
 - APIC write becomes trap-like

Signed-off-by: Gang Wei <gang.wei@intel.com>
Signed-off-by: Yang Zhang <yang.z.zhang@intel.com>
Signed-off-by: Jiongxi Li <jiongxi.li@intel.com>
---


diff -r 62de66cec48a -r ec60de627945 xen/arch/x86/hvm/vlapic.c
--- a/xen/arch/x86/hvm/vlapic.c	Mon Sep 17 17:57:24 2012 +0100
+++ b/xen/arch/x86/hvm/vlapic.c	Mon Sep 17 21:04:08 2012 +0100
@@ -823,6 +823,14 @@ static int vlapic_write(struct vcpu *v, 
     return rc;
 }
 
+int vlapic_apicv_write(struct vcpu *v, unsigned int offset)
+{
+    uint32_t val = vlapic_get_reg(vcpu_vlapic(v), offset);
+
+    vlapic_reg_write(v, offset, val);
+    return 0;
+}
+
 int hvm_x2apic_msr_write(struct vcpu *v, unsigned int msr, uint64_t msr_content)
 {
     struct vlapic *vlapic = vcpu_vlapic(v);
diff -r 62de66cec48a -r ec60de627945 xen/arch/x86/hvm/vmx/vmcs.c
--- a/xen/arch/x86/hvm/vmx/vmcs.c	Mon Sep 17 17:57:24 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vmcs.c	Mon Sep 17 21:04:08 2012 +0100
@@ -89,6 +89,7 @@ static void __init vmx_display_features(
     P(cpu_has_vmx_vnmi, "Virtual NMI");
     P(cpu_has_vmx_msr_bitmap, "MSR direct-access bitmap");
     P(cpu_has_vmx_unrestricted_guest, "Unrestricted Guest");
+    P(cpu_has_vmx_apic_reg_virt, "APIC Register Virtualization");
 #undef P
 
     if ( !printed )
@@ -182,6 +183,14 @@ static int vmx_init_vmcs_config(void)
         if ( opt_unrestricted_guest_enabled )
             opt |= SECONDARY_EXEC_UNRESTRICTED_GUEST;
 
+        /*
+         * "APIC Register Virtualization"
+         * can be set only when "use TPR shadow" is set
+         */
+        if ( _vmx_cpu_based_exec_control & CPU_BASED_TPR_SHADOW )
+            opt |= SECONDARY_EXEC_APIC_REGISTER_VIRT;
+
+
         _vmx_secondary_exec_control = adjust_vmx_controls(
             "Secondary Exec Control", min, opt,
             MSR_IA32_VMX_PROCBASED_CTLS2, &mismatch);
diff -r 62de66cec48a -r ec60de627945 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Mon Sep 17 17:57:24 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Mon Sep 17 21:04:08 2012 +0100
@@ -2197,6 +2197,16 @@ static void vmx_idtv_reinject(unsigned l
     }
 }
 
+static int vmx_handle_apic_write(void)
+{
+    unsigned long exit_qualification = __vmread(EXIT_QUALIFICATION);
+    unsigned int offset = exit_qualification & 0xfff;
+
+    ASSERT(cpu_has_vmx_apic_reg_virt);
+
+    return vlapic_apicv_write(current, offset);
+}
+
 void vmx_vmexit_handler(struct cpu_user_regs *regs)
 {
     unsigned int exit_reason, idtv_info, intr_info = 0, vector = 0;
@@ -2649,6 +2659,11 @@ void vmx_vmexit_handler(struct cpu_user_
         break;
     }
 
+    case EXIT_REASON_APIC_WRITE:
+        if ( vmx_handle_apic_write() )
+            hvm_inject_hw_exception(TRAP_gp_fault, 0);
+        break;
+
     case EXIT_REASON_ACCESS_GDTR_OR_IDTR:
     case EXIT_REASON_ACCESS_LDTR_OR_TR:
     case EXIT_REASON_VMX_PREEMPTION_TIMER_EXPIRED:
diff -r 62de66cec48a -r ec60de627945 xen/include/asm-x86/hvm/vlapic.h
--- a/xen/include/asm-x86/hvm/vlapic.h	Mon Sep 17 17:57:24 2012 +0100
+++ b/xen/include/asm-x86/hvm/vlapic.h	Mon Sep 17 21:04:08 2012 +0100
@@ -103,6 +103,8 @@ void vlapic_EOI_set(struct vlapic *vlapi
 
 int vlapic_ipi(struct vlapic *vlapic, uint32_t icr_low, uint32_t icr_high);
 
+int vlapic_apicv_write(struct vcpu *v, unsigned int offset);
+
 struct vlapic *vlapic_lowest_prio(
     struct domain *d, struct vlapic *source,
     int short_hand, uint8_t dest, uint8_t dest_mode);
diff -r 62de66cec48a -r ec60de627945 xen/include/asm-x86/hvm/vmx/vmcs.h
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h	Mon Sep 17 17:57:24 2012 +0100
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h	Mon Sep 17 21:04:08 2012 +0100
@@ -180,6 +180,7 @@ extern u32 vmx_vmentry_control;
 #define SECONDARY_EXEC_ENABLE_VPID              0x00000020
 #define SECONDARY_EXEC_WBINVD_EXITING           0x00000040
 #define SECONDARY_EXEC_UNRESTRICTED_GUEST       0x00000080
+#define SECONDARY_EXEC_APIC_REGISTER_VIRT       0x00000100
 #define SECONDARY_EXEC_PAUSE_LOOP_EXITING       0x00000400
 #define SECONDARY_EXEC_ENABLE_INVPCID           0x00001000
 extern u32 vmx_secondary_exec_control;
@@ -228,6 +229,8 @@ extern bool_t cpu_has_vmx_ins_outs_instr
      SECONDARY_EXEC_UNRESTRICTED_GUEST)
 #define cpu_has_vmx_ple \
     (vmx_secondary_exec_control & SECONDARY_EXEC_PAUSE_LOOP_EXITING)
+#define cpu_has_vmx_apic_reg_virt \
+    (vmx_secondary_exec_control & SECONDARY_EXEC_APIC_REGISTER_VIRT)
 
 /* GUEST_INTERRUPTIBILITY_INFO flags. */
 #define VMX_INTR_SHADOW_STI             0x00000001
diff -r 62de66cec48a -r ec60de627945 xen/include/asm-x86/hvm/vmx/vmx.h
--- a/xen/include/asm-x86/hvm/vmx/vmx.h	Mon Sep 17 17:57:24 2012 +0100
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h	Mon Sep 17 21:04:08 2012 +0100
@@ -129,6 +129,7 @@ void vmx_update_cpu_exec_control(struct 
 #define EXIT_REASON_INVVPID             53
 #define EXIT_REASON_WBINVD              54
 #define EXIT_REASON_XSETBV              55
+#define EXIT_REASON_APIC_WRITE          56
 #define EXIT_REASON_INVPCID             58
 
 /*

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

From xen-changelog-bounces@lists.xen.org Tue Sep 18 08:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Sep 2012 08:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TDt4Q-0007of-Tc; Tue, 18 Sep 2012 08:22:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDt4P-0007oH-CS
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:13 +0000
Received: from [85.158.143.99:12849] by server-1.bemta-4.messagelabs.com id
	3A/0D-12504-43F28505; Tue, 18 Sep 2012 08:22:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1347956529!25493482!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8449 invoked from network); 18 Sep 2012 08:22:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Sep 2012 08: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 1TDt4L-0004JW-1Q
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDt4K-0000gP-T9
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:08 +0000
Message-Id: <E1TDt4K-0000gP-T9@xenbits.xen.org>
Date: Tue, 18 Sep 2012 08:22:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] MCE: use new common mce handler on
	AMD CPUs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Christoph Egger <Christoph.Egger@amd.com>
# Date 1347901044 -3600
# Node ID 62de66cec48a1716bb700912da451a26296b8d1e
# Parent  7ab899e4634729e959f3c7f7a21551abba778565
MCE: use new common mce handler on AMD CPUs

Factor common machine check handler out of intel specific code
and move it into common files.
Replace old common mce handler with new one and use it on AMD CPUs.
No functional changes on Intel side.
While here fix some whitespace nits and comments.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 7ab899e46347 -r 62de66cec48a xen/arch/x86/cpu/mcheck/amd_k8.c
--- a/xen/arch/x86/cpu/mcheck/amd_k8.c	Mon Sep 17 17:55:12 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/amd_k8.c	Mon Sep 17 17:57:24 2012 +0100
@@ -72,7 +72,7 @@
 /* Machine Check Handler for AMD K8 family series */
 static void k8_machine_check(struct cpu_user_regs *regs, long error_code)
 {
-	mcheck_cmn_handler(regs, error_code, mca_allbanks);
+	mcheck_cmn_handler(regs, error_code, mca_allbanks, NULL);
 }
 
 /* AMD K8 machine check */
@@ -83,6 +83,7 @@ enum mcheck_type amd_k8_mcheck_init(stru
 
 	quirkflag = mcequirk_lookup_amd_quirkdata(c);
 
+	mce_handler_init();
 	x86_mce_vector_register(k8_machine_check);
 
 	for (i = 0; i < nr_mce_banks; i++) {
diff -r 7ab899e46347 -r 62de66cec48a xen/arch/x86/cpu/mcheck/mce.c
--- a/xen/arch/x86/cpu/mcheck/mce.c	Mon Sep 17 17:55:12 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce.c	Mon Sep 17 17:57:24 2012 +0100
@@ -23,6 +23,8 @@
 #include <asm/msr.h>
 
 #include "mce.h"
+#include "barrier.h"
+#include "util.h"
 
 bool_t __read_mostly mce_disabled;
 invbool_param("mce", mce_disabled);
@@ -161,8 +163,30 @@ void mce_need_clearbank_register(mce_nee
     mc_need_clearbank_scan = cbfunc;
 }
 
+
+static struct mce_softirq_barrier mce_inside_bar, mce_severity_bar;
+static struct mce_softirq_barrier mce_trap_bar;
+
+/*
+ * mce_logout_lock should only be used in the trap handler,
+ * while MCIP has not been cleared yet in the global status
+ * register. Other use is not safe, since an MCE trap can
+ * happen at any moment, which would cause lock recursion.
+ */
+static DEFINE_SPINLOCK(mce_logout_lock);
+
+static atomic_t severity_cpu = ATOMIC_INIT(-1);
+static atomic_t found_error = ATOMIC_INIT(0);
+static cpumask_t mce_fatal_cpus;
+
+const struct mca_error_handler *__read_mostly mce_dhandlers;
+const struct mca_error_handler *__read_mostly mce_uhandlers;
+unsigned int __read_mostly mce_dhandler_num;
+unsigned int __read_mostly mce_uhandler_num;
+
+
 static void mca_init_bank(enum mca_source who,
-                                         struct mc_info *mi, int bank)
+    struct mc_info *mi, int bank)
 {
     struct mcinfo_bank *mib;
 
@@ -252,8 +276,9 @@ static int mca_init_global(uint32_t flag
  * For Intel latest CPU, whether to clear the error bank status needs to
  * be judged by the callback function defined above.
  */
-mctelem_cookie_t mcheck_mca_logout(enum mca_source who, struct mca_banks *bankmask,
-                                   struct mca_summary *sp, struct mca_banks* clear_bank)
+mctelem_cookie_t
+mcheck_mca_logout(enum mca_source who, struct mca_banks *bankmask,
+                  struct mca_summary *sp, struct mca_banks *clear_bank)
 {
     uint64_t gstatus, status;
     struct mcinfo_global *mig = NULL; /* on stack */
@@ -291,7 +316,7 @@ mctelem_cookie_t mcheck_mca_logout(enum 
     /* If no mc_recovery_scan callback handler registered,
      * this error is not recoverable
      */
-    recover = (mc_recoverable_scan)? 1: 0;
+    recover = (mc_recoverable_scan) ? 1 : 0;
 
     for (i = 0; i < nr_mce_banks; i++) {
         /* Skip bank if corresponding bit in bankmask is clear */
@@ -311,15 +336,14 @@ mctelem_cookie_t mcheck_mca_logout(enum 
 
         /* If this is the first bank with valid MCA DATA, then
          * try to reserve an entry from the urgent/nonurgent queue
-         * depending on whethere we are called from an exception or
+         * depending on whether we are called from an exception or
          * a poller;  this can fail (for example dom0 may not
          * yet have consumed past telemetry). */
         if (errcnt++ == 0) {
             if ( (mctc = mctelem_reserve(which)) != NULL ) {
                 mci = mctelem_dataptr(mctc);
                 mcinfo_clear(mci);
-                mig = (struct mcinfo_global*)x86_mcinfo_reserve
-                    (mci, sizeof(struct mcinfo_global));
+                mig = x86_mcinfo_reserve(mci, sizeof(struct mcinfo_global));
                 /* mc_info should at least hold up the global information */
                 ASSERT(mig);
                 mca_init_global(mc_flags, mig);
@@ -382,227 +406,141 @@ mctelem_cookie_t mcheck_mca_logout(enum 
     return mci != NULL ? mctc : NULL; /* may be NULL */
 }
 
-#define DOM_NORMAL 0
-#define DOM0_TRAP 1
-#define DOMU_TRAP 2
-#define DOMU_KILLED 4
+static void mce_spin_lock(spinlock_t *lk)
+{
+      while (!spin_trylock(lk)) {
+              cpu_relax();
+              mce_panic_check();
+      }
+}
+
+static void mce_spin_unlock(spinlock_t *lk)
+{
+      spin_unlock(lk);
+}
+
+static enum mce_result mce_action(struct cpu_user_regs *regs,
+    mctelem_cookie_t mctc);
+
+/*
+ * Return:
+ * -1: if system can't be recovered
+ * 0: Continue to next step
+ */
+static int mce_urgent_action(struct cpu_user_regs *regs,
+                              mctelem_cookie_t mctc)
+{
+    uint64_t gstatus;
+
+    if ( mctc == NULL)
+        return 0;
+
+    gstatus = mca_rdmsr(MSR_IA32_MCG_STATUS);
+
+    /*
+     * FIXME: When RIPV = EIPV = 0, it's a little bit tricky. It may be an
+     * asynchronic error, currently we have no way to precisely locate
+     * whether the error occur at guest or hypervisor.
+     * To avoid handling error in wrong way, we treat it as unrecovered.
+     *
+     * Another unrecovered case is RIPV = 0 while in hypervisor
+     * since Xen is not pre-emptible.
+     */
+    if ( !(gstatus & MCG_STATUS_RIPV) &&
+         (!(gstatus & MCG_STATUS_EIPV) || !guest_mode(regs)) )
+        return -1;
+
+    return mce_action(regs, mctc) == MCER_RESET ? -1 : 0;
+}
 
 /* Shared #MC handler. */
 void mcheck_cmn_handler(struct cpu_user_regs *regs, long error_code,
-                        struct mca_banks *bankmask)
+    struct mca_banks *bankmask, struct mca_banks *clear_bank)
 {
-    int xen_state_lost, dom0_state_lost, domU_state_lost;
-    struct vcpu *v = current;
-    struct domain *curdom = v->domain;
-    domid_t domid = curdom->domain_id;
-    int ctx_xen, ctx_dom0, ctx_domU;
-    uint32_t dom_state = DOM_NORMAL;
+    uint64_t gstatus;
     mctelem_cookie_t mctc = NULL;
     struct mca_summary bs;
-    struct mc_info *mci = NULL;
-    int irqlocked = 0;
-    uint64_t gstatus;
-    int ripv;
 
-    /* This handler runs as interrupt gate. So IPIs from the
-     * polling service routine are defered until we're finished.
-     */
+    mce_spin_lock(&mce_logout_lock);
 
-    /* Disable interrupts for the _vcpu_. It may not re-scheduled to
-     * another physical CPU. */
-    vcpu_schedule_lock_irq(v);
-    irqlocked = 1;
+    if (clear_bank != NULL) {
+        memset( clear_bank->bank_map, 0x0,
+            sizeof(long) * BITS_TO_LONGS(clear_bank->num));
+    }
+    mctc = mcheck_mca_logout(MCA_MCE_SCAN, bankmask, &bs, clear_bank);
 
-    /* Read global status;  if it does not indicate machine check
-     * in progress then bail as long as we have a valid ip to return to. */
-    gstatus = mca_rdmsr(MSR_IA32_MCG_STATUS);
-    ripv = ((gstatus & MCG_STATUS_RIPV) != 0);
-    if (!(gstatus & MCG_STATUS_MCIP) && ripv) {
-        add_taint(TAINT_MACHINE_CHECK); /* questionable */
-        vcpu_schedule_unlock_irq(v);
-        irqlocked = 0;
-        goto cmn_handler_done;
+    if (bs.errcnt) {
+        /*
+         * Uncorrected errors must be dealt with in softirq context.
+         */
+        if (bs.uc || bs.pcc) {
+            add_taint(TAINT_MACHINE_CHECK);
+            if (mctc != NULL)
+                mctelem_defer(mctc);
+            /*
+             * For PCC=1 and can't be recovered, context is lost, so
+             * reboot now without clearing the banks, and deal with
+             * the telemetry after reboot (the MSRs are sticky)
+             */
+            if (bs.pcc || !bs.recoverable)
+                cpumask_set_cpu(smp_processor_id(), &mce_fatal_cpus);
+        } else {
+            if (mctc != NULL)
+                mctelem_commit(mctc);
+        }
+        atomic_set(&found_error, 1);
+
+        /* The last CPU will be take check/clean-up etc */
+        atomic_set(&severity_cpu, smp_processor_id());
+
+        mce_printk(MCE_CRITICAL, "MCE: clear_bank map %lx on CPU%d\n",
+                *((unsigned long*)clear_bank), smp_processor_id());
+        if (clear_bank != NULL)
+            mcheck_mca_clearbanks(clear_bank);
+    } else {
+        if (mctc != NULL)
+            mctelem_dismiss(mctc);
     }
+    mce_spin_unlock(&mce_logout_lock);
 
-    /* Go and grab error telemetry.  We must choose whether to commit
-     * for logging or dismiss the cookie that is returned, and must not
-     * reference the cookie after that action.
-     */
-    mctc = mcheck_mca_logout(MCA_MCE_HANDLER, bankmask, &bs, NULL);
-    if (mctc != NULL)
-        mci = (struct mc_info *)mctelem_dataptr(mctc);
-
-    /* Clear MCIP or another #MC will enter shutdown state */
-    gstatus &= ~MCG_STATUS_MCIP;
-    mca_wrmsr(MSR_IA32_MCG_STATUS, gstatus);
-    wmb();
-
-    /* If no valid errors and our stack is intact, we're done */
-    if (ripv && bs.errcnt == 0) {
-        vcpu_schedule_unlock_irq(v);
-        irqlocked = 0;
-        goto cmn_handler_done;
-    }
-
-    if (bs.uc || bs.pcc)
-        add_taint(TAINT_MACHINE_CHECK);
-
-    /* Machine check exceptions will usually be for UC and/or PCC errors,
-     * but it is possible to configure machine check for some classes
-     * of corrected error.
-     *
-     * UC errors could compromise any domain or the hypervisor
-     * itself - for example a cache writeback of modified data that
-     * turned out to be bad could be for data belonging to anyone, not
-     * just the current domain.  In the absence of known data poisoning
-     * to prevent consumption of such bad data in the system we regard
-     * all UC errors as terminal.  It may be possible to attempt some
-     * heuristics based on the address affected, which guests have
-     * mappings to that mfn etc.
-     *
-     * PCC errors apply to the current context.
-     *
-     * If MCG_STATUS indicates !RIPV then even a #MC that is not UC
-     * and not PCC is terminal - the return instruction pointer
-     * pushed onto the stack is bogus.  If the interrupt context is
-     * the hypervisor or dom0 the game is over, otherwise we can
-     * limit the impact to a single domU but only if we trampoline
-     * somewhere safely - we can't return and unwind the stack.
-     * Since there is no trampoline in place we will treat !RIPV
-     * as terminal for any context.
-     */
-    ctx_xen = SEG_PL(regs->cs) == 0;
-    ctx_dom0 = !ctx_xen && (domid == 0);
-    ctx_domU = !ctx_xen && !ctx_dom0;
-
-    xen_state_lost = bs.uc != 0 || (ctx_xen && (bs.pcc || !ripv)) ||
-        !ripv;
-    dom0_state_lost = bs.uc != 0 || (ctx_dom0 && (bs.pcc || !ripv));
-    domU_state_lost = bs.uc != 0 || (ctx_domU && (bs.pcc || !ripv));
-
-    if (xen_state_lost) {
-        /* Now we are going to panic anyway. Allow interrupts, so that
-         * printk on serial console can work. */
-        vcpu_schedule_unlock_irq(v);
-        irqlocked = 0;
-
-        printk("Terminal machine check exception occurred in "
-               "hypervisor context.\n");
-
-        /* If MCG_STATUS_EIPV indicates, the IP on the stack is related
-         * to the error then it makes sense to print a stack trace.
-         * That can be useful for more detailed error analysis and/or
-         * error case studies to figure out, if we can clear
-         * xen_impacted and kill a DomU instead
-         * (i.e. if a guest only control structure is affected, but then
-         * we must ensure the bad pages are not re-used again).
-         */
-        if (bs.eipv & MCG_STATUS_EIPV) {
-            printk("MCE: Instruction Pointer is related to the "
-                   "error, therefore print the execution state.\n");
-            show_execution_state(regs);
-        }
-
-        /* Commit the telemetry so that panic flow can find it. */
-        if (mctc != NULL) {
-            x86_mcinfo_dump(mci);
-            mctelem_commit(mctc);
-        }
-        mc_panic("Hypervisor state lost due to machine check "
-                 "exception.\n");
-        /*NOTREACHED*/
-    }
+    mce_barrier_enter(&mce_trap_bar);
+    if ( mctc != NULL && mce_urgent_action(regs, mctc))
+        cpumask_set_cpu(smp_processor_id(), &mce_fatal_cpus);
+    mce_barrier_exit(&mce_trap_bar);
 
     /*
-     * Xen hypervisor state is intact.  If dom0 state is lost then
-     * give it a chance to decide what to do if it has registered
-     * a handler for this event, otherwise panic.
-     *
-     * XXFM Could add some Solaris dom0 contract kill here?
+     * Wait until everybody has processed the trap.
      */
-    if (dom0_state_lost) {
-        if (dom0 && dom0->max_vcpus && dom0->vcpu[0] &&
-            guest_has_trap_callback(dom0, 0, TRAP_machine_check)) {
-            dom_state = DOM0_TRAP;
-            send_guest_trap(dom0, 0, TRAP_machine_check);
-            /* XXFM case of return with !ripv ??? */
-        } else {
-            /* Commit telemetry for panic flow. */
-            if (mctc != NULL) {
-                x86_mcinfo_dump(mci);
-                mctelem_commit(mctc);
-            }
-            mc_panic("Dom0 state lost due to machine check "
-                     "exception\n");
-            /*NOTREACHED*/
+    mce_barrier_enter(&mce_trap_bar);
+    if (atomic_read(&severity_cpu) == smp_processor_id())
+    {
+        /* According to SDM, if no error bank found on any cpus,
+         * something unexpected happening, we can't do any
+         * recovery job but to reset the system.
+         */
+        if (atomic_read(&found_error) == 0)
+            mc_panic("MCE: No CPU found valid MCE, need reset\n");
+        if (!cpumask_empty(&mce_fatal_cpus))
+        {
+            char *ebufp, ebuf[96] = "MCE: Fatal error happened on CPUs ";
+            ebufp = ebuf + strlen(ebuf);
+            cpumask_scnprintf(ebufp, 95 - strlen(ebuf), &mce_fatal_cpus);
+            mc_panic(ebuf);
         }
+        atomic_set(&found_error, 0);
     }
+    mce_barrier_exit(&mce_trap_bar); 
 
-    /*
-     * If a domU has lost state then send it a trap if it has registered
-     * a handler, otherwise crash the domain.
-     * XXFM Revisit this functionality.
-     */
-    if (domU_state_lost) {
-        if (guest_has_trap_callback(v->domain, v->vcpu_id,
-                                    TRAP_machine_check)) {
-            dom_state = DOMU_TRAP;
-            send_guest_trap(curdom, v->vcpu_id,
-                            TRAP_machine_check);
-        } else {
-            dom_state = DOMU_KILLED;
-            /* Enable interrupts. This basically results in
-             * calling sti on the *physical* cpu. But after
-             * domain_crash() the vcpu pointer is invalid.
-             * Therefore, we must unlock the irqs before killing
-             * it. */
-            vcpu_schedule_unlock_irq(v);
-            irqlocked = 0;
+    /* Clear flags after above fatal check */
+    mce_barrier_enter(&mce_trap_bar);
+    gstatus = mca_rdmsr(MSR_IA32_MCG_STATUS);
+    if ((gstatus & MCG_STATUS_MCIP) != 0) {
+        mce_printk(MCE_CRITICAL, "MCE: Clear MCIP@ last step");
+        mca_wrmsr(MSR_IA32_MCG_STATUS, gstatus & ~MCG_STATUS_MCIP);
+    }
+    mce_barrier_exit(&mce_trap_bar);
 
-            /* DomU is impacted. Kill it and continue. */
-            domain_crash(curdom);
-        }
-    }
-
-    switch (dom_state) {
-    case DOM0_TRAP:
-    case DOMU_TRAP:
-        /* Enable interrupts. */
-        vcpu_schedule_unlock_irq(v);
-        irqlocked = 0;
-
-        /* guest softirqs and event callbacks are scheduled
-         * immediately after this handler exits. */
-        break;
-    case DOMU_KILLED:
-        /* Nothing to do here. */
-        break;
-
-    case DOM_NORMAL:
-        vcpu_schedule_unlock_irq(v);
-        irqlocked = 0;
-        break;
-    }
-
- cmn_handler_done:
-    BUG_ON(irqlocked);
-    BUG_ON(!ripv);
-
-    if (bs.errcnt) {
-        /* Not panicing, so forward telemetry to dom0 now if it
-         * is interested. */
-        if (dom0_vmce_enabled()) {
-            if (mctc != NULL)
-                mctelem_commit(mctc);
-            send_global_virq(VIRQ_MCA);
-        } else {
-            x86_mcinfo_dump(mci);
-            if (mctc != NULL)
-                mctelem_dismiss(mctc);
-        }
-    } else if (mctc != NULL) {
-        mctelem_dismiss(mctc);
-    }
+    raise_softirq(MACHINE_CHECK_SOFTIRQ);
 }
 
 void mcheck_mca_clearbanks(struct mca_banks *bankmask)
@@ -1621,3 +1559,191 @@ void mc_panic(char *s)
     mc_panic_dump();
     panic("HARDWARE ERROR");
 }
+
+/* Machine Check owner judge algorithm:
+ * When error happens, all cpus serially read its msr banks.
+ * The first CPU who fetches the error bank's info will clear
+ * this bank. Later readers can't get any information again.
+ * The first CPU is the actual mce_owner
+ *
+ * For Fatal (pcc=1) error, it might cause machine crash
+ * before we're able to log. For avoiding log missing, we adopt two
+ * round scanning:
+ * Round1: simply scan. If found pcc = 1 or ripv = 0, simply reset.
+ * All MCE banks are sticky, when boot up, MCE polling mechanism
+ * will help to collect and log those MCE errors.
+ * Round2: Do all MCE processing logic as normal.
+ */
+
+/* Maybe called in MCE context, no lock, no printk */
+static enum mce_result mce_action(struct cpu_user_regs *regs,
+                      mctelem_cookie_t mctc)
+{
+    struct mc_info *local_mi;
+    enum mce_result bank_result = MCER_NOERROR;
+    enum mce_result worst_result = MCER_NOERROR;
+    struct mcinfo_common *mic = NULL;
+    struct mca_binfo binfo;
+    const struct mca_error_handler *handlers = mce_dhandlers;
+    unsigned int i, handler_num = mce_dhandler_num;
+
+    /* When in mce context, regs is valid */
+    if (regs)
+    {
+        handler_num = mce_uhandler_num;
+        handlers = mce_uhandlers;
+    }
+
+    /* At least a default handler should be registerd */
+    ASSERT(handler_num);
+
+    local_mi = (struct mc_info*)mctelem_dataptr(mctc);
+    x86_mcinfo_lookup(mic, local_mi, MC_TYPE_GLOBAL);
+    if (mic == NULL) {
+        printk(KERN_ERR "MCE: get local buffer entry failed\n ");
+        return MCER_CONTINUE;
+    }
+
+    memset(&binfo, 0, sizeof(binfo));
+    binfo.mig = (struct mcinfo_global *)mic;
+    binfo.mi = local_mi;
+
+    /* Processing bank information */
+    x86_mcinfo_lookup(mic, local_mi, MC_TYPE_BANK);
+
+    for ( ; bank_result != MCER_RESET && mic && mic->size;
+          mic = x86_mcinfo_next(mic) )
+    {
+        if (mic->type != MC_TYPE_BANK) {
+            continue;
+        }
+        binfo.mib = (struct mcinfo_bank*)mic;
+        binfo.bank = binfo.mib->mc_bank;
+        bank_result = MCER_NOERROR;
+        for ( i = 0; i < handler_num; i++ ) {
+            if (handlers[i].owned_error(binfo.mib->mc_status))
+            {
+                handlers[i].recovery_handler(&binfo, &bank_result, regs);
+                if (worst_result < bank_result)
+                    worst_result = bank_result;
+                break;
+            }
+        }
+        ASSERT(i != handler_num);
+    }
+
+    return worst_result;
+}
+
+/*
+ * Called from mctelem_process_deferred. Return 1 if the telemetry
+ * should be committed for dom0 consumption, 0 if it should be
+ * dismissed.
+ */
+static int mce_delayed_action(mctelem_cookie_t mctc)
+{
+    enum mce_result result;
+    int ret = 0;
+
+    result = mce_action(NULL, mctc);
+
+    switch (result)
+    {
+    case MCER_RESET:
+        dprintk(XENLOG_ERR, "MCE delayed action failed\n");
+        is_mc_panic = 1;
+        x86_mcinfo_dump(mctelem_dataptr(mctc));
+        panic("MCE: Software recovery failed for the UCR\n");
+        break;
+    case MCER_RECOVERED:
+        dprintk(XENLOG_INFO, "MCE: Error is successfully recovered\n");
+        ret  = 1;
+        break;
+    case MCER_CONTINUE:
+        dprintk(XENLOG_INFO, "MCE: Error can't be recovered, "
+            "system is tainted\n");
+        x86_mcinfo_dump(mctelem_dataptr(mctc));
+        ret = 1;
+        break;
+    default:
+        ret = 0;
+        break;
+    }
+    return ret;
+}
+
+/* Softirq Handler for this MCE# processing */
+static void mce_softirq(void)
+{
+    int cpu = smp_processor_id();
+    unsigned int workcpu;
+
+    mce_printk(MCE_VERBOSE, "CPU%d enter softirq\n", cpu);
+
+    mce_barrier_enter(&mce_inside_bar);
+
+    /*
+     * Everybody is here. Now let's see who gets to do the
+     * recovery work. Right now we just see if there's a CPU
+     * that did not have any problems, and pick that one.
+     *
+     * First, just set a default value: the last CPU who reaches this
+     * will overwrite the value and become the default.
+     */
+
+    atomic_set(&severity_cpu, cpu);
+
+    mce_barrier_enter(&mce_severity_bar);
+    if (!mctelem_has_deferred(cpu))
+        atomic_set(&severity_cpu, cpu);
+    mce_barrier_exit(&mce_severity_bar);
+
+    /* We choose severity_cpu for further processing */
+    if (atomic_read(&severity_cpu) == cpu) {
+
+        mce_printk(MCE_VERBOSE, "CPU%d handling errors\n", cpu);
+
+        /* Step1: Fill DOM0 LOG buffer, vMCE injection buffer and
+         * vMCE MSRs virtualization buffer
+         */
+        for_each_online_cpu(workcpu) {
+            mctelem_process_deferred(workcpu, mce_delayed_action);
+        }
+
+        /* Step2: Send Log to DOM0 through vIRQ */
+        if (dom0_vmce_enabled()) {
+            mce_printk(MCE_VERBOSE, "MCE: send MCE# to DOM0 through virq\n");
+            send_global_virq(VIRQ_MCA);
+        }
+    }
+
+    mce_barrier_exit(&mce_inside_bar);
+}
+
+/* Machine Check owner judge algorithm:
+ * When error happens, all cpus serially read its msr banks.
+ * The first CPU who fetches the error bank's info will clear
+ * this bank. Later readers can't get any infor again.
+ * The first CPU is the actual mce_owner
+ *
+ * For Fatal (pcc=1) error, it might cause machine crash
+ * before we're able to log. For avoiding log missing, we adopt two
+ * round scanning:
+ * Round1: simply scan. If found pcc = 1 or ripv = 0, simply reset.
+ * All MCE banks are sticky, when boot up, MCE polling mechanism
+ * will help to collect and log those MCE errors.
+ * Round2: Do all MCE processing logic as normal.
+ */
+void mce_handler_init(void)
+{
+    if (smp_processor_id() != 0)
+        return;
+
+    /* callback register, do we really need so many callback? */
+    /* mce handler data initialization */
+    mce_barrier_init(&mce_inside_bar);
+    mce_barrier_init(&mce_severity_bar);
+    mce_barrier_init(&mce_trap_bar);
+    spin_lock_init(&mce_logout_lock);
+    open_softirq(MACHINE_CHECK_SOFTIRQ, mce_softirq);
+}
diff -r 7ab899e46347 -r 62de66cec48a xen/arch/x86/cpu/mcheck/mce.h
--- a/xen/arch/x86/cpu/mcheck/mce.h	Mon Sep 17 17:55:12 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce.h	Mon Sep 17 17:57:24 2012 +0100
@@ -78,7 +78,8 @@ extern void x86_mce_vector_register(x86_
 
 /* Common generic MCE handler that implementations may nominate
  * via x86_mce_vector_register. */
-extern void mcheck_cmn_handler(struct cpu_user_regs *, long, struct mca_banks *);
+extern void mcheck_cmn_handler(struct cpu_user_regs *, long,
+    struct mca_banks *, struct mca_banks *);
 
 /* Register a handler for judging whether mce is recoverable. */
 typedef int (*mce_recoverable_t)(u64 status);
@@ -166,16 +167,28 @@ void *x86_mcinfo_reserve(struct mc_info 
 void x86_mcinfo_dump(struct mc_info *mi);
 
 int fill_vmsr_data(struct mcinfo_bank *mc_bank, struct domain *d,
-        uint64_t gstatus);
+    uint64_t gstatus);
 int inject_vmce(struct domain *d);
-int vmce_domain_inject(struct mcinfo_bank *bank, struct domain *d, struct mcinfo_global *global);
+int vmce_domain_inject(struct mcinfo_bank *bank, struct domain *d,
+    struct mcinfo_global *global);
 
 static inline int mce_vendor_bank_msr(const struct vcpu *v, uint32_t msr)
 {
-    if ( boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
-         msr >= MSR_IA32_MC0_CTL2 &&
-         msr < MSR_IA32_MCx_CTL2(v->arch.mcg_cap & MCG_CAP_COUNT) )
-          return 1;
+    switch (boot_cpu_data.x86_vendor) {
+    case X86_VENDOR_INTEL:
+        if (msr >= MSR_IA32_MC0_CTL2 &&
+            msr < MSR_IA32_MCx_CTL2(v->arch.mcg_cap & MCG_CAP_COUNT) )
+            return 1;
+        break;
+    case X86_VENDOR_AMD:
+        switch (msr) {
+        case MSR_F10_MC4_MISC1:
+        case MSR_F10_MC4_MISC2:
+        case MSR_F10_MC4_MISC3:
+            return 1;
+        }
+        break;
+    }
     return 0;
 }
 
@@ -188,27 +201,35 @@ static inline int mce_bank_msr(const str
     return 0;
 }
 
+/* MC softirq */
+void mce_handler_init(void);
+
+extern const struct mca_error_handler *mce_dhandlers;
+extern const struct mca_error_handler *mce_uhandlers;
+extern unsigned int mce_dhandler_num;
+extern unsigned int mce_uhandler_num;
+
 /* Fields are zero when not available */
 struct mce {
-    __u64 status;
-    __u64 misc;
-    __u64 addr;
-    __u64 mcgstatus;
-    __u64 ip;
-    __u64 tsc;      /* cpu time stamp counter */
-    __u64 time;     /* wall time_t when error was detected */
-    __u8  cpuvendor;        /* cpu vendor as encoded in system.h */
-    __u8  inject_flags;     /* software inject flags */
-    __u16  pad;
-    __u32 cpuid;    /* CPUID 1 EAX */
-    __u8  cs;               /* code segment */
-    __u8  bank;     /* machine check bank */
-    __u8  cpu;      /* cpu number; obsolete; use extcpu now */
-    __u8  finished;   /* entry is valid */
-    __u32 extcpu;   /* linux cpu number that detected the error */
-    __u32 socketid; /* CPU socket ID */
-    __u32 apicid;   /* CPU initial apic ID */
-    __u64 mcgcap;   /* MCGCAP MSR: machine check capabilities of CPU */
+    uint64_t status;
+    uint64_t misc;
+    uint64_t addr;
+    uint64_t mcgstatus;
+    uint64_t ip;
+    uint64_t tsc;      /* cpu time stamp counter */
+    uint64_t time;     /* wall time_t when error was detected */
+    uint8_t  cpuvendor;        /* cpu vendor as encoded in system.h */
+    uint8_t  inject_flags;     /* software inject flags */
+    uint16_t pad;
+    uint32_t cpuid;    /* CPUID 1 EAX */
+    uint8_t  cs;       /* code segment */
+    uint8_t  bank;     /* machine check bank */
+    uint8_t  cpu;      /* cpu number; obsolete; use extcpu now */
+    uint8_t  finished; /* entry is valid */
+    uint32_t extcpu;   /* linux cpu number that detected the error */
+    uint32_t socketid; /* CPU socket ID */
+    uint32_t apicid;   /* CPU initial apic ID */
+    uint64_t mcgcap;   /* MCGCAP MSR: machine check capabilities of CPU */
 };
 
 extern int apei_write_mce(struct mce *m);
diff -r 7ab899e46347 -r 62de66cec48a xen/arch/x86/cpu/mcheck/mce_intel.c
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c	Mon Sep 17 17:55:12 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c	Mon Sep 17 17:57:24 2012 +0100
@@ -166,244 +166,6 @@ static void intel_init_thermal(struct cp
 }
 #endif /* CONFIG_X86_MCE_THERMAL */
 
-static struct mce_softirq_barrier mce_inside_bar, mce_severity_bar;
-static struct mce_softirq_barrier mce_trap_bar;
-
-/*
- * mce_logout_lock should only be used in the trap handler,
- * while MCIP has not been cleared yet in the global status
- * register. Other use is not safe, since an MCE trap can
- * happen at any moment, which would cause lock recursion.
- */
-static DEFINE_SPINLOCK(mce_logout_lock);
-
-static atomic_t severity_cpu = ATOMIC_INIT(-1);
-static atomic_t found_error = ATOMIC_INIT(0);
-static cpumask_t mce_fatal_cpus;
-
-static const struct mca_error_handler *__read_mostly mce_dhandlers;
-static const struct mca_error_handler *__read_mostly mce_uhandlers;
-static unsigned int __read_mostly mce_dhandler_num;
-static unsigned int __read_mostly mce_uhandler_num;
-
-/* Maybe called in MCE context, no lock, no printk */
-static enum mce_result mce_action(struct cpu_user_regs *regs,
-                      mctelem_cookie_t mctc)
-{
-    struct mc_info *local_mi;
-    enum mce_result bank_result = MCER_NOERROR;
-    enum mce_result worst_result = MCER_NOERROR;
-    struct mcinfo_common *mic = NULL;
-    struct mca_binfo binfo;
-    const struct mca_error_handler *handlers = mce_dhandlers;
-    unsigned int i, handler_num = mce_dhandler_num;
-
-    /* When in mce context, regs is valid */
-    if (regs)
-    {
-        handler_num = mce_uhandler_num;
-        handlers = mce_uhandlers;
-    }
-
-    /* At least a default handler should be registerd */
-    ASSERT(handler_num);
-
-    local_mi = (struct mc_info*)mctelem_dataptr(mctc);
-    x86_mcinfo_lookup(mic, local_mi, MC_TYPE_GLOBAL);
-    if (mic == NULL) {
-        printk(KERN_ERR "MCE: get local buffer entry failed\n ");
-        return MCER_CONTINUE;
-    }
-
-    memset(&binfo, 0, sizeof(binfo));
-    binfo.mig = (struct mcinfo_global *)mic;
-    binfo.mi = local_mi;
-
-    /* Processing bank information */
-    x86_mcinfo_lookup(mic, local_mi, MC_TYPE_BANK);
-
-    for ( ; bank_result != MCER_RESET && mic && mic->size;
-          mic = x86_mcinfo_next(mic) )
-    {
-        if (mic->type != MC_TYPE_BANK) {
-            continue;
-        }
-        binfo.mib = (struct mcinfo_bank*)mic;
-        binfo.bank = binfo.mib->mc_bank;
-        bank_result = MCER_NOERROR;
-        for ( i = 0; i < handler_num; i++ ) {
-            if (handlers[i].owned_error(binfo.mib->mc_status))
-            {
-                handlers[i].recovery_handler(&binfo, &bank_result, regs);
-                if (worst_result < bank_result)
-                    worst_result = bank_result;
-                break;
-            }
-        }
-        ASSERT(i != handler_num);
-    }
-
-    return worst_result;
-}
-
-/*
- * Called from mctelem_process_deferred. Return 1 if the telemetry
- * should be committed for dom0 consumption, 0 if it should be
- * dismissed.
- */
-static int mce_delayed_action(mctelem_cookie_t mctc)
-{
-    enum mce_result result;
-    int ret = 0;
-
-    result = mce_action(NULL, mctc);
-
-    switch (result)
-    {
-    case MCER_RESET:
-        dprintk(XENLOG_ERR, "MCE delayed action failed\n");
-        is_mc_panic = 1;
-        x86_mcinfo_dump(mctelem_dataptr(mctc));
-        panic("MCE: Software recovery failed for the UCR\n");
-        break;
-    case MCER_RECOVERED:
-        dprintk(XENLOG_INFO, "MCE: Error is successfully recovered\n");
-        ret  = 1;
-        break;
-    case MCER_CONTINUE:
-        dprintk(XENLOG_INFO, "MCE: Error can't be recovered, "
-            "system is tainted\n");
-        x86_mcinfo_dump(mctelem_dataptr(mctc));
-        ret = 1;
-        break;
-    default:
-        ret = 0;
-        break;
-    }
-    return ret;
-}
-
-/* Softirq Handler for this MCE# processing */
-static void mce_softirq(void)
-{
-    int cpu = smp_processor_id();
-    unsigned int workcpu;
-
-    mce_printk(MCE_VERBOSE, "CPU%d enter softirq\n", cpu);
-
-    mce_barrier_enter(&mce_inside_bar);
-
-    /*
-     * Everybody is here. Now let's see who gets to do the
-     * recovery work. Right now we just see if there's a CPU
-     * that did not have any problems, and pick that one.
-     *
-     * First, just set a default value: the last CPU who reaches this
-     * will overwrite the value and become the default.
-     */
-
-    atomic_set(&severity_cpu, cpu);
-
-    mce_barrier_enter(&mce_severity_bar);
-    if (!mctelem_has_deferred(cpu))
-        atomic_set(&severity_cpu, cpu);
-    mce_barrier_exit(&mce_severity_bar);
-
-    /* We choose severity_cpu for further processing */
-    if (atomic_read(&severity_cpu) == cpu) {
-
-        mce_printk(MCE_VERBOSE, "CPU%d handling errors\n", cpu);
-
-        /* Step1: Fill DOM0 LOG buffer, vMCE injection buffer and
-         * vMCE MSRs virtualization buffer
-         */
-        for_each_online_cpu(workcpu) {
-            mctelem_process_deferred(workcpu, mce_delayed_action);
-        }
-
-        /* Step2: Send Log to DOM0 through vIRQ */
-        if (dom0_vmce_enabled()) {
-            mce_printk(MCE_VERBOSE, "MCE: send MCE# to DOM0 through virq\n");
-            send_global_virq(VIRQ_MCA);
-        }
-    }
-
-    mce_barrier_exit(&mce_inside_bar);
-}
-
-/*
- * Return:
- * -1: if system can't be recoved
- * 0: Continoue to next step
- */
-static int mce_urgent_action(struct cpu_user_regs *regs,
-                              mctelem_cookie_t mctc)
-{
-    uint64_t gstatus;
-
-    if ( mctc == NULL)
-        return 0;
-
-    gstatus = mca_rdmsr(MSR_IA32_MCG_STATUS);
-
-    /*
-     * FIXME: When RIPV = EIPV = 0, it's a little bit tricky. It may be an
-     * asynchronic error, currently we have no way to precisely locate
-     * whether the error occur at guest or hypervisor.
-     * To avoid handling error in wrong way, we treat it as unrecovered.
-     *
-     * Another unrecovered case is RIPV = 0 while in hypervisor
-     * since Xen is not pre-emptible.
-     */
-    if ( !(gstatus & MCG_STATUS_RIPV) &&
-         (!(gstatus & MCG_STATUS_EIPV) || !guest_mode(regs)) )
-        return -1;
-
-    return mce_action(regs, mctc) == MCER_RESET ? -1 : 0;
-}
-
-/* Machine Check owner judge algorithm:
- * When error happens, all cpus serially read its msr banks.
- * The first CPU who fetches the error bank's info will clear
- * this bank. Later readers can't get any infor again.
- * The first CPU is the actual mce_owner
- *
- * For Fatal (pcc=1) error, it might cause machine crash
- * before we're able to log. For avoiding log missing, we adopt two
- * round scanning:
- * Round1: simply scan. If found pcc = 1 or ripv = 0, simply reset.
- * All MCE banks are sticky, when boot up, MCE polling mechanism
- * will help to collect and log those MCE errors.
- * Round2: Do all MCE processing logic as normal.
- */
-
-static void mce_handler_init(void)
-{
-    if (smp_processor_id() != 0)
-        return;
-
-    /* callback register, do we really need so many callback? */
-    /* mce handler data initialization */
-    mce_barrier_init(&mce_inside_bar);
-    mce_barrier_init(&mce_severity_bar);
-    mce_barrier_init(&mce_trap_bar);
-    spin_lock_init(&mce_logout_lock);
-    open_softirq(MACHINE_CHECK_SOFTIRQ, mce_softirq);
-}
-
-static void mce_spin_lock(spinlock_t *lk)
-{
-      while (!spin_trylock(lk)) {
-              cpu_relax();
-              mce_panic_check();
-      }
-}
-
-static void mce_spin_unlock(spinlock_t *lk)
-{
-      spin_unlock(lk);
-}
-
 /* Intel MCE handler */
 static inline void intel_get_extended_msr(struct mcinfo_extended *ext, u32 msr)
 {
@@ -729,88 +491,8 @@ static const struct mca_error_handler in
 
 static void intel_machine_check(struct cpu_user_regs * regs, long error_code)
 {
-    uint64_t gstatus;
-    mctelem_cookie_t mctc = NULL;
-    struct mca_summary bs;
-    struct mca_banks *clear_bank;
-
-    mce_spin_lock(&mce_logout_lock);
-
-    clear_bank = __get_cpu_var(mce_clear_banks);
-    memset( clear_bank->bank_map, 0x0,
-        sizeof(long) * BITS_TO_LONGS(clear_bank->num));
-    mctc = mcheck_mca_logout(MCA_MCE_SCAN, mca_allbanks, &bs, clear_bank);
-
-    if (bs.errcnt) {
-        /*
-         * Uncorrected errors must be dealth with in softirq context.
-         */
-        if (bs.uc || bs.pcc) {
-            add_taint(TAINT_MACHINE_CHECK);
-            if (mctc != NULL)
-                mctelem_defer(mctc);
-            /*
-             * For PCC=1 and can't be recovered, context is lost, so reboot now without
-             * clearing  the banks, and deal with the telemetry after reboot
-             * (the MSRs are sticky)
-             */
-            if (bs.pcc || !bs.recoverable)
-                cpumask_set_cpu(smp_processor_id(), &mce_fatal_cpus);
-        } else {
-            if (mctc != NULL)
-                mctelem_commit(mctc);
-        }
-        atomic_set(&found_error, 1);
-
-        /* The last CPU will be take check/clean-up etc */
-        atomic_set(&severity_cpu, smp_processor_id());
-
-        mce_printk(MCE_CRITICAL, "MCE: clear_bank map %lx on CPU%d\n",
-                *((unsigned long*)clear_bank), smp_processor_id());
-        mcheck_mca_clearbanks(clear_bank);
-    } else {
-        if (mctc != NULL)
-            mctelem_dismiss(mctc);
-    }
-    mce_spin_unlock(&mce_logout_lock);
-
-    mce_barrier_enter(&mce_trap_bar);
-    if ( mctc != NULL && mce_urgent_action(regs, mctc))
-        cpumask_set_cpu(smp_processor_id(), &mce_fatal_cpus);
-    mce_barrier_exit(&mce_trap_bar);
-    /*
-     * Wait until everybody has processed the trap.
-     */
-    mce_barrier_enter(&mce_trap_bar);
-    if (atomic_read(&severity_cpu) == smp_processor_id())
-    {
-        /* According to SDM, if no error bank found on any cpus,
-         * something unexpected happening, we can't do any
-         * recovery job but to reset the system.
-         */
-        if (atomic_read(&found_error) == 0)
-            mc_panic("MCE: No CPU found valid MCE, need reset\n");
-        if (!cpumask_empty(&mce_fatal_cpus))
-        {
-            char *ebufp, ebuf[96] = "MCE: Fatal error happened on CPUs ";
-            ebufp = ebuf + strlen(ebuf);
-            cpumask_scnprintf(ebufp, 95 - strlen(ebuf), &mce_fatal_cpus);
-            mc_panic(ebuf);
-        }
-        atomic_set(&found_error, 0);
-    }
-    mce_barrier_exit(&mce_trap_bar);
-
-    /* Clear flags after above fatal check */
-    mce_barrier_enter(&mce_trap_bar);
-    gstatus = mca_rdmsr(MSR_IA32_MCG_STATUS);
-    if ((gstatus & MCG_STATUS_MCIP) != 0) {
-        mce_printk(MCE_CRITICAL, "MCE: Clear MCIP@ last step");
-        mca_wrmsr(MSR_IA32_MCG_STATUS, gstatus & ~MCG_STATUS_MCIP);
-    }
-    mce_barrier_exit(&mce_trap_bar);
-
-    raise_softirq(MACHINE_CHECK_SOFTIRQ);
+    mcheck_cmn_handler(regs, error_code, mca_allbanks,
+        __get_cpu_var(mce_clear_banks));
 }
 
 /* According to MCA OS writer guide, CMCI handler need to clear bank when
diff -r 7ab899e46347 -r 62de66cec48a xen/arch/x86/cpu/mcheck/x86_mca.h
--- a/xen/arch/x86/cpu/mcheck/x86_mca.h	Mon Sep 17 17:55:12 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/x86_mca.h	Mon Sep 17 17:57:24 2012 +0100
@@ -32,11 +32,11 @@
 /* Bitfield of the MSR_IA32_MCG_CAP register */
 #define MCG_CAP_COUNT           0x00000000000000ffULL
 #define MCG_CTL_P               (1ULL<<8)
-#define MCG_EXT_P               (1ULL<<9)
-#define MCG_CMCI_P              (1ULL<<10)
-#define MCG_TES_P               (1ULL<<11)
-#define MCG_EXT_CNT             16
-#define MCG_SER_P               (1ULL<<24)
+#define MCG_EXT_P               (1ULL<<9)  /* Intel specific */
+#define MCG_CMCI_P              (1ULL<<10) /* Intel specific */
+#define MCG_TES_P               (1ULL<<11) /* Intel specific */
+#define MCG_EXT_CNT             16         /* Intel specific */
+#define MCG_SER_P               (1ULL<<24) /* Intel specific */
 /* Other bits are reserved */
 
 /* Bitfield of the MSR_IA32_MCG_STATUS register */
@@ -53,9 +53,9 @@
 /* Other information */
 #define MCi_STATUS_OTHER        0x01ffffff00000000ULL
 /* Action Required flag */
-#define MCi_STATUS_AR           0x0080000000000000ULL
+#define MCi_STATUS_AR           0x0080000000000000ULL  /* Intel specific */
 /* Signaling flag */
-#define MCi_STATUS_S            0x0100000000000000ULL
+#define MCi_STATUS_S            0x0100000000000000ULL  /* Intel specific */
 /* processor context corrupt */
 #define MCi_STATUS_PCC          0x0200000000000000ULL
 /* MSR_K8_MCi_ADDR register valid */
@@ -100,7 +100,7 @@ struct mca_banks
     unsigned long *bank_map;
 };
 
-static inline void mcabanks_clear(int bit, struct mca_banks *banks)    \
+static inline void mcabanks_clear(int bit, struct mca_banks *banks)
 {
     if (!banks || !banks->bank_map || bit >= banks->num)
         return ;
@@ -125,7 +125,7 @@ struct mca_banks *mcabanks_alloc(void);
 void mcabanks_free(struct mca_banks *banks);
 extern struct mca_banks *mca_allbanks;
 
-/*Keep bank so that we can get staus even if mib is NULL */
+/* Keep bank so that we can get status even if mib is NULL */
 struct mca_binfo {
     int bank;
     struct mcinfo_global *mig;
@@ -138,7 +138,7 @@ enum mce_result
 {
     MCER_NOERROR,
     MCER_RECOVERED,
-    /* Not recoverd, but can continue */
+    /* Not recovered, but can continue */
     MCER_CONTINUE,
     MCER_RESET,
 };
@@ -149,7 +149,7 @@ struct mca_error_handler
      * identified by mca_code. Otherwise, we might need to have
      * a seperate function to decode the corresponding actions
      * for the particular mca error later.
-    */
+     */
     int (*owned_error)(uint64_t status);
     void (*recovery_handler)(struct mca_binfo *binfo,
                     enum mce_result *result, struct cpu_user_regs *regs);

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

From xen-changelog-bounces@lists.xen.org Tue Sep 18 08:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Sep 2012 08:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TDt4Q-0007of-Tc; Tue, 18 Sep 2012 08:22:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDt4P-0007oH-CS
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:13 +0000
Received: from [85.158.143.99:12849] by server-1.bemta-4.messagelabs.com id
	3A/0D-12504-43F28505; Tue, 18 Sep 2012 08:22:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1347956529!25493482!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8449 invoked from network); 18 Sep 2012 08:22:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Sep 2012 08: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 1TDt4L-0004JW-1Q
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDt4K-0000gP-T9
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:08 +0000
Message-Id: <E1TDt4K-0000gP-T9@xenbits.xen.org>
Date: Tue, 18 Sep 2012 08:22:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] MCE: use new common mce handler on
	AMD CPUs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Christoph Egger <Christoph.Egger@amd.com>
# Date 1347901044 -3600
# Node ID 62de66cec48a1716bb700912da451a26296b8d1e
# Parent  7ab899e4634729e959f3c7f7a21551abba778565
MCE: use new common mce handler on AMD CPUs

Factor common machine check handler out of intel specific code
and move it into common files.
Replace old common mce handler with new one and use it on AMD CPUs.
No functional changes on Intel side.
While here fix some whitespace nits and comments.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 7ab899e46347 -r 62de66cec48a xen/arch/x86/cpu/mcheck/amd_k8.c
--- a/xen/arch/x86/cpu/mcheck/amd_k8.c	Mon Sep 17 17:55:12 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/amd_k8.c	Mon Sep 17 17:57:24 2012 +0100
@@ -72,7 +72,7 @@
 /* Machine Check Handler for AMD K8 family series */
 static void k8_machine_check(struct cpu_user_regs *regs, long error_code)
 {
-	mcheck_cmn_handler(regs, error_code, mca_allbanks);
+	mcheck_cmn_handler(regs, error_code, mca_allbanks, NULL);
 }
 
 /* AMD K8 machine check */
@@ -83,6 +83,7 @@ enum mcheck_type amd_k8_mcheck_init(stru
 
 	quirkflag = mcequirk_lookup_amd_quirkdata(c);
 
+	mce_handler_init();
 	x86_mce_vector_register(k8_machine_check);
 
 	for (i = 0; i < nr_mce_banks; i++) {
diff -r 7ab899e46347 -r 62de66cec48a xen/arch/x86/cpu/mcheck/mce.c
--- a/xen/arch/x86/cpu/mcheck/mce.c	Mon Sep 17 17:55:12 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce.c	Mon Sep 17 17:57:24 2012 +0100
@@ -23,6 +23,8 @@
 #include <asm/msr.h>
 
 #include "mce.h"
+#include "barrier.h"
+#include "util.h"
 
 bool_t __read_mostly mce_disabled;
 invbool_param("mce", mce_disabled);
@@ -161,8 +163,30 @@ void mce_need_clearbank_register(mce_nee
     mc_need_clearbank_scan = cbfunc;
 }
 
+
+static struct mce_softirq_barrier mce_inside_bar, mce_severity_bar;
+static struct mce_softirq_barrier mce_trap_bar;
+
+/*
+ * mce_logout_lock should only be used in the trap handler,
+ * while MCIP has not been cleared yet in the global status
+ * register. Other use is not safe, since an MCE trap can
+ * happen at any moment, which would cause lock recursion.
+ */
+static DEFINE_SPINLOCK(mce_logout_lock);
+
+static atomic_t severity_cpu = ATOMIC_INIT(-1);
+static atomic_t found_error = ATOMIC_INIT(0);
+static cpumask_t mce_fatal_cpus;
+
+const struct mca_error_handler *__read_mostly mce_dhandlers;
+const struct mca_error_handler *__read_mostly mce_uhandlers;
+unsigned int __read_mostly mce_dhandler_num;
+unsigned int __read_mostly mce_uhandler_num;
+
+
 static void mca_init_bank(enum mca_source who,
-                                         struct mc_info *mi, int bank)
+    struct mc_info *mi, int bank)
 {
     struct mcinfo_bank *mib;
 
@@ -252,8 +276,9 @@ static int mca_init_global(uint32_t flag
  * For Intel latest CPU, whether to clear the error bank status needs to
  * be judged by the callback function defined above.
  */
-mctelem_cookie_t mcheck_mca_logout(enum mca_source who, struct mca_banks *bankmask,
-                                   struct mca_summary *sp, struct mca_banks* clear_bank)
+mctelem_cookie_t
+mcheck_mca_logout(enum mca_source who, struct mca_banks *bankmask,
+                  struct mca_summary *sp, struct mca_banks *clear_bank)
 {
     uint64_t gstatus, status;
     struct mcinfo_global *mig = NULL; /* on stack */
@@ -291,7 +316,7 @@ mctelem_cookie_t mcheck_mca_logout(enum 
     /* If no mc_recovery_scan callback handler registered,
      * this error is not recoverable
      */
-    recover = (mc_recoverable_scan)? 1: 0;
+    recover = (mc_recoverable_scan) ? 1 : 0;
 
     for (i = 0; i < nr_mce_banks; i++) {
         /* Skip bank if corresponding bit in bankmask is clear */
@@ -311,15 +336,14 @@ mctelem_cookie_t mcheck_mca_logout(enum 
 
         /* If this is the first bank with valid MCA DATA, then
          * try to reserve an entry from the urgent/nonurgent queue
-         * depending on whethere we are called from an exception or
+         * depending on whether we are called from an exception or
          * a poller;  this can fail (for example dom0 may not
          * yet have consumed past telemetry). */
         if (errcnt++ == 0) {
             if ( (mctc = mctelem_reserve(which)) != NULL ) {
                 mci = mctelem_dataptr(mctc);
                 mcinfo_clear(mci);
-                mig = (struct mcinfo_global*)x86_mcinfo_reserve
-                    (mci, sizeof(struct mcinfo_global));
+                mig = x86_mcinfo_reserve(mci, sizeof(struct mcinfo_global));
                 /* mc_info should at least hold up the global information */
                 ASSERT(mig);
                 mca_init_global(mc_flags, mig);
@@ -382,227 +406,141 @@ mctelem_cookie_t mcheck_mca_logout(enum 
     return mci != NULL ? mctc : NULL; /* may be NULL */
 }
 
-#define DOM_NORMAL 0
-#define DOM0_TRAP 1
-#define DOMU_TRAP 2
-#define DOMU_KILLED 4
+static void mce_spin_lock(spinlock_t *lk)
+{
+      while (!spin_trylock(lk)) {
+              cpu_relax();
+              mce_panic_check();
+      }
+}
+
+static void mce_spin_unlock(spinlock_t *lk)
+{
+      spin_unlock(lk);
+}
+
+static enum mce_result mce_action(struct cpu_user_regs *regs,
+    mctelem_cookie_t mctc);
+
+/*
+ * Return:
+ * -1: if system can't be recovered
+ * 0: Continue to next step
+ */
+static int mce_urgent_action(struct cpu_user_regs *regs,
+                              mctelem_cookie_t mctc)
+{
+    uint64_t gstatus;
+
+    if ( mctc == NULL)
+        return 0;
+
+    gstatus = mca_rdmsr(MSR_IA32_MCG_STATUS);
+
+    /*
+     * FIXME: When RIPV = EIPV = 0, it's a little bit tricky. It may be an
+     * asynchronic error, currently we have no way to precisely locate
+     * whether the error occur at guest or hypervisor.
+     * To avoid handling error in wrong way, we treat it as unrecovered.
+     *
+     * Another unrecovered case is RIPV = 0 while in hypervisor
+     * since Xen is not pre-emptible.
+     */
+    if ( !(gstatus & MCG_STATUS_RIPV) &&
+         (!(gstatus & MCG_STATUS_EIPV) || !guest_mode(regs)) )
+        return -1;
+
+    return mce_action(regs, mctc) == MCER_RESET ? -1 : 0;
+}
 
 /* Shared #MC handler. */
 void mcheck_cmn_handler(struct cpu_user_regs *regs, long error_code,
-                        struct mca_banks *bankmask)
+    struct mca_banks *bankmask, struct mca_banks *clear_bank)
 {
-    int xen_state_lost, dom0_state_lost, domU_state_lost;
-    struct vcpu *v = current;
-    struct domain *curdom = v->domain;
-    domid_t domid = curdom->domain_id;
-    int ctx_xen, ctx_dom0, ctx_domU;
-    uint32_t dom_state = DOM_NORMAL;
+    uint64_t gstatus;
     mctelem_cookie_t mctc = NULL;
     struct mca_summary bs;
-    struct mc_info *mci = NULL;
-    int irqlocked = 0;
-    uint64_t gstatus;
-    int ripv;
 
-    /* This handler runs as interrupt gate. So IPIs from the
-     * polling service routine are defered until we're finished.
-     */
+    mce_spin_lock(&mce_logout_lock);
 
-    /* Disable interrupts for the _vcpu_. It may not re-scheduled to
-     * another physical CPU. */
-    vcpu_schedule_lock_irq(v);
-    irqlocked = 1;
+    if (clear_bank != NULL) {
+        memset( clear_bank->bank_map, 0x0,
+            sizeof(long) * BITS_TO_LONGS(clear_bank->num));
+    }
+    mctc = mcheck_mca_logout(MCA_MCE_SCAN, bankmask, &bs, clear_bank);
 
-    /* Read global status;  if it does not indicate machine check
-     * in progress then bail as long as we have a valid ip to return to. */
-    gstatus = mca_rdmsr(MSR_IA32_MCG_STATUS);
-    ripv = ((gstatus & MCG_STATUS_RIPV) != 0);
-    if (!(gstatus & MCG_STATUS_MCIP) && ripv) {
-        add_taint(TAINT_MACHINE_CHECK); /* questionable */
-        vcpu_schedule_unlock_irq(v);
-        irqlocked = 0;
-        goto cmn_handler_done;
+    if (bs.errcnt) {
+        /*
+         * Uncorrected errors must be dealt with in softirq context.
+         */
+        if (bs.uc || bs.pcc) {
+            add_taint(TAINT_MACHINE_CHECK);
+            if (mctc != NULL)
+                mctelem_defer(mctc);
+            /*
+             * For PCC=1 and can't be recovered, context is lost, so
+             * reboot now without clearing the banks, and deal with
+             * the telemetry after reboot (the MSRs are sticky)
+             */
+            if (bs.pcc || !bs.recoverable)
+                cpumask_set_cpu(smp_processor_id(), &mce_fatal_cpus);
+        } else {
+            if (mctc != NULL)
+                mctelem_commit(mctc);
+        }
+        atomic_set(&found_error, 1);
+
+        /* The last CPU will be take check/clean-up etc */
+        atomic_set(&severity_cpu, smp_processor_id());
+
+        mce_printk(MCE_CRITICAL, "MCE: clear_bank map %lx on CPU%d\n",
+                *((unsigned long*)clear_bank), smp_processor_id());
+        if (clear_bank != NULL)
+            mcheck_mca_clearbanks(clear_bank);
+    } else {
+        if (mctc != NULL)
+            mctelem_dismiss(mctc);
     }
+    mce_spin_unlock(&mce_logout_lock);
 
-    /* Go and grab error telemetry.  We must choose whether to commit
-     * for logging or dismiss the cookie that is returned, and must not
-     * reference the cookie after that action.
-     */
-    mctc = mcheck_mca_logout(MCA_MCE_HANDLER, bankmask, &bs, NULL);
-    if (mctc != NULL)
-        mci = (struct mc_info *)mctelem_dataptr(mctc);
-
-    /* Clear MCIP or another #MC will enter shutdown state */
-    gstatus &= ~MCG_STATUS_MCIP;
-    mca_wrmsr(MSR_IA32_MCG_STATUS, gstatus);
-    wmb();
-
-    /* If no valid errors and our stack is intact, we're done */
-    if (ripv && bs.errcnt == 0) {
-        vcpu_schedule_unlock_irq(v);
-        irqlocked = 0;
-        goto cmn_handler_done;
-    }
-
-    if (bs.uc || bs.pcc)
-        add_taint(TAINT_MACHINE_CHECK);
-
-    /* Machine check exceptions will usually be for UC and/or PCC errors,
-     * but it is possible to configure machine check for some classes
-     * of corrected error.
-     *
-     * UC errors could compromise any domain or the hypervisor
-     * itself - for example a cache writeback of modified data that
-     * turned out to be bad could be for data belonging to anyone, not
-     * just the current domain.  In the absence of known data poisoning
-     * to prevent consumption of such bad data in the system we regard
-     * all UC errors as terminal.  It may be possible to attempt some
-     * heuristics based on the address affected, which guests have
-     * mappings to that mfn etc.
-     *
-     * PCC errors apply to the current context.
-     *
-     * If MCG_STATUS indicates !RIPV then even a #MC that is not UC
-     * and not PCC is terminal - the return instruction pointer
-     * pushed onto the stack is bogus.  If the interrupt context is
-     * the hypervisor or dom0 the game is over, otherwise we can
-     * limit the impact to a single domU but only if we trampoline
-     * somewhere safely - we can't return and unwind the stack.
-     * Since there is no trampoline in place we will treat !RIPV
-     * as terminal for any context.
-     */
-    ctx_xen = SEG_PL(regs->cs) == 0;
-    ctx_dom0 = !ctx_xen && (domid == 0);
-    ctx_domU = !ctx_xen && !ctx_dom0;
-
-    xen_state_lost = bs.uc != 0 || (ctx_xen && (bs.pcc || !ripv)) ||
-        !ripv;
-    dom0_state_lost = bs.uc != 0 || (ctx_dom0 && (bs.pcc || !ripv));
-    domU_state_lost = bs.uc != 0 || (ctx_domU && (bs.pcc || !ripv));
-
-    if (xen_state_lost) {
-        /* Now we are going to panic anyway. Allow interrupts, so that
-         * printk on serial console can work. */
-        vcpu_schedule_unlock_irq(v);
-        irqlocked = 0;
-
-        printk("Terminal machine check exception occurred in "
-               "hypervisor context.\n");
-
-        /* If MCG_STATUS_EIPV indicates, the IP on the stack is related
-         * to the error then it makes sense to print a stack trace.
-         * That can be useful for more detailed error analysis and/or
-         * error case studies to figure out, if we can clear
-         * xen_impacted and kill a DomU instead
-         * (i.e. if a guest only control structure is affected, but then
-         * we must ensure the bad pages are not re-used again).
-         */
-        if (bs.eipv & MCG_STATUS_EIPV) {
-            printk("MCE: Instruction Pointer is related to the "
-                   "error, therefore print the execution state.\n");
-            show_execution_state(regs);
-        }
-
-        /* Commit the telemetry so that panic flow can find it. */
-        if (mctc != NULL) {
-            x86_mcinfo_dump(mci);
-            mctelem_commit(mctc);
-        }
-        mc_panic("Hypervisor state lost due to machine check "
-                 "exception.\n");
-        /*NOTREACHED*/
-    }
+    mce_barrier_enter(&mce_trap_bar);
+    if ( mctc != NULL && mce_urgent_action(regs, mctc))
+        cpumask_set_cpu(smp_processor_id(), &mce_fatal_cpus);
+    mce_barrier_exit(&mce_trap_bar);
 
     /*
-     * Xen hypervisor state is intact.  If dom0 state is lost then
-     * give it a chance to decide what to do if it has registered
-     * a handler for this event, otherwise panic.
-     *
-     * XXFM Could add some Solaris dom0 contract kill here?
+     * Wait until everybody has processed the trap.
      */
-    if (dom0_state_lost) {
-        if (dom0 && dom0->max_vcpus && dom0->vcpu[0] &&
-            guest_has_trap_callback(dom0, 0, TRAP_machine_check)) {
-            dom_state = DOM0_TRAP;
-            send_guest_trap(dom0, 0, TRAP_machine_check);
-            /* XXFM case of return with !ripv ??? */
-        } else {
-            /* Commit telemetry for panic flow. */
-            if (mctc != NULL) {
-                x86_mcinfo_dump(mci);
-                mctelem_commit(mctc);
-            }
-            mc_panic("Dom0 state lost due to machine check "
-                     "exception\n");
-            /*NOTREACHED*/
+    mce_barrier_enter(&mce_trap_bar);
+    if (atomic_read(&severity_cpu) == smp_processor_id())
+    {
+        /* According to SDM, if no error bank found on any cpus,
+         * something unexpected happening, we can't do any
+         * recovery job but to reset the system.
+         */
+        if (atomic_read(&found_error) == 0)
+            mc_panic("MCE: No CPU found valid MCE, need reset\n");
+        if (!cpumask_empty(&mce_fatal_cpus))
+        {
+            char *ebufp, ebuf[96] = "MCE: Fatal error happened on CPUs ";
+            ebufp = ebuf + strlen(ebuf);
+            cpumask_scnprintf(ebufp, 95 - strlen(ebuf), &mce_fatal_cpus);
+            mc_panic(ebuf);
         }
+        atomic_set(&found_error, 0);
     }
+    mce_barrier_exit(&mce_trap_bar); 
 
-    /*
-     * If a domU has lost state then send it a trap if it has registered
-     * a handler, otherwise crash the domain.
-     * XXFM Revisit this functionality.
-     */
-    if (domU_state_lost) {
-        if (guest_has_trap_callback(v->domain, v->vcpu_id,
-                                    TRAP_machine_check)) {
-            dom_state = DOMU_TRAP;
-            send_guest_trap(curdom, v->vcpu_id,
-                            TRAP_machine_check);
-        } else {
-            dom_state = DOMU_KILLED;
-            /* Enable interrupts. This basically results in
-             * calling sti on the *physical* cpu. But after
-             * domain_crash() the vcpu pointer is invalid.
-             * Therefore, we must unlock the irqs before killing
-             * it. */
-            vcpu_schedule_unlock_irq(v);
-            irqlocked = 0;
+    /* Clear flags after above fatal check */
+    mce_barrier_enter(&mce_trap_bar);
+    gstatus = mca_rdmsr(MSR_IA32_MCG_STATUS);
+    if ((gstatus & MCG_STATUS_MCIP) != 0) {
+        mce_printk(MCE_CRITICAL, "MCE: Clear MCIP@ last step");
+        mca_wrmsr(MSR_IA32_MCG_STATUS, gstatus & ~MCG_STATUS_MCIP);
+    }
+    mce_barrier_exit(&mce_trap_bar);
 
-            /* DomU is impacted. Kill it and continue. */
-            domain_crash(curdom);
-        }
-    }
-
-    switch (dom_state) {
-    case DOM0_TRAP:
-    case DOMU_TRAP:
-        /* Enable interrupts. */
-        vcpu_schedule_unlock_irq(v);
-        irqlocked = 0;
-
-        /* guest softirqs and event callbacks are scheduled
-         * immediately after this handler exits. */
-        break;
-    case DOMU_KILLED:
-        /* Nothing to do here. */
-        break;
-
-    case DOM_NORMAL:
-        vcpu_schedule_unlock_irq(v);
-        irqlocked = 0;
-        break;
-    }
-
- cmn_handler_done:
-    BUG_ON(irqlocked);
-    BUG_ON(!ripv);
-
-    if (bs.errcnt) {
-        /* Not panicing, so forward telemetry to dom0 now if it
-         * is interested. */
-        if (dom0_vmce_enabled()) {
-            if (mctc != NULL)
-                mctelem_commit(mctc);
-            send_global_virq(VIRQ_MCA);
-        } else {
-            x86_mcinfo_dump(mci);
-            if (mctc != NULL)
-                mctelem_dismiss(mctc);
-        }
-    } else if (mctc != NULL) {
-        mctelem_dismiss(mctc);
-    }
+    raise_softirq(MACHINE_CHECK_SOFTIRQ);
 }
 
 void mcheck_mca_clearbanks(struct mca_banks *bankmask)
@@ -1621,3 +1559,191 @@ void mc_panic(char *s)
     mc_panic_dump();
     panic("HARDWARE ERROR");
 }
+
+/* Machine Check owner judge algorithm:
+ * When error happens, all cpus serially read its msr banks.
+ * The first CPU who fetches the error bank's info will clear
+ * this bank. Later readers can't get any information again.
+ * The first CPU is the actual mce_owner
+ *
+ * For Fatal (pcc=1) error, it might cause machine crash
+ * before we're able to log. For avoiding log missing, we adopt two
+ * round scanning:
+ * Round1: simply scan. If found pcc = 1 or ripv = 0, simply reset.
+ * All MCE banks are sticky, when boot up, MCE polling mechanism
+ * will help to collect and log those MCE errors.
+ * Round2: Do all MCE processing logic as normal.
+ */
+
+/* Maybe called in MCE context, no lock, no printk */
+static enum mce_result mce_action(struct cpu_user_regs *regs,
+                      mctelem_cookie_t mctc)
+{
+    struct mc_info *local_mi;
+    enum mce_result bank_result = MCER_NOERROR;
+    enum mce_result worst_result = MCER_NOERROR;
+    struct mcinfo_common *mic = NULL;
+    struct mca_binfo binfo;
+    const struct mca_error_handler *handlers = mce_dhandlers;
+    unsigned int i, handler_num = mce_dhandler_num;
+
+    /* When in mce context, regs is valid */
+    if (regs)
+    {
+        handler_num = mce_uhandler_num;
+        handlers = mce_uhandlers;
+    }
+
+    /* At least a default handler should be registerd */
+    ASSERT(handler_num);
+
+    local_mi = (struct mc_info*)mctelem_dataptr(mctc);
+    x86_mcinfo_lookup(mic, local_mi, MC_TYPE_GLOBAL);
+    if (mic == NULL) {
+        printk(KERN_ERR "MCE: get local buffer entry failed\n ");
+        return MCER_CONTINUE;
+    }
+
+    memset(&binfo, 0, sizeof(binfo));
+    binfo.mig = (struct mcinfo_global *)mic;
+    binfo.mi = local_mi;
+
+    /* Processing bank information */
+    x86_mcinfo_lookup(mic, local_mi, MC_TYPE_BANK);
+
+    for ( ; bank_result != MCER_RESET && mic && mic->size;
+          mic = x86_mcinfo_next(mic) )
+    {
+        if (mic->type != MC_TYPE_BANK) {
+            continue;
+        }
+        binfo.mib = (struct mcinfo_bank*)mic;
+        binfo.bank = binfo.mib->mc_bank;
+        bank_result = MCER_NOERROR;
+        for ( i = 0; i < handler_num; i++ ) {
+            if (handlers[i].owned_error(binfo.mib->mc_status))
+            {
+                handlers[i].recovery_handler(&binfo, &bank_result, regs);
+                if (worst_result < bank_result)
+                    worst_result = bank_result;
+                break;
+            }
+        }
+        ASSERT(i != handler_num);
+    }
+
+    return worst_result;
+}
+
+/*
+ * Called from mctelem_process_deferred. Return 1 if the telemetry
+ * should be committed for dom0 consumption, 0 if it should be
+ * dismissed.
+ */
+static int mce_delayed_action(mctelem_cookie_t mctc)
+{
+    enum mce_result result;
+    int ret = 0;
+
+    result = mce_action(NULL, mctc);
+
+    switch (result)
+    {
+    case MCER_RESET:
+        dprintk(XENLOG_ERR, "MCE delayed action failed\n");
+        is_mc_panic = 1;
+        x86_mcinfo_dump(mctelem_dataptr(mctc));
+        panic("MCE: Software recovery failed for the UCR\n");
+        break;
+    case MCER_RECOVERED:
+        dprintk(XENLOG_INFO, "MCE: Error is successfully recovered\n");
+        ret  = 1;
+        break;
+    case MCER_CONTINUE:
+        dprintk(XENLOG_INFO, "MCE: Error can't be recovered, "
+            "system is tainted\n");
+        x86_mcinfo_dump(mctelem_dataptr(mctc));
+        ret = 1;
+        break;
+    default:
+        ret = 0;
+        break;
+    }
+    return ret;
+}
+
+/* Softirq Handler for this MCE# processing */
+static void mce_softirq(void)
+{
+    int cpu = smp_processor_id();
+    unsigned int workcpu;
+
+    mce_printk(MCE_VERBOSE, "CPU%d enter softirq\n", cpu);
+
+    mce_barrier_enter(&mce_inside_bar);
+
+    /*
+     * Everybody is here. Now let's see who gets to do the
+     * recovery work. Right now we just see if there's a CPU
+     * that did not have any problems, and pick that one.
+     *
+     * First, just set a default value: the last CPU who reaches this
+     * will overwrite the value and become the default.
+     */
+
+    atomic_set(&severity_cpu, cpu);
+
+    mce_barrier_enter(&mce_severity_bar);
+    if (!mctelem_has_deferred(cpu))
+        atomic_set(&severity_cpu, cpu);
+    mce_barrier_exit(&mce_severity_bar);
+
+    /* We choose severity_cpu for further processing */
+    if (atomic_read(&severity_cpu) == cpu) {
+
+        mce_printk(MCE_VERBOSE, "CPU%d handling errors\n", cpu);
+
+        /* Step1: Fill DOM0 LOG buffer, vMCE injection buffer and
+         * vMCE MSRs virtualization buffer
+         */
+        for_each_online_cpu(workcpu) {
+            mctelem_process_deferred(workcpu, mce_delayed_action);
+        }
+
+        /* Step2: Send Log to DOM0 through vIRQ */
+        if (dom0_vmce_enabled()) {
+            mce_printk(MCE_VERBOSE, "MCE: send MCE# to DOM0 through virq\n");
+            send_global_virq(VIRQ_MCA);
+        }
+    }
+
+    mce_barrier_exit(&mce_inside_bar);
+}
+
+/* Machine Check owner judge algorithm:
+ * When error happens, all cpus serially read its msr banks.
+ * The first CPU who fetches the error bank's info will clear
+ * this bank. Later readers can't get any infor again.
+ * The first CPU is the actual mce_owner
+ *
+ * For Fatal (pcc=1) error, it might cause machine crash
+ * before we're able to log. For avoiding log missing, we adopt two
+ * round scanning:
+ * Round1: simply scan. If found pcc = 1 or ripv = 0, simply reset.
+ * All MCE banks are sticky, when boot up, MCE polling mechanism
+ * will help to collect and log those MCE errors.
+ * Round2: Do all MCE processing logic as normal.
+ */
+void mce_handler_init(void)
+{
+    if (smp_processor_id() != 0)
+        return;
+
+    /* callback register, do we really need so many callback? */
+    /* mce handler data initialization */
+    mce_barrier_init(&mce_inside_bar);
+    mce_barrier_init(&mce_severity_bar);
+    mce_barrier_init(&mce_trap_bar);
+    spin_lock_init(&mce_logout_lock);
+    open_softirq(MACHINE_CHECK_SOFTIRQ, mce_softirq);
+}
diff -r 7ab899e46347 -r 62de66cec48a xen/arch/x86/cpu/mcheck/mce.h
--- a/xen/arch/x86/cpu/mcheck/mce.h	Mon Sep 17 17:55:12 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce.h	Mon Sep 17 17:57:24 2012 +0100
@@ -78,7 +78,8 @@ extern void x86_mce_vector_register(x86_
 
 /* Common generic MCE handler that implementations may nominate
  * via x86_mce_vector_register. */
-extern void mcheck_cmn_handler(struct cpu_user_regs *, long, struct mca_banks *);
+extern void mcheck_cmn_handler(struct cpu_user_regs *, long,
+    struct mca_banks *, struct mca_banks *);
 
 /* Register a handler for judging whether mce is recoverable. */
 typedef int (*mce_recoverable_t)(u64 status);
@@ -166,16 +167,28 @@ void *x86_mcinfo_reserve(struct mc_info 
 void x86_mcinfo_dump(struct mc_info *mi);
 
 int fill_vmsr_data(struct mcinfo_bank *mc_bank, struct domain *d,
-        uint64_t gstatus);
+    uint64_t gstatus);
 int inject_vmce(struct domain *d);
-int vmce_domain_inject(struct mcinfo_bank *bank, struct domain *d, struct mcinfo_global *global);
+int vmce_domain_inject(struct mcinfo_bank *bank, struct domain *d,
+    struct mcinfo_global *global);
 
 static inline int mce_vendor_bank_msr(const struct vcpu *v, uint32_t msr)
 {
-    if ( boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
-         msr >= MSR_IA32_MC0_CTL2 &&
-         msr < MSR_IA32_MCx_CTL2(v->arch.mcg_cap & MCG_CAP_COUNT) )
-          return 1;
+    switch (boot_cpu_data.x86_vendor) {
+    case X86_VENDOR_INTEL:
+        if (msr >= MSR_IA32_MC0_CTL2 &&
+            msr < MSR_IA32_MCx_CTL2(v->arch.mcg_cap & MCG_CAP_COUNT) )
+            return 1;
+        break;
+    case X86_VENDOR_AMD:
+        switch (msr) {
+        case MSR_F10_MC4_MISC1:
+        case MSR_F10_MC4_MISC2:
+        case MSR_F10_MC4_MISC3:
+            return 1;
+        }
+        break;
+    }
     return 0;
 }
 
@@ -188,27 +201,35 @@ static inline int mce_bank_msr(const str
     return 0;
 }
 
+/* MC softirq */
+void mce_handler_init(void);
+
+extern const struct mca_error_handler *mce_dhandlers;
+extern const struct mca_error_handler *mce_uhandlers;
+extern unsigned int mce_dhandler_num;
+extern unsigned int mce_uhandler_num;
+
 /* Fields are zero when not available */
 struct mce {
-    __u64 status;
-    __u64 misc;
-    __u64 addr;
-    __u64 mcgstatus;
-    __u64 ip;
-    __u64 tsc;      /* cpu time stamp counter */
-    __u64 time;     /* wall time_t when error was detected */
-    __u8  cpuvendor;        /* cpu vendor as encoded in system.h */
-    __u8  inject_flags;     /* software inject flags */
-    __u16  pad;
-    __u32 cpuid;    /* CPUID 1 EAX */
-    __u8  cs;               /* code segment */
-    __u8  bank;     /* machine check bank */
-    __u8  cpu;      /* cpu number; obsolete; use extcpu now */
-    __u8  finished;   /* entry is valid */
-    __u32 extcpu;   /* linux cpu number that detected the error */
-    __u32 socketid; /* CPU socket ID */
-    __u32 apicid;   /* CPU initial apic ID */
-    __u64 mcgcap;   /* MCGCAP MSR: machine check capabilities of CPU */
+    uint64_t status;
+    uint64_t misc;
+    uint64_t addr;
+    uint64_t mcgstatus;
+    uint64_t ip;
+    uint64_t tsc;      /* cpu time stamp counter */
+    uint64_t time;     /* wall time_t when error was detected */
+    uint8_t  cpuvendor;        /* cpu vendor as encoded in system.h */
+    uint8_t  inject_flags;     /* software inject flags */
+    uint16_t pad;
+    uint32_t cpuid;    /* CPUID 1 EAX */
+    uint8_t  cs;       /* code segment */
+    uint8_t  bank;     /* machine check bank */
+    uint8_t  cpu;      /* cpu number; obsolete; use extcpu now */
+    uint8_t  finished; /* entry is valid */
+    uint32_t extcpu;   /* linux cpu number that detected the error */
+    uint32_t socketid; /* CPU socket ID */
+    uint32_t apicid;   /* CPU initial apic ID */
+    uint64_t mcgcap;   /* MCGCAP MSR: machine check capabilities of CPU */
 };
 
 extern int apei_write_mce(struct mce *m);
diff -r 7ab899e46347 -r 62de66cec48a xen/arch/x86/cpu/mcheck/mce_intel.c
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c	Mon Sep 17 17:55:12 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c	Mon Sep 17 17:57:24 2012 +0100
@@ -166,244 +166,6 @@ static void intel_init_thermal(struct cp
 }
 #endif /* CONFIG_X86_MCE_THERMAL */
 
-static struct mce_softirq_barrier mce_inside_bar, mce_severity_bar;
-static struct mce_softirq_barrier mce_trap_bar;
-
-/*
- * mce_logout_lock should only be used in the trap handler,
- * while MCIP has not been cleared yet in the global status
- * register. Other use is not safe, since an MCE trap can
- * happen at any moment, which would cause lock recursion.
- */
-static DEFINE_SPINLOCK(mce_logout_lock);
-
-static atomic_t severity_cpu = ATOMIC_INIT(-1);
-static atomic_t found_error = ATOMIC_INIT(0);
-static cpumask_t mce_fatal_cpus;
-
-static const struct mca_error_handler *__read_mostly mce_dhandlers;
-static const struct mca_error_handler *__read_mostly mce_uhandlers;
-static unsigned int __read_mostly mce_dhandler_num;
-static unsigned int __read_mostly mce_uhandler_num;
-
-/* Maybe called in MCE context, no lock, no printk */
-static enum mce_result mce_action(struct cpu_user_regs *regs,
-                      mctelem_cookie_t mctc)
-{
-    struct mc_info *local_mi;
-    enum mce_result bank_result = MCER_NOERROR;
-    enum mce_result worst_result = MCER_NOERROR;
-    struct mcinfo_common *mic = NULL;
-    struct mca_binfo binfo;
-    const struct mca_error_handler *handlers = mce_dhandlers;
-    unsigned int i, handler_num = mce_dhandler_num;
-
-    /* When in mce context, regs is valid */
-    if (regs)
-    {
-        handler_num = mce_uhandler_num;
-        handlers = mce_uhandlers;
-    }
-
-    /* At least a default handler should be registerd */
-    ASSERT(handler_num);
-
-    local_mi = (struct mc_info*)mctelem_dataptr(mctc);
-    x86_mcinfo_lookup(mic, local_mi, MC_TYPE_GLOBAL);
-    if (mic == NULL) {
-        printk(KERN_ERR "MCE: get local buffer entry failed\n ");
-        return MCER_CONTINUE;
-    }
-
-    memset(&binfo, 0, sizeof(binfo));
-    binfo.mig = (struct mcinfo_global *)mic;
-    binfo.mi = local_mi;
-
-    /* Processing bank information */
-    x86_mcinfo_lookup(mic, local_mi, MC_TYPE_BANK);
-
-    for ( ; bank_result != MCER_RESET && mic && mic->size;
-          mic = x86_mcinfo_next(mic) )
-    {
-        if (mic->type != MC_TYPE_BANK) {
-            continue;
-        }
-        binfo.mib = (struct mcinfo_bank*)mic;
-        binfo.bank = binfo.mib->mc_bank;
-        bank_result = MCER_NOERROR;
-        for ( i = 0; i < handler_num; i++ ) {
-            if (handlers[i].owned_error(binfo.mib->mc_status))
-            {
-                handlers[i].recovery_handler(&binfo, &bank_result, regs);
-                if (worst_result < bank_result)
-                    worst_result = bank_result;
-                break;
-            }
-        }
-        ASSERT(i != handler_num);
-    }
-
-    return worst_result;
-}
-
-/*
- * Called from mctelem_process_deferred. Return 1 if the telemetry
- * should be committed for dom0 consumption, 0 if it should be
- * dismissed.
- */
-static int mce_delayed_action(mctelem_cookie_t mctc)
-{
-    enum mce_result result;
-    int ret = 0;
-
-    result = mce_action(NULL, mctc);
-
-    switch (result)
-    {
-    case MCER_RESET:
-        dprintk(XENLOG_ERR, "MCE delayed action failed\n");
-        is_mc_panic = 1;
-        x86_mcinfo_dump(mctelem_dataptr(mctc));
-        panic("MCE: Software recovery failed for the UCR\n");
-        break;
-    case MCER_RECOVERED:
-        dprintk(XENLOG_INFO, "MCE: Error is successfully recovered\n");
-        ret  = 1;
-        break;
-    case MCER_CONTINUE:
-        dprintk(XENLOG_INFO, "MCE: Error can't be recovered, "
-            "system is tainted\n");
-        x86_mcinfo_dump(mctelem_dataptr(mctc));
-        ret = 1;
-        break;
-    default:
-        ret = 0;
-        break;
-    }
-    return ret;
-}
-
-/* Softirq Handler for this MCE# processing */
-static void mce_softirq(void)
-{
-    int cpu = smp_processor_id();
-    unsigned int workcpu;
-
-    mce_printk(MCE_VERBOSE, "CPU%d enter softirq\n", cpu);
-
-    mce_barrier_enter(&mce_inside_bar);
-
-    /*
-     * Everybody is here. Now let's see who gets to do the
-     * recovery work. Right now we just see if there's a CPU
-     * that did not have any problems, and pick that one.
-     *
-     * First, just set a default value: the last CPU who reaches this
-     * will overwrite the value and become the default.
-     */
-
-    atomic_set(&severity_cpu, cpu);
-
-    mce_barrier_enter(&mce_severity_bar);
-    if (!mctelem_has_deferred(cpu))
-        atomic_set(&severity_cpu, cpu);
-    mce_barrier_exit(&mce_severity_bar);
-
-    /* We choose severity_cpu for further processing */
-    if (atomic_read(&severity_cpu) == cpu) {
-
-        mce_printk(MCE_VERBOSE, "CPU%d handling errors\n", cpu);
-
-        /* Step1: Fill DOM0 LOG buffer, vMCE injection buffer and
-         * vMCE MSRs virtualization buffer
-         */
-        for_each_online_cpu(workcpu) {
-            mctelem_process_deferred(workcpu, mce_delayed_action);
-        }
-
-        /* Step2: Send Log to DOM0 through vIRQ */
-        if (dom0_vmce_enabled()) {
-            mce_printk(MCE_VERBOSE, "MCE: send MCE# to DOM0 through virq\n");
-            send_global_virq(VIRQ_MCA);
-        }
-    }
-
-    mce_barrier_exit(&mce_inside_bar);
-}
-
-/*
- * Return:
- * -1: if system can't be recoved
- * 0: Continoue to next step
- */
-static int mce_urgent_action(struct cpu_user_regs *regs,
-                              mctelem_cookie_t mctc)
-{
-    uint64_t gstatus;
-
-    if ( mctc == NULL)
-        return 0;
-
-    gstatus = mca_rdmsr(MSR_IA32_MCG_STATUS);
-
-    /*
-     * FIXME: When RIPV = EIPV = 0, it's a little bit tricky. It may be an
-     * asynchronic error, currently we have no way to precisely locate
-     * whether the error occur at guest or hypervisor.
-     * To avoid handling error in wrong way, we treat it as unrecovered.
-     *
-     * Another unrecovered case is RIPV = 0 while in hypervisor
-     * since Xen is not pre-emptible.
-     */
-    if ( !(gstatus & MCG_STATUS_RIPV) &&
-         (!(gstatus & MCG_STATUS_EIPV) || !guest_mode(regs)) )
-        return -1;
-
-    return mce_action(regs, mctc) == MCER_RESET ? -1 : 0;
-}
-
-/* Machine Check owner judge algorithm:
- * When error happens, all cpus serially read its msr banks.
- * The first CPU who fetches the error bank's info will clear
- * this bank. Later readers can't get any infor again.
- * The first CPU is the actual mce_owner
- *
- * For Fatal (pcc=1) error, it might cause machine crash
- * before we're able to log. For avoiding log missing, we adopt two
- * round scanning:
- * Round1: simply scan. If found pcc = 1 or ripv = 0, simply reset.
- * All MCE banks are sticky, when boot up, MCE polling mechanism
- * will help to collect and log those MCE errors.
- * Round2: Do all MCE processing logic as normal.
- */
-
-static void mce_handler_init(void)
-{
-    if (smp_processor_id() != 0)
-        return;
-
-    /* callback register, do we really need so many callback? */
-    /* mce handler data initialization */
-    mce_barrier_init(&mce_inside_bar);
-    mce_barrier_init(&mce_severity_bar);
-    mce_barrier_init(&mce_trap_bar);
-    spin_lock_init(&mce_logout_lock);
-    open_softirq(MACHINE_CHECK_SOFTIRQ, mce_softirq);
-}
-
-static void mce_spin_lock(spinlock_t *lk)
-{
-      while (!spin_trylock(lk)) {
-              cpu_relax();
-              mce_panic_check();
-      }
-}
-
-static void mce_spin_unlock(spinlock_t *lk)
-{
-      spin_unlock(lk);
-}
-
 /* Intel MCE handler */
 static inline void intel_get_extended_msr(struct mcinfo_extended *ext, u32 msr)
 {
@@ -729,88 +491,8 @@ static const struct mca_error_handler in
 
 static void intel_machine_check(struct cpu_user_regs * regs, long error_code)
 {
-    uint64_t gstatus;
-    mctelem_cookie_t mctc = NULL;
-    struct mca_summary bs;
-    struct mca_banks *clear_bank;
-
-    mce_spin_lock(&mce_logout_lock);
-
-    clear_bank = __get_cpu_var(mce_clear_banks);
-    memset( clear_bank->bank_map, 0x0,
-        sizeof(long) * BITS_TO_LONGS(clear_bank->num));
-    mctc = mcheck_mca_logout(MCA_MCE_SCAN, mca_allbanks, &bs, clear_bank);
-
-    if (bs.errcnt) {
-        /*
-         * Uncorrected errors must be dealth with in softirq context.
-         */
-        if (bs.uc || bs.pcc) {
-            add_taint(TAINT_MACHINE_CHECK);
-            if (mctc != NULL)
-                mctelem_defer(mctc);
-            /*
-             * For PCC=1 and can't be recovered, context is lost, so reboot now without
-             * clearing  the banks, and deal with the telemetry after reboot
-             * (the MSRs are sticky)
-             */
-            if (bs.pcc || !bs.recoverable)
-                cpumask_set_cpu(smp_processor_id(), &mce_fatal_cpus);
-        } else {
-            if (mctc != NULL)
-                mctelem_commit(mctc);
-        }
-        atomic_set(&found_error, 1);
-
-        /* The last CPU will be take check/clean-up etc */
-        atomic_set(&severity_cpu, smp_processor_id());
-
-        mce_printk(MCE_CRITICAL, "MCE: clear_bank map %lx on CPU%d\n",
-                *((unsigned long*)clear_bank), smp_processor_id());
-        mcheck_mca_clearbanks(clear_bank);
-    } else {
-        if (mctc != NULL)
-            mctelem_dismiss(mctc);
-    }
-    mce_spin_unlock(&mce_logout_lock);
-
-    mce_barrier_enter(&mce_trap_bar);
-    if ( mctc != NULL && mce_urgent_action(regs, mctc))
-        cpumask_set_cpu(smp_processor_id(), &mce_fatal_cpus);
-    mce_barrier_exit(&mce_trap_bar);
-    /*
-     * Wait until everybody has processed the trap.
-     */
-    mce_barrier_enter(&mce_trap_bar);
-    if (atomic_read(&severity_cpu) == smp_processor_id())
-    {
-        /* According to SDM, if no error bank found on any cpus,
-         * something unexpected happening, we can't do any
-         * recovery job but to reset the system.
-         */
-        if (atomic_read(&found_error) == 0)
-            mc_panic("MCE: No CPU found valid MCE, need reset\n");
-        if (!cpumask_empty(&mce_fatal_cpus))
-        {
-            char *ebufp, ebuf[96] = "MCE: Fatal error happened on CPUs ";
-            ebufp = ebuf + strlen(ebuf);
-            cpumask_scnprintf(ebufp, 95 - strlen(ebuf), &mce_fatal_cpus);
-            mc_panic(ebuf);
-        }
-        atomic_set(&found_error, 0);
-    }
-    mce_barrier_exit(&mce_trap_bar);
-
-    /* Clear flags after above fatal check */
-    mce_barrier_enter(&mce_trap_bar);
-    gstatus = mca_rdmsr(MSR_IA32_MCG_STATUS);
-    if ((gstatus & MCG_STATUS_MCIP) != 0) {
-        mce_printk(MCE_CRITICAL, "MCE: Clear MCIP@ last step");
-        mca_wrmsr(MSR_IA32_MCG_STATUS, gstatus & ~MCG_STATUS_MCIP);
-    }
-    mce_barrier_exit(&mce_trap_bar);
-
-    raise_softirq(MACHINE_CHECK_SOFTIRQ);
+    mcheck_cmn_handler(regs, error_code, mca_allbanks,
+        __get_cpu_var(mce_clear_banks));
 }
 
 /* According to MCA OS writer guide, CMCI handler need to clear bank when
diff -r 7ab899e46347 -r 62de66cec48a xen/arch/x86/cpu/mcheck/x86_mca.h
--- a/xen/arch/x86/cpu/mcheck/x86_mca.h	Mon Sep 17 17:55:12 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/x86_mca.h	Mon Sep 17 17:57:24 2012 +0100
@@ -32,11 +32,11 @@
 /* Bitfield of the MSR_IA32_MCG_CAP register */
 #define MCG_CAP_COUNT           0x00000000000000ffULL
 #define MCG_CTL_P               (1ULL<<8)
-#define MCG_EXT_P               (1ULL<<9)
-#define MCG_CMCI_P              (1ULL<<10)
-#define MCG_TES_P               (1ULL<<11)
-#define MCG_EXT_CNT             16
-#define MCG_SER_P               (1ULL<<24)
+#define MCG_EXT_P               (1ULL<<9)  /* Intel specific */
+#define MCG_CMCI_P              (1ULL<<10) /* Intel specific */
+#define MCG_TES_P               (1ULL<<11) /* Intel specific */
+#define MCG_EXT_CNT             16         /* Intel specific */
+#define MCG_SER_P               (1ULL<<24) /* Intel specific */
 /* Other bits are reserved */
 
 /* Bitfield of the MSR_IA32_MCG_STATUS register */
@@ -53,9 +53,9 @@
 /* Other information */
 #define MCi_STATUS_OTHER        0x01ffffff00000000ULL
 /* Action Required flag */
-#define MCi_STATUS_AR           0x0080000000000000ULL
+#define MCi_STATUS_AR           0x0080000000000000ULL  /* Intel specific */
 /* Signaling flag */
-#define MCi_STATUS_S            0x0100000000000000ULL
+#define MCi_STATUS_S            0x0100000000000000ULL  /* Intel specific */
 /* processor context corrupt */
 #define MCi_STATUS_PCC          0x0200000000000000ULL
 /* MSR_K8_MCi_ADDR register valid */
@@ -100,7 +100,7 @@ struct mca_banks
     unsigned long *bank_map;
 };
 
-static inline void mcabanks_clear(int bit, struct mca_banks *banks)    \
+static inline void mcabanks_clear(int bit, struct mca_banks *banks)
 {
     if (!banks || !banks->bank_map || bit >= banks->num)
         return ;
@@ -125,7 +125,7 @@ struct mca_banks *mcabanks_alloc(void);
 void mcabanks_free(struct mca_banks *banks);
 extern struct mca_banks *mca_allbanks;
 
-/*Keep bank so that we can get staus even if mib is NULL */
+/* Keep bank so that we can get status even if mib is NULL */
 struct mca_binfo {
     int bank;
     struct mcinfo_global *mig;
@@ -138,7 +138,7 @@ enum mce_result
 {
     MCER_NOERROR,
     MCER_RECOVERED,
-    /* Not recoverd, but can continue */
+    /* Not recovered, but can continue */
     MCER_CONTINUE,
     MCER_RESET,
 };
@@ -149,7 +149,7 @@ struct mca_error_handler
      * identified by mca_code. Otherwise, we might need to have
      * a seperate function to decode the corresponding actions
      * for the particular mca error later.
-    */
+     */
     int (*owned_error)(uint64_t status);
     void (*recovery_handler)(struct mca_binfo *binfo,
                     enum mce_result *result, struct cpu_user_regs *regs);

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

From xen-changelog-bounces@lists.xen.org Tue Sep 18 08:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Sep 2012 08:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TDt4S-0007pK-9Q; Tue, 18 Sep 2012 08:22:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDt4R-0007oV-1i
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:15 +0000
Received: from [85.158.143.35:15418] by server-2.bemta-4.messagelabs.com id
	A1/96-06610-63F28505; Tue, 18 Sep 2012 08:22:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-21.messagelabs.com!1347956530!14152188!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2690 invoked from network); 18 Sep 2012 08:22:11 -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;
	18 Sep 2012 08: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 1TDt4L-0004JZ-KB
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDt4L-0000ge-Fe
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:09 +0000
Message-Id: <E1TDt4L-0000ge-Fe@xenbits.xen.org>
Date: Tue, 18 Sep 2012 08:22:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: enable APIC-Register
	Virtualization
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jiongxi Li <jiongxi.li@intel.com>
# Date 1347912248 -3600
# Node ID ec60de627945f17ec2ce5c14e1224b59403875f7
# Parent  62de66cec48a1716bb700912da451a26296b8d1e
xen: enable APIC-Register Virtualization

Add APIC register virtualization support
 - APIC read doesn't cause VM-Exit
 - APIC write becomes trap-like

Signed-off-by: Gang Wei <gang.wei@intel.com>
Signed-off-by: Yang Zhang <yang.z.zhang@intel.com>
Signed-off-by: Jiongxi Li <jiongxi.li@intel.com>
---


diff -r 62de66cec48a -r ec60de627945 xen/arch/x86/hvm/vlapic.c
--- a/xen/arch/x86/hvm/vlapic.c	Mon Sep 17 17:57:24 2012 +0100
+++ b/xen/arch/x86/hvm/vlapic.c	Mon Sep 17 21:04:08 2012 +0100
@@ -823,6 +823,14 @@ static int vlapic_write(struct vcpu *v, 
     return rc;
 }
 
+int vlapic_apicv_write(struct vcpu *v, unsigned int offset)
+{
+    uint32_t val = vlapic_get_reg(vcpu_vlapic(v), offset);
+
+    vlapic_reg_write(v, offset, val);
+    return 0;
+}
+
 int hvm_x2apic_msr_write(struct vcpu *v, unsigned int msr, uint64_t msr_content)
 {
     struct vlapic *vlapic = vcpu_vlapic(v);
diff -r 62de66cec48a -r ec60de627945 xen/arch/x86/hvm/vmx/vmcs.c
--- a/xen/arch/x86/hvm/vmx/vmcs.c	Mon Sep 17 17:57:24 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vmcs.c	Mon Sep 17 21:04:08 2012 +0100
@@ -89,6 +89,7 @@ static void __init vmx_display_features(
     P(cpu_has_vmx_vnmi, "Virtual NMI");
     P(cpu_has_vmx_msr_bitmap, "MSR direct-access bitmap");
     P(cpu_has_vmx_unrestricted_guest, "Unrestricted Guest");
+    P(cpu_has_vmx_apic_reg_virt, "APIC Register Virtualization");
 #undef P
 
     if ( !printed )
@@ -182,6 +183,14 @@ static int vmx_init_vmcs_config(void)
         if ( opt_unrestricted_guest_enabled )
             opt |= SECONDARY_EXEC_UNRESTRICTED_GUEST;
 
+        /*
+         * "APIC Register Virtualization"
+         * can be set only when "use TPR shadow" is set
+         */
+        if ( _vmx_cpu_based_exec_control & CPU_BASED_TPR_SHADOW )
+            opt |= SECONDARY_EXEC_APIC_REGISTER_VIRT;
+
+
         _vmx_secondary_exec_control = adjust_vmx_controls(
             "Secondary Exec Control", min, opt,
             MSR_IA32_VMX_PROCBASED_CTLS2, &mismatch);
diff -r 62de66cec48a -r ec60de627945 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Mon Sep 17 17:57:24 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Mon Sep 17 21:04:08 2012 +0100
@@ -2197,6 +2197,16 @@ static void vmx_idtv_reinject(unsigned l
     }
 }
 
+static int vmx_handle_apic_write(void)
+{
+    unsigned long exit_qualification = __vmread(EXIT_QUALIFICATION);
+    unsigned int offset = exit_qualification & 0xfff;
+
+    ASSERT(cpu_has_vmx_apic_reg_virt);
+
+    return vlapic_apicv_write(current, offset);
+}
+
 void vmx_vmexit_handler(struct cpu_user_regs *regs)
 {
     unsigned int exit_reason, idtv_info, intr_info = 0, vector = 0;
@@ -2649,6 +2659,11 @@ void vmx_vmexit_handler(struct cpu_user_
         break;
     }
 
+    case EXIT_REASON_APIC_WRITE:
+        if ( vmx_handle_apic_write() )
+            hvm_inject_hw_exception(TRAP_gp_fault, 0);
+        break;
+
     case EXIT_REASON_ACCESS_GDTR_OR_IDTR:
     case EXIT_REASON_ACCESS_LDTR_OR_TR:
     case EXIT_REASON_VMX_PREEMPTION_TIMER_EXPIRED:
diff -r 62de66cec48a -r ec60de627945 xen/include/asm-x86/hvm/vlapic.h
--- a/xen/include/asm-x86/hvm/vlapic.h	Mon Sep 17 17:57:24 2012 +0100
+++ b/xen/include/asm-x86/hvm/vlapic.h	Mon Sep 17 21:04:08 2012 +0100
@@ -103,6 +103,8 @@ void vlapic_EOI_set(struct vlapic *vlapi
 
 int vlapic_ipi(struct vlapic *vlapic, uint32_t icr_low, uint32_t icr_high);
 
+int vlapic_apicv_write(struct vcpu *v, unsigned int offset);
+
 struct vlapic *vlapic_lowest_prio(
     struct domain *d, struct vlapic *source,
     int short_hand, uint8_t dest, uint8_t dest_mode);
diff -r 62de66cec48a -r ec60de627945 xen/include/asm-x86/hvm/vmx/vmcs.h
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h	Mon Sep 17 17:57:24 2012 +0100
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h	Mon Sep 17 21:04:08 2012 +0100
@@ -180,6 +180,7 @@ extern u32 vmx_vmentry_control;
 #define SECONDARY_EXEC_ENABLE_VPID              0x00000020
 #define SECONDARY_EXEC_WBINVD_EXITING           0x00000040
 #define SECONDARY_EXEC_UNRESTRICTED_GUEST       0x00000080
+#define SECONDARY_EXEC_APIC_REGISTER_VIRT       0x00000100
 #define SECONDARY_EXEC_PAUSE_LOOP_EXITING       0x00000400
 #define SECONDARY_EXEC_ENABLE_INVPCID           0x00001000
 extern u32 vmx_secondary_exec_control;
@@ -228,6 +229,8 @@ extern bool_t cpu_has_vmx_ins_outs_instr
      SECONDARY_EXEC_UNRESTRICTED_GUEST)
 #define cpu_has_vmx_ple \
     (vmx_secondary_exec_control & SECONDARY_EXEC_PAUSE_LOOP_EXITING)
+#define cpu_has_vmx_apic_reg_virt \
+    (vmx_secondary_exec_control & SECONDARY_EXEC_APIC_REGISTER_VIRT)
 
 /* GUEST_INTERRUPTIBILITY_INFO flags. */
 #define VMX_INTR_SHADOW_STI             0x00000001
diff -r 62de66cec48a -r ec60de627945 xen/include/asm-x86/hvm/vmx/vmx.h
--- a/xen/include/asm-x86/hvm/vmx/vmx.h	Mon Sep 17 17:57:24 2012 +0100
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h	Mon Sep 17 21:04:08 2012 +0100
@@ -129,6 +129,7 @@ void vmx_update_cpu_exec_control(struct 
 #define EXIT_REASON_INVVPID             53
 #define EXIT_REASON_WBINVD              54
 #define EXIT_REASON_XSETBV              55
+#define EXIT_REASON_APIC_WRITE          56
 #define EXIT_REASON_INVPCID             58
 
 /*

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

From xen-changelog-bounces@lists.xen.org Tue Sep 18 08:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Sep 2012 08:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TDt4S-0007pF-6d; Tue, 18 Sep 2012 08:22:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDt4Q-0007oP-LY
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:14 +0000
Received: from [85.158.139.83:15888] by server-6.bemta-5.messagelabs.com id
	72/00-21336-53F28505; Tue, 18 Sep 2012 08:22:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-182.messagelabs.com!1347956532!26454169!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22459 invoked from network); 18 Sep 2012 08:22:13 -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;
	18 Sep 2012 08:22: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 1TDt4N-0004Jl-Q6
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDt4N-0000hf-Lt
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:11 +0000
Message-Id: <E1TDt4N-0000hf-Lt@xenbits.xen.org>
Date: Tue, 18 Sep 2012 08:22:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xsm/flask: remove unneeded
	create_sid field
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Daniel De Graaf <dgdegra@tycho.nsa.gov>
# Date 1347912639 -3600
# Node ID 383f0b427494a2b0f03ccd51b19d10042999f20e
# Parent  6804e90926708152edecbf15e9b6689fbc402b52
xsm/flask: remove unneeded create_sid field

This field was only used to populate the ssid of dom0, which can be
handled explicitly in the domain creation hook. This also removes the
unnecessary permission check on the creation of dom0.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 6804e9092670 -r 383f0b427494 tools/flask/policy/policy/modules/xen/xen.te
--- a/tools/flask/policy/policy/modules/xen/xen.te	Mon Sep 17 21:10:07 2012 +0100
+++ b/tools/flask/policy/policy/modules/xen/xen.te	Mon Sep 17 21:10:39 2012 +0100
@@ -52,8 +52,6 @@ type device_t, resource_type;
 # Rules required to boot the hypervisor and dom0
 #
 ################################################################################
-allow xen_t dom0_t:domain { create };
-
 allow dom0_t xen_t:xen { kexec readapic writeapic mtrr_read mtrr_add mtrr_del
 	scheduler physinfo heap quirk readconsole writeconsole settime getcpuinfo
 	microcode cpupool_op sched_op pm_op };
diff -r 6804e9092670 -r 383f0b427494 xen/xsm/flask/hooks.c
--- a/xen/xsm/flask/hooks.c	Mon Sep 17 21:10:07 2012 +0100
+++ b/xen/xsm/flask/hooks.c	Mon Sep 17 21:10:39 2012 +0100
@@ -108,12 +108,10 @@ static int flask_domain_alloc_security(s
 
     memset(dsec, 0, sizeof(struct domain_security_struct));
 
-    dsec->create_sid = SECSID_NULL;
     switch ( d->domain_id )
     {
     case DOMID_IDLE:
         dsec->sid = SECINITSID_XEN;
-        dsec->create_sid = SECINITSID_DOM0;
         break;
     case DOMID_XEN:
         dsec->sid = SECINITSID_DOMXEN;
@@ -489,25 +487,24 @@ static int flask_domain_create(struct do
     int rc;
     struct domain_security_struct *dsec1;
     struct domain_security_struct *dsec2;
+    static int dom0_created = 0;
 
     dsec1 = current->domain->ssid;
+    dsec2 = d->ssid;
 
-    if ( dsec1->create_sid == SECSID_NULL ) 
-        dsec1->create_sid = ssidref;
+    if ( is_idle_domain(current->domain) && !dom0_created )
+    {
+        dsec2->sid = SECINITSID_DOM0;
+        dom0_created = 1;
+        return 0;
+    }
 
-    rc = avc_has_perm(dsec1->sid, dsec1->create_sid, SECCLASS_DOMAIN, 
+    rc = avc_has_perm(dsec1->sid, ssidref, SECCLASS_DOMAIN,
                       DOMAIN__CREATE, NULL);
     if ( rc )
-    {
-        dsec1->create_sid = SECSID_NULL;
         return rc;
-    }
 
-    dsec2 = d->ssid;
-    dsec2->sid = dsec1->create_sid;
-
-    dsec1->create_sid = SECSID_NULL;
-    dsec2->create_sid = SECSID_NULL;
+    dsec2->sid = ssidref;
 
     return rc;
 }
diff -r 6804e9092670 -r 383f0b427494 xen/xsm/flask/include/objsec.h
--- a/xen/xsm/flask/include/objsec.h	Mon Sep 17 21:10:07 2012 +0100
+++ b/xen/xsm/flask/include/objsec.h	Mon Sep 17 21:10:39 2012 +0100
@@ -19,7 +19,6 @@
 
 struct domain_security_struct {
     u32 sid;               /* current SID */
-    u32 create_sid;
 };
 
 struct evtchn_security_struct {

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

From xen-changelog-bounces@lists.xen.org Tue Sep 18 08:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Sep 2012 08:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TDt4S-0007pF-6d; Tue, 18 Sep 2012 08:22:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDt4Q-0007oP-LY
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:14 +0000
Received: from [85.158.139.83:15888] by server-6.bemta-5.messagelabs.com id
	72/00-21336-53F28505; Tue, 18 Sep 2012 08:22:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-182.messagelabs.com!1347956532!26454169!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22459 invoked from network); 18 Sep 2012 08:22:13 -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;
	18 Sep 2012 08:22: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 1TDt4N-0004Jl-Q6
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDt4N-0000hf-Lt
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:11 +0000
Message-Id: <E1TDt4N-0000hf-Lt@xenbits.xen.org>
Date: Tue, 18 Sep 2012 08:22:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xsm/flask: remove unneeded
	create_sid field
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Daniel De Graaf <dgdegra@tycho.nsa.gov>
# Date 1347912639 -3600
# Node ID 383f0b427494a2b0f03ccd51b19d10042999f20e
# Parent  6804e90926708152edecbf15e9b6689fbc402b52
xsm/flask: remove unneeded create_sid field

This field was only used to populate the ssid of dom0, which can be
handled explicitly in the domain creation hook. This also removes the
unnecessary permission check on the creation of dom0.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 6804e9092670 -r 383f0b427494 tools/flask/policy/policy/modules/xen/xen.te
--- a/tools/flask/policy/policy/modules/xen/xen.te	Mon Sep 17 21:10:07 2012 +0100
+++ b/tools/flask/policy/policy/modules/xen/xen.te	Mon Sep 17 21:10:39 2012 +0100
@@ -52,8 +52,6 @@ type device_t, resource_type;
 # Rules required to boot the hypervisor and dom0
 #
 ################################################################################
-allow xen_t dom0_t:domain { create };
-
 allow dom0_t xen_t:xen { kexec readapic writeapic mtrr_read mtrr_add mtrr_del
 	scheduler physinfo heap quirk readconsole writeconsole settime getcpuinfo
 	microcode cpupool_op sched_op pm_op };
diff -r 6804e9092670 -r 383f0b427494 xen/xsm/flask/hooks.c
--- a/xen/xsm/flask/hooks.c	Mon Sep 17 21:10:07 2012 +0100
+++ b/xen/xsm/flask/hooks.c	Mon Sep 17 21:10:39 2012 +0100
@@ -108,12 +108,10 @@ static int flask_domain_alloc_security(s
 
     memset(dsec, 0, sizeof(struct domain_security_struct));
 
-    dsec->create_sid = SECSID_NULL;
     switch ( d->domain_id )
     {
     case DOMID_IDLE:
         dsec->sid = SECINITSID_XEN;
-        dsec->create_sid = SECINITSID_DOM0;
         break;
     case DOMID_XEN:
         dsec->sid = SECINITSID_DOMXEN;
@@ -489,25 +487,24 @@ static int flask_domain_create(struct do
     int rc;
     struct domain_security_struct *dsec1;
     struct domain_security_struct *dsec2;
+    static int dom0_created = 0;
 
     dsec1 = current->domain->ssid;
+    dsec2 = d->ssid;
 
-    if ( dsec1->create_sid == SECSID_NULL ) 
-        dsec1->create_sid = ssidref;
+    if ( is_idle_domain(current->domain) && !dom0_created )
+    {
+        dsec2->sid = SECINITSID_DOM0;
+        dom0_created = 1;
+        return 0;
+    }
 
-    rc = avc_has_perm(dsec1->sid, dsec1->create_sid, SECCLASS_DOMAIN, 
+    rc = avc_has_perm(dsec1->sid, ssidref, SECCLASS_DOMAIN,
                       DOMAIN__CREATE, NULL);
     if ( rc )
-    {
-        dsec1->create_sid = SECSID_NULL;
         return rc;
-    }
 
-    dsec2 = d->ssid;
-    dsec2->sid = dsec1->create_sid;
-
-    dsec1->create_sid = SECSID_NULL;
-    dsec2->create_sid = SECSID_NULL;
+    dsec2->sid = ssidref;
 
     return rc;
 }
diff -r 6804e9092670 -r 383f0b427494 xen/xsm/flask/include/objsec.h
--- a/xen/xsm/flask/include/objsec.h	Mon Sep 17 21:10:07 2012 +0100
+++ b/xen/xsm/flask/include/objsec.h	Mon Sep 17 21:10:39 2012 +0100
@@ -19,7 +19,6 @@
 
 struct domain_security_struct {
     u32 sid;               /* current SID */
-    u32 create_sid;
 };
 
 struct evtchn_security_struct {

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

From xen-changelog-bounces@lists.xen.org Tue Sep 18 08:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Sep 2012 08:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TDt4T-0007pe-EE; Tue, 18 Sep 2012 08:22:17 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDt4R-0007oa-9x
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:15 +0000
Received: from [85.158.139.211:61083] by server-11.bemta-5.messagelabs.com id
	C6/8A-24658-63F28505; Tue, 18 Sep 2012 08:22:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-206.messagelabs.com!1347956532!18962543!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27105 invoked from network); 18 Sep 2012 08:22:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Sep 2012 08:22: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 1TDt4O-0004Jo-BV
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDt4O-0000hu-6v
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:12 +0000
Message-Id: <E1TDt4O-0000hu-6v@xenbits.xen.org>
Date: Tue, 18 Sep 2012 08:22:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xsm/flask: add domain relabel support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Daniel De Graaf <dgdegra@tycho.nsa.gov>
# Date 1347912741 -3600
# Node ID d1c3375c3f118de2465e4b4ec5e8950aafe5a903
# Parent  383f0b427494a2b0f03ccd51b19d10042999f20e
xsm/flask: add domain relabel support

This adds the ability to change a domain's XSM label after creation.
The new label will be used for all future access checks; however,
existing event channels and memory mappings will remain valid even if
their creation would be denied by the new label.

With appropriate security policy and hooks in the domain builder, this
can be used to create domains that the domain builder does not have
access to after building. It can also be used to allow a domain to
drop privileges - for example, prior to launching a user-supplied
kernel loaded by a pv-grub stubdom.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 383f0b427494 -r d1c3375c3f11 tools/flask/policy/policy/flask/access_vectors
--- a/tools/flask/policy/policy/flask/access_vectors	Mon Sep 17 21:10:39 2012 +0100
+++ b/tools/flask/policy/policy/flask/access_vectors	Mon Sep 17 21:12:21 2012 +0100
@@ -73,6 +73,13 @@ class domain
 	set_virq_handler
 }
 
+class domain2
+{
+	relabelfrom
+	relabelto
+	relabelself
+}
+
 class hvm
 {
     sethvmc
diff -r 383f0b427494 -r d1c3375c3f11 tools/flask/policy/policy/flask/security_classes
--- a/tools/flask/policy/policy/flask/security_classes	Mon Sep 17 21:10:39 2012 +0100
+++ b/tools/flask/policy/policy/flask/security_classes	Mon Sep 17 21:12:21 2012 +0100
@@ -9,6 +9,7 @@
 
 class xen
 class domain
+class domain2
 class hvm
 class mmu
 class resource
diff -r 383f0b427494 -r d1c3375c3f11 tools/flask/policy/policy/modules/xen/xen.te
--- a/tools/flask/policy/policy/modules/xen/xen.te	Mon Sep 17 21:10:39 2012 +0100
+++ b/tools/flask/policy/policy/modules/xen/xen.te	Mon Sep 17 21:12:21 2012 +0100
@@ -169,7 +169,7 @@ delegate_devices(dom0_t, domU_t)
 ################################################################################
 
 # Domains must be declared using domain_type
-neverallow * ~domain_type:domain create;
+neverallow * ~domain_type:domain { create transition };
 
 # Resources must be declared using resource_type
 neverallow * ~resource_type:resource use;
diff -r 383f0b427494 -r d1c3375c3f11 xen/include/public/xsm/flask_op.h
--- a/xen/include/public/xsm/flask_op.h	Mon Sep 17 21:10:39 2012 +0100
+++ b/xen/include/public/xsm/flask_op.h	Mon Sep 17 21:12:21 2012 +0100
@@ -142,6 +142,12 @@ struct xen_flask_peersid {
     uint32_t sid;
 };
 
+struct xen_flask_relabel {
+    /* IN */
+    uint32_t domid;
+    uint32_t sid;
+};
+
 struct xen_flask_op {
     uint32_t cmd;
 #define FLASK_LOAD              1
@@ -167,6 +173,7 @@ struct xen_flask_op {
 #define FLASK_ADD_OCONTEXT      21
 #define FLASK_DEL_OCONTEXT      22
 #define FLASK_GET_PEER_SID      23
+#define FLASK_RELABEL_DOMAIN    24
     uint32_t interface_version; /* XEN_FLASK_INTERFACE_VERSION */
     union {
         struct xen_flask_load load;
@@ -185,6 +192,7 @@ struct xen_flask_op {
         /* FLASK_ADD_OCONTEXT, FLASK_DEL_OCONTEXT */
         struct xen_flask_ocontext ocontext;
         struct xen_flask_peersid peersid;
+        struct xen_flask_relabel relabel;
     } u;
 };
 typedef struct xen_flask_op xen_flask_op_t;
diff -r 383f0b427494 -r d1c3375c3f11 xen/xsm/flask/flask_op.c
--- a/xen/xsm/flask/flask_op.c	Mon Sep 17 21:10:39 2012 +0100
+++ b/xen/xsm/flask/flask_op.c	Mon Sep 17 21:12:21 2012 +0100
@@ -573,6 +573,51 @@ static int flask_get_peer_sid(struct xen
     return rv;
 }
 
+static int flask_relabel_domain(struct xen_flask_relabel *arg)
+{
+    int rc;
+    struct domain *d;
+    struct domain_security_struct *csec = current->domain->ssid;
+    struct domain_security_struct *dsec;
+    struct avc_audit_data ad;
+    AVC_AUDIT_DATA_INIT(&ad, NONE);
+
+    d = rcu_lock_domain_by_any_id(arg->domid);
+    if ( d == NULL )
+        return -ESRCH;
+
+    ad.sdom = current->domain;
+    ad.tdom = d;
+    dsec = d->ssid;
+
+    if ( arg->domid == DOMID_SELF )
+    {
+        rc = avc_has_perm(dsec->sid, arg->sid, SECCLASS_DOMAIN2, DOMAIN2__RELABELSELF, &ad);
+        if ( rc )
+            goto out;
+    }
+    else
+    {
+        rc = avc_has_perm(csec->sid, dsec->sid, SECCLASS_DOMAIN2, DOMAIN2__RELABELFROM, &ad);
+        if ( rc )
+            goto out;
+
+        rc = avc_has_perm(csec->sid, arg->sid, SECCLASS_DOMAIN2, DOMAIN2__RELABELTO, &ad);
+        if ( rc )
+            goto out;
+    }
+
+    rc = avc_has_perm(dsec->sid, arg->sid, SECCLASS_DOMAIN, DOMAIN__TRANSITION, &ad);
+    if ( rc )
+        goto out;
+
+    dsec->sid = arg->sid;
+
+ out:
+    rcu_unlock_domain(d);
+    return rc;
+}
+
 long do_flask_op(XEN_GUEST_HANDLE(xsm_op_t) u_flask_op)
 {
     xen_flask_op_t op;
@@ -680,6 +725,10 @@ long do_flask_op(XEN_GUEST_HANDLE(xsm_op
         rv = flask_get_peer_sid(&op.u.peersid);
         break;
 
+    case FLASK_RELABEL_DOMAIN:
+        rv = flask_relabel_domain(&op.u.relabel);
+        break;
+
     default:
         rv = -ENOSYS;
     }
diff -r 383f0b427494 -r d1c3375c3f11 xen/xsm/flask/include/av_perm_to_string.h
--- a/xen/xsm/flask/include/av_perm_to_string.h	Mon Sep 17 21:10:39 2012 +0100
+++ b/xen/xsm/flask/include/av_perm_to_string.h	Mon Sep 17 21:12:21 2012 +0100
@@ -61,6 +61,9 @@
    S_(SECCLASS_DOMAIN, DOMAIN__SETPODTARGET, "setpodtarget")
    S_(SECCLASS_DOMAIN, DOMAIN__SET_MISC_INFO, "set_misc_info")
    S_(SECCLASS_DOMAIN, DOMAIN__SET_VIRQ_HANDLER, "set_virq_handler")
+   S_(SECCLASS_DOMAIN2, DOMAIN2__RELABELFROM, "relabelfrom")
+   S_(SECCLASS_DOMAIN2, DOMAIN2__RELABELTO, "relabelto")
+   S_(SECCLASS_DOMAIN2, DOMAIN2__RELABELSELF, "relabelself")
    S_(SECCLASS_HVM, HVM__SETHVMC, "sethvmc")
    S_(SECCLASS_HVM, HVM__GETHVMC, "gethvmc")
    S_(SECCLASS_HVM, HVM__SETPARAM, "setparam")
diff -r 383f0b427494 -r d1c3375c3f11 xen/xsm/flask/include/av_permissions.h
--- a/xen/xsm/flask/include/av_permissions.h	Mon Sep 17 21:10:39 2012 +0100
+++ b/xen/xsm/flask/include/av_permissions.h	Mon Sep 17 21:12:21 2012 +0100
@@ -63,6 +63,10 @@
 #define DOMAIN__SET_MISC_INFO                     0x40000000UL
 #define DOMAIN__SET_VIRQ_HANDLER                  0x80000000UL
 
+#define DOMAIN2__RELABELFROM                      0x00000001UL
+#define DOMAIN2__RELABELTO                        0x00000002UL
+#define DOMAIN2__RELABELSELF                      0x00000004UL
+
 #define HVM__SETHVMC                              0x00000001UL
 #define HVM__GETHVMC                              0x00000002UL
 #define HVM__SETPARAM                             0x00000004UL
diff -r 383f0b427494 -r d1c3375c3f11 xen/xsm/flask/include/class_to_string.h
--- a/xen/xsm/flask/include/class_to_string.h	Mon Sep 17 21:10:39 2012 +0100
+++ b/xen/xsm/flask/include/class_to_string.h	Mon Sep 17 21:12:21 2012 +0100
@@ -5,6 +5,7 @@
     S_("null")
     S_("xen")
     S_("domain")
+    S_("domain2")
     S_("hvm")
     S_("mmu")
     S_("resource")
diff -r 383f0b427494 -r d1c3375c3f11 xen/xsm/flask/include/flask.h
--- a/xen/xsm/flask/include/flask.h	Mon Sep 17 21:10:39 2012 +0100
+++ b/xen/xsm/flask/include/flask.h	Mon Sep 17 21:12:21 2012 +0100
@@ -7,13 +7,14 @@
  */
 #define SECCLASS_XEN                                     1
 #define SECCLASS_DOMAIN                                  2
-#define SECCLASS_HVM                                     3
-#define SECCLASS_MMU                                     4
-#define SECCLASS_RESOURCE                                5
-#define SECCLASS_SHADOW                                  6
-#define SECCLASS_EVENT                                   7
-#define SECCLASS_GRANT                                   8
-#define SECCLASS_SECURITY                                9
+#define SECCLASS_DOMAIN2                                 3
+#define SECCLASS_HVM                                     4
+#define SECCLASS_MMU                                     5
+#define SECCLASS_RESOURCE                                6
+#define SECCLASS_SHADOW                                  7
+#define SECCLASS_EVENT                                   8
+#define SECCLASS_GRANT                                   9
+#define SECCLASS_SECURITY                                10
 
 /*
  * Security identifier indices for initial entities

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

From xen-changelog-bounces@lists.xen.org Tue Sep 18 08:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Sep 2012 08:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TDt4T-0007pe-EE; Tue, 18 Sep 2012 08:22:17 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDt4R-0007oa-9x
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:15 +0000
Received: from [85.158.139.211:61083] by server-11.bemta-5.messagelabs.com id
	C6/8A-24658-63F28505; Tue, 18 Sep 2012 08:22:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-206.messagelabs.com!1347956532!18962543!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27105 invoked from network); 18 Sep 2012 08:22:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Sep 2012 08:22: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 1TDt4O-0004Jo-BV
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDt4O-0000hu-6v
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:12 +0000
Message-Id: <E1TDt4O-0000hu-6v@xenbits.xen.org>
Date: Tue, 18 Sep 2012 08:22:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xsm/flask: add domain relabel support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Daniel De Graaf <dgdegra@tycho.nsa.gov>
# Date 1347912741 -3600
# Node ID d1c3375c3f118de2465e4b4ec5e8950aafe5a903
# Parent  383f0b427494a2b0f03ccd51b19d10042999f20e
xsm/flask: add domain relabel support

This adds the ability to change a domain's XSM label after creation.
The new label will be used for all future access checks; however,
existing event channels and memory mappings will remain valid even if
their creation would be denied by the new label.

With appropriate security policy and hooks in the domain builder, this
can be used to create domains that the domain builder does not have
access to after building. It can also be used to allow a domain to
drop privileges - for example, prior to launching a user-supplied
kernel loaded by a pv-grub stubdom.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 383f0b427494 -r d1c3375c3f11 tools/flask/policy/policy/flask/access_vectors
--- a/tools/flask/policy/policy/flask/access_vectors	Mon Sep 17 21:10:39 2012 +0100
+++ b/tools/flask/policy/policy/flask/access_vectors	Mon Sep 17 21:12:21 2012 +0100
@@ -73,6 +73,13 @@ class domain
 	set_virq_handler
 }
 
+class domain2
+{
+	relabelfrom
+	relabelto
+	relabelself
+}
+
 class hvm
 {
     sethvmc
diff -r 383f0b427494 -r d1c3375c3f11 tools/flask/policy/policy/flask/security_classes
--- a/tools/flask/policy/policy/flask/security_classes	Mon Sep 17 21:10:39 2012 +0100
+++ b/tools/flask/policy/policy/flask/security_classes	Mon Sep 17 21:12:21 2012 +0100
@@ -9,6 +9,7 @@
 
 class xen
 class domain
+class domain2
 class hvm
 class mmu
 class resource
diff -r 383f0b427494 -r d1c3375c3f11 tools/flask/policy/policy/modules/xen/xen.te
--- a/tools/flask/policy/policy/modules/xen/xen.te	Mon Sep 17 21:10:39 2012 +0100
+++ b/tools/flask/policy/policy/modules/xen/xen.te	Mon Sep 17 21:12:21 2012 +0100
@@ -169,7 +169,7 @@ delegate_devices(dom0_t, domU_t)
 ################################################################################
 
 # Domains must be declared using domain_type
-neverallow * ~domain_type:domain create;
+neverallow * ~domain_type:domain { create transition };
 
 # Resources must be declared using resource_type
 neverallow * ~resource_type:resource use;
diff -r 383f0b427494 -r d1c3375c3f11 xen/include/public/xsm/flask_op.h
--- a/xen/include/public/xsm/flask_op.h	Mon Sep 17 21:10:39 2012 +0100
+++ b/xen/include/public/xsm/flask_op.h	Mon Sep 17 21:12:21 2012 +0100
@@ -142,6 +142,12 @@ struct xen_flask_peersid {
     uint32_t sid;
 };
 
+struct xen_flask_relabel {
+    /* IN */
+    uint32_t domid;
+    uint32_t sid;
+};
+
 struct xen_flask_op {
     uint32_t cmd;
 #define FLASK_LOAD              1
@@ -167,6 +173,7 @@ struct xen_flask_op {
 #define FLASK_ADD_OCONTEXT      21
 #define FLASK_DEL_OCONTEXT      22
 #define FLASK_GET_PEER_SID      23
+#define FLASK_RELABEL_DOMAIN    24
     uint32_t interface_version; /* XEN_FLASK_INTERFACE_VERSION */
     union {
         struct xen_flask_load load;
@@ -185,6 +192,7 @@ struct xen_flask_op {
         /* FLASK_ADD_OCONTEXT, FLASK_DEL_OCONTEXT */
         struct xen_flask_ocontext ocontext;
         struct xen_flask_peersid peersid;
+        struct xen_flask_relabel relabel;
     } u;
 };
 typedef struct xen_flask_op xen_flask_op_t;
diff -r 383f0b427494 -r d1c3375c3f11 xen/xsm/flask/flask_op.c
--- a/xen/xsm/flask/flask_op.c	Mon Sep 17 21:10:39 2012 +0100
+++ b/xen/xsm/flask/flask_op.c	Mon Sep 17 21:12:21 2012 +0100
@@ -573,6 +573,51 @@ static int flask_get_peer_sid(struct xen
     return rv;
 }
 
+static int flask_relabel_domain(struct xen_flask_relabel *arg)
+{
+    int rc;
+    struct domain *d;
+    struct domain_security_struct *csec = current->domain->ssid;
+    struct domain_security_struct *dsec;
+    struct avc_audit_data ad;
+    AVC_AUDIT_DATA_INIT(&ad, NONE);
+
+    d = rcu_lock_domain_by_any_id(arg->domid);
+    if ( d == NULL )
+        return -ESRCH;
+
+    ad.sdom = current->domain;
+    ad.tdom = d;
+    dsec = d->ssid;
+
+    if ( arg->domid == DOMID_SELF )
+    {
+        rc = avc_has_perm(dsec->sid, arg->sid, SECCLASS_DOMAIN2, DOMAIN2__RELABELSELF, &ad);
+        if ( rc )
+            goto out;
+    }
+    else
+    {
+        rc = avc_has_perm(csec->sid, dsec->sid, SECCLASS_DOMAIN2, DOMAIN2__RELABELFROM, &ad);
+        if ( rc )
+            goto out;
+
+        rc = avc_has_perm(csec->sid, arg->sid, SECCLASS_DOMAIN2, DOMAIN2__RELABELTO, &ad);
+        if ( rc )
+            goto out;
+    }
+
+    rc = avc_has_perm(dsec->sid, arg->sid, SECCLASS_DOMAIN, DOMAIN__TRANSITION, &ad);
+    if ( rc )
+        goto out;
+
+    dsec->sid = arg->sid;
+
+ out:
+    rcu_unlock_domain(d);
+    return rc;
+}
+
 long do_flask_op(XEN_GUEST_HANDLE(xsm_op_t) u_flask_op)
 {
     xen_flask_op_t op;
@@ -680,6 +725,10 @@ long do_flask_op(XEN_GUEST_HANDLE(xsm_op
         rv = flask_get_peer_sid(&op.u.peersid);
         break;
 
+    case FLASK_RELABEL_DOMAIN:
+        rv = flask_relabel_domain(&op.u.relabel);
+        break;
+
     default:
         rv = -ENOSYS;
     }
diff -r 383f0b427494 -r d1c3375c3f11 xen/xsm/flask/include/av_perm_to_string.h
--- a/xen/xsm/flask/include/av_perm_to_string.h	Mon Sep 17 21:10:39 2012 +0100
+++ b/xen/xsm/flask/include/av_perm_to_string.h	Mon Sep 17 21:12:21 2012 +0100
@@ -61,6 +61,9 @@
    S_(SECCLASS_DOMAIN, DOMAIN__SETPODTARGET, "setpodtarget")
    S_(SECCLASS_DOMAIN, DOMAIN__SET_MISC_INFO, "set_misc_info")
    S_(SECCLASS_DOMAIN, DOMAIN__SET_VIRQ_HANDLER, "set_virq_handler")
+   S_(SECCLASS_DOMAIN2, DOMAIN2__RELABELFROM, "relabelfrom")
+   S_(SECCLASS_DOMAIN2, DOMAIN2__RELABELTO, "relabelto")
+   S_(SECCLASS_DOMAIN2, DOMAIN2__RELABELSELF, "relabelself")
    S_(SECCLASS_HVM, HVM__SETHVMC, "sethvmc")
    S_(SECCLASS_HVM, HVM__GETHVMC, "gethvmc")
    S_(SECCLASS_HVM, HVM__SETPARAM, "setparam")
diff -r 383f0b427494 -r d1c3375c3f11 xen/xsm/flask/include/av_permissions.h
--- a/xen/xsm/flask/include/av_permissions.h	Mon Sep 17 21:10:39 2012 +0100
+++ b/xen/xsm/flask/include/av_permissions.h	Mon Sep 17 21:12:21 2012 +0100
@@ -63,6 +63,10 @@
 #define DOMAIN__SET_MISC_INFO                     0x40000000UL
 #define DOMAIN__SET_VIRQ_HANDLER                  0x80000000UL
 
+#define DOMAIN2__RELABELFROM                      0x00000001UL
+#define DOMAIN2__RELABELTO                        0x00000002UL
+#define DOMAIN2__RELABELSELF                      0x00000004UL
+
 #define HVM__SETHVMC                              0x00000001UL
 #define HVM__GETHVMC                              0x00000002UL
 #define HVM__SETPARAM                             0x00000004UL
diff -r 383f0b427494 -r d1c3375c3f11 xen/xsm/flask/include/class_to_string.h
--- a/xen/xsm/flask/include/class_to_string.h	Mon Sep 17 21:10:39 2012 +0100
+++ b/xen/xsm/flask/include/class_to_string.h	Mon Sep 17 21:12:21 2012 +0100
@@ -5,6 +5,7 @@
     S_("null")
     S_("xen")
     S_("domain")
+    S_("domain2")
     S_("hvm")
     S_("mmu")
     S_("resource")
diff -r 383f0b427494 -r d1c3375c3f11 xen/xsm/flask/include/flask.h
--- a/xen/xsm/flask/include/flask.h	Mon Sep 17 21:10:39 2012 +0100
+++ b/xen/xsm/flask/include/flask.h	Mon Sep 17 21:12:21 2012 +0100
@@ -7,13 +7,14 @@
  */
 #define SECCLASS_XEN                                     1
 #define SECCLASS_DOMAIN                                  2
-#define SECCLASS_HVM                                     3
-#define SECCLASS_MMU                                     4
-#define SECCLASS_RESOURCE                                5
-#define SECCLASS_SHADOW                                  6
-#define SECCLASS_EVENT                                   7
-#define SECCLASS_GRANT                                   8
-#define SECCLASS_SECURITY                                9
+#define SECCLASS_DOMAIN2                                 3
+#define SECCLASS_HVM                                     4
+#define SECCLASS_MMU                                     5
+#define SECCLASS_RESOURCE                                6
+#define SECCLASS_SHADOW                                  7
+#define SECCLASS_EVENT                                   8
+#define SECCLASS_GRANT                                   9
+#define SECCLASS_SECURITY                                10
 
 /*
  * Security identifier indices for initial entities

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

From xen-changelog-bounces@lists.xen.org Tue Sep 18 08:22:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Sep 2012 08:22:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TDt4S-0007pA-4N; Tue, 18 Sep 2012 08:22:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDt4Q-0007oK-1S
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:14 +0000
Received: from [85.158.139.83:47085] by server-5.bemta-5.messagelabs.com id
	C7/BE-30514-53F28505; Tue, 18 Sep 2012 08:22:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-182.messagelabs.com!1347956530!26714307!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4154 invoked from network); 18 Sep 2012 08:22: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;
	18 Sep 2012 08: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 1TDt4M-0004Jc-6Q
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDt4M-0000gt-23
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:10 +0000
Message-Id: <E1TDt4M-0000gt-23@xenbits.xen.org>
Date: Tue, 18 Sep 2012 08:22:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: enable Virtual-interrupt
	delivery
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jiongxi Li <jiongxi.li@intel.com>
# Date 1347912311 -3600
# Node ID 713b8849b11afa05f1dde157a3f5086fa3aaad08
# Parent  ec60de627945f17ec2ce5c14e1224b59403875f7
xen: enable Virtual-interrupt delivery

Virtual interrupt delivery avoids Xen to inject vAPIC interrupts
manually, which is fully taken care of by the hardware. This needs
some special awareness into existing interrupr injection path:
For pending interrupt from vLAPIC, instead of direct injection, we may
need update architecture specific indicators before resuming to guest.
Before returning to guest, RVI should be updated if any pending IRRs
EOI exit bitmap controls whether an EOI write should cause VM-Exit. If
set, a trap-like induced EOI VM-Exit is triggered. The approach here
is to manipulate EOI exit bitmap based on value of TMR. Level
triggered irq requires a hook in vLAPIC EOI write, so that vIOAPIC EOI
is triggered and emulated

Signed-off-by: Gang Wei <gang.wei@intel.com>
Signed-off-by: Yang Zhang <yang.z.zhang@intel.com>
Signed-off-by: Jiongxi Li <jiongxi.li@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r ec60de627945 -r 713b8849b11a xen/arch/x86/hvm/vlapic.c
--- a/xen/arch/x86/hvm/vlapic.c	Mon Sep 17 21:04:08 2012 +0100
+++ b/xen/arch/x86/hvm/vlapic.c	Mon Sep 17 21:05:11 2012 +0100
@@ -145,6 +145,9 @@ int vlapic_set_irq(struct vlapic *vlapic
     if ( trig )
         vlapic_set_vector(vec, &vlapic->regs->data[APIC_TMR]);
 
+    if ( hvm_funcs.update_eoi_exit_bitmap )
+        hvm_funcs.update_eoi_exit_bitmap(vlapic_vcpu(vlapic), vec ,trig);
+
     /* We may need to wake up target vcpu, besides set pending bit here */
     return !vlapic_test_and_set_irr(vec, vlapic);
 }
@@ -410,6 +413,14 @@ void vlapic_EOI_set(struct vlapic *vlapi
     hvm_dpci_msi_eoi(current->domain, vector);
 }
 
+void vlapic_handle_EOI_induced_exit(struct vlapic *vlapic, int vector)
+{
+    if ( vlapic_test_and_clear_vector(vector, &vlapic->regs->data[APIC_TMR]) )
+        vioapic_update_EOI(vlapic_domain(vlapic), vector);
+
+    hvm_dpci_msi_eoi(current->domain, vector);
+}
+
 int vlapic_ipi(
     struct vlapic *vlapic, uint32_t icr_low, uint32_t icr_high)
 {
@@ -1000,6 +1011,14 @@ void vlapic_adjust_i8259_target(struct d
     pt_adjust_global_vcpu_target(v);
 }
 
+int vlapic_virtual_intr_delivery_enabled(void)
+{
+    if ( hvm_funcs.virtual_intr_delivery_enabled )
+        return hvm_funcs.virtual_intr_delivery_enabled();
+    else
+        return 0;
+}
+
 int vlapic_has_pending_irq(struct vcpu *v)
 {
     struct vlapic *vlapic = vcpu_vlapic(v);
@@ -1012,6 +1031,9 @@ int vlapic_has_pending_irq(struct vcpu *
     if ( irr == -1 )
         return -1;
 
+    if ( vlapic_virtual_intr_delivery_enabled() )
+        return irr;
+
     isr = vlapic_find_highest_isr(vlapic);
     isr = (isr != -1) ? isr : 0;
     if ( (isr & 0xf0) >= (irr & 0xf0) )
@@ -1024,6 +1046,9 @@ int vlapic_ack_pending_irq(struct vcpu *
 {
     struct vlapic *vlapic = vcpu_vlapic(v);
 
+    if ( vlapic_virtual_intr_delivery_enabled() )
+        return 1;
+
     vlapic_set_vector(vector, &vlapic->regs->data[APIC_ISR]);
     vlapic_clear_irr(vector, vlapic);
 
diff -r ec60de627945 -r 713b8849b11a xen/arch/x86/hvm/vmx/intr.c
--- a/xen/arch/x86/hvm/vmx/intr.c	Mon Sep 17 21:04:08 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/intr.c	Mon Sep 17 21:05:11 2012 +0100
@@ -206,6 +206,7 @@ void vmx_intr_assist(void)
     struct vcpu *v = current;
     unsigned int tpr_threshold = 0;
     enum hvm_intblk intblk;
+    int pt_vector = -1;
 
     /* Block event injection when single step with MTF. */
     if ( unlikely(v->arch.hvm_vcpu.single_step) )
@@ -216,7 +217,7 @@ void vmx_intr_assist(void)
     }
 
     /* Crank the handle on interrupt state. */
-    pt_update_irq(v);
+    pt_vector = pt_update_irq(v);
 
     do {
         intack = hvm_vcpu_has_pending_irq(v);
@@ -227,16 +228,34 @@ void vmx_intr_assist(void)
             goto out;
 
         intblk = hvm_interrupt_blocked(v, intack);
-        if ( intblk == hvm_intblk_tpr )
+        if ( cpu_has_vmx_virtual_intr_delivery )
+        {
+            /* Set "Interrupt-window exiting" for ExtINT */
+            if ( (intblk != hvm_intblk_none) &&
+                 ( (intack.source == hvm_intsrc_pic) ||
+                 ( intack.source == hvm_intsrc_vector) ) )
+            {
+                enable_intr_window(v, intack);
+                goto out;
+            }
+
+            if ( __vmread(VM_ENTRY_INTR_INFO) & INTR_INFO_VALID_MASK )
+            {
+                if ( (intack.source == hvm_intsrc_pic) ||
+                     (intack.source == hvm_intsrc_nmi) ||
+                     (intack.source == hvm_intsrc_mce) )
+                    enable_intr_window(v, intack);
+
+                goto out;
+            }
+        } else if ( intblk == hvm_intblk_tpr )
         {
             ASSERT(vlapic_enabled(vcpu_vlapic(v)));
             ASSERT(intack.source == hvm_intsrc_lapic);
             tpr_threshold = intack.vector >> 4;
             goto out;
-        }
-
-        if ( (intblk != hvm_intblk_none) ||
-             (__vmread(VM_ENTRY_INTR_INFO) & INTR_INFO_VALID_MASK) )
+        } else if ( (intblk != hvm_intblk_none) ||
+                    (__vmread(VM_ENTRY_INTR_INFO) & INTR_INFO_VALID_MASK) )
         {
             enable_intr_window(v, intack);
             goto out;
@@ -253,6 +272,44 @@ void vmx_intr_assist(void)
     {
         hvm_inject_hw_exception(TRAP_machine_check, HVM_DELIVER_NO_ERROR_CODE);
     }
+    else if ( cpu_has_vmx_virtual_intr_delivery &&
+              intack.source != hvm_intsrc_pic &&
+              intack.source != hvm_intsrc_vector )
+    {
+        unsigned long status = __vmread(GUEST_INTR_STATUS);
+
+       /*
+        * Set eoi_exit_bitmap for periodic timer interrup to cause EOI-induced VM
+        * exit, then pending periodic time interrups have the chance to be injected
+        * for compensation
+        */
+        if (pt_vector != -1)
+            vmx_set_eoi_exit_bitmap(v, pt_vector);
+
+        /* we need update the RVI field */
+        status &= ~(unsigned long)0x0FF;
+        status |= (unsigned long)0x0FF & 
+                    intack.vector;
+        __vmwrite(GUEST_INTR_STATUS, status);
+        if (v->arch.hvm_vmx.eoi_exitmap_changed) {
+#ifdef __i386__
+#define UPDATE_EOI_EXITMAP(v, e) {                             \
+        if (test_and_clear_bit(e, &v->arch.hvm_vmx.eoi_exitmap_changed)) {      \
+                __vmwrite(EOI_EXIT_BITMAP##e, v->arch.hvm_vmx.eoi_exit_bitmap[e]);    \
+                __vmwrite(EOI_EXIT_BITMAP##e##_HIGH, v.arch.hvm_vmx.eoi_exit_bitmap[e] >> 32);}}
+#else
+#define UPDATE_EOI_EXITMAP(v, e) {                             \
+        if (test_and_clear_bit(e, &v->arch.hvm_vmx.eoi_exitmap_changed)) {      \
+                __vmwrite(EOI_EXIT_BITMAP##e, v->arch.hvm_vmx.eoi_exit_bitmap[e]);}}
+#endif
+                UPDATE_EOI_EXITMAP(v, 0);
+                UPDATE_EOI_EXITMAP(v, 1);
+                UPDATE_EOI_EXITMAP(v, 2);
+                UPDATE_EOI_EXITMAP(v, 3);
+        }
+
+        pt_intr_post(v, intack);
+    }
     else
     {
         HVMTRACE_2D(INJ_VIRQ, intack.vector, /*fake=*/ 0);
@@ -262,11 +319,16 @@ void vmx_intr_assist(void)
 
     /* Is there another IRQ to queue up behind this one? */
     intack = hvm_vcpu_has_pending_irq(v);
-    if ( unlikely(intack.source != hvm_intsrc_none) )
-        enable_intr_window(v, intack);
+    if ( !cpu_has_vmx_virtual_intr_delivery ||
+         intack.source == hvm_intsrc_pic ||
+         intack.source == hvm_intsrc_vector )
+    {
+        if ( unlikely(intack.source != hvm_intsrc_none) )
+            enable_intr_window(v, intack);
+    }
 
  out:
-    if ( cpu_has_vmx_tpr_shadow )
+    if ( !cpu_has_vmx_virtual_intr_delivery && cpu_has_vmx_tpr_shadow )
         __vmwrite(TPR_THRESHOLD, tpr_threshold);
 }
 
diff -r ec60de627945 -r 713b8849b11a xen/arch/x86/hvm/vmx/vmcs.c
--- a/xen/arch/x86/hvm/vmx/vmcs.c	Mon Sep 17 21:04:08 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vmcs.c	Mon Sep 17 21:05:11 2012 +0100
@@ -90,6 +90,7 @@ static void __init vmx_display_features(
     P(cpu_has_vmx_msr_bitmap, "MSR direct-access bitmap");
     P(cpu_has_vmx_unrestricted_guest, "Unrestricted Guest");
     P(cpu_has_vmx_apic_reg_virt, "APIC Register Virtualization");
+    P(cpu_has_vmx_virtual_intr_delivery, "Virtual Interrupt Delivery");
 #undef P
 
     if ( !printed )
@@ -184,11 +185,12 @@ static int vmx_init_vmcs_config(void)
             opt |= SECONDARY_EXEC_UNRESTRICTED_GUEST;
 
         /*
-         * "APIC Register Virtualization"
+         * "APIC Register Virtualization" and "Virtual Interrupt Delivery"
          * can be set only when "use TPR shadow" is set
          */
         if ( _vmx_cpu_based_exec_control & CPU_BASED_TPR_SHADOW )
-            opt |= SECONDARY_EXEC_APIC_REGISTER_VIRT;
+            opt |= SECONDARY_EXEC_APIC_REGISTER_VIRT |
+                   SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY;
 
 
         _vmx_secondary_exec_control = adjust_vmx_controls(
@@ -772,6 +774,22 @@ static int construct_vmcs(struct vcpu *v
     __vmwrite(IO_BITMAP_A, virt_to_maddr((char *)hvm_io_bitmap + 0));
     __vmwrite(IO_BITMAP_B, virt_to_maddr((char *)hvm_io_bitmap + PAGE_SIZE));
 
+    if ( cpu_has_vmx_virtual_intr_delivery )
+    {
+        /* EOI-exit bitmap */
+        v->arch.hvm_vmx.eoi_exit_bitmap[0] = (uint64_t)0;
+        __vmwrite(EOI_EXIT_BITMAP0, v->arch.hvm_vmx.eoi_exit_bitmap[0]);
+        v->arch.hvm_vmx.eoi_exit_bitmap[1] = (uint64_t)0;
+        __vmwrite(EOI_EXIT_BITMAP1, v->arch.hvm_vmx.eoi_exit_bitmap[1]);
+        v->arch.hvm_vmx.eoi_exit_bitmap[2] = (uint64_t)0;
+        __vmwrite(EOI_EXIT_BITMAP2, v->arch.hvm_vmx.eoi_exit_bitmap[2]);
+        v->arch.hvm_vmx.eoi_exit_bitmap[3] = (uint64_t)0;
+        __vmwrite(EOI_EXIT_BITMAP3, v->arch.hvm_vmx.eoi_exit_bitmap[3]);
+
+        /* Initialise Guest Interrupt Status (RVI and SVI) to 0 */
+        __vmwrite(GUEST_INTR_STATUS, 0);
+    }
+
     /* Host data selectors. */
     __vmwrite(HOST_SS_SELECTOR, __HYPERVISOR_DS);
     __vmwrite(HOST_DS_SELECTOR, __HYPERVISOR_DS);
@@ -1000,6 +1018,30 @@ int vmx_add_host_load_msr(u32 msr)
     return 0;
 }
 
+void vmx_set_eoi_exit_bitmap(struct vcpu *v, u8 vector)
+{
+    int index, offset, changed;
+
+    index = vector >> 6; 
+    offset = vector & 63;
+    changed = !test_and_set_bit(offset,
+                  (uint64_t *)&v->arch.hvm_vmx.eoi_exit_bitmap[index]);
+    if (changed)
+        set_bit(index, &v->arch.hvm_vmx.eoi_exitmap_changed);
+}
+
+void vmx_clear_eoi_exit_bitmap(struct vcpu *v, u8 vector)
+{
+    int index, offset, changed;
+
+    index = vector >> 6; 
+    offset = vector & 63;
+    changed = test_and_clear_bit(offset,
+                  (uint64_t *)&v->arch.hvm_vmx.eoi_exit_bitmap[index]);
+    if (changed)
+        set_bit(index, &v->arch.hvm_vmx.eoi_exitmap_changed);
+}
+
 int vmx_create_vmcs(struct vcpu *v)
 {
     struct arch_vmx_struct *arch_vmx = &v->arch.hvm_vmx;
diff -r ec60de627945 -r 713b8849b11a xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Mon Sep 17 21:04:08 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Mon Sep 17 21:05:11 2012 +0100
@@ -1448,6 +1448,22 @@ static void vmx_set_info_guest(struct vc
     vmx_vmcs_exit(v);
 }
 
+static void vmx_update_eoi_exit_bitmap(struct vcpu *v, u8 vector, u8 trig)
+{
+    if ( cpu_has_vmx_virtual_intr_delivery )
+    {
+        if (trig)
+            vmx_set_eoi_exit_bitmap(v, vector);
+        else
+            vmx_clear_eoi_exit_bitmap(v, vector);
+    }
+}
+
+static int vmx_virtual_intr_delivery_enabled(void)
+{
+    return cpu_has_vmx_virtual_intr_delivery;
+}
+
 static struct hvm_function_table __read_mostly vmx_function_table = {
     .name                 = "VMX",
     .cpu_up_prepare       = vmx_cpu_up_prepare,
@@ -1493,7 +1509,9 @@ static struct hvm_function_table __read_
     .nhvm_vmcx_guest_intercepts_trap = nvmx_intercepts_exception,
     .nhvm_vcpu_vmexit_trap = nvmx_vmexit_trap,
     .nhvm_intr_blocked    = nvmx_intr_blocked,
-    .nhvm_domain_relinquish_resources = nvmx_domain_relinquish_resources
+    .nhvm_domain_relinquish_resources = nvmx_domain_relinquish_resources,
+    .update_eoi_exit_bitmap = vmx_update_eoi_exit_bitmap,
+    .virtual_intr_delivery_enabled = vmx_virtual_intr_delivery_enabled
 };
 
 struct hvm_function_table * __init start_vmx(void)
@@ -2207,6 +2225,17 @@ static int vmx_handle_apic_write(void)
     return vlapic_apicv_write(current, offset);
 }
 
+/*
+ * When "Virtual Interrupt Delivery" is enabled, this function is used
+ * to handle EOI-induced VM exit
+ */
+void vmx_handle_EOI_induced_exit(struct vlapic *vlapic, int vector)
+{
+    ASSERT(cpu_has_vmx_virtual_intr_delivery);
+
+    vlapic_handle_EOI_induced_exit(vlapic, vector);
+}
+
 void vmx_vmexit_handler(struct cpu_user_regs *regs)
 {
     unsigned int exit_reason, idtv_info, intr_info = 0, vector = 0;
@@ -2600,6 +2629,16 @@ void vmx_vmexit_handler(struct cpu_user_
             hvm_inject_hw_exception(TRAP_gp_fault, 0);
         break;
 
+    case EXIT_REASON_EOI_INDUCED:
+    {
+        int vector;
+        exit_qualification = __vmread(EXIT_QUALIFICATION);
+        vector = exit_qualification & 0xff;
+
+        vmx_handle_EOI_induced_exit(vcpu_vlapic(current), vector);
+        break;
+    }
+
     case EXIT_REASON_IO_INSTRUCTION:
         exit_qualification = __vmread(EXIT_QUALIFICATION);
         if ( exit_qualification & 0x10 )
diff -r ec60de627945 -r 713b8849b11a xen/arch/x86/hvm/vpt.c
--- a/xen/arch/x86/hvm/vpt.c	Mon Sep 17 21:04:08 2012 +0100
+++ b/xen/arch/x86/hvm/vpt.c	Mon Sep 17 21:05:11 2012 +0100
@@ -212,7 +212,7 @@ static void pt_timer_fn(void *data)
     pt_unlock(pt);
 }
 
-void pt_update_irq(struct vcpu *v)
+int pt_update_irq(struct vcpu *v)
 {
     struct list_head *head = &v->arch.hvm_vcpu.tm_list;
     struct periodic_time *pt, *temp, *earliest_pt = NULL;
@@ -245,7 +245,7 @@ void pt_update_irq(struct vcpu *v)
     if ( earliest_pt == NULL )
     {
         spin_unlock(&v->arch.hvm_vcpu.tm_lock);
-        return;
+        return -1;
     }
 
     earliest_pt->irq_issued = 1;
@@ -263,6 +263,17 @@ void pt_update_irq(struct vcpu *v)
         hvm_isa_irq_deassert(v->domain, irq);
         hvm_isa_irq_assert(v->domain, irq);
     }
+
+    /*
+     * If periodic timer interrut is handled by lapic, its vector in
+     * IRR is returned and used to set eoi_exit_bitmap for virtual
+     * interrupt delivery case. Otherwise return -1 to do nothing.  
+     */ 
+    if ( vlapic_accept_pic_intr(v) &&
+         (&v->domain->arch.hvm_domain)->vpic[0].int_output )
+        return -1;
+    else 
+        return pt_irq_vector(earliest_pt, hvm_intsrc_lapic);
 }
 
 static struct periodic_time *is_pt_irq(
diff -r ec60de627945 -r 713b8849b11a xen/include/asm-x86/hvm/hvm.h
--- a/xen/include/asm-x86/hvm/hvm.h	Mon Sep 17 21:04:08 2012 +0100
+++ b/xen/include/asm-x86/hvm/hvm.h	Mon Sep 17 21:05:11 2012 +0100
@@ -179,6 +179,10 @@ struct hvm_function_table {
 
     enum hvm_intblk (*nhvm_intr_blocked)(struct vcpu *v);
     void (*nhvm_domain_relinquish_resources)(struct domain *d);
+
+    /* Virtual interrupt delivery */
+    void (*update_eoi_exit_bitmap)(struct vcpu *v, u8 vector, u8 trig);
+    int (*virtual_intr_delivery_enabled)(void);
 };
 
 extern struct hvm_function_table hvm_funcs;
diff -r ec60de627945 -r 713b8849b11a xen/include/asm-x86/hvm/vlapic.h
--- a/xen/include/asm-x86/hvm/vlapic.h	Mon Sep 17 21:04:08 2012 +0100
+++ b/xen/include/asm-x86/hvm/vlapic.h	Mon Sep 17 21:05:11 2012 +0100
@@ -100,6 +100,7 @@ int vlapic_accept_pic_intr(struct vcpu *
 void vlapic_adjust_i8259_target(struct domain *d);
 
 void vlapic_EOI_set(struct vlapic *vlapic);
+void vlapic_handle_EOI_induced_exit(struct vlapic *vlapic, int vector);
 
 int vlapic_ipi(struct vlapic *vlapic, uint32_t icr_low, uint32_t icr_high);
 
diff -r ec60de627945 -r 713b8849b11a xen/include/asm-x86/hvm/vmx/vmcs.h
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h	Mon Sep 17 21:04:08 2012 +0100
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h	Mon Sep 17 21:05:11 2012 +0100
@@ -108,6 +108,9 @@ struct arch_vmx_struct {
     unsigned int         host_msr_count;
     struct vmx_msr_entry *host_msr_area;
 
+    uint32_t             eoi_exitmap_changed;
+    uint64_t             eoi_exit_bitmap[4];
+
     unsigned long        host_cr0;
 
     /* Is the guest in real mode? */
@@ -181,6 +184,7 @@ extern u32 vmx_vmentry_control;
 #define SECONDARY_EXEC_WBINVD_EXITING           0x00000040
 #define SECONDARY_EXEC_UNRESTRICTED_GUEST       0x00000080
 #define SECONDARY_EXEC_APIC_REGISTER_VIRT       0x00000100
+#define SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY    0x00000200
 #define SECONDARY_EXEC_PAUSE_LOOP_EXITING       0x00000400
 #define SECONDARY_EXEC_ENABLE_INVPCID           0x00001000
 extern u32 vmx_secondary_exec_control;
@@ -231,6 +235,8 @@ extern bool_t cpu_has_vmx_ins_outs_instr
     (vmx_secondary_exec_control & SECONDARY_EXEC_PAUSE_LOOP_EXITING)
 #define cpu_has_vmx_apic_reg_virt \
     (vmx_secondary_exec_control & SECONDARY_EXEC_APIC_REGISTER_VIRT)
+#define cpu_has_vmx_virtual_intr_delivery \
+    (vmx_secondary_exec_control & SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY)
 
 /* GUEST_INTERRUPTIBILITY_INFO flags. */
 #define VMX_INTR_SHADOW_STI             0x00000001
@@ -249,6 +255,7 @@ enum vmcs_field {
     GUEST_GS_SELECTOR               = 0x0000080a,
     GUEST_LDTR_SELECTOR             = 0x0000080c,
     GUEST_TR_SELECTOR               = 0x0000080e,
+    GUEST_INTR_STATUS               = 0x00000810,
     HOST_ES_SELECTOR                = 0x00000c00,
     HOST_CS_SELECTOR                = 0x00000c02,
     HOST_SS_SELECTOR                = 0x00000c04,
@@ -276,6 +283,14 @@ enum vmcs_field {
     APIC_ACCESS_ADDR_HIGH           = 0x00002015,
     EPT_POINTER                     = 0x0000201a,
     EPT_POINTER_HIGH                = 0x0000201b,
+    EOI_EXIT_BITMAP0                = 0x0000201c,
+    EOI_EXIT_BITMAP0_HIGH           = 0x0000201d,
+    EOI_EXIT_BITMAP1                = 0x0000201e,
+    EOI_EXIT_BITMAP1_HIGH           = 0x0000201f,
+    EOI_EXIT_BITMAP2                = 0x00002020,
+    EOI_EXIT_BITMAP2_HIGH           = 0x00002021,
+    EOI_EXIT_BITMAP3                = 0x00002022,
+    EOI_EXIT_BITMAP3_HIGH           = 0x00002023,
     GUEST_PHYSICAL_ADDRESS          = 0x00002400,
     GUEST_PHYSICAL_ADDRESS_HIGH     = 0x00002401,
     VMCS_LINK_POINTER               = 0x00002800,
@@ -396,6 +411,8 @@ int vmx_write_guest_msr(u32 msr, u64 val
 int vmx_add_guest_msr(u32 msr);
 int vmx_add_host_load_msr(u32 msr);
 void vmx_vmcs_switch(struct vmcs_struct *from, struct vmcs_struct *to);
+void vmx_set_eoi_exit_bitmap(struct vcpu *v, u8 vector);
+void vmx_clear_eoi_exit_bitmap(struct vcpu *v, u8 vector);
 
 #endif /* ASM_X86_HVM_VMX_VMCS_H__ */
 
diff -r ec60de627945 -r 713b8849b11a xen/include/asm-x86/hvm/vmx/vmx.h
--- a/xen/include/asm-x86/hvm/vmx/vmx.h	Mon Sep 17 21:04:08 2012 +0100
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h	Mon Sep 17 21:05:11 2012 +0100
@@ -119,6 +119,7 @@ void vmx_update_cpu_exec_control(struct 
 #define EXIT_REASON_MCE_DURING_VMENTRY  41
 #define EXIT_REASON_TPR_BELOW_THRESHOLD 43
 #define EXIT_REASON_APIC_ACCESS         44
+#define EXIT_REASON_EOI_INDUCED         45
 #define EXIT_REASON_ACCESS_GDTR_OR_IDTR 46
 #define EXIT_REASON_ACCESS_LDTR_OR_TR   47
 #define EXIT_REASON_EPT_VIOLATION       48
diff -r ec60de627945 -r 713b8849b11a xen/include/asm-x86/hvm/vpt.h
--- a/xen/include/asm-x86/hvm/vpt.h	Mon Sep 17 21:04:08 2012 +0100
+++ b/xen/include/asm-x86/hvm/vpt.h	Mon Sep 17 21:05:11 2012 +0100
@@ -141,7 +141,7 @@ struct pl_time {    /* platform time */
 
 void pt_save_timer(struct vcpu *v);
 void pt_restore_timer(struct vcpu *v);
-void pt_update_irq(struct vcpu *v);
+int pt_update_irq(struct vcpu *v);
 void pt_intr_post(struct vcpu *v, struct hvm_intack intack);
 void pt_migrate(struct vcpu *v);
 

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

From xen-changelog-bounces@lists.xen.org Tue Sep 18 08:22:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Sep 2012 08:22:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TDt4S-0007pA-4N; Tue, 18 Sep 2012 08:22:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDt4Q-0007oK-1S
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:14 +0000
Received: from [85.158.139.83:47085] by server-5.bemta-5.messagelabs.com id
	C7/BE-30514-53F28505; Tue, 18 Sep 2012 08:22:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-182.messagelabs.com!1347956530!26714307!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4154 invoked from network); 18 Sep 2012 08:22: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;
	18 Sep 2012 08: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 1TDt4M-0004Jc-6Q
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDt4M-0000gt-23
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:10 +0000
Message-Id: <E1TDt4M-0000gt-23@xenbits.xen.org>
Date: Tue, 18 Sep 2012 08:22:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: enable Virtual-interrupt
	delivery
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jiongxi Li <jiongxi.li@intel.com>
# Date 1347912311 -3600
# Node ID 713b8849b11afa05f1dde157a3f5086fa3aaad08
# Parent  ec60de627945f17ec2ce5c14e1224b59403875f7
xen: enable Virtual-interrupt delivery

Virtual interrupt delivery avoids Xen to inject vAPIC interrupts
manually, which is fully taken care of by the hardware. This needs
some special awareness into existing interrupr injection path:
For pending interrupt from vLAPIC, instead of direct injection, we may
need update architecture specific indicators before resuming to guest.
Before returning to guest, RVI should be updated if any pending IRRs
EOI exit bitmap controls whether an EOI write should cause VM-Exit. If
set, a trap-like induced EOI VM-Exit is triggered. The approach here
is to manipulate EOI exit bitmap based on value of TMR. Level
triggered irq requires a hook in vLAPIC EOI write, so that vIOAPIC EOI
is triggered and emulated

Signed-off-by: Gang Wei <gang.wei@intel.com>
Signed-off-by: Yang Zhang <yang.z.zhang@intel.com>
Signed-off-by: Jiongxi Li <jiongxi.li@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r ec60de627945 -r 713b8849b11a xen/arch/x86/hvm/vlapic.c
--- a/xen/arch/x86/hvm/vlapic.c	Mon Sep 17 21:04:08 2012 +0100
+++ b/xen/arch/x86/hvm/vlapic.c	Mon Sep 17 21:05:11 2012 +0100
@@ -145,6 +145,9 @@ int vlapic_set_irq(struct vlapic *vlapic
     if ( trig )
         vlapic_set_vector(vec, &vlapic->regs->data[APIC_TMR]);
 
+    if ( hvm_funcs.update_eoi_exit_bitmap )
+        hvm_funcs.update_eoi_exit_bitmap(vlapic_vcpu(vlapic), vec ,trig);
+
     /* We may need to wake up target vcpu, besides set pending bit here */
     return !vlapic_test_and_set_irr(vec, vlapic);
 }
@@ -410,6 +413,14 @@ void vlapic_EOI_set(struct vlapic *vlapi
     hvm_dpci_msi_eoi(current->domain, vector);
 }
 
+void vlapic_handle_EOI_induced_exit(struct vlapic *vlapic, int vector)
+{
+    if ( vlapic_test_and_clear_vector(vector, &vlapic->regs->data[APIC_TMR]) )
+        vioapic_update_EOI(vlapic_domain(vlapic), vector);
+
+    hvm_dpci_msi_eoi(current->domain, vector);
+}
+
 int vlapic_ipi(
     struct vlapic *vlapic, uint32_t icr_low, uint32_t icr_high)
 {
@@ -1000,6 +1011,14 @@ void vlapic_adjust_i8259_target(struct d
     pt_adjust_global_vcpu_target(v);
 }
 
+int vlapic_virtual_intr_delivery_enabled(void)
+{
+    if ( hvm_funcs.virtual_intr_delivery_enabled )
+        return hvm_funcs.virtual_intr_delivery_enabled();
+    else
+        return 0;
+}
+
 int vlapic_has_pending_irq(struct vcpu *v)
 {
     struct vlapic *vlapic = vcpu_vlapic(v);
@@ -1012,6 +1031,9 @@ int vlapic_has_pending_irq(struct vcpu *
     if ( irr == -1 )
         return -1;
 
+    if ( vlapic_virtual_intr_delivery_enabled() )
+        return irr;
+
     isr = vlapic_find_highest_isr(vlapic);
     isr = (isr != -1) ? isr : 0;
     if ( (isr & 0xf0) >= (irr & 0xf0) )
@@ -1024,6 +1046,9 @@ int vlapic_ack_pending_irq(struct vcpu *
 {
     struct vlapic *vlapic = vcpu_vlapic(v);
 
+    if ( vlapic_virtual_intr_delivery_enabled() )
+        return 1;
+
     vlapic_set_vector(vector, &vlapic->regs->data[APIC_ISR]);
     vlapic_clear_irr(vector, vlapic);
 
diff -r ec60de627945 -r 713b8849b11a xen/arch/x86/hvm/vmx/intr.c
--- a/xen/arch/x86/hvm/vmx/intr.c	Mon Sep 17 21:04:08 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/intr.c	Mon Sep 17 21:05:11 2012 +0100
@@ -206,6 +206,7 @@ void vmx_intr_assist(void)
     struct vcpu *v = current;
     unsigned int tpr_threshold = 0;
     enum hvm_intblk intblk;
+    int pt_vector = -1;
 
     /* Block event injection when single step with MTF. */
     if ( unlikely(v->arch.hvm_vcpu.single_step) )
@@ -216,7 +217,7 @@ void vmx_intr_assist(void)
     }
 
     /* Crank the handle on interrupt state. */
-    pt_update_irq(v);
+    pt_vector = pt_update_irq(v);
 
     do {
         intack = hvm_vcpu_has_pending_irq(v);
@@ -227,16 +228,34 @@ void vmx_intr_assist(void)
             goto out;
 
         intblk = hvm_interrupt_blocked(v, intack);
-        if ( intblk == hvm_intblk_tpr )
+        if ( cpu_has_vmx_virtual_intr_delivery )
+        {
+            /* Set "Interrupt-window exiting" for ExtINT */
+            if ( (intblk != hvm_intblk_none) &&
+                 ( (intack.source == hvm_intsrc_pic) ||
+                 ( intack.source == hvm_intsrc_vector) ) )
+            {
+                enable_intr_window(v, intack);
+                goto out;
+            }
+
+            if ( __vmread(VM_ENTRY_INTR_INFO) & INTR_INFO_VALID_MASK )
+            {
+                if ( (intack.source == hvm_intsrc_pic) ||
+                     (intack.source == hvm_intsrc_nmi) ||
+                     (intack.source == hvm_intsrc_mce) )
+                    enable_intr_window(v, intack);
+
+                goto out;
+            }
+        } else if ( intblk == hvm_intblk_tpr )
         {
             ASSERT(vlapic_enabled(vcpu_vlapic(v)));
             ASSERT(intack.source == hvm_intsrc_lapic);
             tpr_threshold = intack.vector >> 4;
             goto out;
-        }
-
-        if ( (intblk != hvm_intblk_none) ||
-             (__vmread(VM_ENTRY_INTR_INFO) & INTR_INFO_VALID_MASK) )
+        } else if ( (intblk != hvm_intblk_none) ||
+                    (__vmread(VM_ENTRY_INTR_INFO) & INTR_INFO_VALID_MASK) )
         {
             enable_intr_window(v, intack);
             goto out;
@@ -253,6 +272,44 @@ void vmx_intr_assist(void)
     {
         hvm_inject_hw_exception(TRAP_machine_check, HVM_DELIVER_NO_ERROR_CODE);
     }
+    else if ( cpu_has_vmx_virtual_intr_delivery &&
+              intack.source != hvm_intsrc_pic &&
+              intack.source != hvm_intsrc_vector )
+    {
+        unsigned long status = __vmread(GUEST_INTR_STATUS);
+
+       /*
+        * Set eoi_exit_bitmap for periodic timer interrup to cause EOI-induced VM
+        * exit, then pending periodic time interrups have the chance to be injected
+        * for compensation
+        */
+        if (pt_vector != -1)
+            vmx_set_eoi_exit_bitmap(v, pt_vector);
+
+        /* we need update the RVI field */
+        status &= ~(unsigned long)0x0FF;
+        status |= (unsigned long)0x0FF & 
+                    intack.vector;
+        __vmwrite(GUEST_INTR_STATUS, status);
+        if (v->arch.hvm_vmx.eoi_exitmap_changed) {
+#ifdef __i386__
+#define UPDATE_EOI_EXITMAP(v, e) {                             \
+        if (test_and_clear_bit(e, &v->arch.hvm_vmx.eoi_exitmap_changed)) {      \
+                __vmwrite(EOI_EXIT_BITMAP##e, v->arch.hvm_vmx.eoi_exit_bitmap[e]);    \
+                __vmwrite(EOI_EXIT_BITMAP##e##_HIGH, v.arch.hvm_vmx.eoi_exit_bitmap[e] >> 32);}}
+#else
+#define UPDATE_EOI_EXITMAP(v, e) {                             \
+        if (test_and_clear_bit(e, &v->arch.hvm_vmx.eoi_exitmap_changed)) {      \
+                __vmwrite(EOI_EXIT_BITMAP##e, v->arch.hvm_vmx.eoi_exit_bitmap[e]);}}
+#endif
+                UPDATE_EOI_EXITMAP(v, 0);
+                UPDATE_EOI_EXITMAP(v, 1);
+                UPDATE_EOI_EXITMAP(v, 2);
+                UPDATE_EOI_EXITMAP(v, 3);
+        }
+
+        pt_intr_post(v, intack);
+    }
     else
     {
         HVMTRACE_2D(INJ_VIRQ, intack.vector, /*fake=*/ 0);
@@ -262,11 +319,16 @@ void vmx_intr_assist(void)
 
     /* Is there another IRQ to queue up behind this one? */
     intack = hvm_vcpu_has_pending_irq(v);
-    if ( unlikely(intack.source != hvm_intsrc_none) )
-        enable_intr_window(v, intack);
+    if ( !cpu_has_vmx_virtual_intr_delivery ||
+         intack.source == hvm_intsrc_pic ||
+         intack.source == hvm_intsrc_vector )
+    {
+        if ( unlikely(intack.source != hvm_intsrc_none) )
+            enable_intr_window(v, intack);
+    }
 
  out:
-    if ( cpu_has_vmx_tpr_shadow )
+    if ( !cpu_has_vmx_virtual_intr_delivery && cpu_has_vmx_tpr_shadow )
         __vmwrite(TPR_THRESHOLD, tpr_threshold);
 }
 
diff -r ec60de627945 -r 713b8849b11a xen/arch/x86/hvm/vmx/vmcs.c
--- a/xen/arch/x86/hvm/vmx/vmcs.c	Mon Sep 17 21:04:08 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vmcs.c	Mon Sep 17 21:05:11 2012 +0100
@@ -90,6 +90,7 @@ static void __init vmx_display_features(
     P(cpu_has_vmx_msr_bitmap, "MSR direct-access bitmap");
     P(cpu_has_vmx_unrestricted_guest, "Unrestricted Guest");
     P(cpu_has_vmx_apic_reg_virt, "APIC Register Virtualization");
+    P(cpu_has_vmx_virtual_intr_delivery, "Virtual Interrupt Delivery");
 #undef P
 
     if ( !printed )
@@ -184,11 +185,12 @@ static int vmx_init_vmcs_config(void)
             opt |= SECONDARY_EXEC_UNRESTRICTED_GUEST;
 
         /*
-         * "APIC Register Virtualization"
+         * "APIC Register Virtualization" and "Virtual Interrupt Delivery"
          * can be set only when "use TPR shadow" is set
          */
         if ( _vmx_cpu_based_exec_control & CPU_BASED_TPR_SHADOW )
-            opt |= SECONDARY_EXEC_APIC_REGISTER_VIRT;
+            opt |= SECONDARY_EXEC_APIC_REGISTER_VIRT |
+                   SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY;
 
 
         _vmx_secondary_exec_control = adjust_vmx_controls(
@@ -772,6 +774,22 @@ static int construct_vmcs(struct vcpu *v
     __vmwrite(IO_BITMAP_A, virt_to_maddr((char *)hvm_io_bitmap + 0));
     __vmwrite(IO_BITMAP_B, virt_to_maddr((char *)hvm_io_bitmap + PAGE_SIZE));
 
+    if ( cpu_has_vmx_virtual_intr_delivery )
+    {
+        /* EOI-exit bitmap */
+        v->arch.hvm_vmx.eoi_exit_bitmap[0] = (uint64_t)0;
+        __vmwrite(EOI_EXIT_BITMAP0, v->arch.hvm_vmx.eoi_exit_bitmap[0]);
+        v->arch.hvm_vmx.eoi_exit_bitmap[1] = (uint64_t)0;
+        __vmwrite(EOI_EXIT_BITMAP1, v->arch.hvm_vmx.eoi_exit_bitmap[1]);
+        v->arch.hvm_vmx.eoi_exit_bitmap[2] = (uint64_t)0;
+        __vmwrite(EOI_EXIT_BITMAP2, v->arch.hvm_vmx.eoi_exit_bitmap[2]);
+        v->arch.hvm_vmx.eoi_exit_bitmap[3] = (uint64_t)0;
+        __vmwrite(EOI_EXIT_BITMAP3, v->arch.hvm_vmx.eoi_exit_bitmap[3]);
+
+        /* Initialise Guest Interrupt Status (RVI and SVI) to 0 */
+        __vmwrite(GUEST_INTR_STATUS, 0);
+    }
+
     /* Host data selectors. */
     __vmwrite(HOST_SS_SELECTOR, __HYPERVISOR_DS);
     __vmwrite(HOST_DS_SELECTOR, __HYPERVISOR_DS);
@@ -1000,6 +1018,30 @@ int vmx_add_host_load_msr(u32 msr)
     return 0;
 }
 
+void vmx_set_eoi_exit_bitmap(struct vcpu *v, u8 vector)
+{
+    int index, offset, changed;
+
+    index = vector >> 6; 
+    offset = vector & 63;
+    changed = !test_and_set_bit(offset,
+                  (uint64_t *)&v->arch.hvm_vmx.eoi_exit_bitmap[index]);
+    if (changed)
+        set_bit(index, &v->arch.hvm_vmx.eoi_exitmap_changed);
+}
+
+void vmx_clear_eoi_exit_bitmap(struct vcpu *v, u8 vector)
+{
+    int index, offset, changed;
+
+    index = vector >> 6; 
+    offset = vector & 63;
+    changed = test_and_clear_bit(offset,
+                  (uint64_t *)&v->arch.hvm_vmx.eoi_exit_bitmap[index]);
+    if (changed)
+        set_bit(index, &v->arch.hvm_vmx.eoi_exitmap_changed);
+}
+
 int vmx_create_vmcs(struct vcpu *v)
 {
     struct arch_vmx_struct *arch_vmx = &v->arch.hvm_vmx;
diff -r ec60de627945 -r 713b8849b11a xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Mon Sep 17 21:04:08 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Mon Sep 17 21:05:11 2012 +0100
@@ -1448,6 +1448,22 @@ static void vmx_set_info_guest(struct vc
     vmx_vmcs_exit(v);
 }
 
+static void vmx_update_eoi_exit_bitmap(struct vcpu *v, u8 vector, u8 trig)
+{
+    if ( cpu_has_vmx_virtual_intr_delivery )
+    {
+        if (trig)
+            vmx_set_eoi_exit_bitmap(v, vector);
+        else
+            vmx_clear_eoi_exit_bitmap(v, vector);
+    }
+}
+
+static int vmx_virtual_intr_delivery_enabled(void)
+{
+    return cpu_has_vmx_virtual_intr_delivery;
+}
+
 static struct hvm_function_table __read_mostly vmx_function_table = {
     .name                 = "VMX",
     .cpu_up_prepare       = vmx_cpu_up_prepare,
@@ -1493,7 +1509,9 @@ static struct hvm_function_table __read_
     .nhvm_vmcx_guest_intercepts_trap = nvmx_intercepts_exception,
     .nhvm_vcpu_vmexit_trap = nvmx_vmexit_trap,
     .nhvm_intr_blocked    = nvmx_intr_blocked,
-    .nhvm_domain_relinquish_resources = nvmx_domain_relinquish_resources
+    .nhvm_domain_relinquish_resources = nvmx_domain_relinquish_resources,
+    .update_eoi_exit_bitmap = vmx_update_eoi_exit_bitmap,
+    .virtual_intr_delivery_enabled = vmx_virtual_intr_delivery_enabled
 };
 
 struct hvm_function_table * __init start_vmx(void)
@@ -2207,6 +2225,17 @@ static int vmx_handle_apic_write(void)
     return vlapic_apicv_write(current, offset);
 }
 
+/*
+ * When "Virtual Interrupt Delivery" is enabled, this function is used
+ * to handle EOI-induced VM exit
+ */
+void vmx_handle_EOI_induced_exit(struct vlapic *vlapic, int vector)
+{
+    ASSERT(cpu_has_vmx_virtual_intr_delivery);
+
+    vlapic_handle_EOI_induced_exit(vlapic, vector);
+}
+
 void vmx_vmexit_handler(struct cpu_user_regs *regs)
 {
     unsigned int exit_reason, idtv_info, intr_info = 0, vector = 0;
@@ -2600,6 +2629,16 @@ void vmx_vmexit_handler(struct cpu_user_
             hvm_inject_hw_exception(TRAP_gp_fault, 0);
         break;
 
+    case EXIT_REASON_EOI_INDUCED:
+    {
+        int vector;
+        exit_qualification = __vmread(EXIT_QUALIFICATION);
+        vector = exit_qualification & 0xff;
+
+        vmx_handle_EOI_induced_exit(vcpu_vlapic(current), vector);
+        break;
+    }
+
     case EXIT_REASON_IO_INSTRUCTION:
         exit_qualification = __vmread(EXIT_QUALIFICATION);
         if ( exit_qualification & 0x10 )
diff -r ec60de627945 -r 713b8849b11a xen/arch/x86/hvm/vpt.c
--- a/xen/arch/x86/hvm/vpt.c	Mon Sep 17 21:04:08 2012 +0100
+++ b/xen/arch/x86/hvm/vpt.c	Mon Sep 17 21:05:11 2012 +0100
@@ -212,7 +212,7 @@ static void pt_timer_fn(void *data)
     pt_unlock(pt);
 }
 
-void pt_update_irq(struct vcpu *v)
+int pt_update_irq(struct vcpu *v)
 {
     struct list_head *head = &v->arch.hvm_vcpu.tm_list;
     struct periodic_time *pt, *temp, *earliest_pt = NULL;
@@ -245,7 +245,7 @@ void pt_update_irq(struct vcpu *v)
     if ( earliest_pt == NULL )
     {
         spin_unlock(&v->arch.hvm_vcpu.tm_lock);
-        return;
+        return -1;
     }
 
     earliest_pt->irq_issued = 1;
@@ -263,6 +263,17 @@ void pt_update_irq(struct vcpu *v)
         hvm_isa_irq_deassert(v->domain, irq);
         hvm_isa_irq_assert(v->domain, irq);
     }
+
+    /*
+     * If periodic timer interrut is handled by lapic, its vector in
+     * IRR is returned and used to set eoi_exit_bitmap for virtual
+     * interrupt delivery case. Otherwise return -1 to do nothing.  
+     */ 
+    if ( vlapic_accept_pic_intr(v) &&
+         (&v->domain->arch.hvm_domain)->vpic[0].int_output )
+        return -1;
+    else 
+        return pt_irq_vector(earliest_pt, hvm_intsrc_lapic);
 }
 
 static struct periodic_time *is_pt_irq(
diff -r ec60de627945 -r 713b8849b11a xen/include/asm-x86/hvm/hvm.h
--- a/xen/include/asm-x86/hvm/hvm.h	Mon Sep 17 21:04:08 2012 +0100
+++ b/xen/include/asm-x86/hvm/hvm.h	Mon Sep 17 21:05:11 2012 +0100
@@ -179,6 +179,10 @@ struct hvm_function_table {
 
     enum hvm_intblk (*nhvm_intr_blocked)(struct vcpu *v);
     void (*nhvm_domain_relinquish_resources)(struct domain *d);
+
+    /* Virtual interrupt delivery */
+    void (*update_eoi_exit_bitmap)(struct vcpu *v, u8 vector, u8 trig);
+    int (*virtual_intr_delivery_enabled)(void);
 };
 
 extern struct hvm_function_table hvm_funcs;
diff -r ec60de627945 -r 713b8849b11a xen/include/asm-x86/hvm/vlapic.h
--- a/xen/include/asm-x86/hvm/vlapic.h	Mon Sep 17 21:04:08 2012 +0100
+++ b/xen/include/asm-x86/hvm/vlapic.h	Mon Sep 17 21:05:11 2012 +0100
@@ -100,6 +100,7 @@ int vlapic_accept_pic_intr(struct vcpu *
 void vlapic_adjust_i8259_target(struct domain *d);
 
 void vlapic_EOI_set(struct vlapic *vlapic);
+void vlapic_handle_EOI_induced_exit(struct vlapic *vlapic, int vector);
 
 int vlapic_ipi(struct vlapic *vlapic, uint32_t icr_low, uint32_t icr_high);
 
diff -r ec60de627945 -r 713b8849b11a xen/include/asm-x86/hvm/vmx/vmcs.h
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h	Mon Sep 17 21:04:08 2012 +0100
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h	Mon Sep 17 21:05:11 2012 +0100
@@ -108,6 +108,9 @@ struct arch_vmx_struct {
     unsigned int         host_msr_count;
     struct vmx_msr_entry *host_msr_area;
 
+    uint32_t             eoi_exitmap_changed;
+    uint64_t             eoi_exit_bitmap[4];
+
     unsigned long        host_cr0;
 
     /* Is the guest in real mode? */
@@ -181,6 +184,7 @@ extern u32 vmx_vmentry_control;
 #define SECONDARY_EXEC_WBINVD_EXITING           0x00000040
 #define SECONDARY_EXEC_UNRESTRICTED_GUEST       0x00000080
 #define SECONDARY_EXEC_APIC_REGISTER_VIRT       0x00000100
+#define SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY    0x00000200
 #define SECONDARY_EXEC_PAUSE_LOOP_EXITING       0x00000400
 #define SECONDARY_EXEC_ENABLE_INVPCID           0x00001000
 extern u32 vmx_secondary_exec_control;
@@ -231,6 +235,8 @@ extern bool_t cpu_has_vmx_ins_outs_instr
     (vmx_secondary_exec_control & SECONDARY_EXEC_PAUSE_LOOP_EXITING)
 #define cpu_has_vmx_apic_reg_virt \
     (vmx_secondary_exec_control & SECONDARY_EXEC_APIC_REGISTER_VIRT)
+#define cpu_has_vmx_virtual_intr_delivery \
+    (vmx_secondary_exec_control & SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY)
 
 /* GUEST_INTERRUPTIBILITY_INFO flags. */
 #define VMX_INTR_SHADOW_STI             0x00000001
@@ -249,6 +255,7 @@ enum vmcs_field {
     GUEST_GS_SELECTOR               = 0x0000080a,
     GUEST_LDTR_SELECTOR             = 0x0000080c,
     GUEST_TR_SELECTOR               = 0x0000080e,
+    GUEST_INTR_STATUS               = 0x00000810,
     HOST_ES_SELECTOR                = 0x00000c00,
     HOST_CS_SELECTOR                = 0x00000c02,
     HOST_SS_SELECTOR                = 0x00000c04,
@@ -276,6 +283,14 @@ enum vmcs_field {
     APIC_ACCESS_ADDR_HIGH           = 0x00002015,
     EPT_POINTER                     = 0x0000201a,
     EPT_POINTER_HIGH                = 0x0000201b,
+    EOI_EXIT_BITMAP0                = 0x0000201c,
+    EOI_EXIT_BITMAP0_HIGH           = 0x0000201d,
+    EOI_EXIT_BITMAP1                = 0x0000201e,
+    EOI_EXIT_BITMAP1_HIGH           = 0x0000201f,
+    EOI_EXIT_BITMAP2                = 0x00002020,
+    EOI_EXIT_BITMAP2_HIGH           = 0x00002021,
+    EOI_EXIT_BITMAP3                = 0x00002022,
+    EOI_EXIT_BITMAP3_HIGH           = 0x00002023,
     GUEST_PHYSICAL_ADDRESS          = 0x00002400,
     GUEST_PHYSICAL_ADDRESS_HIGH     = 0x00002401,
     VMCS_LINK_POINTER               = 0x00002800,
@@ -396,6 +411,8 @@ int vmx_write_guest_msr(u32 msr, u64 val
 int vmx_add_guest_msr(u32 msr);
 int vmx_add_host_load_msr(u32 msr);
 void vmx_vmcs_switch(struct vmcs_struct *from, struct vmcs_struct *to);
+void vmx_set_eoi_exit_bitmap(struct vcpu *v, u8 vector);
+void vmx_clear_eoi_exit_bitmap(struct vcpu *v, u8 vector);
 
 #endif /* ASM_X86_HVM_VMX_VMCS_H__ */
 
diff -r ec60de627945 -r 713b8849b11a xen/include/asm-x86/hvm/vmx/vmx.h
--- a/xen/include/asm-x86/hvm/vmx/vmx.h	Mon Sep 17 21:04:08 2012 +0100
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h	Mon Sep 17 21:05:11 2012 +0100
@@ -119,6 +119,7 @@ void vmx_update_cpu_exec_control(struct 
 #define EXIT_REASON_MCE_DURING_VMENTRY  41
 #define EXIT_REASON_TPR_BELOW_THRESHOLD 43
 #define EXIT_REASON_APIC_ACCESS         44
+#define EXIT_REASON_EOI_INDUCED         45
 #define EXIT_REASON_ACCESS_GDTR_OR_IDTR 46
 #define EXIT_REASON_ACCESS_LDTR_OR_TR   47
 #define EXIT_REASON_EPT_VIOLATION       48
diff -r ec60de627945 -r 713b8849b11a xen/include/asm-x86/hvm/vpt.h
--- a/xen/include/asm-x86/hvm/vpt.h	Mon Sep 17 21:04:08 2012 +0100
+++ b/xen/include/asm-x86/hvm/vpt.h	Mon Sep 17 21:05:11 2012 +0100
@@ -141,7 +141,7 @@ struct pl_time {    /* platform time */
 
 void pt_save_timer(struct vcpu *v);
 void pt_restore_timer(struct vcpu *v);
-void pt_update_irq(struct vcpu *v);
+int pt_update_irq(struct vcpu *v);
 void pt_intr_post(struct vcpu *v, struct hvm_intack intack);
 void pt_migrate(struct vcpu *v);
 

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

From xen-changelog-bounces@lists.xen.org Tue Sep 18 08:22:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Sep 2012 08:22:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TDt4c-0007sv-Hy; Tue, 18 Sep 2012 08:22:26 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDt4a-0007sM-Kd
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:24 +0000
Received: from [85.158.143.35:35067] by server-1.bemta-4.messagelabs.com id
	DA/6D-12504-F3F28505; Tue, 18 Sep 2012 08:22:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-21.messagelabs.com!1347956528!15481183!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9365 invoked from network); 18 Sep 2012 08:22:12 -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;
	18 Sep 2012 08: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 1TDt4K-0004JQ-1A
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDt4J-0000fv-OU
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:07 +0000
Message-Id: <E1TDt4J-0000fv-OU@xenbits.xen.org>
Date: Tue, 18 Sep 2012 08:22:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Extra check in grant table code for
	mapping of shared frame
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1347900717 -3600
# Node ID 5ba70e030b47b37c638054d4f22889f9a6c39b8e
# Parent  3bf63fcfacd1945381d34911d10b298e0df3883e
Extra check in grant table code for mapping of shared frame

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 3bf63fcfacd1 -r 5ba70e030b47 xen/common/grant_table.c
--- a/xen/common/grant_table.c	Mon Sep 17 11:17:05 2012 +0100
+++ b/xen/common/grant_table.c	Mon Sep 17 17:51:57 2012 +0100
@@ -708,9 +708,12 @@ __gnttab_map_grant_ref(
     }
     else if ( owner == rd || owner == dom_cow )
     {
-        if ( gnttab_host_mapping_get_page_type(op, ld, rd) &&
-             !get_page_type(pg, PGT_writable_page) )
-            goto could_not_pin;
+        if ( gnttab_host_mapping_get_page_type(op, ld, rd) )
+        {
+            if ( (owner == dom_cow) ||
+                 !get_page_type(pg, PGT_writable_page) )
+                goto could_not_pin;
+        }
 
         nr_gets++;
         if ( op->flags & GNTMAP_host_map )

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

From xen-changelog-bounces@lists.xen.org Tue Sep 18 08:22:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Sep 2012 08:22:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TDt4c-0007sv-Hy; Tue, 18 Sep 2012 08:22:26 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDt4a-0007sM-Kd
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:24 +0000
Received: from [85.158.143.35:35067] by server-1.bemta-4.messagelabs.com id
	DA/6D-12504-F3F28505; Tue, 18 Sep 2012 08:22:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-21.messagelabs.com!1347956528!15481183!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9365 invoked from network); 18 Sep 2012 08:22:12 -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;
	18 Sep 2012 08: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 1TDt4K-0004JQ-1A
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDt4J-0000fv-OU
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:07 +0000
Message-Id: <E1TDt4J-0000fv-OU@xenbits.xen.org>
Date: Tue, 18 Sep 2012 08:22:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Extra check in grant table code for
	mapping of shared frame
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1347900717 -3600
# Node ID 5ba70e030b47b37c638054d4f22889f9a6c39b8e
# Parent  3bf63fcfacd1945381d34911d10b298e0df3883e
Extra check in grant table code for mapping of shared frame

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 3bf63fcfacd1 -r 5ba70e030b47 xen/common/grant_table.c
--- a/xen/common/grant_table.c	Mon Sep 17 11:17:05 2012 +0100
+++ b/xen/common/grant_table.c	Mon Sep 17 17:51:57 2012 +0100
@@ -708,9 +708,12 @@ __gnttab_map_grant_ref(
     }
     else if ( owner == rd || owner == dom_cow )
     {
-        if ( gnttab_host_mapping_get_page_type(op, ld, rd) &&
-             !get_page_type(pg, PGT_writable_page) )
-            goto could_not_pin;
+        if ( gnttab_host_mapping_get_page_type(op, ld, rd) )
+        {
+            if ( (owner == dom_cow) ||
+                 !get_page_type(pg, PGT_writable_page) )
+                goto could_not_pin;
+        }
 
         nr_gets++;
         if ( op->flags & GNTMAP_host_map )

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

From xen-changelog-bounces@lists.xen.org Tue Sep 18 08:22:32 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Sep 2012 08:22:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TDt4g-0007ua-LD; Tue, 18 Sep 2012 08:22:30 +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 1TDt4f-0007sI-7k
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1347956531!11438283!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23300 invoked from network); 18 Sep 2012 08:22:13 -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;
	18 Sep 2012 08:22: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 1TDt4N-0004Ji-6d
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDt4N-0000hO-5N
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:11 +0000
Message-Id: <E1TDt4N-0000hO-5N@xenbits.xen.org>
Date: Tue, 18 Sep 2012 08:22:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xsm/flask: remove inherited class
	attributes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Daniel De Graaf <dgdegra@tycho.nsa.gov>
# Date 1347912607 -3600
# Node ID 6804e90926708152edecbf15e9b6689fbc402b52
# Parent  c2578dd96b8318e108fff0f340411135dedaa47d
xsm/flask: remove inherited class attributes

The ability to declare common permission blocks shared across multiple
classes is not currently used in Xen. Currently, support for this
feature is broken in the header generation scripts, and it is not
expected that this feature will be used in the future, so remove the
dead code.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r c2578dd96b83 -r 6804e9092670 tools/flask/policy/policy/flask/Makefile
--- a/tools/flask/policy/policy/flask/Makefile	Mon Sep 17 21:06:02 2012 +0100
+++ b/tools/flask/policy/policy/flask/Makefile	Mon Sep 17 21:10:07 2012 +0100
@@ -14,7 +14,7 @@ FLASK_H_DEPEND = security_classes initia
 AV_H_DEPEND = access_vectors
 
 FLASK_H_FILES = class_to_string.h flask.h initial_sid_to_string.h
-AV_H_FILES = av_inherit.h common_perm_to_string.h av_perm_to_string.h av_permissions.h
+AV_H_FILES = av_perm_to_string.h av_permissions.h
 ALL_H_FILES = $(FLASK_H_FILES) $(AV_H_FILES)
 
 all:  $(ALL_H_FILES)
diff -r c2578dd96b83 -r 6804e9092670 tools/flask/policy/policy/flask/access_vectors
--- a/tools/flask/policy/policy/flask/access_vectors	Mon Sep 17 21:06:02 2012 +0100
+++ b/tools/flask/policy/policy/flask/access_vectors	Mon Sep 17 21:10:07 2012 +0100
@@ -1,22 +1,7 @@
-#
-# Define common prefixes for access vectors
-#
-# common common_name { permission_name ... }
-
-#
-# Define a common prefix for file access vectors.
-#
-
-
 #
 # Define the access vectors.
 #
-# class class_name [ inherits common_name ] { permission_name ... }
-
-
-#
-# Define the access vector interpretation for file-related objects.
-#
+# class class_name { permission_name ... }
 
 class xen
 {
diff -r c2578dd96b83 -r 6804e9092670 tools/flask/policy/policy/flask/mkaccess_vector.sh
--- a/tools/flask/policy/policy/flask/mkaccess_vector.sh	Mon Sep 17 21:06:02 2012 +0100
+++ b/tools/flask/policy/policy/flask/mkaccess_vector.sh	Mon Sep 17 21:10:07 2012 +0100
@@ -10,50 +10,21 @@ shift
 
 # output files
 av_permissions="av_permissions.h"
-av_inherit="av_inherit.h"
-common_perm_to_string="common_perm_to_string.h"
 av_perm_to_string="av_perm_to_string.h"
 
 cat $* | $awk "
 BEGIN	{
 		outfile = \"$av_permissions\"
-		inheritfile = \"$av_inherit\"
-		cpermfile = \"$common_perm_to_string\"
 		avpermfile = \"$av_perm_to_string\"
 		"'
 		nextstate = "COMMON_OR_AV";
 		printf("/* This file is automatically generated.  Do not edit. */\n") > outfile;
-		printf("/* This file is automatically generated.  Do not edit. */\n") > inheritfile;
-		printf("/* This file is automatically generated.  Do not edit. */\n") > cpermfile;
 		printf("/* This file is automatically generated.  Do not edit. */\n") > avpermfile;
 ;
 	}
 /^[ \t]*#/	{ 
 			next;
 		}
-$1 == "common"	{ 
-			if (nextstate != "COMMON_OR_AV")
-			{
-				printf("Parse error:  Unexpected COMMON definition on line %d\n", NR);
-				next;	
-			}
-
-			if ($2 in common_defined)
-			{
-				printf("Duplicate COMMON definition for %s on line %d.\n", $2, NR);
-				next;
-			}	
-			common_defined[$2] = 1;
-
-			tclass = $2;
-			common_name = $2; 
-			permission = 1;
-
-			printf("TB_(common_%s_perm_to_string)\n", $2) > cpermfile;
-
-			nextstate = "COMMON-OPENBRACKET";
-			next;
-		}
 $1 == "class"	{
 			if (nextstate != "COMMON_OR_AV" &&
 			    nextstate != "CLASS_OR_CLASS-OPENBRACKET")
@@ -71,62 +42,11 @@ BEGIN	{
 			} 
 			av_defined[tclass] = 1;
 
-			inherits = "";
 			permission = 1;
 
 			nextstate = "INHERITS_OR_CLASS-OPENBRACKET";
 			next;
 		}
-$1 == "inherits" {			
-			if (nextstate != "INHERITS_OR_CLASS-OPENBRACKET")
-			{
-				printf("Parse error:  Unexpected INHERITS definition on line %d\n", NR);
-				next;	
-			}
-
-			if (!($2 in common_defined))
-			{
-				printf("COMMON %s is not defined (line %d).\n", $2, NR);
-				next;
-			}
-
-			inherits = $2;
-			permission = common_base[$2];
-
-			for (combined in common_perms)
-			{
-				split(combined,separate, SUBSEP);
-				if (separate[1] == inherits)
-				{
-					inherited_perms[common_perms[combined]] = separate[2];
-				}
-			}
-
-                        j = 1;
-                        for (i in inherited_perms) {
-                            ind[j] = i + 0;
-                            j++;
-                        }
-                        n = asort(ind);
-			for (i = 1; i <= n; i++) {
-				perm = inherited_perms[ind[i]];
-				printf("#define %s__%s", toupper(tclass), toupper(perm)) > outfile; 
-				spaces = 40 - (length(perm) + length(tclass));
-				if (spaces < 1)
-				      spaces = 1;
-				for (j = 0; j < spaces; j++) 
-					printf(" ") > outfile; 
-				printf("0x%08xUL\n", ind[i]) > outfile; 
-			}
-			printf("\n") > outfile;
-                        for (i in ind) delete ind[i];
-                        for (i in inherited_perms) delete inherited_perms[i];
-
-			printf("   S_(SECCLASS_%s, %s, 0x%08xUL)\n", toupper(tclass), inherits, permission) > inheritfile; 
-
-			nextstate = "CLASS_OR_CLASS-OPENBRACKET";
-			next;
-		}
 $1 == "{"	{ 
 			if (nextstate != "INHERITS_OR_CLASS-OPENBRACKET" &&
 			    nextstate != "CLASS_OR_CLASS-OPENBRACKET" &&
@@ -177,15 +97,6 @@ BEGIN	{
 
 				av_perms[tclass,$1] = permission;
 		
-				if (inherits != "")
-				{
-					if ((inherits,$1) in common_perms)
-					{
-						printf("Permission %s in %s on line %d conflicts with common permission.\n", $1, tclass, inherits, NR);
-						next;
-					}
-				}
-
 				printf("#define %s__%s", toupper(tclass), toupper($1)) > outfile; 
 
 				printf("   S_(SECCLASS_%s, %s__%s, \"%s\")\n", toupper(tclass), toupper(tclass), toupper($1), $1) > avpermfile; 
diff -r c2578dd96b83 -r 6804e9092670 xen/xsm/flask/avc.c
--- a/xen/xsm/flask/avc.c	Mon Sep 17 21:06:02 2012 +0100
+++ b/xen/xsm/flask/avc.c	Mon Sep 17 21:10:07 2012 +0100
@@ -45,28 +45,11 @@ static const char *class_to_string[] = {
 #undef S_
 };
 
-#define TB_(s) static const char * s [] = {
-#define TE_(s) };
-#define S_(s) s,
-#include "common_perm_to_string.h"
-#undef TB_
-#undef TE_
-#undef S_
-
-static const struct av_inherit av_inherit[] = {
-#define S_(c, i, b) { .tclass = c, .common_pts = common_##i##_perm_to_string, \
-                      .common_base = b },
-#include "av_inherit.h"
-#undef S_
-};
-
 const struct selinux_class_perm selinux_class_perm = {
     .av_perm_to_string = av_perm_to_string,
     .av_pts_len = ARRAY_SIZE(av_perm_to_string),
     .class_to_string = class_to_string,
     .cts_len = ARRAY_SIZE(class_to_string),
-    .av_inherit = av_inherit,
-    .av_inherit_len = ARRAY_SIZE(av_inherit)
 };
 
 #define AVC_CACHE_SLOTS            512
@@ -181,8 +164,6 @@ static void avc_printk(struct avc_dump_b
  */
 static void avc_dump_av(struct avc_dump_buf *buf, u16 tclass, u32 av)
 {
-    const char **common_pts = NULL;
-    u32 common_base = 0;
     int i, i2, perm;
 
     if ( av == 0 )
@@ -191,29 +172,9 @@ static void avc_dump_av(struct avc_dump_
         return;
     }
 
-    for ( i = 0; i < ARRAY_SIZE(av_inherit); i++ )
-    {
-        if (av_inherit[i].tclass == tclass)
-        {
-            common_pts = av_inherit[i].common_pts;
-            common_base = av_inherit[i].common_base;
-            break;
-        }
-    }
-
     avc_printk(buf, " {");
     i = 0;
     perm = 1;
-    while ( perm < common_base )
-    {
-        if (perm & av)
-        {
-            avc_printk(buf, " %s", common_pts[i]);
-            av &= ~perm;
-        }
-        i++;
-        perm <<= 1;
-    }
 
     while ( i < sizeof(av) * 8 )
     {
diff -r c2578dd96b83 -r 6804e9092670 xen/xsm/flask/include/av_inherit.h
--- a/xen/xsm/flask/include/av_inherit.h	Mon Sep 17 21:06:02 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-/* This file is automatically generated.  Do not edit. */
diff -r c2578dd96b83 -r 6804e9092670 xen/xsm/flask/include/avc_ss.h
--- a/xen/xsm/flask/include/avc_ss.h	Mon Sep 17 21:06:02 2012 +0100
+++ b/xen/xsm/flask/include/avc_ss.h	Mon Sep 17 21:10:07 2012 +0100
@@ -16,19 +16,11 @@ struct av_perm_to_string {
     const char *name;
 };
 
-struct av_inherit {
-    const char **common_pts;
-    u32 common_base;
-    u16 tclass;
-};
-
 struct selinux_class_perm {
     const struct av_perm_to_string *av_perm_to_string;
     u32 av_pts_len;
     u32 cts_len;
     const char **class_to_string;
-    const struct av_inherit *av_inherit;
-    u32 av_inherit_len;
 };
 
 extern const struct selinux_class_perm selinux_class_perm;
diff -r c2578dd96b83 -r 6804e9092670 xen/xsm/flask/include/common_perm_to_string.h
--- a/xen/xsm/flask/include/common_perm_to_string.h	Mon Sep 17 21:06:02 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-/* This file is automatically generated.  Do not edit. */
diff -r c2578dd96b83 -r 6804e9092670 xen/xsm/flask/ss/policydb.c
--- a/xen/xsm/flask/ss/policydb.c	Mon Sep 17 21:06:02 2012 +0100
+++ b/xen/xsm/flask/ss/policydb.c	Mon Sep 17 21:10:07 2012 +0100
@@ -254,14 +254,6 @@ out_free_symtab:
 
 static int common_index(void *key, void *datum, void *datap)
 {
-    struct policydb *p;
-    struct common_datum *comdatum;
-
-    comdatum = datum;
-    p = datap;
-    if ( !comdatum->value || comdatum->value > p->p_commons.nprim )
-        return -EINVAL;
-    p->p_common_val_to_name[comdatum->value - 1] = key;
     return 0;
 }
 
@@ -382,8 +374,7 @@ static int (*index_f[SYM_NUM]) (void *ke
 };
 
 /*
- * Define the common val_to_name array and the class
- * val_to_name and val_to_struct arrays in a policy
+ * Define the class val_to_name and val_to_struct arrays in a policy
  * database structure.
  *
  * Caller must clean up upon failure.
@@ -392,18 +383,6 @@ static int policydb_index_classes(struct
 {
     int rc;
 
-    p->p_common_val_to_name =
-        xmalloc_array(char *, p->p_commons.nprim);
-    if ( !p->p_common_val_to_name )
-    {
-        rc = -ENOMEM;
-        goto out;
-    }
-
-    rc = hashtab_map(p->p_commons.table, common_index, p);
-    if ( rc )
-        goto out;
-
     p->class_val_to_struct =
         xmalloc_array(struct class_datum *, p->p_classes.nprim);
     if ( !p->class_val_to_struct )
@@ -1200,26 +1179,9 @@ static int class_read(struct policydb *p
 
     if ( len2 )
     {
-        cladatum->comkey = xmalloc_array(char, len2 + 1);
-        if ( !cladatum->comkey )
-        {
-            rc = -ENOMEM;
-            goto bad;
-        }
-        rc = next_entry(cladatum->comkey, fp, len2);
-        if ( rc < 0 )
-            goto bad;
-        cladatum->comkey[len2] = 0;
-
-        cladatum->comdatum = hashtab_search(p->p_commons.table,
-                            cladatum->comkey);
-        if ( !cladatum->comdatum )
-        {
-            printk(KERN_ERR "Flask:  unknown common %s\n",
-                   cladatum->comkey);
-            rc = -EINVAL;
-            goto bad;
-        }
+        printk(KERN_ERR "Flask:  classes with common prefixes are not supported\n");
+        rc = -EINVAL;
+        goto bad;
     }
     for ( i = 0; i < nel; i++ )
     {
diff -r c2578dd96b83 -r 6804e9092670 xen/xsm/flask/ss/services.c
--- a/xen/xsm/flask/ss/services.c	Mon Sep 17 21:06:02 2012 +0100
+++ b/xen/xsm/flask/ss/services.c	Mon Sep 17 21:10:07 2012 +0100
@@ -1167,10 +1167,10 @@ int security_change_sid(u32 ssid, u32 ts
  */
 static int validate_classes(struct policydb *p)
 {
-    int i, j;
+    int i;
     struct class_datum *cladatum;
     struct perm_datum *perdatum;
-    u32 nprim, tmp, common_pts_len, perm_val, pol_val;
+    u32 nprim, perm_val, pol_val;
     u16 class_val;
     const struct selinux_class_perm *kdefs = &selinux_class_perm;
     const char *def_class, *def_perm, *pol_class;
@@ -1233,56 +1233,6 @@ static int validate_classes(struct polic
             return -EINVAL;
         }
     }
-    for ( i = 0; i < kdefs->av_inherit_len; i++ )
-    {
-        class_val = kdefs->av_inherit[i].tclass;
-        if ( class_val > p->p_classes.nprim )
-            continue;
-        pol_class = p->p_class_val_to_name[class_val-1];
-        cladatum = hashtab_search(p->p_classes.table, pol_class);
-        BUG_ON( !cladatum );
-        if ( !cladatum->comdatum )
-        {
-            printk(KERN_ERR
-            "Flask:  class %s should have an inherits clause but does not\n",
-                   pol_class);
-            return -EINVAL;
-        }
-        tmp = kdefs->av_inherit[i].common_base;
-        common_pts_len = 0;
-        while ( !(tmp & 0x01) )
-        {
-            common_pts_len++;
-            tmp >>= 1;
-        }
-        perms = &cladatum->comdatum->permissions;
-        for ( j = 0; j < common_pts_len; j++ )
-        {
-            def_perm = kdefs->av_inherit[i].common_pts[j];
-            if ( j >= perms->nprim )
-            {
-                printk(KERN_INFO
-                "Flask:  permission %s in class %s not defined in policy\n",
-                       def_perm, pol_class);
-                return -EINVAL;
-            }
-            perdatum = hashtab_search(perms->table, def_perm);
-            if ( perdatum == NULL )
-            {
-                printk(KERN_ERR
-                       "Flask:  permission %s in class %s not found in policy\n",
-                       def_perm, pol_class);
-                return -EINVAL;
-            }
-            if ( perdatum->value != j + 1 )
-            {
-                printk(KERN_ERR
-                      "Flask:  permission %s in class %s has incorrect value\n",
-                       def_perm, pol_class);
-                return -EINVAL;
-            }
-        }
-    }
     return 0;
 }
 

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

From xen-changelog-bounces@lists.xen.org Tue Sep 18 08:22:32 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Sep 2012 08:22:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TDt4g-0007ua-LD; Tue, 18 Sep 2012 08:22:30 +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 1TDt4f-0007sI-7k
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1347956531!11438283!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23300 invoked from network); 18 Sep 2012 08:22:13 -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;
	18 Sep 2012 08:22: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 1TDt4N-0004Ji-6d
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDt4N-0000hO-5N
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:11 +0000
Message-Id: <E1TDt4N-0000hO-5N@xenbits.xen.org>
Date: Tue, 18 Sep 2012 08:22:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xsm/flask: remove inherited class
	attributes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Daniel De Graaf <dgdegra@tycho.nsa.gov>
# Date 1347912607 -3600
# Node ID 6804e90926708152edecbf15e9b6689fbc402b52
# Parent  c2578dd96b8318e108fff0f340411135dedaa47d
xsm/flask: remove inherited class attributes

The ability to declare common permission blocks shared across multiple
classes is not currently used in Xen. Currently, support for this
feature is broken in the header generation scripts, and it is not
expected that this feature will be used in the future, so remove the
dead code.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r c2578dd96b83 -r 6804e9092670 tools/flask/policy/policy/flask/Makefile
--- a/tools/flask/policy/policy/flask/Makefile	Mon Sep 17 21:06:02 2012 +0100
+++ b/tools/flask/policy/policy/flask/Makefile	Mon Sep 17 21:10:07 2012 +0100
@@ -14,7 +14,7 @@ FLASK_H_DEPEND = security_classes initia
 AV_H_DEPEND = access_vectors
 
 FLASK_H_FILES = class_to_string.h flask.h initial_sid_to_string.h
-AV_H_FILES = av_inherit.h common_perm_to_string.h av_perm_to_string.h av_permissions.h
+AV_H_FILES = av_perm_to_string.h av_permissions.h
 ALL_H_FILES = $(FLASK_H_FILES) $(AV_H_FILES)
 
 all:  $(ALL_H_FILES)
diff -r c2578dd96b83 -r 6804e9092670 tools/flask/policy/policy/flask/access_vectors
--- a/tools/flask/policy/policy/flask/access_vectors	Mon Sep 17 21:06:02 2012 +0100
+++ b/tools/flask/policy/policy/flask/access_vectors	Mon Sep 17 21:10:07 2012 +0100
@@ -1,22 +1,7 @@
-#
-# Define common prefixes for access vectors
-#
-# common common_name { permission_name ... }
-
-#
-# Define a common prefix for file access vectors.
-#
-
-
 #
 # Define the access vectors.
 #
-# class class_name [ inherits common_name ] { permission_name ... }
-
-
-#
-# Define the access vector interpretation for file-related objects.
-#
+# class class_name { permission_name ... }
 
 class xen
 {
diff -r c2578dd96b83 -r 6804e9092670 tools/flask/policy/policy/flask/mkaccess_vector.sh
--- a/tools/flask/policy/policy/flask/mkaccess_vector.sh	Mon Sep 17 21:06:02 2012 +0100
+++ b/tools/flask/policy/policy/flask/mkaccess_vector.sh	Mon Sep 17 21:10:07 2012 +0100
@@ -10,50 +10,21 @@ shift
 
 # output files
 av_permissions="av_permissions.h"
-av_inherit="av_inherit.h"
-common_perm_to_string="common_perm_to_string.h"
 av_perm_to_string="av_perm_to_string.h"
 
 cat $* | $awk "
 BEGIN	{
 		outfile = \"$av_permissions\"
-		inheritfile = \"$av_inherit\"
-		cpermfile = \"$common_perm_to_string\"
 		avpermfile = \"$av_perm_to_string\"
 		"'
 		nextstate = "COMMON_OR_AV";
 		printf("/* This file is automatically generated.  Do not edit. */\n") > outfile;
-		printf("/* This file is automatically generated.  Do not edit. */\n") > inheritfile;
-		printf("/* This file is automatically generated.  Do not edit. */\n") > cpermfile;
 		printf("/* This file is automatically generated.  Do not edit. */\n") > avpermfile;
 ;
 	}
 /^[ \t]*#/	{ 
 			next;
 		}
-$1 == "common"	{ 
-			if (nextstate != "COMMON_OR_AV")
-			{
-				printf("Parse error:  Unexpected COMMON definition on line %d\n", NR);
-				next;	
-			}
-
-			if ($2 in common_defined)
-			{
-				printf("Duplicate COMMON definition for %s on line %d.\n", $2, NR);
-				next;
-			}	
-			common_defined[$2] = 1;
-
-			tclass = $2;
-			common_name = $2; 
-			permission = 1;
-
-			printf("TB_(common_%s_perm_to_string)\n", $2) > cpermfile;
-
-			nextstate = "COMMON-OPENBRACKET";
-			next;
-		}
 $1 == "class"	{
 			if (nextstate != "COMMON_OR_AV" &&
 			    nextstate != "CLASS_OR_CLASS-OPENBRACKET")
@@ -71,62 +42,11 @@ BEGIN	{
 			} 
 			av_defined[tclass] = 1;
 
-			inherits = "";
 			permission = 1;
 
 			nextstate = "INHERITS_OR_CLASS-OPENBRACKET";
 			next;
 		}
-$1 == "inherits" {			
-			if (nextstate != "INHERITS_OR_CLASS-OPENBRACKET")
-			{
-				printf("Parse error:  Unexpected INHERITS definition on line %d\n", NR);
-				next;	
-			}
-
-			if (!($2 in common_defined))
-			{
-				printf("COMMON %s is not defined (line %d).\n", $2, NR);
-				next;
-			}
-
-			inherits = $2;
-			permission = common_base[$2];
-
-			for (combined in common_perms)
-			{
-				split(combined,separate, SUBSEP);
-				if (separate[1] == inherits)
-				{
-					inherited_perms[common_perms[combined]] = separate[2];
-				}
-			}
-
-                        j = 1;
-                        for (i in inherited_perms) {
-                            ind[j] = i + 0;
-                            j++;
-                        }
-                        n = asort(ind);
-			for (i = 1; i <= n; i++) {
-				perm = inherited_perms[ind[i]];
-				printf("#define %s__%s", toupper(tclass), toupper(perm)) > outfile; 
-				spaces = 40 - (length(perm) + length(tclass));
-				if (spaces < 1)
-				      spaces = 1;
-				for (j = 0; j < spaces; j++) 
-					printf(" ") > outfile; 
-				printf("0x%08xUL\n", ind[i]) > outfile; 
-			}
-			printf("\n") > outfile;
-                        for (i in ind) delete ind[i];
-                        for (i in inherited_perms) delete inherited_perms[i];
-
-			printf("   S_(SECCLASS_%s, %s, 0x%08xUL)\n", toupper(tclass), inherits, permission) > inheritfile; 
-
-			nextstate = "CLASS_OR_CLASS-OPENBRACKET";
-			next;
-		}
 $1 == "{"	{ 
 			if (nextstate != "INHERITS_OR_CLASS-OPENBRACKET" &&
 			    nextstate != "CLASS_OR_CLASS-OPENBRACKET" &&
@@ -177,15 +97,6 @@ BEGIN	{
 
 				av_perms[tclass,$1] = permission;
 		
-				if (inherits != "")
-				{
-					if ((inherits,$1) in common_perms)
-					{
-						printf("Permission %s in %s on line %d conflicts with common permission.\n", $1, tclass, inherits, NR);
-						next;
-					}
-				}
-
 				printf("#define %s__%s", toupper(tclass), toupper($1)) > outfile; 
 
 				printf("   S_(SECCLASS_%s, %s__%s, \"%s\")\n", toupper(tclass), toupper(tclass), toupper($1), $1) > avpermfile; 
diff -r c2578dd96b83 -r 6804e9092670 xen/xsm/flask/avc.c
--- a/xen/xsm/flask/avc.c	Mon Sep 17 21:06:02 2012 +0100
+++ b/xen/xsm/flask/avc.c	Mon Sep 17 21:10:07 2012 +0100
@@ -45,28 +45,11 @@ static const char *class_to_string[] = {
 #undef S_
 };
 
-#define TB_(s) static const char * s [] = {
-#define TE_(s) };
-#define S_(s) s,
-#include "common_perm_to_string.h"
-#undef TB_
-#undef TE_
-#undef S_
-
-static const struct av_inherit av_inherit[] = {
-#define S_(c, i, b) { .tclass = c, .common_pts = common_##i##_perm_to_string, \
-                      .common_base = b },
-#include "av_inherit.h"
-#undef S_
-};
-
 const struct selinux_class_perm selinux_class_perm = {
     .av_perm_to_string = av_perm_to_string,
     .av_pts_len = ARRAY_SIZE(av_perm_to_string),
     .class_to_string = class_to_string,
     .cts_len = ARRAY_SIZE(class_to_string),
-    .av_inherit = av_inherit,
-    .av_inherit_len = ARRAY_SIZE(av_inherit)
 };
 
 #define AVC_CACHE_SLOTS            512
@@ -181,8 +164,6 @@ static void avc_printk(struct avc_dump_b
  */
 static void avc_dump_av(struct avc_dump_buf *buf, u16 tclass, u32 av)
 {
-    const char **common_pts = NULL;
-    u32 common_base = 0;
     int i, i2, perm;
 
     if ( av == 0 )
@@ -191,29 +172,9 @@ static void avc_dump_av(struct avc_dump_
         return;
     }
 
-    for ( i = 0; i < ARRAY_SIZE(av_inherit); i++ )
-    {
-        if (av_inherit[i].tclass == tclass)
-        {
-            common_pts = av_inherit[i].common_pts;
-            common_base = av_inherit[i].common_base;
-            break;
-        }
-    }
-
     avc_printk(buf, " {");
     i = 0;
     perm = 1;
-    while ( perm < common_base )
-    {
-        if (perm & av)
-        {
-            avc_printk(buf, " %s", common_pts[i]);
-            av &= ~perm;
-        }
-        i++;
-        perm <<= 1;
-    }
 
     while ( i < sizeof(av) * 8 )
     {
diff -r c2578dd96b83 -r 6804e9092670 xen/xsm/flask/include/av_inherit.h
--- a/xen/xsm/flask/include/av_inherit.h	Mon Sep 17 21:06:02 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-/* This file is automatically generated.  Do not edit. */
diff -r c2578dd96b83 -r 6804e9092670 xen/xsm/flask/include/avc_ss.h
--- a/xen/xsm/flask/include/avc_ss.h	Mon Sep 17 21:06:02 2012 +0100
+++ b/xen/xsm/flask/include/avc_ss.h	Mon Sep 17 21:10:07 2012 +0100
@@ -16,19 +16,11 @@ struct av_perm_to_string {
     const char *name;
 };
 
-struct av_inherit {
-    const char **common_pts;
-    u32 common_base;
-    u16 tclass;
-};
-
 struct selinux_class_perm {
     const struct av_perm_to_string *av_perm_to_string;
     u32 av_pts_len;
     u32 cts_len;
     const char **class_to_string;
-    const struct av_inherit *av_inherit;
-    u32 av_inherit_len;
 };
 
 extern const struct selinux_class_perm selinux_class_perm;
diff -r c2578dd96b83 -r 6804e9092670 xen/xsm/flask/include/common_perm_to_string.h
--- a/xen/xsm/flask/include/common_perm_to_string.h	Mon Sep 17 21:06:02 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-/* This file is automatically generated.  Do not edit. */
diff -r c2578dd96b83 -r 6804e9092670 xen/xsm/flask/ss/policydb.c
--- a/xen/xsm/flask/ss/policydb.c	Mon Sep 17 21:06:02 2012 +0100
+++ b/xen/xsm/flask/ss/policydb.c	Mon Sep 17 21:10:07 2012 +0100
@@ -254,14 +254,6 @@ out_free_symtab:
 
 static int common_index(void *key, void *datum, void *datap)
 {
-    struct policydb *p;
-    struct common_datum *comdatum;
-
-    comdatum = datum;
-    p = datap;
-    if ( !comdatum->value || comdatum->value > p->p_commons.nprim )
-        return -EINVAL;
-    p->p_common_val_to_name[comdatum->value - 1] = key;
     return 0;
 }
 
@@ -382,8 +374,7 @@ static int (*index_f[SYM_NUM]) (void *ke
 };
 
 /*
- * Define the common val_to_name array and the class
- * val_to_name and val_to_struct arrays in a policy
+ * Define the class val_to_name and val_to_struct arrays in a policy
  * database structure.
  *
  * Caller must clean up upon failure.
@@ -392,18 +383,6 @@ static int policydb_index_classes(struct
 {
     int rc;
 
-    p->p_common_val_to_name =
-        xmalloc_array(char *, p->p_commons.nprim);
-    if ( !p->p_common_val_to_name )
-    {
-        rc = -ENOMEM;
-        goto out;
-    }
-
-    rc = hashtab_map(p->p_commons.table, common_index, p);
-    if ( rc )
-        goto out;
-
     p->class_val_to_struct =
         xmalloc_array(struct class_datum *, p->p_classes.nprim);
     if ( !p->class_val_to_struct )
@@ -1200,26 +1179,9 @@ static int class_read(struct policydb *p
 
     if ( len2 )
     {
-        cladatum->comkey = xmalloc_array(char, len2 + 1);
-        if ( !cladatum->comkey )
-        {
-            rc = -ENOMEM;
-            goto bad;
-        }
-        rc = next_entry(cladatum->comkey, fp, len2);
-        if ( rc < 0 )
-            goto bad;
-        cladatum->comkey[len2] = 0;
-
-        cladatum->comdatum = hashtab_search(p->p_commons.table,
-                            cladatum->comkey);
-        if ( !cladatum->comdatum )
-        {
-            printk(KERN_ERR "Flask:  unknown common %s\n",
-                   cladatum->comkey);
-            rc = -EINVAL;
-            goto bad;
-        }
+        printk(KERN_ERR "Flask:  classes with common prefixes are not supported\n");
+        rc = -EINVAL;
+        goto bad;
     }
     for ( i = 0; i < nel; i++ )
     {
diff -r c2578dd96b83 -r 6804e9092670 xen/xsm/flask/ss/services.c
--- a/xen/xsm/flask/ss/services.c	Mon Sep 17 21:06:02 2012 +0100
+++ b/xen/xsm/flask/ss/services.c	Mon Sep 17 21:10:07 2012 +0100
@@ -1167,10 +1167,10 @@ int security_change_sid(u32 ssid, u32 ts
  */
 static int validate_classes(struct policydb *p)
 {
-    int i, j;
+    int i;
     struct class_datum *cladatum;
     struct perm_datum *perdatum;
-    u32 nprim, tmp, common_pts_len, perm_val, pol_val;
+    u32 nprim, perm_val, pol_val;
     u16 class_val;
     const struct selinux_class_perm *kdefs = &selinux_class_perm;
     const char *def_class, *def_perm, *pol_class;
@@ -1233,56 +1233,6 @@ static int validate_classes(struct polic
             return -EINVAL;
         }
     }
-    for ( i = 0; i < kdefs->av_inherit_len; i++ )
-    {
-        class_val = kdefs->av_inherit[i].tclass;
-        if ( class_val > p->p_classes.nprim )
-            continue;
-        pol_class = p->p_class_val_to_name[class_val-1];
-        cladatum = hashtab_search(p->p_classes.table, pol_class);
-        BUG_ON( !cladatum );
-        if ( !cladatum->comdatum )
-        {
-            printk(KERN_ERR
-            "Flask:  class %s should have an inherits clause but does not\n",
-                   pol_class);
-            return -EINVAL;
-        }
-        tmp = kdefs->av_inherit[i].common_base;
-        common_pts_len = 0;
-        while ( !(tmp & 0x01) )
-        {
-            common_pts_len++;
-            tmp >>= 1;
-        }
-        perms = &cladatum->comdatum->permissions;
-        for ( j = 0; j < common_pts_len; j++ )
-        {
-            def_perm = kdefs->av_inherit[i].common_pts[j];
-            if ( j >= perms->nprim )
-            {
-                printk(KERN_INFO
-                "Flask:  permission %s in class %s not defined in policy\n",
-                       def_perm, pol_class);
-                return -EINVAL;
-            }
-            perdatum = hashtab_search(perms->table, def_perm);
-            if ( perdatum == NULL )
-            {
-                printk(KERN_ERR
-                       "Flask:  permission %s in class %s not found in policy\n",
-                       def_perm, pol_class);
-                return -EINVAL;
-            }
-            if ( perdatum->value != j + 1 )
-            {
-                printk(KERN_ERR
-                      "Flask:  permission %s in class %s has incorrect value\n",
-                       def_perm, pol_class);
-                return -EINVAL;
-            }
-        }
-    }
     return 0;
 }
 

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

From xen-changelog-bounces@lists.xen.org Tue Sep 18 08:23:01 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Sep 2012 08:23:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TDt5A-00083G-Ss; Tue, 18 Sep 2012 08:23:00 +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 1TDt5A-00081y-8g
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:23:00 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-27.messagelabs.com!1347956528!6249194!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2180 invoked from network); 18 Sep 2012 08:22:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Sep 2012 08:22: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 1TDt4K-0004JT-JS
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDt4K-0000gA-BU
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:08 +0000
Message-Id: <E1TDt4K-0000gA-BU@xenbits.xen.org>
Date: Tue, 18 Sep 2012 08:22:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] mem_event: fix regression affecting
	CR3, CR4 memory events
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Steven Maresca <steve@zentific.com>
# Date 1347900912 -3600
# Node ID 7ab899e4634729e959f3c7f7a21551abba778565
# Parent  5ba70e030b47b37c638054d4f22889f9a6c39b8e
mem_event: fix regression affecting CR3, CR4 memory events

This is a patch repairing a regression in code previously functional
in 4.1.x. It appears that, during some refactoring work, calls to
hvm_memory_event_cr3 and hvm_memory_event_cr4 were lost.

These functions were originally called in mov_to_cr() of vmx.c, but
the commit  http://xenbits.xen.org/hg/xen-unstable.hg/rev/1276926e3795
abstracted the original code into generic functions up a level in
hvm.c, dropping these calls in the process.

Signed-off-by: Steven Maresca <steve@zentific.com>
Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 5ba70e030b47 -r 7ab899e46347 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Mon Sep 17 17:51:57 2012 +0100
+++ b/xen/arch/x86/hvm/hvm.c	Mon Sep 17 17:55:12 2012 +0100
@@ -1742,6 +1742,7 @@ int hvm_set_cr3(unsigned long value)
 {
     struct vcpu *v = current;
     struct page_info *page;
+    unsigned long old;
 
     if ( hvm_paging_enabled(v) && !paging_mode_hap(v->domain) &&
          (value != v->arch.hvm_vcpu.guest_cr[3]) )
@@ -1759,8 +1760,10 @@ int hvm_set_cr3(unsigned long value)
         HVM_DBG_LOG(DBG_LEVEL_VMMU, "Update CR3 value = %lx", value);
     }
 
+    old=v->arch.hvm_vcpu.guest_cr[3];
     v->arch.hvm_vcpu.guest_cr[3] = value;
     paging_update_cr3(v);
+    hvm_memory_event_cr3(value, old);
     return X86EMUL_OKAY;
 
  bad_cr3:
@@ -1802,6 +1805,7 @@ int hvm_set_cr4(unsigned long value)
 
     v->arch.hvm_vcpu.guest_cr[4] = value;
     hvm_update_guest_cr(v, 4);
+    hvm_memory_event_cr4(value, old_cr);
 
     /*
      * Modifying CR4.{PSE,PAE,PGE,SMEP}, or clearing CR4.PCIDE

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

From xen-changelog-bounces@lists.xen.org Tue Sep 18 08:23:01 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Sep 2012 08:23:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TDt5A-00083G-Ss; Tue, 18 Sep 2012 08:23:00 +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 1TDt5A-00081y-8g
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:23:00 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-27.messagelabs.com!1347956528!6249194!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2180 invoked from network); 18 Sep 2012 08:22:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Sep 2012 08:22: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 1TDt4K-0004JT-JS
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TDt4K-0000gA-BU
	for xen-changelog@lists.xensource.com; Tue, 18 Sep 2012 08:22:08 +0000
Message-Id: <E1TDt4K-0000gA-BU@xenbits.xen.org>
Date: Tue, 18 Sep 2012 08:22:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] mem_event: fix regression affecting
	CR3, CR4 memory events
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Steven Maresca <steve@zentific.com>
# Date 1347900912 -3600
# Node ID 7ab899e4634729e959f3c7f7a21551abba778565
# Parent  5ba70e030b47b37c638054d4f22889f9a6c39b8e
mem_event: fix regression affecting CR3, CR4 memory events

This is a patch repairing a regression in code previously functional
in 4.1.x. It appears that, during some refactoring work, calls to
hvm_memory_event_cr3 and hvm_memory_event_cr4 were lost.

These functions were originally called in mov_to_cr() of vmx.c, but
the commit  http://xenbits.xen.org/hg/xen-unstable.hg/rev/1276926e3795
abstracted the original code into generic functions up a level in
hvm.c, dropping these calls in the process.

Signed-off-by: Steven Maresca <steve@zentific.com>
Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 5ba70e030b47 -r 7ab899e46347 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Mon Sep 17 17:51:57 2012 +0100
+++ b/xen/arch/x86/hvm/hvm.c	Mon Sep 17 17:55:12 2012 +0100
@@ -1742,6 +1742,7 @@ int hvm_set_cr3(unsigned long value)
 {
     struct vcpu *v = current;
     struct page_info *page;
+    unsigned long old;
 
     if ( hvm_paging_enabled(v) && !paging_mode_hap(v->domain) &&
          (value != v->arch.hvm_vcpu.guest_cr[3]) )
@@ -1759,8 +1760,10 @@ int hvm_set_cr3(unsigned long value)
         HVM_DBG_LOG(DBG_LEVEL_VMMU, "Update CR3 value = %lx", value);
     }
 
+    old=v->arch.hvm_vcpu.guest_cr[3];
     v->arch.hvm_vcpu.guest_cr[3] = value;
     paging_update_cr3(v);
+    hvm_memory_event_cr3(value, old);
     return X86EMUL_OKAY;
 
  bad_cr3:
@@ -1802,6 +1805,7 @@ int hvm_set_cr4(unsigned long value)
 
     v->arch.hvm_vcpu.guest_cr[4] = value;
     hvm_update_guest_cr(v, 4);
+    hvm_memory_event_cr4(value, old_cr);
 
     /*
      * Modifying CR4.{PSE,PAE,PGE,SMEP}, or clearing CR4.PCIDE

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

From xen-changelog-bounces@lists.xen.org Wed Sep 19 16:22:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Sep 2012 16:22:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TEN2U-0002bn-0v; Wed, 19 Sep 2012 16:22: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 1TEN2T-0002bT-2J
	for xen-changelog@lists.xensource.com; Wed, 19 Sep 2012 16:22:13 +0000
Received: from [85.158.137.99:38206] by server-8.bemta-3.messagelabs.com id
	78/CA-24700-431F9505; Wed, 19 Sep 2012 16:22:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-217.messagelabs.com!1348071730!13597921!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26623 invoked from network); 19 Sep 2012 16:22:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Sep 2012 16: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 1TEN2Q-0003o7-7C
	for xen-changelog@lists.xensource.com; Wed, 19 Sep 2012 16:22:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEN2P-0000AF-U2
	for xen-changelog@lists.xensource.com; Wed, 19 Sep 2012 16:22:09 +0000
Message-Id: <E1TEN2P-0000AF-U2@xenbits.xen.org>
Date: Wed, 19 Sep 2012 16:22:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: properly check
	XEN_DOMCTL_ioport_mapping arguments for invalid range
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348039675 -7200
# Node ID 3e3959413b2fbef584993beb434285d0691d5c67
# Parent  4a0438fe1e6afe01e46023bcb2c828c5aaeefb1d
x86: properly check XEN_DOMCTL_ioport_mapping arguments for invalid range

In particular, the case of "np" being a very large value wasn't handled
correctly. The range start checks also were off by one (except that in
practice, when "np" is properly range checked, this would still have
been caught by the range end checks).

Also, is a GFN wrap in XEN_DOMCTL_memory_mapping really okay?

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


diff -r 4a0438fe1e6a -r 3e3959413b2f xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Wed Sep 19 09:26:26 2012 +0200
+++ b/xen/arch/x86/domctl.c	Wed Sep 19 09:27:55 2012 +0200
@@ -884,7 +884,7 @@ long arch_do_domctl(
         int found = 0;
 
         ret = -EINVAL;
-        if ( (np == 0) || (fgp > MAX_IOPORTS) || (fmp > MAX_IOPORTS) ||
+        if ( ((fgp | fmp | (np - 1)) >= MAX_IOPORTS) ||
             ((fgp + np) > MAX_IOPORTS) || ((fmp + np) > MAX_IOPORTS) )
         {
             printk(XENLOG_G_ERR

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

From xen-changelog-bounces@lists.xen.org Wed Sep 19 16:22:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Sep 2012 16:22:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TEN2U-0002bn-0v; Wed, 19 Sep 2012 16:22: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 1TEN2T-0002bT-2J
	for xen-changelog@lists.xensource.com; Wed, 19 Sep 2012 16:22:13 +0000
Received: from [85.158.137.99:38206] by server-8.bemta-3.messagelabs.com id
	78/CA-24700-431F9505; Wed, 19 Sep 2012 16:22:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-217.messagelabs.com!1348071730!13597921!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26623 invoked from network); 19 Sep 2012 16:22:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Sep 2012 16: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 1TEN2Q-0003o7-7C
	for xen-changelog@lists.xensource.com; Wed, 19 Sep 2012 16:22:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEN2P-0000AF-U2
	for xen-changelog@lists.xensource.com; Wed, 19 Sep 2012 16:22:09 +0000
Message-Id: <E1TEN2P-0000AF-U2@xenbits.xen.org>
Date: Wed, 19 Sep 2012 16:22:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: properly check
	XEN_DOMCTL_ioport_mapping arguments for invalid range
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348039675 -7200
# Node ID 3e3959413b2fbef584993beb434285d0691d5c67
# Parent  4a0438fe1e6afe01e46023bcb2c828c5aaeefb1d
x86: properly check XEN_DOMCTL_ioport_mapping arguments for invalid range

In particular, the case of "np" being a very large value wasn't handled
correctly. The range start checks also were off by one (except that in
practice, when "np" is properly range checked, this would still have
been caught by the range end checks).

Also, is a GFN wrap in XEN_DOMCTL_memory_mapping really okay?

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


diff -r 4a0438fe1e6a -r 3e3959413b2f xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Wed Sep 19 09:26:26 2012 +0200
+++ b/xen/arch/x86/domctl.c	Wed Sep 19 09:27:55 2012 +0200
@@ -884,7 +884,7 @@ long arch_do_domctl(
         int found = 0;
 
         ret = -EINVAL;
-        if ( (np == 0) || (fgp > MAX_IOPORTS) || (fmp > MAX_IOPORTS) ||
+        if ( ((fgp | fmp | (np - 1)) >= MAX_IOPORTS) ||
             ((fgp + np) > MAX_IOPORTS) || ((fmp + np) > MAX_IOPORTS) )
         {
             printk(XENLOG_G_ERR

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

From xen-changelog-bounces@lists.xen.org Wed Sep 19 16:22:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Sep 2012 16:22:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TEN2S-0002bZ-UZ; Wed, 19 Sep 2012 16:22:12 +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 1TEN2S-0002bO-3i
	for xen-changelog@lists.xensource.com; Wed, 19 Sep 2012 16:22:12 +0000
Received: from [85.158.138.51:42243] by server-7.bemta-3.messagelabs.com id
	C1/2B-32000-331F9505; Wed, 19 Sep 2012 16:22:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-174.messagelabs.com!1348071729!22331831!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11032 invoked from network); 19 Sep 2012 16:22:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Sep 2012 16: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 1TEN2P-0003o4-Gv
	for xen-changelog@lists.xensource.com; Wed, 19 Sep 2012 16:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEN2P-00009y-A0
	for xen-changelog@lists.xensource.com; Wed, 19 Sep 2012 16:22:09 +0000
Message-Id: <E1TEN2P-00009y-A0@xenbits.xen.org>
Date: Wed, 19 Sep 2012 16:22:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/ACPI: fix error indication from
	acpi_parse_madt_lapic_entries()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348039586 -7200
# Node ID 4a0438fe1e6afe01e46023bcb2c828c5aaeefb1d
# Parent  d1c3375c3f118de2465e4b4ec5e8950aafe5a903
x86/ACPI: fix error indication from acpi_parse_madt_lapic_entries()

If the legacy APIC invocation of acpi_table_parse_madt() succeeds but
the x2APIC counterpart fails, this is regarded as failure by the
function, yet its return value would indicate success.

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


diff -r d1c3375c3f11 -r 4a0438fe1e6a xen/arch/x86/acpi/boot.c
--- a/xen/arch/x86/acpi/boot.c	Mon Sep 17 21:12:21 2012 +0100
+++ b/xen/arch/x86/acpi/boot.c	Wed Sep 19 09:26:26 2012 +0200
@@ -452,7 +452,7 @@ static int __init acpi_parse_madt_lapic_
 	} else if (count < 0 || x2count < 0) {
 		printk(KERN_ERR PREFIX "Error parsing LAPIC entry\n");
 		/* TBD: Cleanup to allow fallback to MPS */
-		return count;
+		return count < 0 ? count : x2count;
 	}
 
 	count =
@@ -464,7 +464,7 @@ static int __init acpi_parse_madt_lapic_
 	if (count < 0 || x2count < 0) {
 		printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n");
 		/* TBD: Cleanup to allow fallback to MPS */
-		return count;
+		return count < 0 ? count : x2count;
 	}
 	return 0;
 }

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

From xen-changelog-bounces@lists.xen.org Wed Sep 19 16:22:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Sep 2012 16:22:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TEN2S-0002bZ-UZ; Wed, 19 Sep 2012 16:22:12 +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 1TEN2S-0002bO-3i
	for xen-changelog@lists.xensource.com; Wed, 19 Sep 2012 16:22:12 +0000
Received: from [85.158.138.51:42243] by server-7.bemta-3.messagelabs.com id
	C1/2B-32000-331F9505; Wed, 19 Sep 2012 16:22:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-174.messagelabs.com!1348071729!22331831!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11032 invoked from network); 19 Sep 2012 16:22:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Sep 2012 16: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 1TEN2P-0003o4-Gv
	for xen-changelog@lists.xensource.com; Wed, 19 Sep 2012 16:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEN2P-00009y-A0
	for xen-changelog@lists.xensource.com; Wed, 19 Sep 2012 16:22:09 +0000
Message-Id: <E1TEN2P-00009y-A0@xenbits.xen.org>
Date: Wed, 19 Sep 2012 16:22:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/ACPI: fix error indication from
	acpi_parse_madt_lapic_entries()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348039586 -7200
# Node ID 4a0438fe1e6afe01e46023bcb2c828c5aaeefb1d
# Parent  d1c3375c3f118de2465e4b4ec5e8950aafe5a903
x86/ACPI: fix error indication from acpi_parse_madt_lapic_entries()

If the legacy APIC invocation of acpi_table_parse_madt() succeeds but
the x2APIC counterpart fails, this is regarded as failure by the
function, yet its return value would indicate success.

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


diff -r d1c3375c3f11 -r 4a0438fe1e6a xen/arch/x86/acpi/boot.c
--- a/xen/arch/x86/acpi/boot.c	Mon Sep 17 21:12:21 2012 +0100
+++ b/xen/arch/x86/acpi/boot.c	Wed Sep 19 09:26:26 2012 +0200
@@ -452,7 +452,7 @@ static int __init acpi_parse_madt_lapic_
 	} else if (count < 0 || x2count < 0) {
 		printk(KERN_ERR PREFIX "Error parsing LAPIC entry\n");
 		/* TBD: Cleanup to allow fallback to MPS */
-		return count;
+		return count < 0 ? count : x2count;
 	}
 
 	count =
@@ -464,7 +464,7 @@ static int __init acpi_parse_madt_lapic_
 	if (count < 0 || x2count < 0) {
 		printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n");
 		/* TBD: Cleanup to allow fallback to MPS */
-		return count;
+		return count < 0 ? count : x2count;
 	}
 	return 0;
 }

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

From xen-changelog-bounces@lists.xen.org Wed Sep 19 16:22:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Sep 2012 16:22:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TEN2Z-0002cg-43; Wed, 19 Sep 2012 16: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 1TEN2Y-0002bY-6e
	for xen-changelog@lists.xensource.com; Wed, 19 Sep 2012 16:22:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-27.messagelabs.com!1348071730!2333018!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24670 invoked from network); 19 Sep 2012 16:22:11 -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 Sep 2012 16: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 1TEN2Q-0003oA-I6
	for xen-changelog@lists.xensource.com; Wed, 19 Sep 2012 16:22:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEN2Q-0000AU-Gu
	for xen-changelog@lists.xensource.com; Wed, 19 Sep 2012 16:22:10 +0000
Message-Id: <E1TEN2Q-0000AU-Gu@xenbits.xen.org>
Date: Wed, 19 Sep 2012 16:22:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: remove open-coded IO-APIC RTE
	reads/writes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348039850 -7200
# Node ID 7b045d43e59dcb42340097058502bf456e151180
# Parent  3e3959413b2fbef584993beb434285d0691d5c67
x86: remove open-coded IO-APIC RTE reads/writes

This improves readability, not the least through doing away with a
couple of ugly casts.

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


diff -r 3e3959413b2f -r 7b045d43e59d xen/arch/x86/io_apic.c
--- a/xen/arch/x86/io_apic.c	Wed Sep 19 09:27:55 2012 +0200
+++ b/xen/arch/x86/io_apic.c	Wed Sep 19 09:30:50 2012 +0200
@@ -225,9 +225,8 @@ void __ioapic_write_entry(
 {
     void (*write)(unsigned int, unsigned int, unsigned int)
         = raw ? __io_apic_write : io_apic_write;
-    union entry_union eu = {{0, 0}};
+    union entry_union eu = { .entry = e };
 
-    eu.entry = e;
     (*write)(apic, 0x11 + 2*pin, eu.w2);
     (*write)(apic, 0x10 + 2*pin, eu.w1);
 }
@@ -2384,8 +2383,7 @@ int ioapic_guest_write(unsigned long phy
     SET_DEST(rte.dest.dest32, rte.dest.logical.logical_dest,
              cpu_mask_to_apicid(desc->arch.cpu_mask));
 
-    io_apic_write(apic, 0x10 + 2 * pin, *(((int *)&rte) + 0));
-    io_apic_write(apic, 0x11 + 2 * pin, *(((int *)&rte) + 1));
+    __ioapic_write_entry(apic, pin, 0, rte);
     
     spin_unlock_irqrestore(&ioapic_lock, flags);
 
@@ -2414,7 +2412,6 @@ void dump_ioapic_irq_info(void)
     struct irq_pin_list *entry;
     struct IO_APIC_route_entry rte;
     unsigned int irq, pin, printed = 0;
-    unsigned long flags;
 
     if ( !irq_2_pin )
         return;
@@ -2436,10 +2433,7 @@ void dump_ioapic_irq_info(void)
 
             printk("      Apic 0x%02x, Pin %2d: ", entry->apic, pin);
 
-            spin_lock_irqsave(&ioapic_lock, flags);
-            *(((int *)&rte) + 0) = io_apic_read(entry->apic, 0x10 + 2 * pin);
-            *(((int *)&rte) + 1) = io_apic_read(entry->apic, 0x11 + 2 * pin);
-            spin_unlock_irqrestore(&ioapic_lock, flags);
+            rte = ioapic_read_entry(entry->apic, pin, 0);
 
             printk("vec=%02x delivery=%-5s dest=%c status=%d "
                    "polarity=%d irr=%d trig=%c mask=%d dest_id:%d\n",

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

From xen-changelog-bounces@lists.xen.org Wed Sep 19 16:22:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Sep 2012 16:22:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TEN2Z-0002cg-43; Wed, 19 Sep 2012 16: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 1TEN2Y-0002bY-6e
	for xen-changelog@lists.xensource.com; Wed, 19 Sep 2012 16:22:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-27.messagelabs.com!1348071730!2333018!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24670 invoked from network); 19 Sep 2012 16:22:11 -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 Sep 2012 16: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 1TEN2Q-0003oA-I6
	for xen-changelog@lists.xensource.com; Wed, 19 Sep 2012 16:22:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEN2Q-0000AU-Gu
	for xen-changelog@lists.xensource.com; Wed, 19 Sep 2012 16:22:10 +0000
Message-Id: <E1TEN2Q-0000AU-Gu@xenbits.xen.org>
Date: Wed, 19 Sep 2012 16:22:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: remove open-coded IO-APIC RTE
	reads/writes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348039850 -7200
# Node ID 7b045d43e59dcb42340097058502bf456e151180
# Parent  3e3959413b2fbef584993beb434285d0691d5c67
x86: remove open-coded IO-APIC RTE reads/writes

This improves readability, not the least through doing away with a
couple of ugly casts.

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


diff -r 3e3959413b2f -r 7b045d43e59d xen/arch/x86/io_apic.c
--- a/xen/arch/x86/io_apic.c	Wed Sep 19 09:27:55 2012 +0200
+++ b/xen/arch/x86/io_apic.c	Wed Sep 19 09:30:50 2012 +0200
@@ -225,9 +225,8 @@ void __ioapic_write_entry(
 {
     void (*write)(unsigned int, unsigned int, unsigned int)
         = raw ? __io_apic_write : io_apic_write;
-    union entry_union eu = {{0, 0}};
+    union entry_union eu = { .entry = e };
 
-    eu.entry = e;
     (*write)(apic, 0x11 + 2*pin, eu.w2);
     (*write)(apic, 0x10 + 2*pin, eu.w1);
 }
@@ -2384,8 +2383,7 @@ int ioapic_guest_write(unsigned long phy
     SET_DEST(rte.dest.dest32, rte.dest.logical.logical_dest,
              cpu_mask_to_apicid(desc->arch.cpu_mask));
 
-    io_apic_write(apic, 0x10 + 2 * pin, *(((int *)&rte) + 0));
-    io_apic_write(apic, 0x11 + 2 * pin, *(((int *)&rte) + 1));
+    __ioapic_write_entry(apic, pin, 0, rte);
     
     spin_unlock_irqrestore(&ioapic_lock, flags);
 
@@ -2414,7 +2412,6 @@ void dump_ioapic_irq_info(void)
     struct irq_pin_list *entry;
     struct IO_APIC_route_entry rte;
     unsigned int irq, pin, printed = 0;
-    unsigned long flags;
 
     if ( !irq_2_pin )
         return;
@@ -2436,10 +2433,7 @@ void dump_ioapic_irq_info(void)
 
             printk("      Apic 0x%02x, Pin %2d: ", entry->apic, pin);
 
-            spin_lock_irqsave(&ioapic_lock, flags);
-            *(((int *)&rte) + 0) = io_apic_read(entry->apic, 0x10 + 2 * pin);
-            *(((int *)&rte) + 1) = io_apic_read(entry->apic, 0x11 + 2 * pin);
-            spin_unlock_irqrestore(&ioapic_lock, flags);
+            rte = ioapic_read_entry(entry->apic, pin, 0);
 
             printk("vec=%02x delivery=%-5s dest=%c status=%d "
                    "polarity=%d irr=%d trig=%c mask=%d dest_id:%d\n",

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

From xen-changelog-bounces@lists.xen.org Wed Sep 19 23:11:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Sep 2012 23:11:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TETQI-0007Ia-Fv; Wed, 19 Sep 2012 23:11: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 1TETQH-0007IV-1Z
	for xen-changelog@lists.xensource.com; Wed, 19 Sep 2012 23:11:13 +0000
Received: from [85.158.138.51:20342] by server-4.bemta-3.messagelabs.com id
	47/41-24831-0115A505; Wed, 19 Sep 2012 23:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1348096269!31159786!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9004 invoked from network); 19 Sep 2012 23:11:10 -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 Sep 2012 23: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 1TETQD-0008Rm-E3
	for xen-changelog@lists.xensource.com; Wed, 19 Sep 2012 23:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TETQC-00022Z-TH
	for xen-changelog@lists.xensource.com; Wed, 19 Sep 2012 23:11:09 +0000
Message-Id: <E1TETQC-00022Z-TH@xenbits.xen.org>
Date: Wed, 19 Sep 2012 23:11:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tmem: bump pool version to 1 to fix
	restore issue when tmem enabled
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Zhenzhong Duan <zhenzhong.duan@oracle.com>
# Date 1348069127 -7200
# Node ID fee83ac77d8c7339abf5185690603ea5b0c548cf
# Parent  7b045d43e59dcb42340097058502bf456e151180
tmem: bump pool version to 1 to fix restore issue when tmem enabled

Restore fails when tmem is enabled both in hypervisor and guest. This
is due to spec version mismatch when restoring a pool.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 7b045d43e59d -r fee83ac77d8c xen/common/tmem.c
--- a/xen/common/tmem.c	Wed Sep 19 09:30:50 2012 +0200
+++ b/xen/common/tmem.c	Wed Sep 19 17:38:47 2012 +0200
@@ -2397,7 +2397,8 @@ static NOINLINE int tmemc_save_subop(int
              break;
          rc = (pool->persistent ? TMEM_POOL_PERSIST : 0) |
               (pool->shared ? TMEM_POOL_SHARED : 0) |
-              (pool->pageshift << TMEM_POOL_PAGESIZE_SHIFT);
+              (pool->pageshift << TMEM_POOL_PAGESIZE_SHIFT) |
+              (TMEM_SPEC_VERSION << TMEM_POOL_VERSION_SHIFT);
         break;
     case TMEMC_SAVE_GET_POOL_NPAGES:
          if ( pool == NULL )

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

From xen-changelog-bounces@lists.xen.org Wed Sep 19 23:11:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Sep 2012 23:11:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TETQI-0007Ia-Fv; Wed, 19 Sep 2012 23:11: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 1TETQH-0007IV-1Z
	for xen-changelog@lists.xensource.com; Wed, 19 Sep 2012 23:11:13 +0000
Received: from [85.158.138.51:20342] by server-4.bemta-3.messagelabs.com id
	47/41-24831-0115A505; Wed, 19 Sep 2012 23:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1348096269!31159786!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9004 invoked from network); 19 Sep 2012 23:11:10 -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 Sep 2012 23: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 1TETQD-0008Rm-E3
	for xen-changelog@lists.xensource.com; Wed, 19 Sep 2012 23:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TETQC-00022Z-TH
	for xen-changelog@lists.xensource.com; Wed, 19 Sep 2012 23:11:09 +0000
Message-Id: <E1TETQC-00022Z-TH@xenbits.xen.org>
Date: Wed, 19 Sep 2012 23:11:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tmem: bump pool version to 1 to fix
	restore issue when tmem enabled
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Zhenzhong Duan <zhenzhong.duan@oracle.com>
# Date 1348069127 -7200
# Node ID fee83ac77d8c7339abf5185690603ea5b0c548cf
# Parent  7b045d43e59dcb42340097058502bf456e151180
tmem: bump pool version to 1 to fix restore issue when tmem enabled

Restore fails when tmem is enabled both in hypervisor and guest. This
is due to spec version mismatch when restoring a pool.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 7b045d43e59d -r fee83ac77d8c xen/common/tmem.c
--- a/xen/common/tmem.c	Wed Sep 19 09:30:50 2012 +0200
+++ b/xen/common/tmem.c	Wed Sep 19 17:38:47 2012 +0200
@@ -2397,7 +2397,8 @@ static NOINLINE int tmemc_save_subop(int
              break;
          rc = (pool->persistent ? TMEM_POOL_PERSIST : 0) |
               (pool->shared ? TMEM_POOL_SHARED : 0) |
-              (pool->pageshift << TMEM_POOL_PAGESIZE_SHIFT);
+              (pool->pageshift << TMEM_POOL_PAGESIZE_SHIFT) |
+              (TMEM_SPEC_VERSION << TMEM_POOL_VERSION_SHIFT);
         break;
     case TMEMC_SAVE_GET_POOL_NPAGES:
          if ( pool == NULL )

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

From xen-changelog-bounces@lists.xen.org Thu Sep 20 02:11:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Sep 2012 02:11:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TEWEV-0004Tg-5y; Thu, 20 Sep 2012 02:11:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEWET-0004TZ-CD
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 02:11:13 +0000
Received: from [85.158.139.211:40291] by server-10.bemta-5.messagelabs.com id
	85/68-10969-04B7A505; Thu, 20 Sep 2012 02:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-206.messagelabs.com!1348107071!19259796!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23709 invoked from network); 20 Sep 2012 02:11:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Sep 2012 02:11: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 1TEWEQ-0002nX-NS
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 02:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEWEP-0006vV-AV
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 02:11:09 +0000
Message-Id: <E1TEWEP-0006vV-AV@xenbits.xen.org>
Date: Thu, 20 Sep 2012 02:11:08 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Update Xen version to 4.2.1-pre
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich
# Date 1348068206 -7200
# Node ID cab407c45e8771337603dd90e37b47b6da652e59
# Parent  357bd4bb295017b1113c402af97316624707b30c
Update Xen version to 4.2.1-pre
---


diff -r 357bd4bb2950 -r cab407c45e87 xen/Makefile
--- a/xen/Makefile	Mon Sep 17 09:25:24 2012 +0100
+++ b/xen/Makefile	Wed Sep 19 17:23:26 2012 +0200
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 2
-export XEN_EXTRAVERSION ?= .0$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .1-pre$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 

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

From xen-changelog-bounces@lists.xen.org Thu Sep 20 02:11:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Sep 2012 02:11:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TEWEV-0004Tg-5y; Thu, 20 Sep 2012 02:11:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEWET-0004TZ-CD
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 02:11:13 +0000
Received: from [85.158.139.211:40291] by server-10.bemta-5.messagelabs.com id
	85/68-10969-04B7A505; Thu, 20 Sep 2012 02:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-206.messagelabs.com!1348107071!19259796!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23709 invoked from network); 20 Sep 2012 02:11:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Sep 2012 02:11: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 1TEWEQ-0002nX-NS
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 02:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEWEP-0006vV-AV
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 02:11:09 +0000
Message-Id: <E1TEWEP-0006vV-AV@xenbits.xen.org>
Date: Thu, 20 Sep 2012 02:11:08 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Update Xen version to 4.2.1-pre
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich
# Date 1348068206 -7200
# Node ID cab407c45e8771337603dd90e37b47b6da652e59
# Parent  357bd4bb295017b1113c402af97316624707b30c
Update Xen version to 4.2.1-pre
---


diff -r 357bd4bb2950 -r cab407c45e87 xen/Makefile
--- a/xen/Makefile	Mon Sep 17 09:25:24 2012 +0100
+++ b/xen/Makefile	Wed Sep 19 17:23:26 2012 +0200
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 2
-export XEN_EXTRAVERSION ?= .0$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .1-pre$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 

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

From xen-changelog-bounces@lists.xen.org Thu Sep 20 02:11:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Sep 2012 02:11:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TEWEY-0004UF-Bk; Thu, 20 Sep 2012 02:11:18 +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 1TEWEW-0004Tq-Rr
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 02:11:17 +0000
Received: from [85.158.137.99:60287] by server-12.bemta-3.messagelabs.com id
	2D/2E-10384-44B7A505; Thu, 20 Sep 2012 02:11:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-217.messagelabs.com!1348107073!18387177!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26541 invoked from network); 20 Sep 2012 02:11:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Sep 2012 02:11: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 1TEWET-0002nd-O9
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 02:11:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEWET-0006wJ-0y
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 02:11:13 +0000
Message-Id: <E1TEWET-0006wJ-0y@xenbits.xen.org>
Date: Thu, 20 Sep 2012 02:11:12 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] adjust a few RCU domain locking
	calls
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348068392 -7200
# Node ID d26e2d67a8fbe8e7f63ae4bb2278895178a4596d
# Parent  dad9008caa414dcd88935e08d3390ade489bd5c9
adjust a few RCU domain locking calls

x86's do_physdev_op() had a case where the locking was entirely
superfluous. Its physdev_map_pirq() further had a case where the lock
was being obtained too early, needlessly complicating early exit paths.

Grant table code had two open coded instances of
rcu_lock_target_domain_by_id(), and a third code section could be
consolidated by using the newly introduced helper function.

The memory hypercall code had two more instances of open coding
rcu_lock_target_domain_by_id(), but note that here this is not just
cleanup, but also fixes an error return path in memory_exchange() to
actually return an error.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25835:c70d70d85306
xen-unstable date: Fri Sep  7 15:58:12 UTC 2012
---


diff -r dad9008caa41 -r d26e2d67a8fb xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c	Wed Sep 19 17:24:47 2012 +0200
+++ b/xen/arch/x86/physdev.c	Wed Sep 19 17:26:32 2012 +0200
@@ -90,14 +90,10 @@ static int physdev_hvm_map_pirq(
 int physdev_map_pirq(domid_t domid, int type, int *index, int *pirq_p,
                      struct msi_info *msi)
 {
-    struct domain *d;
+    struct domain *d = current->domain;
     int pirq, irq, ret = 0;
     void *map_data = NULL;
 
-    ret = rcu_lock_target_domain_by_id(domid, &d);
-    if ( ret )
-        return ret;
-
     if ( domid == DOMID_SELF && is_hvm_domain(d) )
     {
         /*
@@ -105,14 +101,15 @@ int physdev_map_pirq(domid_t domid, int 
          * 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, type, index, pirq_p);
-        goto free_domain;
+            return -EINVAL;
+
+        return physdev_hvm_map_pirq(d, type, index, pirq_p);
     }
 
+    ret = rcu_lock_target_domain_by_id(domid, &d);
+    if ( ret )
+        return ret;
+
     if ( !IS_PRIV_FOR(current->domain, d) )
     {
         ret = -EPERM;
@@ -696,13 +693,12 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
     }
     case PHYSDEVOP_get_free_pirq: {
         struct physdev_get_free_pirq out;
-        struct domain *d;
+        struct domain *d = v->domain;
 
         ret = -EFAULT;
         if ( copy_from_guest(&out, arg, 1) != 0 )
             break;
 
-        d = rcu_lock_current_domain();
         spin_lock(&d->event_lock);
 
         ret = get_free_pirq(d, out.type);
@@ -717,7 +713,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
         }
 
         spin_unlock(&d->event_lock);
-        rcu_unlock_domain(d);
 
         if ( ret >= 0 )
         {
diff -r dad9008caa41 -r d26e2d67a8fb xen/common/grant_table.c
--- a/xen/common/grant_table.c	Wed Sep 19 17:24:47 2012 +0200
+++ b/xen/common/grant_table.c	Wed Sep 19 17:26:32 2012 +0200
@@ -24,7 +24,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <xen/config.h>
+#include <xen/err.h>
 #include <xen/iocap.h>
 #include <xen/lib.h>
 #include <xen/sched.h>
@@ -195,6 +195,30 @@ double_gt_unlock(struct grant_table *lgt
         spin_unlock(&rgt->lock);
 }
 
+static struct domain *gt_lock_target_domain_by_id(domid_t dom)
+{
+    struct domain *d;
+    int rc = GNTST_general_error;
+
+    switch ( rcu_lock_target_domain_by_id(dom, &d) )
+    {
+    case 0:
+        return d;
+
+    case -ESRCH:
+        gdprintk(XENLOG_INFO, "Bad domid %d.\n", dom);
+        rc = GNTST_bad_domain;
+        break;
+
+    case -EPERM:
+        rc = GNTST_permission_denied;
+        break;
+    }
+
+    ASSERT(rc < 0 && -rc <= MAX_ERRNO);
+    return ERR_PTR(rc);
+}
+
 static inline int
 __get_maptrack_handle(
     struct grant_table *t)
@@ -1261,7 +1285,6 @@ gnttab_setup_table(
     struct grant_table *gt;
     int            i;
     unsigned long  gmfn;
-    domid_t        dom;
 
     if ( count != 1 )
         return -EINVAL;
@@ -1281,25 +1304,11 @@ gnttab_setup_table(
         goto out1;
     }
 
-    dom = op.dom;
-    if ( dom == DOMID_SELF )
+    d = gt_lock_target_domain_by_id(op.dom);
+    if ( IS_ERR(d) )
     {
-        d = rcu_lock_current_domain();
-    }
-    else
-    {
-        if ( unlikely((d = rcu_lock_domain_by_id(dom)) == NULL) )
-        {
-            gdprintk(XENLOG_INFO, "Bad domid %d.\n", dom);
-            op.status = GNTST_bad_domain;
-            goto out1;
-        }
-
-        if ( unlikely(!IS_PRIV_FOR(current->domain, d)) )
-        {
-            op.status = GNTST_permission_denied;
-            goto out2;
-        }
+        op.status = PTR_ERR(d);
+        goto out1;
     }
 
     if ( xsm_grant_setup(current->domain, d) )
@@ -1352,7 +1361,6 @@ gnttab_query_size(
 {
     struct gnttab_query_size op;
     struct domain *d;
-    domid_t        dom;
     int rc;
 
     if ( count != 1 )
@@ -1364,25 +1372,11 @@ gnttab_query_size(
         return -EFAULT;
     }
 
-    dom = op.dom;
-    if ( dom == DOMID_SELF )
+    d = gt_lock_target_domain_by_id(op.dom);
+    if ( IS_ERR(d) )
     {
-        d = rcu_lock_current_domain();
-    }
-    else
-    {
-        if ( unlikely((d = rcu_lock_domain_by_id(dom)) == NULL) )
-        {
-            gdprintk(XENLOG_INFO, "Bad domid %d.\n", dom);
-            op.status = GNTST_bad_domain;
-            goto query_out;
-        }
-
-        if ( unlikely(!IS_PRIV_FOR(current->domain, d)) )
-        {
-            op.status = GNTST_permission_denied;
-            goto query_out_unlock;
-        }
+        op.status = PTR_ERR(d);
+        goto query_out;
     }
 
     rc = xsm_grant_query_size(current->domain, d);
@@ -2251,15 +2245,10 @@ gnttab_get_status_frames(XEN_GUEST_HANDL
         return -EFAULT;
     }
 
-    rc = rcu_lock_target_domain_by_id(op.dom, &d);
-    if ( rc < 0 )
+    d = gt_lock_target_domain_by_id(op.dom);
+    if ( IS_ERR(d) )
     {
-        if ( rc == -ESRCH )
-            op.status = GNTST_bad_domain;
-        else if ( rc == -EPERM )
-            op.status = GNTST_permission_denied;
-        else
-            op.status = GNTST_general_error;
+        op.status = PTR_ERR(d);
         goto out1;
     }
     rc = xsm_grant_setup(current->domain, d);
diff -r dad9008caa41 -r d26e2d67a8fb xen/common/memory.c
--- a/xen/common/memory.c	Wed Sep 19 17:24:47 2012 +0200
+++ b/xen/common/memory.c	Wed Sep 19 17:26:32 2012 +0200
@@ -329,22 +329,9 @@ static long memory_exchange(XEN_GUEST_HA
         out_chunk_order = exch.in.extent_order - exch.out.extent_order;
     }
 
-    if ( likely(exch.in.domid == DOMID_SELF) )
-    {
-        d = rcu_lock_current_domain();
-    }
-    else
-    {
-        if ( (d = rcu_lock_domain_by_id(exch.in.domid)) == NULL )
-            goto fail_early;
-
-        if ( !IS_PRIV_FOR(current->domain, d) )
-        {
-            rcu_unlock_domain(d);
-            rc = -EPERM;
-            goto fail_early;
-        }
-    }
+    rc = rcu_lock_target_domain_by_id(exch.in.domid, &d);
+    if ( rc )
+        goto fail_early;
 
     memflags |= MEMF_bits(domain_clamp_alloc_bitsize(
         d,
@@ -583,20 +570,8 @@ long do_memory_op(unsigned long cmd, XEN
              && (reservation.mem_flags & XENMEMF_populate_on_demand) )
             args.memflags |= MEMF_populate_on_demand;
 
-        if ( likely(reservation.domid == DOMID_SELF) )
-        {
-            d = rcu_lock_current_domain();
-        }
-        else
-        {
-            if ( (d = rcu_lock_domain_by_id(reservation.domid)) == NULL )
-                return start_extent;
-            if ( !IS_PRIV_FOR(current->domain, d) )
-            {
-                rcu_unlock_domain(d);
-                return start_extent;
-            }
-        }
+        if ( unlikely(rcu_lock_target_domain_by_id(reservation.domid, &d)) )
+            return start_extent;
         args.domain = d;
 
         rc = xsm_memory_adjust_reservation(current->domain, d);

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

From xen-changelog-bounces@lists.xen.org Thu Sep 20 02:11:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Sep 2012 02:11:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TEWEY-0004UF-Bk; Thu, 20 Sep 2012 02:11:18 +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 1TEWEW-0004Tq-Rr
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 02:11:17 +0000
Received: from [85.158.137.99:60287] by server-12.bemta-3.messagelabs.com id
	2D/2E-10384-44B7A505; Thu, 20 Sep 2012 02:11:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-217.messagelabs.com!1348107073!18387177!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26541 invoked from network); 20 Sep 2012 02:11:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Sep 2012 02:11: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 1TEWET-0002nd-O9
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 02:11:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEWET-0006wJ-0y
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 02:11:13 +0000
Message-Id: <E1TEWET-0006wJ-0y@xenbits.xen.org>
Date: Thu, 20 Sep 2012 02:11:12 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] adjust a few RCU domain locking
	calls
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348068392 -7200
# Node ID d26e2d67a8fbe8e7f63ae4bb2278895178a4596d
# Parent  dad9008caa414dcd88935e08d3390ade489bd5c9
adjust a few RCU domain locking calls

x86's do_physdev_op() had a case where the locking was entirely
superfluous. Its physdev_map_pirq() further had a case where the lock
was being obtained too early, needlessly complicating early exit paths.

Grant table code had two open coded instances of
rcu_lock_target_domain_by_id(), and a third code section could be
consolidated by using the newly introduced helper function.

The memory hypercall code had two more instances of open coding
rcu_lock_target_domain_by_id(), but note that here this is not just
cleanup, but also fixes an error return path in memory_exchange() to
actually return an error.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25835:c70d70d85306
xen-unstable date: Fri Sep  7 15:58:12 UTC 2012
---


diff -r dad9008caa41 -r d26e2d67a8fb xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c	Wed Sep 19 17:24:47 2012 +0200
+++ b/xen/arch/x86/physdev.c	Wed Sep 19 17:26:32 2012 +0200
@@ -90,14 +90,10 @@ static int physdev_hvm_map_pirq(
 int physdev_map_pirq(domid_t domid, int type, int *index, int *pirq_p,
                      struct msi_info *msi)
 {
-    struct domain *d;
+    struct domain *d = current->domain;
     int pirq, irq, ret = 0;
     void *map_data = NULL;
 
-    ret = rcu_lock_target_domain_by_id(domid, &d);
-    if ( ret )
-        return ret;
-
     if ( domid == DOMID_SELF && is_hvm_domain(d) )
     {
         /*
@@ -105,14 +101,15 @@ int physdev_map_pirq(domid_t domid, int 
          * 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, type, index, pirq_p);
-        goto free_domain;
+            return -EINVAL;
+
+        return physdev_hvm_map_pirq(d, type, index, pirq_p);
     }
 
+    ret = rcu_lock_target_domain_by_id(domid, &d);
+    if ( ret )
+        return ret;
+
     if ( !IS_PRIV_FOR(current->domain, d) )
     {
         ret = -EPERM;
@@ -696,13 +693,12 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
     }
     case PHYSDEVOP_get_free_pirq: {
         struct physdev_get_free_pirq out;
-        struct domain *d;
+        struct domain *d = v->domain;
 
         ret = -EFAULT;
         if ( copy_from_guest(&out, arg, 1) != 0 )
             break;
 
-        d = rcu_lock_current_domain();
         spin_lock(&d->event_lock);
 
         ret = get_free_pirq(d, out.type);
@@ -717,7 +713,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
         }
 
         spin_unlock(&d->event_lock);
-        rcu_unlock_domain(d);
 
         if ( ret >= 0 )
         {
diff -r dad9008caa41 -r d26e2d67a8fb xen/common/grant_table.c
--- a/xen/common/grant_table.c	Wed Sep 19 17:24:47 2012 +0200
+++ b/xen/common/grant_table.c	Wed Sep 19 17:26:32 2012 +0200
@@ -24,7 +24,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <xen/config.h>
+#include <xen/err.h>
 #include <xen/iocap.h>
 #include <xen/lib.h>
 #include <xen/sched.h>
@@ -195,6 +195,30 @@ double_gt_unlock(struct grant_table *lgt
         spin_unlock(&rgt->lock);
 }
 
+static struct domain *gt_lock_target_domain_by_id(domid_t dom)
+{
+    struct domain *d;
+    int rc = GNTST_general_error;
+
+    switch ( rcu_lock_target_domain_by_id(dom, &d) )
+    {
+    case 0:
+        return d;
+
+    case -ESRCH:
+        gdprintk(XENLOG_INFO, "Bad domid %d.\n", dom);
+        rc = GNTST_bad_domain;
+        break;
+
+    case -EPERM:
+        rc = GNTST_permission_denied;
+        break;
+    }
+
+    ASSERT(rc < 0 && -rc <= MAX_ERRNO);
+    return ERR_PTR(rc);
+}
+
 static inline int
 __get_maptrack_handle(
     struct grant_table *t)
@@ -1261,7 +1285,6 @@ gnttab_setup_table(
     struct grant_table *gt;
     int            i;
     unsigned long  gmfn;
-    domid_t        dom;
 
     if ( count != 1 )
         return -EINVAL;
@@ -1281,25 +1304,11 @@ gnttab_setup_table(
         goto out1;
     }
 
-    dom = op.dom;
-    if ( dom == DOMID_SELF )
+    d = gt_lock_target_domain_by_id(op.dom);
+    if ( IS_ERR(d) )
     {
-        d = rcu_lock_current_domain();
-    }
-    else
-    {
-        if ( unlikely((d = rcu_lock_domain_by_id(dom)) == NULL) )
-        {
-            gdprintk(XENLOG_INFO, "Bad domid %d.\n", dom);
-            op.status = GNTST_bad_domain;
-            goto out1;
-        }
-
-        if ( unlikely(!IS_PRIV_FOR(current->domain, d)) )
-        {
-            op.status = GNTST_permission_denied;
-            goto out2;
-        }
+        op.status = PTR_ERR(d);
+        goto out1;
     }
 
     if ( xsm_grant_setup(current->domain, d) )
@@ -1352,7 +1361,6 @@ gnttab_query_size(
 {
     struct gnttab_query_size op;
     struct domain *d;
-    domid_t        dom;
     int rc;
 
     if ( count != 1 )
@@ -1364,25 +1372,11 @@ gnttab_query_size(
         return -EFAULT;
     }
 
-    dom = op.dom;
-    if ( dom == DOMID_SELF )
+    d = gt_lock_target_domain_by_id(op.dom);
+    if ( IS_ERR(d) )
     {
-        d = rcu_lock_current_domain();
-    }
-    else
-    {
-        if ( unlikely((d = rcu_lock_domain_by_id(dom)) == NULL) )
-        {
-            gdprintk(XENLOG_INFO, "Bad domid %d.\n", dom);
-            op.status = GNTST_bad_domain;
-            goto query_out;
-        }
-
-        if ( unlikely(!IS_PRIV_FOR(current->domain, d)) )
-        {
-            op.status = GNTST_permission_denied;
-            goto query_out_unlock;
-        }
+        op.status = PTR_ERR(d);
+        goto query_out;
     }
 
     rc = xsm_grant_query_size(current->domain, d);
@@ -2251,15 +2245,10 @@ gnttab_get_status_frames(XEN_GUEST_HANDL
         return -EFAULT;
     }
 
-    rc = rcu_lock_target_domain_by_id(op.dom, &d);
-    if ( rc < 0 )
+    d = gt_lock_target_domain_by_id(op.dom);
+    if ( IS_ERR(d) )
     {
-        if ( rc == -ESRCH )
-            op.status = GNTST_bad_domain;
-        else if ( rc == -EPERM )
-            op.status = GNTST_permission_denied;
-        else
-            op.status = GNTST_general_error;
+        op.status = PTR_ERR(d);
         goto out1;
     }
     rc = xsm_grant_setup(current->domain, d);
diff -r dad9008caa41 -r d26e2d67a8fb xen/common/memory.c
--- a/xen/common/memory.c	Wed Sep 19 17:24:47 2012 +0200
+++ b/xen/common/memory.c	Wed Sep 19 17:26:32 2012 +0200
@@ -329,22 +329,9 @@ static long memory_exchange(XEN_GUEST_HA
         out_chunk_order = exch.in.extent_order - exch.out.extent_order;
     }
 
-    if ( likely(exch.in.domid == DOMID_SELF) )
-    {
-        d = rcu_lock_current_domain();
-    }
-    else
-    {
-        if ( (d = rcu_lock_domain_by_id(exch.in.domid)) == NULL )
-            goto fail_early;
-
-        if ( !IS_PRIV_FOR(current->domain, d) )
-        {
-            rcu_unlock_domain(d);
-            rc = -EPERM;
-            goto fail_early;
-        }
-    }
+    rc = rcu_lock_target_domain_by_id(exch.in.domid, &d);
+    if ( rc )
+        goto fail_early;
 
     memflags |= MEMF_bits(domain_clamp_alloc_bitsize(
         d,
@@ -583,20 +570,8 @@ long do_memory_op(unsigned long cmd, XEN
              && (reservation.mem_flags & XENMEMF_populate_on_demand) )
             args.memflags |= MEMF_populate_on_demand;
 
-        if ( likely(reservation.domid == DOMID_SELF) )
-        {
-            d = rcu_lock_current_domain();
-        }
-        else
-        {
-            if ( (d = rcu_lock_domain_by_id(reservation.domid)) == NULL )
-                return start_extent;
-            if ( !IS_PRIV_FOR(current->domain, d) )
-            {
-                rcu_unlock_domain(d);
-                return start_extent;
-            }
-        }
+        if ( unlikely(rcu_lock_target_domain_by_id(reservation.domid, &d)) )
+            return start_extent;
         args.domain = d;
 
         rc = xsm_memory_adjust_reservation(current->domain, d);

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

From xen-changelog-bounces@lists.xen.org Thu Sep 20 02:11:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Sep 2012 02:11:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TEWEX-0004Tz-8k; Thu, 20 Sep 2012 02:11:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEWEV-0004Tf-5h
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 02:11:15 +0000
Received: from [85.158.143.99:4993] by server-1.bemta-4.messagelabs.com id
	1D/9A-05684-24B7A505; Thu, 20 Sep 2012 02:11:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-216.messagelabs.com!1348107072!24922526!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30397 invoked from network); 20 Sep 2012 02:11:13 -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;
	20 Sep 2012 02:11: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 1TEWES-0002na-Kk
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 02:11:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEWER-0006w2-P1
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 02:11:12 +0000
Message-Id: <E1TEWER-0006w2-P1@xenbits.xen.org>
Date: Thu, 20 Sep 2012 02:11:09 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] x86/32-on-64: adjust Dom0 initial
	page table layout
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348068287 -7200
# Node ID dad9008caa414dcd88935e08d3390ade489bd5c9
# Parent  cab407c45e8771337603dd90e37b47b6da652e59
x86/32-on-64: adjust Dom0 initial page table layout

Drop the unnecessary reservation of the L4 page for 32on64 Dom0, and
allocate its L3 first (to match behavior when running identical bit-
width hypervisor and Dom0 kernel).

Reported-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25833:bb85bbccb1c9
xen-unstable date: Fri Sep  7 13:01:39 UTC 2012
---


diff -r cab407c45e87 -r dad9008caa41 xen/arch/x86/domain_build.c
--- a/xen/arch/x86/domain_build.c	Wed Sep 19 17:23:26 2012 +0200
+++ b/xen/arch/x86/domain_build.c	Wed Sep 19 17:24:47 2012 +0200
@@ -510,7 +510,7 @@ int __init construct_dom0(
 #define NR(_l,_h,_s) \
     (((((_h) + ((1UL<<(_s))-1)) & ~((1UL<<(_s))-1)) - \
        ((_l) & ~((1UL<<(_s))-1))) >> (_s))
-        if ( (1 + /* # L4 */
+        if ( (!is_pv_32on64_domain(d) + /* # L4 */
               NR(v_start, v_end, L4_PAGETABLE_SHIFT) + /* # L3 */
               (!is_pv_32on64_domain(d) ?
                NR(v_start, v_end, L3_PAGETABLE_SHIFT) : /* # L2 */
@@ -756,6 +756,8 @@ int __init construct_dom0(
             panic("Not enough RAM for domain 0 PML4.\n");
         page->u.inuse.type_info = PGT_l4_page_table|PGT_validated|1;
         l4start = l4tab = page_to_virt(page);
+        maddr_to_page(mpt_alloc)->u.inuse.type_info = PGT_l3_page_table;
+        l3start = __va(mpt_alloc); mpt_alloc += PAGE_SIZE;
     }
     copy_page(l4tab, idle_pg_table);
     l4tab[0] = l4e_empty(); /* zap trampoline mapping */
@@ -787,9 +789,13 @@ int __init construct_dom0(
                     l2tab += l2_table_offset(v_start);
                 if ( !((unsigned long)l3tab & (PAGE_SIZE-1)) )
                 {
-                    maddr_to_page(mpt_alloc)->u.inuse.type_info =
-                        PGT_l3_page_table;
-                    l3start = l3tab = __va(mpt_alloc); mpt_alloc += PAGE_SIZE;
+                    if ( count || !l3start )
+                    {
+                        maddr_to_page(mpt_alloc)->u.inuse.type_info =
+                            PGT_l3_page_table;
+                        l3start = __va(mpt_alloc); mpt_alloc += PAGE_SIZE;
+                    }
+                    l3tab = l3start;
                     clear_page(l3tab);
                     if ( count == 0 )
                         l3tab += l3_table_offset(v_start);
@@ -938,7 +944,7 @@ int __init construct_dom0(
     if ( !vinitrd_start && initrd_len )
         si->flags   |= SIF_MOD_START_PFN;
     si->flags       |= (xen_processor_pmbits << 8) & SIF_PM_MASK;
-    si->pt_base      = vpt_start + 2 * PAGE_SIZE * !!is_pv_32on64_domain(d);
+    si->pt_base      = vpt_start;
     si->nr_pt_frames = nr_pt_pages;
     si->mfn_list     = vphysmap_start;
     snprintf(si->magic, sizeof(si->magic), "xen-3.0-x86_%d%s",

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

From xen-changelog-bounces@lists.xen.org Thu Sep 20 02:11:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Sep 2012 02:11:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TEWEX-0004Tz-8k; Thu, 20 Sep 2012 02:11:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEWEV-0004Tf-5h
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 02:11:15 +0000
Received: from [85.158.143.99:4993] by server-1.bemta-4.messagelabs.com id
	1D/9A-05684-24B7A505; Thu, 20 Sep 2012 02:11:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-216.messagelabs.com!1348107072!24922526!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30397 invoked from network); 20 Sep 2012 02:11:13 -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;
	20 Sep 2012 02:11: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 1TEWES-0002na-Kk
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 02:11:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEWER-0006w2-P1
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 02:11:12 +0000
Message-Id: <E1TEWER-0006w2-P1@xenbits.xen.org>
Date: Thu, 20 Sep 2012 02:11:09 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] x86/32-on-64: adjust Dom0 initial
	page table layout
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348068287 -7200
# Node ID dad9008caa414dcd88935e08d3390ade489bd5c9
# Parent  cab407c45e8771337603dd90e37b47b6da652e59
x86/32-on-64: adjust Dom0 initial page table layout

Drop the unnecessary reservation of the L4 page for 32on64 Dom0, and
allocate its L3 first (to match behavior when running identical bit-
width hypervisor and Dom0 kernel).

Reported-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25833:bb85bbccb1c9
xen-unstable date: Fri Sep  7 13:01:39 UTC 2012
---


diff -r cab407c45e87 -r dad9008caa41 xen/arch/x86/domain_build.c
--- a/xen/arch/x86/domain_build.c	Wed Sep 19 17:23:26 2012 +0200
+++ b/xen/arch/x86/domain_build.c	Wed Sep 19 17:24:47 2012 +0200
@@ -510,7 +510,7 @@ int __init construct_dom0(
 #define NR(_l,_h,_s) \
     (((((_h) + ((1UL<<(_s))-1)) & ~((1UL<<(_s))-1)) - \
        ((_l) & ~((1UL<<(_s))-1))) >> (_s))
-        if ( (1 + /* # L4 */
+        if ( (!is_pv_32on64_domain(d) + /* # L4 */
               NR(v_start, v_end, L4_PAGETABLE_SHIFT) + /* # L3 */
               (!is_pv_32on64_domain(d) ?
                NR(v_start, v_end, L3_PAGETABLE_SHIFT) : /* # L2 */
@@ -756,6 +756,8 @@ int __init construct_dom0(
             panic("Not enough RAM for domain 0 PML4.\n");
         page->u.inuse.type_info = PGT_l4_page_table|PGT_validated|1;
         l4start = l4tab = page_to_virt(page);
+        maddr_to_page(mpt_alloc)->u.inuse.type_info = PGT_l3_page_table;
+        l3start = __va(mpt_alloc); mpt_alloc += PAGE_SIZE;
     }
     copy_page(l4tab, idle_pg_table);
     l4tab[0] = l4e_empty(); /* zap trampoline mapping */
@@ -787,9 +789,13 @@ int __init construct_dom0(
                     l2tab += l2_table_offset(v_start);
                 if ( !((unsigned long)l3tab & (PAGE_SIZE-1)) )
                 {
-                    maddr_to_page(mpt_alloc)->u.inuse.type_info =
-                        PGT_l3_page_table;
-                    l3start = l3tab = __va(mpt_alloc); mpt_alloc += PAGE_SIZE;
+                    if ( count || !l3start )
+                    {
+                        maddr_to_page(mpt_alloc)->u.inuse.type_info =
+                            PGT_l3_page_table;
+                        l3start = __va(mpt_alloc); mpt_alloc += PAGE_SIZE;
+                    }
+                    l3tab = l3start;
                     clear_page(l3tab);
                     if ( count == 0 )
                         l3tab += l3_table_offset(v_start);
@@ -938,7 +944,7 @@ int __init construct_dom0(
     if ( !vinitrd_start && initrd_len )
         si->flags   |= SIF_MOD_START_PFN;
     si->flags       |= (xen_processor_pmbits << 8) & SIF_PM_MASK;
-    si->pt_base      = vpt_start + 2 * PAGE_SIZE * !!is_pv_32on64_domain(d);
+    si->pt_base      = vpt_start;
     si->nr_pt_frames = nr_pt_pages;
     si->mfn_list     = vphysmap_start;
     snprintf(si->magic, sizeof(si->magic), "xen-3.0-x86_%d%s",

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

From xen-changelog-bounces@lists.xen.org Thu Sep 20 02:11:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Sep 2012 02:11:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TEWEZ-0004Ua-Ib; Thu, 20 Sep 2012 02:11:19 +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 1TEWEY-0004Tu-3k
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 02:11:18 +0000
Received: from [85.158.138.51:36936] by server-11.bemta-3.messagelabs.com id
	AB/F6-30250-54B7A505; Thu, 20 Sep 2012 02:11:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-174.messagelabs.com!1348107076!31206931!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13707 invoked from network); 20 Sep 2012 02:11: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;
	20 Sep 2012 02:11: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 1TEWEV-0002nm-Po
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 02:11:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEWEV-0006xH-7v
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 02:11:15 +0000
Message-Id: <E1TEWEV-0006xH-7v@xenbits.xen.org>
Date: Thu, 20 Sep 2012 02:11:14 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] mem_event: fix regression
	affecting CR3, CR4 memory events
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Steven Maresca <steve@zentific.com>
# Date 1348068785 -7200
# Node ID 3462914d95d32d5657de1fad8fd79547c696f081
# Parent  1a4ace3604420ab001922ea9571c0654f431e530
mem_event: fix regression affecting CR3, CR4 memory events

This is a patch repairing a regression in code previously functional
in 4.1.x. It appears that, during some refactoring work, calls to
hvm_memory_event_cr3 and hvm_memory_event_cr4 were lost.

These functions were originally called in mov_to_cr() of vmx.c, but
the commit  http://xenbits.xen.org/hg/xen-unstable.hg/rev/1276926e3795
abstracted the original code into generic functions up a level in
hvm.c, dropping these calls in the process.

Signed-off-by: Steven Maresca <steve@zentific.com>
Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
xen-unstable changeset: 25918:7ab899e46347
xen-unstable date: Mon Sep 17 16:55:12 UTC 2012
---


diff -r 1a4ace360442 -r 3462914d95d3 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Wed Sep 19 17:31:10 2012 +0200
+++ b/xen/arch/x86/hvm/hvm.c	Wed Sep 19 17:33:05 2012 +0200
@@ -1758,6 +1758,7 @@ int hvm_set_cr3(unsigned long value)
 {
     struct vcpu *v = current;
     struct page_info *page;
+    unsigned long old;
 
     if ( hvm_paging_enabled(v) && !paging_mode_hap(v->domain) &&
          (value != v->arch.hvm_vcpu.guest_cr[3]) )
@@ -1775,8 +1776,10 @@ int hvm_set_cr3(unsigned long value)
         HVM_DBG_LOG(DBG_LEVEL_VMMU, "Update CR3 value = %lx", value);
     }
 
+    old=v->arch.hvm_vcpu.guest_cr[3];
     v->arch.hvm_vcpu.guest_cr[3] = value;
     paging_update_cr3(v);
+    hvm_memory_event_cr3(value, old);
     return X86EMUL_OKAY;
 
  bad_cr3:
@@ -1818,6 +1821,7 @@ int hvm_set_cr4(unsigned long value)
 
     v->arch.hvm_vcpu.guest_cr[4] = value;
     hvm_update_guest_cr(v, 4);
+    hvm_memory_event_cr4(value, old_cr);
 
     /*
      * Modifying CR4.{PSE,PAE,PGE,SMEP}, or clearing CR4.PCIDE

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

From xen-changelog-bounces@lists.xen.org Thu Sep 20 02:11:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Sep 2012 02:11:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TEWEZ-0004Ua-Ib; Thu, 20 Sep 2012 02:11:19 +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 1TEWEY-0004Tu-3k
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 02:11:18 +0000
Received: from [85.158.138.51:36936] by server-11.bemta-3.messagelabs.com id
	AB/F6-30250-54B7A505; Thu, 20 Sep 2012 02:11:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-174.messagelabs.com!1348107076!31206931!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13707 invoked from network); 20 Sep 2012 02:11: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;
	20 Sep 2012 02:11: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 1TEWEV-0002nm-Po
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 02:11:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEWEV-0006xH-7v
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 02:11:15 +0000
Message-Id: <E1TEWEV-0006xH-7v@xenbits.xen.org>
Date: Thu, 20 Sep 2012 02:11:14 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] mem_event: fix regression
	affecting CR3, CR4 memory events
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Steven Maresca <steve@zentific.com>
# Date 1348068785 -7200
# Node ID 3462914d95d32d5657de1fad8fd79547c696f081
# Parent  1a4ace3604420ab001922ea9571c0654f431e530
mem_event: fix regression affecting CR3, CR4 memory events

This is a patch repairing a regression in code previously functional
in 4.1.x. It appears that, during some refactoring work, calls to
hvm_memory_event_cr3 and hvm_memory_event_cr4 were lost.

These functions were originally called in mov_to_cr() of vmx.c, but
the commit  http://xenbits.xen.org/hg/xen-unstable.hg/rev/1276926e3795
abstracted the original code into generic functions up a level in
hvm.c, dropping these calls in the process.

Signed-off-by: Steven Maresca <steve@zentific.com>
Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
xen-unstable changeset: 25918:7ab899e46347
xen-unstable date: Mon Sep 17 16:55:12 UTC 2012
---


diff -r 1a4ace360442 -r 3462914d95d3 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Wed Sep 19 17:31:10 2012 +0200
+++ b/xen/arch/x86/hvm/hvm.c	Wed Sep 19 17:33:05 2012 +0200
@@ -1758,6 +1758,7 @@ int hvm_set_cr3(unsigned long value)
 {
     struct vcpu *v = current;
     struct page_info *page;
+    unsigned long old;
 
     if ( hvm_paging_enabled(v) && !paging_mode_hap(v->domain) &&
          (value != v->arch.hvm_vcpu.guest_cr[3]) )
@@ -1775,8 +1776,10 @@ int hvm_set_cr3(unsigned long value)
         HVM_DBG_LOG(DBG_LEVEL_VMMU, "Update CR3 value = %lx", value);
     }
 
+    old=v->arch.hvm_vcpu.guest_cr[3];
     v->arch.hvm_vcpu.guest_cr[3] = value;
     paging_update_cr3(v);
+    hvm_memory_event_cr3(value, old);
     return X86EMUL_OKAY;
 
  bad_cr3:
@@ -1818,6 +1821,7 @@ int hvm_set_cr4(unsigned long value)
 
     v->arch.hvm_vcpu.guest_cr[4] = value;
     hvm_update_guest_cr(v, 4);
+    hvm_memory_event_cr4(value, old_cr);
 
     /*
      * Modifying CR4.{PSE,PAE,PGE,SMEP}, or clearing CR4.PCIDE

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

From xen-changelog-bounces@lists.xen.org Thu Sep 20 02:11:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Sep 2012 02:11:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TEWEZ-0004UV-Fy; Thu, 20 Sep 2012 02:11:19 +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 1TEWEX-0004Tu-Lk
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 02:11:17 +0000
Received: from [85.158.137.99:65382] by server-11.bemta-3.messagelabs.com id
	49/F6-30250-44B7A505; Thu, 20 Sep 2012 02:11:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-217.messagelabs.com!1348107075!18360327!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10866 invoked from network); 20 Sep 2012 02:11:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Sep 2012 02:11: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 1TEWEU-0002nj-R9
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 02:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEWEU-0006wt-Ja
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 02:11:14 +0000
Message-Id: <E1TEWEU-0006wt-Ja@xenbits.xen.org>
Date: Thu, 20 Sep 2012 02:11:14 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Extra check in grant table code
	for mapping of shared frame
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1348068670 -7200
# Node ID 1a4ace3604420ab001922ea9571c0654f431e530
# Parent  244bf44cb7a6f96fab18bfe266bb1af6df2e406f
Extra check in grant table code for mapping of shared frame

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
xen-unstable changeset: 25917:5ba70e030b47
xen-unstable date: Mon Sep 17 16:51:57 UTC 2012
---


diff -r 244bf44cb7a6 -r 1a4ace360442 xen/common/grant_table.c
--- a/xen/common/grant_table.c	Wed Sep 19 17:27:38 2012 +0200
+++ b/xen/common/grant_table.c	Wed Sep 19 17:31:10 2012 +0200
@@ -673,9 +673,12 @@ __gnttab_map_grant_ref(
     }
     else if ( owner == rd || owner == dom_cow )
     {
-        if ( gnttab_host_mapping_get_page_type(op, ld, rd) &&
-             !get_page_type(pg, PGT_writable_page) )
-            goto could_not_pin;
+        if ( gnttab_host_mapping_get_page_type(op, ld, rd) )
+        {
+            if ( (owner == dom_cow) ||
+                 !get_page_type(pg, PGT_writable_page) )
+                goto could_not_pin;
+        }
 
         nr_gets++;
         if ( op->flags & GNTMAP_host_map )

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

From xen-changelog-bounces@lists.xen.org Thu Sep 20 02:11:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Sep 2012 02:11:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TEWEZ-0004UV-Fy; Thu, 20 Sep 2012 02:11:19 +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 1TEWEX-0004Tu-Lk
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 02:11:17 +0000
Received: from [85.158.137.99:65382] by server-11.bemta-3.messagelabs.com id
	49/F6-30250-44B7A505; Thu, 20 Sep 2012 02:11:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-217.messagelabs.com!1348107075!18360327!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10866 invoked from network); 20 Sep 2012 02:11:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Sep 2012 02:11: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 1TEWEU-0002nj-R9
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 02:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEWEU-0006wt-Ja
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 02:11:14 +0000
Message-Id: <E1TEWEU-0006wt-Ja@xenbits.xen.org>
Date: Thu, 20 Sep 2012 02:11:14 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Extra check in grant table code
	for mapping of shared frame
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1348068670 -7200
# Node ID 1a4ace3604420ab001922ea9571c0654f431e530
# Parent  244bf44cb7a6f96fab18bfe266bb1af6df2e406f
Extra check in grant table code for mapping of shared frame

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
xen-unstable changeset: 25917:5ba70e030b47
xen-unstable date: Mon Sep 17 16:51:57 UTC 2012
---


diff -r 244bf44cb7a6 -r 1a4ace360442 xen/common/grant_table.c
--- a/xen/common/grant_table.c	Wed Sep 19 17:27:38 2012 +0200
+++ b/xen/common/grant_table.c	Wed Sep 19 17:31:10 2012 +0200
@@ -673,9 +673,12 @@ __gnttab_map_grant_ref(
     }
     else if ( owner == rd || owner == dom_cow )
     {
-        if ( gnttab_host_mapping_get_page_type(op, ld, rd) &&
-             !get_page_type(pg, PGT_writable_page) )
-            goto could_not_pin;
+        if ( gnttab_host_mapping_get_page_type(op, ld, rd) )
+        {
+            if ( (owner == dom_cow) ||
+                 !get_page_type(pg, PGT_writable_page) )
+                goto could_not_pin;
+        }
 
         nr_gets++;
         if ( op->flags & GNTMAP_host_map )

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

From xen-changelog-bounces@lists.xen.org Thu Sep 20 02:11:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Sep 2012 02: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.xen.org>)
	id 1TEWEc-0004VX-MA; Thu, 20 Sep 2012 02:11: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 1TEWEb-0004Tp-Fk
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 02:11:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-27.messagelabs.com!1348107074!8867962!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18872 invoked from network); 20 Sep 2012 02:11:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Sep 2012 02:11: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 1TEWEU-0002ng-3B
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 02:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEWET-0006wZ-V2
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 02:11:14 +0000
Message-Id: <E1TEWET-0006wZ-V2@xenbits.xen.org>
Date: Thu, 20 Sep 2012 02:11:13 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] VT-d: split .ack and .disable
	DMA-MSI actors
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348068458 -7200
# Node ID 244bf44cb7a6f96fab18bfe266bb1af6df2e406f
# Parent  d26e2d67a8fbe8e7f63ae4bb2278895178a4596d
VT-d: split .ack and .disable DMA-MSI actors

Calling irq_complete_move() from .disable is wrong, breaking S3 resume.

Comparing with all other .ack actors, it was also missing a call to
move_{native,masked}_irq(). As the actor is masking its interrupt
anyway (albeit it's not immediately obvious why), the latter is the
better choice.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by Xiantao Zhang <xiantao.zhang@intel.com>
xen-unstable changeset: 25836:7d216f026f71
xen-unstable date: Mon Sep 10 07:45:30 UTC 2012
---


diff -r d26e2d67a8fb -r 244bf44cb7a6 xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c	Wed Sep 19 17:26:32 2012 +0200
+++ b/xen/drivers/passthrough/vtd/iommu.c	Wed Sep 19 17:27:38 2012 +0200
@@ -1040,8 +1040,6 @@ static void dma_msi_mask(struct irq_desc
     unsigned long flags;
     struct iommu *iommu = desc->action->dev_id;
 
-    irq_complete_move(desc);
-
     /* mask it */
     spin_lock_irqsave(&iommu->register_lock, flags);
     dmar_writel(iommu->reg, DMAR_FECTL_REG, DMA_FECTL_IM);
@@ -1054,6 +1052,13 @@ static unsigned int dma_msi_startup(stru
     return 0;
 }
 
+static void dma_msi_ack(struct irq_desc *desc)
+{
+    irq_complete_move(desc);
+    dma_msi_mask(desc);
+    move_masked_irq(desc);
+}
+
 static void dma_msi_end(struct irq_desc *desc, u8 vector)
 {
     dma_msi_unmask(desc);
@@ -1115,7 +1120,7 @@ static hw_irq_controller dma_msi_type = 
     .shutdown = dma_msi_mask,
     .enable = dma_msi_unmask,
     .disable = dma_msi_mask,
-    .ack = dma_msi_mask,
+    .ack = dma_msi_ack,
     .end = dma_msi_end,
     .set_affinity = dma_msi_set_affinity,
 };

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

From xen-changelog-bounces@lists.xen.org Thu Sep 20 02:11:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Sep 2012 02: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.xen.org>)
	id 1TEWEc-0004VX-MA; Thu, 20 Sep 2012 02:11: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 1TEWEb-0004Tp-Fk
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 02:11:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-27.messagelabs.com!1348107074!8867962!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18872 invoked from network); 20 Sep 2012 02:11:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Sep 2012 02:11: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 1TEWEU-0002ng-3B
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 02:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEWET-0006wZ-V2
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 02:11:14 +0000
Message-Id: <E1TEWET-0006wZ-V2@xenbits.xen.org>
Date: Thu, 20 Sep 2012 02:11:13 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] VT-d: split .ack and .disable
	DMA-MSI actors
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348068458 -7200
# Node ID 244bf44cb7a6f96fab18bfe266bb1af6df2e406f
# Parent  d26e2d67a8fbe8e7f63ae4bb2278895178a4596d
VT-d: split .ack and .disable DMA-MSI actors

Calling irq_complete_move() from .disable is wrong, breaking S3 resume.

Comparing with all other .ack actors, it was also missing a call to
move_{native,masked}_irq(). As the actor is masking its interrupt
anyway (albeit it's not immediately obvious why), the latter is the
better choice.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by Xiantao Zhang <xiantao.zhang@intel.com>
xen-unstable changeset: 25836:7d216f026f71
xen-unstable date: Mon Sep 10 07:45:30 UTC 2012
---


diff -r d26e2d67a8fb -r 244bf44cb7a6 xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c	Wed Sep 19 17:26:32 2012 +0200
+++ b/xen/drivers/passthrough/vtd/iommu.c	Wed Sep 19 17:27:38 2012 +0200
@@ -1040,8 +1040,6 @@ static void dma_msi_mask(struct irq_desc
     unsigned long flags;
     struct iommu *iommu = desc->action->dev_id;
 
-    irq_complete_move(desc);
-
     /* mask it */
     spin_lock_irqsave(&iommu->register_lock, flags);
     dmar_writel(iommu->reg, DMAR_FECTL_REG, DMA_FECTL_IM);
@@ -1054,6 +1052,13 @@ static unsigned int dma_msi_startup(stru
     return 0;
 }
 
+static void dma_msi_ack(struct irq_desc *desc)
+{
+    irq_complete_move(desc);
+    dma_msi_mask(desc);
+    move_masked_irq(desc);
+}
+
 static void dma_msi_end(struct irq_desc *desc, u8 vector)
 {
     dma_msi_unmask(desc);
@@ -1115,7 +1120,7 @@ static hw_irq_controller dma_msi_type = 
     .shutdown = dma_msi_mask,
     .enable = dma_msi_unmask,
     .disable = dma_msi_mask,
-    .ack = dma_msi_mask,
+    .ack = dma_msi_ack,
     .end = dma_msi_end,
     .set_affinity = dma_msi_set_affinity,
 };

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

From xen-changelog-bounces@lists.xen.org Thu Sep 20 17:22:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Sep 2012 17: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.xen.org>)
	id 1TEkSB-0007Kb-7h; Thu, 20 Sep 2012 17:22:19 +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 1TEkS9-0007KD-TW
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:18 +0000
Received: from [85.158.137.99:58417] by server-5.bemta-3.messagelabs.com id
	8B/EA-13133-8C05B505; Thu, 20 Sep 2012 17:22:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-217.messagelabs.com!1348161735!18388895!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24916 invoked from network); 20 Sep 2012 17:22:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Sep 2012 17:22: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 1TEkS6-0005pL-P8
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEkS6-0006Ax-GY
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:14 +0000
Message-Id: <E1TEkS6-0006Ax-GY@xenbits.xen.org>
Date: Thu, 20 Sep 2012 17:22:13 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86/PoD: prevent guest from being
	destroyed upon early access to its memory
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============7338874445038536355=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============7338874445038536355==
Content-Type: text/plain

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348130783 -7200
# Node ID 1588867f85c7464db815f3de76a8371b2184f27e
# Parent  474235d7c1dc44c018ec7538c8a9c8906512c55a
x86/PoD: prevent guest from being destroyed upon early access to its memory

When an external agent (e.g. a monitoring daemon) happens to access the
memory of a PoD guest prior to setting the PoD target, that access must
fail for there not being any page in the PoD cache, and only the space
above the low 2Mb gets scanned for victim pages (while only the low 2Mb
got real pages populated so far).

To accomodate for this
- set the PoD target first
- do all physmap population in PoD mode (i.e. not just large [2Mb or
  1Gb] pages)
- slightly lift the restrictions enforced by p2m_pod_set_mem_target()
  to accomodate for the changed tools behavior

Tested-by: Jürgen Groß <juergen.gross@ts.fujitsu.com>
           (in a 4.0.x based incarnation)
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
xen-unstable changeset: 25754:be8ae5439a88
xen-unstable date: Thu Aug 16 08:14:11 UTC 2012
---


diff -r 474235d7c1dc -r 1588867f85c7 tools/libxc/xc_hvm_build.c
--- a/tools/libxc/xc_hvm_build.c	Thu Sep 20 10:43:49 2012 +0200
+++ b/tools/libxc/xc_hvm_build.c	Thu Sep 20 10:46:23 2012 +0200
@@ -154,7 +154,7 @@ static int setup_guest(xc_interface *xch
         goto error_out;
 
     if ( memsize > target )
-        pod_mode = 1;
+        pod_mode = XENMEMF_populate_on_demand;
 
     memset(&elf, 0, sizeof(elf));
     if ( elf_init(&elf, image, image_size) != 0 )
@@ -194,6 +194,22 @@ static int setup_guest(xc_interface *xch
     for ( i = HVM_BELOW_4G_RAM_END >> PAGE_SHIFT; i < nr_pages; i++ )
         page_array[i] += HVM_BELOW_4G_MMIO_LENGTH >> PAGE_SHIFT;
 
+    if ( pod_mode )
+    {
+        /*
+         * Subtract 0x20 from target_pages for the VGA "hole".  Xen will
+         * adjust the PoD cache size so that domain tot_pages will be
+         * target_pages - 0x20 after this call.
+         */
+        rc = xc_domain_set_pod_target(xch, dom, target_pages - 0x20,
+                                      NULL, NULL, NULL);
+        if ( rc != 0 )
+        {
+            PERROR("Could not set PoD target for HVM guest.\n");
+            goto error_out;
+        }
+    }
+
     /*
      * Allocate memory for HVM guest, skipping VGA hole 0xA0000-0xC0000.
      *
@@ -205,7 +221,7 @@ static int setup_guest(xc_interface *xch
      * ensure that we can be preempted and hence dom0 remains responsive.
      */
     rc = xc_domain_populate_physmap_exact(
-        xch, dom, 0xa0, 0, 0, &page_array[0x00]);
+        xch, dom, 0xa0, 0, pod_mode, &page_array[0x00]);
     cur_pages = 0xc0;
     stat_normal_pages = 0xc0;
     while ( (rc == 0) && (nr_pages > cur_pages) )
@@ -243,8 +259,7 @@ static int setup_guest(xc_interface *xch
                 sp_extents[i] = page_array[cur_pages+(i<<SUPERPAGE_1GB_SHIFT)];
 
             done = xc_domain_populate_physmap(xch, dom, nr_extents, SUPERPAGE_1GB_SHIFT,
-                                              pod_mode ? XENMEMF_populate_on_demand : 0,
-                                              sp_extents);
+                                              pod_mode, sp_extents);
 
             if ( done > 0 )
             {
@@ -281,8 +296,7 @@ static int setup_guest(xc_interface *xch
                     sp_extents[i] = page_array[cur_pages+(i<<SUPERPAGE_2MB_SHIFT)];
 
                 done = xc_domain_populate_physmap(xch, dom, nr_extents, SUPERPAGE_2MB_SHIFT,
-                                                  pod_mode ? XENMEMF_populate_on_demand : 0,
-                                                  sp_extents);
+                                                  pod_mode, sp_extents);
 
                 if ( done > 0 )
                 {
@@ -298,19 +312,12 @@ static int setup_guest(xc_interface *xch
         if ( count != 0 )
         {
             rc = xc_domain_populate_physmap_exact(
-                xch, dom, count, 0, 0, &page_array[cur_pages]);
+                xch, dom, count, 0, pod_mode, &page_array[cur_pages]);
             cur_pages += count;
             stat_normal_pages += count;
         }
     }
 
-    /* Subtract 0x20 from target_pages for the VGA "hole".  Xen will
-     * adjust the PoD cache size so that domain tot_pages will be
-     * target_pages - 0x20 after this call. */
-    if ( pod_mode )
-        rc = xc_domain_set_pod_target(xch, dom, target_pages - 0x20,
-                                      NULL, NULL, NULL);
-
     if ( rc != 0 )
     {
         PERROR("Could not allocate memory for HVM guest.");
diff -r 474235d7c1dc -r 1588867f85c7 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Thu Sep 20 10:43:49 2012 +0200
+++ b/xen/arch/x86/mm/p2m.c	Thu Sep 20 10:46:23 2012 +0200
@@ -611,8 +611,9 @@ p2m_pod_set_mem_target(struct domain *d,
 
     p2m_lock(p2m);
 
-    /* P == B: Nothing to do. */
-    if ( p2m->pod.entry_count == 0 )
+    /* P == B: Nothing to do (unless the guest is being created). */
+    populated = d->tot_pages - p2m->pod.count;
+    if ( populated > 0 && p2m->pod.entry_count == 0 )
         goto out;
 
     /* Don't do anything if the domain is being torn down */
@@ -624,13 +625,11 @@ p2m_pod_set_mem_target(struct domain *d,
     if ( target < d->tot_pages )
         goto out;
 
-    populated  = d->tot_pages - p2m->pod.count;
-
     pod_target = target - populated;
 
     /* B < T': Set the cache size equal to # of outstanding entries,
      * let the balloon driver fill in the rest. */
-    if ( pod_target > p2m->pod.entry_count )
+    if ( populated > 0 && pod_target > p2m->pod.entry_count )
         pod_target = p2m->pod.entry_count;
 
     ASSERT( pod_target >= p2m->pod.count );


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

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

From xen-changelog-bounces@lists.xen.org Thu Sep 20 17:22:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Sep 2012 17: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.xen.org>)
	id 1TEkSB-0007Kb-7h; Thu, 20 Sep 2012 17:22:19 +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 1TEkS9-0007KD-TW
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:18 +0000
Received: from [85.158.137.99:58417] by server-5.bemta-3.messagelabs.com id
	8B/EA-13133-8C05B505; Thu, 20 Sep 2012 17:22:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-217.messagelabs.com!1348161735!18388895!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24916 invoked from network); 20 Sep 2012 17:22:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Sep 2012 17:22: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 1TEkS6-0005pL-P8
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEkS6-0006Ax-GY
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:14 +0000
Message-Id: <E1TEkS6-0006Ax-GY@xenbits.xen.org>
Date: Thu, 20 Sep 2012 17:22:13 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86/PoD: prevent guest from being
	destroyed upon early access to its memory
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============7338874445038536355=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============7338874445038536355==
Content-Type: text/plain

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348130783 -7200
# Node ID 1588867f85c7464db815f3de76a8371b2184f27e
# Parent  474235d7c1dc44c018ec7538c8a9c8906512c55a
x86/PoD: prevent guest from being destroyed upon early access to its memory

When an external agent (e.g. a monitoring daemon) happens to access the
memory of a PoD guest prior to setting the PoD target, that access must
fail for there not being any page in the PoD cache, and only the space
above the low 2Mb gets scanned for victim pages (while only the low 2Mb
got real pages populated so far).

To accomodate for this
- set the PoD target first
- do all physmap population in PoD mode (i.e. not just large [2Mb or
  1Gb] pages)
- slightly lift the restrictions enforced by p2m_pod_set_mem_target()
  to accomodate for the changed tools behavior

Tested-by: Jürgen Groß <juergen.gross@ts.fujitsu.com>
           (in a 4.0.x based incarnation)
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
xen-unstable changeset: 25754:be8ae5439a88
xen-unstable date: Thu Aug 16 08:14:11 UTC 2012
---


diff -r 474235d7c1dc -r 1588867f85c7 tools/libxc/xc_hvm_build.c
--- a/tools/libxc/xc_hvm_build.c	Thu Sep 20 10:43:49 2012 +0200
+++ b/tools/libxc/xc_hvm_build.c	Thu Sep 20 10:46:23 2012 +0200
@@ -154,7 +154,7 @@ static int setup_guest(xc_interface *xch
         goto error_out;
 
     if ( memsize > target )
-        pod_mode = 1;
+        pod_mode = XENMEMF_populate_on_demand;
 
     memset(&elf, 0, sizeof(elf));
     if ( elf_init(&elf, image, image_size) != 0 )
@@ -194,6 +194,22 @@ static int setup_guest(xc_interface *xch
     for ( i = HVM_BELOW_4G_RAM_END >> PAGE_SHIFT; i < nr_pages; i++ )
         page_array[i] += HVM_BELOW_4G_MMIO_LENGTH >> PAGE_SHIFT;
 
+    if ( pod_mode )
+    {
+        /*
+         * Subtract 0x20 from target_pages for the VGA "hole".  Xen will
+         * adjust the PoD cache size so that domain tot_pages will be
+         * target_pages - 0x20 after this call.
+         */
+        rc = xc_domain_set_pod_target(xch, dom, target_pages - 0x20,
+                                      NULL, NULL, NULL);
+        if ( rc != 0 )
+        {
+            PERROR("Could not set PoD target for HVM guest.\n");
+            goto error_out;
+        }
+    }
+
     /*
      * Allocate memory for HVM guest, skipping VGA hole 0xA0000-0xC0000.
      *
@@ -205,7 +221,7 @@ static int setup_guest(xc_interface *xch
      * ensure that we can be preempted and hence dom0 remains responsive.
      */
     rc = xc_domain_populate_physmap_exact(
-        xch, dom, 0xa0, 0, 0, &page_array[0x00]);
+        xch, dom, 0xa0, 0, pod_mode, &page_array[0x00]);
     cur_pages = 0xc0;
     stat_normal_pages = 0xc0;
     while ( (rc == 0) && (nr_pages > cur_pages) )
@@ -243,8 +259,7 @@ static int setup_guest(xc_interface *xch
                 sp_extents[i] = page_array[cur_pages+(i<<SUPERPAGE_1GB_SHIFT)];
 
             done = xc_domain_populate_physmap(xch, dom, nr_extents, SUPERPAGE_1GB_SHIFT,
-                                              pod_mode ? XENMEMF_populate_on_demand : 0,
-                                              sp_extents);
+                                              pod_mode, sp_extents);
 
             if ( done > 0 )
             {
@@ -281,8 +296,7 @@ static int setup_guest(xc_interface *xch
                     sp_extents[i] = page_array[cur_pages+(i<<SUPERPAGE_2MB_SHIFT)];
 
                 done = xc_domain_populate_physmap(xch, dom, nr_extents, SUPERPAGE_2MB_SHIFT,
-                                                  pod_mode ? XENMEMF_populate_on_demand : 0,
-                                                  sp_extents);
+                                                  pod_mode, sp_extents);
 
                 if ( done > 0 )
                 {
@@ -298,19 +312,12 @@ static int setup_guest(xc_interface *xch
         if ( count != 0 )
         {
             rc = xc_domain_populate_physmap_exact(
-                xch, dom, count, 0, 0, &page_array[cur_pages]);
+                xch, dom, count, 0, pod_mode, &page_array[cur_pages]);
             cur_pages += count;
             stat_normal_pages += count;
         }
     }
 
-    /* Subtract 0x20 from target_pages for the VGA "hole".  Xen will
-     * adjust the PoD cache size so that domain tot_pages will be
-     * target_pages - 0x20 after this call. */
-    if ( pod_mode )
-        rc = xc_domain_set_pod_target(xch, dom, target_pages - 0x20,
-                                      NULL, NULL, NULL);
-
     if ( rc != 0 )
     {
         PERROR("Could not allocate memory for HVM guest.");
diff -r 474235d7c1dc -r 1588867f85c7 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Thu Sep 20 10:43:49 2012 +0200
+++ b/xen/arch/x86/mm/p2m.c	Thu Sep 20 10:46:23 2012 +0200
@@ -611,8 +611,9 @@ p2m_pod_set_mem_target(struct domain *d,
 
     p2m_lock(p2m);
 
-    /* P == B: Nothing to do. */
-    if ( p2m->pod.entry_count == 0 )
+    /* P == B: Nothing to do (unless the guest is being created). */
+    populated = d->tot_pages - p2m->pod.count;
+    if ( populated > 0 && p2m->pod.entry_count == 0 )
         goto out;
 
     /* Don't do anything if the domain is being torn down */
@@ -624,13 +625,11 @@ p2m_pod_set_mem_target(struct domain *d,
     if ( target < d->tot_pages )
         goto out;
 
-    populated  = d->tot_pages - p2m->pod.count;
-
     pod_target = target - populated;
 
     /* B < T': Set the cache size equal to # of outstanding entries,
      * let the balloon driver fill in the rest. */
-    if ( pod_target > p2m->pod.entry_count )
+    if ( populated > 0 && pod_target > p2m->pod.entry_count )
         pod_target = p2m->pod.entry_count;
 
     ASSERT( pod_target >= p2m->pod.count );


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

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

From xen-changelog-bounces@lists.xen.org Thu Sep 20 17:22:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Sep 2012 17: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.xen.org>)
	id 1TEkSC-0007Ks-Cx; Thu, 20 Sep 2012 17:22:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEkSA-0007KH-H7
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:18 +0000
Received: from [85.158.143.35:53500] by server-3.bemta-4.messagelabs.com id
	7F/19-10986-9C05B505; Thu, 20 Sep 2012 17:22:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-21.messagelabs.com!1348161736!13341807!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1438 invoked from network); 20 Sep 2012 17:22:17 -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;
	20 Sep 2012 17: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 1TEkS8-0005pT-56
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEkS7-0006Ba-TX
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:16 +0000
Message-Id: <E1TEkS7-0006Ba-TX@xenbits.xen.org>
Date: Thu, 20 Sep 2012 17:22:15 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86/mm: update max_mapped_pfn on
	MMIO mappings too.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Tim Deegan <tim@xen.org>
# Date 1348131039 -7200
# Node ID 337fe1dc46d77269f39f6c2a6babf47a032d535a
# Parent  d7b754c813be89e00ea7422e07273762c979fdc0
x86/mm: update max_mapped_pfn on MMIO mappings too.

max_mapped_pfn should reflect the highest mapping we've ever seen of
any type, or the tests in the lookup functions will be wrong.  As it
happens, the highest mapping has always been a RAM one, but this is no
longer the case when we allow 64-bit BARs.

Reported-by: Xudong Hao <xudong.hao@intel.com>
Signed-off-by: Tim Deegan <tim@xen.org>
xen-unstable changeset: 25756:8918737c7e80
xen-unstable date: Thu Aug 16 13:31:09 UTC 2012
---


diff -r d7b754c813be -r 337fe1dc46d7 xen/arch/x86/mm/hap/p2m-ept.c
--- a/xen/arch/x86/mm/hap/p2m-ept.c	Thu Sep 20 10:49:17 2012 +0200
+++ b/xen/arch/x86/mm/hap/p2m-ept.c	Thu Sep 20 10:50:39 2012 +0200
@@ -449,7 +449,7 @@ ept_set_entry(struct p2m_domain *p2m, un
     }
 
     /* Track the highest gfn for which we have ever had a valid mapping */
-    if ( mfn_valid(mfn_x(mfn)) &&
+    if ( p2mt != p2m_invalid &&
          (gfn + (1UL << order) - 1 > p2m->max_mapped_pfn) )
         p2m->max_mapped_pfn = gfn + (1UL << order) - 1;
 
diff -r d7b754c813be -r 337fe1dc46d7 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Thu Sep 20 10:49:17 2012 +0200
+++ b/xen/arch/x86/mm/p2m.c	Thu Sep 20 10:50:39 2012 +0200
@@ -1521,7 +1521,7 @@ p2m_set_entry(struct p2m_domain *p2m, un
     }
 
     /* Track the highest gfn for which we have ever had a valid mapping */
-    if ( mfn_valid(mfn) 
+    if ( p2mt != p2m_invalid
          && (gfn + (1UL << page_order) - 1 > p2m->max_mapped_pfn) )
         p2m->max_mapped_pfn = gfn + (1UL << page_order) - 1;
 

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

From xen-changelog-bounces@lists.xen.org Thu Sep 20 17:22:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Sep 2012 17: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.xen.org>)
	id 1TEkSC-0007Ks-Cx; Thu, 20 Sep 2012 17:22:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEkSA-0007KH-H7
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:18 +0000
Received: from [85.158.143.35:53500] by server-3.bemta-4.messagelabs.com id
	7F/19-10986-9C05B505; Thu, 20 Sep 2012 17:22:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-21.messagelabs.com!1348161736!13341807!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1438 invoked from network); 20 Sep 2012 17:22:17 -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;
	20 Sep 2012 17: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 1TEkS8-0005pT-56
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEkS7-0006Ba-TX
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:16 +0000
Message-Id: <E1TEkS7-0006Ba-TX@xenbits.xen.org>
Date: Thu, 20 Sep 2012 17:22:15 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86/mm: update max_mapped_pfn on
	MMIO mappings too.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Tim Deegan <tim@xen.org>
# Date 1348131039 -7200
# Node ID 337fe1dc46d77269f39f6c2a6babf47a032d535a
# Parent  d7b754c813be89e00ea7422e07273762c979fdc0
x86/mm: update max_mapped_pfn on MMIO mappings too.

max_mapped_pfn should reflect the highest mapping we've ever seen of
any type, or the tests in the lookup functions will be wrong.  As it
happens, the highest mapping has always been a RAM one, but this is no
longer the case when we allow 64-bit BARs.

Reported-by: Xudong Hao <xudong.hao@intel.com>
Signed-off-by: Tim Deegan <tim@xen.org>
xen-unstable changeset: 25756:8918737c7e80
xen-unstable date: Thu Aug 16 13:31:09 UTC 2012
---


diff -r d7b754c813be -r 337fe1dc46d7 xen/arch/x86/mm/hap/p2m-ept.c
--- a/xen/arch/x86/mm/hap/p2m-ept.c	Thu Sep 20 10:49:17 2012 +0200
+++ b/xen/arch/x86/mm/hap/p2m-ept.c	Thu Sep 20 10:50:39 2012 +0200
@@ -449,7 +449,7 @@ ept_set_entry(struct p2m_domain *p2m, un
     }
 
     /* Track the highest gfn for which we have ever had a valid mapping */
-    if ( mfn_valid(mfn_x(mfn)) &&
+    if ( p2mt != p2m_invalid &&
          (gfn + (1UL << order) - 1 > p2m->max_mapped_pfn) )
         p2m->max_mapped_pfn = gfn + (1UL << order) - 1;
 
diff -r d7b754c813be -r 337fe1dc46d7 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Thu Sep 20 10:49:17 2012 +0200
+++ b/xen/arch/x86/mm/p2m.c	Thu Sep 20 10:50:39 2012 +0200
@@ -1521,7 +1521,7 @@ p2m_set_entry(struct p2m_domain *p2m, un
     }
 
     /* Track the highest gfn for which we have ever had a valid mapping */
-    if ( mfn_valid(mfn) 
+    if ( p2mt != p2m_invalid
          && (gfn + (1UL << page_order) - 1 > p2m->max_mapped_pfn) )
         p2m->max_mapped_pfn = gfn + (1UL << page_order) - 1;
 

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

From xen-changelog-bounces@lists.xen.org Thu Sep 20 17:22:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Sep 2012 17: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.xen.org>)
	id 1TEkSC-0007Km-A7; Thu, 20 Sep 2012 17:22:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEkSA-0007KF-9v
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:18 +0000
Received: from [85.158.143.99:52073] by server-1.bemta-4.messagelabs.com id
	07/23-05684-9C05B505; Thu, 20 Sep 2012 17:22:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-216.messagelabs.com!1348161736!19929550!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26391 invoked from network); 20 Sep 2012 17:22:17 -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;
	20 Sep 2012 17: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 1TEkS6-0005pK-UI
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEkS5-0006Ai-OE
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:13 +0000
Message-Id: <E1TEkS5-0006Ai-OE@xenbits.xen.org>
Date: Thu, 20 Sep 2012 17:22:12 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] acpi: Make sure valid CPU is
	passed to do_pm_op()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Boris Ostrovsky <boris.ostrovsky@amd.com>
# Date 1348130629 -7200
# Node ID 474235d7c1dc44c018ec7538c8a9c8906512c55a
# Parent  c52e7afc96a91fca96364e5fda72626099161a54
acpi: Make sure valid CPU is passed to do_pm_op()

Passing invalid CPU value to do_pm_op() will cause assertion
in cpu_online().

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@amd.com>

Such checks would, at a first glance, then also be missing at the top
of various helper functions, but these check really were already
redundant with the check in do_pm_op(). Remove the redundant checks
for clarity and brevity.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 25752:1df4fdbaade0
xen-unstable date: Wed Aug 15 07:43:25 UTC 2012
---


diff -r c52e7afc96a9 -r 474235d7c1dc xen/drivers/acpi/pmstat.c
--- a/xen/drivers/acpi/pmstat.c	Wed Sep 12 19:35:07 2012 +0100
+++ b/xen/drivers/acpi/pmstat.c	Thu Sep 20 10:43:49 2012 +0200
@@ -203,8 +203,6 @@ static int get_cpufreq_para(struct xen_s
     struct list_head *pos;
     uint32_t cpu, i, j = 0;
 
-    if ( !op || !cpu_online(op->cpuid) )
-        return -EINVAL;
     pmpt = processor_pminfo[op->cpuid];
     policy = per_cpu(cpufreq_cpu_policy, op->cpuid);
 
@@ -312,9 +310,6 @@ static int set_cpufreq_gov(struct xen_sy
 {
     struct cpufreq_policy new_policy, *old_policy;
 
-    if ( !op || !cpu_online(op->cpuid) )
-        return -EINVAL;
-
     old_policy = per_cpu(cpufreq_cpu_policy, op->cpuid);
     if ( !old_policy )
         return -EINVAL;
@@ -333,8 +328,6 @@ static int set_cpufreq_para(struct xen_s
     int ret = 0;
     struct cpufreq_policy *policy;
 
-    if ( !op || !cpu_online(op->cpuid) )
-        return -EINVAL;
     policy = per_cpu(cpufreq_cpu_policy, op->cpuid);
 
     if ( !policy || !policy->governor )
@@ -411,22 +404,12 @@ static int set_cpufreq_para(struct xen_s
     return ret;
 }
 
-static int get_cpufreq_avgfreq(struct xen_sysctl_pm_op *op)
-{
-    if ( !op || !cpu_online(op->cpuid) )
-        return -EINVAL;
-
-    op->u.get_avgfreq = cpufreq_driver_getavg(op->cpuid, USR_GETAVG);
-
-    return 0;
-}
-
 int do_pm_op(struct xen_sysctl_pm_op *op)
 {
     int ret = 0;
     const struct processor_pminfo *pmpt;
 
-    if ( !op || !cpu_online(op->cpuid) )
+    if ( !op || op->cpuid >= NR_CPUS || !cpu_online(op->cpuid) )
         return -EINVAL;
     pmpt = processor_pminfo[op->cpuid];
 
@@ -462,7 +445,7 @@ int do_pm_op(struct xen_sysctl_pm_op *op
 
     case GET_CPUFREQ_AVGFREQ:
     {
-        ret = get_cpufreq_avgfreq(op);
+        op->u.get_avgfreq = cpufreq_driver_getavg(op->cpuid, USR_GETAVG);
         break;
     }
 

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

From xen-changelog-bounces@lists.xen.org Thu Sep 20 17:22:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Sep 2012 17: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.xen.org>)
	id 1TEkSC-0007Km-A7; Thu, 20 Sep 2012 17:22:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEkSA-0007KF-9v
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:18 +0000
Received: from [85.158.143.99:52073] by server-1.bemta-4.messagelabs.com id
	07/23-05684-9C05B505; Thu, 20 Sep 2012 17:22:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-216.messagelabs.com!1348161736!19929550!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26391 invoked from network); 20 Sep 2012 17:22:17 -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;
	20 Sep 2012 17: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 1TEkS6-0005pK-UI
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEkS5-0006Ai-OE
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:13 +0000
Message-Id: <E1TEkS5-0006Ai-OE@xenbits.xen.org>
Date: Thu, 20 Sep 2012 17:22:12 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] acpi: Make sure valid CPU is
	passed to do_pm_op()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Boris Ostrovsky <boris.ostrovsky@amd.com>
# Date 1348130629 -7200
# Node ID 474235d7c1dc44c018ec7538c8a9c8906512c55a
# Parent  c52e7afc96a91fca96364e5fda72626099161a54
acpi: Make sure valid CPU is passed to do_pm_op()

Passing invalid CPU value to do_pm_op() will cause assertion
in cpu_online().

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@amd.com>

Such checks would, at a first glance, then also be missing at the top
of various helper functions, but these check really were already
redundant with the check in do_pm_op(). Remove the redundant checks
for clarity and brevity.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 25752:1df4fdbaade0
xen-unstable date: Wed Aug 15 07:43:25 UTC 2012
---


diff -r c52e7afc96a9 -r 474235d7c1dc xen/drivers/acpi/pmstat.c
--- a/xen/drivers/acpi/pmstat.c	Wed Sep 12 19:35:07 2012 +0100
+++ b/xen/drivers/acpi/pmstat.c	Thu Sep 20 10:43:49 2012 +0200
@@ -203,8 +203,6 @@ static int get_cpufreq_para(struct xen_s
     struct list_head *pos;
     uint32_t cpu, i, j = 0;
 
-    if ( !op || !cpu_online(op->cpuid) )
-        return -EINVAL;
     pmpt = processor_pminfo[op->cpuid];
     policy = per_cpu(cpufreq_cpu_policy, op->cpuid);
 
@@ -312,9 +310,6 @@ static int set_cpufreq_gov(struct xen_sy
 {
     struct cpufreq_policy new_policy, *old_policy;
 
-    if ( !op || !cpu_online(op->cpuid) )
-        return -EINVAL;
-
     old_policy = per_cpu(cpufreq_cpu_policy, op->cpuid);
     if ( !old_policy )
         return -EINVAL;
@@ -333,8 +328,6 @@ static int set_cpufreq_para(struct xen_s
     int ret = 0;
     struct cpufreq_policy *policy;
 
-    if ( !op || !cpu_online(op->cpuid) )
-        return -EINVAL;
     policy = per_cpu(cpufreq_cpu_policy, op->cpuid);
 
     if ( !policy || !policy->governor )
@@ -411,22 +404,12 @@ static int set_cpufreq_para(struct xen_s
     return ret;
 }
 
-static int get_cpufreq_avgfreq(struct xen_sysctl_pm_op *op)
-{
-    if ( !op || !cpu_online(op->cpuid) )
-        return -EINVAL;
-
-    op->u.get_avgfreq = cpufreq_driver_getavg(op->cpuid, USR_GETAVG);
-
-    return 0;
-}
-
 int do_pm_op(struct xen_sysctl_pm_op *op)
 {
     int ret = 0;
     const struct processor_pminfo *pmpt;
 
-    if ( !op || !cpu_online(op->cpuid) )
+    if ( !op || op->cpuid >= NR_CPUS || !cpu_online(op->cpuid) )
         return -EINVAL;
     pmpt = processor_pminfo[op->cpuid];
 
@@ -462,7 +445,7 @@ int do_pm_op(struct xen_sysctl_pm_op *op
 
     case GET_CPUFREQ_AVGFREQ:
     {
-        ret = get_cpufreq_avgfreq(op);
+        op->u.get_avgfreq = cpufreq_driver_getavg(op->cpuid, USR_GETAVG);
         break;
     }
 

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

From xen-changelog-bounces@lists.xen.org Thu Sep 20 17:22:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Sep 2012 17: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.xen.org>)
	id 1TEkSC-0007Ky-FG; Thu, 20 Sep 2012 17:22:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEkSA-0007KF-Oi
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:18 +0000
Received: from [85.158.143.35:53499] by server-1.bemta-4.messagelabs.com id
	08/23-05684-9C05B505; Thu, 20 Sep 2012 17:22:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-21.messagelabs.com!1348161736!8145818!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16761 invoked from network); 20 Sep 2012 17:22:16 -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;
	20 Sep 2012 17:22: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 1TEkS7-0005pP-F0
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEkS7-0006BI-5z
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:15 +0000
Message-Id: <E1TEkS7-0006BI-5z@xenbits.xen.org>
Date: Thu, 20 Sep 2012 17:22:14 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86/PoD: clean up types
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348130957 -7200
# Node ID d7b754c813be89e00ea7422e07273762c979fdc0
# Parent  1588867f85c7464db815f3de76a8371b2184f27e
x86/PoD: clean up types

GMFN values must undoubtedly be "unsigned long". "count" and
"entry_count", since they are signed types, should also be "long" as
otherwise they can't fit all values that can fit into "d->tot_pages"
(which currently is "uint32_t").

Beyond that, the patch doesn't convert everything to "long" as in many
places it is clear that "int" suffices. In places where "long" is being
used partially already, the change is however being done.

Furthermore, page order values have no use of being "long".

Finally, in the course of updating a few printk messages anyway, some
also get slightly shortened (to focus on the relevant information).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
xen-unstable changeset: 25755:c887c30a0a35
xen-unstable date: Thu Aug 16 08:16:19 UTC 2012
---


diff -r 1588867f85c7 -r d7b754c813be xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Thu Sep 20 10:46:23 2012 +0200
+++ b/xen/arch/x86/mm/p2m.c	Thu Sep 20 10:49:17 2012 +0200
@@ -327,7 +327,7 @@ int set_p2m_entry(struct p2m_domain *p2m
 static int
 p2m_pod_cache_add(struct p2m_domain *p2m,
                   struct page_info *page,
-                  unsigned long order)
+                  unsigned int order)
 {
     int i;
     struct page_info *p;
@@ -341,7 +341,7 @@ p2m_pod_cache_add(struct p2m_domain *p2m
     /* Check to make sure this is a contiguous region */
     if( mfn_x(mfn) & ((1 << order) - 1) )
     {
-        printk("%s: mfn %lx not aligned order %lu! (mask %lx)\n",
+        printk("%s: mfn %lx not aligned order %u! (mask %lx)\n",
                __func__, mfn_x(mfn), order, ((1UL << order) - 1));
         return -1;
     }
@@ -413,7 +413,7 @@ p2m_pod_cache_add(struct p2m_domain *p2m
  * a superpage is requested and no superpages are available.  Must be called
  * with the d->page_lock held. */
 static struct page_info * p2m_pod_cache_get(struct p2m_domain *p2m,
-                                            unsigned long order)
+                                            unsigned int order)
 {
     struct page_info *p = NULL;
     int i;
@@ -495,7 +495,7 @@ p2m_pod_set_cache_target(struct p2m_doma
                 goto retry;
             }   
             
-            printk("%s: Unable to allocate domheap page for pod cache.  target %lu cachesize %d\n",
+            printk("%s: Unable to allocate page for PoD cache (target=%lu cache=%ld)\n",
                    __func__, pod_target, p2m->pod.count);
             ret = -ENOMEM;
             goto out;
@@ -604,10 +604,9 @@ out:
 int
 p2m_pod_set_mem_target(struct domain *d, unsigned long target)
 {
-    unsigned pod_target;
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
     int ret = 0;
-    unsigned long populated;
+    unsigned long populated, pod_target;
 
     p2m_lock(p2m);
 
@@ -884,7 +883,8 @@ out:
 void
 p2m_pod_dump_data(struct p2m_domain *p2m)
 {
-    printk("    PoD entries=%d cachesize=%d\n",
+
+    printk("    PoD entries=%ld cachesize=%ld\n",
            p2m->pod.entry_count, p2m->pod.count);
 }
 
@@ -1315,8 +1315,9 @@ p2m_pod_demand_populate(struct p2m_domai
 out_of_memory:
     spin_unlock(&d->page_alloc_lock);
 
-    printk("%s: Out of populate-on-demand memory! tot_pages %" PRIu32 " pod_entries %" PRIi32 "\n",
-           __func__, d->tot_pages, p2m->pod.entry_count);
+    printk("%s: Dom%d out of PoD memory! (tot=%"PRIu32" ents=%ld dom%d)\n",
+           __func__, d->domain_id, d->tot_pages, p2m->pod.entry_count,
+           current->domain->domain_id);
     domain_crash(d);
 out_fail:
     return -1;
@@ -2073,8 +2074,7 @@ static void audit_p2m(struct p2m_domain 
 {
     struct page_info *page;
     struct domain *od;
-    unsigned long mfn, gfn, m2pfn, lp2mfn = 0;
-    int entry_count = 0;
+    unsigned long mfn, gfn, m2pfn, lp2mfn = 0, entry_count = 0;
     mfn_t p2mfn;
     unsigned long orphans_d = 0, orphans_i = 0, mpbad = 0, pmbad = 0;
     int test_linear;
@@ -2313,7 +2313,7 @@ static void audit_p2m(struct p2m_domain 
 
     if ( entry_count != p2m->pod.entry_count )
     {
-        printk("%s: refcounted entry count %d, audit count %d!\n",
+        printk("%s: refcounted entry count %ld, audit count %lu!\n",
                __func__,
                p2m->pod.entry_count,
                entry_count);
@@ -2407,10 +2407,9 @@ guest_physmap_mark_populate_on_demand(st
                                       unsigned int order)
 {
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
-    unsigned long i;
+    unsigned long i, pod_count = 0;
     p2m_type_t ot;
     mfn_t omfn;
-    int pod_count = 0;
     int rc = 0;
 
     if ( !paging_mode_translate(d) )
diff -r 1588867f85c7 -r d7b754c813be xen/include/asm-x86/p2m.h
--- a/xen/include/asm-x86/p2m.h	Thu Sep 20 10:46:23 2012 +0200
+++ b/xen/include/asm-x86/p2m.h	Thu Sep 20 10:49:17 2012 +0200
@@ -255,11 +255,11 @@ struct p2m_domain {
     struct {
         struct page_list_head super,   /* List of superpages                */
                          single;       /* Non-super lists                   */
-        int              count,        /* # of pages in cache lists         */
+        long             count,        /* # of pages in cache lists         */
                          entry_count;  /* # of pages in p2m marked pod      */
-        unsigned         reclaim_super; /* Last gpfn of a scan */
-        unsigned         reclaim_single; /* Last gpfn of a scan */
-        unsigned         max_guest;    /* gpfn of max guest demand-populate */
+        unsigned long    reclaim_super; /* Last gpfn of a scan */
+        unsigned long    reclaim_single; /* Last gpfn of a scan */
+        unsigned long    max_guest;    /* gpfn of max guest demand-populate */
     } pod;
 };
 

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

From xen-changelog-bounces@lists.xen.org Thu Sep 20 17:22:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Sep 2012 17: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.xen.org>)
	id 1TEkSD-0007LJ-Hq; Thu, 20 Sep 2012 17:22:21 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEkSC-0007KF-8F
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:20 +0000
Received: from [85.158.143.99:4098] by server-1.bemta-4.messagelabs.com id
	AD/23-05684-BC05B505; Thu, 20 Sep 2012 17:22:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-216.messagelabs.com!1348161738!24149947!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4640 invoked from network); 20 Sep 2012 17:22:19 -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;
	20 Sep 2012 17: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 1TEkSA-0005pc-3m
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEkSA-0006CJ-2C
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:18 +0000
Message-Id: <E1TEkSA-0006CJ-2C@xenbits.xen.org>
Date: Thu, 20 Sep 2012 17:22:17 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86-64: refine the XSA-9 fix
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348131223 -7200
# Node ID 6162d01a51499009913119334fa6f061b5fea283
# Parent  4fc6e4f64024d1085ae397b38001d1194a5513be
x86-64: refine the XSA-9 fix

Our product management wasn't happy with the "solution" for XSA-9, and
demanded that customer systems must continue to boot. Rather than
having our and perhaps other distros carry non-trivial patches, allow
for more fine grained control (panic on boot, deny guest creation, or
merely warn) by means of a single line change.

Also, as this was found to be a problem with remotely managed systems,
don't default to boot denial (just deny guest creation).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25765:e6ca45ca03c2
xen-unstable date: Mon Aug 20 06:46:47 UTC 2012
---


diff -r 4fc6e4f64024 -r 6162d01a5149 xen/arch/x86/cpu/amd.c
--- a/xen/arch/x86/cpu/amd.c	Thu Sep 20 10:52:24 2012 +0200
+++ b/xen/arch/x86/cpu/amd.c	Thu Sep 20 10:53:43 2012 +0200
@@ -32,8 +32,11 @@
 static char opt_famrev[14];
 string_param("cpuid_mask_cpu", opt_famrev);
 
-static int opt_allow_unsafe;
+#ifdef __x86_64__
+/* 1 = allow, 0 = don't allow guest creation, -1 = don't allow boot */
+int __read_mostly opt_allow_unsafe;
 boolean_param("allow_unsafe", opt_allow_unsafe);
+#endif
 
 static inline void wrmsr_amd(unsigned int index, unsigned int lo, 
 		unsigned int hi)
@@ -623,10 +626,19 @@ static void __devinit init_amd(struct cp
 		clear_bit(X86_FEATURE_MCE, c->x86_capability);
 
 #ifdef __x86_64__
-	if (cpu_has_amd_erratum(c, AMD_ERRATUM_121) && !opt_allow_unsafe)
+	if (!cpu_has_amd_erratum(c, AMD_ERRATUM_121))
+		opt_allow_unsafe = 1;
+	else if (opt_allow_unsafe < 0)
 		panic("Xen will not boot on this CPU for security reasons.\n"
 		      "Pass \"allow_unsafe\" if you're trusting all your"
 		      " (PV) guest kernels.\n");
+	else if (!opt_allow_unsafe && c == &boot_cpu_data)
+		printk(KERN_WARNING
+		       "*** Xen will not allow creation of DomU-s on"
+		       " this CPU for security reasons. ***\n"
+		       KERN_WARNING
+		       "*** Pass \"allow_unsafe\" if you're trusting"
+		       " all your (PV) guest kernels. ***\n");
 
 	/* AMD CPUs do not support SYSENTER outside of legacy mode. */
 	clear_bit(X86_FEATURE_SEP, c->x86_capability);
diff -r 4fc6e4f64024 -r 6162d01a5149 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c	Thu Sep 20 10:52:24 2012 +0200
+++ b/xen/arch/x86/domain.c	Thu Sep 20 10:53:43 2012 +0200
@@ -52,6 +52,7 @@
 #include <asm/traps.h>
 #include <asm/nmi.h>
 #include <asm/mce.h>
+#include <asm/amd.h>
 #include <xen/numa.h>
 #include <xen/iommu.h>
 #ifdef CONFIG_COMPAT
@@ -457,6 +458,20 @@ int arch_domain_create(struct domain *d,
 
 #else /* __x86_64__ */
 
+    if ( d->domain_id && !is_idle_domain(d) &&
+         cpu_has_amd_erratum(&boot_cpu_data, AMD_ERRATUM_121) )
+    {
+        if ( !opt_allow_unsafe )
+        {
+            printk(XENLOG_G_ERR "Xen does not allow DomU creation on this CPU"
+                   " for security reasons.\n");
+            return -EPERM;
+        }
+        printk(XENLOG_G_WARNING
+               "Dom%d may compromise security on this CPU.\n",
+               d->domain_id);
+    }
+
     BUILD_BUG_ON(PDPT_L2_ENTRIES * sizeof(*d->arch.mm_perdomain_pt_pages)
                  != PAGE_SIZE);
     pg = alloc_domheap_page(NULL, MEMF_node(domain_to_node(d)));
diff -r 4fc6e4f64024 -r 6162d01a5149 xen/include/asm-x86/amd.h
--- a/xen/include/asm-x86/amd.h	Thu Sep 20 10:52:24 2012 +0200
+++ b/xen/include/asm-x86/amd.h	Thu Sep 20 10:53:43 2012 +0200
@@ -151,6 +151,8 @@ struct cpuinfo_x86;
 int cpu_has_amd_erratum(const struct cpuinfo_x86 *, int, ...);
 
 #ifdef __x86_64__
+extern int opt_allow_unsafe;
+
 void fam10h_check_enable_mmcfg(void);
 void check_enable_amd_mmconf_dmi(void);
 #endif

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

From xen-changelog-bounces@lists.xen.org Thu Sep 20 17:22:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Sep 2012 17: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.xen.org>)
	id 1TEkSC-0007Ky-FG; Thu, 20 Sep 2012 17:22:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEkSA-0007KF-Oi
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:18 +0000
Received: from [85.158.143.35:53499] by server-1.bemta-4.messagelabs.com id
	08/23-05684-9C05B505; Thu, 20 Sep 2012 17:22:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-21.messagelabs.com!1348161736!8145818!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16761 invoked from network); 20 Sep 2012 17:22:16 -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;
	20 Sep 2012 17:22: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 1TEkS7-0005pP-F0
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEkS7-0006BI-5z
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:15 +0000
Message-Id: <E1TEkS7-0006BI-5z@xenbits.xen.org>
Date: Thu, 20 Sep 2012 17:22:14 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86/PoD: clean up types
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348130957 -7200
# Node ID d7b754c813be89e00ea7422e07273762c979fdc0
# Parent  1588867f85c7464db815f3de76a8371b2184f27e
x86/PoD: clean up types

GMFN values must undoubtedly be "unsigned long". "count" and
"entry_count", since they are signed types, should also be "long" as
otherwise they can't fit all values that can fit into "d->tot_pages"
(which currently is "uint32_t").

Beyond that, the patch doesn't convert everything to "long" as in many
places it is clear that "int" suffices. In places where "long" is being
used partially already, the change is however being done.

Furthermore, page order values have no use of being "long".

Finally, in the course of updating a few printk messages anyway, some
also get slightly shortened (to focus on the relevant information).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
xen-unstable changeset: 25755:c887c30a0a35
xen-unstable date: Thu Aug 16 08:16:19 UTC 2012
---


diff -r 1588867f85c7 -r d7b754c813be xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Thu Sep 20 10:46:23 2012 +0200
+++ b/xen/arch/x86/mm/p2m.c	Thu Sep 20 10:49:17 2012 +0200
@@ -327,7 +327,7 @@ int set_p2m_entry(struct p2m_domain *p2m
 static int
 p2m_pod_cache_add(struct p2m_domain *p2m,
                   struct page_info *page,
-                  unsigned long order)
+                  unsigned int order)
 {
     int i;
     struct page_info *p;
@@ -341,7 +341,7 @@ p2m_pod_cache_add(struct p2m_domain *p2m
     /* Check to make sure this is a contiguous region */
     if( mfn_x(mfn) & ((1 << order) - 1) )
     {
-        printk("%s: mfn %lx not aligned order %lu! (mask %lx)\n",
+        printk("%s: mfn %lx not aligned order %u! (mask %lx)\n",
                __func__, mfn_x(mfn), order, ((1UL << order) - 1));
         return -1;
     }
@@ -413,7 +413,7 @@ p2m_pod_cache_add(struct p2m_domain *p2m
  * a superpage is requested and no superpages are available.  Must be called
  * with the d->page_lock held. */
 static struct page_info * p2m_pod_cache_get(struct p2m_domain *p2m,
-                                            unsigned long order)
+                                            unsigned int order)
 {
     struct page_info *p = NULL;
     int i;
@@ -495,7 +495,7 @@ p2m_pod_set_cache_target(struct p2m_doma
                 goto retry;
             }   
             
-            printk("%s: Unable to allocate domheap page for pod cache.  target %lu cachesize %d\n",
+            printk("%s: Unable to allocate page for PoD cache (target=%lu cache=%ld)\n",
                    __func__, pod_target, p2m->pod.count);
             ret = -ENOMEM;
             goto out;
@@ -604,10 +604,9 @@ out:
 int
 p2m_pod_set_mem_target(struct domain *d, unsigned long target)
 {
-    unsigned pod_target;
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
     int ret = 0;
-    unsigned long populated;
+    unsigned long populated, pod_target;
 
     p2m_lock(p2m);
 
@@ -884,7 +883,8 @@ out:
 void
 p2m_pod_dump_data(struct p2m_domain *p2m)
 {
-    printk("    PoD entries=%d cachesize=%d\n",
+
+    printk("    PoD entries=%ld cachesize=%ld\n",
            p2m->pod.entry_count, p2m->pod.count);
 }
 
@@ -1315,8 +1315,9 @@ p2m_pod_demand_populate(struct p2m_domai
 out_of_memory:
     spin_unlock(&d->page_alloc_lock);
 
-    printk("%s: Out of populate-on-demand memory! tot_pages %" PRIu32 " pod_entries %" PRIi32 "\n",
-           __func__, d->tot_pages, p2m->pod.entry_count);
+    printk("%s: Dom%d out of PoD memory! (tot=%"PRIu32" ents=%ld dom%d)\n",
+           __func__, d->domain_id, d->tot_pages, p2m->pod.entry_count,
+           current->domain->domain_id);
     domain_crash(d);
 out_fail:
     return -1;
@@ -2073,8 +2074,7 @@ static void audit_p2m(struct p2m_domain 
 {
     struct page_info *page;
     struct domain *od;
-    unsigned long mfn, gfn, m2pfn, lp2mfn = 0;
-    int entry_count = 0;
+    unsigned long mfn, gfn, m2pfn, lp2mfn = 0, entry_count = 0;
     mfn_t p2mfn;
     unsigned long orphans_d = 0, orphans_i = 0, mpbad = 0, pmbad = 0;
     int test_linear;
@@ -2313,7 +2313,7 @@ static void audit_p2m(struct p2m_domain 
 
     if ( entry_count != p2m->pod.entry_count )
     {
-        printk("%s: refcounted entry count %d, audit count %d!\n",
+        printk("%s: refcounted entry count %ld, audit count %lu!\n",
                __func__,
                p2m->pod.entry_count,
                entry_count);
@@ -2407,10 +2407,9 @@ guest_physmap_mark_populate_on_demand(st
                                       unsigned int order)
 {
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
-    unsigned long i;
+    unsigned long i, pod_count = 0;
     p2m_type_t ot;
     mfn_t omfn;
-    int pod_count = 0;
     int rc = 0;
 
     if ( !paging_mode_translate(d) )
diff -r 1588867f85c7 -r d7b754c813be xen/include/asm-x86/p2m.h
--- a/xen/include/asm-x86/p2m.h	Thu Sep 20 10:46:23 2012 +0200
+++ b/xen/include/asm-x86/p2m.h	Thu Sep 20 10:49:17 2012 +0200
@@ -255,11 +255,11 @@ struct p2m_domain {
     struct {
         struct page_list_head super,   /* List of superpages                */
                          single;       /* Non-super lists                   */
-        int              count,        /* # of pages in cache lists         */
+        long             count,        /* # of pages in cache lists         */
                          entry_count;  /* # of pages in p2m marked pod      */
-        unsigned         reclaim_super; /* Last gpfn of a scan */
-        unsigned         reclaim_single; /* Last gpfn of a scan */
-        unsigned         max_guest;    /* gpfn of max guest demand-populate */
+        unsigned long    reclaim_super; /* Last gpfn of a scan */
+        unsigned long    reclaim_single; /* Last gpfn of a scan */
+        unsigned long    max_guest;    /* gpfn of max guest demand-populate */
     } pod;
 };
 

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

From xen-changelog-bounces@lists.xen.org Thu Sep 20 17:22:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Sep 2012 17: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.xen.org>)
	id 1TEkSD-0007LJ-Hq; Thu, 20 Sep 2012 17:22:21 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEkSC-0007KF-8F
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:20 +0000
Received: from [85.158.143.99:4098] by server-1.bemta-4.messagelabs.com id
	AD/23-05684-BC05B505; Thu, 20 Sep 2012 17:22:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-216.messagelabs.com!1348161738!24149947!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4640 invoked from network); 20 Sep 2012 17:22:19 -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;
	20 Sep 2012 17: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 1TEkSA-0005pc-3m
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEkSA-0006CJ-2C
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:18 +0000
Message-Id: <E1TEkSA-0006CJ-2C@xenbits.xen.org>
Date: Thu, 20 Sep 2012 17:22:17 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86-64: refine the XSA-9 fix
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348131223 -7200
# Node ID 6162d01a51499009913119334fa6f061b5fea283
# Parent  4fc6e4f64024d1085ae397b38001d1194a5513be
x86-64: refine the XSA-9 fix

Our product management wasn't happy with the "solution" for XSA-9, and
demanded that customer systems must continue to boot. Rather than
having our and perhaps other distros carry non-trivial patches, allow
for more fine grained control (panic on boot, deny guest creation, or
merely warn) by means of a single line change.

Also, as this was found to be a problem with remotely managed systems,
don't default to boot denial (just deny guest creation).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25765:e6ca45ca03c2
xen-unstable date: Mon Aug 20 06:46:47 UTC 2012
---


diff -r 4fc6e4f64024 -r 6162d01a5149 xen/arch/x86/cpu/amd.c
--- a/xen/arch/x86/cpu/amd.c	Thu Sep 20 10:52:24 2012 +0200
+++ b/xen/arch/x86/cpu/amd.c	Thu Sep 20 10:53:43 2012 +0200
@@ -32,8 +32,11 @@
 static char opt_famrev[14];
 string_param("cpuid_mask_cpu", opt_famrev);
 
-static int opt_allow_unsafe;
+#ifdef __x86_64__
+/* 1 = allow, 0 = don't allow guest creation, -1 = don't allow boot */
+int __read_mostly opt_allow_unsafe;
 boolean_param("allow_unsafe", opt_allow_unsafe);
+#endif
 
 static inline void wrmsr_amd(unsigned int index, unsigned int lo, 
 		unsigned int hi)
@@ -623,10 +626,19 @@ static void __devinit init_amd(struct cp
 		clear_bit(X86_FEATURE_MCE, c->x86_capability);
 
 #ifdef __x86_64__
-	if (cpu_has_amd_erratum(c, AMD_ERRATUM_121) && !opt_allow_unsafe)
+	if (!cpu_has_amd_erratum(c, AMD_ERRATUM_121))
+		opt_allow_unsafe = 1;
+	else if (opt_allow_unsafe < 0)
 		panic("Xen will not boot on this CPU for security reasons.\n"
 		      "Pass \"allow_unsafe\" if you're trusting all your"
 		      " (PV) guest kernels.\n");
+	else if (!opt_allow_unsafe && c == &boot_cpu_data)
+		printk(KERN_WARNING
+		       "*** Xen will not allow creation of DomU-s on"
+		       " this CPU for security reasons. ***\n"
+		       KERN_WARNING
+		       "*** Pass \"allow_unsafe\" if you're trusting"
+		       " all your (PV) guest kernels. ***\n");
 
 	/* AMD CPUs do not support SYSENTER outside of legacy mode. */
 	clear_bit(X86_FEATURE_SEP, c->x86_capability);
diff -r 4fc6e4f64024 -r 6162d01a5149 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c	Thu Sep 20 10:52:24 2012 +0200
+++ b/xen/arch/x86/domain.c	Thu Sep 20 10:53:43 2012 +0200
@@ -52,6 +52,7 @@
 #include <asm/traps.h>
 #include <asm/nmi.h>
 #include <asm/mce.h>
+#include <asm/amd.h>
 #include <xen/numa.h>
 #include <xen/iommu.h>
 #ifdef CONFIG_COMPAT
@@ -457,6 +458,20 @@ int arch_domain_create(struct domain *d,
 
 #else /* __x86_64__ */
 
+    if ( d->domain_id && !is_idle_domain(d) &&
+         cpu_has_amd_erratum(&boot_cpu_data, AMD_ERRATUM_121) )
+    {
+        if ( !opt_allow_unsafe )
+        {
+            printk(XENLOG_G_ERR "Xen does not allow DomU creation on this CPU"
+                   " for security reasons.\n");
+            return -EPERM;
+        }
+        printk(XENLOG_G_WARNING
+               "Dom%d may compromise security on this CPU.\n",
+               d->domain_id);
+    }
+
     BUILD_BUG_ON(PDPT_L2_ENTRIES * sizeof(*d->arch.mm_perdomain_pt_pages)
                  != PAGE_SIZE);
     pg = alloc_domheap_page(NULL, MEMF_node(domain_to_node(d)));
diff -r 4fc6e4f64024 -r 6162d01a5149 xen/include/asm-x86/amd.h
--- a/xen/include/asm-x86/amd.h	Thu Sep 20 10:52:24 2012 +0200
+++ b/xen/include/asm-x86/amd.h	Thu Sep 20 10:53:43 2012 +0200
@@ -151,6 +151,8 @@ struct cpuinfo_x86;
 int cpu_has_amd_erratum(const struct cpuinfo_x86 *, int, ...);
 
 #ifdef __x86_64__
+extern int opt_allow_unsafe;
+
 void fam10h_check_enable_mmcfg(void);
 void check_enable_amd_mmconf_dmi(void);
 #endif

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

From xen-changelog-bounces@lists.xen.org Thu Sep 20 17:22:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Sep 2012 17: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.xen.org>)
	id 1TEkSD-0007LU-Ka; Thu, 20 Sep 2012 17:22:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEkSC-0007Kk-KN
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:20 +0000
Received: from [85.158.139.83:21488] by server-6.bemta-5.messagelabs.com id
	56/A1-21336-BC05B505; Thu, 20 Sep 2012 17:22:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-182.messagelabs.com!1348161738!28582530!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23200 invoked from network); 20 Sep 2012 17:22:19 -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;
	20 Sep 2012 17: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 1TEkS9-0005pZ-Rd
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEkS9-0006C4-3t
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:17 +0000
Message-Id: <E1TEkS9-0006C4-3t@xenbits.xen.org>
Date: Thu, 20 Sep 2012 17:22:16 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86: don't expose SYSENTER on
	unknown CPUs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348131144 -7200
# Node ID 4fc6e4f64024d1085ae397b38001d1194a5513be
# Parent  35bb0a4c9bc0b2481e34a3394fb914674a45f6e0
x86: don't expose SYSENTER on unknown CPUs

So far we only ever set up the respective MSRs on Intel CPUs, yet we
hide the feature only on a 32-bit hypervisor. That prevents booting of
PV guests on top of a 64-bit hypervisor making use of the instruction
on unknown CPUs (VIA in this case).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25764:4b0d263008cd
xen-unstable date: Mon Aug 20 06:40:01 UTC 2012
---


diff -r 35bb0a4c9bc0 -r 4fc6e4f64024 xen/arch/x86/cpu/common.c
--- a/xen/arch/x86/cpu/common.c	Thu Sep 20 10:51:30 2012 +0200
+++ b/xen/arch/x86/cpu/common.c	Thu Sep 20 10:52:24 2012 +0200
@@ -68,6 +68,7 @@ static void default_init(struct cpuinfo_
 		else if (c->x86 == 3)
 			safe_strcpy(c->x86_model_id, "386");
 	}
+        __clear_bit(X86_FEATURE_SEP, c->x86_capability);
 }
 
 static struct cpu_dev default_cpu = {

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

From xen-changelog-bounces@lists.xen.org Thu Sep 20 17:22:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Sep 2012 17: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.xen.org>)
	id 1TEkSD-0007LU-Ka; Thu, 20 Sep 2012 17:22:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEkSC-0007Kk-KN
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:20 +0000
Received: from [85.158.139.83:21488] by server-6.bemta-5.messagelabs.com id
	56/A1-21336-BC05B505; Thu, 20 Sep 2012 17:22:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-182.messagelabs.com!1348161738!28582530!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23200 invoked from network); 20 Sep 2012 17:22:19 -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;
	20 Sep 2012 17: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 1TEkS9-0005pZ-Rd
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEkS9-0006C4-3t
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:17 +0000
Message-Id: <E1TEkS9-0006C4-3t@xenbits.xen.org>
Date: Thu, 20 Sep 2012 17:22:16 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86: don't expose SYSENTER on
	unknown CPUs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348131144 -7200
# Node ID 4fc6e4f64024d1085ae397b38001d1194a5513be
# Parent  35bb0a4c9bc0b2481e34a3394fb914674a45f6e0
x86: don't expose SYSENTER on unknown CPUs

So far we only ever set up the respective MSRs on Intel CPUs, yet we
hide the feature only on a 32-bit hypervisor. That prevents booting of
PV guests on top of a 64-bit hypervisor making use of the instruction
on unknown CPUs (VIA in this case).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25764:4b0d263008cd
xen-unstable date: Mon Aug 20 06:40:01 UTC 2012
---


diff -r 35bb0a4c9bc0 -r 4fc6e4f64024 xen/arch/x86/cpu/common.c
--- a/xen/arch/x86/cpu/common.c	Thu Sep 20 10:51:30 2012 +0200
+++ b/xen/arch/x86/cpu/common.c	Thu Sep 20 10:52:24 2012 +0200
@@ -68,6 +68,7 @@ static void default_init(struct cpuinfo_
 		else if (c->x86 == 3)
 			safe_strcpy(c->x86_model_id, "386");
 	}
+        __clear_bit(X86_FEATURE_SEP, c->x86_capability);
 }
 
 static struct cpu_dev default_cpu = {

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

From xen-changelog-bounces@lists.xen.org Thu Sep 20 17:22:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Sep 2012 17:22:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TEkSF-0007NP-SH; Thu, 20 Sep 2012 17:22:23 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEkSE-0007Le-Cd
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:22 +0000
Received: from [85.158.139.83:65358] by server-9.bemta-5.messagelabs.com id
	66/72-20529-DC05B505; Thu, 20 Sep 2012 17:22:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-182.messagelabs.com!1348161740!26896838!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16151 invoked from network); 20 Sep 2012 17:22:21 -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;
	20 Sep 2012 17:22: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 1TEkSB-0005pl-TS
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEkSB-0006D5-S6
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:19 +0000
Message-Id: <E1TEkSB-0006D5-S6@xenbits.xen.org>
Date: Thu, 20 Sep 2012 17:22:19 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86: Prefer multiboot-provided
	e820 over bios-provided e801 memory info.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1348131664 -7200
# Node ID 6a17d5f11d66688be995c7ae5ed0f20d8ebe9cbf
# Parent  d9feedbcd750629966615801fb57c81bd6ad944a
x86: Prefer multiboot-provided e820 over bios-provided e801 memory info.

Some UEFI systems do not provide e820 information. In this case we
should take the detailed memory map provided by a multiboot-capable
loader, rather than rely on very conservative values from the e801
bios call. Using the latter on any modern system really hardly makes
good sense.

Signed-off-by: Keir Fraser <keir@xen.org>
Tested-by: Jonathan Tripathy <jonnyt@abpni.co.uk>
xen-unstable changeset: 25786:a0b5f8102a00
xen-unstable date: Tue Aug 28 21:40:45 UTC 2012
---


diff -r d9feedbcd750 -r 6a17d5f11d66 xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c	Thu Sep 20 10:59:17 2012 +0200
+++ b/xen/arch/x86/setup.c	Thu Sep 20 11:01:04 2012 +0200
@@ -665,17 +665,6 @@ void __init __start_xen(unsigned long mb
     {
         memmap_type = "Xen-e820";
     }
-    else if ( bootsym(lowmem_kb) )
-    {
-        memmap_type = "Xen-e801";
-        e820_raw[0].addr = 0;
-        e820_raw[0].size = bootsym(lowmem_kb) << 10;
-        e820_raw[0].type = E820_RAM;
-        e820_raw[1].addr = 0x100000;
-        e820_raw[1].size = bootsym(highmem_kb) << 10;
-        e820_raw[1].type = E820_RAM;
-        e820_raw_nr = 2;
-    }
     else if ( mbi->flags & MBI_MEMMAP )
     {
         memmap_type = "Multiboot-e820";
@@ -713,6 +702,17 @@ void __init __start_xen(unsigned long mb
             bytes += map->size + 4;
         }
     }
+    else if ( bootsym(lowmem_kb) )
+    {
+        memmap_type = "Xen-e801";
+        e820_raw[0].addr = 0;
+        e820_raw[0].size = bootsym(lowmem_kb) << 10;
+        e820_raw[0].type = E820_RAM;
+        e820_raw[1].addr = 0x100000;
+        e820_raw[1].size = bootsym(highmem_kb) << 10;
+        e820_raw[1].type = E820_RAM;
+        e820_raw_nr = 2;
+    }
     else if ( mbi->flags & MBI_MEMLIMITS )
     {
         memmap_type = "Multiboot-e801";

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

From xen-changelog-bounces@lists.xen.org Thu Sep 20 17:22:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Sep 2012 17:22:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TEkSF-0007NP-SH; Thu, 20 Sep 2012 17:22:23 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEkSE-0007Le-Cd
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:22 +0000
Received: from [85.158.139.83:65358] by server-9.bemta-5.messagelabs.com id
	66/72-20529-DC05B505; Thu, 20 Sep 2012 17:22:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-182.messagelabs.com!1348161740!26896838!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16151 invoked from network); 20 Sep 2012 17:22:21 -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;
	20 Sep 2012 17:22: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 1TEkSB-0005pl-TS
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEkSB-0006D5-S6
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:19 +0000
Message-Id: <E1TEkSB-0006D5-S6@xenbits.xen.org>
Date: Thu, 20 Sep 2012 17:22:19 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86: Prefer multiboot-provided
	e820 over bios-provided e801 memory info.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1348131664 -7200
# Node ID 6a17d5f11d66688be995c7ae5ed0f20d8ebe9cbf
# Parent  d9feedbcd750629966615801fb57c81bd6ad944a
x86: Prefer multiboot-provided e820 over bios-provided e801 memory info.

Some UEFI systems do not provide e820 information. In this case we
should take the detailed memory map provided by a multiboot-capable
loader, rather than rely on very conservative values from the e801
bios call. Using the latter on any modern system really hardly makes
good sense.

Signed-off-by: Keir Fraser <keir@xen.org>
Tested-by: Jonathan Tripathy <jonnyt@abpni.co.uk>
xen-unstable changeset: 25786:a0b5f8102a00
xen-unstable date: Tue Aug 28 21:40:45 UTC 2012
---


diff -r d9feedbcd750 -r 6a17d5f11d66 xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c	Thu Sep 20 10:59:17 2012 +0200
+++ b/xen/arch/x86/setup.c	Thu Sep 20 11:01:04 2012 +0200
@@ -665,17 +665,6 @@ void __init __start_xen(unsigned long mb
     {
         memmap_type = "Xen-e820";
     }
-    else if ( bootsym(lowmem_kb) )
-    {
-        memmap_type = "Xen-e801";
-        e820_raw[0].addr = 0;
-        e820_raw[0].size = bootsym(lowmem_kb) << 10;
-        e820_raw[0].type = E820_RAM;
-        e820_raw[1].addr = 0x100000;
-        e820_raw[1].size = bootsym(highmem_kb) << 10;
-        e820_raw[1].type = E820_RAM;
-        e820_raw_nr = 2;
-    }
     else if ( mbi->flags & MBI_MEMMAP )
     {
         memmap_type = "Multiboot-e820";
@@ -713,6 +702,17 @@ void __init __start_xen(unsigned long mb
             bytes += map->size + 4;
         }
     }
+    else if ( bootsym(lowmem_kb) )
+    {
+        memmap_type = "Xen-e801";
+        e820_raw[0].addr = 0;
+        e820_raw[0].size = bootsym(lowmem_kb) << 10;
+        e820_raw[0].type = E820_RAM;
+        e820_raw[1].addr = 0x100000;
+        e820_raw[1].size = bootsym(highmem_kb) << 10;
+        e820_raw[1].type = E820_RAM;
+        e820_raw_nr = 2;
+    }
     else if ( mbi->flags & MBI_MEMLIMITS )
     {
         memmap_type = "Multiboot-e801";

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

From xen-changelog-bounces@lists.xen.org Thu Sep 20 17:22:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Sep 2012 17:22:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TEkSE-0007Lv-PC; Thu, 20 Sep 2012 17:22:22 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEkSD-0007LD-CF
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:21 +0000
Received: from [85.158.143.99:52148] by server-2.bemta-4.messagelabs.com id
	BF/55-06610-CC05B505; Thu, 20 Sep 2012 17:22:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-216.messagelabs.com!1348161739!30250381!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13619 invoked from network); 20 Sep 2012 17:22:19 -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;
	20 Sep 2012 17: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 1TEkSA-0005pf-Re
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEkSA-0006Cb-KP
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:18 +0000
Message-Id: <E1TEkSA-0006Cb-KP@xenbits.xen.org>
Date: Thu, 20 Sep 2012 17:22:18 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] Fix shared entry status for grant
	copy operation on paged-out gfn
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1348131319 -7200
# Node ID 4210b36bfc416c27ed4d4313003a6278bdfdbb4a
# Parent  6162d01a51499009913119334fa6f061b5fea283
Fix shared entry status for grant copy operation on paged-out gfn

The unwind path was not clearing the shared entry status bits. This
was BSOD-ing guests on network activity under certain configurations.

Also:
 * sed the fixup method name to signal it's related to grant copy.
 * use atomic clear flag ops during fixup.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
xen-unstable changeset: 25771:1636cc4886f6
xen-unstable date: Wed Aug 22 21:27:50 UTC 2012
---


diff -r 6162d01a5149 -r 4210b36bfc41 xen/common/grant_table.c
--- a/xen/common/grant_table.c	Thu Sep 20 10:53:43 2012 +0200
+++ b/xen/common/grant_table.c	Thu Sep 20 10:55:19 2012 +0200
@@ -1707,14 +1707,14 @@ __release_grant_for_copy(
    under the domain's grant table lock. */
 /* Only safe on transitive grants.  Even then, note that we don't
    attempt to drop any pin on the referent grant. */
-static void __fixup_status_for_pin(const struct active_grant_entry *act,
+static void __fixup_status_for_copy_pin(const struct active_grant_entry *act,
                                    uint16_t *status)
 {
     if ( !(act->pin & GNTPIN_hstw_mask) )
-        *status &= ~GTF_writing;
+        gnttab_clear_flag(_GTF_writing, status);
 
     if ( !(act->pin & GNTPIN_hstr_mask) )
-        *status &= ~GTF_reading;
+        gnttab_clear_flag(_GTF_reading, status);
 }
 
 /* Grab a frame number from a grant entry and update the flags and pin
@@ -1794,7 +1794,7 @@ __acquire_grant_for_copy(
         if ( sha2 && (shah->flags & GTF_type_mask) == GTF_transitive )
         {
             if ( !allow_transitive )
-                PIN_FAIL(unlock_out, GNTST_general_error,
+                PIN_FAIL(unlock_out_clear, GNTST_general_error,
                          "transitive grant when transitivity not allowed\n");
 
             trans_domid = sha2->transitive.trans_domid;
@@ -1802,7 +1802,7 @@ __acquire_grant_for_copy(
             barrier(); /* Stop the compiler from re-loading
                           trans_domid from shared memory */
             if ( trans_domid == rd->domain_id )
-                PIN_FAIL(unlock_out, GNTST_general_error,
+                PIN_FAIL(unlock_out_clear, GNTST_general_error,
                          "transitive grants cannot be self-referential\n");
 
             /* We allow the trans_domid == ld->domain_id case, which
@@ -1814,7 +1814,7 @@ __acquire_grant_for_copy(
 
             rrd = rcu_lock_domain_by_id(trans_domid);
             if ( rrd == NULL )
-                PIN_FAIL(unlock_out, GNTST_general_error,
+                PIN_FAIL(unlock_out_clear, GNTST_general_error,
                          "transitive grant referenced bad domain %d\n",
                          trans_domid);
             spin_unlock(&rd->grant_table->lock);
@@ -1826,7 +1826,7 @@ __acquire_grant_for_copy(
 
             spin_lock(&rd->grant_table->lock);
             if ( rc != GNTST_okay ) {
-                __fixup_status_for_pin(act, status);
+                __fixup_status_for_copy_pin(act, status);
                 spin_unlock(&rd->grant_table->lock);
                 return rc;
             }
@@ -1837,7 +1837,7 @@ __acquire_grant_for_copy(
                and try again. */
             if ( act->pin != old_pin )
             {
-                __fixup_status_for_pin(act, status);
+                __fixup_status_for_copy_pin(act, status);
                 spin_unlock(&rd->grant_table->lock);
                 return __acquire_grant_for_copy(rd, gref, ld, readonly,
                                                 frame, page_off, length,
@@ -1857,7 +1857,7 @@ __acquire_grant_for_copy(
             gfn = sha1->frame;
             rc = __get_paged_frame(gfn, &grant_frame, readonly, rd);
             if ( rc != GNTST_okay )
-                goto unlock_out;
+                goto unlock_out_clear;
             act->gfn = gfn;
             is_sub_page = 0;
             trans_page_off = 0;
@@ -1869,7 +1869,7 @@ __acquire_grant_for_copy(
             gfn = sha2->full_page.frame;
             rc = __get_paged_frame(gfn, &grant_frame, readonly, rd);
             if ( rc != GNTST_okay )
-                goto unlock_out;
+                goto unlock_out_clear;
             act->gfn = gfn;
             is_sub_page = 0;
             trans_page_off = 0;
@@ -1881,7 +1881,7 @@ __acquire_grant_for_copy(
             gfn = sha2->sub_page.frame;
             rc = __get_paged_frame(gfn, &grant_frame, readonly, rd);
             if ( rc != GNTST_okay )
-                goto unlock_out;
+                goto unlock_out_clear;
             act->gfn = gfn;
             is_sub_page = 1;
             trans_page_off = sha2->sub_page.page_off;
@@ -1911,6 +1911,17 @@ __acquire_grant_for_copy(
     *length = act->length;
     *frame = act->frame;
 
+    spin_unlock(&rd->grant_table->lock);
+    return rc;
+
+ unlock_out_clear:
+    if ( !(readonly) &&
+         !(act->pin & GNTPIN_hstw_mask) )
+        gnttab_clear_flag(_GTF_writing, status);
+
+    if ( !act->pin )
+        gnttab_clear_flag(_GTF_reading, status);
+
  unlock_out:
     spin_unlock(&rd->grant_table->lock);
     return rc;

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

From xen-changelog-bounces@lists.xen.org Thu Sep 20 17:22:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Sep 2012 17:22:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TEkSE-0007Lv-PC; Thu, 20 Sep 2012 17:22:22 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEkSD-0007LD-CF
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:21 +0000
Received: from [85.158.143.99:52148] by server-2.bemta-4.messagelabs.com id
	BF/55-06610-CC05B505; Thu, 20 Sep 2012 17:22:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-216.messagelabs.com!1348161739!30250381!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13619 invoked from network); 20 Sep 2012 17:22:19 -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;
	20 Sep 2012 17: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 1TEkSA-0005pf-Re
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEkSA-0006Cb-KP
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:18 +0000
Message-Id: <E1TEkSA-0006Cb-KP@xenbits.xen.org>
Date: Thu, 20 Sep 2012 17:22:18 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] Fix shared entry status for grant
	copy operation on paged-out gfn
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1348131319 -7200
# Node ID 4210b36bfc416c27ed4d4313003a6278bdfdbb4a
# Parent  6162d01a51499009913119334fa6f061b5fea283
Fix shared entry status for grant copy operation on paged-out gfn

The unwind path was not clearing the shared entry status bits. This
was BSOD-ing guests on network activity under certain configurations.

Also:
 * sed the fixup method name to signal it's related to grant copy.
 * use atomic clear flag ops during fixup.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
xen-unstable changeset: 25771:1636cc4886f6
xen-unstable date: Wed Aug 22 21:27:50 UTC 2012
---


diff -r 6162d01a5149 -r 4210b36bfc41 xen/common/grant_table.c
--- a/xen/common/grant_table.c	Thu Sep 20 10:53:43 2012 +0200
+++ b/xen/common/grant_table.c	Thu Sep 20 10:55:19 2012 +0200
@@ -1707,14 +1707,14 @@ __release_grant_for_copy(
    under the domain's grant table lock. */
 /* Only safe on transitive grants.  Even then, note that we don't
    attempt to drop any pin on the referent grant. */
-static void __fixup_status_for_pin(const struct active_grant_entry *act,
+static void __fixup_status_for_copy_pin(const struct active_grant_entry *act,
                                    uint16_t *status)
 {
     if ( !(act->pin & GNTPIN_hstw_mask) )
-        *status &= ~GTF_writing;
+        gnttab_clear_flag(_GTF_writing, status);
 
     if ( !(act->pin & GNTPIN_hstr_mask) )
-        *status &= ~GTF_reading;
+        gnttab_clear_flag(_GTF_reading, status);
 }
 
 /* Grab a frame number from a grant entry and update the flags and pin
@@ -1794,7 +1794,7 @@ __acquire_grant_for_copy(
         if ( sha2 && (shah->flags & GTF_type_mask) == GTF_transitive )
         {
             if ( !allow_transitive )
-                PIN_FAIL(unlock_out, GNTST_general_error,
+                PIN_FAIL(unlock_out_clear, GNTST_general_error,
                          "transitive grant when transitivity not allowed\n");
 
             trans_domid = sha2->transitive.trans_domid;
@@ -1802,7 +1802,7 @@ __acquire_grant_for_copy(
             barrier(); /* Stop the compiler from re-loading
                           trans_domid from shared memory */
             if ( trans_domid == rd->domain_id )
-                PIN_FAIL(unlock_out, GNTST_general_error,
+                PIN_FAIL(unlock_out_clear, GNTST_general_error,
                          "transitive grants cannot be self-referential\n");
 
             /* We allow the trans_domid == ld->domain_id case, which
@@ -1814,7 +1814,7 @@ __acquire_grant_for_copy(
 
             rrd = rcu_lock_domain_by_id(trans_domid);
             if ( rrd == NULL )
-                PIN_FAIL(unlock_out, GNTST_general_error,
+                PIN_FAIL(unlock_out_clear, GNTST_general_error,
                          "transitive grant referenced bad domain %d\n",
                          trans_domid);
             spin_unlock(&rd->grant_table->lock);
@@ -1826,7 +1826,7 @@ __acquire_grant_for_copy(
 
             spin_lock(&rd->grant_table->lock);
             if ( rc != GNTST_okay ) {
-                __fixup_status_for_pin(act, status);
+                __fixup_status_for_copy_pin(act, status);
                 spin_unlock(&rd->grant_table->lock);
                 return rc;
             }
@@ -1837,7 +1837,7 @@ __acquire_grant_for_copy(
                and try again. */
             if ( act->pin != old_pin )
             {
-                __fixup_status_for_pin(act, status);
+                __fixup_status_for_copy_pin(act, status);
                 spin_unlock(&rd->grant_table->lock);
                 return __acquire_grant_for_copy(rd, gref, ld, readonly,
                                                 frame, page_off, length,
@@ -1857,7 +1857,7 @@ __acquire_grant_for_copy(
             gfn = sha1->frame;
             rc = __get_paged_frame(gfn, &grant_frame, readonly, rd);
             if ( rc != GNTST_okay )
-                goto unlock_out;
+                goto unlock_out_clear;
             act->gfn = gfn;
             is_sub_page = 0;
             trans_page_off = 0;
@@ -1869,7 +1869,7 @@ __acquire_grant_for_copy(
             gfn = sha2->full_page.frame;
             rc = __get_paged_frame(gfn, &grant_frame, readonly, rd);
             if ( rc != GNTST_okay )
-                goto unlock_out;
+                goto unlock_out_clear;
             act->gfn = gfn;
             is_sub_page = 0;
             trans_page_off = 0;
@@ -1881,7 +1881,7 @@ __acquire_grant_for_copy(
             gfn = sha2->sub_page.frame;
             rc = __get_paged_frame(gfn, &grant_frame, readonly, rd);
             if ( rc != GNTST_okay )
-                goto unlock_out;
+                goto unlock_out_clear;
             act->gfn = gfn;
             is_sub_page = 1;
             trans_page_off = sha2->sub_page.page_off;
@@ -1911,6 +1911,17 @@ __acquire_grant_for_copy(
     *length = act->length;
     *frame = act->frame;
 
+    spin_unlock(&rd->grant_table->lock);
+    return rc;
+
+ unlock_out_clear:
+    if ( !(readonly) &&
+         !(act->pin & GNTPIN_hstw_mask) )
+        gnttab_clear_flag(_GTF_writing, status);
+
+    if ( !act->pin )
+        gnttab_clear_flag(_GTF_reading, status);
+
  unlock_out:
     spin_unlock(&rd->grant_table->lock);
     return rc;

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

From xen-changelog-bounces@lists.xen.org Thu Sep 20 17:22:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Sep 2012 17: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.xen.org>)
	id 1TEkSG-0007O8-VR; Thu, 20 Sep 2012 17:22:24 +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 1TEkSF-0007LR-QW
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:23 +0000
Received: from [85.158.137.99:47966] by server-8.bemta-3.messagelabs.com id
	53/B6-24700-DC05B505; Thu, 20 Sep 2012 17:22:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-217.messagelabs.com!1348161739!16136954!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1769 invoked from network); 20 Sep 2012 17:22:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Sep 2012 17:22: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 1TEkSB-0005pi-CL
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEkSB-0006Cq-Aw
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:19 +0000
Message-Id: <E1TEkSB-0006Cq-Aw@xenbits.xen.org>
Date: Thu, 20 Sep 2012 17:22:18 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86,
	cmdline: Fix setting skip_realmode boolean on no-real-mode and
	tboot options
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1348131557 -7200
# Node ID d9feedbcd750629966615801fb57c81bd6ad944a
# Parent  4210b36bfc416c27ed4d4313003a6278bdfdbb4a
x86,cmdline: Fix setting skip_realmode boolean on no-real-mode and tboot options
...effect should be cumulative.

Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25773:b7e66cabb70f
xen-unstable date: Thu Aug 23 14:02:04 UTC 2012
---


diff -r 4210b36bfc41 -r d9feedbcd750 xen/arch/x86/boot/cmdline.S
--- a/xen/arch/x86/boot/cmdline.S	Thu Sep 20 10:55:19 2012 +0200
+++ b/xen/arch/x86/boot/cmdline.S	Thu Sep 20 10:59:17 2012 +0200
@@ -164,13 +164,15 @@ cmdline_parse_early:
         pushl   MB_cmdline(%ebx)
         call    .Lfind_option
         test    %eax,%eax
-        setnz   bootsym_phys(skip_realmode)
+        setnz   %al
+        or      %al,bootsym_phys(skip_realmode)
 
         /* Check for 'tboot=' command-line option. */
         movl    $sym_phys(.Ltboot_opt),4(%esp)
         call    .Lfind_option
         test    %eax,%eax
-        setnz   bootsym_phys(skip_realmode) /* tboot= implies no-real-mode */
+        setnz   %al
+        or      %al,bootsym_phys(skip_realmode) /* tboot= implies no-real-mode */
 
 .Lparse_edd:
         /* Check for 'edd=' command-line option. */

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

From xen-changelog-bounces@lists.xen.org Thu Sep 20 17:22:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Sep 2012 17: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.xen.org>)
	id 1TEkSG-0007O8-VR; Thu, 20 Sep 2012 17:22:24 +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 1TEkSF-0007LR-QW
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:23 +0000
Received: from [85.158.137.99:47966] by server-8.bemta-3.messagelabs.com id
	53/B6-24700-DC05B505; Thu, 20 Sep 2012 17:22:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-217.messagelabs.com!1348161739!16136954!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1769 invoked from network); 20 Sep 2012 17:22:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Sep 2012 17:22: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 1TEkSB-0005pi-CL
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEkSB-0006Cq-Aw
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:19 +0000
Message-Id: <E1TEkSB-0006Cq-Aw@xenbits.xen.org>
Date: Thu, 20 Sep 2012 17:22:18 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86,
	cmdline: Fix setting skip_realmode boolean on no-real-mode and
	tboot options
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1348131557 -7200
# Node ID d9feedbcd750629966615801fb57c81bd6ad944a
# Parent  4210b36bfc416c27ed4d4313003a6278bdfdbb4a
x86,cmdline: Fix setting skip_realmode boolean on no-real-mode and tboot options
...effect should be cumulative.

Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25773:b7e66cabb70f
xen-unstable date: Thu Aug 23 14:02:04 UTC 2012
---


diff -r 4210b36bfc41 -r d9feedbcd750 xen/arch/x86/boot/cmdline.S
--- a/xen/arch/x86/boot/cmdline.S	Thu Sep 20 10:55:19 2012 +0200
+++ b/xen/arch/x86/boot/cmdline.S	Thu Sep 20 10:59:17 2012 +0200
@@ -164,13 +164,15 @@ cmdline_parse_early:
         pushl   MB_cmdline(%ebx)
         call    .Lfind_option
         test    %eax,%eax
-        setnz   bootsym_phys(skip_realmode)
+        setnz   %al
+        or      %al,bootsym_phys(skip_realmode)
 
         /* Check for 'tboot=' command-line option. */
         movl    $sym_phys(.Ltboot_opt),4(%esp)
         call    .Lfind_option
         test    %eax,%eax
-        setnz   bootsym_phys(skip_realmode) /* tboot= implies no-real-mode */
+        setnz   %al
+        or      %al,bootsym_phys(skip_realmode) /* tboot= implies no-real-mode */
 
 .Lparse_edd:
         /* Check for 'edd=' command-line option. */

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

From xen-changelog-bounces@lists.xen.org Thu Sep 20 17:22:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Sep 2012 17:22:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TEkSI-0007P5-2S; Thu, 20 Sep 2012 17:22: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 1TEkSH-0007Ki-1x
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1348161737!11206422!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3594 invoked from network); 20 Sep 2012 17:22:18 -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;
	20 Sep 2012 17:22: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 1TEkS8-0005pW-QG
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEkS8-0006Bp-HJ
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:16 +0000
Message-Id: <E1TEkS8-0006Bp-HJ@xenbits.xen.org>
Date: Thu, 20 Sep 2012 17:22:16 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] EPT/PoD: fix interaction with 1Gb
	pages
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348131090 -7200
# Node ID 35bb0a4c9bc0b2481e34a3394fb914674a45f6e0
# Parent  337fe1dc46d77269f39f6c2a6babf47a032d535a
EPT/PoD: fix interaction with 1Gb pages

When PoD got enabled to support 1Gb pages, ept_get_entry() didn't get
updated to match - the assertion in there triggered, indicating that
the call to p2m_pod_demand_populate() needed adjustment.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Tim Deegan <tim@xen.org>
xen-unstable changeset: 25757:3468a834be8d
xen-unstable date: Thu Aug 16 16:38:05 UTC 2012
---


diff -r 337fe1dc46d7 -r 35bb0a4c9bc0 xen/arch/x86/mm/hap/p2m-ept.c
--- a/xen/arch/x86/mm/hap/p2m-ept.c	Thu Sep 20 10:50:39 2012 +0200
+++ b/xen/arch/x86/mm/hap/p2m-ept.c	Thu Sep 20 10:51:30 2012 +0200
@@ -542,13 +542,13 @@ static mfn_t ept_get_entry(struct p2m_do
             }
 
             /* Populate this superpage */
-            ASSERT(i == 1);
+            ASSERT(i <= 2);
 
             index = gfn_remainder >> ( i * EPT_TABLE_ORDER);
             ept_entry = table + index;
 
-            if ( !ept_pod_check_and_populate(p2m, gfn,
-                                             ept_entry, 9, q) )
+            if ( !ept_pod_check_and_populate(p2m, gfn, ept_entry,
+                                             i * EPT_TABLE_ORDER, q) )
                 goto retry;
             else
                 goto out;

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

From xen-changelog-bounces@lists.xen.org Thu Sep 20 17:22:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Sep 2012 17:22:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TEkSI-0007P5-2S; Thu, 20 Sep 2012 17:22: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 1TEkSH-0007Ki-1x
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1348161737!11206422!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3594 invoked from network); 20 Sep 2012 17:22:18 -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;
	20 Sep 2012 17:22: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 1TEkS8-0005pW-QG
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEkS8-0006Bp-HJ
	for xen-changelog@lists.xensource.com; Thu, 20 Sep 2012 17:22:16 +0000
Message-Id: <E1TEkS8-0006Bp-HJ@xenbits.xen.org>
Date: Thu, 20 Sep 2012 17:22:16 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] EPT/PoD: fix interaction with 1Gb
	pages
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348131090 -7200
# Node ID 35bb0a4c9bc0b2481e34a3394fb914674a45f6e0
# Parent  337fe1dc46d77269f39f6c2a6babf47a032d535a
EPT/PoD: fix interaction with 1Gb pages

When PoD got enabled to support 1Gb pages, ept_get_entry() didn't get
updated to match - the assertion in there triggered, indicating that
the call to p2m_pod_demand_populate() needed adjustment.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Tim Deegan <tim@xen.org>
xen-unstable changeset: 25757:3468a834be8d
xen-unstable date: Thu Aug 16 16:38:05 UTC 2012
---


diff -r 337fe1dc46d7 -r 35bb0a4c9bc0 xen/arch/x86/mm/hap/p2m-ept.c
--- a/xen/arch/x86/mm/hap/p2m-ept.c	Thu Sep 20 10:50:39 2012 +0200
+++ b/xen/arch/x86/mm/hap/p2m-ept.c	Thu Sep 20 10:51:30 2012 +0200
@@ -542,13 +542,13 @@ static mfn_t ept_get_entry(struct p2m_do
             }
 
             /* Populate this superpage */
-            ASSERT(i == 1);
+            ASSERT(i <= 2);
 
             index = gfn_remainder >> ( i * EPT_TABLE_ORDER);
             ept_entry = table + index;
 
-            if ( !ept_pod_check_and_populate(p2m, gfn,
-                                             ept_entry, 9, q) )
+            if ( !ept_pod_check_and_populate(p2m, gfn, ept_entry,
+                                             i * EPT_TABLE_ORDER, q) )
                 goto retry;
             else
                 goto out;

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

From xen-changelog-bounces@lists.xen.org Fri Sep 21 00:00:50 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Sep 2012 00:00:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TEqfm-0005Py-R6; Fri, 21 Sep 2012 00:00:46 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEqfm-0005PR-83
	for xen-changelog@lists.xensource.com; Fri, 21 Sep 2012 00:00:46 +0000
Received: from [85.158.143.35:35789] by server-2.bemta-4.messagelabs.com id
	EB/ED-06610-D2EAB505; Fri, 21 Sep 2012 00:00:45 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1348185642!7467679!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27769 invoked from network); 21 Sep 2012 00:00:43 -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;
	21 Sep 2012 00:00: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 1TEqfi-0002Kd-Ex
	for xen-changelog@lists.xensource.com; Fri, 21 Sep 2012 00:00:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEqfN-0007tl-JV
	for xen-changelog@lists.xensource.com; Fri, 21 Sep 2012 00:00:41 +0000
Message-Id: <E1TEqfN-0007tl-JV@xenbits.xen.org>
Date: Fri, 21 Sep 2012 00:00:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/IO-APIC: streamline level
	ack/end handling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348125630 -7200
# Node ID 4e93cbeac98b3e6be98e5ec0881b44b68ee95974
# Parent  fee83ac77d8c7339abf5185690603ea5b0c548cf
x86/IO-APIC: streamline level ack/end handling

Rather than evaluating "ioapic_ack_new" on each invocation, and
considering that the two methods really have almost no code in common,
split the handlers.

While at it, also move ioapic_ack_{new,forced} into .init.data
(eliminating the single non-__init reference to the former).

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


diff -r fee83ac77d8c -r 4e93cbeac98b xen/arch/x86/io_apic.c
--- a/xen/arch/x86/io_apic.c	Wed Sep 19 17:38:47 2012 +0200
+++ b/xen/arch/x86/io_apic.c	Thu Sep 20 09:20:30 2012 +0200
@@ -43,8 +43,8 @@ static struct { int pin, apic; } ioapic_
 static DEFINE_SPINLOCK(ioapic_lock);
 
 bool_t __read_mostly skip_ioapic_setup;
-bool_t __read_mostly ioapic_ack_new = 1;
-bool_t __read_mostly ioapic_ack_forced = 0;
+bool_t __initdata ioapic_ack_new = 1;
+bool_t __initdata ioapic_ack_forced = 0;
 
 /*
  * # of IRQ routing registers
@@ -918,7 +918,7 @@ static inline int IO_APIC_irq_trigger(in
     return 0;
 }
 
-static hw_irq_controller ioapic_level_type;
+static struct hw_interrupt_type ioapic_level_type;
 static hw_irq_controller ioapic_edge_type;
 
 #define IOAPIC_AUTO	-1
@@ -1605,9 +1605,6 @@ static void mask_and_ack_level_ioapic_ir
 
     irq_complete_move(desc);
 
-    if ( ioapic_ack_new )
-        return;
-
     if ( !directed_eoi_enabled )
         mask_IO_APIC_irq(desc);
 
@@ -1651,34 +1648,29 @@ static void mask_and_ack_level_ioapic_ir
     }
 }
 
-static void end_level_ioapic_irq(struct irq_desc *desc, u8 vector)
+static void end_level_ioapic_irq_old(struct irq_desc *desc, u8 vector)
 {
-    unsigned long v;
-    int i;
-
-    if ( !ioapic_ack_new )
+    if ( directed_eoi_enabled )
     {
-        if ( directed_eoi_enabled )
+        if ( !(desc->status & (IRQ_DISABLED|IRQ_MOVE_PENDING)) )
         {
-            if ( !(desc->status & (IRQ_DISABLED|IRQ_MOVE_PENDING)) )
-            {
-                eoi_IO_APIC_irq(desc);
-                return;
-            }
-
-            mask_IO_APIC_irq(desc);
             eoi_IO_APIC_irq(desc);
-            if ( (desc->status & IRQ_MOVE_PENDING) &&
-                 !io_apic_level_ack_pending(desc->irq) )
-                move_masked_irq(desc);
+            return;
         }
 
-        if ( !(desc->status & IRQ_DISABLED) )
-            unmask_IO_APIC_irq(desc);
-
-        return;
+        mask_IO_APIC_irq(desc);
+        eoi_IO_APIC_irq(desc);
+        if ( (desc->status & IRQ_MOVE_PENDING) &&
+             !io_apic_level_ack_pending(desc->irq) )
+            move_masked_irq(desc);
     }
 
+    if ( !(desc->status & IRQ_DISABLED) )
+        unmask_IO_APIC_irq(desc);
+}
+
+static void end_level_ioapic_irq_new(struct irq_desc *desc, u8 vector)
+{
 /*
  * It appears there is an erratum which affects at least version 0x11
  * of I/O APIC (that's the 82093AA and cores integrated into various
@@ -1698,7 +1690,7 @@ static void end_level_ioapic_irq(struct 
  * operation to prevent an edge-triggered interrupt escaping meanwhile.
  * The idea is from Manfred Spraul.  --macro
  */
-    i = desc->arch.vector;
+    unsigned int v, i = desc->arch.vector;
 
     /* Manually EOI the old vector if we are moving to the new */
     if ( vector && i != vector )
@@ -1741,14 +1733,14 @@ static hw_irq_controller ioapic_edge_typ
     .set_affinity 	= set_ioapic_affinity_irq,
 };
 
-static hw_irq_controller ioapic_level_type = {
+static struct hw_interrupt_type __read_mostly ioapic_level_type = {
     .typename 	= "IO-APIC-level",
     .startup 	= startup_level_ioapic_irq,
     .shutdown 	= mask_IO_APIC_irq,
     .enable 	= unmask_IO_APIC_irq,
     .disable 	= mask_IO_APIC_irq,
     .ack 		= mask_and_ack_level_ioapic_irq,
-    .end 		= end_level_ioapic_irq,
+    .end 		= end_level_ioapic_irq_old,
     .set_affinity 	= set_ioapic_affinity_irq,
 };
 
@@ -2006,6 +1998,11 @@ void __init setup_IO_APIC(void)
     printk("ENABLING IO-APIC IRQs\n");
     printk(" -> Using %s ACK method\n", ioapic_ack_new ? "new" : "old");
 
+    if (ioapic_ack_new) {
+        ioapic_level_type.ack = irq_complete_move;
+        ioapic_level_type.end = end_level_ioapic_irq_new;
+    }
+
     /*
      * Set up IO-APIC IRQ routing.
      */
diff -r fee83ac77d8c -r 4e93cbeac98b xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c	Wed Sep 19 17:38:47 2012 +0200
+++ b/xen/arch/x86/irq.c	Thu Sep 20 09:20:30 2012 +0200
@@ -1495,7 +1495,8 @@ static int pirq_acktype(struct domain *d
      * on which they were received. This is because we tickle the LAPIC to EOI.
      */
     if ( !strcmp(desc->handler->typename, "IO-APIC-level") )
-        return ioapic_ack_new ? ACKTYPE_EOI : ACKTYPE_UNMASK;
+        return desc->handler->ack == irq_complete_move ?
+               ACKTYPE_EOI : ACKTYPE_UNMASK;
 
     /* Legacy PIC interrupts can be acknowledged from any CPU. */
     if ( !strcmp(desc->handler->typename, "XT-PIC") )

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

From xen-changelog-bounces@lists.xen.org Fri Sep 21 00:00:50 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Sep 2012 00:00:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TEqfm-0005Py-R6; Fri, 21 Sep 2012 00:00:46 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEqfm-0005PR-83
	for xen-changelog@lists.xensource.com; Fri, 21 Sep 2012 00:00:46 +0000
Received: from [85.158.143.35:35789] by server-2.bemta-4.messagelabs.com id
	EB/ED-06610-D2EAB505; Fri, 21 Sep 2012 00:00:45 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1348185642!7467679!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27769 invoked from network); 21 Sep 2012 00:00:43 -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;
	21 Sep 2012 00:00: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 1TEqfi-0002Kd-Ex
	for xen-changelog@lists.xensource.com; Fri, 21 Sep 2012 00:00:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEqfN-0007tl-JV
	for xen-changelog@lists.xensource.com; Fri, 21 Sep 2012 00:00:41 +0000
Message-Id: <E1TEqfN-0007tl-JV@xenbits.xen.org>
Date: Fri, 21 Sep 2012 00:00:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/IO-APIC: streamline level
	ack/end handling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348125630 -7200
# Node ID 4e93cbeac98b3e6be98e5ec0881b44b68ee95974
# Parent  fee83ac77d8c7339abf5185690603ea5b0c548cf
x86/IO-APIC: streamline level ack/end handling

Rather than evaluating "ioapic_ack_new" on each invocation, and
considering that the two methods really have almost no code in common,
split the handlers.

While at it, also move ioapic_ack_{new,forced} into .init.data
(eliminating the single non-__init reference to the former).

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


diff -r fee83ac77d8c -r 4e93cbeac98b xen/arch/x86/io_apic.c
--- a/xen/arch/x86/io_apic.c	Wed Sep 19 17:38:47 2012 +0200
+++ b/xen/arch/x86/io_apic.c	Thu Sep 20 09:20:30 2012 +0200
@@ -43,8 +43,8 @@ static struct { int pin, apic; } ioapic_
 static DEFINE_SPINLOCK(ioapic_lock);
 
 bool_t __read_mostly skip_ioapic_setup;
-bool_t __read_mostly ioapic_ack_new = 1;
-bool_t __read_mostly ioapic_ack_forced = 0;
+bool_t __initdata ioapic_ack_new = 1;
+bool_t __initdata ioapic_ack_forced = 0;
 
 /*
  * # of IRQ routing registers
@@ -918,7 +918,7 @@ static inline int IO_APIC_irq_trigger(in
     return 0;
 }
 
-static hw_irq_controller ioapic_level_type;
+static struct hw_interrupt_type ioapic_level_type;
 static hw_irq_controller ioapic_edge_type;
 
 #define IOAPIC_AUTO	-1
@@ -1605,9 +1605,6 @@ static void mask_and_ack_level_ioapic_ir
 
     irq_complete_move(desc);
 
-    if ( ioapic_ack_new )
-        return;
-
     if ( !directed_eoi_enabled )
         mask_IO_APIC_irq(desc);
 
@@ -1651,34 +1648,29 @@ static void mask_and_ack_level_ioapic_ir
     }
 }
 
-static void end_level_ioapic_irq(struct irq_desc *desc, u8 vector)
+static void end_level_ioapic_irq_old(struct irq_desc *desc, u8 vector)
 {
-    unsigned long v;
-    int i;
-
-    if ( !ioapic_ack_new )
+    if ( directed_eoi_enabled )
     {
-        if ( directed_eoi_enabled )
+        if ( !(desc->status & (IRQ_DISABLED|IRQ_MOVE_PENDING)) )
         {
-            if ( !(desc->status & (IRQ_DISABLED|IRQ_MOVE_PENDING)) )
-            {
-                eoi_IO_APIC_irq(desc);
-                return;
-            }
-
-            mask_IO_APIC_irq(desc);
             eoi_IO_APIC_irq(desc);
-            if ( (desc->status & IRQ_MOVE_PENDING) &&
-                 !io_apic_level_ack_pending(desc->irq) )
-                move_masked_irq(desc);
+            return;
         }
 
-        if ( !(desc->status & IRQ_DISABLED) )
-            unmask_IO_APIC_irq(desc);
-
-        return;
+        mask_IO_APIC_irq(desc);
+        eoi_IO_APIC_irq(desc);
+        if ( (desc->status & IRQ_MOVE_PENDING) &&
+             !io_apic_level_ack_pending(desc->irq) )
+            move_masked_irq(desc);
     }
 
+    if ( !(desc->status & IRQ_DISABLED) )
+        unmask_IO_APIC_irq(desc);
+}
+
+static void end_level_ioapic_irq_new(struct irq_desc *desc, u8 vector)
+{
 /*
  * It appears there is an erratum which affects at least version 0x11
  * of I/O APIC (that's the 82093AA and cores integrated into various
@@ -1698,7 +1690,7 @@ static void end_level_ioapic_irq(struct 
  * operation to prevent an edge-triggered interrupt escaping meanwhile.
  * The idea is from Manfred Spraul.  --macro
  */
-    i = desc->arch.vector;
+    unsigned int v, i = desc->arch.vector;
 
     /* Manually EOI the old vector if we are moving to the new */
     if ( vector && i != vector )
@@ -1741,14 +1733,14 @@ static hw_irq_controller ioapic_edge_typ
     .set_affinity 	= set_ioapic_affinity_irq,
 };
 
-static hw_irq_controller ioapic_level_type = {
+static struct hw_interrupt_type __read_mostly ioapic_level_type = {
     .typename 	= "IO-APIC-level",
     .startup 	= startup_level_ioapic_irq,
     .shutdown 	= mask_IO_APIC_irq,
     .enable 	= unmask_IO_APIC_irq,
     .disable 	= mask_IO_APIC_irq,
     .ack 		= mask_and_ack_level_ioapic_irq,
-    .end 		= end_level_ioapic_irq,
+    .end 		= end_level_ioapic_irq_old,
     .set_affinity 	= set_ioapic_affinity_irq,
 };
 
@@ -2006,6 +1998,11 @@ void __init setup_IO_APIC(void)
     printk("ENABLING IO-APIC IRQs\n");
     printk(" -> Using %s ACK method\n", ioapic_ack_new ? "new" : "old");
 
+    if (ioapic_ack_new) {
+        ioapic_level_type.ack = irq_complete_move;
+        ioapic_level_type.end = end_level_ioapic_irq_new;
+    }
+
     /*
      * Set up IO-APIC IRQ routing.
      */
diff -r fee83ac77d8c -r 4e93cbeac98b xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c	Wed Sep 19 17:38:47 2012 +0200
+++ b/xen/arch/x86/irq.c	Thu Sep 20 09:20:30 2012 +0200
@@ -1495,7 +1495,8 @@ static int pirq_acktype(struct domain *d
      * on which they were received. This is because we tickle the LAPIC to EOI.
      */
     if ( !strcmp(desc->handler->typename, "IO-APIC-level") )
-        return ioapic_ack_new ? ACKTYPE_EOI : ACKTYPE_UNMASK;
+        return desc->handler->ack == irq_complete_move ?
+               ACKTYPE_EOI : ACKTYPE_UNMASK;
 
     /* Legacy PIC interrupts can be acknowledged from any CPU. */
     if ( !strcmp(desc->handler->typename, "XT-PIC") )

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

From xen-changelog-bounces@lists.xen.org Fri Sep 21 00:00:50 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Sep 2012 00:00:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TEqfm-0005Pl-Ln; Fri, 21 Sep 2012 00:00:46 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEqfl-0005PR-MW
	for xen-changelog@lists.xensource.com; Fri, 21 Sep 2012 00:00:45 +0000
Received: from [85.158.143.99:37617] by server-2.bemta-4.messagelabs.com id
	BB/ED-06610-D2EAB505; Fri, 21 Sep 2012 00:00:45 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1348185643!24767079!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31049 invoked from network); 21 Sep 2012 00:00:43 -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;
	21 Sep 2012 00:00: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 1TEqfi-0002Kg-Sc
	for xen-changelog@lists.xensource.com; Fri, 21 Sep 2012 00:00:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEqfi-0007xd-IB
	for xen-changelog@lists.xensource.com; Fri, 21 Sep 2012 00:00:42 +0000
Message-Id: <E1TEqfi-0007xd-IB@xenbits.xen.org>
Date: Fri, 21 Sep 2012 00:00:42 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: tighten checks in
	XEN_DOMCTL_memory_mapping handler
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348125713 -7200
# Node ID 14980591956954584f3cd87bf4e8d306360e7f27
# Parent  4e93cbeac98b3e6be98e5ec0881b44b68ee95974
x86: tighten checks in XEN_DOMCTL_memory_mapping handler

Properly checking the MFN implies knowing the physical address width
supported by the platform, so to obtain this consistently the
respective code gets moved out of the MTRR subdir.

Btw., the model specific workaround in that code is likely unnecessary
- I believe those CPU models don't support 64-bit mode. But I wasn't
able to formally verify this, so I preferred to retain that code for
now.

But domctl code here also was lacking other error checks (as was,
looking at it again from that angle) the XEN_DOMCTL_ioport_mapping one.
Besides adding the missing checks, printing is also added for the case
where revoking access permissions didn't work (as that may have
implications for the host operator, e.g. wanting to not pass through
affected devices to another guest until the one previously using them
did actually die).

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


diff -r 4e93cbeac98b -r 149805919569 xen/arch/x86/cpu/common.c
--- a/xen/arch/x86/cpu/common.c	Thu Sep 20 09:20:30 2012 +0200
+++ b/xen/arch/x86/cpu/common.c	Thu Sep 20 09:21:53 2012 +0200
@@ -36,6 +36,8 @@ integer_param("cpuid_mask_ext_edx", opt_
 
 struct cpu_dev * cpu_devs[X86_VENDOR_NUM] = {};
 
+unsigned int paddr_bits __read_mostly = 36;
+
 /*
  * Default host IA32_CR_PAT value to cover all memory types.
  * BIOS usually sets it to 0x07040600070406.
@@ -265,6 +267,8 @@ static void __cpuinit generic_identify(s
 		}
 		if ( xlvl >= 0x80000004 )
 			get_model_name(c); /* Default name */
+		if ( xlvl >= 0x80000008 )
+			paddr_bits = cpuid_eax(0x80000008) & 0xff;
 	}
 
 	/* Intel-defined flags: level 0x00000007 */
diff -r 4e93cbeac98b -r 149805919569 xen/arch/x86/cpu/intel.c
--- a/xen/arch/x86/cpu/intel.c	Thu Sep 20 09:20:30 2012 +0200
+++ b/xen/arch/x86/cpu/intel.c	Thu Sep 20 09:21:53 2012 +0200
@@ -144,6 +144,11 @@ void __devinit early_intel_workaround(st
 				       c->cpuid_level);
 		}
 	}
+
+	/* CPUID workaround for Intel 0F33/0F34 CPU */
+	if (boot_cpu_data.x86 == 0xF && boot_cpu_data.x86_model == 3 &&
+	    (boot_cpu_data.x86_mask == 3 || boot_cpu_data.x86_mask == 4))
+		paddr_bits = 36;
 }
 
 /*
diff -r 4e93cbeac98b -r 149805919569 xen/arch/x86/cpu/mtrr/main.c
--- a/xen/arch/x86/cpu/mtrr/main.c	Thu Sep 20 09:20:30 2012 +0200
+++ b/xen/arch/x86/cpu/mtrr/main.c	Thu Sep 20 09:21:53 2012 +0200
@@ -559,8 +559,6 @@ struct mtrr_value {
 	unsigned long	lsize;
 };
 
-unsigned int paddr_bits __read_mostly = 36;
-
 /**
  * mtrr_bp_init - initialize mtrrs on the boot CPU
  *
@@ -572,31 +570,8 @@ void __init mtrr_bp_init(void)
 {
 	if (cpu_has_mtrr) {
 		mtrr_if = &generic_mtrr_ops;
-		size_or_mask = 0xff000000;	/* 36 bits */
-		size_and_mask = 0x00f00000;
-
-		/* This is an AMD specific MSR, but we assume(hope?) that
-		   Intel will implement it to when they extend the address
-		   bus of the Xeon. */
-		if (cpuid_eax(0x80000000) >= 0x80000008) {
-			paddr_bits = cpuid_eax(0x80000008) & 0xff;
-			/* CPUID workaround for Intel 0F33/0F34 CPU */
-			if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
-			    boot_cpu_data.x86 == 0xF &&
-			    boot_cpu_data.x86_model == 0x3 &&
-			    (boot_cpu_data.x86_mask == 0x3 ||
-			     boot_cpu_data.x86_mask == 0x4))
-				paddr_bits = 36;
-
-			size_or_mask = ~((1ULL << (paddr_bits - PAGE_SHIFT)) - 1);
-			size_and_mask = ~size_or_mask & 0xfffff00000ULL;
-		} else if (boot_cpu_data.x86_vendor == X86_VENDOR_CENTAUR &&
-			   boot_cpu_data.x86 == 6) {
-			/* VIA C* family have Intel style MTRRs, but
-			   don't support PAE */
-			size_or_mask = 0xfff00000;	/* 32 bits */
-			size_and_mask = 0;
-		}
+		size_or_mask = ~((1ULL << (paddr_bits - PAGE_SHIFT)) - 1);
+		size_and_mask = ~size_or_mask & 0xfffff00000ULL;
 	}
 
 	if (mtrr_if) {
diff -r 4e93cbeac98b -r 149805919569 xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Thu Sep 20 09:20:30 2012 +0200
+++ b/xen/arch/x86/domctl.c	Thu Sep 20 09:21:53 2012 +0200
@@ -825,10 +825,12 @@ long arch_do_domctl(
         unsigned long mfn = domctl->u.memory_mapping.first_mfn;
         unsigned long nr_mfns = domctl->u.memory_mapping.nr_mfns;
         int add = domctl->u.memory_mapping.add_mapping;
-        int i;
+        unsigned long i;
 
         ret = -EINVAL;
-        if ( (mfn + nr_mfns - 1) < mfn ) /* wrap? */
+        if ( (mfn + nr_mfns - 1) < mfn || /* wrap? */
+             ((mfn | (mfn + nr_mfns - 1)) >> (paddr_bits - PAGE_SHIFT)) ||
+             (gfn + nr_mfns - 1) < gfn ) /* wrap? */
             break;
 
         ret = -EPERM;
@@ -853,8 +855,25 @@ long arch_do_domctl(
                    d->domain_id, gfn, mfn, nr_mfns);
 
             ret = iomem_permit_access(d, mfn, mfn + nr_mfns - 1);
-            for ( i = 0; i < nr_mfns; i++ )
-                set_mmio_p2m_entry(d, gfn+i, _mfn(mfn+i));
+            if ( !ret && paging_mode_translate(d) )
+            {
+                for ( i = 0; !ret && i < nr_mfns; i++ )
+                    if ( !set_mmio_p2m_entry(d, gfn + i, _mfn(mfn + i)) )
+                        ret = -EIO;
+                if ( ret )
+                {
+                    printk(XENLOG_G_WARNING
+                           "memory_map:fail: dom%d gfn=%lx mfn=%lx\n",
+                           d->domain_id, gfn + i, mfn + i);
+                    while ( i-- )
+                        clear_mmio_p2m_entry(d, gfn + i);
+                    if ( iomem_deny_access(d, mfn, mfn + nr_mfns - 1) &&
+                         IS_PRIV(current->domain) )
+                        printk(XENLOG_ERR
+                               "memory_map: failed to deny dom%d access to [%lx,%lx]\n",
+                               d->domain_id, mfn, mfn + nr_mfns - 1);
+                }
+            }
         }
         else
         {
@@ -862,9 +881,17 @@ long arch_do_domctl(
                    "memory_map:remove: dom%d gfn=%lx mfn=%lx nr=%lx\n",
                    d->domain_id, gfn, mfn, nr_mfns);
 
-            for ( i = 0; i < nr_mfns; i++ )
-                clear_mmio_p2m_entry(d, gfn+i);
+            if ( paging_mode_translate(d) )
+                for ( i = 0; i < nr_mfns; i++ )
+                    add |= !clear_mmio_p2m_entry(d, gfn + i);
             ret = iomem_deny_access(d, mfn, mfn + nr_mfns - 1);
+            if ( !ret && add )
+                ret = -EIO;
+            if ( ret && IS_PRIV(current->domain) )
+                printk(XENLOG_ERR
+                       "memory_map: error %ld %s dom%d access to [%lx,%lx]\n",
+                       ret, add ? "removing" : "denying", d->domain_id,
+                       mfn, mfn + nr_mfns - 1);
         }
 
         rcu_unlock_domain(d);
@@ -926,12 +953,23 @@ long arch_do_domctl(
             if ( !found )
             {
                 g2m_ioport = xmalloc(struct g2m_ioport);
+                if ( !g2m_ioport )
+                    ret = -ENOMEM;
+            }
+            if ( !found && !ret )
+            {
                 g2m_ioport->gport = fgp;
                 g2m_ioport->mport = fmp;
                 g2m_ioport->np = np;
                 list_add_tail(&g2m_ioport->list, &hd->g2m_ioport_list);
             }
-            ret = ioports_permit_access(d, fmp, fmp + np - 1);
+            if ( !ret )
+                ret = ioports_permit_access(d, fmp, fmp + np - 1);
+            if ( ret && !found && g2m_ioport )
+            {
+                list_del(&g2m_ioport->list);
+                xfree(g2m_ioport);
+            }
         }
         else
         {
@@ -946,6 +984,10 @@ long arch_do_domctl(
                     break;
                 }
             ret = ioports_deny_access(d, fmp, fmp + np - 1);
+            if ( ret && IS_PRIV(current->domain) )
+                printk(XENLOG_ERR
+                       "ioport_map: error %ld denying dom%d access to [%x,%x]\n",
+                       ret, d->domain_id, fmp, fmp + np - 1);
         }
         rcu_unlock_domain(d);
     }

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

From xen-changelog-bounces@lists.xen.org Fri Sep 21 00:00:50 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Sep 2012 00:00:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TEqfm-0005Pl-Ln; Fri, 21 Sep 2012 00:00:46 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEqfl-0005PR-MW
	for xen-changelog@lists.xensource.com; Fri, 21 Sep 2012 00:00:45 +0000
Received: from [85.158.143.99:37617] by server-2.bemta-4.messagelabs.com id
	BB/ED-06610-D2EAB505; Fri, 21 Sep 2012 00:00:45 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1348185643!24767079!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31049 invoked from network); 21 Sep 2012 00:00:43 -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;
	21 Sep 2012 00:00: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 1TEqfi-0002Kg-Sc
	for xen-changelog@lists.xensource.com; Fri, 21 Sep 2012 00:00:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEqfi-0007xd-IB
	for xen-changelog@lists.xensource.com; Fri, 21 Sep 2012 00:00:42 +0000
Message-Id: <E1TEqfi-0007xd-IB@xenbits.xen.org>
Date: Fri, 21 Sep 2012 00:00:42 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: tighten checks in
	XEN_DOMCTL_memory_mapping handler
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348125713 -7200
# Node ID 14980591956954584f3cd87bf4e8d306360e7f27
# Parent  4e93cbeac98b3e6be98e5ec0881b44b68ee95974
x86: tighten checks in XEN_DOMCTL_memory_mapping handler

Properly checking the MFN implies knowing the physical address width
supported by the platform, so to obtain this consistently the
respective code gets moved out of the MTRR subdir.

Btw., the model specific workaround in that code is likely unnecessary
- I believe those CPU models don't support 64-bit mode. But I wasn't
able to formally verify this, so I preferred to retain that code for
now.

But domctl code here also was lacking other error checks (as was,
looking at it again from that angle) the XEN_DOMCTL_ioport_mapping one.
Besides adding the missing checks, printing is also added for the case
where revoking access permissions didn't work (as that may have
implications for the host operator, e.g. wanting to not pass through
affected devices to another guest until the one previously using them
did actually die).

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


diff -r 4e93cbeac98b -r 149805919569 xen/arch/x86/cpu/common.c
--- a/xen/arch/x86/cpu/common.c	Thu Sep 20 09:20:30 2012 +0200
+++ b/xen/arch/x86/cpu/common.c	Thu Sep 20 09:21:53 2012 +0200
@@ -36,6 +36,8 @@ integer_param("cpuid_mask_ext_edx", opt_
 
 struct cpu_dev * cpu_devs[X86_VENDOR_NUM] = {};
 
+unsigned int paddr_bits __read_mostly = 36;
+
 /*
  * Default host IA32_CR_PAT value to cover all memory types.
  * BIOS usually sets it to 0x07040600070406.
@@ -265,6 +267,8 @@ static void __cpuinit generic_identify(s
 		}
 		if ( xlvl >= 0x80000004 )
 			get_model_name(c); /* Default name */
+		if ( xlvl >= 0x80000008 )
+			paddr_bits = cpuid_eax(0x80000008) & 0xff;
 	}
 
 	/* Intel-defined flags: level 0x00000007 */
diff -r 4e93cbeac98b -r 149805919569 xen/arch/x86/cpu/intel.c
--- a/xen/arch/x86/cpu/intel.c	Thu Sep 20 09:20:30 2012 +0200
+++ b/xen/arch/x86/cpu/intel.c	Thu Sep 20 09:21:53 2012 +0200
@@ -144,6 +144,11 @@ void __devinit early_intel_workaround(st
 				       c->cpuid_level);
 		}
 	}
+
+	/* CPUID workaround for Intel 0F33/0F34 CPU */
+	if (boot_cpu_data.x86 == 0xF && boot_cpu_data.x86_model == 3 &&
+	    (boot_cpu_data.x86_mask == 3 || boot_cpu_data.x86_mask == 4))
+		paddr_bits = 36;
 }
 
 /*
diff -r 4e93cbeac98b -r 149805919569 xen/arch/x86/cpu/mtrr/main.c
--- a/xen/arch/x86/cpu/mtrr/main.c	Thu Sep 20 09:20:30 2012 +0200
+++ b/xen/arch/x86/cpu/mtrr/main.c	Thu Sep 20 09:21:53 2012 +0200
@@ -559,8 +559,6 @@ struct mtrr_value {
 	unsigned long	lsize;
 };
 
-unsigned int paddr_bits __read_mostly = 36;
-
 /**
  * mtrr_bp_init - initialize mtrrs on the boot CPU
  *
@@ -572,31 +570,8 @@ void __init mtrr_bp_init(void)
 {
 	if (cpu_has_mtrr) {
 		mtrr_if = &generic_mtrr_ops;
-		size_or_mask = 0xff000000;	/* 36 bits */
-		size_and_mask = 0x00f00000;
-
-		/* This is an AMD specific MSR, but we assume(hope?) that
-		   Intel will implement it to when they extend the address
-		   bus of the Xeon. */
-		if (cpuid_eax(0x80000000) >= 0x80000008) {
-			paddr_bits = cpuid_eax(0x80000008) & 0xff;
-			/* CPUID workaround for Intel 0F33/0F34 CPU */
-			if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
-			    boot_cpu_data.x86 == 0xF &&
-			    boot_cpu_data.x86_model == 0x3 &&
-			    (boot_cpu_data.x86_mask == 0x3 ||
-			     boot_cpu_data.x86_mask == 0x4))
-				paddr_bits = 36;
-
-			size_or_mask = ~((1ULL << (paddr_bits - PAGE_SHIFT)) - 1);
-			size_and_mask = ~size_or_mask & 0xfffff00000ULL;
-		} else if (boot_cpu_data.x86_vendor == X86_VENDOR_CENTAUR &&
-			   boot_cpu_data.x86 == 6) {
-			/* VIA C* family have Intel style MTRRs, but
-			   don't support PAE */
-			size_or_mask = 0xfff00000;	/* 32 bits */
-			size_and_mask = 0;
-		}
+		size_or_mask = ~((1ULL << (paddr_bits - PAGE_SHIFT)) - 1);
+		size_and_mask = ~size_or_mask & 0xfffff00000ULL;
 	}
 
 	if (mtrr_if) {
diff -r 4e93cbeac98b -r 149805919569 xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Thu Sep 20 09:20:30 2012 +0200
+++ b/xen/arch/x86/domctl.c	Thu Sep 20 09:21:53 2012 +0200
@@ -825,10 +825,12 @@ long arch_do_domctl(
         unsigned long mfn = domctl->u.memory_mapping.first_mfn;
         unsigned long nr_mfns = domctl->u.memory_mapping.nr_mfns;
         int add = domctl->u.memory_mapping.add_mapping;
-        int i;
+        unsigned long i;
 
         ret = -EINVAL;
-        if ( (mfn + nr_mfns - 1) < mfn ) /* wrap? */
+        if ( (mfn + nr_mfns - 1) < mfn || /* wrap? */
+             ((mfn | (mfn + nr_mfns - 1)) >> (paddr_bits - PAGE_SHIFT)) ||
+             (gfn + nr_mfns - 1) < gfn ) /* wrap? */
             break;
 
         ret = -EPERM;
@@ -853,8 +855,25 @@ long arch_do_domctl(
                    d->domain_id, gfn, mfn, nr_mfns);
 
             ret = iomem_permit_access(d, mfn, mfn + nr_mfns - 1);
-            for ( i = 0; i < nr_mfns; i++ )
-                set_mmio_p2m_entry(d, gfn+i, _mfn(mfn+i));
+            if ( !ret && paging_mode_translate(d) )
+            {
+                for ( i = 0; !ret && i < nr_mfns; i++ )
+                    if ( !set_mmio_p2m_entry(d, gfn + i, _mfn(mfn + i)) )
+                        ret = -EIO;
+                if ( ret )
+                {
+                    printk(XENLOG_G_WARNING
+                           "memory_map:fail: dom%d gfn=%lx mfn=%lx\n",
+                           d->domain_id, gfn + i, mfn + i);
+                    while ( i-- )
+                        clear_mmio_p2m_entry(d, gfn + i);
+                    if ( iomem_deny_access(d, mfn, mfn + nr_mfns - 1) &&
+                         IS_PRIV(current->domain) )
+                        printk(XENLOG_ERR
+                               "memory_map: failed to deny dom%d access to [%lx,%lx]\n",
+                               d->domain_id, mfn, mfn + nr_mfns - 1);
+                }
+            }
         }
         else
         {
@@ -862,9 +881,17 @@ long arch_do_domctl(
                    "memory_map:remove: dom%d gfn=%lx mfn=%lx nr=%lx\n",
                    d->domain_id, gfn, mfn, nr_mfns);
 
-            for ( i = 0; i < nr_mfns; i++ )
-                clear_mmio_p2m_entry(d, gfn+i);
+            if ( paging_mode_translate(d) )
+                for ( i = 0; i < nr_mfns; i++ )
+                    add |= !clear_mmio_p2m_entry(d, gfn + i);
             ret = iomem_deny_access(d, mfn, mfn + nr_mfns - 1);
+            if ( !ret && add )
+                ret = -EIO;
+            if ( ret && IS_PRIV(current->domain) )
+                printk(XENLOG_ERR
+                       "memory_map: error %ld %s dom%d access to [%lx,%lx]\n",
+                       ret, add ? "removing" : "denying", d->domain_id,
+                       mfn, mfn + nr_mfns - 1);
         }
 
         rcu_unlock_domain(d);
@@ -926,12 +953,23 @@ long arch_do_domctl(
             if ( !found )
             {
                 g2m_ioport = xmalloc(struct g2m_ioport);
+                if ( !g2m_ioport )
+                    ret = -ENOMEM;
+            }
+            if ( !found && !ret )
+            {
                 g2m_ioport->gport = fgp;
                 g2m_ioport->mport = fmp;
                 g2m_ioport->np = np;
                 list_add_tail(&g2m_ioport->list, &hd->g2m_ioport_list);
             }
-            ret = ioports_permit_access(d, fmp, fmp + np - 1);
+            if ( !ret )
+                ret = ioports_permit_access(d, fmp, fmp + np - 1);
+            if ( ret && !found && g2m_ioport )
+            {
+                list_del(&g2m_ioport->list);
+                xfree(g2m_ioport);
+            }
         }
         else
         {
@@ -946,6 +984,10 @@ long arch_do_domctl(
                     break;
                 }
             ret = ioports_deny_access(d, fmp, fmp + np - 1);
+            if ( ret && IS_PRIV(current->domain) )
+                printk(XENLOG_ERR
+                       "ioport_map: error %ld denying dom%d access to [%x,%x]\n",
+                       ret, d->domain_id, fmp, fmp + np - 1);
         }
         rcu_unlock_domain(d);
     }

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

From xen-changelog-bounces@lists.xen.org Fri Sep 21 00:00:50 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Sep 2012 00:00:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TEqfm-0005Pt-OV; Fri, 21 Sep 2012 00:00:46 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEqfm-0005PU-7L
	for xen-changelog@lists.xensource.com; Fri, 21 Sep 2012 00:00:46 +0000
Received: from [85.158.139.83:64003] by server-16.bemta-5.messagelabs.com id
	AB/1A-11718-D2EAB505; Fri, 21 Sep 2012 00:00:45 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1348185643!29260008!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26153 invoked from network); 21 Sep 2012 00:00:44 -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;
	21 Sep 2012 00:00:44 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEqfj-0002Km-N6
	for xen-changelog@lists.xensource.com; Fri, 21 Sep 2012 00:00:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEqfj-0007y9-Ku
	for xen-changelog@lists.xensource.com; Fri, 21 Sep 2012 00:00:43 +0000
Message-Id: <E1TEqfj-0007y9-Ku@xenbits.xen.org>
Date: Fri, 21 Sep 2012 00:00:43 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] introduce guest_handle_for_field()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348140679 -7200
# Node ID d364becfb0835f69e85d273fe2b29035c2d975df
# Parent  06a0774df47cad34ad889767bd65bdf1722dd76a
introduce guest_handle_for_field()

This helper turns a field of a GUEST_HANDLE in a GUEST_HANDLE.

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


diff -r 06a0774df47c -r d364becfb083 xen/include/asm-x86/guest_access.h
--- a/xen/include/asm-x86/guest_access.h	Thu Sep 20 09:22:55 2012 +0200
+++ b/xen/include/asm-x86/guest_access.h	Thu Sep 20 13:31:19 2012 +0200
@@ -51,6 +51,9 @@
     (XEN_GUEST_HANDLE(type)) { _x };            \
 })
 
+#define guest_handle_for_field(hnd, type, fld)          \
+    ((XEN_GUEST_HANDLE(type)) { &(hnd).p->fld })
+
 #define guest_handle_from_ptr(ptr, type)        \
     ((XEN_GUEST_HANDLE(type)) { (type *)ptr })
 #define const_guest_handle_from_ptr(ptr, type)  \

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

From xen-changelog-bounces@lists.xen.org Fri Sep 21 00:00:50 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Sep 2012 00:00:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TEqfm-0005Pt-OV; Fri, 21 Sep 2012 00:00:46 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEqfm-0005PU-7L
	for xen-changelog@lists.xensource.com; Fri, 21 Sep 2012 00:00:46 +0000
Received: from [85.158.139.83:64003] by server-16.bemta-5.messagelabs.com id
	AB/1A-11718-D2EAB505; Fri, 21 Sep 2012 00:00:45 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1348185643!29260008!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26153 invoked from network); 21 Sep 2012 00:00:44 -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;
	21 Sep 2012 00:00:44 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEqfj-0002Km-N6
	for xen-changelog@lists.xensource.com; Fri, 21 Sep 2012 00:00:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEqfj-0007y9-Ku
	for xen-changelog@lists.xensource.com; Fri, 21 Sep 2012 00:00:43 +0000
Message-Id: <E1TEqfj-0007y9-Ku@xenbits.xen.org>
Date: Fri, 21 Sep 2012 00:00:43 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] introduce guest_handle_for_field()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348140679 -7200
# Node ID d364becfb0835f69e85d273fe2b29035c2d975df
# Parent  06a0774df47cad34ad889767bd65bdf1722dd76a
introduce guest_handle_for_field()

This helper turns a field of a GUEST_HANDLE in a GUEST_HANDLE.

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


diff -r 06a0774df47c -r d364becfb083 xen/include/asm-x86/guest_access.h
--- a/xen/include/asm-x86/guest_access.h	Thu Sep 20 09:22:55 2012 +0200
+++ b/xen/include/asm-x86/guest_access.h	Thu Sep 20 13:31:19 2012 +0200
@@ -51,6 +51,9 @@
     (XEN_GUEST_HANDLE(type)) { _x };            \
 })
 
+#define guest_handle_for_field(hnd, type, fld)          \
+    ((XEN_GUEST_HANDLE(type)) { &(hnd).p->fld })
+
 #define guest_handle_from_ptr(ptr, type)        \
     ((XEN_GUEST_HANDLE(type)) { (type *)ptr })
 #define const_guest_handle_from_ptr(ptr, type)  \

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

From xen-changelog-bounces@lists.xen.org Fri Sep 21 00:00:56 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Sep 2012 00:00:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TEqfs-0005Ra-Vs; Fri, 21 Sep 2012 00:00:52 +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 1TEqfr-0005Pa-Eu
	for xen-changelog@lists.xensource.com; Fri, 21 Sep 2012 00:00:51 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-27.messagelabs.com!1348185643!9847004!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4934 invoked from network); 21 Sep 2012 00:00:44 -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;
	21 Sep 2012 00:00:44 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEqfj-0002Kj-Cj
	for xen-changelog@lists.xensource.com; Fri, 21 Sep 2012 00:00:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEqfj-0007xu-3j
	for xen-changelog@lists.xensource.com; Fri, 21 Sep 2012 00:00:43 +0000
Message-Id: <E1TEqfj-0007xu-3j@xenbits.xen.org>
Date: Fri, 21 Sep 2012 00:00:42 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] ACPI: move tables.c fully into
	.init.*
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348125775 -7200
# Node ID 06a0774df47cad34ad889767bd65bdf1722dd76a
# Parent  14980591956954584f3cd87bf4e8d306360e7f27
ACPI: move tables.c fully into .init.*

The only non-init item was the space reserved for the initial tables,
but we can as well dynamically allocate that array.

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


diff -r 149805919569 -r 06a0774df47c xen/drivers/acpi/Makefile
--- a/xen/drivers/acpi/Makefile	Thu Sep 20 09:21:53 2012 +0200
+++ b/xen/drivers/acpi/Makefile	Thu Sep 20 09:22:55 2012 +0200
@@ -2,7 +2,7 @@ subdir-y += tables
 subdir-y += utilities
 subdir-$(x86) += apei
 
-obj-y += tables.o
+obj-bin-y += tables.init.o
 obj-y += numa.o
 obj-y += osl.o
 obj-y += pmstat.o
diff -r 149805919569 -r 06a0774df47c xen/drivers/acpi/osl.c
--- a/xen/drivers/acpi/osl.c	Thu Sep 20 09:21:53 2012 +0200
+++ b/xen/drivers/acpi/osl.c	Thu Sep 20 09:22:55 2012 +0200
@@ -27,6 +27,7 @@
 #include <asm/io.h>
 #include <xen/config.h>
 #include <xen/init.h>
+#include <xen/pfn.h>
 #include <xen/types.h>
 #include <xen/errno.h>
 #include <xen/acpi.h>
@@ -182,3 +183,38 @@ acpi_os_write_memory(acpi_physical_addre
 
 	return AE_OK;
 }
+
+#define is_xmalloc_memory(ptr) ((unsigned long)(ptr) & (PAGE_SIZE - 1))
+
+void *__init acpi_os_alloc_memory(size_t sz)
+{
+	void *ptr;
+
+	if (system_state == SYS_STATE_early_boot)
+		return mfn_to_virt(alloc_boot_pages(PFN_UP(sz), 1));
+
+	ptr = xmalloc_bytes(sz);
+	ASSERT(!ptr || is_xmalloc_memory(ptr));
+	return ptr;
+}
+
+void *__init acpi_os_zalloc_memory(size_t sz)
+{
+	void *ptr;
+
+	if (system_state != SYS_STATE_early_boot) {
+		ptr = xzalloc_bytes(sz);
+		ASSERT(!ptr || is_xmalloc_memory(ptr));
+		return ptr;
+	}
+	ptr = acpi_os_alloc_memory(sz);
+	return ptr ? memset(ptr, 0, sz) : NULL;
+}
+
+void __init acpi_os_free_memory(void *ptr)
+{
+	if (is_xmalloc_memory(ptr))
+		xfree(ptr);
+	else if (ptr && system_state == SYS_STATE_early_boot)
+		init_boot_pages(__pa(ptr), __pa(ptr) + PAGE_SIZE);
+}
diff -r 149805919569 -r 06a0774df47c xen/drivers/acpi/tables.c
--- a/xen/drivers/acpi/tables.c	Thu Sep 20 09:21:53 2012 +0200
+++ b/xen/drivers/acpi/tables.c	Thu Sep 20 09:22:55 2012 +0200
@@ -41,8 +41,6 @@ mps_inti_flags_polarity[] = { "dfl", "hi
 static const char *__initdata
 mps_inti_flags_trigger[] = { "dfl", "edge", "res", "level" };
 
-static struct acpi_table_desc initial_tables[ACPI_MAX_TABLES];
-
 static int acpi_apic_instance __initdata;
 
 void __init acpi_table_print_madt_entry(struct acpi_subtable_header *header)
@@ -324,7 +322,7 @@ static void __init check_multiple_madt(v
 
 int __init acpi_table_init(void)
 {
-	acpi_initialize_tables(initial_tables, ACPI_MAX_TABLES, 0);
+	acpi_initialize_tables(NULL, ACPI_MAX_TABLES, 0);
 	check_multiple_madt();
 	return 0;
 }
diff -r 149805919569 -r 06a0774df47c xen/include/acpi/platform/aclinux.h
--- a/xen/include/acpi/platform/aclinux.h	Thu Sep 20 09:21:53 2012 +0200
+++ b/xen/include/acpi/platform/aclinux.h	Thu Sep 20 09:22:55 2012 +0200
@@ -76,8 +76,12 @@
 
 #define acpi_thread_id struct vcpu *
 
-#define ACPI_ALLOCATE(a)	xmalloc_bytes(a)
-#define ACPI_ALLOCATE_ZEROED(a)	xzalloc_bytes(a)
-#define ACPI_FREE(a)		xfree(a)
+void *acpi_os_alloc_memory(size_t);
+void *acpi_os_zalloc_memory(size_t);
+void acpi_os_free_memory(void *);
+
+#define ACPI_ALLOCATE(a)	acpi_os_alloc_memory(a)
+#define ACPI_ALLOCATE_ZEROED(a)	acpi_os_zalloc_memory(a)
+#define ACPI_FREE(a)		acpi_os_free_memory(a)
 
 #endif				/* __ACLINUX_H__ */

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

From xen-changelog-bounces@lists.xen.org Fri Sep 21 00:00:56 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Sep 2012 00:00:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TEqfs-0005Ra-Vs; Fri, 21 Sep 2012 00:00:52 +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 1TEqfr-0005Pa-Eu
	for xen-changelog@lists.xensource.com; Fri, 21 Sep 2012 00:00:51 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-27.messagelabs.com!1348185643!9847004!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4934 invoked from network); 21 Sep 2012 00:00:44 -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;
	21 Sep 2012 00:00:44 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEqfj-0002Kj-Cj
	for xen-changelog@lists.xensource.com; Fri, 21 Sep 2012 00:00:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TEqfj-0007xu-3j
	for xen-changelog@lists.xensource.com; Fri, 21 Sep 2012 00:00:43 +0000
Message-Id: <E1TEqfj-0007xu-3j@xenbits.xen.org>
Date: Fri, 21 Sep 2012 00:00:42 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] ACPI: move tables.c fully into
	.init.*
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348125775 -7200
# Node ID 06a0774df47cad34ad889767bd65bdf1722dd76a
# Parent  14980591956954584f3cd87bf4e8d306360e7f27
ACPI: move tables.c fully into .init.*

The only non-init item was the space reserved for the initial tables,
but we can as well dynamically allocate that array.

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


diff -r 149805919569 -r 06a0774df47c xen/drivers/acpi/Makefile
--- a/xen/drivers/acpi/Makefile	Thu Sep 20 09:21:53 2012 +0200
+++ b/xen/drivers/acpi/Makefile	Thu Sep 20 09:22:55 2012 +0200
@@ -2,7 +2,7 @@ subdir-y += tables
 subdir-y += utilities
 subdir-$(x86) += apei
 
-obj-y += tables.o
+obj-bin-y += tables.init.o
 obj-y += numa.o
 obj-y += osl.o
 obj-y += pmstat.o
diff -r 149805919569 -r 06a0774df47c xen/drivers/acpi/osl.c
--- a/xen/drivers/acpi/osl.c	Thu Sep 20 09:21:53 2012 +0200
+++ b/xen/drivers/acpi/osl.c	Thu Sep 20 09:22:55 2012 +0200
@@ -27,6 +27,7 @@
 #include <asm/io.h>
 #include <xen/config.h>
 #include <xen/init.h>
+#include <xen/pfn.h>
 #include <xen/types.h>
 #include <xen/errno.h>
 #include <xen/acpi.h>
@@ -182,3 +183,38 @@ acpi_os_write_memory(acpi_physical_addre
 
 	return AE_OK;
 }
+
+#define is_xmalloc_memory(ptr) ((unsigned long)(ptr) & (PAGE_SIZE - 1))
+
+void *__init acpi_os_alloc_memory(size_t sz)
+{
+	void *ptr;
+
+	if (system_state == SYS_STATE_early_boot)
+		return mfn_to_virt(alloc_boot_pages(PFN_UP(sz), 1));
+
+	ptr = xmalloc_bytes(sz);
+	ASSERT(!ptr || is_xmalloc_memory(ptr));
+	return ptr;
+}
+
+void *__init acpi_os_zalloc_memory(size_t sz)
+{
+	void *ptr;
+
+	if (system_state != SYS_STATE_early_boot) {
+		ptr = xzalloc_bytes(sz);
+		ASSERT(!ptr || is_xmalloc_memory(ptr));
+		return ptr;
+	}
+	ptr = acpi_os_alloc_memory(sz);
+	return ptr ? memset(ptr, 0, sz) : NULL;
+}
+
+void __init acpi_os_free_memory(void *ptr)
+{
+	if (is_xmalloc_memory(ptr))
+		xfree(ptr);
+	else if (ptr && system_state == SYS_STATE_early_boot)
+		init_boot_pages(__pa(ptr), __pa(ptr) + PAGE_SIZE);
+}
diff -r 149805919569 -r 06a0774df47c xen/drivers/acpi/tables.c
--- a/xen/drivers/acpi/tables.c	Thu Sep 20 09:21:53 2012 +0200
+++ b/xen/drivers/acpi/tables.c	Thu Sep 20 09:22:55 2012 +0200
@@ -41,8 +41,6 @@ mps_inti_flags_polarity[] = { "dfl", "hi
 static const char *__initdata
 mps_inti_flags_trigger[] = { "dfl", "edge", "res", "level" };
 
-static struct acpi_table_desc initial_tables[ACPI_MAX_TABLES];
-
 static int acpi_apic_instance __initdata;
 
 void __init acpi_table_print_madt_entry(struct acpi_subtable_header *header)
@@ -324,7 +322,7 @@ static void __init check_multiple_madt(v
 
 int __init acpi_table_init(void)
 {
-	acpi_initialize_tables(initial_tables, ACPI_MAX_TABLES, 0);
+	acpi_initialize_tables(NULL, ACPI_MAX_TABLES, 0);
 	check_multiple_madt();
 	return 0;
 }
diff -r 149805919569 -r 06a0774df47c xen/include/acpi/platform/aclinux.h
--- a/xen/include/acpi/platform/aclinux.h	Thu Sep 20 09:21:53 2012 +0200
+++ b/xen/include/acpi/platform/aclinux.h	Thu Sep 20 09:22:55 2012 +0200
@@ -76,8 +76,12 @@
 
 #define acpi_thread_id struct vcpu *
 
-#define ACPI_ALLOCATE(a)	xmalloc_bytes(a)
-#define ACPI_ALLOCATE_ZEROED(a)	xzalloc_bytes(a)
-#define ACPI_FREE(a)		xfree(a)
+void *acpi_os_alloc_memory(size_t);
+void *acpi_os_zalloc_memory(size_t);
+void acpi_os_free_memory(void *);
+
+#define ACPI_ALLOCATE(a)	acpi_os_alloc_memory(a)
+#define ACPI_ALLOCATE_ZEROED(a)	acpi_os_zalloc_memory(a)
+#define ACPI_FREE(a)		acpi_os_free_memory(a)
 
 #endif				/* __ACLINUX_H__ */

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

From xen-changelog-bounces@lists.xen.org Mon Sep 24 15:44:10 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Sep 2012 15:44:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGApL-0007G1-Lt; Mon, 24 Sep 2012 15:44:07 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGApL-0007Fw-0i
	for xen-changelog@lists.xensource.com; Mon, 24 Sep 2012 15:44:07 +0000
Received: from [85.158.139.211:61906] by server-13.bemta-5.messagelabs.com id
	6F/4C-16359-6CF70605; Mon, 24 Sep 2012 15:44:06 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-206.messagelabs.com!1348501444!19780522!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20959 invoked from network); 24 Sep 2012 15:44:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	24 Sep 2012 15: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 1TGApI-0007Zo-2N
	for xen-changelog@lists.xensource.com; Mon, 24 Sep 2012 15:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGApH-0005rB-N2
	for xen-changelog@lists.xensource.com; Mon, 24 Sep 2012 15:44:03 +0000
Message-Id: <E1TGApH-0005rB-N2@xenbits.xen.org>
Date: Mon, 24 Sep 2012 15: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] frontends: handle backend CLOSED
	without CLOSING
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User David Vrabel <david.vrabel@citrix.com>
# Date 1348500969 -7200
# Node ID e09f03f312e52f421e7cf39f81515adb445b5159
# Parent  341104e962db9697186669899917bc3c8ed59525
frontends: handle backend CLOSED without CLOSING

Backend drivers shouldn't transistion to CLOSED unless the frontend is
CLOSED.  If a backend does transition to CLOSED too soon then the
frontend may not see the CLOSING state and will not properly shutdown.

So, treat an unexpected backend CLOSED state the same as CLOSING.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Extended to scsifront and usbfront.

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


diff -r 341104e962db -r e09f03f312e5 drivers/xen/blkfront/blkfront.c
--- a/drivers/xen/blkfront/blkfront.c	Mon Sep 03 15:18:54 2012 +0200
+++ b/drivers/xen/blkfront/blkfront.c	Mon Sep 24 17:36:09 2012 +0200
@@ -277,13 +277,16 @@ static void backend_changed(struct xenbu
 	case XenbusStateReconfiguring:
 	case XenbusStateReconfigured:
 	case XenbusStateUnknown:
-	case XenbusStateClosed:
 		break;
 
 	case XenbusStateConnected:
 		connect(info);
 		break;
 
+	case XenbusStateClosed:
+		if (dev->state == XenbusStateClosed)
+			break;
+		/* Missed the backend's Closing state -- fallthrough */
 	case XenbusStateClosing:
 		bd = bdget(info->dev);
 		if (bd == NULL) {
diff -r 341104e962db -r e09f03f312e5 drivers/xen/fbfront/xenfb.c
--- a/drivers/xen/fbfront/xenfb.c	Mon Sep 03 15:18:54 2012 +0200
+++ b/drivers/xen/fbfront/xenfb.c	Mon Sep 24 17:36:09 2012 +0200
@@ -806,7 +806,6 @@ static void xenfb_backend_changed(struct
 	case XenbusStateReconfiguring:
 	case XenbusStateReconfigured:
 	case XenbusStateUnknown:
-	case XenbusStateClosed:
 		break;
 
 	case XenbusStateInitWait:
@@ -844,6 +843,10 @@ static void xenfb_backend_changed(struct
 		}
 		break;
 
+	case XenbusStateClosed:
+		if (dev->state == XenbusStateClosed)
+			break;
+		/* Missed the backend's CLOSING state -- fallthrough */
 	case XenbusStateClosing:
 		// FIXME is this safe in any dev->state?
 		xenbus_frontend_closed(dev);
diff -r 341104e962db -r e09f03f312e5 drivers/xen/fbfront/xenkbd.c
--- a/drivers/xen/fbfront/xenkbd.c	Mon Sep 03 15:18:54 2012 +0200
+++ b/drivers/xen/fbfront/xenkbd.c	Mon Sep 24 17:36:09 2012 +0200
@@ -285,7 +285,6 @@ static void xenkbd_backend_changed(struc
 	case XenbusStateReconfiguring:
 	case XenbusStateReconfigured:
 	case XenbusStateUnknown:
-	case XenbusStateClosed:
 		break;
 
 	case XenbusStateInitWait:
@@ -323,6 +322,10 @@ static void xenkbd_backend_changed(struc
 
 		break;
 
+	case XenbusStateClosed:
+		if (dev->state == XenbusStateClosed)
+			break;
+		/* Missed the backend's CLOSING state -- fallthrough */
 	case XenbusStateClosing:
 		xenbus_frontend_closed(dev);
 		break;
diff -r 341104e962db -r e09f03f312e5 drivers/xen/netfront/netfront.c
--- a/drivers/xen/netfront/netfront.c	Mon Sep 03 15:18:54 2012 +0200
+++ b/drivers/xen/netfront/netfront.c	Mon Sep 24 17:36:09 2012 +0200
@@ -542,7 +542,6 @@ static void backend_changed(struct xenbu
 	case XenbusStateReconfiguring:
 	case XenbusStateReconfigured:
 	case XenbusStateUnknown:
-	case XenbusStateClosed:
 		break;
 
 	case XenbusStateInitWait:
@@ -557,6 +556,10 @@ static void backend_changed(struct xenbu
 		send_fake_arp(netdev);
 		break;
 
+	case XenbusStateClosed:
+		if (dev->state == XenbusStateClosed)
+			break;
+		/* Missed the backend's CLOSING state -- fallthrough */
 	case XenbusStateClosing:
 		xenbus_frontend_closed(dev);
 		break;
diff -r 341104e962db -r e09f03f312e5 drivers/xen/pcifront/xenbus.c
--- a/drivers/xen/pcifront/xenbus.c	Mon Sep 03 15:18:54 2012 +0200
+++ b/drivers/xen/pcifront/xenbus.c	Mon Sep 24 17:36:09 2012 +0200
@@ -404,13 +404,16 @@ static void __init_refok pcifront_backen
 	case XenbusStateInitialising:
 	case XenbusStateInitWait:
 	case XenbusStateInitialised:
-	case XenbusStateClosed:
 		break;
 
 	case XenbusStateConnected:
 		pcifront_try_connect(pdev);
 		break;
 
+	case XenbusStateClosed:
+		if (xdev->state == XenbusStateClosed)
+			break;
+		/* Missed the backend's CLOSING state -- fallthrough */
 	case XenbusStateClosing:
 		dev_warn(&xdev->dev, "backend going away!\n");
 		pcifront_try_disconnect(pdev);
diff -r 341104e962db -r e09f03f312e5 drivers/xen/scsifront/xenbus.c
--- a/drivers/xen/scsifront/xenbus.c	Mon Sep 03 15:18:54 2012 +0200
+++ b/drivers/xen/scsifront/xenbus.c	Mon Sep 24 17:36:09 2012 +0200
@@ -363,9 +363,6 @@ static void scsifront_backend_changed(st
 	case XenbusStateUnknown:
 	case XenbusStateInitialising:
 	case XenbusStateInitWait:
-	case XenbusStateClosed:
-		break;
-
 	case XenbusStateInitialised:
 		break;
 
@@ -381,6 +378,10 @@ static void scsifront_backend_changed(st
 		xenbus_switch_state(dev, XenbusStateConnected);
 		break;
 
+	case XenbusStateClosed:
+		if (dev->state == XenbusStateClosed)
+			break;
+		/* Missed the backend's Closing state -- fallthrough */
 	case XenbusStateClosing:
 		scsifront_disconnect(info);
 		break;
diff -r 341104e962db -r e09f03f312e5 drivers/xen/usbfront/xenbus.c
--- a/drivers/xen/usbfront/xenbus.c	Mon Sep 03 15:18:54 2012 +0200
+++ b/drivers/xen/usbfront/xenbus.c	Mon Sep 24 17:36:09 2012 +0200
@@ -339,7 +339,6 @@ static void backend_changed(struct xenbu
 	case XenbusStateReconfiguring:
 	case XenbusStateReconfigured:
 	case XenbusStateUnknown:
-	case XenbusStateClosed:
 		break;
 
 	case XenbusStateInitWait:
@@ -349,6 +348,10 @@ static void backend_changed(struct xenbu
 			xenbus_switch_state(dev, XenbusStateConnected);
 		break;
 
+	case XenbusStateClosed:
+		if (dev->state == XenbusStateClosed)
+			break;
+		/* Missed the backend's Closing state -- fallthrough */
 	case XenbusStateClosing:
 		usbfront_disconnect(dev);
 		break;

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

From xen-changelog-bounces@lists.xen.org Mon Sep 24 15:44:10 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Sep 2012 15:44:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGApL-0007G1-Lt; Mon, 24 Sep 2012 15:44:07 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGApL-0007Fw-0i
	for xen-changelog@lists.xensource.com; Mon, 24 Sep 2012 15:44:07 +0000
Received: from [85.158.139.211:61906] by server-13.bemta-5.messagelabs.com id
	6F/4C-16359-6CF70605; Mon, 24 Sep 2012 15:44:06 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-206.messagelabs.com!1348501444!19780522!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20959 invoked from network); 24 Sep 2012 15:44:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	24 Sep 2012 15: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 1TGApI-0007Zo-2N
	for xen-changelog@lists.xensource.com; Mon, 24 Sep 2012 15:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGApH-0005rB-N2
	for xen-changelog@lists.xensource.com; Mon, 24 Sep 2012 15:44:03 +0000
Message-Id: <E1TGApH-0005rB-N2@xenbits.xen.org>
Date: Mon, 24 Sep 2012 15: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] frontends: handle backend CLOSED
	without CLOSING
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User David Vrabel <david.vrabel@citrix.com>
# Date 1348500969 -7200
# Node ID e09f03f312e52f421e7cf39f81515adb445b5159
# Parent  341104e962db9697186669899917bc3c8ed59525
frontends: handle backend CLOSED without CLOSING

Backend drivers shouldn't transistion to CLOSED unless the frontend is
CLOSED.  If a backend does transition to CLOSED too soon then the
frontend may not see the CLOSING state and will not properly shutdown.

So, treat an unexpected backend CLOSED state the same as CLOSING.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Extended to scsifront and usbfront.

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


diff -r 341104e962db -r e09f03f312e5 drivers/xen/blkfront/blkfront.c
--- a/drivers/xen/blkfront/blkfront.c	Mon Sep 03 15:18:54 2012 +0200
+++ b/drivers/xen/blkfront/blkfront.c	Mon Sep 24 17:36:09 2012 +0200
@@ -277,13 +277,16 @@ static void backend_changed(struct xenbu
 	case XenbusStateReconfiguring:
 	case XenbusStateReconfigured:
 	case XenbusStateUnknown:
-	case XenbusStateClosed:
 		break;
 
 	case XenbusStateConnected:
 		connect(info);
 		break;
 
+	case XenbusStateClosed:
+		if (dev->state == XenbusStateClosed)
+			break;
+		/* Missed the backend's Closing state -- fallthrough */
 	case XenbusStateClosing:
 		bd = bdget(info->dev);
 		if (bd == NULL) {
diff -r 341104e962db -r e09f03f312e5 drivers/xen/fbfront/xenfb.c
--- a/drivers/xen/fbfront/xenfb.c	Mon Sep 03 15:18:54 2012 +0200
+++ b/drivers/xen/fbfront/xenfb.c	Mon Sep 24 17:36:09 2012 +0200
@@ -806,7 +806,6 @@ static void xenfb_backend_changed(struct
 	case XenbusStateReconfiguring:
 	case XenbusStateReconfigured:
 	case XenbusStateUnknown:
-	case XenbusStateClosed:
 		break;
 
 	case XenbusStateInitWait:
@@ -844,6 +843,10 @@ static void xenfb_backend_changed(struct
 		}
 		break;
 
+	case XenbusStateClosed:
+		if (dev->state == XenbusStateClosed)
+			break;
+		/* Missed the backend's CLOSING state -- fallthrough */
 	case XenbusStateClosing:
 		// FIXME is this safe in any dev->state?
 		xenbus_frontend_closed(dev);
diff -r 341104e962db -r e09f03f312e5 drivers/xen/fbfront/xenkbd.c
--- a/drivers/xen/fbfront/xenkbd.c	Mon Sep 03 15:18:54 2012 +0200
+++ b/drivers/xen/fbfront/xenkbd.c	Mon Sep 24 17:36:09 2012 +0200
@@ -285,7 +285,6 @@ static void xenkbd_backend_changed(struc
 	case XenbusStateReconfiguring:
 	case XenbusStateReconfigured:
 	case XenbusStateUnknown:
-	case XenbusStateClosed:
 		break;
 
 	case XenbusStateInitWait:
@@ -323,6 +322,10 @@ static void xenkbd_backend_changed(struc
 
 		break;
 
+	case XenbusStateClosed:
+		if (dev->state == XenbusStateClosed)
+			break;
+		/* Missed the backend's CLOSING state -- fallthrough */
 	case XenbusStateClosing:
 		xenbus_frontend_closed(dev);
 		break;
diff -r 341104e962db -r e09f03f312e5 drivers/xen/netfront/netfront.c
--- a/drivers/xen/netfront/netfront.c	Mon Sep 03 15:18:54 2012 +0200
+++ b/drivers/xen/netfront/netfront.c	Mon Sep 24 17:36:09 2012 +0200
@@ -542,7 +542,6 @@ static void backend_changed(struct xenbu
 	case XenbusStateReconfiguring:
 	case XenbusStateReconfigured:
 	case XenbusStateUnknown:
-	case XenbusStateClosed:
 		break;
 
 	case XenbusStateInitWait:
@@ -557,6 +556,10 @@ static void backend_changed(struct xenbu
 		send_fake_arp(netdev);
 		break;
 
+	case XenbusStateClosed:
+		if (dev->state == XenbusStateClosed)
+			break;
+		/* Missed the backend's CLOSING state -- fallthrough */
 	case XenbusStateClosing:
 		xenbus_frontend_closed(dev);
 		break;
diff -r 341104e962db -r e09f03f312e5 drivers/xen/pcifront/xenbus.c
--- a/drivers/xen/pcifront/xenbus.c	Mon Sep 03 15:18:54 2012 +0200
+++ b/drivers/xen/pcifront/xenbus.c	Mon Sep 24 17:36:09 2012 +0200
@@ -404,13 +404,16 @@ static void __init_refok pcifront_backen
 	case XenbusStateInitialising:
 	case XenbusStateInitWait:
 	case XenbusStateInitialised:
-	case XenbusStateClosed:
 		break;
 
 	case XenbusStateConnected:
 		pcifront_try_connect(pdev);
 		break;
 
+	case XenbusStateClosed:
+		if (xdev->state == XenbusStateClosed)
+			break;
+		/* Missed the backend's CLOSING state -- fallthrough */
 	case XenbusStateClosing:
 		dev_warn(&xdev->dev, "backend going away!\n");
 		pcifront_try_disconnect(pdev);
diff -r 341104e962db -r e09f03f312e5 drivers/xen/scsifront/xenbus.c
--- a/drivers/xen/scsifront/xenbus.c	Mon Sep 03 15:18:54 2012 +0200
+++ b/drivers/xen/scsifront/xenbus.c	Mon Sep 24 17:36:09 2012 +0200
@@ -363,9 +363,6 @@ static void scsifront_backend_changed(st
 	case XenbusStateUnknown:
 	case XenbusStateInitialising:
 	case XenbusStateInitWait:
-	case XenbusStateClosed:
-		break;
-
 	case XenbusStateInitialised:
 		break;
 
@@ -381,6 +378,10 @@ static void scsifront_backend_changed(st
 		xenbus_switch_state(dev, XenbusStateConnected);
 		break;
 
+	case XenbusStateClosed:
+		if (dev->state == XenbusStateClosed)
+			break;
+		/* Missed the backend's Closing state -- fallthrough */
 	case XenbusStateClosing:
 		scsifront_disconnect(info);
 		break;
diff -r 341104e962db -r e09f03f312e5 drivers/xen/usbfront/xenbus.c
--- a/drivers/xen/usbfront/xenbus.c	Mon Sep 03 15:18:54 2012 +0200
+++ b/drivers/xen/usbfront/xenbus.c	Mon Sep 24 17:36:09 2012 +0200
@@ -339,7 +339,6 @@ static void backend_changed(struct xenbu
 	case XenbusStateReconfiguring:
 	case XenbusStateReconfigured:
 	case XenbusStateUnknown:
-	case XenbusStateClosed:
 		break;
 
 	case XenbusStateInitWait:
@@ -349,6 +348,10 @@ static void backend_changed(struct xenbu
 			xenbus_switch_state(dev, XenbusStateConnected);
 		break;
 
+	case XenbusStateClosed:
+		if (dev->state == XenbusStateClosed)
+			break;
+		/* Missed the backend's Closing state -- fallthrough */
 	case XenbusStateClosing:
 		usbfront_disconnect(dev);
 		break;

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

From xen-changelog-bounces@lists.xen.org Tue Sep 25 09:55:13 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Sep 2012 09:55:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGRrC-0002cX-8A; Tue, 25 Sep 2012 09:55:10 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGRrB-0002cM-2N
	for xen-changelog@lists.xensource.com; Tue, 25 Sep 2012 09:55:09 +0000
Received: from [85.158.143.99:38640] by server-3.bemta-4.messagelabs.com id
	FA/98-10986-C7F71605; Tue, 25 Sep 2012 09:55:08 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-216.messagelabs.com!1348566905!22064143!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13040 invoked from network); 25 Sep 2012 09:55:07 -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 Sep 2012 09:55: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 1TGRr7-0004W0-Mc
	for xen-changelog@lists.xensource.com; Tue, 25 Sep 2012 09:55:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGRr7-00010t-F5
	for xen-changelog@lists.xensource.com; Tue, 25 Sep 2012 09:55:05 +0000
Message-Id: <E1TGRr7-00010t-F5@xenbits.xen.org>
Date: Tue, 25 Sep 2012 09:55: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] pciback: improve input validation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348566584 -7200
# Node ID 50245ed8527a266e614a233102b0994fc86f0151
# Parent  2e2f50c02c3c1b95c41f2e27b40b59b54fd246f2
pciback: improve input validation

Reject - where this is not already being done elsewhere - out of range
values originating from user mode. This goes as far as reasonably
possible considering the non-conformance of the in-kernel sscanf().

At the same time, relax quirk parsing so that 0x prefixes get tolerated
without unnecessarily limiting the range of values (in some cases using
the prefix would make parsing outright fail no matter what value was
intended to be specified) for the (future) case where the in-kernel
sscanf() properly honors field width specifications even for integer
conversions.

Plus, to match parsing of standalone PCI device specifications, allow a
second form of input not having a domain specified (implying domain 0).

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


diff -r 2e2f50c02c3c -r 50245ed8527a drivers/xen/pciback/pci_stub.c
--- a/drivers/xen/pciback/pci_stub.c	Tue Sep 25 11:48:19 2012 +0200
+++ b/drivers/xen/pciback/pci_stub.c	Tue Sep 25 11:49:44 2012 +0200
@@ -121,7 +121,8 @@ static struct pcistub_device *pcistub_de
 		if (psdev->dev != NULL
 		    && domain == pci_domain_nr(psdev->dev->bus)
 		    && bus == psdev->dev->bus->number
-		    && PCI_DEVFN(slot, func) == psdev->dev->devfn) {
+		    && slot == PCI_SLOT(psdev->dev->devfn)
+		    && func == PCI_FUNC(psdev->dev->devfn)) {
 			pcistub_device_get(psdev);
 			goto out;
 		}
@@ -170,7 +171,8 @@ struct pci_dev *pcistub_get_pci_dev_by_s
 		if (psdev->dev != NULL
 		    && domain == pci_domain_nr(psdev->dev->bus)
 		    && bus == psdev->dev->bus->number
-		    && PCI_DEVFN(slot, func) == psdev->dev->devfn) {
+		    && slot == PCI_SLOT(psdev->dev->devfn)
+		    && func == PCI_FUNC(psdev->dev->devfn)) {
 			found_dev = pcistub_device_get_pci_dev(pdev, psdev);
 			break;
 		}
@@ -906,11 +908,18 @@ static inline int str_to_quirk(const cha
 {
 	int err;
 
-	err =
-	    sscanf(buf, " %04x:%02x:%02x.%1x-%08x:%1x:%08x", domain, bus, slot,
-		   func, reg, size, mask);
+	err = sscanf(buf, " %x:%x:%x.%x-%x:%x:%x", domain, bus, slot, func,
+		     reg, size, mask);
 	if (err == 7)
 		return 0;
+
+	/* try again without domain */
+	*domain = 0;
+	err = sscanf(buf, " %x:%x.%x-%x:%x:%x", bus, slot, func, reg, size,
+		     mask);
+	if (err == 6)
+		return 0;
+
 	return -EINVAL;
 }
 
@@ -918,7 +927,7 @@ static int pcistub_device_id_add(int dom
 {
 	struct pcistub_device_id *pci_dev_id;
 	unsigned long flags;
-	int rc = 0;
+	int rc = 0, devfn = PCI_DEVFN(slot, func);
 
 	if (slot < 0) {
 		for (slot = 0; !rc && slot < 32; ++slot)
@@ -932,13 +941,23 @@ static int pcistub_device_id_add(int dom
 		return rc;
 	}
 
+#ifdef CONFIG_PCI_DOMAINS
+	if (domain < 0 || domain > 0xffff
+#else
+	if (domain
+#endif
+	    || bus < 0 || bus > 0xff
+	    || PCI_SLOT(devfn) != slot
+	    || PCI_FUNC(devfn) != func)
+		return -EINVAL;
+
 	pci_dev_id = kmalloc(sizeof(*pci_dev_id), GFP_KERNEL);
 	if (!pci_dev_id)
 		return -ENOMEM;
 
 	pci_dev_id->domain = domain;
 	pci_dev_id->bus = bus;
-	pci_dev_id->devfn = PCI_DEVFN(slot, func);
+	pci_dev_id->devfn = devfn;
 
 	pr_debug("pciback: wants to seize %04x:%02x:%02x.%01x\n",
 		 domain, bus, slot, func);
@@ -979,14 +998,18 @@ static int pcistub_device_id_remove(int 
 	return err;
 }
 
-static int pcistub_reg_add(int domain, int bus, int slot, int func, int reg,
-			   int size, int mask)
+static int pcistub_reg_add(int domain, int bus, int slot, int func,
+			   unsigned int reg, unsigned int size,
+			   unsigned int mask)
 {
 	int err = 0;
 	struct pcistub_device *psdev;
 	struct pci_dev *dev;
 	struct config_field *field;
 
+	if (reg > 0xfff || (size < 4 && (mask >> (size * 8))))
+		return -EINVAL;
+
 	psdev = pcistub_device_find(domain, bus, slot, func);
 	if (!psdev) {
 		err = -ENODEV;
@@ -1149,13 +1172,11 @@ static ssize_t permissive_add(struct dev
 	int err;
 	struct pcistub_device *psdev;
 	struct pciback_dev_data *dev_data;
+
 	err = str_to_slot(buf, &domain, &bus, &slot, &func);
 	if (err)
 		goto out;
-	if (slot < 0 || func < 0) {
-		err = -EINVAL;
-		goto out;
-	}
+
 	psdev = pcistub_device_find(domain, bus, slot, func);
 	if (!psdev) {
 		err = -ENODEV;

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

From xen-changelog-bounces@lists.xen.org Tue Sep 25 09:55:13 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Sep 2012 09:55:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGRrC-0002cX-8A; Tue, 25 Sep 2012 09:55:10 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGRrB-0002cM-2N
	for xen-changelog@lists.xensource.com; Tue, 25 Sep 2012 09:55:09 +0000
Received: from [85.158.143.99:38640] by server-3.bemta-4.messagelabs.com id
	FA/98-10986-C7F71605; Tue, 25 Sep 2012 09:55:08 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-216.messagelabs.com!1348566905!22064143!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13040 invoked from network); 25 Sep 2012 09:55:07 -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 Sep 2012 09:55: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 1TGRr7-0004W0-Mc
	for xen-changelog@lists.xensource.com; Tue, 25 Sep 2012 09:55:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGRr7-00010t-F5
	for xen-changelog@lists.xensource.com; Tue, 25 Sep 2012 09:55:05 +0000
Message-Id: <E1TGRr7-00010t-F5@xenbits.xen.org>
Date: Tue, 25 Sep 2012 09:55: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] pciback: improve input validation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348566584 -7200
# Node ID 50245ed8527a266e614a233102b0994fc86f0151
# Parent  2e2f50c02c3c1b95c41f2e27b40b59b54fd246f2
pciback: improve input validation

Reject - where this is not already being done elsewhere - out of range
values originating from user mode. This goes as far as reasonably
possible considering the non-conformance of the in-kernel sscanf().

At the same time, relax quirk parsing so that 0x prefixes get tolerated
without unnecessarily limiting the range of values (in some cases using
the prefix would make parsing outright fail no matter what value was
intended to be specified) for the (future) case where the in-kernel
sscanf() properly honors field width specifications even for integer
conversions.

Plus, to match parsing of standalone PCI device specifications, allow a
second form of input not having a domain specified (implying domain 0).

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


diff -r 2e2f50c02c3c -r 50245ed8527a drivers/xen/pciback/pci_stub.c
--- a/drivers/xen/pciback/pci_stub.c	Tue Sep 25 11:48:19 2012 +0200
+++ b/drivers/xen/pciback/pci_stub.c	Tue Sep 25 11:49:44 2012 +0200
@@ -121,7 +121,8 @@ static struct pcistub_device *pcistub_de
 		if (psdev->dev != NULL
 		    && domain == pci_domain_nr(psdev->dev->bus)
 		    && bus == psdev->dev->bus->number
-		    && PCI_DEVFN(slot, func) == psdev->dev->devfn) {
+		    && slot == PCI_SLOT(psdev->dev->devfn)
+		    && func == PCI_FUNC(psdev->dev->devfn)) {
 			pcistub_device_get(psdev);
 			goto out;
 		}
@@ -170,7 +171,8 @@ struct pci_dev *pcistub_get_pci_dev_by_s
 		if (psdev->dev != NULL
 		    && domain == pci_domain_nr(psdev->dev->bus)
 		    && bus == psdev->dev->bus->number
-		    && PCI_DEVFN(slot, func) == psdev->dev->devfn) {
+		    && slot == PCI_SLOT(psdev->dev->devfn)
+		    && func == PCI_FUNC(psdev->dev->devfn)) {
 			found_dev = pcistub_device_get_pci_dev(pdev, psdev);
 			break;
 		}
@@ -906,11 +908,18 @@ static inline int str_to_quirk(const cha
 {
 	int err;
 
-	err =
-	    sscanf(buf, " %04x:%02x:%02x.%1x-%08x:%1x:%08x", domain, bus, slot,
-		   func, reg, size, mask);
+	err = sscanf(buf, " %x:%x:%x.%x-%x:%x:%x", domain, bus, slot, func,
+		     reg, size, mask);
 	if (err == 7)
 		return 0;
+
+	/* try again without domain */
+	*domain = 0;
+	err = sscanf(buf, " %x:%x.%x-%x:%x:%x", bus, slot, func, reg, size,
+		     mask);
+	if (err == 6)
+		return 0;
+
 	return -EINVAL;
 }
 
@@ -918,7 +927,7 @@ static int pcistub_device_id_add(int dom
 {
 	struct pcistub_device_id *pci_dev_id;
 	unsigned long flags;
-	int rc = 0;
+	int rc = 0, devfn = PCI_DEVFN(slot, func);
 
 	if (slot < 0) {
 		for (slot = 0; !rc && slot < 32; ++slot)
@@ -932,13 +941,23 @@ static int pcistub_device_id_add(int dom
 		return rc;
 	}
 
+#ifdef CONFIG_PCI_DOMAINS
+	if (domain < 0 || domain > 0xffff
+#else
+	if (domain
+#endif
+	    || bus < 0 || bus > 0xff
+	    || PCI_SLOT(devfn) != slot
+	    || PCI_FUNC(devfn) != func)
+		return -EINVAL;
+
 	pci_dev_id = kmalloc(sizeof(*pci_dev_id), GFP_KERNEL);
 	if (!pci_dev_id)
 		return -ENOMEM;
 
 	pci_dev_id->domain = domain;
 	pci_dev_id->bus = bus;
-	pci_dev_id->devfn = PCI_DEVFN(slot, func);
+	pci_dev_id->devfn = devfn;
 
 	pr_debug("pciback: wants to seize %04x:%02x:%02x.%01x\n",
 		 domain, bus, slot, func);
@@ -979,14 +998,18 @@ static int pcistub_device_id_remove(int 
 	return err;
 }
 
-static int pcistub_reg_add(int domain, int bus, int slot, int func, int reg,
-			   int size, int mask)
+static int pcistub_reg_add(int domain, int bus, int slot, int func,
+			   unsigned int reg, unsigned int size,
+			   unsigned int mask)
 {
 	int err = 0;
 	struct pcistub_device *psdev;
 	struct pci_dev *dev;
 	struct config_field *field;
 
+	if (reg > 0xfff || (size < 4 && (mask >> (size * 8))))
+		return -EINVAL;
+
 	psdev = pcistub_device_find(domain, bus, slot, func);
 	if (!psdev) {
 		err = -ENODEV;
@@ -1149,13 +1172,11 @@ static ssize_t permissive_add(struct dev
 	int err;
 	struct pcistub_device *psdev;
 	struct pciback_dev_data *dev_data;
+
 	err = str_to_slot(buf, &domain, &bus, &slot, &func);
 	if (err)
 		goto out;
-	if (slot < 0 || func < 0) {
-		err = -EINVAL;
-		goto out;
-	}
+
 	psdev = pcistub_device_find(domain, bus, slot, func);
 	if (!psdev) {
 		err = -ENODEV;

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

From xen-changelog-bounces@lists.xen.org Tue Sep 25 09:55:13 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Sep 2012 09:55:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGRrC-0002cS-5j; Tue, 25 Sep 2012 09:55:10 +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 1TGRrA-0002cD-AW
	for xen-changelog@lists.xensource.com; Tue, 25 Sep 2012 09:55:08 +0000
Received: from [85.158.137.99:60180] by server-14.bemta-3.messagelabs.com id
	2D/53-21431-B7F71605; Tue, 25 Sep 2012 09:55:07 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-217.messagelabs.com!1348566905!18995939!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13296 invoked from network); 25 Sep 2012 09:55:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Sep 2012 09:55: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 1TGRr7-0004Vx-AM
	for xen-changelog@lists.xensource.com; Tue, 25 Sep 2012 09:55:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGRr7-00010e-1z
	for xen-changelog@lists.xensource.com; Tue, 25 Sep 2012 09:55:05 +0000
Message-Id: <E1TGRr7-00010e-1z@xenbits.xen.org>
Date: Tue, 25 Sep 2012 09:55: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] pciback: properly clean up after
	calling pcistub_device_find()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348566499 -7200
# Node ID 2e2f50c02c3c1b95c41f2e27b40b59b54fd246f2
# Parent  15b151bb8c5cb5001957a8f131a82f4cac2a2904
pciback: properly clean up after calling pcistub_device_find()

As the function calls pcistub_device_get() before returning non-NULL,
its callers need to take care of calling pcistub_device_put() on
(mostly, but not exclusively) error paths.

Otoh, the function already guarantees that the 'dev' member is non-NULL
upon successful return, so callers do not need to check for this a
second time.

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


diff -r 15b151bb8c5c -r 2e2f50c02c3c drivers/xen/pciback/pci_stub.c
--- a/drivers/xen/pciback/pci_stub.c	Tue Sep 25 11:45:10 2012 +0200
+++ b/drivers/xen/pciback/pci_stub.c	Tue Sep 25 11:48:19 2012 +0200
@@ -642,14 +642,14 @@ static pci_ers_result_t pciback_slot_res
 		dev_err(&dev->dev, "pciback device is not connected or owned"
 			" by HVM, kill it\n");
 		kill_domain_by_device(psdev);
-		goto release;
+		goto end;
 	}
 
 	if ( !test_bit(_XEN_PCIB_AERHANDLER, 
 		(unsigned long *)&psdev->pdev->sh_info->flags) ) {
 		dev_err(&dev->dev, 
 			"guest with no AER driver should have been killed\n");
-		goto release;
+		goto end;
 	}
 	result = common_process(psdev, 1, XEN_PCI_OP_aer_slotreset, result);
 
@@ -659,9 +659,9 @@ static pci_ers_result_t pciback_slot_res
 			"No AER slot_reset service or disconnected!\n");
 		kill_domain_by_device(psdev);
 	}
-release:
-	pcistub_device_put(psdev);
 end:
+	if (psdev)
+		pcistub_device_put(psdev);
 	up_write(&pcistub_sem);
 	return result;
 
@@ -702,14 +702,14 @@ static pci_ers_result_t pciback_mmio_ena
 		dev_err(&dev->dev, "pciback device is not connected or owned"
 			" by HVM, kill it\n");
 		kill_domain_by_device(psdev);
-		goto release;
+		goto end;
 	}
 
 	if ( !test_bit(_XEN_PCIB_AERHANDLER, 
 		(unsigned long *)&psdev->pdev->sh_info->flags) ) {
 		dev_err(&dev->dev, 
 			"guest with no AER driver should have been killed\n");
-		goto release;
+		goto end;
 	}
 	result = common_process(psdev, 1, XEN_PCI_OP_aer_mmio, result);
 
@@ -719,9 +719,9 @@ static pci_ers_result_t pciback_mmio_ena
 			"No AER mmio_enabled service or disconnected!\n");
 		kill_domain_by_device(psdev);
 	}
-release:
-	pcistub_device_put(psdev);
 end:
+	if (psdev)
+		pcistub_device_put(psdev);
 	up_write(&pcistub_sem);
 	return result;
 }
@@ -762,7 +762,7 @@ static pci_ers_result_t pciback_error_de
 		dev_err(&dev->dev, "pciback device is not connected or owned"
 			" by HVM, kill it\n");
 		kill_domain_by_device(psdev);
-		goto release;
+		goto end;
 	}
 
 	/*Guest owns the device yet no aer handler regiested, kill guest*/
@@ -770,7 +770,7 @@ static pci_ers_result_t pciback_error_de
 		(unsigned long *)&psdev->pdev->sh_info->flags) ) {
 		dev_dbg(&dev->dev, "guest may have no aer driver, kill it\n");
 		kill_domain_by_device(psdev);
-		goto release;
+		goto end;
 	}
 	result = common_process(psdev, error, XEN_PCI_OP_aer_detected, result);
 
@@ -780,9 +780,9 @@ static pci_ers_result_t pciback_error_de
 			"No AER error_detected service or disconnected!\n");
 		kill_domain_by_device(psdev);
 	}
-release:
-	pcistub_device_put(psdev);
 end:
+	if (psdev)
+		pcistub_device_put(psdev);
 	up_write(&pcistub_sem);
 	return result;
 }
@@ -818,7 +818,7 @@ static void pciback_error_resume(struct 
 		dev_err(&dev->dev, "pciback device is not connected or owned"
 			" by HVM, kill it\n");
 		kill_domain_by_device(psdev);
-		goto release;
+		goto end;
 	}
 
 	if ( !test_bit(_XEN_PCIB_AERHANDLER, 
@@ -826,12 +826,12 @@ static void pciback_error_resume(struct 
 		dev_err(&dev->dev, 
 			"guest with no AER driver should have been killed\n");
 		kill_domain_by_device(psdev);
-		goto release;
+		goto end;
 	}
 	common_process(psdev, 1, XEN_PCI_OP_aer_resume, PCI_ERS_RESULT_RECOVERED);
-release:
-	pcistub_device_put(psdev);
 end:
+	if (psdev)
+		pcistub_device_put(psdev);
 	up_write(&pcistub_sem);
 	return;
 }
@@ -988,7 +988,7 @@ static int pcistub_reg_add(int domain, i
 	struct config_field *field;
 
 	psdev = pcistub_device_find(domain, bus, slot, func);
-	if (!psdev || !psdev->dev) {
+	if (!psdev) {
 		err = -ENODEV;
 		goto out;
 	}
@@ -1012,6 +1012,8 @@ static int pcistub_reg_add(int domain, i
 	if (err)
 		kfree(field);
       out:
+	if (psdev)
+		pcistub_device_put(psdev);
 	return err;
 }
 
@@ -1159,10 +1161,7 @@ static ssize_t permissive_add(struct dev
 		err = -ENODEV;
 		goto out;
 	}
-	if (!psdev->dev) {
-		err = -ENODEV;
-		goto release;
-	}
+
 	dev_data = pci_get_drvdata(psdev->dev);
 	/* the driver data for a device should never be null at this point */
 	if (!dev_data) {
@@ -1214,14 +1213,18 @@ static DRIVER_ATTR(permissive, S_IRUSR |
 int pciback_get_owner(struct pci_dev *dev)
 {
 	struct pcistub_device *psdev;
+	int rc;
 
 	psdev = pcistub_device_find(pci_domain_nr(dev->bus), dev->bus->number,
 			PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
 
-	if (!psdev || !psdev->pdev)
-		return -1;
+	if (!psdev)
+		return -ESRCH;
 
-	return psdev->pdev->xdev->otherend_id;
+	rc = psdev->pdev ? psdev->pdev->xdev->otherend_id : -EINVAL;
+
+	pcistub_device_put(psdev);
+	return rc;
 }
 #endif
 

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

From xen-changelog-bounces@lists.xen.org Tue Sep 25 09:55:13 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Sep 2012 09:55:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGRrC-0002cS-5j; Tue, 25 Sep 2012 09:55:10 +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 1TGRrA-0002cD-AW
	for xen-changelog@lists.xensource.com; Tue, 25 Sep 2012 09:55:08 +0000
Received: from [85.158.137.99:60180] by server-14.bemta-3.messagelabs.com id
	2D/53-21431-B7F71605; Tue, 25 Sep 2012 09:55:07 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-217.messagelabs.com!1348566905!18995939!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13296 invoked from network); 25 Sep 2012 09:55:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Sep 2012 09:55: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 1TGRr7-0004Vx-AM
	for xen-changelog@lists.xensource.com; Tue, 25 Sep 2012 09:55:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGRr7-00010e-1z
	for xen-changelog@lists.xensource.com; Tue, 25 Sep 2012 09:55:05 +0000
Message-Id: <E1TGRr7-00010e-1z@xenbits.xen.org>
Date: Tue, 25 Sep 2012 09:55: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] pciback: properly clean up after
	calling pcistub_device_find()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348566499 -7200
# Node ID 2e2f50c02c3c1b95c41f2e27b40b59b54fd246f2
# Parent  15b151bb8c5cb5001957a8f131a82f4cac2a2904
pciback: properly clean up after calling pcistub_device_find()

As the function calls pcistub_device_get() before returning non-NULL,
its callers need to take care of calling pcistub_device_put() on
(mostly, but not exclusively) error paths.

Otoh, the function already guarantees that the 'dev' member is non-NULL
upon successful return, so callers do not need to check for this a
second time.

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


diff -r 15b151bb8c5c -r 2e2f50c02c3c drivers/xen/pciback/pci_stub.c
--- a/drivers/xen/pciback/pci_stub.c	Tue Sep 25 11:45:10 2012 +0200
+++ b/drivers/xen/pciback/pci_stub.c	Tue Sep 25 11:48:19 2012 +0200
@@ -642,14 +642,14 @@ static pci_ers_result_t pciback_slot_res
 		dev_err(&dev->dev, "pciback device is not connected or owned"
 			" by HVM, kill it\n");
 		kill_domain_by_device(psdev);
-		goto release;
+		goto end;
 	}
 
 	if ( !test_bit(_XEN_PCIB_AERHANDLER, 
 		(unsigned long *)&psdev->pdev->sh_info->flags) ) {
 		dev_err(&dev->dev, 
 			"guest with no AER driver should have been killed\n");
-		goto release;
+		goto end;
 	}
 	result = common_process(psdev, 1, XEN_PCI_OP_aer_slotreset, result);
 
@@ -659,9 +659,9 @@ static pci_ers_result_t pciback_slot_res
 			"No AER slot_reset service or disconnected!\n");
 		kill_domain_by_device(psdev);
 	}
-release:
-	pcistub_device_put(psdev);
 end:
+	if (psdev)
+		pcistub_device_put(psdev);
 	up_write(&pcistub_sem);
 	return result;
 
@@ -702,14 +702,14 @@ static pci_ers_result_t pciback_mmio_ena
 		dev_err(&dev->dev, "pciback device is not connected or owned"
 			" by HVM, kill it\n");
 		kill_domain_by_device(psdev);
-		goto release;
+		goto end;
 	}
 
 	if ( !test_bit(_XEN_PCIB_AERHANDLER, 
 		(unsigned long *)&psdev->pdev->sh_info->flags) ) {
 		dev_err(&dev->dev, 
 			"guest with no AER driver should have been killed\n");
-		goto release;
+		goto end;
 	}
 	result = common_process(psdev, 1, XEN_PCI_OP_aer_mmio, result);
 
@@ -719,9 +719,9 @@ static pci_ers_result_t pciback_mmio_ena
 			"No AER mmio_enabled service or disconnected!\n");
 		kill_domain_by_device(psdev);
 	}
-release:
-	pcistub_device_put(psdev);
 end:
+	if (psdev)
+		pcistub_device_put(psdev);
 	up_write(&pcistub_sem);
 	return result;
 }
@@ -762,7 +762,7 @@ static pci_ers_result_t pciback_error_de
 		dev_err(&dev->dev, "pciback device is not connected or owned"
 			" by HVM, kill it\n");
 		kill_domain_by_device(psdev);
-		goto release;
+		goto end;
 	}
 
 	/*Guest owns the device yet no aer handler regiested, kill guest*/
@@ -770,7 +770,7 @@ static pci_ers_result_t pciback_error_de
 		(unsigned long *)&psdev->pdev->sh_info->flags) ) {
 		dev_dbg(&dev->dev, "guest may have no aer driver, kill it\n");
 		kill_domain_by_device(psdev);
-		goto release;
+		goto end;
 	}
 	result = common_process(psdev, error, XEN_PCI_OP_aer_detected, result);
 
@@ -780,9 +780,9 @@ static pci_ers_result_t pciback_error_de
 			"No AER error_detected service or disconnected!\n");
 		kill_domain_by_device(psdev);
 	}
-release:
-	pcistub_device_put(psdev);
 end:
+	if (psdev)
+		pcistub_device_put(psdev);
 	up_write(&pcistub_sem);
 	return result;
 }
@@ -818,7 +818,7 @@ static void pciback_error_resume(struct 
 		dev_err(&dev->dev, "pciback device is not connected or owned"
 			" by HVM, kill it\n");
 		kill_domain_by_device(psdev);
-		goto release;
+		goto end;
 	}
 
 	if ( !test_bit(_XEN_PCIB_AERHANDLER, 
@@ -826,12 +826,12 @@ static void pciback_error_resume(struct 
 		dev_err(&dev->dev, 
 			"guest with no AER driver should have been killed\n");
 		kill_domain_by_device(psdev);
-		goto release;
+		goto end;
 	}
 	common_process(psdev, 1, XEN_PCI_OP_aer_resume, PCI_ERS_RESULT_RECOVERED);
-release:
-	pcistub_device_put(psdev);
 end:
+	if (psdev)
+		pcistub_device_put(psdev);
 	up_write(&pcistub_sem);
 	return;
 }
@@ -988,7 +988,7 @@ static int pcistub_reg_add(int domain, i
 	struct config_field *field;
 
 	psdev = pcistub_device_find(domain, bus, slot, func);
-	if (!psdev || !psdev->dev) {
+	if (!psdev) {
 		err = -ENODEV;
 		goto out;
 	}
@@ -1012,6 +1012,8 @@ static int pcistub_reg_add(int domain, i
 	if (err)
 		kfree(field);
       out:
+	if (psdev)
+		pcistub_device_put(psdev);
 	return err;
 }
 
@@ -1159,10 +1161,7 @@ static ssize_t permissive_add(struct dev
 		err = -ENODEV;
 		goto out;
 	}
-	if (!psdev->dev) {
-		err = -ENODEV;
-		goto release;
-	}
+
 	dev_data = pci_get_drvdata(psdev->dev);
 	/* the driver data for a device should never be null at this point */
 	if (!dev_data) {
@@ -1214,14 +1213,18 @@ static DRIVER_ATTR(permissive, S_IRUSR |
 int pciback_get_owner(struct pci_dev *dev)
 {
 	struct pcistub_device *psdev;
+	int rc;
 
 	psdev = pcistub_device_find(pci_domain_nr(dev->bus), dev->bus->number,
 			PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
 
-	if (!psdev || !psdev->pdev)
-		return -1;
+	if (!psdev)
+		return -ESRCH;
 
-	return psdev->pdev->xdev->otherend_id;
+	rc = psdev->pdev ? psdev->pdev->xdev->otherend_id : -EINVAL;
+
+	pcistub_device_put(psdev);
+	return rc;
 }
 #endif
 

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

From xen-changelog-bounces@lists.xen.org Tue Sep 25 09:55:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Sep 2012 09:55:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGRrH-0002dR-Ao; Tue, 25 Sep 2012 09:55: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 1TGRrF-0002cF-BI
	for xen-changelog@lists.xensource.com; Tue, 25 Sep 2012 09:55:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-27.messagelabs.com!1348566905!8573792!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25580 invoked from network); 25 Sep 2012 09:55:06 -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;
	25 Sep 2012 09:55: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 1TGRr6-0004Vu-RU
	for xen-changelog@lists.xensource.com; Tue, 25 Sep 2012 09:55:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGRr6-00010P-GH
	for xen-changelog@lists.xensource.com; Tue, 25 Sep 2012 09:55:04 +0000
Message-Id: <E1TGRr6-00010P-GH@xenbits.xen.org>
Date: Tue, 25 Sep 2012 09:55: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] pciback: support wild cards in
	slot specifications
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348566310 -7200
# Node ID 15b151bb8c5cb5001957a8f131a82f4cac2a2904
# Parent  e09f03f312e52f421e7cf39f81515adb445b5159
pciback: support wild cards in slot specifications

Particularly for hiding sets of SR-IOV devices, specifying them all
individually is rather cumbersome. Therefore, allow function and slot
numbers to be replaced by a wildcard character ('*').

Unfortunately this gets complicated by the in-kernel sscanf()
implementation not being really standard conformant - matching of
plain text tails cannot be checked by the caller (a patch to overcome
this will be sent shortly, and a follow-up patch for simplifying the
code is planned to be sent when that fixed went upstream).

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


diff -r e09f03f312e5 -r 15b151bb8c5c drivers/xen/pciback/pci_stub.c
--- a/drivers/xen/pciback/pci_stub.c	Mon Sep 24 17:36:09 2012 +0200
+++ b/drivers/xen/pciback/pci_stub.c	Tue Sep 25 11:45:10 2012 +0200
@@ -861,17 +861,41 @@ static inline int str_to_slot(const char
 			      int *slot, int *func)
 {
 	int err;
+	char wc = '*';
 
 	err = sscanf(buf, " %x:%x:%x.%x", domain, bus, slot, func);
-	if (err == 4)
+	switch (err) {
+	case 3:
+		*func = -1;
+		err = sscanf(buf, " %x:%x:%x.%c", domain, bus, slot, &wc);
+		break;
+	case 2:
+		*slot = *func = -1;
+		err = sscanf(buf, " %x:%x:*.%c", domain, bus, &wc);
+		if (err >= 2)
+			++err;
+		break;
+	}
+	if (err == 4 && wc == '*')
 		return 0;
 	else if (err < 0)
 		return -EINVAL;
 
 	/* try again without domain */
 	*domain = 0;
+	wc = '*';
 	err = sscanf(buf, " %x:%x.%x", bus, slot, func);
-	if (err == 3)
+	switch (err) {
+	case 2:
+		*func = -1;
+		err = sscanf(buf, " %x:%x.%c", bus, slot, &wc);
+		break;
+	case 1:
+		*slot = *func = -1;
+		err = sscanf(buf, " %x:*.%c", bus, &wc) + 1;
+		break;
+	}
+	if (err == 3 && wc == '*')
 		return 0;
 
 	return -EINVAL;
@@ -894,6 +918,19 @@ static int pcistub_device_id_add(int dom
 {
 	struct pcistub_device_id *pci_dev_id;
 	unsigned long flags;
+	int rc = 0;
+
+	if (slot < 0) {
+		for (slot = 0; !rc && slot < 32; ++slot)
+			rc = pcistub_device_id_add(domain, bus, slot, func);
+		return rc;
+	}
+
+	if (func < 0) {
+		for (func = 0; !rc && func < 8; ++func)
+			rc = pcistub_device_id_add(domain, bus, slot, func);
+		return rc;
+	}
 
 	pci_dev_id = kmalloc(sizeof(*pci_dev_id), GFP_KERNEL);
 	if (!pci_dev_id)
@@ -916,15 +953,15 @@ static int pcistub_device_id_add(int dom
 static int pcistub_device_id_remove(int domain, int bus, int slot, int func)
 {
 	struct pcistub_device_id *pci_dev_id, *t;
-	int devfn = PCI_DEVFN(slot, func);
 	int err = -ENOENT;
 	unsigned long flags;
 
 	spin_lock_irqsave(&device_ids_lock, flags);
 	list_for_each_entry_safe(pci_dev_id, t, &pcistub_device_ids, slot_list) {
 
-		if (pci_dev_id->domain == domain
-		    && pci_dev_id->bus == bus && pci_dev_id->devfn == devfn) {
+		if (pci_dev_id->domain == domain && pci_dev_id->bus == bus
+		    && (slot < 0 || PCI_SLOT(pci_dev_id->devfn) == slot)
+		    && (func < 0 || PCI_FUNC(pci_dev_id->devfn) == func)) {
 			/* Don't break; here because it's possible the same
 			 * slot could be in the list more than once
 			 */
@@ -1113,6 +1150,10 @@ static ssize_t permissive_add(struct dev
 	err = str_to_slot(buf, &domain, &bus, &slot, &func);
 	if (err)
 		goto out;
+	if (slot < 0 || func < 0) {
+		err = -EINVAL;
+		goto out;
+	}
 	psdev = pcistub_device_find(domain, bus, slot, func);
 	if (!psdev) {
 		err = -ENODEV;
@@ -1206,17 +1247,51 @@ static int __init pcistub_init(void)
 
 	if (pci_devs_to_hide && *pci_devs_to_hide) {
 		do {
+			char wc = '*';
+
 			parsed = 0;
 
 			err = sscanf(pci_devs_to_hide + pos,
 				     " (%x:%x:%x.%x) %n",
 				     &domain, &bus, &slot, &func, &parsed);
-			if (err != 4) {
+			switch (err) {
+			case 3:
+				func = -1;
+				err = sscanf(pci_devs_to_hide + pos,
+					     " (%x:%x:%x.%c) %n",
+					     &domain, &bus, &slot, &wc,
+					     &parsed);
+				break;
+			case 2:
+				slot = func = -1;
+				err = sscanf(pci_devs_to_hide + pos,
+					     " (%x:%x:*.%c) %n",
+					     &domain, &bus, &wc, &parsed) + 1;
+				break;
+			}
+
+			if (err != 4 || wc != '*') {
 				domain = 0;
+				wc = '*';
 				err = sscanf(pci_devs_to_hide + pos,
 					     " (%x:%x.%x) %n",
 					     &bus, &slot, &func, &parsed);
-				if (err != 3)
+				switch (err) {
+				case 2:
+					func = -1;
+					err = sscanf(pci_devs_to_hide + pos,
+						     " (%x:%x.%c) %n",
+						     &bus, &slot, &wc,
+						     &parsed);
+					break;
+				case 1:
+					slot = func = -1;
+					err = sscanf(pci_devs_to_hide + pos,
+						     " (%x:*.%c) %n",
+						     &bus, &wc, &parsed) + 1;
+					break;
+				}
+				if (err != 3 || wc != '*')
 					goto parse_error;
 			}
 

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

From xen-changelog-bounces@lists.xen.org Tue Sep 25 09:55:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Sep 2012 09:55:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGRrH-0002dR-Ao; Tue, 25 Sep 2012 09:55: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 1TGRrF-0002cF-BI
	for xen-changelog@lists.xensource.com; Tue, 25 Sep 2012 09:55:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-27.messagelabs.com!1348566905!8573792!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25580 invoked from network); 25 Sep 2012 09:55:06 -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;
	25 Sep 2012 09:55: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 1TGRr6-0004Vu-RU
	for xen-changelog@lists.xensource.com; Tue, 25 Sep 2012 09:55:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGRr6-00010P-GH
	for xen-changelog@lists.xensource.com; Tue, 25 Sep 2012 09:55:04 +0000
Message-Id: <E1TGRr6-00010P-GH@xenbits.xen.org>
Date: Tue, 25 Sep 2012 09:55: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] pciback: support wild cards in
	slot specifications
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348566310 -7200
# Node ID 15b151bb8c5cb5001957a8f131a82f4cac2a2904
# Parent  e09f03f312e52f421e7cf39f81515adb445b5159
pciback: support wild cards in slot specifications

Particularly for hiding sets of SR-IOV devices, specifying them all
individually is rather cumbersome. Therefore, allow function and slot
numbers to be replaced by a wildcard character ('*').

Unfortunately this gets complicated by the in-kernel sscanf()
implementation not being really standard conformant - matching of
plain text tails cannot be checked by the caller (a patch to overcome
this will be sent shortly, and a follow-up patch for simplifying the
code is planned to be sent when that fixed went upstream).

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


diff -r e09f03f312e5 -r 15b151bb8c5c drivers/xen/pciback/pci_stub.c
--- a/drivers/xen/pciback/pci_stub.c	Mon Sep 24 17:36:09 2012 +0200
+++ b/drivers/xen/pciback/pci_stub.c	Tue Sep 25 11:45:10 2012 +0200
@@ -861,17 +861,41 @@ static inline int str_to_slot(const char
 			      int *slot, int *func)
 {
 	int err;
+	char wc = '*';
 
 	err = sscanf(buf, " %x:%x:%x.%x", domain, bus, slot, func);
-	if (err == 4)
+	switch (err) {
+	case 3:
+		*func = -1;
+		err = sscanf(buf, " %x:%x:%x.%c", domain, bus, slot, &wc);
+		break;
+	case 2:
+		*slot = *func = -1;
+		err = sscanf(buf, " %x:%x:*.%c", domain, bus, &wc);
+		if (err >= 2)
+			++err;
+		break;
+	}
+	if (err == 4 && wc == '*')
 		return 0;
 	else if (err < 0)
 		return -EINVAL;
 
 	/* try again without domain */
 	*domain = 0;
+	wc = '*';
 	err = sscanf(buf, " %x:%x.%x", bus, slot, func);
-	if (err == 3)
+	switch (err) {
+	case 2:
+		*func = -1;
+		err = sscanf(buf, " %x:%x.%c", bus, slot, &wc);
+		break;
+	case 1:
+		*slot = *func = -1;
+		err = sscanf(buf, " %x:*.%c", bus, &wc) + 1;
+		break;
+	}
+	if (err == 3 && wc == '*')
 		return 0;
 
 	return -EINVAL;
@@ -894,6 +918,19 @@ static int pcistub_device_id_add(int dom
 {
 	struct pcistub_device_id *pci_dev_id;
 	unsigned long flags;
+	int rc = 0;
+
+	if (slot < 0) {
+		for (slot = 0; !rc && slot < 32; ++slot)
+			rc = pcistub_device_id_add(domain, bus, slot, func);
+		return rc;
+	}
+
+	if (func < 0) {
+		for (func = 0; !rc && func < 8; ++func)
+			rc = pcistub_device_id_add(domain, bus, slot, func);
+		return rc;
+	}
 
 	pci_dev_id = kmalloc(sizeof(*pci_dev_id), GFP_KERNEL);
 	if (!pci_dev_id)
@@ -916,15 +953,15 @@ static int pcistub_device_id_add(int dom
 static int pcistub_device_id_remove(int domain, int bus, int slot, int func)
 {
 	struct pcistub_device_id *pci_dev_id, *t;
-	int devfn = PCI_DEVFN(slot, func);
 	int err = -ENOENT;
 	unsigned long flags;
 
 	spin_lock_irqsave(&device_ids_lock, flags);
 	list_for_each_entry_safe(pci_dev_id, t, &pcistub_device_ids, slot_list) {
 
-		if (pci_dev_id->domain == domain
-		    && pci_dev_id->bus == bus && pci_dev_id->devfn == devfn) {
+		if (pci_dev_id->domain == domain && pci_dev_id->bus == bus
+		    && (slot < 0 || PCI_SLOT(pci_dev_id->devfn) == slot)
+		    && (func < 0 || PCI_FUNC(pci_dev_id->devfn) == func)) {
 			/* Don't break; here because it's possible the same
 			 * slot could be in the list more than once
 			 */
@@ -1113,6 +1150,10 @@ static ssize_t permissive_add(struct dev
 	err = str_to_slot(buf, &domain, &bus, &slot, &func);
 	if (err)
 		goto out;
+	if (slot < 0 || func < 0) {
+		err = -EINVAL;
+		goto out;
+	}
 	psdev = pcistub_device_find(domain, bus, slot, func);
 	if (!psdev) {
 		err = -ENODEV;
@@ -1206,17 +1247,51 @@ static int __init pcistub_init(void)
 
 	if (pci_devs_to_hide && *pci_devs_to_hide) {
 		do {
+			char wc = '*';
+
 			parsed = 0;
 
 			err = sscanf(pci_devs_to_hide + pos,
 				     " (%x:%x:%x.%x) %n",
 				     &domain, &bus, &slot, &func, &parsed);
-			if (err != 4) {
+			switch (err) {
+			case 3:
+				func = -1;
+				err = sscanf(pci_devs_to_hide + pos,
+					     " (%x:%x:%x.%c) %n",
+					     &domain, &bus, &slot, &wc,
+					     &parsed);
+				break;
+			case 2:
+				slot = func = -1;
+				err = sscanf(pci_devs_to_hide + pos,
+					     " (%x:%x:*.%c) %n",
+					     &domain, &bus, &wc, &parsed) + 1;
+				break;
+			}
+
+			if (err != 4 || wc != '*') {
 				domain = 0;
+				wc = '*';
 				err = sscanf(pci_devs_to_hide + pos,
 					     " (%x:%x.%x) %n",
 					     &bus, &slot, &func, &parsed);
-				if (err != 3)
+				switch (err) {
+				case 2:
+					func = -1;
+					err = sscanf(pci_devs_to_hide + pos,
+						     " (%x:%x.%c) %n",
+						     &bus, &slot, &wc,
+						     &parsed);
+					break;
+				case 1:
+					slot = func = -1;
+					err = sscanf(pci_devs_to_hide + pos,
+						     " (%x:*.%c) %n",
+						     &bus, &wc, &parsed) + 1;
+					break;
+				}
+				if (err != 3 || wc != '*')
 					goto parse_error;
 			}
 

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 02:55:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 02:55:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGhmM-0001f8-V2; Wed, 26 Sep 2012 02:55:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGhmL-0001eo-5J
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:13 +0000
Received: from [85.158.139.83:26933] by server-5.bemta-5.messagelabs.com id
	DE/52-21075-09E62605; Wed, 26 Sep 2012 02:55:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1348628109!28174232!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15804 invoked from network); 26 Sep 2012 02:55:11 -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;
	26 Sep 2012 02: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 1TGhmH-0000ZQ-Eb
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGhmH-0002pu-2e
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:09 +0000
Message-Id: <E1TGhmH-0002pu-2e@xenbits.xen.org>
Date: Wed, 26 Sep 2012 02:55:08 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] tmem: only allow tmem control
	operations from privileged domains
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1348568646 -7200
# Node ID 240b1de53095bb046f1bb4398b7fb2c7d53bc158
# Parent  6a17d5f11d66688be995c7ae5ed0f20d8ebe9cbf
tmem: only allow tmem control operations from privileged domains

This is part of XSA-15 / CVE-2012-3497.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 25850:0dba5a888655
xen-unstable date: Tue Sep 11 12:06:30 UTC 2012
---


diff -r 6a17d5f11d66 -r 240b1de53095 xen/common/tmem.c
--- a/xen/common/tmem.c	Thu Sep 20 11:01:04 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:24:06 2012 +0200
@@ -2544,10 +2544,8 @@ static NOINLINE int do_tmem_control(stru
     OID *oidp = (OID *)(&op->u.ctrl.oid[0]);
 
     if (!tmh_current_is_privileged())
-    {
-        /* don't fail... mystery: sometimes dom0 fails here */
-        /* return -EPERM; */
-    }
+        return -EPERM;
+
     switch(subop)
     {
     case TMEMC_THAW:

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 02:55:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 02:55:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGhmM-0001f8-V2; Wed, 26 Sep 2012 02:55:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGhmL-0001eo-5J
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:13 +0000
Received: from [85.158.139.83:26933] by server-5.bemta-5.messagelabs.com id
	DE/52-21075-09E62605; Wed, 26 Sep 2012 02:55:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1348628109!28174232!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15804 invoked from network); 26 Sep 2012 02:55:11 -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;
	26 Sep 2012 02: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 1TGhmH-0000ZQ-Eb
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGhmH-0002pu-2e
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:09 +0000
Message-Id: <E1TGhmH-0002pu-2e@xenbits.xen.org>
Date: Wed, 26 Sep 2012 02:55:08 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] tmem: only allow tmem control
	operations from privileged domains
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1348568646 -7200
# Node ID 240b1de53095bb046f1bb4398b7fb2c7d53bc158
# Parent  6a17d5f11d66688be995c7ae5ed0f20d8ebe9cbf
tmem: only allow tmem control operations from privileged domains

This is part of XSA-15 / CVE-2012-3497.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 25850:0dba5a888655
xen-unstable date: Tue Sep 11 12:06:30 UTC 2012
---


diff -r 6a17d5f11d66 -r 240b1de53095 xen/common/tmem.c
--- a/xen/common/tmem.c	Thu Sep 20 11:01:04 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:24:06 2012 +0200
@@ -2544,10 +2544,8 @@ static NOINLINE int do_tmem_control(stru
     OID *oidp = (OID *)(&op->u.ctrl.oid[0]);
 
     if (!tmh_current_is_privileged())
-    {
-        /* don't fail... mystery: sometimes dom0 fails here */
-        /* return -EPERM; */
-    }
+        return -EPERM;
+
     switch(subop)
     {
     case TMEMC_THAW:

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 02:55:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 02:55:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGhmO-0001fY-4B; Wed, 26 Sep 2012 02:55:16 +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 1TGhmM-0001f6-Pp
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:15 +0000
Received: from [85.158.137.99:24514] by server-10.bemta-3.messagelabs.com id
	98/F1-10411-19E62605; Wed, 26 Sep 2012 02:55:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-217.messagelabs.com!1348628111!16759534!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14889 invoked from network); 26 Sep 2012 02:55:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Sep 2012 02: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 1TGhmJ-0000ZZ-3r
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGhmI-0002qd-OW
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:10 +0000
Message-Id: <E1TGhmI-0002qd-OW@xenbits.xen.org>
Date: Wed, 26 Sep 2012 02: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] tmem: check for a valid client
	("domain") in the save subops
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1348568725 -7200
# Node ID 8dba0836f71b0ff37861dc42eae7d4c78b10dbe5
# Parent  6f61607a074b407b0f6303b6bd09382c0e27576c
tmem: check for a valid client ("domain") in the save subops

This is part of XSA-15 / CVE-2012-3497.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
xen-unstable changeset: 25853:f53c5aadbba9
xen-unstable date: Tue Sep 11 12:17:27 UTC 2012
---


diff -r 6f61607a074b -r 8dba0836f71b xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:24:57 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:25:25 2012 +0200
@@ -2382,12 +2382,18 @@ static NOINLINE int tmemc_save_subop(int
         rc = MAX_POOLS_PER_DOMAIN;
         break;
     case TMEMC_SAVE_GET_CLIENT_WEIGHT:
+        if ( client == NULL )
+            break;
         rc = client->weight == -1 ? -2 : client->weight;
         break;
     case TMEMC_SAVE_GET_CLIENT_CAP:
+        if ( client == NULL )
+            break;
         rc = client->cap == -1 ? -2 : client->cap;
         break;
     case TMEMC_SAVE_GET_CLIENT_FLAGS:
+        if ( client == NULL )
+            break;
         rc = (client->compress ? TMEM_CLIENT_COMPRESS : 0 ) |
              (client->was_frozen ? TMEM_CLIENT_FROZEN : 0 );
         break;
@@ -2411,6 +2417,8 @@ static NOINLINE int tmemc_save_subop(int
         *uuid = pool->uuid[1];
         rc = 0;
     case TMEMC_SAVE_END:
+        if ( client == NULL )
+            break;
         client->live_migrating = 0;
         if ( !list_empty(&client->persistent_invalidated_list) )
             list_for_each_entry_safe(pgp,pgp2,

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 02:55:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 02:55:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGhmO-0001fY-4B; Wed, 26 Sep 2012 02:55:16 +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 1TGhmM-0001f6-Pp
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:15 +0000
Received: from [85.158.137.99:24514] by server-10.bemta-3.messagelabs.com id
	98/F1-10411-19E62605; Wed, 26 Sep 2012 02:55:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-217.messagelabs.com!1348628111!16759534!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14889 invoked from network); 26 Sep 2012 02:55:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Sep 2012 02: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 1TGhmJ-0000ZZ-3r
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGhmI-0002qd-OW
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:10 +0000
Message-Id: <E1TGhmI-0002qd-OW@xenbits.xen.org>
Date: Wed, 26 Sep 2012 02: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] tmem: check for a valid client
	("domain") in the save subops
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1348568725 -7200
# Node ID 8dba0836f71b0ff37861dc42eae7d4c78b10dbe5
# Parent  6f61607a074b407b0f6303b6bd09382c0e27576c
tmem: check for a valid client ("domain") in the save subops

This is part of XSA-15 / CVE-2012-3497.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
xen-unstable changeset: 25853:f53c5aadbba9
xen-unstable date: Tue Sep 11 12:17:27 UTC 2012
---


diff -r 6f61607a074b -r 8dba0836f71b xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:24:57 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:25:25 2012 +0200
@@ -2382,12 +2382,18 @@ static NOINLINE int tmemc_save_subop(int
         rc = MAX_POOLS_PER_DOMAIN;
         break;
     case TMEMC_SAVE_GET_CLIENT_WEIGHT:
+        if ( client == NULL )
+            break;
         rc = client->weight == -1 ? -2 : client->weight;
         break;
     case TMEMC_SAVE_GET_CLIENT_CAP:
+        if ( client == NULL )
+            break;
         rc = client->cap == -1 ? -2 : client->cap;
         break;
     case TMEMC_SAVE_GET_CLIENT_FLAGS:
+        if ( client == NULL )
+            break;
         rc = (client->compress ? TMEM_CLIENT_COMPRESS : 0 ) |
              (client->was_frozen ? TMEM_CLIENT_FROZEN : 0 );
         break;
@@ -2411,6 +2417,8 @@ static NOINLINE int tmemc_save_subop(int
         *uuid = pool->uuid[1];
         rc = 0;
     case TMEMC_SAVE_END:
+        if ( client == NULL )
+            break;
         client->live_migrating = 0;
         if ( !list_empty(&client->persistent_invalidated_list) )
             list_for_each_entry_safe(pgp,pgp2,

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 02:55:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 02: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.xen.org>)
	id 1TGhmN-0001fE-1K; Wed, 26 Sep 2012 02:55:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGhmL-0001es-RF
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:13 +0000
Received: from [85.158.143.99:29600] by server-3.bemta-4.messagelabs.com id
	0D/5A-10986-19E62605; Wed, 26 Sep 2012 02:55:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-216.messagelabs.com!1348628111!22165518!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1843 invoked from network); 26 Sep 2012 02:55:12 -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;
	26 Sep 2012 02: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 1TGhmI-0000ZW-CY
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGhmI-0002qO-8B
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:10 +0000
Message-Id: <E1TGhmI-0002qO-8B@xenbits.xen.org>
Date: Wed, 26 Sep 2012 02: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] tmem: check the pool_id is valid
	when destroying a tmem pool
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1348568697 -7200
# Node ID 6f61607a074b407b0f6303b6bd09382c0e27576c
# Parent  805f0ba5e11b54067b0782b920fd8bc6421adfb1
tmem: check the pool_id is valid when destroying a tmem pool

This is part of XSA-15 / CVE-2012-3497.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 25852:d189d99ef00c
xen-unstable date: Tue Sep 11 12:06:54 UTC 2012
---


diff -r 805f0ba5e11b -r 6f61607a074b xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:24:37 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:24:57 2012 +0200
@@ -1873,6 +1873,8 @@ static NOINLINE int do_tmem_destroy_pool
 
     if ( client->pools == NULL )
         return 0;
+    if ( pool_id >= MAX_POOLS_PER_DOMAIN )
+        return 0;
     if ( (pool = client->pools[pool_id]) == NULL )
         return 0;
     client->pools[pool_id] = NULL;

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 02:55:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 02: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.xen.org>)
	id 1TGhmN-0001fE-1K; Wed, 26 Sep 2012 02:55:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGhmL-0001es-RF
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:13 +0000
Received: from [85.158.143.99:29600] by server-3.bemta-4.messagelabs.com id
	0D/5A-10986-19E62605; Wed, 26 Sep 2012 02:55:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-216.messagelabs.com!1348628111!22165518!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1843 invoked from network); 26 Sep 2012 02:55:12 -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;
	26 Sep 2012 02: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 1TGhmI-0000ZW-CY
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGhmI-0002qO-8B
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:10 +0000
Message-Id: <E1TGhmI-0002qO-8B@xenbits.xen.org>
Date: Wed, 26 Sep 2012 02: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] tmem: check the pool_id is valid
	when destroying a tmem pool
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1348568697 -7200
# Node ID 6f61607a074b407b0f6303b6bd09382c0e27576c
# Parent  805f0ba5e11b54067b0782b920fd8bc6421adfb1
tmem: check the pool_id is valid when destroying a tmem pool

This is part of XSA-15 / CVE-2012-3497.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 25852:d189d99ef00c
xen-unstable date: Tue Sep 11 12:06:54 UTC 2012
---


diff -r 805f0ba5e11b -r 6f61607a074b xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:24:37 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:24:57 2012 +0200
@@ -1873,6 +1873,8 @@ static NOINLINE int do_tmem_destroy_pool
 
     if ( client->pools == NULL )
         return 0;
+    if ( pool_id >= MAX_POOLS_PER_DOMAIN )
+        return 0;
     if ( (pool = client->pools[pool_id]) == NULL )
         return 0;
     client->pools[pool_id] = NULL;

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 02:55:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 02: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.xen.org>)
	id 1TGhmQ-0001g8-DQ; Wed, 26 Sep 2012 02:55:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGhmO-0001fb-Qz
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:16 +0000
Received: from [85.158.139.211:50977] by server-6.bemta-5.messagelabs.com id
	2B/84-14717-39E62605; Wed, 26 Sep 2012 02:55:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-206.messagelabs.com!1348628114!19910678!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30852 invoked from network); 26 Sep 2012 02:55:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Sep 2012 02: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 1TGhmL-0000Zl-Lx
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGhmL-0002ri-Jf
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:13 +0000
Message-Id: <E1TGhmL-0002ri-Jf@xenbits.xen.org>
Date: Wed, 26 Sep 2012 02: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] tmem: properly drop lock on error
	path in do_tmem_op()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348568841 -7200
# Node ID 91bf384afc83fac5334535aa87dee17d6a07de98
# Parent  397cac9587fec61ee71b2ccf09120a54ecb5b4f8
tmem: properly drop lock on error path in do_tmem_op()

Reported-by: Tim Deegan <tim@xen.org>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
xen-unstable changeset: 25857:109ea6a0c23a
xen-unstable date: Tue Sep 11 12:18:26 UTC 2012
---


diff -r 397cac9587fe -r 91bf384afc83 xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:26:57 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:27:21 2012 +0200
@@ -2662,13 +2662,19 @@ EXPORT long do_tmem_op(tmem_cli_op_t uop
     if ( client != NULL && tmh_client_is_dying(client) )
     {
         rc = -ENODEV;
-        goto out;
+        if ( tmh_lock_all )
+            goto out;
+ simple_error:
+        errored_tmem_ops++;
+        return rc;
     }
 
     if ( unlikely(tmh_get_tmemop_from_client(&op, uops) != 0) )
     {
         printk("tmem: can't get tmem struct from %s\n",client_str);
         rc = -EFAULT;
+        if ( !tmh_lock_all )
+            goto simple_error;
         goto out;
     }
 

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 02:55:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 02: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.xen.org>)
	id 1TGhmR-0001gp-GK; Wed, 26 Sep 2012 02: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 1TGhmQ-0001ep-3a
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-27.messagelabs.com!1348628110!11273802!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21485 invoked from network); 26 Sep 2012 02:55:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Sep 2012 02: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 1TGhmI-0000ZT-3F
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGhmH-0002q9-NW
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:09 +0000
Message-Id: <E1TGhmH-0002q9-NW@xenbits.xen.org>
Date: Wed, 26 Sep 2012 02: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] tmem: consistently make pool_id a
	uint32_t
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1348568677 -7200
# Node ID 805f0ba5e11b54067b0782b920fd8bc6421adfb1
# Parent  240b1de53095bb046f1bb4398b7fb2c7d53bc158
tmem: consistently make pool_id a uint32_t

Treating it as an int could allow a malicious guest to provide a
negative pool_Id, by passing the MAX_POOLS_PER_DOMAIN limit check and
allowing access to the negative offsets of the pool array.

This is part of XSA-15 / CVE-2012-3497.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 25851:fcf567acc92a
xen-unstable date: Tue Sep 11 12:06:43 UTC 2012
---


diff -r 240b1de53095 -r 805f0ba5e11b xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:24:06 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:24:37 2012 +0200
@@ -2420,7 +2420,7 @@ static NOINLINE int tmemc_save_subop(int
     return rc;
 }
 
-static NOINLINE int tmemc_save_get_next_page(int cli_id, int pool_id,
+static NOINLINE int tmemc_save_get_next_page(int cli_id, uint32_t pool_id,
                         tmem_cli_va_t buf, uint32_t bufsize)
 {
     client_t *client = tmh_client_from_cli_id(cli_id);
@@ -2512,7 +2512,7 @@ out:
     return ret;
 }
 
-static int tmemc_restore_put_page(int cli_id, int pool_id, OID *oidp,
+static int tmemc_restore_put_page(int cli_id, uint32_t pool_id, OID *oidp,
                       uint32_t index, tmem_cli_va_t buf, uint32_t bufsize)
 {
     client_t *client = tmh_client_from_cli_id(cli_id);
@@ -2524,7 +2524,7 @@ static int tmemc_restore_put_page(int cl
     return do_tmem_put(pool,oidp,index,0,0,0,bufsize,buf.p);
 }
 
-static int tmemc_restore_flush_page(int cli_id, int pool_id, OID *oidp,
+static int tmemc_restore_flush_page(int cli_id, uint32_t pool_id, OID *oidp,
                         uint32_t index)
 {
     client_t *client = tmh_client_from_cli_id(cli_id);

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 02:55:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 02: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.xen.org>)
	id 1TGhmR-0001gp-GK; Wed, 26 Sep 2012 02: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 1TGhmQ-0001ep-3a
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-27.messagelabs.com!1348628110!11273802!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21485 invoked from network); 26 Sep 2012 02:55:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Sep 2012 02: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 1TGhmI-0000ZT-3F
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGhmH-0002q9-NW
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:09 +0000
Message-Id: <E1TGhmH-0002q9-NW@xenbits.xen.org>
Date: Wed, 26 Sep 2012 02: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] tmem: consistently make pool_id a
	uint32_t
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1348568677 -7200
# Node ID 805f0ba5e11b54067b0782b920fd8bc6421adfb1
# Parent  240b1de53095bb046f1bb4398b7fb2c7d53bc158
tmem: consistently make pool_id a uint32_t

Treating it as an int could allow a malicious guest to provide a
negative pool_Id, by passing the MAX_POOLS_PER_DOMAIN limit check and
allowing access to the negative offsets of the pool array.

This is part of XSA-15 / CVE-2012-3497.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 25851:fcf567acc92a
xen-unstable date: Tue Sep 11 12:06:43 UTC 2012
---


diff -r 240b1de53095 -r 805f0ba5e11b xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:24:06 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:24:37 2012 +0200
@@ -2420,7 +2420,7 @@ static NOINLINE int tmemc_save_subop(int
     return rc;
 }
 
-static NOINLINE int tmemc_save_get_next_page(int cli_id, int pool_id,
+static NOINLINE int tmemc_save_get_next_page(int cli_id, uint32_t pool_id,
                         tmem_cli_va_t buf, uint32_t bufsize)
 {
     client_t *client = tmh_client_from_cli_id(cli_id);
@@ -2512,7 +2512,7 @@ out:
     return ret;
 }
 
-static int tmemc_restore_put_page(int cli_id, int pool_id, OID *oidp,
+static int tmemc_restore_put_page(int cli_id, uint32_t pool_id, OID *oidp,
                       uint32_t index, tmem_cli_va_t buf, uint32_t bufsize)
 {
     client_t *client = tmh_client_from_cli_id(cli_id);
@@ -2524,7 +2524,7 @@ static int tmemc_restore_put_page(int cl
     return do_tmem_put(pool,oidp,index,0,0,0,bufsize,buf.p);
 }
 
-static int tmemc_restore_flush_page(int cli_id, int pool_id, OID *oidp,
+static int tmemc_restore_flush_page(int cli_id, uint32_t pool_id, OID *oidp,
                         uint32_t index)
 {
     client_t *client = tmh_client_from_cli_id(cli_id);

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 02:55:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 02: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.xen.org>)
	id 1TGhmQ-0001g8-DQ; Wed, 26 Sep 2012 02:55:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGhmO-0001fb-Qz
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:16 +0000
Received: from [85.158.139.211:50977] by server-6.bemta-5.messagelabs.com id
	2B/84-14717-39E62605; Wed, 26 Sep 2012 02:55:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-206.messagelabs.com!1348628114!19910678!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30852 invoked from network); 26 Sep 2012 02:55:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Sep 2012 02: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 1TGhmL-0000Zl-Lx
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGhmL-0002ri-Jf
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:13 +0000
Message-Id: <E1TGhmL-0002ri-Jf@xenbits.xen.org>
Date: Wed, 26 Sep 2012 02: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] tmem: properly drop lock on error
	path in do_tmem_op()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348568841 -7200
# Node ID 91bf384afc83fac5334535aa87dee17d6a07de98
# Parent  397cac9587fec61ee71b2ccf09120a54ecb5b4f8
tmem: properly drop lock on error path in do_tmem_op()

Reported-by: Tim Deegan <tim@xen.org>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
xen-unstable changeset: 25857:109ea6a0c23a
xen-unstable date: Tue Sep 11 12:18:26 UTC 2012
---


diff -r 397cac9587fe -r 91bf384afc83 xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:26:57 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:27:21 2012 +0200
@@ -2662,13 +2662,19 @@ EXPORT long do_tmem_op(tmem_cli_op_t uop
     if ( client != NULL && tmh_client_is_dying(client) )
     {
         rc = -ENODEV;
-        goto out;
+        if ( tmh_lock_all )
+            goto out;
+ simple_error:
+        errored_tmem_ops++;
+        return rc;
     }
 
     if ( unlikely(tmh_get_tmemop_from_client(&op, uops) != 0) )
     {
         printk("tmem: can't get tmem struct from %s\n",client_str);
         rc = -EFAULT;
+        if ( !tmh_lock_all )
+            goto simple_error;
         goto out;
     }
 

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 02:55:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 02: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.xen.org>)
	id 1TGhmQ-0001fz-71; Wed, 26 Sep 2012 02:55:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGhmO-0001fX-Fp
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:16 +0000
Received: from [85.158.143.35:15423] by server-2.bemta-4.messagelabs.com id
	C2/CD-06610-39E62605; Wed, 26 Sep 2012 02:55:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-21.messagelabs.com!1348628113!12747988!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23850 invoked from network); 26 Sep 2012 02:55:14 -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;
	26 Sep 2012 02: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 1TGhmK-0000Zi-UT
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGhmK-0002rT-Se
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:12 +0000
Message-Id: <E1TGhmK-0002rT-Se@xenbits.xen.org>
Date: Wed, 26 Sep 2012 02: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] tmem: properly drop lock on error
	path in do_tmem_get()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348568817 -7200
# Node ID 397cac9587fec61ee71b2ccf09120a54ecb5b4f8
# Parent  2cce0490a2603ae9959cff04d292fe964a8bc28e
tmem: properly drop lock on error path in do_tmem_get()

Also remove a bogus assertion.

Reported-by: Tim Deegan <tim@xen.org>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
xen-unstable changeset: 25856:83b97a59888b
xen-unstable date: Tue Sep 11 12:18:08 UTC 2012
---


diff -r 2cce0490a260 -r 397cac9587fe xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:26:29 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:26:57 2012 +0200
@@ -1793,7 +1793,6 @@ static NOINLINE int do_tmem_get(pool_t *
             list_del(&pgp->us.client_eph_pages);
             list_add_tail(&pgp->us.client_eph_pages,&client->ephemeral_page_list);
             tmem_spin_unlock(&eph_lists_spinlock);
-            ASSERT(obj != NULL);
             obj->last_client = tmh_get_cli_id_from_current();
         }
     }
@@ -1810,6 +1809,8 @@ static NOINLINE int do_tmem_get(pool_t *
     return 1;
 
 bad_copy:
+    obj->no_evict = 0;
+    tmem_spin_unlock(&obj->obj_spinlock);
     failed_copies++;
     return rc;
 }

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 02:55:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 02: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.xen.org>)
	id 1TGhmQ-0001fz-71; Wed, 26 Sep 2012 02:55:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGhmO-0001fX-Fp
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:16 +0000
Received: from [85.158.143.35:15423] by server-2.bemta-4.messagelabs.com id
	C2/CD-06610-39E62605; Wed, 26 Sep 2012 02:55:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-21.messagelabs.com!1348628113!12747988!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23850 invoked from network); 26 Sep 2012 02:55:14 -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;
	26 Sep 2012 02: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 1TGhmK-0000Zi-UT
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGhmK-0002rT-Se
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:12 +0000
Message-Id: <E1TGhmK-0002rT-Se@xenbits.xen.org>
Date: Wed, 26 Sep 2012 02: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] tmem: properly drop lock on error
	path in do_tmem_get()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348568817 -7200
# Node ID 397cac9587fec61ee71b2ccf09120a54ecb5b4f8
# Parent  2cce0490a2603ae9959cff04d292fe964a8bc28e
tmem: properly drop lock on error path in do_tmem_get()

Also remove a bogus assertion.

Reported-by: Tim Deegan <tim@xen.org>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
xen-unstable changeset: 25856:83b97a59888b
xen-unstable date: Tue Sep 11 12:18:08 UTC 2012
---


diff -r 2cce0490a260 -r 397cac9587fe xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:26:29 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:26:57 2012 +0200
@@ -1793,7 +1793,6 @@ static NOINLINE int do_tmem_get(pool_t *
             list_del(&pgp->us.client_eph_pages);
             list_add_tail(&pgp->us.client_eph_pages,&client->ephemeral_page_list);
             tmem_spin_unlock(&eph_lists_spinlock);
-            ASSERT(obj != NULL);
             obj->last_client = tmh_get_cli_id_from_current();
         }
     }
@@ -1810,6 +1809,8 @@ static NOINLINE int do_tmem_get(pool_t *
     return 1;
 
 bad_copy:
+    obj->no_evict = 0;
+    tmem_spin_unlock(&obj->obj_spinlock);
     failed_copies++;
     return rc;
 }

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 02:55:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 02:55:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGhmS-0001hg-Pr; Wed, 26 Sep 2012 02:55:20 +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 1TGhmQ-0001g3-W8
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:19 +0000
Received: from [85.158.138.51:49363] by server-4.bemta-3.messagelabs.com id
	4F/56-24831-69E62605; Wed, 26 Sep 2012 02:55:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-174.messagelabs.com!1348628115!30186221!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26277 invoked from network); 26 Sep 2012 02:55:16 -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;
	26 Sep 2012 02: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 1TGhmN-0000Zu-He
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGhmN-0002sV-92
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:15 +0000
Message-Id: <E1TGhmN-0002sV-92@xenbits.xen.org>
Date: Wed, 26 Sep 2012 02:55:14 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] tmem: cleanup
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348568936 -7200
# Node ID 0c3286621912623e8fa78b6d27f4f2680662f2ac
# Parent  00ff640ebc7bd22b67b4c69f51dd44954c78dca8
tmem: cleanup

- one more case of checking for a specific rather than any error
- drop redundant casts

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
xen-unstable changeset: 25860:e4cb84111610
xen-unstable date: Tue Sep 11 12:19:29 UTC 2012
---


diff -r 00ff640ebc7b -r 0c3286621912 xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:28:24 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:28:56 2012 +0200
@@ -1471,7 +1471,7 @@ static NOINLINE int do_tmem_put_compress
         pgp_free_data(pgp, pgp->us.obj->pool);
     START_CYC_COUNTER(compress);
     ret = tmh_compress_from_client(cmfn, &dst, &size, clibuf);
-    if ( (ret == -EFAULT) || (ret == 0) )
+    if ( ret <= 0 )
         goto out;
     else if ( (size == 0) || (size >= tmem_subpage_maxsize()) ) {
         ret = 0;
diff -r 00ff640ebc7b -r 0c3286621912 xen/common/tmem_xen.c
--- a/xen/common/tmem_xen.c	Tue Sep 25 12:28:24 2012 +0200
+++ b/xen/common/tmem_xen.c	Tue Sep 25 12:28:56 2012 +0200
@@ -121,7 +121,7 @@ static inline void *cli_get_page(tmem_cl
     if ( !ret )
         return NULL;
     *pcli_mfn = cli_mfn;
-    *pcli_pfp = (pfp_t *)page;
+    *pcli_pfp = page;
     return map_domain_page(cli_mfn);
 }
 
@@ -130,11 +130,11 @@ static inline void cli_put_page(void *cl
 {
     if ( mark_dirty )
     {
-        put_page_and_type((struct page_info *)cli_pfp);
+        put_page_and_type(cli_pfp);
         paging_mark_dirty(current->domain,cli_mfn);
     }
     else
-        put_page((struct page_info *)cli_pfp);
+        put_page(cli_pfp);
     unmap_domain_page(cli_va);
 }
 #endif

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 02:55:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 02:55:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGhmS-0001hS-JR; Wed, 26 Sep 2012 02:55:20 +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 1TGhmQ-0001fx-8w
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:18 +0000
Received: from [85.158.138.51:15487] by server-13.bemta-3.messagelabs.com id
	1C/4A-01606-59E62605; Wed, 26 Sep 2012 02:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-174.messagelabs.com!1348628114!24044678!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21690 invoked from network); 26 Sep 2012 02:55:15 -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;
	26 Sep 2012 02: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 1TGhmM-0000Zo-Ak
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGhmM-0002rz-59
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:14 +0000
Message-Id: <E1TGhmM-0002rz-59@xenbits.xen.org>
Date: Wed, 26 Sep 2012 02:55:13 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] tmem: reduce severity of log
	messages
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348568870 -7200
# Node ID 5a3829c943fff0295aa604a806009025c22dc9f3
# Parent  91bf384afc83fac5334535aa87dee17d6a07de98
tmem: reduce severity of log messages

Otherwise they can be used by a guest to spam the hypervisor log with
all settings at their defaults.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
xen-unstable changeset: 25858:0520982a602a
xen-unstable date: Tue Sep 11 12:18:36 UTC 2012
---


diff -r 91bf384afc83 -r 5a3829c943ff xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:27:21 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:27:50 2012 +0200
@@ -1110,7 +1110,7 @@ static int shared_pool_join(pool_t *pool
     sl->client = new_client;
     list_add_tail(&sl->share_list, &pool->share_list);
     if ( new_client->cli_id != pool->client->cli_id )
-        printk("adding new %s %d to shared pool owned by %s %d\n",
+        tmh_client_info("adding new %s %d to shared pool owned by %s %d\n",
             client_str, new_client->cli_id, client_str, pool->client->cli_id);
     return ++pool->shared_count;
 }
@@ -1140,7 +1140,7 @@ static NOINLINE void shared_pool_reassig
     old_client->eph_count -= _atomic_read(pool->pgp_count);
     list_splice_init(&old_client->ephemeral_page_list,
                      &new_client->ephemeral_page_list);
-    printk("reassigned shared pool from %s=%d to %s=%d pool_id=%d\n",
+    tmh_client_info("reassigned shared pool from %s=%d to %s=%d pool_id=%d\n",
         cli_id_str, old_client->cli_id, cli_id_str, new_client->cli_id, poolid);
     pool->pool_id = poolid;
 }
@@ -1176,7 +1176,7 @@ static NOINLINE int shared_pool_quit(poo
             }
         return 0;
     }
-    printk("tmem: no match unsharing pool, %s=%d\n",
+    tmh_client_warn("tmem: no match unsharing pool, %s=%d\n",
         cli_id_str,pool->client->cli_id);
     return -1;
 }
@@ -1187,17 +1187,18 @@ static void pool_flush(pool_t *pool, cli
     ASSERT(pool != NULL);
     if ( (is_shared(pool)) && (shared_pool_quit(pool,cli_id) > 0) )
     {
-        printk("tmem: %s=%d no longer using shared pool %d owned by %s=%d\n",
+        tmh_client_warn("tmem: %s=%d no longer using shared pool %d owned by %s=%d\n",
            cli_id_str, cli_id, pool->pool_id, cli_id_str,pool->client->cli_id);
         return;
     }
-    printk("%s %s-%s tmem pool ",destroy?"destroying":"flushing",
-        is_persistent(pool) ? "persistent" : "ephemeral" ,
-        is_shared(pool) ? "shared" : "private");
-    printk("%s=%d pool_id=%d\n", cli_id_str,pool->client->cli_id,pool->pool_id);
+    tmh_client_info("%s %s-%s tmem pool %s=%d pool_id=%d\n",
+                    destroy ? "destroying" : "flushing",
+                    is_persistent(pool) ? "persistent" : "ephemeral" ,
+                    is_shared(pool) ? "shared" : "private",
+                    cli_id_str, pool->client->cli_id, pool->pool_id);
     if ( pool->client->live_migrating )
     {
-        printk("can't %s pool while %s is live-migrating\n",
+        tmh_client_warn("can't %s pool while %s is live-migrating\n",
                destroy?"destroy":"flush", client_str);
         return;
     }
@@ -1216,21 +1217,22 @@ static client_t *client_create(cli_id_t 
     client_t *client = tmh_alloc_infra(sizeof(client_t),__alignof__(client_t));
     int i;
 
-    printk("tmem: initializing tmem capability for %s=%d...",cli_id_str,cli_id);
+    tmh_client_info("tmem: initializing tmem capability for %s=%d...",
+                    cli_id_str, cli_id);
     if ( client == NULL )
     {
-        printk("failed... out of memory\n");
+        tmh_client_err("failed... out of memory\n");
         goto fail;
     }
     memset(client,0,sizeof(client_t));
     if ( (client->tmh = tmh_client_init(cli_id)) == NULL )
     {
-        printk("failed... can't allocate host-dependent part of client\n");
+        tmh_client_err("failed... can't allocate host-dependent part of client\n");
         goto fail;
     }
     if ( !tmh_set_client_from_id(client, client->tmh, cli_id) )
     {
-        printk("failed... can't set client\n");
+        tmh_client_err("failed... can't set client\n");
         goto fail;
     }
     client->cli_id = cli_id;
@@ -1252,7 +1254,7 @@ static client_t *client_create(cli_id_t 
     client->eph_count = client->eph_count_max = 0;
     client->total_cycles = 0; client->succ_pers_puts = 0;
     client->succ_eph_gets = 0; client->succ_pers_gets = 0;
-    printk("ok\n");
+    tmh_client_info("ok\n");
     return client;
 
  fail:
@@ -1906,32 +1908,33 @@ static NOINLINE int do_tmem_new_pool(cli
         cli_id = tmh_get_cli_id_from_current();
     else
         cli_id = this_cli_id;
-    printk("tmem: allocating %s-%s tmem pool for %s=%d...",
+    tmh_client_info("tmem: allocating %s-%s tmem pool for %s=%d...",
         persistent ? "persistent" : "ephemeral" ,
         shared ? "shared" : "private", cli_id_str, cli_id);
     if ( specversion != TMEM_SPEC_VERSION )
     {
-        printk("failed... unsupported spec version\n");
+        tmh_client_err("failed... unsupported spec version\n");
         return -EPERM;
     }
     if ( pagebits != (PAGE_SHIFT - 12) )
     {
-        printk("failed... unsupported pagesize %d\n",1<<(pagebits+12));
+        tmh_client_err("failed... unsupported pagesize %d\n",
+                       1 << (pagebits + 12));
         return -EPERM;
     }
     if ( flags & TMEM_POOL_PRECOMPRESSED )
     {
-        printk("failed... precompression flag set but unsupported\n");
+        tmh_client_err("failed... precompression flag set but unsupported\n");
         return -EPERM;
     }
     if ( flags & TMEM_POOL_RESERVED_BITS )
     {
-        printk("failed... reserved bits must be zero\n");
+        tmh_client_err("failed... reserved bits must be zero\n");
         return -EPERM;
     }
     if ( (pool = pool_alloc()) == NULL )
     {
-        printk("failed... out of memory\n");
+        tmh_client_err("failed... out of memory\n");
         return -ENOMEM;
     }
     if ( this_cli_id != CLI_ID_NULL )
@@ -1950,7 +1953,7 @@ static NOINLINE int do_tmem_new_pool(cli
                 break;
         if ( d_poolid >= MAX_POOLS_PER_DOMAIN )
         {
-            printk("failed... no more pool slots available for this %s\n",
+            tmh_client_err("failed... no more pool slots available for this %s\n",
                    client_str);
             goto fail;
         }
@@ -1980,9 +1983,8 @@ static NOINLINE int do_tmem_new_pool(cli
             {
                 if ( shpool->uuid[0] == uuid_lo && shpool->uuid[1] == uuid_hi )
                 {
-                    printk("(matches shared pool uuid=%"PRIx64".%"PRIx64") ",
-                        uuid_hi, uuid_lo);
-                    printk("pool_id=%d\n",d_poolid);
+                    tmh_client_info("(matches shared pool uuid=%"PRIx64".%"PRIx64") pool_id=%d\n",
+                        uuid_hi, uuid_lo, d_poolid);
                     client->pools[d_poolid] = global_shared_pools[s_poolid];
                     shared_pool_join(global_shared_pools[s_poolid], client);
                     pool_free(pool);
@@ -1994,7 +1996,7 @@ static NOINLINE int do_tmem_new_pool(cli
         }
         if ( first_unused_s_poolid == MAX_GLOBAL_SHARED_POOLS )
         {
-            printk("tmem: failed... no global shared pool slots available\n");
+            tmh_client_warn("tmem: failed... no global shared pool slots available\n");
             goto fail;
         }
         else
@@ -2010,7 +2012,7 @@ static NOINLINE int do_tmem_new_pool(cli
     pool->pool_id = d_poolid;
     pool->persistent = persistent;
     pool->uuid[0] = uuid_lo; pool->uuid[1] = uuid_hi;
-    printk("pool_id=%d\n",d_poolid);
+    tmh_client_info("pool_id=%d\n", d_poolid);
     return d_poolid;
 
 fail:
@@ -2033,14 +2035,15 @@ static int tmemc_freeze_pools(cli_id_t c
     {
         list_for_each_entry(client,&global_client_list,client_list)
             client_freeze(client,freeze);
-        printk("tmem: all pools %s for all %ss\n",s,client_str);
+        tmh_client_info("tmem: all pools %s for all %ss\n", s, client_str);
     }
     else
     {
         if ( (client = tmh_client_from_cli_id(cli_id)) == NULL)
             return -1;
         client_freeze(client,freeze);
-        printk("tmem: all pools %s for %s=%d\n",s,cli_id_str,cli_id);
+        tmh_client_info("tmem: all pools %s for %s=%d\n",
+                         s, cli_id_str, cli_id);
     }
     return 0;
 }
@@ -2051,7 +2054,7 @@ static int tmemc_flush_mem(cli_id_t cli_
 
     if ( cli_id != CLI_ID_NULL )
     {
-        printk("tmem: %s-specific flush not supported yet, use --all\n",
+        tmh_client_warn("tmem: %s-specific flush not supported yet, use --all\n",
            client_str);
         return -1;
     }
@@ -2264,13 +2267,15 @@ static int tmemc_set_var_one(client_t *c
     case TMEMC_SET_WEIGHT:
         old_weight = client->weight;
         client->weight = arg1;
-        printk("tmem: weight set to %d for %s=%d\n",arg1,cli_id_str,cli_id);
+        tmh_client_info("tmem: weight set to %d for %s=%d\n",
+                        arg1, cli_id_str, cli_id);
         atomic_sub(old_weight,&client_weight_total);
         atomic_add(client->weight,&client_weight_total);
         break;
     case TMEMC_SET_CAP:
         client->cap = arg1;
-        printk("tmem: cap set to %d for %s=%d\n",arg1,cli_id_str,cli_id);
+        tmh_client_info("tmem: cap set to %d for %s=%d\n",
+                        arg1, cli_id_str, cli_id);
         break;
     case TMEMC_SET_COMPRESS:
 #ifdef __i386__
@@ -2278,17 +2283,17 @@ static int tmemc_set_var_one(client_t *c
 #endif
         if ( tmh_dedup_enabled() )
         {
-            printk("tmem: compression %s for all %ss, cannot be changed "
-                   "when tmem_dedup is enabled\n",
-            tmh_compression_enabled() ? "enabled" : "disabled",client_str);
+            tmh_client_warn("tmem: compression %s for all %ss, cannot be changed when tmem_dedup is enabled\n",
+                            tmh_compression_enabled() ? "enabled" : "disabled",
+                            client_str);
             return -1;
         }
         client->compress = arg1 ? 1 : 0;
-        printk("tmem: compression %s for %s=%d\n",
+        tmh_client_info("tmem: compression %s for %s=%d\n",
             arg1 ? "enabled" : "disabled",cli_id_str,cli_id);
         break;
     default:
-        printk("tmem: unknown subop %d for tmemc_set_var\n",subop);
+        tmh_client_warn("tmem: unknown subop %d for tmemc_set_var\n", subop);
         return -1;
     }
     return 0;
@@ -2671,7 +2676,7 @@ EXPORT long do_tmem_op(tmem_cli_op_t uop
 
     if ( unlikely(tmh_get_tmemop_from_client(&op, uops) != 0) )
     {
-        printk("tmem: can't get tmem struct from %s\n",client_str);
+        tmh_client_err("tmem: can't get tmem struct from %s\n", client_str);
         rc = -EFAULT;
         if ( !tmh_lock_all )
             goto simple_error;
@@ -2705,7 +2710,8 @@ EXPORT long do_tmem_op(tmem_cli_op_t uop
         tmem_write_lock_set = 1;
         if ( (client = client_create(tmh_get_cli_id_from_current())) == NULL )
         {
-            printk("tmem: can't create tmem structure for %s\n",client_str);
+            tmh_client_err("tmem: can't create tmem structure for %s\n",
+                           client_str);
             rc = -ENOMEM;
             goto out;
         }
@@ -2729,8 +2735,8 @@ EXPORT long do_tmem_op(tmem_cli_op_t uop
         if ( ((uint32_t)op.pool_id >= MAX_POOLS_PER_DOMAIN) ||
              ((pool = client->pools[op.pool_id]) == NULL) )
         {
+            tmh_client_err("tmem: operation requested on uncreated pool\n");
             rc = -ENODEV;
-            printk("tmem: operation requested on uncreated pool\n");
             goto out;
         }
         ASSERT_SENTINEL(pool,POOL);
@@ -2786,11 +2792,11 @@ EXPORT long do_tmem_op(tmem_cli_op_t uop
         break;
     case TMEM_XCHG:
         /* need to hold global lock to ensure xchg is atomic */
-        printk("tmem_xchg op not implemented yet\n");
+        tmh_client_warn("tmem_xchg op not implemented yet\n");
         rc = 0;
         break;
     default:
-        printk("tmem: op %d not implemented\n", op.cmd);
+        tmh_client_warn("tmem: op %d not implemented\n", op.cmd);
         rc = 0;
         break;
     }
diff -r 91bf384afc83 -r 5a3829c943ff xen/include/xen/tmem_xen.h
--- a/xen/include/xen/tmem_xen.h	Tue Sep 25 12:27:21 2012 +0200
+++ b/xen/include/xen/tmem_xen.h	Tue Sep 25 12:27:50 2012 +0200
@@ -512,6 +512,9 @@ int tmh_copy_to_client(tmem_cli_mfn_t, p
 
 extern int tmh_copy_tze_to_client(tmem_cli_mfn_t cmfn, void *tmem_va, pagesize_t len);
 
+#define tmh_client_err(fmt, args...)  printk(XENLOG_G_ERR fmt, ##args)
+#define tmh_client_warn(fmt, args...) printk(XENLOG_G_WARNING fmt, ##args)
+#define tmh_client_info(fmt, args...) printk(XENLOG_G_INFO fmt, ##args)
 
 #define TMEM_PERF
 #ifdef TMEM_PERF

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 02:55:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 02:55:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGhmS-0001hZ-NK; Wed, 26 Sep 2012 02:55:20 +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 1TGhmR-0001fx-3O
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:19 +0000
Received: from [85.158.137.99:23548] by server-13.bemta-3.messagelabs.com id
	FD/4A-01606-69E62605; Wed, 26 Sep 2012 02:55:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-217.messagelabs.com!1348628116!19125679!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14005 invoked from network); 26 Sep 2012 02:55:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Sep 2012 02: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 1TGhmN-0000Zx-Vj
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGhmN-0002sk-RO
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:15 +0000
Message-Id: <E1TGhmN-0002sk-RO@xenbits.xen.org>
Date: Wed, 26 Sep 2012 02:55:15 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] tmem: bump pool version to 1 to
	fix restore issue when tmem enabled
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Zhenzhong Duan <zhenzhong.duan@oracle.com>
# Date 1348568969 -7200
# Node ID fb0561ba7d9ec9e6f39e8cb5f93596880008dae5
# Parent  0c3286621912623e8fa78b6d27f4f2680662f2ac
tmem: bump pool version to 1 to fix restore issue when tmem enabled

Restore fails when tmem is enabled both in hypervisor and guest. This
is due to spec version mismatch when restoring a pool.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
xen-unstable changeset: 25929:fee83ac77d8c
xen-unstable date: Wed Sep 19 15:38:47 UTC 2012
---


diff -r 0c3286621912 -r fb0561ba7d9e xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:28:56 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:29:29 2012 +0200
@@ -2410,7 +2410,8 @@ static NOINLINE int tmemc_save_subop(int
              break;
          rc = (pool->persistent ? TMEM_POOL_PERSIST : 0) |
               (pool->shared ? TMEM_POOL_SHARED : 0) |
-              (pool->pageshift << TMEM_POOL_PAGESIZE_SHIFT);
+              (pool->pageshift << TMEM_POOL_PAGESIZE_SHIFT) |
+              (TMEM_SPEC_VERSION << TMEM_POOL_VERSION_SHIFT);
         break;
     case TMEMC_SAVE_GET_POOL_NPAGES:
          if ( pool == NULL )

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 02:55:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 02:55:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGhmS-0001hZ-NK; Wed, 26 Sep 2012 02:55:20 +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 1TGhmR-0001fx-3O
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:19 +0000
Received: from [85.158.137.99:23548] by server-13.bemta-3.messagelabs.com id
	FD/4A-01606-69E62605; Wed, 26 Sep 2012 02:55:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-217.messagelabs.com!1348628116!19125679!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14005 invoked from network); 26 Sep 2012 02:55:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Sep 2012 02: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 1TGhmN-0000Zx-Vj
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGhmN-0002sk-RO
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:15 +0000
Message-Id: <E1TGhmN-0002sk-RO@xenbits.xen.org>
Date: Wed, 26 Sep 2012 02:55:15 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] tmem: bump pool version to 1 to
	fix restore issue when tmem enabled
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Zhenzhong Duan <zhenzhong.duan@oracle.com>
# Date 1348568969 -7200
# Node ID fb0561ba7d9ec9e6f39e8cb5f93596880008dae5
# Parent  0c3286621912623e8fa78b6d27f4f2680662f2ac
tmem: bump pool version to 1 to fix restore issue when tmem enabled

Restore fails when tmem is enabled both in hypervisor and guest. This
is due to spec version mismatch when restoring a pool.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
xen-unstable changeset: 25929:fee83ac77d8c
xen-unstable date: Wed Sep 19 15:38:47 UTC 2012
---


diff -r 0c3286621912 -r fb0561ba7d9e xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:28:56 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:29:29 2012 +0200
@@ -2410,7 +2410,8 @@ static NOINLINE int tmemc_save_subop(int
              break;
          rc = (pool->persistent ? TMEM_POOL_PERSIST : 0) |
               (pool->shared ? TMEM_POOL_SHARED : 0) |
-              (pool->pageshift << TMEM_POOL_PAGESIZE_SHIFT);
+              (pool->pageshift << TMEM_POOL_PAGESIZE_SHIFT) |
+              (TMEM_SPEC_VERSION << TMEM_POOL_VERSION_SHIFT);
         break;
     case TMEMC_SAVE_GET_POOL_NPAGES:
          if ( pool == NULL )

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 02:55:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 02:55:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGhmS-0001hS-JR; Wed, 26 Sep 2012 02:55:20 +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 1TGhmQ-0001fx-8w
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:18 +0000
Received: from [85.158.138.51:15487] by server-13.bemta-3.messagelabs.com id
	1C/4A-01606-59E62605; Wed, 26 Sep 2012 02:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-174.messagelabs.com!1348628114!24044678!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21690 invoked from network); 26 Sep 2012 02:55:15 -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;
	26 Sep 2012 02: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 1TGhmM-0000Zo-Ak
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGhmM-0002rz-59
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:14 +0000
Message-Id: <E1TGhmM-0002rz-59@xenbits.xen.org>
Date: Wed, 26 Sep 2012 02:55:13 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] tmem: reduce severity of log
	messages
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348568870 -7200
# Node ID 5a3829c943fff0295aa604a806009025c22dc9f3
# Parent  91bf384afc83fac5334535aa87dee17d6a07de98
tmem: reduce severity of log messages

Otherwise they can be used by a guest to spam the hypervisor log with
all settings at their defaults.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
xen-unstable changeset: 25858:0520982a602a
xen-unstable date: Tue Sep 11 12:18:36 UTC 2012
---


diff -r 91bf384afc83 -r 5a3829c943ff xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:27:21 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:27:50 2012 +0200
@@ -1110,7 +1110,7 @@ static int shared_pool_join(pool_t *pool
     sl->client = new_client;
     list_add_tail(&sl->share_list, &pool->share_list);
     if ( new_client->cli_id != pool->client->cli_id )
-        printk("adding new %s %d to shared pool owned by %s %d\n",
+        tmh_client_info("adding new %s %d to shared pool owned by %s %d\n",
             client_str, new_client->cli_id, client_str, pool->client->cli_id);
     return ++pool->shared_count;
 }
@@ -1140,7 +1140,7 @@ static NOINLINE void shared_pool_reassig
     old_client->eph_count -= _atomic_read(pool->pgp_count);
     list_splice_init(&old_client->ephemeral_page_list,
                      &new_client->ephemeral_page_list);
-    printk("reassigned shared pool from %s=%d to %s=%d pool_id=%d\n",
+    tmh_client_info("reassigned shared pool from %s=%d to %s=%d pool_id=%d\n",
         cli_id_str, old_client->cli_id, cli_id_str, new_client->cli_id, poolid);
     pool->pool_id = poolid;
 }
@@ -1176,7 +1176,7 @@ static NOINLINE int shared_pool_quit(poo
             }
         return 0;
     }
-    printk("tmem: no match unsharing pool, %s=%d\n",
+    tmh_client_warn("tmem: no match unsharing pool, %s=%d\n",
         cli_id_str,pool->client->cli_id);
     return -1;
 }
@@ -1187,17 +1187,18 @@ static void pool_flush(pool_t *pool, cli
     ASSERT(pool != NULL);
     if ( (is_shared(pool)) && (shared_pool_quit(pool,cli_id) > 0) )
     {
-        printk("tmem: %s=%d no longer using shared pool %d owned by %s=%d\n",
+        tmh_client_warn("tmem: %s=%d no longer using shared pool %d owned by %s=%d\n",
            cli_id_str, cli_id, pool->pool_id, cli_id_str,pool->client->cli_id);
         return;
     }
-    printk("%s %s-%s tmem pool ",destroy?"destroying":"flushing",
-        is_persistent(pool) ? "persistent" : "ephemeral" ,
-        is_shared(pool) ? "shared" : "private");
-    printk("%s=%d pool_id=%d\n", cli_id_str,pool->client->cli_id,pool->pool_id);
+    tmh_client_info("%s %s-%s tmem pool %s=%d pool_id=%d\n",
+                    destroy ? "destroying" : "flushing",
+                    is_persistent(pool) ? "persistent" : "ephemeral" ,
+                    is_shared(pool) ? "shared" : "private",
+                    cli_id_str, pool->client->cli_id, pool->pool_id);
     if ( pool->client->live_migrating )
     {
-        printk("can't %s pool while %s is live-migrating\n",
+        tmh_client_warn("can't %s pool while %s is live-migrating\n",
                destroy?"destroy":"flush", client_str);
         return;
     }
@@ -1216,21 +1217,22 @@ static client_t *client_create(cli_id_t 
     client_t *client = tmh_alloc_infra(sizeof(client_t),__alignof__(client_t));
     int i;
 
-    printk("tmem: initializing tmem capability for %s=%d...",cli_id_str,cli_id);
+    tmh_client_info("tmem: initializing tmem capability for %s=%d...",
+                    cli_id_str, cli_id);
     if ( client == NULL )
     {
-        printk("failed... out of memory\n");
+        tmh_client_err("failed... out of memory\n");
         goto fail;
     }
     memset(client,0,sizeof(client_t));
     if ( (client->tmh = tmh_client_init(cli_id)) == NULL )
     {
-        printk("failed... can't allocate host-dependent part of client\n");
+        tmh_client_err("failed... can't allocate host-dependent part of client\n");
         goto fail;
     }
     if ( !tmh_set_client_from_id(client, client->tmh, cli_id) )
     {
-        printk("failed... can't set client\n");
+        tmh_client_err("failed... can't set client\n");
         goto fail;
     }
     client->cli_id = cli_id;
@@ -1252,7 +1254,7 @@ static client_t *client_create(cli_id_t 
     client->eph_count = client->eph_count_max = 0;
     client->total_cycles = 0; client->succ_pers_puts = 0;
     client->succ_eph_gets = 0; client->succ_pers_gets = 0;
-    printk("ok\n");
+    tmh_client_info("ok\n");
     return client;
 
  fail:
@@ -1906,32 +1908,33 @@ static NOINLINE int do_tmem_new_pool(cli
         cli_id = tmh_get_cli_id_from_current();
     else
         cli_id = this_cli_id;
-    printk("tmem: allocating %s-%s tmem pool for %s=%d...",
+    tmh_client_info("tmem: allocating %s-%s tmem pool for %s=%d...",
         persistent ? "persistent" : "ephemeral" ,
         shared ? "shared" : "private", cli_id_str, cli_id);
     if ( specversion != TMEM_SPEC_VERSION )
     {
-        printk("failed... unsupported spec version\n");
+        tmh_client_err("failed... unsupported spec version\n");
         return -EPERM;
     }
     if ( pagebits != (PAGE_SHIFT - 12) )
     {
-        printk("failed... unsupported pagesize %d\n",1<<(pagebits+12));
+        tmh_client_err("failed... unsupported pagesize %d\n",
+                       1 << (pagebits + 12));
         return -EPERM;
     }
     if ( flags & TMEM_POOL_PRECOMPRESSED )
     {
-        printk("failed... precompression flag set but unsupported\n");
+        tmh_client_err("failed... precompression flag set but unsupported\n");
         return -EPERM;
     }
     if ( flags & TMEM_POOL_RESERVED_BITS )
     {
-        printk("failed... reserved bits must be zero\n");
+        tmh_client_err("failed... reserved bits must be zero\n");
         return -EPERM;
     }
     if ( (pool = pool_alloc()) == NULL )
     {
-        printk("failed... out of memory\n");
+        tmh_client_err("failed... out of memory\n");
         return -ENOMEM;
     }
     if ( this_cli_id != CLI_ID_NULL )
@@ -1950,7 +1953,7 @@ static NOINLINE int do_tmem_new_pool(cli
                 break;
         if ( d_poolid >= MAX_POOLS_PER_DOMAIN )
         {
-            printk("failed... no more pool slots available for this %s\n",
+            tmh_client_err("failed... no more pool slots available for this %s\n",
                    client_str);
             goto fail;
         }
@@ -1980,9 +1983,8 @@ static NOINLINE int do_tmem_new_pool(cli
             {
                 if ( shpool->uuid[0] == uuid_lo && shpool->uuid[1] == uuid_hi )
                 {
-                    printk("(matches shared pool uuid=%"PRIx64".%"PRIx64") ",
-                        uuid_hi, uuid_lo);
-                    printk("pool_id=%d\n",d_poolid);
+                    tmh_client_info("(matches shared pool uuid=%"PRIx64".%"PRIx64") pool_id=%d\n",
+                        uuid_hi, uuid_lo, d_poolid);
                     client->pools[d_poolid] = global_shared_pools[s_poolid];
                     shared_pool_join(global_shared_pools[s_poolid], client);
                     pool_free(pool);
@@ -1994,7 +1996,7 @@ static NOINLINE int do_tmem_new_pool(cli
         }
         if ( first_unused_s_poolid == MAX_GLOBAL_SHARED_POOLS )
         {
-            printk("tmem: failed... no global shared pool slots available\n");
+            tmh_client_warn("tmem: failed... no global shared pool slots available\n");
             goto fail;
         }
         else
@@ -2010,7 +2012,7 @@ static NOINLINE int do_tmem_new_pool(cli
     pool->pool_id = d_poolid;
     pool->persistent = persistent;
     pool->uuid[0] = uuid_lo; pool->uuid[1] = uuid_hi;
-    printk("pool_id=%d\n",d_poolid);
+    tmh_client_info("pool_id=%d\n", d_poolid);
     return d_poolid;
 
 fail:
@@ -2033,14 +2035,15 @@ static int tmemc_freeze_pools(cli_id_t c
     {
         list_for_each_entry(client,&global_client_list,client_list)
             client_freeze(client,freeze);
-        printk("tmem: all pools %s for all %ss\n",s,client_str);
+        tmh_client_info("tmem: all pools %s for all %ss\n", s, client_str);
     }
     else
     {
         if ( (client = tmh_client_from_cli_id(cli_id)) == NULL)
             return -1;
         client_freeze(client,freeze);
-        printk("tmem: all pools %s for %s=%d\n",s,cli_id_str,cli_id);
+        tmh_client_info("tmem: all pools %s for %s=%d\n",
+                         s, cli_id_str, cli_id);
     }
     return 0;
 }
@@ -2051,7 +2054,7 @@ static int tmemc_flush_mem(cli_id_t cli_
 
     if ( cli_id != CLI_ID_NULL )
     {
-        printk("tmem: %s-specific flush not supported yet, use --all\n",
+        tmh_client_warn("tmem: %s-specific flush not supported yet, use --all\n",
            client_str);
         return -1;
     }
@@ -2264,13 +2267,15 @@ static int tmemc_set_var_one(client_t *c
     case TMEMC_SET_WEIGHT:
         old_weight = client->weight;
         client->weight = arg1;
-        printk("tmem: weight set to %d for %s=%d\n",arg1,cli_id_str,cli_id);
+        tmh_client_info("tmem: weight set to %d for %s=%d\n",
+                        arg1, cli_id_str, cli_id);
         atomic_sub(old_weight,&client_weight_total);
         atomic_add(client->weight,&client_weight_total);
         break;
     case TMEMC_SET_CAP:
         client->cap = arg1;
-        printk("tmem: cap set to %d for %s=%d\n",arg1,cli_id_str,cli_id);
+        tmh_client_info("tmem: cap set to %d for %s=%d\n",
+                        arg1, cli_id_str, cli_id);
         break;
     case TMEMC_SET_COMPRESS:
 #ifdef __i386__
@@ -2278,17 +2283,17 @@ static int tmemc_set_var_one(client_t *c
 #endif
         if ( tmh_dedup_enabled() )
         {
-            printk("tmem: compression %s for all %ss, cannot be changed "
-                   "when tmem_dedup is enabled\n",
-            tmh_compression_enabled() ? "enabled" : "disabled",client_str);
+            tmh_client_warn("tmem: compression %s for all %ss, cannot be changed when tmem_dedup is enabled\n",
+                            tmh_compression_enabled() ? "enabled" : "disabled",
+                            client_str);
             return -1;
         }
         client->compress = arg1 ? 1 : 0;
-        printk("tmem: compression %s for %s=%d\n",
+        tmh_client_info("tmem: compression %s for %s=%d\n",
             arg1 ? "enabled" : "disabled",cli_id_str,cli_id);
         break;
     default:
-        printk("tmem: unknown subop %d for tmemc_set_var\n",subop);
+        tmh_client_warn("tmem: unknown subop %d for tmemc_set_var\n", subop);
         return -1;
     }
     return 0;
@@ -2671,7 +2676,7 @@ EXPORT long do_tmem_op(tmem_cli_op_t uop
 
     if ( unlikely(tmh_get_tmemop_from_client(&op, uops) != 0) )
     {
-        printk("tmem: can't get tmem struct from %s\n",client_str);
+        tmh_client_err("tmem: can't get tmem struct from %s\n", client_str);
         rc = -EFAULT;
         if ( !tmh_lock_all )
             goto simple_error;
@@ -2705,7 +2710,8 @@ EXPORT long do_tmem_op(tmem_cli_op_t uop
         tmem_write_lock_set = 1;
         if ( (client = client_create(tmh_get_cli_id_from_current())) == NULL )
         {
-            printk("tmem: can't create tmem structure for %s\n",client_str);
+            tmh_client_err("tmem: can't create tmem structure for %s\n",
+                           client_str);
             rc = -ENOMEM;
             goto out;
         }
@@ -2729,8 +2735,8 @@ EXPORT long do_tmem_op(tmem_cli_op_t uop
         if ( ((uint32_t)op.pool_id >= MAX_POOLS_PER_DOMAIN) ||
              ((pool = client->pools[op.pool_id]) == NULL) )
         {
+            tmh_client_err("tmem: operation requested on uncreated pool\n");
             rc = -ENODEV;
-            printk("tmem: operation requested on uncreated pool\n");
             goto out;
         }
         ASSERT_SENTINEL(pool,POOL);
@@ -2786,11 +2792,11 @@ EXPORT long do_tmem_op(tmem_cli_op_t uop
         break;
     case TMEM_XCHG:
         /* need to hold global lock to ensure xchg is atomic */
-        printk("tmem_xchg op not implemented yet\n");
+        tmh_client_warn("tmem_xchg op not implemented yet\n");
         rc = 0;
         break;
     default:
-        printk("tmem: op %d not implemented\n", op.cmd);
+        tmh_client_warn("tmem: op %d not implemented\n", op.cmd);
         rc = 0;
         break;
     }
diff -r 91bf384afc83 -r 5a3829c943ff xen/include/xen/tmem_xen.h
--- a/xen/include/xen/tmem_xen.h	Tue Sep 25 12:27:21 2012 +0200
+++ b/xen/include/xen/tmem_xen.h	Tue Sep 25 12:27:50 2012 +0200
@@ -512,6 +512,9 @@ int tmh_copy_to_client(tmem_cli_mfn_t, p
 
 extern int tmh_copy_tze_to_client(tmem_cli_mfn_t cmfn, void *tmem_va, pagesize_t len);
 
+#define tmh_client_err(fmt, args...)  printk(XENLOG_G_ERR fmt, ##args)
+#define tmh_client_warn(fmt, args...) printk(XENLOG_G_WARNING fmt, ##args)
+#define tmh_client_info(fmt, args...) printk(XENLOG_G_INFO fmt, ##args)
 
 #define TMEM_PERF
 #ifdef TMEM_PERF

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 02:55:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 02:55:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGhmS-0001hg-Pr; Wed, 26 Sep 2012 02:55:20 +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 1TGhmQ-0001g3-W8
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:19 +0000
Received: from [85.158.138.51:49363] by server-4.bemta-3.messagelabs.com id
	4F/56-24831-69E62605; Wed, 26 Sep 2012 02:55:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-174.messagelabs.com!1348628115!30186221!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26277 invoked from network); 26 Sep 2012 02:55:16 -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;
	26 Sep 2012 02: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 1TGhmN-0000Zu-He
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGhmN-0002sV-92
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:15 +0000
Message-Id: <E1TGhmN-0002sV-92@xenbits.xen.org>
Date: Wed, 26 Sep 2012 02:55:14 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] tmem: cleanup
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348568936 -7200
# Node ID 0c3286621912623e8fa78b6d27f4f2680662f2ac
# Parent  00ff640ebc7bd22b67b4c69f51dd44954c78dca8
tmem: cleanup

- one more case of checking for a specific rather than any error
- drop redundant casts

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
xen-unstable changeset: 25860:e4cb84111610
xen-unstable date: Tue Sep 11 12:19:29 UTC 2012
---


diff -r 00ff640ebc7b -r 0c3286621912 xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:28:24 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:28:56 2012 +0200
@@ -1471,7 +1471,7 @@ static NOINLINE int do_tmem_put_compress
         pgp_free_data(pgp, pgp->us.obj->pool);
     START_CYC_COUNTER(compress);
     ret = tmh_compress_from_client(cmfn, &dst, &size, clibuf);
-    if ( (ret == -EFAULT) || (ret == 0) )
+    if ( ret <= 0 )
         goto out;
     else if ( (size == 0) || (size >= tmem_subpage_maxsize()) ) {
         ret = 0;
diff -r 00ff640ebc7b -r 0c3286621912 xen/common/tmem_xen.c
--- a/xen/common/tmem_xen.c	Tue Sep 25 12:28:24 2012 +0200
+++ b/xen/common/tmem_xen.c	Tue Sep 25 12:28:56 2012 +0200
@@ -121,7 +121,7 @@ static inline void *cli_get_page(tmem_cl
     if ( !ret )
         return NULL;
     *pcli_mfn = cli_mfn;
-    *pcli_pfp = (pfp_t *)page;
+    *pcli_pfp = page;
     return map_domain_page(cli_mfn);
 }
 
@@ -130,11 +130,11 @@ static inline void cli_put_page(void *cl
 {
     if ( mark_dirty )
     {
-        put_page_and_type((struct page_info *)cli_pfp);
+        put_page_and_type(cli_pfp);
         paging_mark_dirty(current->domain,cli_mfn);
     }
     else
-        put_page((struct page_info *)cli_pfp);
+        put_page(cli_pfp);
     unmap_domain_page(cli_va);
 }
 #endif

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 02:55:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 02:55:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGhmU-0001j0-4T; Wed, 26 Sep 2012 02: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 1TGhmS-0001fM-IV
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-27.messagelabs.com!1348628111!9074552!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7125 invoked from network); 26 Sep 2012 02:55:12 -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;
	26 Sep 2012 02: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 1TGhmJ-0000Zc-JC
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGhmJ-0002qt-DY
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:11 +0000
Message-Id: <E1TGhmJ-0002qt-DY@xenbits.xen.org>
Date: Wed, 26 Sep 2012 02: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] tmem: don't access guest memory
	without using the accessors intended for this
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348568766 -7200
# Node ID 122caf666c0cd07bb0829516c2f6d9f4d002fefe
# Parent  8dba0836f71b0ff37861dc42eae7d4c78b10dbe5
tmem: don't access guest memory without using the accessors intended for this

This is not permitted, not even for buffers coming from Dom0 (and it
would also break the moment Dom0 runs in HVM mode). An implication from
the changes here is that tmh_copy_page() can't be used anymore for
control operations calling tmh_copy_{from,to}_client() (as those pass
the buffer by virtual address rather than MFN).

Note that tmemc_save_get_next_page() previously didn't set the returned
handle's pool_id field, while the new code does. It need to be
confirmed that this is not a problem (otherwise the copy-out operation
will require further tmh_...() abstractions to be added).

Further note that the patch removes (rather than adjusts) an invalid
call to unmap_domain_page() (no matching map_domain_page()) from
tmh_compress_from_client() and adds a missing one to an error return
path in tmh_copy_from_client().

Finally note that the patch adds a previously missing return statement
to cli_get_page() (without which that function could de-reference a
NULL pointer, triggerable from guest mode).

This is part of XSA-15 / CVE-2012-3497.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
xen-unstable changeset: 25854:ccd60ed6c555
xen-unstable date: Tue Sep 11 12:17:49 UTC 2012
---


diff -r 8dba0836f71b -r 122caf666c0c xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:25:25 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:26:06 2012 +0200
@@ -387,11 +387,13 @@ static NOINLINE int pcd_copy_to_client(t
     pcd = pgp->pcd;
     if ( pgp->size < PAGE_SIZE && pgp->size != 0 &&
          pcd->size < PAGE_SIZE && pcd->size != 0 )
-        ret = tmh_decompress_to_client(cmfn, pcd->cdata, pcd->size, NULL);
+        ret = tmh_decompress_to_client(cmfn, pcd->cdata, pcd->size,
+                                       tmh_cli_buf_null);
     else if ( tmh_tze_enabled() && pcd->size < PAGE_SIZE )
         ret = tmh_copy_tze_to_client(cmfn, pcd->tze, pcd->size);
     else
-        ret = tmh_copy_to_client(cmfn, pcd->pfp, 0, 0, PAGE_SIZE, NULL);
+        ret = tmh_copy_to_client(cmfn, pcd->pfp, 0, 0, PAGE_SIZE,
+                                 tmh_cli_buf_null);
     tmem_read_unlock(&pcd_tree_rwlocks[firstbyte]);
     return ret;
 }
@@ -1447,7 +1449,7 @@ static inline void tmem_ensure_avail_pag
 /************ TMEM CORE OPERATIONS ************************************/
 
 static NOINLINE int do_tmem_put_compress(pgp_t *pgp, tmem_cli_mfn_t cmfn,
-                                         void *cva)
+                                         tmem_cli_va_t clibuf)
 {
     void *dst, *p;
     size_t size;
@@ -1466,7 +1468,7 @@ static NOINLINE int do_tmem_put_compress
     if ( pgp->pfp != NULL )
         pgp_free_data(pgp, pgp->us.obj->pool);
     START_CYC_COUNTER(compress);
-    ret = tmh_compress_from_client(cmfn, &dst, &size, cva);
+    ret = tmh_compress_from_client(cmfn, &dst, &size, clibuf);
     if ( (ret == -EFAULT) || (ret == 0) )
         goto out;
     else if ( (size == 0) || (size >= tmem_subpage_maxsize()) ) {
@@ -1493,7 +1495,8 @@ out:
 }
 
 static NOINLINE int do_tmem_dup_put(pgp_t *pgp, tmem_cli_mfn_t cmfn,
-       pagesize_t tmem_offset, pagesize_t pfn_offset, pagesize_t len, void *cva)
+       pagesize_t tmem_offset, pagesize_t pfn_offset, pagesize_t len,
+       tmem_cli_va_t clibuf)
 {
     pool_t *pool;
     obj_t *obj;
@@ -1515,7 +1518,7 @@ static NOINLINE int do_tmem_dup_put(pgp_
     /* can we successfully manipulate pgp to change out the data? */
     if ( len != 0 && client->compress && pgp->size != 0 )
     {
-        ret = do_tmem_put_compress(pgp,cmfn,cva);
+        ret = do_tmem_put_compress(pgp, cmfn, clibuf);
         if ( ret == 1 )
             goto done;
         else if ( ret == 0 )
@@ -1533,7 +1536,8 @@ copy_uncompressed:
         goto failed_dup;
     pgp->size = 0;
     /* tmh_copy_from_client properly handles len==0 and offsets != 0 */
-    ret = tmh_copy_from_client(pgp->pfp,cmfn,tmem_offset,pfn_offset,len,0);
+    ret = tmh_copy_from_client(pgp->pfp, cmfn, tmem_offset, pfn_offset, len,
+                               tmh_cli_buf_null);
     if ( ret == -EFAULT )
         goto bad_copy;
     if ( tmh_dedup_enabled() && !is_persistent(pool) )
@@ -1585,7 +1589,7 @@ cleanup:
 static NOINLINE int do_tmem_put(pool_t *pool,
               OID *oidp, uint32_t index,
               tmem_cli_mfn_t cmfn, pagesize_t tmem_offset,
-              pagesize_t pfn_offset, pagesize_t len, void *cva)
+              pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_t clibuf)
 {
     obj_t *obj = NULL, *objfound = NULL, *objnew = NULL;
     pgp_t *pgp = NULL, *pgpdel = NULL;
@@ -1599,7 +1603,8 @@ static NOINLINE int do_tmem_put(pool_t *
     {
         ASSERT_SPINLOCK(&objfound->obj_spinlock);
         if ((pgp = pgp_lookup_in_obj(objfound, index)) != NULL)
-            return do_tmem_dup_put(pgp,cmfn,tmem_offset,pfn_offset,len,cva);
+            return do_tmem_dup_put(pgp, cmfn, tmem_offset, pfn_offset, len,
+                                   clibuf);
     }
 
     /* no puts allowed into a frozen pool (except dup puts) */
@@ -1634,7 +1639,7 @@ static NOINLINE int do_tmem_put(pool_t *
     if ( len != 0 && client->compress )
     {
         ASSERT(pgp->pfp == NULL);
-        ret = do_tmem_put_compress(pgp,cmfn,cva);
+        ret = do_tmem_put_compress(pgp, cmfn, clibuf);
         if ( ret == 1 )
             goto insert_page;
         if ( ret == -ENOMEM )
@@ -1658,7 +1663,8 @@ copy_uncompressed:
         goto delete_and_free;
     }
     /* tmh_copy_from_client properly handles len==0 (TMEM_NEW_PAGE) */
-    ret = tmh_copy_from_client(pgp->pfp,cmfn,tmem_offset,pfn_offset,len,cva);
+    ret = tmh_copy_from_client(pgp->pfp, cmfn, tmem_offset, pfn_offset, len,
+                               clibuf);
     if ( ret == -EFAULT )
         goto bad_copy;
     if ( tmh_dedup_enabled() && !is_persistent(pool) )
@@ -1728,12 +1734,13 @@ free:
 
 static NOINLINE int do_tmem_get(pool_t *pool, OID *oidp, uint32_t index,
               tmem_cli_mfn_t cmfn, pagesize_t tmem_offset,
-              pagesize_t pfn_offset, pagesize_t len, void *cva)
+              pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_t clibuf)
 {
     obj_t *obj;
     pgp_t *pgp;
     client_t *client = pool->client;
     DECL_LOCAL_CYC_COUNTER(decompress);
+    int rc = -EFAULT;
 
     if ( !_atomic_read(pool->pgp_count) )
         return -EEMPTY;
@@ -1758,16 +1765,18 @@ static NOINLINE int do_tmem_get(pool_t *
     if ( tmh_dedup_enabled() && !is_persistent(pool) &&
               pgp->firstbyte != NOT_SHAREABLE )
     {
-        if ( pcd_copy_to_client(cmfn, pgp) == -EFAULT )
+        rc = pcd_copy_to_client(cmfn, pgp);
+        if ( rc <= 0 )
             goto bad_copy;
     } else if ( pgp->size != 0 ) {
         START_CYC_COUNTER(decompress);
-        if ( tmh_decompress_to_client(cmfn, pgp->cdata,
-                                      pgp->size, cva) == -EFAULT )
+        rc = tmh_decompress_to_client(cmfn, pgp->cdata,
+                                      pgp->size, clibuf);
+        if ( rc <= 0 )
             goto bad_copy;
         END_CYC_COUNTER(decompress);
     } else if ( tmh_copy_to_client(cmfn, pgp->pfp, tmem_offset,
-                                 pfn_offset, len, cva) == -EFAULT)
+                                 pfn_offset, len, clibuf) == -EFAULT)
         goto bad_copy;
     if ( is_ephemeral(pool) )
     {
@@ -1807,8 +1816,7 @@ static NOINLINE int do_tmem_get(pool_t *
 bad_copy:
     /* this should only happen if the client passed a bad mfn */
     failed_copies++;
-    return -EFAULT;
-
+    return rc;
 }
 
 static NOINLINE int do_tmem_flush_page(pool_t *pool, OID *oidp, uint32_t index)
@@ -2348,7 +2356,6 @@ static NOINLINE int tmemc_save_subop(int
     pool_t *pool = (client == NULL || pool_id >= MAX_POOLS_PER_DOMAIN)
                    ? NULL : client->pools[pool_id];
     uint32_t p;
-    uint64_t *uuid;
     pgp_t *pgp, *pgp2;
     int rc = -1;
 
@@ -2412,9 +2419,7 @@ static NOINLINE int tmemc_save_subop(int
     case TMEMC_SAVE_GET_POOL_UUID:
          if ( pool == NULL )
              break;
-        uuid = (uint64_t *)buf.p;
-        *uuid++ = pool->uuid[0];
-        *uuid = pool->uuid[1];
+        tmh_copy_to_client_buf(buf, pool->uuid, 2);
         rc = 0;
     case TMEMC_SAVE_END:
         if ( client == NULL )
@@ -2439,7 +2444,7 @@ static NOINLINE int tmemc_save_get_next_
     pgp_t *pgp;
     OID oid;
     int ret = 0;
-    struct tmem_handle *h;
+    struct tmem_handle h;
     unsigned int pagesize = 1 << (pool->pageshift+12);
 
     if ( pool == NULL || is_ephemeral(pool) )
@@ -2470,11 +2475,13 @@ static NOINLINE int tmemc_save_get_next_
                          pgp_t,us.pool_pers_pages);
     pool->cur_pgp = pgp;
     oid = pgp->us.obj->oid;
-    h = (struct tmem_handle *)buf.p;
-    *(OID *)&h->oid[0] = oid;
-    h->index = pgp->index;
-    buf.p = (void *)(h+1);
-    ret = do_tmem_get(pool, &oid, h->index,0,0,0,pagesize,buf.p);
+    h.pool_id = pool_id;
+    BUILD_BUG_ON(sizeof(h.oid) != sizeof(oid));
+    memcpy(h.oid, oid.oid, sizeof(h.oid));
+    h.index = pgp->index;
+    tmh_copy_to_client_buf(buf, &h, 1);
+    tmh_client_buf_add(buf, sizeof(h));
+    ret = do_tmem_get(pool, &oid, pgp->index, 0, 0, 0, pagesize, buf);
 
 out:
     tmem_spin_unlock(&pers_lists_spinlock);
@@ -2486,7 +2493,7 @@ static NOINLINE int tmemc_save_get_next_
 {
     client_t *client = tmh_client_from_cli_id(cli_id);
     pgp_t *pgp;
-    struct tmem_handle *h;
+    struct tmem_handle h;
     int ret = 0;
 
     if ( client == NULL )
@@ -2512,10 +2519,11 @@ static NOINLINE int tmemc_save_get_next_
                          pgp_t,client_inv_pages);
         client->cur_pgp = pgp;
     }
-    h = (struct tmem_handle *)buf.p;
-    h->pool_id = pgp->pool_id;
-    *(OID *)&h->oid = pgp->inv_oid;
-    h->index = pgp->index;
+    h.pool_id = pgp->pool_id;
+    BUILD_BUG_ON(sizeof(h.oid) != sizeof(pgp->inv_oid));
+    memcpy(h.oid, pgp->inv_oid.oid, sizeof(h.oid));
+    h.index = pgp->index;
+    tmh_copy_to_client_buf(buf, &h, 1);
     ret = 1;
 out:
     tmem_spin_unlock(&pers_lists_spinlock);
@@ -2531,7 +2539,7 @@ static int tmemc_restore_put_page(int cl
 
     if ( pool == NULL )
         return -1;
-    return do_tmem_put(pool,oidp,index,0,0,0,bufsize,buf.p);
+    return do_tmem_put(pool, oidp, index, 0, 0, 0, bufsize, buf);
 }
 
 static int tmemc_restore_flush_page(int cli_id, uint32_t pool_id, OID *oidp,
@@ -2735,19 +2743,19 @@ EXPORT long do_tmem_op(tmem_cli_op_t uop
         break;
     case TMEM_NEW_PAGE:
         tmem_ensure_avail_pages();
-        rc = do_tmem_put(pool, oidp,
-                         op.u.gen.index, op.u.gen.cmfn, 0, 0, 0, NULL);
+        rc = do_tmem_put(pool, oidp, op.u.gen.index, op.u.gen.cmfn, 0, 0, 0,
+                         tmh_cli_buf_null);
         break;
     case TMEM_PUT_PAGE:
         tmem_ensure_avail_pages();
-        rc = do_tmem_put(pool, oidp,
-                    op.u.gen.index, op.u.gen.cmfn, 0, 0, PAGE_SIZE, NULL);
+        rc = do_tmem_put(pool, oidp, op.u.gen.index, op.u.gen.cmfn, 0, 0,
+                         PAGE_SIZE, tmh_cli_buf_null);
         if (rc == 1) succ_put = 1;
         else non_succ_put = 1;
         break;
     case TMEM_GET_PAGE:
         rc = do_tmem_get(pool, oidp, op.u.gen.index, op.u.gen.cmfn,
-                         0, 0, PAGE_SIZE, 0);
+                         0, 0, PAGE_SIZE, tmh_cli_buf_null);
         if (rc == 1) succ_get = 1;
         else non_succ_get = 1;
         break;
@@ -2766,13 +2774,13 @@ EXPORT long do_tmem_op(tmem_cli_op_t uop
     case TMEM_READ:
         rc = do_tmem_get(pool, oidp, op.u.gen.index, op.u.gen.cmfn,
                          op.u.gen.tmem_offset, op.u.gen.pfn_offset,
-                         op.u.gen.len,0);
+                         op.u.gen.len, tmh_cli_buf_null);
         break;
     case TMEM_WRITE:
         rc = do_tmem_put(pool, oidp,
                          op.u.gen.index, op.u.gen.cmfn,
                          op.u.gen.tmem_offset, op.u.gen.pfn_offset,
-                         op.u.gen.len, NULL);
+                         op.u.gen.len, tmh_cli_buf_null);
         break;
     case TMEM_XCHG:
         /* need to hold global lock to ensure xchg is atomic */
diff -r 8dba0836f71b -r 122caf666c0c xen/common/tmem_xen.c
--- a/xen/common/tmem_xen.c	Tue Sep 25 12:25:25 2012 +0200
+++ b/xen/common/tmem_xen.c	Tue Sep 25 12:26:06 2012 +0200
@@ -50,6 +50,7 @@ DECL_CYC_COUNTER(pg_copy);
 #define LZO_DSTMEM_PAGES 2
 static DEFINE_PER_CPU_READ_MOSTLY(unsigned char *, workmem);
 static DEFINE_PER_CPU_READ_MOSTLY(unsigned char *, dstmem);
+static DEFINE_PER_CPU_READ_MOSTLY(void *, scratch_page);
 
 #ifdef COMPARE_COPY_PAGE_SSE2
 #include <asm/flushtlb.h>  /* REMOVE ME AFTER TEST */
@@ -140,12 +141,12 @@ static inline void cli_put_page(void *cl
 
 EXPORT int tmh_copy_from_client(pfp_t *pfp,
     tmem_cli_mfn_t cmfn, pagesize_t tmem_offset,
-    pagesize_t pfn_offset, pagesize_t len, void *cli_va)
+    pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_t clibuf)
 {
     unsigned long tmem_mfn, cli_mfn = 0;
-    void *tmem_va;
+    char *tmem_va, *cli_va = NULL;
     pfp_t *cli_pfp = NULL;
-    bool_t tmemc = cli_va != NULL; /* if true, cli_va is control-op buffer */
+    int rc = 1;
 
     ASSERT(pfp != NULL);
     tmem_mfn = page_to_mfn(pfp);
@@ -156,62 +157,76 @@ EXPORT int tmh_copy_from_client(pfp_t *p
         unmap_domain_page(tmem_va);
         return 1;
     }
-    if ( !tmemc )
+    if ( guest_handle_is_null(clibuf) )
+    {
+        cli_va = cli_get_page(cmfn, &cli_mfn, &cli_pfp, 0);
+        if ( cli_va == NULL )
+        {
+            unmap_domain_page(tmem_va);
+            return -EFAULT;
+        }
+    }
+    mb();
+    if ( len == PAGE_SIZE && !tmem_offset && !pfn_offset && cli_va )
+        tmh_copy_page(tmem_va, cli_va);
+    else if ( (tmem_offset+len <= PAGE_SIZE) &&
+              (pfn_offset+len <= PAGE_SIZE) )
+    {
+        if ( cli_va )
+            memcpy(tmem_va + tmem_offset, cli_va + pfn_offset, len);
+        else if ( copy_from_guest_offset(tmem_va + tmem_offset, clibuf,
+                                         pfn_offset, len) )
+            rc = -EFAULT;
+    }
+    if ( cli_va )
+        cli_put_page(cli_va, cli_pfp, cli_mfn, 0);
+    unmap_domain_page(tmem_va);
+    return rc;
+}
+
+EXPORT int tmh_compress_from_client(tmem_cli_mfn_t cmfn,
+    void **out_va, size_t *out_len, tmem_cli_va_t clibuf)
+{
+    int ret = 0;
+    unsigned char *dmem = this_cpu(dstmem);
+    unsigned char *wmem = this_cpu(workmem);
+    char *scratch = this_cpu(scratch_page);
+    pfp_t *cli_pfp = NULL;
+    unsigned long cli_mfn = 0;
+    void *cli_va = NULL;
+
+    if ( dmem == NULL || wmem == NULL )
+        return 0;  /* no buffer, so can't compress */
+    if ( guest_handle_is_null(clibuf) )
     {
         cli_va = cli_get_page(cmfn, &cli_mfn, &cli_pfp, 0);
         if ( cli_va == NULL )
             return -EFAULT;
     }
+    else if ( !scratch )
+        return 0;
+    else if ( copy_from_guest(scratch, clibuf, PAGE_SIZE) )
+        return -EFAULT;
     mb();
-    if (len == PAGE_SIZE && !tmem_offset && !pfn_offset)
-        tmh_copy_page(tmem_va, cli_va);
-    else if ( (tmem_offset+len <= PAGE_SIZE) &&
-              (pfn_offset+len <= PAGE_SIZE) )
-        memcpy((char *)tmem_va+tmem_offset,(char *)cli_va+pfn_offset,len);
-    if ( !tmemc )
-        cli_put_page(cli_va, cli_pfp, cli_mfn, 0);
-    unmap_domain_page(tmem_va);
-    return 1;
-}
-
-EXPORT int tmh_compress_from_client(tmem_cli_mfn_t cmfn,
-    void **out_va, size_t *out_len, void *cli_va)
-{
-    int ret = 0;
-    unsigned char *dmem = this_cpu(dstmem);
-    unsigned char *wmem = this_cpu(workmem);
-    pfp_t *cli_pfp = NULL;
-    unsigned long cli_mfn = 0;
-    bool_t tmemc = cli_va != NULL; /* if true, cli_va is control-op buffer */
-
-    if ( dmem == NULL || wmem == NULL )
-        return 0;  /* no buffer, so can't compress */
-    if ( !tmemc )
-    {
-        cli_va = cli_get_page(cmfn, &cli_mfn, &cli_pfp, 0);
-        if ( cli_va == NULL )
-            return -EFAULT;
-    }
-    mb();
-    ret = lzo1x_1_compress(cli_va, PAGE_SIZE, dmem, out_len, wmem);
+    ret = lzo1x_1_compress(cli_va ?: scratch, PAGE_SIZE, dmem, out_len, wmem);
     ASSERT(ret == LZO_E_OK);
     *out_va = dmem;
-    if ( !tmemc )
+    if ( cli_va )
         cli_put_page(cli_va, cli_pfp, cli_mfn, 0);
-    unmap_domain_page(cli_va);
     return 1;
 }
 
 EXPORT int tmh_copy_to_client(tmem_cli_mfn_t cmfn, pfp_t *pfp,
-    pagesize_t tmem_offset, pagesize_t pfn_offset, pagesize_t len, void *cli_va)
+    pagesize_t tmem_offset, pagesize_t pfn_offset, pagesize_t len,
+    tmem_cli_va_t clibuf)
 {
     unsigned long tmem_mfn, cli_mfn = 0;
-    void *tmem_va;
+    char *tmem_va, *cli_va = NULL;
     pfp_t *cli_pfp = NULL;
-    bool_t tmemc = cli_va != NULL; /* if true, cli_va is control-op buffer */
+    int rc = 1;
 
     ASSERT(pfp != NULL);
-    if ( !tmemc )
+    if ( guest_handle_is_null(clibuf) )
     {
         cli_va = cli_get_page(cmfn, &cli_mfn, &cli_pfp, 1);
         if ( cli_va == NULL )
@@ -219,37 +234,48 @@ EXPORT int tmh_copy_to_client(tmem_cli_m
     }
     tmem_mfn = page_to_mfn(pfp);
     tmem_va = map_domain_page(tmem_mfn);
-    if (len == PAGE_SIZE && !tmem_offset && !pfn_offset)
+    if ( len == PAGE_SIZE && !tmem_offset && !pfn_offset && cli_va )
         tmh_copy_page(cli_va, tmem_va);
     else if ( (tmem_offset+len <= PAGE_SIZE) && (pfn_offset+len <= PAGE_SIZE) )
-        memcpy((char *)cli_va+pfn_offset,(char *)tmem_va+tmem_offset,len);
+    {
+        if ( cli_va )
+            memcpy(cli_va + pfn_offset, tmem_va + tmem_offset, len);
+        else if ( copy_to_guest_offset(clibuf, pfn_offset,
+                                       tmem_va + tmem_offset, len) )
+            rc = -EFAULT;
+    }
     unmap_domain_page(tmem_va);
-    if ( !tmemc )
+    if ( cli_va )
         cli_put_page(cli_va, cli_pfp, cli_mfn, 1);
     mb();
-    return 1;
+    return rc;
 }
 
 EXPORT int tmh_decompress_to_client(tmem_cli_mfn_t cmfn, void *tmem_va,
-                                    size_t size, void *cli_va)
+                                    size_t size, tmem_cli_va_t clibuf)
 {
     unsigned long cli_mfn = 0;
     pfp_t *cli_pfp = NULL;
+    void *cli_va = NULL;
+    char *scratch = this_cpu(scratch_page);
     size_t out_len = PAGE_SIZE;
-    bool_t tmemc = cli_va != NULL; /* if true, cli_va is control-op buffer */
     int ret;
 
-    if ( !tmemc )
+    if ( guest_handle_is_null(clibuf) )
     {
         cli_va = cli_get_page(cmfn, &cli_mfn, &cli_pfp, 1);
         if ( cli_va == NULL )
             return -EFAULT;
     }
-    ret = lzo1x_decompress_safe(tmem_va, size, cli_va, &out_len);
+    else if ( !scratch )
+        return 0;
+    ret = lzo1x_decompress_safe(tmem_va, size, cli_va ?: scratch, &out_len);
     ASSERT(ret == LZO_E_OK);
     ASSERT(out_len == PAGE_SIZE);
-    if ( !tmemc )
+    if ( cli_va )
         cli_put_page(cli_va, cli_pfp, cli_mfn, 1);
+    else if ( copy_to_guest(clibuf, scratch, PAGE_SIZE) )
+        return -EFAULT;
     mb();
     return 1;
 }
@@ -419,6 +445,11 @@ static int cpu_callback(
             struct page_info *p = alloc_domheap_pages(0, workmem_order, 0);
             per_cpu(workmem, cpu) = p ? page_to_virt(p) : NULL;
         }
+        if ( per_cpu(scratch_page, cpu) == NULL )
+        {
+            struct page_info *p = alloc_domheap_page(NULL, 0);
+            per_cpu(scratch_page, cpu) = p ? page_to_virt(p) : NULL;
+        }
         break;
     }
     case CPU_DEAD:
@@ -435,6 +466,11 @@ static int cpu_callback(
             free_domheap_pages(p, workmem_order);
             per_cpu(workmem, cpu) = NULL;
         }
+        if ( per_cpu(scratch_page, cpu) != NULL )
+        {
+            free_domheap_page(virt_to_page(per_cpu(scratch_page, cpu)));
+            per_cpu(scratch_page, cpu) = NULL;
+        }
         break;
     }
     default:
diff -r 8dba0836f71b -r 122caf666c0c xen/include/xen/tmem_xen.h
--- a/xen/include/xen/tmem_xen.h	Tue Sep 25 12:25:25 2012 +0200
+++ b/xen/include/xen/tmem_xen.h	Tue Sep 25 12:26:06 2012 +0200
@@ -482,27 +482,33 @@ static inline int tmh_get_tmemop_from_cl
     return copy_from_guest(op, uops, 1);
 }
 
+#define tmh_cli_buf_null guest_handle_from_ptr(NULL, char)
+
 static inline void tmh_copy_to_client_buf_offset(tmem_cli_va_t clibuf, int off,
                                            char *tmembuf, int len)
 {
     copy_to_guest_offset(clibuf,off,tmembuf,len);
 }
 
+#define tmh_copy_to_client_buf(clibuf, tmembuf, cnt) \
+    copy_to_guest(guest_handle_cast(clibuf, void), tmembuf, cnt)
+
+#define tmh_client_buf_add guest_handle_add_offset
+
 #define TMH_CLI_ID_NULL ((cli_id_t)((domid_t)-1L))
 
 #define tmh_cli_id_str "domid"
 #define tmh_client_str "domain"
 
-extern int tmh_decompress_to_client(tmem_cli_mfn_t,void*,size_t,void*);
+int tmh_decompress_to_client(tmem_cli_mfn_t, void *, size_t, tmem_cli_va_t);
 
-extern int tmh_compress_from_client(tmem_cli_mfn_t,void**,size_t *,void*);
+int tmh_compress_from_client(tmem_cli_mfn_t, void **, size_t *, tmem_cli_va_t);
 
-extern int tmh_copy_from_client(pfp_t *pfp,
-    tmem_cli_mfn_t cmfn, pagesize_t tmem_offset,
-    pagesize_t pfn_offset, pagesize_t len, void *cva);
+int tmh_copy_from_client(pfp_t *, tmem_cli_mfn_t, pagesize_t tmem_offset,
+    pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_t);
 
-extern int tmh_copy_to_client(tmem_cli_mfn_t cmfn, pfp_t *pfp,
-    pagesize_t tmem_offset, pagesize_t pfn_offset, pagesize_t len, void *cva);
+int tmh_copy_to_client(tmem_cli_mfn_t, pfp_t *, pagesize_t tmem_offset,
+    pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_t);
 
 extern int tmh_copy_tze_to_client(tmem_cli_mfn_t cmfn, void *tmem_va, pagesize_t len);
 

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 02:55:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 02:55:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGhmU-0001j0-4T; Wed, 26 Sep 2012 02: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 1TGhmS-0001fM-IV
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-27.messagelabs.com!1348628111!9074552!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7125 invoked from network); 26 Sep 2012 02:55:12 -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;
	26 Sep 2012 02: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 1TGhmJ-0000Zc-JC
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGhmJ-0002qt-DY
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:11 +0000
Message-Id: <E1TGhmJ-0002qt-DY@xenbits.xen.org>
Date: Wed, 26 Sep 2012 02: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] tmem: don't access guest memory
	without using the accessors intended for this
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348568766 -7200
# Node ID 122caf666c0cd07bb0829516c2f6d9f4d002fefe
# Parent  8dba0836f71b0ff37861dc42eae7d4c78b10dbe5
tmem: don't access guest memory without using the accessors intended for this

This is not permitted, not even for buffers coming from Dom0 (and it
would also break the moment Dom0 runs in HVM mode). An implication from
the changes here is that tmh_copy_page() can't be used anymore for
control operations calling tmh_copy_{from,to}_client() (as those pass
the buffer by virtual address rather than MFN).

Note that tmemc_save_get_next_page() previously didn't set the returned
handle's pool_id field, while the new code does. It need to be
confirmed that this is not a problem (otherwise the copy-out operation
will require further tmh_...() abstractions to be added).

Further note that the patch removes (rather than adjusts) an invalid
call to unmap_domain_page() (no matching map_domain_page()) from
tmh_compress_from_client() and adds a missing one to an error return
path in tmh_copy_from_client().

Finally note that the patch adds a previously missing return statement
to cli_get_page() (without which that function could de-reference a
NULL pointer, triggerable from guest mode).

This is part of XSA-15 / CVE-2012-3497.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
xen-unstable changeset: 25854:ccd60ed6c555
xen-unstable date: Tue Sep 11 12:17:49 UTC 2012
---


diff -r 8dba0836f71b -r 122caf666c0c xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:25:25 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:26:06 2012 +0200
@@ -387,11 +387,13 @@ static NOINLINE int pcd_copy_to_client(t
     pcd = pgp->pcd;
     if ( pgp->size < PAGE_SIZE && pgp->size != 0 &&
          pcd->size < PAGE_SIZE && pcd->size != 0 )
-        ret = tmh_decompress_to_client(cmfn, pcd->cdata, pcd->size, NULL);
+        ret = tmh_decompress_to_client(cmfn, pcd->cdata, pcd->size,
+                                       tmh_cli_buf_null);
     else if ( tmh_tze_enabled() && pcd->size < PAGE_SIZE )
         ret = tmh_copy_tze_to_client(cmfn, pcd->tze, pcd->size);
     else
-        ret = tmh_copy_to_client(cmfn, pcd->pfp, 0, 0, PAGE_SIZE, NULL);
+        ret = tmh_copy_to_client(cmfn, pcd->pfp, 0, 0, PAGE_SIZE,
+                                 tmh_cli_buf_null);
     tmem_read_unlock(&pcd_tree_rwlocks[firstbyte]);
     return ret;
 }
@@ -1447,7 +1449,7 @@ static inline void tmem_ensure_avail_pag
 /************ TMEM CORE OPERATIONS ************************************/
 
 static NOINLINE int do_tmem_put_compress(pgp_t *pgp, tmem_cli_mfn_t cmfn,
-                                         void *cva)
+                                         tmem_cli_va_t clibuf)
 {
     void *dst, *p;
     size_t size;
@@ -1466,7 +1468,7 @@ static NOINLINE int do_tmem_put_compress
     if ( pgp->pfp != NULL )
         pgp_free_data(pgp, pgp->us.obj->pool);
     START_CYC_COUNTER(compress);
-    ret = tmh_compress_from_client(cmfn, &dst, &size, cva);
+    ret = tmh_compress_from_client(cmfn, &dst, &size, clibuf);
     if ( (ret == -EFAULT) || (ret == 0) )
         goto out;
     else if ( (size == 0) || (size >= tmem_subpage_maxsize()) ) {
@@ -1493,7 +1495,8 @@ out:
 }
 
 static NOINLINE int do_tmem_dup_put(pgp_t *pgp, tmem_cli_mfn_t cmfn,
-       pagesize_t tmem_offset, pagesize_t pfn_offset, pagesize_t len, void *cva)
+       pagesize_t tmem_offset, pagesize_t pfn_offset, pagesize_t len,
+       tmem_cli_va_t clibuf)
 {
     pool_t *pool;
     obj_t *obj;
@@ -1515,7 +1518,7 @@ static NOINLINE int do_tmem_dup_put(pgp_
     /* can we successfully manipulate pgp to change out the data? */
     if ( len != 0 && client->compress && pgp->size != 0 )
     {
-        ret = do_tmem_put_compress(pgp,cmfn,cva);
+        ret = do_tmem_put_compress(pgp, cmfn, clibuf);
         if ( ret == 1 )
             goto done;
         else if ( ret == 0 )
@@ -1533,7 +1536,8 @@ copy_uncompressed:
         goto failed_dup;
     pgp->size = 0;
     /* tmh_copy_from_client properly handles len==0 and offsets != 0 */
-    ret = tmh_copy_from_client(pgp->pfp,cmfn,tmem_offset,pfn_offset,len,0);
+    ret = tmh_copy_from_client(pgp->pfp, cmfn, tmem_offset, pfn_offset, len,
+                               tmh_cli_buf_null);
     if ( ret == -EFAULT )
         goto bad_copy;
     if ( tmh_dedup_enabled() && !is_persistent(pool) )
@@ -1585,7 +1589,7 @@ cleanup:
 static NOINLINE int do_tmem_put(pool_t *pool,
               OID *oidp, uint32_t index,
               tmem_cli_mfn_t cmfn, pagesize_t tmem_offset,
-              pagesize_t pfn_offset, pagesize_t len, void *cva)
+              pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_t clibuf)
 {
     obj_t *obj = NULL, *objfound = NULL, *objnew = NULL;
     pgp_t *pgp = NULL, *pgpdel = NULL;
@@ -1599,7 +1603,8 @@ static NOINLINE int do_tmem_put(pool_t *
     {
         ASSERT_SPINLOCK(&objfound->obj_spinlock);
         if ((pgp = pgp_lookup_in_obj(objfound, index)) != NULL)
-            return do_tmem_dup_put(pgp,cmfn,tmem_offset,pfn_offset,len,cva);
+            return do_tmem_dup_put(pgp, cmfn, tmem_offset, pfn_offset, len,
+                                   clibuf);
     }
 
     /* no puts allowed into a frozen pool (except dup puts) */
@@ -1634,7 +1639,7 @@ static NOINLINE int do_tmem_put(pool_t *
     if ( len != 0 && client->compress )
     {
         ASSERT(pgp->pfp == NULL);
-        ret = do_tmem_put_compress(pgp,cmfn,cva);
+        ret = do_tmem_put_compress(pgp, cmfn, clibuf);
         if ( ret == 1 )
             goto insert_page;
         if ( ret == -ENOMEM )
@@ -1658,7 +1663,8 @@ copy_uncompressed:
         goto delete_and_free;
     }
     /* tmh_copy_from_client properly handles len==0 (TMEM_NEW_PAGE) */
-    ret = tmh_copy_from_client(pgp->pfp,cmfn,tmem_offset,pfn_offset,len,cva);
+    ret = tmh_copy_from_client(pgp->pfp, cmfn, tmem_offset, pfn_offset, len,
+                               clibuf);
     if ( ret == -EFAULT )
         goto bad_copy;
     if ( tmh_dedup_enabled() && !is_persistent(pool) )
@@ -1728,12 +1734,13 @@ free:
 
 static NOINLINE int do_tmem_get(pool_t *pool, OID *oidp, uint32_t index,
               tmem_cli_mfn_t cmfn, pagesize_t tmem_offset,
-              pagesize_t pfn_offset, pagesize_t len, void *cva)
+              pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_t clibuf)
 {
     obj_t *obj;
     pgp_t *pgp;
     client_t *client = pool->client;
     DECL_LOCAL_CYC_COUNTER(decompress);
+    int rc = -EFAULT;
 
     if ( !_atomic_read(pool->pgp_count) )
         return -EEMPTY;
@@ -1758,16 +1765,18 @@ static NOINLINE int do_tmem_get(pool_t *
     if ( tmh_dedup_enabled() && !is_persistent(pool) &&
               pgp->firstbyte != NOT_SHAREABLE )
     {
-        if ( pcd_copy_to_client(cmfn, pgp) == -EFAULT )
+        rc = pcd_copy_to_client(cmfn, pgp);
+        if ( rc <= 0 )
             goto bad_copy;
     } else if ( pgp->size != 0 ) {
         START_CYC_COUNTER(decompress);
-        if ( tmh_decompress_to_client(cmfn, pgp->cdata,
-                                      pgp->size, cva) == -EFAULT )
+        rc = tmh_decompress_to_client(cmfn, pgp->cdata,
+                                      pgp->size, clibuf);
+        if ( rc <= 0 )
             goto bad_copy;
         END_CYC_COUNTER(decompress);
     } else if ( tmh_copy_to_client(cmfn, pgp->pfp, tmem_offset,
-                                 pfn_offset, len, cva) == -EFAULT)
+                                 pfn_offset, len, clibuf) == -EFAULT)
         goto bad_copy;
     if ( is_ephemeral(pool) )
     {
@@ -1807,8 +1816,7 @@ static NOINLINE int do_tmem_get(pool_t *
 bad_copy:
     /* this should only happen if the client passed a bad mfn */
     failed_copies++;
-    return -EFAULT;
-
+    return rc;
 }
 
 static NOINLINE int do_tmem_flush_page(pool_t *pool, OID *oidp, uint32_t index)
@@ -2348,7 +2356,6 @@ static NOINLINE int tmemc_save_subop(int
     pool_t *pool = (client == NULL || pool_id >= MAX_POOLS_PER_DOMAIN)
                    ? NULL : client->pools[pool_id];
     uint32_t p;
-    uint64_t *uuid;
     pgp_t *pgp, *pgp2;
     int rc = -1;
 
@@ -2412,9 +2419,7 @@ static NOINLINE int tmemc_save_subop(int
     case TMEMC_SAVE_GET_POOL_UUID:
          if ( pool == NULL )
              break;
-        uuid = (uint64_t *)buf.p;
-        *uuid++ = pool->uuid[0];
-        *uuid = pool->uuid[1];
+        tmh_copy_to_client_buf(buf, pool->uuid, 2);
         rc = 0;
     case TMEMC_SAVE_END:
         if ( client == NULL )
@@ -2439,7 +2444,7 @@ static NOINLINE int tmemc_save_get_next_
     pgp_t *pgp;
     OID oid;
     int ret = 0;
-    struct tmem_handle *h;
+    struct tmem_handle h;
     unsigned int pagesize = 1 << (pool->pageshift+12);
 
     if ( pool == NULL || is_ephemeral(pool) )
@@ -2470,11 +2475,13 @@ static NOINLINE int tmemc_save_get_next_
                          pgp_t,us.pool_pers_pages);
     pool->cur_pgp = pgp;
     oid = pgp->us.obj->oid;
-    h = (struct tmem_handle *)buf.p;
-    *(OID *)&h->oid[0] = oid;
-    h->index = pgp->index;
-    buf.p = (void *)(h+1);
-    ret = do_tmem_get(pool, &oid, h->index,0,0,0,pagesize,buf.p);
+    h.pool_id = pool_id;
+    BUILD_BUG_ON(sizeof(h.oid) != sizeof(oid));
+    memcpy(h.oid, oid.oid, sizeof(h.oid));
+    h.index = pgp->index;
+    tmh_copy_to_client_buf(buf, &h, 1);
+    tmh_client_buf_add(buf, sizeof(h));
+    ret = do_tmem_get(pool, &oid, pgp->index, 0, 0, 0, pagesize, buf);
 
 out:
     tmem_spin_unlock(&pers_lists_spinlock);
@@ -2486,7 +2493,7 @@ static NOINLINE int tmemc_save_get_next_
 {
     client_t *client = tmh_client_from_cli_id(cli_id);
     pgp_t *pgp;
-    struct tmem_handle *h;
+    struct tmem_handle h;
     int ret = 0;
 
     if ( client == NULL )
@@ -2512,10 +2519,11 @@ static NOINLINE int tmemc_save_get_next_
                          pgp_t,client_inv_pages);
         client->cur_pgp = pgp;
     }
-    h = (struct tmem_handle *)buf.p;
-    h->pool_id = pgp->pool_id;
-    *(OID *)&h->oid = pgp->inv_oid;
-    h->index = pgp->index;
+    h.pool_id = pgp->pool_id;
+    BUILD_BUG_ON(sizeof(h.oid) != sizeof(pgp->inv_oid));
+    memcpy(h.oid, pgp->inv_oid.oid, sizeof(h.oid));
+    h.index = pgp->index;
+    tmh_copy_to_client_buf(buf, &h, 1);
     ret = 1;
 out:
     tmem_spin_unlock(&pers_lists_spinlock);
@@ -2531,7 +2539,7 @@ static int tmemc_restore_put_page(int cl
 
     if ( pool == NULL )
         return -1;
-    return do_tmem_put(pool,oidp,index,0,0,0,bufsize,buf.p);
+    return do_tmem_put(pool, oidp, index, 0, 0, 0, bufsize, buf);
 }
 
 static int tmemc_restore_flush_page(int cli_id, uint32_t pool_id, OID *oidp,
@@ -2735,19 +2743,19 @@ EXPORT long do_tmem_op(tmem_cli_op_t uop
         break;
     case TMEM_NEW_PAGE:
         tmem_ensure_avail_pages();
-        rc = do_tmem_put(pool, oidp,
-                         op.u.gen.index, op.u.gen.cmfn, 0, 0, 0, NULL);
+        rc = do_tmem_put(pool, oidp, op.u.gen.index, op.u.gen.cmfn, 0, 0, 0,
+                         tmh_cli_buf_null);
         break;
     case TMEM_PUT_PAGE:
         tmem_ensure_avail_pages();
-        rc = do_tmem_put(pool, oidp,
-                    op.u.gen.index, op.u.gen.cmfn, 0, 0, PAGE_SIZE, NULL);
+        rc = do_tmem_put(pool, oidp, op.u.gen.index, op.u.gen.cmfn, 0, 0,
+                         PAGE_SIZE, tmh_cli_buf_null);
         if (rc == 1) succ_put = 1;
         else non_succ_put = 1;
         break;
     case TMEM_GET_PAGE:
         rc = do_tmem_get(pool, oidp, op.u.gen.index, op.u.gen.cmfn,
-                         0, 0, PAGE_SIZE, 0);
+                         0, 0, PAGE_SIZE, tmh_cli_buf_null);
         if (rc == 1) succ_get = 1;
         else non_succ_get = 1;
         break;
@@ -2766,13 +2774,13 @@ EXPORT long do_tmem_op(tmem_cli_op_t uop
     case TMEM_READ:
         rc = do_tmem_get(pool, oidp, op.u.gen.index, op.u.gen.cmfn,
                          op.u.gen.tmem_offset, op.u.gen.pfn_offset,
-                         op.u.gen.len,0);
+                         op.u.gen.len, tmh_cli_buf_null);
         break;
     case TMEM_WRITE:
         rc = do_tmem_put(pool, oidp,
                          op.u.gen.index, op.u.gen.cmfn,
                          op.u.gen.tmem_offset, op.u.gen.pfn_offset,
-                         op.u.gen.len, NULL);
+                         op.u.gen.len, tmh_cli_buf_null);
         break;
     case TMEM_XCHG:
         /* need to hold global lock to ensure xchg is atomic */
diff -r 8dba0836f71b -r 122caf666c0c xen/common/tmem_xen.c
--- a/xen/common/tmem_xen.c	Tue Sep 25 12:25:25 2012 +0200
+++ b/xen/common/tmem_xen.c	Tue Sep 25 12:26:06 2012 +0200
@@ -50,6 +50,7 @@ DECL_CYC_COUNTER(pg_copy);
 #define LZO_DSTMEM_PAGES 2
 static DEFINE_PER_CPU_READ_MOSTLY(unsigned char *, workmem);
 static DEFINE_PER_CPU_READ_MOSTLY(unsigned char *, dstmem);
+static DEFINE_PER_CPU_READ_MOSTLY(void *, scratch_page);
 
 #ifdef COMPARE_COPY_PAGE_SSE2
 #include <asm/flushtlb.h>  /* REMOVE ME AFTER TEST */
@@ -140,12 +141,12 @@ static inline void cli_put_page(void *cl
 
 EXPORT int tmh_copy_from_client(pfp_t *pfp,
     tmem_cli_mfn_t cmfn, pagesize_t tmem_offset,
-    pagesize_t pfn_offset, pagesize_t len, void *cli_va)
+    pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_t clibuf)
 {
     unsigned long tmem_mfn, cli_mfn = 0;
-    void *tmem_va;
+    char *tmem_va, *cli_va = NULL;
     pfp_t *cli_pfp = NULL;
-    bool_t tmemc = cli_va != NULL; /* if true, cli_va is control-op buffer */
+    int rc = 1;
 
     ASSERT(pfp != NULL);
     tmem_mfn = page_to_mfn(pfp);
@@ -156,62 +157,76 @@ EXPORT int tmh_copy_from_client(pfp_t *p
         unmap_domain_page(tmem_va);
         return 1;
     }
-    if ( !tmemc )
+    if ( guest_handle_is_null(clibuf) )
+    {
+        cli_va = cli_get_page(cmfn, &cli_mfn, &cli_pfp, 0);
+        if ( cli_va == NULL )
+        {
+            unmap_domain_page(tmem_va);
+            return -EFAULT;
+        }
+    }
+    mb();
+    if ( len == PAGE_SIZE && !tmem_offset && !pfn_offset && cli_va )
+        tmh_copy_page(tmem_va, cli_va);
+    else if ( (tmem_offset+len <= PAGE_SIZE) &&
+              (pfn_offset+len <= PAGE_SIZE) )
+    {
+        if ( cli_va )
+            memcpy(tmem_va + tmem_offset, cli_va + pfn_offset, len);
+        else if ( copy_from_guest_offset(tmem_va + tmem_offset, clibuf,
+                                         pfn_offset, len) )
+            rc = -EFAULT;
+    }
+    if ( cli_va )
+        cli_put_page(cli_va, cli_pfp, cli_mfn, 0);
+    unmap_domain_page(tmem_va);
+    return rc;
+}
+
+EXPORT int tmh_compress_from_client(tmem_cli_mfn_t cmfn,
+    void **out_va, size_t *out_len, tmem_cli_va_t clibuf)
+{
+    int ret = 0;
+    unsigned char *dmem = this_cpu(dstmem);
+    unsigned char *wmem = this_cpu(workmem);
+    char *scratch = this_cpu(scratch_page);
+    pfp_t *cli_pfp = NULL;
+    unsigned long cli_mfn = 0;
+    void *cli_va = NULL;
+
+    if ( dmem == NULL || wmem == NULL )
+        return 0;  /* no buffer, so can't compress */
+    if ( guest_handle_is_null(clibuf) )
     {
         cli_va = cli_get_page(cmfn, &cli_mfn, &cli_pfp, 0);
         if ( cli_va == NULL )
             return -EFAULT;
     }
+    else if ( !scratch )
+        return 0;
+    else if ( copy_from_guest(scratch, clibuf, PAGE_SIZE) )
+        return -EFAULT;
     mb();
-    if (len == PAGE_SIZE && !tmem_offset && !pfn_offset)
-        tmh_copy_page(tmem_va, cli_va);
-    else if ( (tmem_offset+len <= PAGE_SIZE) &&
-              (pfn_offset+len <= PAGE_SIZE) )
-        memcpy((char *)tmem_va+tmem_offset,(char *)cli_va+pfn_offset,len);
-    if ( !tmemc )
-        cli_put_page(cli_va, cli_pfp, cli_mfn, 0);
-    unmap_domain_page(tmem_va);
-    return 1;
-}
-
-EXPORT int tmh_compress_from_client(tmem_cli_mfn_t cmfn,
-    void **out_va, size_t *out_len, void *cli_va)
-{
-    int ret = 0;
-    unsigned char *dmem = this_cpu(dstmem);
-    unsigned char *wmem = this_cpu(workmem);
-    pfp_t *cli_pfp = NULL;
-    unsigned long cli_mfn = 0;
-    bool_t tmemc = cli_va != NULL; /* if true, cli_va is control-op buffer */
-
-    if ( dmem == NULL || wmem == NULL )
-        return 0;  /* no buffer, so can't compress */
-    if ( !tmemc )
-    {
-        cli_va = cli_get_page(cmfn, &cli_mfn, &cli_pfp, 0);
-        if ( cli_va == NULL )
-            return -EFAULT;
-    }
-    mb();
-    ret = lzo1x_1_compress(cli_va, PAGE_SIZE, dmem, out_len, wmem);
+    ret = lzo1x_1_compress(cli_va ?: scratch, PAGE_SIZE, dmem, out_len, wmem);
     ASSERT(ret == LZO_E_OK);
     *out_va = dmem;
-    if ( !tmemc )
+    if ( cli_va )
         cli_put_page(cli_va, cli_pfp, cli_mfn, 0);
-    unmap_domain_page(cli_va);
     return 1;
 }
 
 EXPORT int tmh_copy_to_client(tmem_cli_mfn_t cmfn, pfp_t *pfp,
-    pagesize_t tmem_offset, pagesize_t pfn_offset, pagesize_t len, void *cli_va)
+    pagesize_t tmem_offset, pagesize_t pfn_offset, pagesize_t len,
+    tmem_cli_va_t clibuf)
 {
     unsigned long tmem_mfn, cli_mfn = 0;
-    void *tmem_va;
+    char *tmem_va, *cli_va = NULL;
     pfp_t *cli_pfp = NULL;
-    bool_t tmemc = cli_va != NULL; /* if true, cli_va is control-op buffer */
+    int rc = 1;
 
     ASSERT(pfp != NULL);
-    if ( !tmemc )
+    if ( guest_handle_is_null(clibuf) )
     {
         cli_va = cli_get_page(cmfn, &cli_mfn, &cli_pfp, 1);
         if ( cli_va == NULL )
@@ -219,37 +234,48 @@ EXPORT int tmh_copy_to_client(tmem_cli_m
     }
     tmem_mfn = page_to_mfn(pfp);
     tmem_va = map_domain_page(tmem_mfn);
-    if (len == PAGE_SIZE && !tmem_offset && !pfn_offset)
+    if ( len == PAGE_SIZE && !tmem_offset && !pfn_offset && cli_va )
         tmh_copy_page(cli_va, tmem_va);
     else if ( (tmem_offset+len <= PAGE_SIZE) && (pfn_offset+len <= PAGE_SIZE) )
-        memcpy((char *)cli_va+pfn_offset,(char *)tmem_va+tmem_offset,len);
+    {
+        if ( cli_va )
+            memcpy(cli_va + pfn_offset, tmem_va + tmem_offset, len);
+        else if ( copy_to_guest_offset(clibuf, pfn_offset,
+                                       tmem_va + tmem_offset, len) )
+            rc = -EFAULT;
+    }
     unmap_domain_page(tmem_va);
-    if ( !tmemc )
+    if ( cli_va )
         cli_put_page(cli_va, cli_pfp, cli_mfn, 1);
     mb();
-    return 1;
+    return rc;
 }
 
 EXPORT int tmh_decompress_to_client(tmem_cli_mfn_t cmfn, void *tmem_va,
-                                    size_t size, void *cli_va)
+                                    size_t size, tmem_cli_va_t clibuf)
 {
     unsigned long cli_mfn = 0;
     pfp_t *cli_pfp = NULL;
+    void *cli_va = NULL;
+    char *scratch = this_cpu(scratch_page);
     size_t out_len = PAGE_SIZE;
-    bool_t tmemc = cli_va != NULL; /* if true, cli_va is control-op buffer */
     int ret;
 
-    if ( !tmemc )
+    if ( guest_handle_is_null(clibuf) )
     {
         cli_va = cli_get_page(cmfn, &cli_mfn, &cli_pfp, 1);
         if ( cli_va == NULL )
             return -EFAULT;
     }
-    ret = lzo1x_decompress_safe(tmem_va, size, cli_va, &out_len);
+    else if ( !scratch )
+        return 0;
+    ret = lzo1x_decompress_safe(tmem_va, size, cli_va ?: scratch, &out_len);
     ASSERT(ret == LZO_E_OK);
     ASSERT(out_len == PAGE_SIZE);
-    if ( !tmemc )
+    if ( cli_va )
         cli_put_page(cli_va, cli_pfp, cli_mfn, 1);
+    else if ( copy_to_guest(clibuf, scratch, PAGE_SIZE) )
+        return -EFAULT;
     mb();
     return 1;
 }
@@ -419,6 +445,11 @@ static int cpu_callback(
             struct page_info *p = alloc_domheap_pages(0, workmem_order, 0);
             per_cpu(workmem, cpu) = p ? page_to_virt(p) : NULL;
         }
+        if ( per_cpu(scratch_page, cpu) == NULL )
+        {
+            struct page_info *p = alloc_domheap_page(NULL, 0);
+            per_cpu(scratch_page, cpu) = p ? page_to_virt(p) : NULL;
+        }
         break;
     }
     case CPU_DEAD:
@@ -435,6 +466,11 @@ static int cpu_callback(
             free_domheap_pages(p, workmem_order);
             per_cpu(workmem, cpu) = NULL;
         }
+        if ( per_cpu(scratch_page, cpu) != NULL )
+        {
+            free_domheap_page(virt_to_page(per_cpu(scratch_page, cpu)));
+            per_cpu(scratch_page, cpu) = NULL;
+        }
         break;
     }
     default:
diff -r 8dba0836f71b -r 122caf666c0c xen/include/xen/tmem_xen.h
--- a/xen/include/xen/tmem_xen.h	Tue Sep 25 12:25:25 2012 +0200
+++ b/xen/include/xen/tmem_xen.h	Tue Sep 25 12:26:06 2012 +0200
@@ -482,27 +482,33 @@ static inline int tmh_get_tmemop_from_cl
     return copy_from_guest(op, uops, 1);
 }
 
+#define tmh_cli_buf_null guest_handle_from_ptr(NULL, char)
+
 static inline void tmh_copy_to_client_buf_offset(tmem_cli_va_t clibuf, int off,
                                            char *tmembuf, int len)
 {
     copy_to_guest_offset(clibuf,off,tmembuf,len);
 }
 
+#define tmh_copy_to_client_buf(clibuf, tmembuf, cnt) \
+    copy_to_guest(guest_handle_cast(clibuf, void), tmembuf, cnt)
+
+#define tmh_client_buf_add guest_handle_add_offset
+
 #define TMH_CLI_ID_NULL ((cli_id_t)((domid_t)-1L))
 
 #define tmh_cli_id_str "domid"
 #define tmh_client_str "domain"
 
-extern int tmh_decompress_to_client(tmem_cli_mfn_t,void*,size_t,void*);
+int tmh_decompress_to_client(tmem_cli_mfn_t, void *, size_t, tmem_cli_va_t);
 
-extern int tmh_compress_from_client(tmem_cli_mfn_t,void**,size_t *,void*);
+int tmh_compress_from_client(tmem_cli_mfn_t, void **, size_t *, tmem_cli_va_t);
 
-extern int tmh_copy_from_client(pfp_t *pfp,
-    tmem_cli_mfn_t cmfn, pagesize_t tmem_offset,
-    pagesize_t pfn_offset, pagesize_t len, void *cva);
+int tmh_copy_from_client(pfp_t *, tmem_cli_mfn_t, pagesize_t tmem_offset,
+    pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_t);
 
-extern int tmh_copy_to_client(tmem_cli_mfn_t cmfn, pfp_t *pfp,
-    pagesize_t tmem_offset, pagesize_t pfn_offset, pagesize_t len, void *cva);
+int tmh_copy_to_client(tmem_cli_mfn_t, pfp_t *, pagesize_t tmem_offset,
+    pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_t);
 
 extern int tmh_copy_tze_to_client(tmem_cli_mfn_t cmfn, void *tmem_va, pagesize_t len);
 

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 02:55:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 02: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.xen.org>)
	id 1TGhmU-0001iu-1r; Wed, 26 Sep 2012 02: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 1TGhmS-0001fO-Md
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-27.messagelabs.com!1348628112!12356554!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26923 invoked from network); 26 Sep 2012 02:55:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Sep 2012 02: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 1TGhmK-0000Zf-Aq
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGhmK-0002rC-6F
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:12 +0000
Message-Id: <E1TGhmK-0002rC-6F@xenbits.xen.org>
Date: Wed, 26 Sep 2012 02: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] tmem: detect arithmetic overflow
	in tmh_copy_{from, to}_client()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348568789 -7200
# Node ID 2cce0490a2603ae9959cff04d292fe964a8bc28e
# Parent  122caf666c0cd07bb0829516c2f6d9f4d002fefe
tmem: detect arithmetic overflow in tmh_copy_{from,to}_client()

This implies adjusting callers to deal with errors other than -EFAULT
and removing some comments which would otherwise become stale.

Reported-by: Tim Deegan <tim@xen.org>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
xen-unstable changeset: 25855:33b8c42a87ec
xen-unstable date: Tue Sep 11 12:17:59 UTC 2012
---


diff -r 122caf666c0c -r 2cce0490a260 xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:26:06 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:26:29 2012 +0200
@@ -1538,7 +1538,7 @@ copy_uncompressed:
     /* tmh_copy_from_client properly handles len==0 and offsets != 0 */
     ret = tmh_copy_from_client(pgp->pfp, cmfn, tmem_offset, pfn_offset, len,
                                tmh_cli_buf_null);
-    if ( ret == -EFAULT )
+    if ( ret < 0 )
         goto bad_copy;
     if ( tmh_dedup_enabled() && !is_persistent(pool) )
     {
@@ -1559,9 +1559,7 @@ done:
     return 1;
 
 bad_copy:
-    /* this should only happen if the client passed a bad mfn */
     failed_copies++;
-    ret = -EFAULT;
     goto cleanup;
 
 failed_dup:
@@ -1665,7 +1663,7 @@ copy_uncompressed:
     /* tmh_copy_from_client properly handles len==0 (TMEM_NEW_PAGE) */
     ret = tmh_copy_from_client(pgp->pfp, cmfn, tmem_offset, pfn_offset, len,
                                clibuf);
-    if ( ret == -EFAULT )
+    if ( ret < 0 )
         goto bad_copy;
     if ( tmh_dedup_enabled() && !is_persistent(pool) )
     {
@@ -1705,8 +1703,6 @@ insert_page:
     return 1;
 
 bad_copy:
-    /* this should only happen if the client passed a bad mfn */
-    ret = -EFAULT;
     failed_copies++;
 
 delete_and_free:
@@ -1740,7 +1736,7 @@ static NOINLINE int do_tmem_get(pool_t *
     pgp_t *pgp;
     client_t *client = pool->client;
     DECL_LOCAL_CYC_COUNTER(decompress);
-    int rc = -EFAULT;
+    int rc;
 
     if ( !_atomic_read(pool->pgp_count) )
         return -EEMPTY;
@@ -1764,20 +1760,20 @@ static NOINLINE int do_tmem_get(pool_t *
     ASSERT(pgp->size != -1);
     if ( tmh_dedup_enabled() && !is_persistent(pool) &&
               pgp->firstbyte != NOT_SHAREABLE )
+        rc = pcd_copy_to_client(cmfn, pgp);
+    else if ( pgp->size != 0 )
     {
-        rc = pcd_copy_to_client(cmfn, pgp);
-        if ( rc <= 0 )
-            goto bad_copy;
-    } else if ( pgp->size != 0 ) {
         START_CYC_COUNTER(decompress);
         rc = tmh_decompress_to_client(cmfn, pgp->cdata,
                                       pgp->size, clibuf);
-        if ( rc <= 0 )
-            goto bad_copy;
         END_CYC_COUNTER(decompress);
-    } else if ( tmh_copy_to_client(cmfn, pgp->pfp, tmem_offset,
-                                 pfn_offset, len, clibuf) == -EFAULT)
+    }
+    else
+        rc = tmh_copy_to_client(cmfn, pgp->pfp, tmem_offset,
+                                pfn_offset, len, clibuf);
+    if ( rc <= 0 )
         goto bad_copy;
+
     if ( is_ephemeral(pool) )
     {
         if ( is_private(pool) )
@@ -1814,7 +1810,6 @@ static NOINLINE int do_tmem_get(pool_t *
     return 1;
 
 bad_copy:
-    /* this should only happen if the client passed a bad mfn */
     failed_copies++;
     return rc;
 }
diff -r 122caf666c0c -r 2cce0490a260 xen/common/tmem_xen.c
--- a/xen/common/tmem_xen.c	Tue Sep 25 12:26:06 2012 +0200
+++ b/xen/common/tmem_xen.c	Tue Sep 25 12:26:29 2012 +0200
@@ -148,6 +148,8 @@ EXPORT int tmh_copy_from_client(pfp_t *p
     pfp_t *cli_pfp = NULL;
     int rc = 1;
 
+    if ( tmem_offset > PAGE_SIZE || pfn_offset > PAGE_SIZE || len > PAGE_SIZE )
+        return -EINVAL;
     ASSERT(pfp != NULL);
     tmem_mfn = page_to_mfn(pfp);
     tmem_va = map_domain_page(tmem_mfn);
@@ -178,6 +180,8 @@ EXPORT int tmh_copy_from_client(pfp_t *p
                                          pfn_offset, len) )
             rc = -EFAULT;
     }
+    else if ( len )
+        rc = -EINVAL;
     if ( cli_va )
         cli_put_page(cli_va, cli_pfp, cli_mfn, 0);
     unmap_domain_page(tmem_va);
@@ -225,6 +229,8 @@ EXPORT int tmh_copy_to_client(tmem_cli_m
     pfp_t *cli_pfp = NULL;
     int rc = 1;
 
+    if ( tmem_offset > PAGE_SIZE || pfn_offset > PAGE_SIZE || len > PAGE_SIZE )
+        return -EINVAL;
     ASSERT(pfp != NULL);
     if ( guest_handle_is_null(clibuf) )
     {
@@ -244,6 +250,8 @@ EXPORT int tmh_copy_to_client(tmem_cli_m
                                        tmem_va + tmem_offset, len) )
             rc = -EFAULT;
     }
+    else if ( len )
+        rc = -EINVAL;
     unmap_domain_page(tmem_va);
     if ( cli_va )
         cli_put_page(cli_va, cli_pfp, cli_mfn, 1);

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 02:55:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 02: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.xen.org>)
	id 1TGhmU-0001iu-1r; Wed, 26 Sep 2012 02: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 1TGhmS-0001fO-Md
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-27.messagelabs.com!1348628112!12356554!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26923 invoked from network); 26 Sep 2012 02:55:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Sep 2012 02: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 1TGhmK-0000Zf-Aq
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGhmK-0002rC-6F
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:12 +0000
Message-Id: <E1TGhmK-0002rC-6F@xenbits.xen.org>
Date: Wed, 26 Sep 2012 02: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] tmem: detect arithmetic overflow
	in tmh_copy_{from, to}_client()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348568789 -7200
# Node ID 2cce0490a2603ae9959cff04d292fe964a8bc28e
# Parent  122caf666c0cd07bb0829516c2f6d9f4d002fefe
tmem: detect arithmetic overflow in tmh_copy_{from,to}_client()

This implies adjusting callers to deal with errors other than -EFAULT
and removing some comments which would otherwise become stale.

Reported-by: Tim Deegan <tim@xen.org>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
xen-unstable changeset: 25855:33b8c42a87ec
xen-unstable date: Tue Sep 11 12:17:59 UTC 2012
---


diff -r 122caf666c0c -r 2cce0490a260 xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:26:06 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:26:29 2012 +0200
@@ -1538,7 +1538,7 @@ copy_uncompressed:
     /* tmh_copy_from_client properly handles len==0 and offsets != 0 */
     ret = tmh_copy_from_client(pgp->pfp, cmfn, tmem_offset, pfn_offset, len,
                                tmh_cli_buf_null);
-    if ( ret == -EFAULT )
+    if ( ret < 0 )
         goto bad_copy;
     if ( tmh_dedup_enabled() && !is_persistent(pool) )
     {
@@ -1559,9 +1559,7 @@ done:
     return 1;
 
 bad_copy:
-    /* this should only happen if the client passed a bad mfn */
     failed_copies++;
-    ret = -EFAULT;
     goto cleanup;
 
 failed_dup:
@@ -1665,7 +1663,7 @@ copy_uncompressed:
     /* tmh_copy_from_client properly handles len==0 (TMEM_NEW_PAGE) */
     ret = tmh_copy_from_client(pgp->pfp, cmfn, tmem_offset, pfn_offset, len,
                                clibuf);
-    if ( ret == -EFAULT )
+    if ( ret < 0 )
         goto bad_copy;
     if ( tmh_dedup_enabled() && !is_persistent(pool) )
     {
@@ -1705,8 +1703,6 @@ insert_page:
     return 1;
 
 bad_copy:
-    /* this should only happen if the client passed a bad mfn */
-    ret = -EFAULT;
     failed_copies++;
 
 delete_and_free:
@@ -1740,7 +1736,7 @@ static NOINLINE int do_tmem_get(pool_t *
     pgp_t *pgp;
     client_t *client = pool->client;
     DECL_LOCAL_CYC_COUNTER(decompress);
-    int rc = -EFAULT;
+    int rc;
 
     if ( !_atomic_read(pool->pgp_count) )
         return -EEMPTY;
@@ -1764,20 +1760,20 @@ static NOINLINE int do_tmem_get(pool_t *
     ASSERT(pgp->size != -1);
     if ( tmh_dedup_enabled() && !is_persistent(pool) &&
               pgp->firstbyte != NOT_SHAREABLE )
+        rc = pcd_copy_to_client(cmfn, pgp);
+    else if ( pgp->size != 0 )
     {
-        rc = pcd_copy_to_client(cmfn, pgp);
-        if ( rc <= 0 )
-            goto bad_copy;
-    } else if ( pgp->size != 0 ) {
         START_CYC_COUNTER(decompress);
         rc = tmh_decompress_to_client(cmfn, pgp->cdata,
                                       pgp->size, clibuf);
-        if ( rc <= 0 )
-            goto bad_copy;
         END_CYC_COUNTER(decompress);
-    } else if ( tmh_copy_to_client(cmfn, pgp->pfp, tmem_offset,
-                                 pfn_offset, len, clibuf) == -EFAULT)
+    }
+    else
+        rc = tmh_copy_to_client(cmfn, pgp->pfp, tmem_offset,
+                                pfn_offset, len, clibuf);
+    if ( rc <= 0 )
         goto bad_copy;
+
     if ( is_ephemeral(pool) )
     {
         if ( is_private(pool) )
@@ -1814,7 +1810,6 @@ static NOINLINE int do_tmem_get(pool_t *
     return 1;
 
 bad_copy:
-    /* this should only happen if the client passed a bad mfn */
     failed_copies++;
     return rc;
 }
diff -r 122caf666c0c -r 2cce0490a260 xen/common/tmem_xen.c
--- a/xen/common/tmem_xen.c	Tue Sep 25 12:26:06 2012 +0200
+++ b/xen/common/tmem_xen.c	Tue Sep 25 12:26:29 2012 +0200
@@ -148,6 +148,8 @@ EXPORT int tmh_copy_from_client(pfp_t *p
     pfp_t *cli_pfp = NULL;
     int rc = 1;
 
+    if ( tmem_offset > PAGE_SIZE || pfn_offset > PAGE_SIZE || len > PAGE_SIZE )
+        return -EINVAL;
     ASSERT(pfp != NULL);
     tmem_mfn = page_to_mfn(pfp);
     tmem_va = map_domain_page(tmem_mfn);
@@ -178,6 +180,8 @@ EXPORT int tmh_copy_from_client(pfp_t *p
                                          pfn_offset, len) )
             rc = -EFAULT;
     }
+    else if ( len )
+        rc = -EINVAL;
     if ( cli_va )
         cli_put_page(cli_va, cli_pfp, cli_mfn, 0);
     unmap_domain_page(tmem_va);
@@ -225,6 +229,8 @@ EXPORT int tmh_copy_to_client(tmem_cli_m
     pfp_t *cli_pfp = NULL;
     int rc = 1;
 
+    if ( tmem_offset > PAGE_SIZE || pfn_offset > PAGE_SIZE || len > PAGE_SIZE )
+        return -EINVAL;
     ASSERT(pfp != NULL);
     if ( guest_handle_is_null(clibuf) )
     {
@@ -244,6 +250,8 @@ EXPORT int tmh_copy_to_client(tmem_cli_m
                                        tmem_va + tmem_offset, len) )
             rc = -EFAULT;
     }
+    else if ( len )
+        rc = -EINVAL;
     unmap_domain_page(tmem_va);
     if ( cli_va )
         cli_put_page(cli_va, cli_pfp, cli_mfn, 1);

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 02:55:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 02: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.xen.org>)
	id 1TGhmV-0001kT-Ds; Wed, 26 Sep 2012 02: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 1TGhmU-0001fn-7p
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1348628115!11789819!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30039 invoked from network); 26 Sep 2012 02:55:15 -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;
	26 Sep 2012 02: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 1TGhmM-0000Zr-OX
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGhmM-0002sF-Mp
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:14 +0000
Message-Id: <E1TGhmM-0002sF-Mp@xenbits.xen.org>
Date: Wed, 26 Sep 2012 02:55:14 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] tmem: fixup 2010 cleanup patch
	that breaks tmem save/restore
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dan Magenheimer <dan.magenheimer@oracle.com>
# Date 1348568904 -7200
# Node ID 00ff640ebc7bd22b67b4c69f51dd44954c78dca8
# Parent  5a3829c943fff0295aa604a806009025c22dc9f3
tmem: fixup 2010 cleanup patch that breaks tmem save/restore

20918:a3fa6d444b25 "Fix domain reference leaks" (in Feb 2010, by Jan)
does some cleanup in addition to the leak fixes.  Unfortunately, that
cleanup inadvertently resulted in an incorrect fallthrough in a switch
statement which breaks tmem save/restore.

That broken patch was apparently applied to 4.0-testing and 4.1-testing
so those are broken as well.

What is the process now for requesting back-patches to 4.0 and 4.1?

(Side note: This does not by itself entirely fix save/restore in 4.2.)

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 25859:16e0392c6594
xen-unstable date: Tue Sep 11 12:19:03 UTC 2012
---


diff -r 5a3829c943ff -r 00ff640ebc7b xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:27:50 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:28:24 2012 +0200
@@ -2422,6 +2422,7 @@ static NOINLINE int tmemc_save_subop(int
              break;
         tmh_copy_to_client_buf(buf, pool->uuid, 2);
         rc = 0;
+        break;
     case TMEMC_SAVE_END:
         if ( client == NULL )
             break;
@@ -2432,6 +2433,7 @@ static NOINLINE int tmemc_save_subop(int
                 pgp_free_from_inv_list(client,pgp);
         client->frozen = client->was_frozen;
         rc = 0;
+        break;
     }
     return rc;
 }

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 02:55:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 02: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.xen.org>)
	id 1TGhmV-0001kT-Ds; Wed, 26 Sep 2012 02: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 1TGhmU-0001fn-7p
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1348628115!11789819!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30039 invoked from network); 26 Sep 2012 02:55:15 -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;
	26 Sep 2012 02: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 1TGhmM-0000Zr-OX
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGhmM-0002sF-Mp
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 02:55:14 +0000
Message-Id: <E1TGhmM-0002sF-Mp@xenbits.xen.org>
Date: Wed, 26 Sep 2012 02:55:14 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] tmem: fixup 2010 cleanup patch
	that breaks tmem save/restore
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dan Magenheimer <dan.magenheimer@oracle.com>
# Date 1348568904 -7200
# Node ID 00ff640ebc7bd22b67b4c69f51dd44954c78dca8
# Parent  5a3829c943fff0295aa604a806009025c22dc9f3
tmem: fixup 2010 cleanup patch that breaks tmem save/restore

20918:a3fa6d444b25 "Fix domain reference leaks" (in Feb 2010, by Jan)
does some cleanup in addition to the leak fixes.  Unfortunately, that
cleanup inadvertently resulted in an incorrect fallthrough in a switch
statement which breaks tmem save/restore.

That broken patch was apparently applied to 4.0-testing and 4.1-testing
so those are broken as well.

What is the process now for requesting back-patches to 4.0 and 4.1?

(Side note: This does not by itself entirely fix save/restore in 4.2.)

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 25859:16e0392c6594
xen-unstable date: Tue Sep 11 12:19:03 UTC 2012
---


diff -r 5a3829c943ff -r 00ff640ebc7b xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:27:50 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:28:24 2012 +0200
@@ -2422,6 +2422,7 @@ static NOINLINE int tmemc_save_subop(int
              break;
         tmh_copy_to_client_buf(buf, pool->uuid, 2);
         rc = 0;
+        break;
     case TMEMC_SAVE_END:
         if ( client == NULL )
             break;
@@ -2432,6 +2433,7 @@ static NOINLINE int tmemc_save_subop(int
                 pgp_free_from_inv_list(client,pgp);
         client->frozen = client->was_frozen;
         rc = 0;
+        break;
     }
     return rc;
 }

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 09:33:13 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 09:33:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGnzR-0007cs-Bj; Wed, 26 Sep 2012 09:33:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGnzP-0007cl-8K
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 09:33:07 +0000
Received: from [85.158.139.83:54245] by server-16.bemta-5.messagelabs.com id
	13/49-05998-2DBC2605; Wed, 26 Sep 2012 09:33:06 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-182.messagelabs.com!1348651984!31817999!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17434 invoked from network); 26 Sep 2012 09:33:05 -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;
	26 Sep 2012 09:33: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 1TGnzM-0005WS-3Z
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 09:33:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGnzL-00055o-QR
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 09:33:03 +0000
Message-Id: <E1TGnzL-00055o-QR@xenbits.xen.org>
Date: Wed, 26 Sep 2012 09: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] blkfront: adjustment for c/s
	1189:e09f03f312e5
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348651657 -7200
# Node ID 2491acc045e4b5a228dd133da9bb7cf443560a1d
# Parent  50245ed8527a266e614a233102b0994fc86f0151
blkfront: adjustment for c/s 1189:e09f03f312e5

Didn't handle the frontend block device being mounted.

Based on an upstream patch from David.

Reported-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 50245ed8527a -r 2491acc045e4 drivers/xen/blkfront/blkfront.c
--- a/drivers/xen/blkfront/blkfront.c	Tue Sep 25 11:49:44 2012 +0200
+++ b/drivers/xen/blkfront/blkfront.c	Wed Sep 26 11:27:37 2012 +0200
@@ -544,9 +544,16 @@ int blkif_release(struct inode *inode, s
 		if (!dev) {
 			blkfront_closing(info);
 			kfree(info);
-		} else if (xenbus_read_driver_state(dev->otherend)
-			   == XenbusStateClosing && info->is_ready)
-			blkfront_closing(info);
+		} else
+			switch (xenbus_read_driver_state(dev->otherend)) {
+			case XenbusStateClosing:
+			case XenbusStateClosed:
+				if (info->is_ready)
+					blkfront_closing(info);
+				break;
+			default:
+				break;
+			}
 	}
 	return 0;
 }

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 09:33:13 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 09:33:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGnzR-0007cs-Bj; Wed, 26 Sep 2012 09:33:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGnzP-0007cl-8K
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 09:33:07 +0000
Received: from [85.158.139.83:54245] by server-16.bemta-5.messagelabs.com id
	13/49-05998-2DBC2605; Wed, 26 Sep 2012 09:33:06 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-182.messagelabs.com!1348651984!31817999!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17434 invoked from network); 26 Sep 2012 09:33:05 -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;
	26 Sep 2012 09:33: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 1TGnzM-0005WS-3Z
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 09:33:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGnzL-00055o-QR
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 09:33:03 +0000
Message-Id: <E1TGnzL-00055o-QR@xenbits.xen.org>
Date: Wed, 26 Sep 2012 09: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] blkfront: adjustment for c/s
	1189:e09f03f312e5
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348651657 -7200
# Node ID 2491acc045e4b5a228dd133da9bb7cf443560a1d
# Parent  50245ed8527a266e614a233102b0994fc86f0151
blkfront: adjustment for c/s 1189:e09f03f312e5

Didn't handle the frontend block device being mounted.

Based on an upstream patch from David.

Reported-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 50245ed8527a -r 2491acc045e4 drivers/xen/blkfront/blkfront.c
--- a/drivers/xen/blkfront/blkfront.c	Tue Sep 25 11:49:44 2012 +0200
+++ b/drivers/xen/blkfront/blkfront.c	Wed Sep 26 11:27:37 2012 +0200
@@ -544,9 +544,16 @@ int blkif_release(struct inode *inode, s
 		if (!dev) {
 			blkfront_closing(info);
 			kfree(info);
-		} else if (xenbus_read_driver_state(dev->otherend)
-			   == XenbusStateClosing && info->is_ready)
-			blkfront_closing(info);
+		} else
+			switch (xenbus_read_driver_state(dev->otherend)) {
+			case XenbusStateClosing:
+			case XenbusStateClosed:
+				if (info->is_ready)
+					blkfront_closing(info);
+				break;
+			default:
+				break;
+			}
 	}
 	return 0;
 }

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 09:44:11 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 09:44:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGoA4-0007oL-IG; Wed, 26 Sep 2012 09:44:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGoA3-0007oA-9Z
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 09:44:07 +0000
Received: from [85.158.137.99:28435] by server-6.bemta-3.messagelabs.com id
	BC/1E-11085-66EC2605; Wed, 26 Sep 2012 09:44:06 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-217.messagelabs.com!1348652644!19144463!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30817 invoked from network); 26 Sep 2012 09:44:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Sep 2012 09: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 1TGoA0-0005cx-HK
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 09:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGoA0-0005MP-4f
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 09:44:04 +0000
Message-Id: <E1TGoA0-0005MP-4f@xenbits.xen.org>
Date: Wed, 26 Sep 2012 09: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] add further
	backward-compatibility configure options
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348651940 -7200
# Node ID 6741142f164f772e4a77d7a3a3fbfdbbb8f6e077
# Parent  2491acc045e4b5a228dd133da9bb7cf443560a1d
add further backward-compatibility configure options

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


diff -r 2491acc045e4 -r 6741142f164f drivers/xen/Kconfig
--- a/drivers/xen/Kconfig	Wed Sep 26 11:27:37 2012 +0200
+++ b/drivers/xen/Kconfig	Wed Sep 26 11:32:20 2012 +0200
@@ -324,6 +324,24 @@ choice
 	config XEN_COMPAT_030100_AND_LATER
 		bool "3.1.0 and later"
 
+	config XEN_COMPAT_030200_AND_LATER
+		bool "3.2.0 and later"
+
+	config XEN_COMPAT_030300_AND_LATER
+		bool "3.3.0 and later"
+
+	config XEN_COMPAT_030400_AND_LATER
+		bool "3.4.0 and later"
+
+	config XEN_COMPAT_040000_AND_LATER
+		bool "4.0.0 and later"
+
+	config XEN_COMPAT_040100_AND_LATER
+		bool "4.1.0 and later"
+
+	config XEN_COMPAT_040200_AND_LATER
+		bool "4.2.0 and later"
+
 	config XEN_COMPAT_LATEST_ONLY
 		bool "no compatibility code"
 
@@ -332,6 +350,12 @@ endchoice
 config XEN_COMPAT
 	hex
 	default 0xffffff if XEN_COMPAT_LATEST_ONLY
+	default 0x040200 if XEN_COMPAT_040200_AND_LATER
+	default 0x040100 if XEN_COMPAT_040100_AND_LATER
+	default 0x040000 if XEN_COMPAT_040000_AND_LATER
+	default 0x030400 if XEN_COMPAT_030400_AND_LATER
+	default 0x030300 if XEN_COMPAT_030300_AND_LATER
+	default 0x030200 if XEN_COMPAT_030200_AND_LATER
 	default 0x030100 if XEN_COMPAT_030100_AND_LATER
 	default 0x030004 if XEN_COMPAT_030004_AND_LATER
 	default 0x030002 if XEN_COMPAT_030002_AND_LATER

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 09:44:11 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 09:44:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGoA4-0007oL-IG; Wed, 26 Sep 2012 09:44:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGoA3-0007oA-9Z
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 09:44:07 +0000
Received: from [85.158.137.99:28435] by server-6.bemta-3.messagelabs.com id
	BC/1E-11085-66EC2605; Wed, 26 Sep 2012 09:44:06 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-217.messagelabs.com!1348652644!19144463!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30817 invoked from network); 26 Sep 2012 09:44:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Sep 2012 09: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 1TGoA0-0005cx-HK
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 09:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGoA0-0005MP-4f
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 09:44:04 +0000
Message-Id: <E1TGoA0-0005MP-4f@xenbits.xen.org>
Date: Wed, 26 Sep 2012 09: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] add further
	backward-compatibility configure options
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348651940 -7200
# Node ID 6741142f164f772e4a77d7a3a3fbfdbbb8f6e077
# Parent  2491acc045e4b5a228dd133da9bb7cf443560a1d
add further backward-compatibility configure options

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


diff -r 2491acc045e4 -r 6741142f164f drivers/xen/Kconfig
--- a/drivers/xen/Kconfig	Wed Sep 26 11:27:37 2012 +0200
+++ b/drivers/xen/Kconfig	Wed Sep 26 11:32:20 2012 +0200
@@ -324,6 +324,24 @@ choice
 	config XEN_COMPAT_030100_AND_LATER
 		bool "3.1.0 and later"
 
+	config XEN_COMPAT_030200_AND_LATER
+		bool "3.2.0 and later"
+
+	config XEN_COMPAT_030300_AND_LATER
+		bool "3.3.0 and later"
+
+	config XEN_COMPAT_030400_AND_LATER
+		bool "3.4.0 and later"
+
+	config XEN_COMPAT_040000_AND_LATER
+		bool "4.0.0 and later"
+
+	config XEN_COMPAT_040100_AND_LATER
+		bool "4.1.0 and later"
+
+	config XEN_COMPAT_040200_AND_LATER
+		bool "4.2.0 and later"
+
 	config XEN_COMPAT_LATEST_ONLY
 		bool "no compatibility code"
 
@@ -332,6 +350,12 @@ endchoice
 config XEN_COMPAT
 	hex
 	default 0xffffff if XEN_COMPAT_LATEST_ONLY
+	default 0x040200 if XEN_COMPAT_040200_AND_LATER
+	default 0x040100 if XEN_COMPAT_040100_AND_LATER
+	default 0x040000 if XEN_COMPAT_040000_AND_LATER
+	default 0x030400 if XEN_COMPAT_030400_AND_LATER
+	default 0x030300 if XEN_COMPAT_030300_AND_LATER
+	default 0x030200 if XEN_COMPAT_030200_AND_LATER
 	default 0x030100 if XEN_COMPAT_030100_AND_LATER
 	default 0x030004 if XEN_COMPAT_030004_AND_LATER
 	default 0x030002 if XEN_COMPAT_030002_AND_LATER

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 09:44:12 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 09:44:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGoA4-0007oQ-Kc; Wed, 26 Sep 2012 09:44:08 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGoA3-0007oC-M6
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 09:44:07 +0000
Received: from [85.158.139.211:43221] by server-3.bemta-5.messagelabs.com id
	E2/8A-16108-66EC2605; Wed, 26 Sep 2012 09:44:06 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-206.messagelabs.com!1348652644!18498031!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8692 invoked from network); 26 Sep 2012 09:44:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Sep 2012 09: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 1TGoA0-0005cz-MY
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 09:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGoA0-0005Me-IY
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 09:44:04 +0000
Message-Id: <E1TGoA0-0005Me-IY@xenbits.xen.org>
Date: Wed, 26 Sep 2012 09: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] PCI: suppress bogus warning on
	old hypervisors
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348652101 -7200
# Node ID a752ff67b472662f15883f179e554cc64a87b272
# Parent  6741142f164f772e4a77d7a3a3fbfdbbb8f6e077
PCI: suppress bogus warning on old hypervisors

pci_bus_remove_wrapper() warned even for the -ENOSYS case. By detecting
the missing support early (in pci_bus_probe_wrapper()) we can avoid
this by removing the hooks altogether in this case.

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


diff -r 6741142f164f -r a752ff67b472 drivers/xen/core/pci.c
--- a/drivers/xen/core/pci.c	Wed Sep 26 11:32:20 2012 +0200
+++ b/drivers/xen/core/pci.c	Wed Sep 26 11:35:01 2012 +0200
@@ -45,8 +45,21 @@ static int pci_bus_probe_wrapper(struct 
 		r = HYPERVISOR_physdev_op(PHYSDEVOP_manage_pci_add,
 					  &manage_pci);
 	}
-	if (r && r != -ENOSYS)
+
+	switch (r) {
+	case 0:
+		break;
+#if CONFIG_XEN_COMPAT < 0x030300
+	case -ENOSYS:
+		if (!manage_pci_ext.is_virtfn && !manage_pci_ext.is_extfn) {
+			pci_bus_type.probe = pci_bus_probe;
+			pci_bus_type.remove = pci_bus_remove;
+		}
+		break;
+#endif
+	default:
 		return r;
+	}
 
 	r = pci_bus_probe(dev);
 	return r;

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 09:44:12 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 09:44:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGoA4-0007oQ-Kc; Wed, 26 Sep 2012 09:44:08 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGoA3-0007oC-M6
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 09:44:07 +0000
Received: from [85.158.139.211:43221] by server-3.bemta-5.messagelabs.com id
	E2/8A-16108-66EC2605; Wed, 26 Sep 2012 09:44:06 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-206.messagelabs.com!1348652644!18498031!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8692 invoked from network); 26 Sep 2012 09:44:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Sep 2012 09: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 1TGoA0-0005cz-MY
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 09:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGoA0-0005Me-IY
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 09:44:04 +0000
Message-Id: <E1TGoA0-0005Me-IY@xenbits.xen.org>
Date: Wed, 26 Sep 2012 09: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] PCI: suppress bogus warning on
	old hypervisors
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348652101 -7200
# Node ID a752ff67b472662f15883f179e554cc64a87b272
# Parent  6741142f164f772e4a77d7a3a3fbfdbbb8f6e077
PCI: suppress bogus warning on old hypervisors

pci_bus_remove_wrapper() warned even for the -ENOSYS case. By detecting
the missing support early (in pci_bus_probe_wrapper()) we can avoid
this by removing the hooks altogether in this case.

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


diff -r 6741142f164f -r a752ff67b472 drivers/xen/core/pci.c
--- a/drivers/xen/core/pci.c	Wed Sep 26 11:32:20 2012 +0200
+++ b/drivers/xen/core/pci.c	Wed Sep 26 11:35:01 2012 +0200
@@ -45,8 +45,21 @@ static int pci_bus_probe_wrapper(struct 
 		r = HYPERVISOR_physdev_op(PHYSDEVOP_manage_pci_add,
 					  &manage_pci);
 	}
-	if (r && r != -ENOSYS)
+
+	switch (r) {
+	case 0:
+		break;
+#if CONFIG_XEN_COMPAT < 0x030300
+	case -ENOSYS:
+		if (!manage_pci_ext.is_virtfn && !manage_pci_ext.is_extfn) {
+			pci_bus_type.probe = pci_bus_probe;
+			pci_bus_type.remove = pci_bus_remove;
+		}
+		break;
+#endif
+	default:
 		return r;
+	}
 
 	r = pci_bus_probe(dev);
 	return r;

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 09:45:11 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 09:45:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGoB2-0007sj-PC; Wed, 26 Sep 2012 09:45:08 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGoB2-0007sZ-0v
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 09:45:08 +0000
Received: from [85.158.143.99:41229] by server-1.bemta-4.messagelabs.com id
	5C/8F-05684-3AEC2605; Wed, 26 Sep 2012 09:45:07 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-216.messagelabs.com!1348652704!23628891!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24749 invoked from network); 26 Sep 2012 09:45:05 -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;
	26 Sep 2012 09:45: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 1TGoA1-0005d3-4k
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 09:44:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGoA0-0005Mt-VM
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 09:44:04 +0000
Message-Id: <E1TGoA0-0005Mt-VM@xenbits.xen.org>
Date: Wed, 26 Sep 2012 09: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] IRQ/evtchn: adjust affinity
	handling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348652183 -7200
# Node ID f91e59ea970843355ab682d41c2181c1d5ec8850
# Parent  a752ff67b472662f15883f179e554cc64a87b272
IRQ/evtchn: adjust affinity handling

Virtually forever, Xen code diverged from native in the way affinities
of IRQs got managed: Native, even if restricting handling of an IRQ to
a single CPU e.g. because of APIC ID constraints, it would still keep
the affinity set to all permitted CPUs. Xen instead restricted the
affinity along with the handling. Retain that behavior only for per-CPU
IRQs (and for other dynamic ones on their initial setup, albeit perhaps
event that is still too strict), but make physical ones (and dynamic
ones if their affinity gets adjusted an the fly) match native behavior.

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


diff -r a752ff67b472 -r f91e59ea9708 drivers/xen/core/evtchn.c
--- a/drivers/xen/core/evtchn.c	Wed Sep 26 11:35:01 2012 +0200
+++ b/drivers/xen/core/evtchn.c	Wed Sep 26 11:36:23 2012 +0200
@@ -137,21 +137,28 @@ static inline unsigned long active_evtch
 		~sh->evtchn_mask[idx]);
 }
 
-static void bind_evtchn_to_cpu(unsigned int chn, unsigned int cpu)
+static void _bind_evtchn_to_cpu(unsigned int chn, unsigned int cpu, int irq,
+				cpumask_t cpumask)
 {
 	shared_info_t *s = HYPERVISOR_shared_info;
-	int irq = evtchn_to_irq[chn];
 
 	BUG_ON(!test_bit(chn, s->evtchn_mask));
 
-	if (irq != -1)
-		set_native_irq_info(irq, cpumask_of_cpu(cpu));
+	if (irq >= 0) {
+		BUG_ON(!cpu_isset(cpu, cpumask));
+		set_native_irq_info(irq, cpumask);
+	}
 
 	clear_bit(chn, (unsigned long *)cpu_evtchn_mask[cpu_evtchn[chn]]);
 	set_bit(chn, (unsigned long *)cpu_evtchn_mask[cpu]);
 	cpu_evtchn[chn] = cpu;
 }
 
+static void bind_evtchn_to_cpu(unsigned int chn, unsigned int cpu)
+{
+	_bind_evtchn_to_cpu(chn, cpu, evtchn_to_irq[chn], cpumask_of_cpu(cpu));
+}
+
 static void init_evtchn_cpu_bindings(void)
 {
 	int i;
@@ -180,6 +187,11 @@ static inline unsigned long active_evtch
 	return (sh->evtchn_pending[idx] & ~sh->evtchn_mask[idx]);
 }
 
+static void _bind_evtchn_to_cpu(unsigned int chn, unsigned int cpu, int irq,
+				cpumask_t cpumask)
+{
+}
+
 static void bind_evtchn_to_cpu(unsigned int chn, unsigned int cpu)
 {
 }
@@ -663,30 +675,32 @@ void unbind_from_irqhandler(unsigned int
 EXPORT_SYMBOL_GPL(unbind_from_irqhandler);
 
 #ifdef CONFIG_SMP
-void rebind_evtchn_to_cpu(int port, unsigned int cpu)
+static void _rebind_evtchn_to_cpu(int port, unsigned int cpu, int irq,
+				  cpumask_t dest)
 {
 	struct evtchn_bind_vcpu ebv = { .port = port, .vcpu = cpu };
 	int masked;
 
 	masked = test_and_set_evtchn_mask(port);
 	if (HYPERVISOR_event_channel_op(EVTCHNOP_bind_vcpu, &ebv) == 0)
-		bind_evtchn_to_cpu(port, cpu);
+		_bind_evtchn_to_cpu(port, cpu, irq, dest);
 	if (!masked)
 		unmask_evtchn(port);
 }
 
-static void rebind_irq_to_cpu(unsigned int irq, unsigned int tcpu)
+void rebind_evtchn_to_cpu(int port, unsigned int cpu)
 {
-	int evtchn = evtchn_from_irq(irq);
-
-	if (VALID_EVTCHN(evtchn))
-		rebind_evtchn_to_cpu(evtchn, tcpu);
+	_rebind_evtchn_to_cpu(port, cpu, evtchn_to_irq[port],
+			      cpumask_of_cpu(cpu));
 }
 
 static void set_affinity_irq(unsigned int irq, cpumask_t dest)
 {
+	int evtchn = evtchn_from_irq(irq);
 	unsigned tcpu = first_cpu(dest);
-	rebind_irq_to_cpu(irq, tcpu);
+
+	if (VALID_EVTCHN(evtchn))
+		_rebind_evtchn_to_cpu(evtchn, tcpu, irq, dest);
 }
 #endif
 
@@ -854,7 +868,7 @@ static unsigned int startup_pirq(unsigne
 	pirq_query_unmask(irq);
 
 	evtchn_to_irq[evtchn] = irq;
-	bind_evtchn_to_cpu(evtchn, 0);
+	_bind_evtchn_to_cpu(evtchn, 0, irq, cpu_possible_map);
 	irq_info[irq] = mk_irq_info(IRQT_PIRQ, bind_pirq.pirq, evtchn);
 
  out:
@@ -1019,7 +1033,7 @@ static void restore_cpu_virqs(unsigned i
 		/* Record the new mapping. */
 		evtchn_to_irq[evtchn] = irq;
 		irq_info[irq] = mk_irq_info(IRQT_VIRQ, virq, evtchn);
-		bind_evtchn_to_cpu(evtchn, cpu);
+		_bind_evtchn_to_cpu(evtchn, cpu, -1, CPU_MASK_NONE);
 
 		/* Ready for use. */
 		unmask_evtchn(evtchn);
@@ -1047,7 +1061,7 @@ static void restore_cpu_ipis(unsigned in
 		/* Record the new mapping. */
 		evtchn_to_irq[evtchn] = irq;
 		irq_info[irq] = mk_irq_info(IRQT_IPI, ipi, evtchn);
-		bind_evtchn_to_cpu(evtchn, cpu);
+		_bind_evtchn_to_cpu(evtchn, cpu, -1, CPU_MASK_NONE);
 
 		/* Ready for use. */
 		unmask_evtchn(evtchn);

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 09:45:11 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 09:45:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGoB2-0007sj-PC; Wed, 26 Sep 2012 09:45:08 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGoB2-0007sZ-0v
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 09:45:08 +0000
Received: from [85.158.143.99:41229] by server-1.bemta-4.messagelabs.com id
	5C/8F-05684-3AEC2605; Wed, 26 Sep 2012 09:45:07 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-216.messagelabs.com!1348652704!23628891!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24749 invoked from network); 26 Sep 2012 09:45:05 -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;
	26 Sep 2012 09:45: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 1TGoA1-0005d3-4k
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 09:44:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGoA0-0005Mt-VM
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 09:44:04 +0000
Message-Id: <E1TGoA0-0005Mt-VM@xenbits.xen.org>
Date: Wed, 26 Sep 2012 09: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] IRQ/evtchn: adjust affinity
	handling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348652183 -7200
# Node ID f91e59ea970843355ab682d41c2181c1d5ec8850
# Parent  a752ff67b472662f15883f179e554cc64a87b272
IRQ/evtchn: adjust affinity handling

Virtually forever, Xen code diverged from native in the way affinities
of IRQs got managed: Native, even if restricting handling of an IRQ to
a single CPU e.g. because of APIC ID constraints, it would still keep
the affinity set to all permitted CPUs. Xen instead restricted the
affinity along with the handling. Retain that behavior only for per-CPU
IRQs (and for other dynamic ones on their initial setup, albeit perhaps
event that is still too strict), but make physical ones (and dynamic
ones if their affinity gets adjusted an the fly) match native behavior.

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


diff -r a752ff67b472 -r f91e59ea9708 drivers/xen/core/evtchn.c
--- a/drivers/xen/core/evtchn.c	Wed Sep 26 11:35:01 2012 +0200
+++ b/drivers/xen/core/evtchn.c	Wed Sep 26 11:36:23 2012 +0200
@@ -137,21 +137,28 @@ static inline unsigned long active_evtch
 		~sh->evtchn_mask[idx]);
 }
 
-static void bind_evtchn_to_cpu(unsigned int chn, unsigned int cpu)
+static void _bind_evtchn_to_cpu(unsigned int chn, unsigned int cpu, int irq,
+				cpumask_t cpumask)
 {
 	shared_info_t *s = HYPERVISOR_shared_info;
-	int irq = evtchn_to_irq[chn];
 
 	BUG_ON(!test_bit(chn, s->evtchn_mask));
 
-	if (irq != -1)
-		set_native_irq_info(irq, cpumask_of_cpu(cpu));
+	if (irq >= 0) {
+		BUG_ON(!cpu_isset(cpu, cpumask));
+		set_native_irq_info(irq, cpumask);
+	}
 
 	clear_bit(chn, (unsigned long *)cpu_evtchn_mask[cpu_evtchn[chn]]);
 	set_bit(chn, (unsigned long *)cpu_evtchn_mask[cpu]);
 	cpu_evtchn[chn] = cpu;
 }
 
+static void bind_evtchn_to_cpu(unsigned int chn, unsigned int cpu)
+{
+	_bind_evtchn_to_cpu(chn, cpu, evtchn_to_irq[chn], cpumask_of_cpu(cpu));
+}
+
 static void init_evtchn_cpu_bindings(void)
 {
 	int i;
@@ -180,6 +187,11 @@ static inline unsigned long active_evtch
 	return (sh->evtchn_pending[idx] & ~sh->evtchn_mask[idx]);
 }
 
+static void _bind_evtchn_to_cpu(unsigned int chn, unsigned int cpu, int irq,
+				cpumask_t cpumask)
+{
+}
+
 static void bind_evtchn_to_cpu(unsigned int chn, unsigned int cpu)
 {
 }
@@ -663,30 +675,32 @@ void unbind_from_irqhandler(unsigned int
 EXPORT_SYMBOL_GPL(unbind_from_irqhandler);
 
 #ifdef CONFIG_SMP
-void rebind_evtchn_to_cpu(int port, unsigned int cpu)
+static void _rebind_evtchn_to_cpu(int port, unsigned int cpu, int irq,
+				  cpumask_t dest)
 {
 	struct evtchn_bind_vcpu ebv = { .port = port, .vcpu = cpu };
 	int masked;
 
 	masked = test_and_set_evtchn_mask(port);
 	if (HYPERVISOR_event_channel_op(EVTCHNOP_bind_vcpu, &ebv) == 0)
-		bind_evtchn_to_cpu(port, cpu);
+		_bind_evtchn_to_cpu(port, cpu, irq, dest);
 	if (!masked)
 		unmask_evtchn(port);
 }
 
-static void rebind_irq_to_cpu(unsigned int irq, unsigned int tcpu)
+void rebind_evtchn_to_cpu(int port, unsigned int cpu)
 {
-	int evtchn = evtchn_from_irq(irq);
-
-	if (VALID_EVTCHN(evtchn))
-		rebind_evtchn_to_cpu(evtchn, tcpu);
+	_rebind_evtchn_to_cpu(port, cpu, evtchn_to_irq[port],
+			      cpumask_of_cpu(cpu));
 }
 
 static void set_affinity_irq(unsigned int irq, cpumask_t dest)
 {
+	int evtchn = evtchn_from_irq(irq);
 	unsigned tcpu = first_cpu(dest);
-	rebind_irq_to_cpu(irq, tcpu);
+
+	if (VALID_EVTCHN(evtchn))
+		_rebind_evtchn_to_cpu(evtchn, tcpu, irq, dest);
 }
 #endif
 
@@ -854,7 +868,7 @@ static unsigned int startup_pirq(unsigne
 	pirq_query_unmask(irq);
 
 	evtchn_to_irq[evtchn] = irq;
-	bind_evtchn_to_cpu(evtchn, 0);
+	_bind_evtchn_to_cpu(evtchn, 0, irq, cpu_possible_map);
 	irq_info[irq] = mk_irq_info(IRQT_PIRQ, bind_pirq.pirq, evtchn);
 
  out:
@@ -1019,7 +1033,7 @@ static void restore_cpu_virqs(unsigned i
 		/* Record the new mapping. */
 		evtchn_to_irq[evtchn] = irq;
 		irq_info[irq] = mk_irq_info(IRQT_VIRQ, virq, evtchn);
-		bind_evtchn_to_cpu(evtchn, cpu);
+		_bind_evtchn_to_cpu(evtchn, cpu, -1, CPU_MASK_NONE);
 
 		/* Ready for use. */
 		unmask_evtchn(evtchn);
@@ -1047,7 +1061,7 @@ static void restore_cpu_ipis(unsigned in
 		/* Record the new mapping. */
 		evtchn_to_irq[evtchn] = irq;
 		irq_info[irq] = mk_irq_info(IRQT_IPI, ipi, evtchn);
-		bind_evtchn_to_cpu(evtchn, cpu);
+		_bind_evtchn_to_cpu(evtchn, cpu, -1, CPU_MASK_NONE);
 
 		/* Ready for use. */
 		unmask_evtchn(evtchn);

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 14:44:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 14:44:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGsqU-0000pS-Ho; Wed, 26 Sep 2012 14:44:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGsqT-0000om-CW
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:13 +0000
Received: from [85.158.143.99:7323] by server-2.bemta-4.messagelabs.com id
	D9/7F-06610-CB413605; Wed, 26 Sep 2012 14:44:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-216.messagelabs.com!1348670651!25745226!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20581 invoked from network); 26 Sep 2012 14:44: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;
	26 Sep 2012 14: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 1TGsqQ-0000cv-Od
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGsqQ-0005MG-Jd
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:10 +0000
Message-Id: <E1TGsqQ-0005MG-Jd@xenbits.xen.org>
Date: Wed, 26 Sep 2012 14:44:10 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] tmem: check for a valid client
	("domain") in the save subops
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1348568020 -7200
# Node ID b383875a33f07ba75a6c5ceedf93e58ccb042676
# Parent  da0fd47f59b4bb479bd550dc2abd8c04bf3e0317
tmem: check for a valid client ("domain") in the save subops

This is part of XSA-15 / CVE-2012-3497.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
xen-unstable changeset: 25853:f53c5aadbba9
xen-unstable date: Tue Sep 11 12:17:27 UTC 2012
---


diff -r da0fd47f59b4 -r b383875a33f0 xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:12:48 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:13:40 2012 +0200
@@ -2379,12 +2379,18 @@ static NOINLINE int tmemc_save_subop(int
         rc = MAX_POOLS_PER_DOMAIN;
         break;
     case TMEMC_SAVE_GET_CLIENT_WEIGHT:
+        if ( client == NULL )
+            break;
         rc = client->weight == -1 ? -2 : client->weight;
         break;
     case TMEMC_SAVE_GET_CLIENT_CAP:
+        if ( client == NULL )
+            break;
         rc = client->cap == -1 ? -2 : client->cap;
         break;
     case TMEMC_SAVE_GET_CLIENT_FLAGS:
+        if ( client == NULL )
+            break;
         rc = (client->compress ? TMEM_CLIENT_COMPRESS : 0 ) |
              (client->was_frozen ? TMEM_CLIENT_FROZEN : 0 );
         break;
@@ -2408,6 +2414,8 @@ static NOINLINE int tmemc_save_subop(int
         *uuid = pool->uuid[1];
         rc = 0;
     case TMEMC_SAVE_END:
+        if ( client == NULL )
+            break;
         client->live_migrating = 0;
         if ( !list_empty(&client->persistent_invalidated_list) )
             list_for_each_entry_safe(pgp,pgp2,

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 14:44:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 14:44:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGsqU-0000pS-Ho; Wed, 26 Sep 2012 14:44:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGsqT-0000om-CW
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:13 +0000
Received: from [85.158.143.99:7323] by server-2.bemta-4.messagelabs.com id
	D9/7F-06610-CB413605; Wed, 26 Sep 2012 14:44:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-216.messagelabs.com!1348670651!25745226!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20581 invoked from network); 26 Sep 2012 14:44: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;
	26 Sep 2012 14: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 1TGsqQ-0000cv-Od
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGsqQ-0005MG-Jd
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:10 +0000
Message-Id: <E1TGsqQ-0005MG-Jd@xenbits.xen.org>
Date: Wed, 26 Sep 2012 14:44:10 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] tmem: check for a valid client
	("domain") in the save subops
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1348568020 -7200
# Node ID b383875a33f07ba75a6c5ceedf93e58ccb042676
# Parent  da0fd47f59b4bb479bd550dc2abd8c04bf3e0317
tmem: check for a valid client ("domain") in the save subops

This is part of XSA-15 / CVE-2012-3497.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
xen-unstable changeset: 25853:f53c5aadbba9
xen-unstable date: Tue Sep 11 12:17:27 UTC 2012
---


diff -r da0fd47f59b4 -r b383875a33f0 xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:12:48 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:13:40 2012 +0200
@@ -2379,12 +2379,18 @@ static NOINLINE int tmemc_save_subop(int
         rc = MAX_POOLS_PER_DOMAIN;
         break;
     case TMEMC_SAVE_GET_CLIENT_WEIGHT:
+        if ( client == NULL )
+            break;
         rc = client->weight == -1 ? -2 : client->weight;
         break;
     case TMEMC_SAVE_GET_CLIENT_CAP:
+        if ( client == NULL )
+            break;
         rc = client->cap == -1 ? -2 : client->cap;
         break;
     case TMEMC_SAVE_GET_CLIENT_FLAGS:
+        if ( client == NULL )
+            break;
         rc = (client->compress ? TMEM_CLIENT_COMPRESS : 0 ) |
              (client->was_frozen ? TMEM_CLIENT_FROZEN : 0 );
         break;
@@ -2408,6 +2414,8 @@ static NOINLINE int tmemc_save_subop(int
         *uuid = pool->uuid[1];
         rc = 0;
     case TMEMC_SAVE_END:
+        if ( client == NULL )
+            break;
         client->live_migrating = 0;
         if ( !list_empty(&client->persistent_invalidated_list) )
             list_for_each_entry_safe(pgp,pgp2,

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 14:44:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 14:44:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGsqT-0000os-Cq; Wed, 26 Sep 2012 14:44:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGsqS-0000oP-2u
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:12 +0000
Received: from [85.158.139.211:6395] by server-5.bemta-5.messagelabs.com id
	3B/68-21075-BB413605; Wed, 26 Sep 2012 14:44:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-206.messagelabs.com!1348670649!20071136!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27888 invoked from network); 26 Sep 2012 14:44:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Sep 2012 14: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 1TGsqP-0000cm-Ds
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGsqO-0005Kb-TD
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:09 +0000
Message-Id: <E1TGsqO-0005Kb-TD@xenbits.xen.org>
Date: Wed, 26 Sep 2012 14:44:08 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] tmem: only allow tmem control
	operations from privileged domains
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1348567759 -7200
# Node ID e0dc63c822b2825e84eee3b49cd05052cb0059d3
# Parent  3462914d95d32d5657de1fad8fd79547c696f081
tmem: only allow tmem control operations from privileged domains

This is part of XSA-15 / CVE-2012-3497.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Acked-by-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 25850:0dba5a888655
xen-unstable date: Tue Sep 11 12:06:30 UTC 2012
---


diff -r 3462914d95d3 -r e0dc63c822b2 xen/common/tmem.c
--- a/xen/common/tmem.c	Wed Sep 19 17:33:05 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:09:19 2012 +0200
@@ -2541,10 +2541,8 @@ static NOINLINE int do_tmem_control(stru
     OID *oidp = (OID *)(&op->u.ctrl.oid[0]);
 
     if (!tmh_current_is_privileged())
-    {
-        /* don't fail... mystery: sometimes dom0 fails here */
-        /* return -EPERM; */
-    }
+        return -EPERM;
+
     switch(subop)
     {
     case TMEMC_THAW:

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 14:44:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 14:44:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGsqT-0000os-Cq; Wed, 26 Sep 2012 14:44:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGsqS-0000oP-2u
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:12 +0000
Received: from [85.158.139.211:6395] by server-5.bemta-5.messagelabs.com id
	3B/68-21075-BB413605; Wed, 26 Sep 2012 14:44:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-206.messagelabs.com!1348670649!20071136!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27888 invoked from network); 26 Sep 2012 14:44:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Sep 2012 14: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 1TGsqP-0000cm-Ds
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGsqO-0005Kb-TD
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:09 +0000
Message-Id: <E1TGsqO-0005Kb-TD@xenbits.xen.org>
Date: Wed, 26 Sep 2012 14:44:08 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] tmem: only allow tmem control
	operations from privileged domains
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1348567759 -7200
# Node ID e0dc63c822b2825e84eee3b49cd05052cb0059d3
# Parent  3462914d95d32d5657de1fad8fd79547c696f081
tmem: only allow tmem control operations from privileged domains

This is part of XSA-15 / CVE-2012-3497.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Acked-by-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 25850:0dba5a888655
xen-unstable date: Tue Sep 11 12:06:30 UTC 2012
---


diff -r 3462914d95d3 -r e0dc63c822b2 xen/common/tmem.c
--- a/xen/common/tmem.c	Wed Sep 19 17:33:05 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:09:19 2012 +0200
@@ -2541,10 +2541,8 @@ static NOINLINE int do_tmem_control(stru
     OID *oidp = (OID *)(&op->u.ctrl.oid[0]);
 
     if (!tmh_current_is_privileged())
-    {
-        /* don't fail... mystery: sometimes dom0 fails here */
-        /* return -EPERM; */
-    }
+        return -EPERM;
+
     switch(subop)
     {
     case TMEMC_THAW:

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 14:44:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 14:44:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGsqV-0000qB-Pw; Wed, 26 Sep 2012 14:44:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGsqU-0000oS-Oj
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:14 +0000
Received: from [85.158.139.83:32240] by server-16.bemta-5.messagelabs.com id
	4E/1A-05998-EB413605; Wed, 26 Sep 2012 14:44:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-182.messagelabs.com!1348670652!24894137!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13633 invoked from network); 26 Sep 2012 14:44:13 -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;
	26 Sep 2012 14:44: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 1TGsqS-0000d7-QT
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGsqS-0005NG-MD
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:12 +0000
Message-Id: <E1TGsqS-0005NG-MD@xenbits.xen.org>
Date: Wed, 26 Sep 2012 14:44:12 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] tmem: properly drop lock on error
	path in do_tmem_op()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348568194 -7200
# Node ID 22dfc72fdbf394098027e051bba2ebbd40f2ee32
# Parent  b4218d4791cd1ed3baa668b2a7dddb15b7186499
tmem: properly drop lock on error path in do_tmem_op()

Reported-by: Tim Deegan <tim@xen.org>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
xen-unstable changeset: 25857:109ea6a0c23a
xen-unstable date: Tue Sep 11 12:18:26 UTC 2012
---


diff -r b4218d4791cd -r 22dfc72fdbf3 xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:16:14 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:16:34 2012 +0200
@@ -2659,13 +2659,19 @@ EXPORT long do_tmem_op(tmem_cli_op_t uop
     if ( client != NULL && tmh_client_is_dying(client) )
     {
         rc = -ENODEV;
-        goto out;
+        if ( tmh_lock_all )
+            goto out;
+ simple_error:
+        errored_tmem_ops++;
+        return rc;
     }
 
     if ( unlikely(tmh_get_tmemop_from_client(&op, uops) != 0) )
     {
         printk("tmem: can't get tmem struct from %s\n",client_str);
         rc = -EFAULT;
+        if ( !tmh_lock_all )
+            goto simple_error;
         goto out;
     }
 

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 14:44:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 14:44:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGsqV-0000qB-Pw; Wed, 26 Sep 2012 14:44:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGsqU-0000oS-Oj
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:14 +0000
Received: from [85.158.139.83:32240] by server-16.bemta-5.messagelabs.com id
	4E/1A-05998-EB413605; Wed, 26 Sep 2012 14:44:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-182.messagelabs.com!1348670652!24894137!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13633 invoked from network); 26 Sep 2012 14:44:13 -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;
	26 Sep 2012 14:44: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 1TGsqS-0000d7-QT
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGsqS-0005NG-MD
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:12 +0000
Message-Id: <E1TGsqS-0005NG-MD@xenbits.xen.org>
Date: Wed, 26 Sep 2012 14:44:12 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] tmem: properly drop lock on error
	path in do_tmem_op()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348568194 -7200
# Node ID 22dfc72fdbf394098027e051bba2ebbd40f2ee32
# Parent  b4218d4791cd1ed3baa668b2a7dddb15b7186499
tmem: properly drop lock on error path in do_tmem_op()

Reported-by: Tim Deegan <tim@xen.org>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
xen-unstable changeset: 25857:109ea6a0c23a
xen-unstable date: Tue Sep 11 12:18:26 UTC 2012
---


diff -r b4218d4791cd -r 22dfc72fdbf3 xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:16:14 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:16:34 2012 +0200
@@ -2659,13 +2659,19 @@ EXPORT long do_tmem_op(tmem_cli_op_t uop
     if ( client != NULL && tmh_client_is_dying(client) )
     {
         rc = -ENODEV;
-        goto out;
+        if ( tmh_lock_all )
+            goto out;
+ simple_error:
+        errored_tmem_ops++;
+        return rc;
     }
 
     if ( unlikely(tmh_get_tmemop_from_client(&op, uops) != 0) )
     {
         printk("tmem: can't get tmem struct from %s\n",client_str);
         rc = -EFAULT;
+        if ( !tmh_lock_all )
+            goto simple_error;
         goto out;
     }
 

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 14:44:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 14:44:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGsqV-0000qN-TC; Wed, 26 Sep 2012 14:44:15 +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 1TGsqV-0000pM-3I
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:15 +0000
Received: from [85.158.137.99:61867] by server-6.bemta-3.messagelabs.com id
	45/AA-11085-EB413605; Wed, 26 Sep 2012 14:44:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-217.messagelabs.com!1348670652!14158230!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25003 invoked from network); 26 Sep 2012 14:44:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Sep 2012 14:44: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 1TGsqS-0000d4-6y
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGsqS-0005N1-5q
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:12 +0000
Message-Id: <E1TGsqS-0005N1-5q@xenbits.xen.org>
Date: Wed, 26 Sep 2012 14:44:11 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] tmem: properly drop lock on error
	path in do_tmem_get()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348568174 -7200
# Node ID b4218d4791cd1ed3baa668b2a7dddb15b7186499
# Parent  61c35eaf1a88bb68816a18f2ae25dedd60f71ae0
tmem: properly drop lock on error path in do_tmem_get()

Also remove a bogus assertion.

Reported-by: Tim Deegan <tim@xen.org>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
xen-unstable changeset: 25856:83b97a59888b
xen-unstable date: Tue Sep 11 12:18:08 UTC 2012
---


diff -r 61c35eaf1a88 -r b4218d4791cd xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:15:01 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:16:14 2012 +0200
@@ -1790,7 +1790,6 @@ static NOINLINE int do_tmem_get(pool_t *
             list_del(&pgp->us.client_eph_pages);
             list_add_tail(&pgp->us.client_eph_pages,&client->ephemeral_page_list);
             tmem_spin_unlock(&eph_lists_spinlock);
-            ASSERT(obj != NULL);
             obj->last_client = tmh_get_cli_id_from_current();
         }
     }
@@ -1807,6 +1806,8 @@ static NOINLINE int do_tmem_get(pool_t *
     return 1;
 
 bad_copy:
+    obj->no_evict = 0;
+    tmem_spin_unlock(&obj->obj_spinlock);
     failed_copies++;
     return rc;
 }

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 14:44:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 14:44:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGsqV-0000qN-TC; Wed, 26 Sep 2012 14:44:15 +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 1TGsqV-0000pM-3I
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:15 +0000
Received: from [85.158.137.99:61867] by server-6.bemta-3.messagelabs.com id
	45/AA-11085-EB413605; Wed, 26 Sep 2012 14:44:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-217.messagelabs.com!1348670652!14158230!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25003 invoked from network); 26 Sep 2012 14:44:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Sep 2012 14:44: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 1TGsqS-0000d4-6y
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGsqS-0005N1-5q
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:12 +0000
Message-Id: <E1TGsqS-0005N1-5q@xenbits.xen.org>
Date: Wed, 26 Sep 2012 14:44:11 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] tmem: properly drop lock on error
	path in do_tmem_get()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348568174 -7200
# Node ID b4218d4791cd1ed3baa668b2a7dddb15b7186499
# Parent  61c35eaf1a88bb68816a18f2ae25dedd60f71ae0
tmem: properly drop lock on error path in do_tmem_get()

Also remove a bogus assertion.

Reported-by: Tim Deegan <tim@xen.org>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
xen-unstable changeset: 25856:83b97a59888b
xen-unstable date: Tue Sep 11 12:18:08 UTC 2012
---


diff -r 61c35eaf1a88 -r b4218d4791cd xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:15:01 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:16:14 2012 +0200
@@ -1790,7 +1790,6 @@ static NOINLINE int do_tmem_get(pool_t *
             list_del(&pgp->us.client_eph_pages);
             list_add_tail(&pgp->us.client_eph_pages,&client->ephemeral_page_list);
             tmem_spin_unlock(&eph_lists_spinlock);
-            ASSERT(obj != NULL);
             obj->last_client = tmh_get_cli_id_from_current();
         }
     }
@@ -1807,6 +1806,8 @@ static NOINLINE int do_tmem_get(pool_t *
     return 1;
 
 bad_copy:
+    obj->no_evict = 0;
+    tmem_spin_unlock(&obj->obj_spinlock);
     failed_copies++;
     return rc;
 }

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 14:44:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 14:44:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGsqV-0000q6-NM; Wed, 26 Sep 2012 14:44:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGsqU-0000pD-Ey
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:14 +0000
Received: from [85.158.139.211:45775] by server-10.bemta-5.messagelabs.com id
	80/AD-16911-DB413605; Wed, 26 Sep 2012 14:44:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-206.messagelabs.com!1348670651!19050252!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10733 invoked from network); 26 Sep 2012 14:44:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Sep 2012 14:44: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 1TGsqR-0000d1-N4
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGsqR-0005Mm-Lp
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:11 +0000
Message-Id: <E1TGsqR-0005Mm-Lp@xenbits.xen.org>
Date: Wed, 26 Sep 2012 14:44:11 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] tmem: detect arithmetic overflow
	in tmh_copy_{from, to}_client()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348568101 -7200
# Node ID 61c35eaf1a88bb68816a18f2ae25dedd60f71ae0
# Parent  5bc3e774301c435c97b2d1a40193b19b8911bdfa
tmem: detect arithmetic overflow in tmh_copy_{from,to}_client()

This implies adjusting callers to deal with errors other than -EFAULT
and removing some comments which would otherwise become stale.

Reported-by: Tim Deegan <tim@xen.org>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
xen-unstable changeset: 25855:33b8c42a87ec
xen-unstable date: Tue Sep 11 12:17:59 UTC 2012
---


diff -r 5bc3e774301c -r 61c35eaf1a88 xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:14:31 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:15:01 2012 +0200
@@ -1535,7 +1535,7 @@ copy_uncompressed:
     /* tmh_copy_from_client properly handles len==0 and offsets != 0 */
     ret = tmh_copy_from_client(pgp->pfp, cmfn, tmem_offset, pfn_offset, len,
                                tmh_cli_buf_null);
-    if ( ret == -EFAULT )
+    if ( ret < 0 )
         goto bad_copy;
     if ( tmh_dedup_enabled() && !is_persistent(pool) )
     {
@@ -1556,9 +1556,7 @@ done:
     return 1;
 
 bad_copy:
-    /* this should only happen if the client passed a bad mfn */
     failed_copies++;
-    ret = -EFAULT;
     goto cleanup;
 
 failed_dup:
@@ -1662,7 +1660,7 @@ copy_uncompressed:
     /* tmh_copy_from_client properly handles len==0 (TMEM_NEW_PAGE) */
     ret = tmh_copy_from_client(pgp->pfp, cmfn, tmem_offset, pfn_offset, len,
                                clibuf);
-    if ( ret == -EFAULT )
+    if ( ret < 0 )
         goto bad_copy;
     if ( tmh_dedup_enabled() && !is_persistent(pool) )
     {
@@ -1702,8 +1700,6 @@ insert_page:
     return 1;
 
 bad_copy:
-    /* this should only happen if the client passed a bad mfn */
-    ret = -EFAULT;
     failed_copies++;
 
 delete_and_free:
@@ -1737,7 +1733,7 @@ static NOINLINE int do_tmem_get(pool_t *
     pgp_t *pgp;
     client_t *client = pool->client;
     DECL_LOCAL_CYC_COUNTER(decompress);
-    int rc = -EFAULT;
+    int rc;
 
     if ( !_atomic_read(pool->pgp_count) )
         return -EEMPTY;
@@ -1761,20 +1757,20 @@ static NOINLINE int do_tmem_get(pool_t *
     ASSERT(pgp->size != -1);
     if ( tmh_dedup_enabled() && !is_persistent(pool) &&
               pgp->firstbyte != NOT_SHAREABLE )
+        rc = pcd_copy_to_client(cmfn, pgp);
+    else if ( pgp->size != 0 )
     {
-        rc = pcd_copy_to_client(cmfn, pgp);
-        if ( rc <= 0 )
-            goto bad_copy;
-    } else if ( pgp->size != 0 ) {
         START_CYC_COUNTER(decompress);
         rc = tmh_decompress_to_client(cmfn, pgp->cdata,
                                       pgp->size, clibuf);
-        if ( rc <= 0 )
-            goto bad_copy;
         END_CYC_COUNTER(decompress);
-    } else if ( tmh_copy_to_client(cmfn, pgp->pfp, tmem_offset,
-                                 pfn_offset, len, clibuf) == -EFAULT)
+    }
+    else
+        rc = tmh_copy_to_client(cmfn, pgp->pfp, tmem_offset,
+                                pfn_offset, len, clibuf);
+    if ( rc <= 0 )
         goto bad_copy;
+
     if ( is_ephemeral(pool) )
     {
         if ( is_private(pool) )
@@ -1811,7 +1807,6 @@ static NOINLINE int do_tmem_get(pool_t *
     return 1;
 
 bad_copy:
-    /* this should only happen if the client passed a bad mfn */
     failed_copies++;
     return rc;
 }
diff -r 5bc3e774301c -r 61c35eaf1a88 xen/common/tmem_xen.c
--- a/xen/common/tmem_xen.c	Tue Sep 25 12:14:31 2012 +0200
+++ b/xen/common/tmem_xen.c	Tue Sep 25 12:15:01 2012 +0200
@@ -153,6 +153,8 @@ EXPORT int tmh_copy_from_client(pfp_t *p
     pfp_t *cli_pfp = NULL;
     int rc = 1;
 
+    if ( tmem_offset > PAGE_SIZE || pfn_offset > PAGE_SIZE || len > PAGE_SIZE )
+        return -EINVAL;
     ASSERT(pfp != NULL);
     tmem_mfn = page_to_mfn(pfp);
     tmem_va = map_domain_page(tmem_mfn);
@@ -183,6 +185,8 @@ EXPORT int tmh_copy_from_client(pfp_t *p
                                          pfn_offset, len) )
             rc = -EFAULT;
     }
+    else if ( len )
+        rc = -EINVAL;
     if ( cli_va )
         cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 0);
     unmap_domain_page(tmem_va);
@@ -230,6 +234,8 @@ EXPORT int tmh_copy_to_client(tmem_cli_m
     pfp_t *cli_pfp = NULL;
     int rc = 1;
 
+    if ( tmem_offset > PAGE_SIZE || pfn_offset > PAGE_SIZE || len > PAGE_SIZE )
+        return -EINVAL;
     ASSERT(pfp != NULL);
     if ( guest_handle_is_null(clibuf) )
     {
@@ -249,6 +255,8 @@ EXPORT int tmh_copy_to_client(tmem_cli_m
                                        tmem_va + tmem_offset, len) )
             rc = -EFAULT;
     }
+    else if ( len )
+        rc = -EINVAL;
     unmap_domain_page(tmem_va);
     if ( cli_va )
         cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 1);

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 14:44:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 14:44:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGsqV-0000q6-NM; Wed, 26 Sep 2012 14:44:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGsqU-0000pD-Ey
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:14 +0000
Received: from [85.158.139.211:45775] by server-10.bemta-5.messagelabs.com id
	80/AD-16911-DB413605; Wed, 26 Sep 2012 14:44:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-206.messagelabs.com!1348670651!19050252!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10733 invoked from network); 26 Sep 2012 14:44:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Sep 2012 14:44: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 1TGsqR-0000d1-N4
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGsqR-0005Mm-Lp
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:11 +0000
Message-Id: <E1TGsqR-0005Mm-Lp@xenbits.xen.org>
Date: Wed, 26 Sep 2012 14:44:11 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] tmem: detect arithmetic overflow
	in tmh_copy_{from, to}_client()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348568101 -7200
# Node ID 61c35eaf1a88bb68816a18f2ae25dedd60f71ae0
# Parent  5bc3e774301c435c97b2d1a40193b19b8911bdfa
tmem: detect arithmetic overflow in tmh_copy_{from,to}_client()

This implies adjusting callers to deal with errors other than -EFAULT
and removing some comments which would otherwise become stale.

Reported-by: Tim Deegan <tim@xen.org>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
xen-unstable changeset: 25855:33b8c42a87ec
xen-unstable date: Tue Sep 11 12:17:59 UTC 2012
---


diff -r 5bc3e774301c -r 61c35eaf1a88 xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:14:31 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:15:01 2012 +0200
@@ -1535,7 +1535,7 @@ copy_uncompressed:
     /* tmh_copy_from_client properly handles len==0 and offsets != 0 */
     ret = tmh_copy_from_client(pgp->pfp, cmfn, tmem_offset, pfn_offset, len,
                                tmh_cli_buf_null);
-    if ( ret == -EFAULT )
+    if ( ret < 0 )
         goto bad_copy;
     if ( tmh_dedup_enabled() && !is_persistent(pool) )
     {
@@ -1556,9 +1556,7 @@ done:
     return 1;
 
 bad_copy:
-    /* this should only happen if the client passed a bad mfn */
     failed_copies++;
-    ret = -EFAULT;
     goto cleanup;
 
 failed_dup:
@@ -1662,7 +1660,7 @@ copy_uncompressed:
     /* tmh_copy_from_client properly handles len==0 (TMEM_NEW_PAGE) */
     ret = tmh_copy_from_client(pgp->pfp, cmfn, tmem_offset, pfn_offset, len,
                                clibuf);
-    if ( ret == -EFAULT )
+    if ( ret < 0 )
         goto bad_copy;
     if ( tmh_dedup_enabled() && !is_persistent(pool) )
     {
@@ -1702,8 +1700,6 @@ insert_page:
     return 1;
 
 bad_copy:
-    /* this should only happen if the client passed a bad mfn */
-    ret = -EFAULT;
     failed_copies++;
 
 delete_and_free:
@@ -1737,7 +1733,7 @@ static NOINLINE int do_tmem_get(pool_t *
     pgp_t *pgp;
     client_t *client = pool->client;
     DECL_LOCAL_CYC_COUNTER(decompress);
-    int rc = -EFAULT;
+    int rc;
 
     if ( !_atomic_read(pool->pgp_count) )
         return -EEMPTY;
@@ -1761,20 +1757,20 @@ static NOINLINE int do_tmem_get(pool_t *
     ASSERT(pgp->size != -1);
     if ( tmh_dedup_enabled() && !is_persistent(pool) &&
               pgp->firstbyte != NOT_SHAREABLE )
+        rc = pcd_copy_to_client(cmfn, pgp);
+    else if ( pgp->size != 0 )
     {
-        rc = pcd_copy_to_client(cmfn, pgp);
-        if ( rc <= 0 )
-            goto bad_copy;
-    } else if ( pgp->size != 0 ) {
         START_CYC_COUNTER(decompress);
         rc = tmh_decompress_to_client(cmfn, pgp->cdata,
                                       pgp->size, clibuf);
-        if ( rc <= 0 )
-            goto bad_copy;
         END_CYC_COUNTER(decompress);
-    } else if ( tmh_copy_to_client(cmfn, pgp->pfp, tmem_offset,
-                                 pfn_offset, len, clibuf) == -EFAULT)
+    }
+    else
+        rc = tmh_copy_to_client(cmfn, pgp->pfp, tmem_offset,
+                                pfn_offset, len, clibuf);
+    if ( rc <= 0 )
         goto bad_copy;
+
     if ( is_ephemeral(pool) )
     {
         if ( is_private(pool) )
@@ -1811,7 +1807,6 @@ static NOINLINE int do_tmem_get(pool_t *
     return 1;
 
 bad_copy:
-    /* this should only happen if the client passed a bad mfn */
     failed_copies++;
     return rc;
 }
diff -r 5bc3e774301c -r 61c35eaf1a88 xen/common/tmem_xen.c
--- a/xen/common/tmem_xen.c	Tue Sep 25 12:14:31 2012 +0200
+++ b/xen/common/tmem_xen.c	Tue Sep 25 12:15:01 2012 +0200
@@ -153,6 +153,8 @@ EXPORT int tmh_copy_from_client(pfp_t *p
     pfp_t *cli_pfp = NULL;
     int rc = 1;
 
+    if ( tmem_offset > PAGE_SIZE || pfn_offset > PAGE_SIZE || len > PAGE_SIZE )
+        return -EINVAL;
     ASSERT(pfp != NULL);
     tmem_mfn = page_to_mfn(pfp);
     tmem_va = map_domain_page(tmem_mfn);
@@ -183,6 +185,8 @@ EXPORT int tmh_copy_from_client(pfp_t *p
                                          pfn_offset, len) )
             rc = -EFAULT;
     }
+    else if ( len )
+        rc = -EINVAL;
     if ( cli_va )
         cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 0);
     unmap_domain_page(tmem_va);
@@ -230,6 +234,8 @@ EXPORT int tmh_copy_to_client(tmem_cli_m
     pfp_t *cli_pfp = NULL;
     int rc = 1;
 
+    if ( tmem_offset > PAGE_SIZE || pfn_offset > PAGE_SIZE || len > PAGE_SIZE )
+        return -EINVAL;
     ASSERT(pfp != NULL);
     if ( guest_handle_is_null(clibuf) )
     {
@@ -249,6 +255,8 @@ EXPORT int tmh_copy_to_client(tmem_cli_m
                                        tmem_va + tmem_offset, len) )
             rc = -EFAULT;
     }
+    else if ( len )
+        rc = -EINVAL;
     unmap_domain_page(tmem_va);
     if ( cli_va )
         cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 1);

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 14:44:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 14:44:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGsqV-0000q0-Km; Wed, 26 Sep 2012 14:44:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGsqU-0000pC-DQ
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:14 +0000
Received: from [85.158.143.35:21127] by server-1.bemta-4.messagelabs.com id
	37/F8-05684-DB413605; Wed, 26 Sep 2012 14:44:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-21.messagelabs.com!1348670650!18575469!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32064 invoked from network); 26 Sep 2012 14:44: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;
	26 Sep 2012 14: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 1TGsqQ-0000cs-9x
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGsqQ-0005M0-2p
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:10 +0000
Message-Id: <E1TGsqQ-0005M0-2p@xenbits.xen.org>
Date: Wed, 26 Sep 2012 14:44:09 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] tmem: check the pool_id is valid
	when destroying a tmem pool
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1348567968 -7200
# Node ID da0fd47f59b4bb479bd550dc2abd8c04bf3e0317
# Parent  d188a7ad6c75b8b9ff4ec7335176ec87a047ca28
tmem: check the pool_id is valid when destroying a tmem pool

This is part of XSA-15 / CVE-2012-3497.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 25852:d189d99ef00c
xen-unstable date: Tue Sep 11 12:06:54 UTC 2012
---


diff -r d188a7ad6c75 -r da0fd47f59b4 xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:12:04 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:12:48 2012 +0200
@@ -1870,6 +1870,8 @@ static NOINLINE int do_tmem_destroy_pool
 
     if ( client->pools == NULL )
         return 0;
+    if ( pool_id >= MAX_POOLS_PER_DOMAIN )
+        return 0;
     if ( (pool = client->pools[pool_id]) == NULL )
         return 0;
     client->pools[pool_id] = NULL;

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 14:44:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 14:44:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGsqV-0000q0-Km; Wed, 26 Sep 2012 14:44:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGsqU-0000pC-DQ
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:14 +0000
Received: from [85.158.143.35:21127] by server-1.bemta-4.messagelabs.com id
	37/F8-05684-DB413605; Wed, 26 Sep 2012 14:44:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-21.messagelabs.com!1348670650!18575469!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32064 invoked from network); 26 Sep 2012 14:44: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;
	26 Sep 2012 14: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 1TGsqQ-0000cs-9x
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGsqQ-0005M0-2p
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:10 +0000
Message-Id: <E1TGsqQ-0005M0-2p@xenbits.xen.org>
Date: Wed, 26 Sep 2012 14:44:09 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] tmem: check the pool_id is valid
	when destroying a tmem pool
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1348567968 -7200
# Node ID da0fd47f59b4bb479bd550dc2abd8c04bf3e0317
# Parent  d188a7ad6c75b8b9ff4ec7335176ec87a047ca28
tmem: check the pool_id is valid when destroying a tmem pool

This is part of XSA-15 / CVE-2012-3497.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 25852:d189d99ef00c
xen-unstable date: Tue Sep 11 12:06:54 UTC 2012
---


diff -r d188a7ad6c75 -r da0fd47f59b4 xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:12:04 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:12:48 2012 +0200
@@ -1870,6 +1870,8 @@ static NOINLINE int do_tmem_destroy_pool
 
     if ( client->pools == NULL )
         return 0;
+    if ( pool_id >= MAX_POOLS_PER_DOMAIN )
+        return 0;
     if ( (pool = client->pools[pool_id]) == NULL )
         return 0;
     client->pools[pool_id] = NULL;

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 14:44:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 14:44:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGsqW-0000rP-WD; Wed, 26 Sep 2012 14:44: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 1TGsqV-0000po-JN
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:16 +0000
Received: from [85.158.138.51:43925] by server-5.bemta-3.messagelabs.com id
	41/08-00589-EB413605; Wed, 26 Sep 2012 14:44:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-174.messagelabs.com!1348670651!13384153!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14547 invoked from network); 26 Sep 2012 14:44:12 -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;
	26 Sep 2012 14:44: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 1TGsqR-0000cy-C8
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGsqR-0005MV-55
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:11 +0000
Message-Id: <E1TGsqR-0005MV-55@xenbits.xen.org>
Date: Wed, 26 Sep 2012 14:44:10 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] tmem: don't access guest memory
	without using the accessors intended for this
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348568071 -7200
# Node ID 5bc3e774301c435c97b2d1a40193b19b8911bdfa
# Parent  b383875a33f07ba75a6c5ceedf93e58ccb042676
tmem: don't access guest memory without using the accessors intended for this

This is not permitted, not even for buffers coming from Dom0 (and it
would also break the moment Dom0 runs in HVM mode). An implication from
the changes here is that tmh_copy_page() can't be used anymore for
control operations calling tmh_copy_{from,to}_client() (as those pass
the buffer by virtual address rather than MFN).

Note that tmemc_save_get_next_page() previously didn't set the returned
handle's pool_id field, while the new code does. It need to be
confirmed that this is not a problem (otherwise the copy-out operation
will require further tmh_...() abstractions to be added).

Further note that the patch removes (rather than adjusts) an invalid
call to unmap_domain_page() (no matching map_domain_page()) from
tmh_compress_from_client() and adds a missing one to an error return
path in tmh_copy_from_client().

Finally note that the patch adds a previously missing return statement
to cli_get_page() (without which that function could de-reference a
NULL pointer, triggerable from guest mode).

This is part of XSA-15 / CVE-2012-3497.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
xen-unstable changeset: 25854:ccd60ed6c555
xen-unstable date: Tue Sep 11 12:17:49 UTC 2012
---


diff -r b383875a33f0 -r 5bc3e774301c xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:13:40 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:14:31 2012 +0200
@@ -388,11 +388,13 @@ static NOINLINE int pcd_copy_to_client(t
     pcd = pgp->pcd;
     if ( pgp->size < PAGE_SIZE && pgp->size != 0 &&
          pcd->size < PAGE_SIZE && pcd->size != 0 )
-        ret = tmh_decompress_to_client(cmfn, pcd->cdata, pcd->size, NULL);
+        ret = tmh_decompress_to_client(cmfn, pcd->cdata, pcd->size,
+                                       tmh_cli_buf_null);
     else if ( tmh_tze_enabled() && pcd->size < PAGE_SIZE )
         ret = tmh_copy_tze_to_client(cmfn, pcd->tze, pcd->size);
     else
-        ret = tmh_copy_to_client(cmfn, pcd->pfp, 0, 0, PAGE_SIZE, NULL);
+        ret = tmh_copy_to_client(cmfn, pcd->pfp, 0, 0, PAGE_SIZE,
+                                 tmh_cli_buf_null);
     tmem_read_unlock(&pcd_tree_rwlocks[firstbyte]);
     return ret;
 }
@@ -1444,7 +1446,7 @@ static inline void tmem_ensure_avail_pag
 /************ TMEM CORE OPERATIONS ************************************/
 
 static NOINLINE int do_tmem_put_compress(pgp_t *pgp, tmem_cli_mfn_t cmfn,
-                                         void *cva)
+                                         tmem_cli_va_t clibuf)
 {
     void *dst, *p;
     size_t size;
@@ -1463,7 +1465,7 @@ static NOINLINE int do_tmem_put_compress
     if ( pgp->pfp != NULL )
         pgp_free_data(pgp, pgp->us.obj->pool);
     START_CYC_COUNTER(compress);
-    ret = tmh_compress_from_client(cmfn, &dst, &size, cva);
+    ret = tmh_compress_from_client(cmfn, &dst, &size, clibuf);
     if ( (ret == -EFAULT) || (ret == 0) )
         goto out;
     else if ( (size == 0) || (size >= tmem_subpage_maxsize()) ) {
@@ -1490,7 +1492,8 @@ out:
 }
 
 static NOINLINE int do_tmem_dup_put(pgp_t *pgp, tmem_cli_mfn_t cmfn,
-       pagesize_t tmem_offset, pagesize_t pfn_offset, pagesize_t len, void *cva)
+       pagesize_t tmem_offset, pagesize_t pfn_offset, pagesize_t len,
+       tmem_cli_va_t clibuf)
 {
     pool_t *pool;
     obj_t *obj;
@@ -1512,7 +1515,7 @@ static NOINLINE int do_tmem_dup_put(pgp_
     /* can we successfully manipulate pgp to change out the data? */
     if ( len != 0 && client->compress && pgp->size != 0 )
     {
-        ret = do_tmem_put_compress(pgp,cmfn,cva);
+        ret = do_tmem_put_compress(pgp, cmfn, clibuf);
         if ( ret == 1 )
             goto done;
         else if ( ret == 0 )
@@ -1530,7 +1533,8 @@ copy_uncompressed:
         goto failed_dup;
     pgp->size = 0;
     /* tmh_copy_from_client properly handles len==0 and offsets != 0 */
-    ret = tmh_copy_from_client(pgp->pfp,cmfn,tmem_offset,pfn_offset,len,0);
+    ret = tmh_copy_from_client(pgp->pfp, cmfn, tmem_offset, pfn_offset, len,
+                               tmh_cli_buf_null);
     if ( ret == -EFAULT )
         goto bad_copy;
     if ( tmh_dedup_enabled() && !is_persistent(pool) )
@@ -1582,7 +1586,7 @@ cleanup:
 static NOINLINE int do_tmem_put(pool_t *pool,
               OID *oidp, uint32_t index,
               tmem_cli_mfn_t cmfn, pagesize_t tmem_offset,
-              pagesize_t pfn_offset, pagesize_t len, void *cva)
+              pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_t clibuf)
 {
     obj_t *obj = NULL, *objfound = NULL, *objnew = NULL;
     pgp_t *pgp = NULL, *pgpdel = NULL;
@@ -1596,7 +1600,8 @@ static NOINLINE int do_tmem_put(pool_t *
     {
         ASSERT_SPINLOCK(&objfound->obj_spinlock);
         if ((pgp = pgp_lookup_in_obj(objfound, index)) != NULL)
-            return do_tmem_dup_put(pgp,cmfn,tmem_offset,pfn_offset,len,cva);
+            return do_tmem_dup_put(pgp, cmfn, tmem_offset, pfn_offset, len,
+                                   clibuf);
     }
 
     /* no puts allowed into a frozen pool (except dup puts) */
@@ -1631,7 +1636,7 @@ static NOINLINE int do_tmem_put(pool_t *
     if ( len != 0 && client->compress )
     {
         ASSERT(pgp->pfp == NULL);
-        ret = do_tmem_put_compress(pgp,cmfn,cva);
+        ret = do_tmem_put_compress(pgp, cmfn, clibuf);
         if ( ret == 1 )
             goto insert_page;
         if ( ret == -ENOMEM )
@@ -1655,7 +1660,8 @@ copy_uncompressed:
         goto delete_and_free;
     }
     /* tmh_copy_from_client properly handles len==0 (TMEM_NEW_PAGE) */
-    ret = tmh_copy_from_client(pgp->pfp,cmfn,tmem_offset,pfn_offset,len,cva);
+    ret = tmh_copy_from_client(pgp->pfp, cmfn, tmem_offset, pfn_offset, len,
+                               clibuf);
     if ( ret == -EFAULT )
         goto bad_copy;
     if ( tmh_dedup_enabled() && !is_persistent(pool) )
@@ -1725,12 +1731,13 @@ free:
 
 static NOINLINE int do_tmem_get(pool_t *pool, OID *oidp, uint32_t index,
               tmem_cli_mfn_t cmfn, pagesize_t tmem_offset,
-              pagesize_t pfn_offset, pagesize_t len, void *cva)
+              pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_t clibuf)
 {
     obj_t *obj;
     pgp_t *pgp;
     client_t *client = pool->client;
     DECL_LOCAL_CYC_COUNTER(decompress);
+    int rc = -EFAULT;
 
     if ( !_atomic_read(pool->pgp_count) )
         return -EEMPTY;
@@ -1755,16 +1762,18 @@ static NOINLINE int do_tmem_get(pool_t *
     if ( tmh_dedup_enabled() && !is_persistent(pool) &&
               pgp->firstbyte != NOT_SHAREABLE )
     {
-        if ( pcd_copy_to_client(cmfn, pgp) == -EFAULT )
+        rc = pcd_copy_to_client(cmfn, pgp);
+        if ( rc <= 0 )
             goto bad_copy;
     } else if ( pgp->size != 0 ) {
         START_CYC_COUNTER(decompress);
-        if ( tmh_decompress_to_client(cmfn, pgp->cdata,
-                                      pgp->size, cva) == -EFAULT )
+        rc = tmh_decompress_to_client(cmfn, pgp->cdata,
+                                      pgp->size, clibuf);
+        if ( rc <= 0 )
             goto bad_copy;
         END_CYC_COUNTER(decompress);
     } else if ( tmh_copy_to_client(cmfn, pgp->pfp, tmem_offset,
-                                 pfn_offset, len, cva) == -EFAULT)
+                                 pfn_offset, len, clibuf) == -EFAULT)
         goto bad_copy;
     if ( is_ephemeral(pool) )
     {
@@ -1804,8 +1813,7 @@ static NOINLINE int do_tmem_get(pool_t *
 bad_copy:
     /* this should only happen if the client passed a bad mfn */
     failed_copies++;
-    return -EFAULT;
-
+    return rc;
 }
 
 static NOINLINE int do_tmem_flush_page(pool_t *pool, OID *oidp, uint32_t index)
@@ -2345,7 +2353,6 @@ static NOINLINE int tmemc_save_subop(int
     pool_t *pool = (client == NULL || pool_id >= MAX_POOLS_PER_DOMAIN)
                    ? NULL : client->pools[pool_id];
     uint32_t p;
-    uint64_t *uuid;
     pgp_t *pgp, *pgp2;
     int rc = -1;
 
@@ -2409,9 +2416,7 @@ static NOINLINE int tmemc_save_subop(int
     case TMEMC_SAVE_GET_POOL_UUID:
          if ( pool == NULL )
              break;
-        uuid = (uint64_t *)buf.p;
-        *uuid++ = pool->uuid[0];
-        *uuid = pool->uuid[1];
+        tmh_copy_to_client_buf(buf, pool->uuid, 2);
         rc = 0;
     case TMEMC_SAVE_END:
         if ( client == NULL )
@@ -2436,7 +2441,7 @@ static NOINLINE int tmemc_save_get_next_
     pgp_t *pgp;
     OID oid;
     int ret = 0;
-    struct tmem_handle *h;
+    struct tmem_handle h;
     unsigned int pagesize = 1 << (pool->pageshift+12);
 
     if ( pool == NULL || is_ephemeral(pool) )
@@ -2467,11 +2472,13 @@ static NOINLINE int tmemc_save_get_next_
                          pgp_t,us.pool_pers_pages);
     pool->cur_pgp = pgp;
     oid = pgp->us.obj->oid;
-    h = (struct tmem_handle *)buf.p;
-    *(OID *)&h->oid[0] = oid;
-    h->index = pgp->index;
-    buf.p = (void *)(h+1);
-    ret = do_tmem_get(pool, &oid, h->index,0,0,0,pagesize,buf.p);
+    h.pool_id = pool_id;
+    BUILD_BUG_ON(sizeof(h.oid) != sizeof(oid));
+    memcpy(h.oid, oid.oid, sizeof(h.oid));
+    h.index = pgp->index;
+    tmh_copy_to_client_buf(buf, &h, 1);
+    tmh_client_buf_add(buf, sizeof(h));
+    ret = do_tmem_get(pool, &oid, pgp->index, 0, 0, 0, pagesize, buf);
 
 out:
     tmem_spin_unlock(&pers_lists_spinlock);
@@ -2483,7 +2490,7 @@ static NOINLINE int tmemc_save_get_next_
 {
     client_t *client = tmh_client_from_cli_id(cli_id);
     pgp_t *pgp;
-    struct tmem_handle *h;
+    struct tmem_handle h;
     int ret = 0;
 
     if ( client == NULL )
@@ -2509,10 +2516,11 @@ static NOINLINE int tmemc_save_get_next_
                          pgp_t,client_inv_pages);
         client->cur_pgp = pgp;
     }
-    h = (struct tmem_handle *)buf.p;
-    h->pool_id = pgp->pool_id;
-    *(OID *)&h->oid = pgp->inv_oid;
-    h->index = pgp->index;
+    h.pool_id = pgp->pool_id;
+    BUILD_BUG_ON(sizeof(h.oid) != sizeof(pgp->inv_oid));
+    memcpy(h.oid, pgp->inv_oid.oid, sizeof(h.oid));
+    h.index = pgp->index;
+    tmh_copy_to_client_buf(buf, &h, 1);
     ret = 1;
 out:
     tmem_spin_unlock(&pers_lists_spinlock);
@@ -2528,7 +2536,7 @@ static int tmemc_restore_put_page(int cl
 
     if ( pool == NULL )
         return -1;
-    return do_tmem_put(pool,oidp,index,0,0,0,bufsize,buf.p);
+    return do_tmem_put(pool, oidp, index, 0, 0, 0, bufsize, buf);
 }
 
 static int tmemc_restore_flush_page(int cli_id, uint32_t pool_id, OID *oidp,
@@ -2732,19 +2740,19 @@ EXPORT long do_tmem_op(tmem_cli_op_t uop
         break;
     case TMEM_NEW_PAGE:
         tmem_ensure_avail_pages();
-        rc = do_tmem_put(pool, oidp,
-                         op.u.gen.index, op.u.gen.cmfn, 0, 0, 0, NULL);
+        rc = do_tmem_put(pool, oidp, op.u.gen.index, op.u.gen.cmfn, 0, 0, 0,
+                         tmh_cli_buf_null);
         break;
     case TMEM_PUT_PAGE:
         tmem_ensure_avail_pages();
-        rc = do_tmem_put(pool, oidp,
-                    op.u.gen.index, op.u.gen.cmfn, 0, 0, PAGE_SIZE, NULL);
+        rc = do_tmem_put(pool, oidp, op.u.gen.index, op.u.gen.cmfn, 0, 0,
+                         PAGE_SIZE, tmh_cli_buf_null);
         if (rc == 1) succ_put = 1;
         else non_succ_put = 1;
         break;
     case TMEM_GET_PAGE:
         rc = do_tmem_get(pool, oidp, op.u.gen.index, op.u.gen.cmfn,
-                         0, 0, PAGE_SIZE, 0);
+                         0, 0, PAGE_SIZE, tmh_cli_buf_null);
         if (rc == 1) succ_get = 1;
         else non_succ_get = 1;
         break;
@@ -2763,13 +2771,13 @@ EXPORT long do_tmem_op(tmem_cli_op_t uop
     case TMEM_READ:
         rc = do_tmem_get(pool, oidp, op.u.gen.index, op.u.gen.cmfn,
                          op.u.gen.tmem_offset, op.u.gen.pfn_offset,
-                         op.u.gen.len,0);
+                         op.u.gen.len, tmh_cli_buf_null);
         break;
     case TMEM_WRITE:
         rc = do_tmem_put(pool, oidp,
                          op.u.gen.index, op.u.gen.cmfn,
                          op.u.gen.tmem_offset, op.u.gen.pfn_offset,
-                         op.u.gen.len, NULL);
+                         op.u.gen.len, tmh_cli_buf_null);
         break;
     case TMEM_XCHG:
         /* need to hold global lock to ensure xchg is atomic */
diff -r b383875a33f0 -r 5bc3e774301c xen/common/tmem_xen.c
--- a/xen/common/tmem_xen.c	Tue Sep 25 12:13:40 2012 +0200
+++ b/xen/common/tmem_xen.c	Tue Sep 25 12:14:31 2012 +0200
@@ -51,6 +51,7 @@ DECL_CYC_COUNTER(pg_copy);
 #define LZO_DSTMEM_PAGES 2
 static DEFINE_PER_CPU_READ_MOSTLY(unsigned char *, workmem);
 static DEFINE_PER_CPU_READ_MOSTLY(unsigned char *, dstmem);
+static DEFINE_PER_CPU_READ_MOSTLY(void *, scratch_page);
 
 #ifdef COMPARE_COPY_PAGE_SSE2
 #include <asm/flushtlb.h>  /* REMOVE ME AFTER TEST */
@@ -115,6 +116,7 @@ static inline void *cli_get_page(tmem_cl
     {
         if ( page )
             put_page(page);
+        return NULL;
     }
 
     if ( cli_write && !get_page_type(page, PGT_writable_page) )
@@ -144,12 +146,12 @@ static inline void cli_put_page(tmem_cli
 
 EXPORT int tmh_copy_from_client(pfp_t *pfp,
     tmem_cli_mfn_t cmfn, pagesize_t tmem_offset,
-    pagesize_t pfn_offset, pagesize_t len, void *cli_va)
+    pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_t clibuf)
 {
     unsigned long tmem_mfn, cli_mfn = 0;
-    void *tmem_va;
+    char *tmem_va, *cli_va = NULL;
     pfp_t *cli_pfp = NULL;
-    bool_t tmemc = cli_va != NULL; /* if true, cli_va is control-op buffer */
+    int rc = 1;
 
     ASSERT(pfp != NULL);
     tmem_mfn = page_to_mfn(pfp);
@@ -160,62 +162,76 @@ EXPORT int tmh_copy_from_client(pfp_t *p
         unmap_domain_page(tmem_va);
         return 1;
     }
-    if ( !tmemc )
+    if ( guest_handle_is_null(clibuf) )
+    {
+        cli_va = cli_get_page(cmfn, &cli_mfn, &cli_pfp, 0);
+        if ( cli_va == NULL )
+        {
+            unmap_domain_page(tmem_va);
+            return -EFAULT;
+        }
+    }
+    mb();
+    if ( len == PAGE_SIZE && !tmem_offset && !pfn_offset && cli_va )
+        tmh_copy_page(tmem_va, cli_va);
+    else if ( (tmem_offset+len <= PAGE_SIZE) &&
+              (pfn_offset+len <= PAGE_SIZE) )
+    {
+        if ( cli_va )
+            memcpy(tmem_va + tmem_offset, cli_va + pfn_offset, len);
+        else if ( copy_from_guest_offset(tmem_va + tmem_offset, clibuf,
+                                         pfn_offset, len) )
+            rc = -EFAULT;
+    }
+    if ( cli_va )
+        cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 0);
+    unmap_domain_page(tmem_va);
+    return rc;
+}
+
+EXPORT int tmh_compress_from_client(tmem_cli_mfn_t cmfn,
+    void **out_va, size_t *out_len, tmem_cli_va_t clibuf)
+{
+    int ret = 0;
+    unsigned char *dmem = this_cpu(dstmem);
+    unsigned char *wmem = this_cpu(workmem);
+    char *scratch = this_cpu(scratch_page);
+    pfp_t *cli_pfp = NULL;
+    unsigned long cli_mfn = 0;
+    void *cli_va = NULL;
+
+    if ( dmem == NULL || wmem == NULL )
+        return 0;  /* no buffer, so can't compress */
+    if ( guest_handle_is_null(clibuf) )
     {
         cli_va = cli_get_page(cmfn, &cli_mfn, &cli_pfp, 0);
         if ( cli_va == NULL )
             return -EFAULT;
     }
+    else if ( !scratch )
+        return 0;
+    else if ( copy_from_guest(scratch, clibuf, PAGE_SIZE) )
+        return -EFAULT;
     mb();
-    if (len == PAGE_SIZE && !tmem_offset && !pfn_offset)
-        tmh_copy_page(tmem_va, cli_va);
-    else if ( (tmem_offset+len <= PAGE_SIZE) &&
-              (pfn_offset+len <= PAGE_SIZE) )
-        memcpy((char *)tmem_va+tmem_offset,(char *)cli_va+pfn_offset,len);
-    if ( !tmemc )
-        cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 0);
-    unmap_domain_page(tmem_va);
-    return 1;
-}
-
-EXPORT int tmh_compress_from_client(tmem_cli_mfn_t cmfn,
-    void **out_va, size_t *out_len, void *cli_va)
-{
-    int ret = 0;
-    unsigned char *dmem = this_cpu(dstmem);
-    unsigned char *wmem = this_cpu(workmem);
-    pfp_t *cli_pfp = NULL;
-    unsigned long cli_mfn = 0;
-    bool_t tmemc = cli_va != NULL; /* if true, cli_va is control-op buffer */
-
-    if ( dmem == NULL || wmem == NULL )
-        return 0;  /* no buffer, so can't compress */
-    if ( !tmemc )
-    {
-        cli_va = cli_get_page(cmfn, &cli_mfn, &cli_pfp, 0);
-        if ( cli_va == NULL )
-            return -EFAULT;
-    }
-    mb();
-    ret = lzo1x_1_compress(cli_va, PAGE_SIZE, dmem, out_len, wmem);
+    ret = lzo1x_1_compress(cli_va ?: scratch, PAGE_SIZE, dmem, out_len, wmem);
     ASSERT(ret == LZO_E_OK);
     *out_va = dmem;
-    if ( !tmemc )
+    if ( cli_va )
         cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 0);
-    unmap_domain_page(cli_va);
     return 1;
 }
 
 EXPORT int tmh_copy_to_client(tmem_cli_mfn_t cmfn, pfp_t *pfp,
-    pagesize_t tmem_offset, pagesize_t pfn_offset, pagesize_t len, void *cli_va)
+    pagesize_t tmem_offset, pagesize_t pfn_offset, pagesize_t len,
+    tmem_cli_va_t clibuf)
 {
     unsigned long tmem_mfn, cli_mfn = 0;
-    void *tmem_va;
+    char *tmem_va, *cli_va = NULL;
     pfp_t *cli_pfp = NULL;
-    bool_t tmemc = cli_va != NULL; /* if true, cli_va is control-op buffer */
+    int rc = 1;
 
     ASSERT(pfp != NULL);
-    if ( !tmemc )
+    if ( guest_handle_is_null(clibuf) )
     {
         cli_va = cli_get_page(cmfn, &cli_mfn, &cli_pfp, 1);
         if ( cli_va == NULL )
@@ -223,37 +239,48 @@ EXPORT int tmh_copy_to_client(tmem_cli_m
     }
     tmem_mfn = page_to_mfn(pfp);
     tmem_va = map_domain_page(tmem_mfn);
-    if (len == PAGE_SIZE && !tmem_offset && !pfn_offset)
+    if ( len == PAGE_SIZE && !tmem_offset && !pfn_offset && cli_va )
         tmh_copy_page(cli_va, tmem_va);
     else if ( (tmem_offset+len <= PAGE_SIZE) && (pfn_offset+len <= PAGE_SIZE) )
-        memcpy((char *)cli_va+pfn_offset,(char *)tmem_va+tmem_offset,len);
+    {
+        if ( cli_va )
+            memcpy(cli_va + pfn_offset, tmem_va + tmem_offset, len);
+        else if ( copy_to_guest_offset(clibuf, pfn_offset,
+                                       tmem_va + tmem_offset, len) )
+            rc = -EFAULT;
+    }
     unmap_domain_page(tmem_va);
-    if ( !tmemc )
+    if ( cli_va )
         cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 1);
     mb();
-    return 1;
+    return rc;
 }
 
 EXPORT int tmh_decompress_to_client(tmem_cli_mfn_t cmfn, void *tmem_va,
-                                    size_t size, void *cli_va)
+                                    size_t size, tmem_cli_va_t clibuf)
 {
     unsigned long cli_mfn = 0;
     pfp_t *cli_pfp = NULL;
+    void *cli_va = NULL;
+    char *scratch = this_cpu(scratch_page);
     size_t out_len = PAGE_SIZE;
-    bool_t tmemc = cli_va != NULL; /* if true, cli_va is control-op buffer */
     int ret;
 
-    if ( !tmemc )
+    if ( guest_handle_is_null(clibuf) )
     {
         cli_va = cli_get_page(cmfn, &cli_mfn, &cli_pfp, 1);
         if ( cli_va == NULL )
             return -EFAULT;
     }
-    ret = lzo1x_decompress_safe(tmem_va, size, cli_va, &out_len);
+    else if ( !scratch )
+        return 0;
+    ret = lzo1x_decompress_safe(tmem_va, size, cli_va ?: scratch, &out_len);
     ASSERT(ret == LZO_E_OK);
     ASSERT(out_len == PAGE_SIZE);
-    if ( !tmemc )
+    if ( cli_va )
         cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 1);
+    else if ( copy_to_guest(clibuf, scratch, PAGE_SIZE) )
+        return -EFAULT;
     mb();
     return 1;
 }
@@ -423,6 +450,11 @@ static int cpu_callback(
             struct page_info *p = alloc_domheap_pages(0, workmem_order, 0);
             per_cpu(workmem, cpu) = p ? page_to_virt(p) : NULL;
         }
+        if ( per_cpu(scratch_page, cpu) == NULL )
+        {
+            struct page_info *p = alloc_domheap_page(NULL, 0);
+            per_cpu(scratch_page, cpu) = p ? page_to_virt(p) : NULL;
+        }
         break;
     }
     case CPU_DEAD:
@@ -439,6 +471,11 @@ static int cpu_callback(
             free_domheap_pages(p, workmem_order);
             per_cpu(workmem, cpu) = NULL;
         }
+        if ( per_cpu(scratch_page, cpu) != NULL )
+        {
+            free_domheap_page(virt_to_page(per_cpu(scratch_page, cpu)));
+            per_cpu(scratch_page, cpu) = NULL;
+        }
         break;
     }
     default:
diff -r b383875a33f0 -r 5bc3e774301c xen/include/xen/tmem_xen.h
--- a/xen/include/xen/tmem_xen.h	Tue Sep 25 12:13:40 2012 +0200
+++ b/xen/include/xen/tmem_xen.h	Tue Sep 25 12:14:31 2012 +0200
@@ -482,27 +482,33 @@ static inline int tmh_get_tmemop_from_cl
     return copy_from_guest(op, uops, 1);
 }
 
+#define tmh_cli_buf_null guest_handle_from_ptr(NULL, char)
+
 static inline void tmh_copy_to_client_buf_offset(tmem_cli_va_t clibuf, int off,
                                            char *tmembuf, int len)
 {
     copy_to_guest_offset(clibuf,off,tmembuf,len);
 }
 
+#define tmh_copy_to_client_buf(clibuf, tmembuf, cnt) \
+    copy_to_guest(guest_handle_cast(clibuf, void), tmembuf, cnt)
+
+#define tmh_client_buf_add guest_handle_add_offset
+
 #define TMH_CLI_ID_NULL ((cli_id_t)((domid_t)-1L))
 
 #define tmh_cli_id_str "domid"
 #define tmh_client_str "domain"
 
-extern int tmh_decompress_to_client(tmem_cli_mfn_t,void*,size_t,void*);
+int tmh_decompress_to_client(tmem_cli_mfn_t, void *, size_t, tmem_cli_va_t);
 
-extern int tmh_compress_from_client(tmem_cli_mfn_t,void**,size_t *,void*);
+int tmh_compress_from_client(tmem_cli_mfn_t, void **, size_t *, tmem_cli_va_t);
 
-extern int tmh_copy_from_client(pfp_t *pfp,
-    tmem_cli_mfn_t cmfn, pagesize_t tmem_offset,
-    pagesize_t pfn_offset, pagesize_t len, void *cva);
+int tmh_copy_from_client(pfp_t *, tmem_cli_mfn_t, pagesize_t tmem_offset,
+    pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_t);
 
-extern int tmh_copy_to_client(tmem_cli_mfn_t cmfn, pfp_t *pfp,
-    pagesize_t tmem_offset, pagesize_t pfn_offset, pagesize_t len, void *cva);
+int tmh_copy_to_client(tmem_cli_mfn_t, pfp_t *, pagesize_t tmem_offset,
+    pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_t);
 
 extern int tmh_copy_tze_to_client(tmem_cli_mfn_t cmfn, void *tmem_va, pagesize_t len);
 

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 14:44:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 14:44:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGsqW-0000rP-WD; Wed, 26 Sep 2012 14:44: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 1TGsqV-0000po-JN
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:16 +0000
Received: from [85.158.138.51:43925] by server-5.bemta-3.messagelabs.com id
	41/08-00589-EB413605; Wed, 26 Sep 2012 14:44:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-174.messagelabs.com!1348670651!13384153!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14547 invoked from network); 26 Sep 2012 14:44:12 -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;
	26 Sep 2012 14:44: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 1TGsqR-0000cy-C8
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGsqR-0005MV-55
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:11 +0000
Message-Id: <E1TGsqR-0005MV-55@xenbits.xen.org>
Date: Wed, 26 Sep 2012 14:44:10 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] tmem: don't access guest memory
	without using the accessors intended for this
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348568071 -7200
# Node ID 5bc3e774301c435c97b2d1a40193b19b8911bdfa
# Parent  b383875a33f07ba75a6c5ceedf93e58ccb042676
tmem: don't access guest memory without using the accessors intended for this

This is not permitted, not even for buffers coming from Dom0 (and it
would also break the moment Dom0 runs in HVM mode). An implication from
the changes here is that tmh_copy_page() can't be used anymore for
control operations calling tmh_copy_{from,to}_client() (as those pass
the buffer by virtual address rather than MFN).

Note that tmemc_save_get_next_page() previously didn't set the returned
handle's pool_id field, while the new code does. It need to be
confirmed that this is not a problem (otherwise the copy-out operation
will require further tmh_...() abstractions to be added).

Further note that the patch removes (rather than adjusts) an invalid
call to unmap_domain_page() (no matching map_domain_page()) from
tmh_compress_from_client() and adds a missing one to an error return
path in tmh_copy_from_client().

Finally note that the patch adds a previously missing return statement
to cli_get_page() (without which that function could de-reference a
NULL pointer, triggerable from guest mode).

This is part of XSA-15 / CVE-2012-3497.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
xen-unstable changeset: 25854:ccd60ed6c555
xen-unstable date: Tue Sep 11 12:17:49 UTC 2012
---


diff -r b383875a33f0 -r 5bc3e774301c xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:13:40 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:14:31 2012 +0200
@@ -388,11 +388,13 @@ static NOINLINE int pcd_copy_to_client(t
     pcd = pgp->pcd;
     if ( pgp->size < PAGE_SIZE && pgp->size != 0 &&
          pcd->size < PAGE_SIZE && pcd->size != 0 )
-        ret = tmh_decompress_to_client(cmfn, pcd->cdata, pcd->size, NULL);
+        ret = tmh_decompress_to_client(cmfn, pcd->cdata, pcd->size,
+                                       tmh_cli_buf_null);
     else if ( tmh_tze_enabled() && pcd->size < PAGE_SIZE )
         ret = tmh_copy_tze_to_client(cmfn, pcd->tze, pcd->size);
     else
-        ret = tmh_copy_to_client(cmfn, pcd->pfp, 0, 0, PAGE_SIZE, NULL);
+        ret = tmh_copy_to_client(cmfn, pcd->pfp, 0, 0, PAGE_SIZE,
+                                 tmh_cli_buf_null);
     tmem_read_unlock(&pcd_tree_rwlocks[firstbyte]);
     return ret;
 }
@@ -1444,7 +1446,7 @@ static inline void tmem_ensure_avail_pag
 /************ TMEM CORE OPERATIONS ************************************/
 
 static NOINLINE int do_tmem_put_compress(pgp_t *pgp, tmem_cli_mfn_t cmfn,
-                                         void *cva)
+                                         tmem_cli_va_t clibuf)
 {
     void *dst, *p;
     size_t size;
@@ -1463,7 +1465,7 @@ static NOINLINE int do_tmem_put_compress
     if ( pgp->pfp != NULL )
         pgp_free_data(pgp, pgp->us.obj->pool);
     START_CYC_COUNTER(compress);
-    ret = tmh_compress_from_client(cmfn, &dst, &size, cva);
+    ret = tmh_compress_from_client(cmfn, &dst, &size, clibuf);
     if ( (ret == -EFAULT) || (ret == 0) )
         goto out;
     else if ( (size == 0) || (size >= tmem_subpage_maxsize()) ) {
@@ -1490,7 +1492,8 @@ out:
 }
 
 static NOINLINE int do_tmem_dup_put(pgp_t *pgp, tmem_cli_mfn_t cmfn,
-       pagesize_t tmem_offset, pagesize_t pfn_offset, pagesize_t len, void *cva)
+       pagesize_t tmem_offset, pagesize_t pfn_offset, pagesize_t len,
+       tmem_cli_va_t clibuf)
 {
     pool_t *pool;
     obj_t *obj;
@@ -1512,7 +1515,7 @@ static NOINLINE int do_tmem_dup_put(pgp_
     /* can we successfully manipulate pgp to change out the data? */
     if ( len != 0 && client->compress && pgp->size != 0 )
     {
-        ret = do_tmem_put_compress(pgp,cmfn,cva);
+        ret = do_tmem_put_compress(pgp, cmfn, clibuf);
         if ( ret == 1 )
             goto done;
         else if ( ret == 0 )
@@ -1530,7 +1533,8 @@ copy_uncompressed:
         goto failed_dup;
     pgp->size = 0;
     /* tmh_copy_from_client properly handles len==0 and offsets != 0 */
-    ret = tmh_copy_from_client(pgp->pfp,cmfn,tmem_offset,pfn_offset,len,0);
+    ret = tmh_copy_from_client(pgp->pfp, cmfn, tmem_offset, pfn_offset, len,
+                               tmh_cli_buf_null);
     if ( ret == -EFAULT )
         goto bad_copy;
     if ( tmh_dedup_enabled() && !is_persistent(pool) )
@@ -1582,7 +1586,7 @@ cleanup:
 static NOINLINE int do_tmem_put(pool_t *pool,
               OID *oidp, uint32_t index,
               tmem_cli_mfn_t cmfn, pagesize_t tmem_offset,
-              pagesize_t pfn_offset, pagesize_t len, void *cva)
+              pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_t clibuf)
 {
     obj_t *obj = NULL, *objfound = NULL, *objnew = NULL;
     pgp_t *pgp = NULL, *pgpdel = NULL;
@@ -1596,7 +1600,8 @@ static NOINLINE int do_tmem_put(pool_t *
     {
         ASSERT_SPINLOCK(&objfound->obj_spinlock);
         if ((pgp = pgp_lookup_in_obj(objfound, index)) != NULL)
-            return do_tmem_dup_put(pgp,cmfn,tmem_offset,pfn_offset,len,cva);
+            return do_tmem_dup_put(pgp, cmfn, tmem_offset, pfn_offset, len,
+                                   clibuf);
     }
 
     /* no puts allowed into a frozen pool (except dup puts) */
@@ -1631,7 +1636,7 @@ static NOINLINE int do_tmem_put(pool_t *
     if ( len != 0 && client->compress )
     {
         ASSERT(pgp->pfp == NULL);
-        ret = do_tmem_put_compress(pgp,cmfn,cva);
+        ret = do_tmem_put_compress(pgp, cmfn, clibuf);
         if ( ret == 1 )
             goto insert_page;
         if ( ret == -ENOMEM )
@@ -1655,7 +1660,8 @@ copy_uncompressed:
         goto delete_and_free;
     }
     /* tmh_copy_from_client properly handles len==0 (TMEM_NEW_PAGE) */
-    ret = tmh_copy_from_client(pgp->pfp,cmfn,tmem_offset,pfn_offset,len,cva);
+    ret = tmh_copy_from_client(pgp->pfp, cmfn, tmem_offset, pfn_offset, len,
+                               clibuf);
     if ( ret == -EFAULT )
         goto bad_copy;
     if ( tmh_dedup_enabled() && !is_persistent(pool) )
@@ -1725,12 +1731,13 @@ free:
 
 static NOINLINE int do_tmem_get(pool_t *pool, OID *oidp, uint32_t index,
               tmem_cli_mfn_t cmfn, pagesize_t tmem_offset,
-              pagesize_t pfn_offset, pagesize_t len, void *cva)
+              pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_t clibuf)
 {
     obj_t *obj;
     pgp_t *pgp;
     client_t *client = pool->client;
     DECL_LOCAL_CYC_COUNTER(decompress);
+    int rc = -EFAULT;
 
     if ( !_atomic_read(pool->pgp_count) )
         return -EEMPTY;
@@ -1755,16 +1762,18 @@ static NOINLINE int do_tmem_get(pool_t *
     if ( tmh_dedup_enabled() && !is_persistent(pool) &&
               pgp->firstbyte != NOT_SHAREABLE )
     {
-        if ( pcd_copy_to_client(cmfn, pgp) == -EFAULT )
+        rc = pcd_copy_to_client(cmfn, pgp);
+        if ( rc <= 0 )
             goto bad_copy;
     } else if ( pgp->size != 0 ) {
         START_CYC_COUNTER(decompress);
-        if ( tmh_decompress_to_client(cmfn, pgp->cdata,
-                                      pgp->size, cva) == -EFAULT )
+        rc = tmh_decompress_to_client(cmfn, pgp->cdata,
+                                      pgp->size, clibuf);
+        if ( rc <= 0 )
             goto bad_copy;
         END_CYC_COUNTER(decompress);
     } else if ( tmh_copy_to_client(cmfn, pgp->pfp, tmem_offset,
-                                 pfn_offset, len, cva) == -EFAULT)
+                                 pfn_offset, len, clibuf) == -EFAULT)
         goto bad_copy;
     if ( is_ephemeral(pool) )
     {
@@ -1804,8 +1813,7 @@ static NOINLINE int do_tmem_get(pool_t *
 bad_copy:
     /* this should only happen if the client passed a bad mfn */
     failed_copies++;
-    return -EFAULT;
-
+    return rc;
 }
 
 static NOINLINE int do_tmem_flush_page(pool_t *pool, OID *oidp, uint32_t index)
@@ -2345,7 +2353,6 @@ static NOINLINE int tmemc_save_subop(int
     pool_t *pool = (client == NULL || pool_id >= MAX_POOLS_PER_DOMAIN)
                    ? NULL : client->pools[pool_id];
     uint32_t p;
-    uint64_t *uuid;
     pgp_t *pgp, *pgp2;
     int rc = -1;
 
@@ -2409,9 +2416,7 @@ static NOINLINE int tmemc_save_subop(int
     case TMEMC_SAVE_GET_POOL_UUID:
          if ( pool == NULL )
              break;
-        uuid = (uint64_t *)buf.p;
-        *uuid++ = pool->uuid[0];
-        *uuid = pool->uuid[1];
+        tmh_copy_to_client_buf(buf, pool->uuid, 2);
         rc = 0;
     case TMEMC_SAVE_END:
         if ( client == NULL )
@@ -2436,7 +2441,7 @@ static NOINLINE int tmemc_save_get_next_
     pgp_t *pgp;
     OID oid;
     int ret = 0;
-    struct tmem_handle *h;
+    struct tmem_handle h;
     unsigned int pagesize = 1 << (pool->pageshift+12);
 
     if ( pool == NULL || is_ephemeral(pool) )
@@ -2467,11 +2472,13 @@ static NOINLINE int tmemc_save_get_next_
                          pgp_t,us.pool_pers_pages);
     pool->cur_pgp = pgp;
     oid = pgp->us.obj->oid;
-    h = (struct tmem_handle *)buf.p;
-    *(OID *)&h->oid[0] = oid;
-    h->index = pgp->index;
-    buf.p = (void *)(h+1);
-    ret = do_tmem_get(pool, &oid, h->index,0,0,0,pagesize,buf.p);
+    h.pool_id = pool_id;
+    BUILD_BUG_ON(sizeof(h.oid) != sizeof(oid));
+    memcpy(h.oid, oid.oid, sizeof(h.oid));
+    h.index = pgp->index;
+    tmh_copy_to_client_buf(buf, &h, 1);
+    tmh_client_buf_add(buf, sizeof(h));
+    ret = do_tmem_get(pool, &oid, pgp->index, 0, 0, 0, pagesize, buf);
 
 out:
     tmem_spin_unlock(&pers_lists_spinlock);
@@ -2483,7 +2490,7 @@ static NOINLINE int tmemc_save_get_next_
 {
     client_t *client = tmh_client_from_cli_id(cli_id);
     pgp_t *pgp;
-    struct tmem_handle *h;
+    struct tmem_handle h;
     int ret = 0;
 
     if ( client == NULL )
@@ -2509,10 +2516,11 @@ static NOINLINE int tmemc_save_get_next_
                          pgp_t,client_inv_pages);
         client->cur_pgp = pgp;
     }
-    h = (struct tmem_handle *)buf.p;
-    h->pool_id = pgp->pool_id;
-    *(OID *)&h->oid = pgp->inv_oid;
-    h->index = pgp->index;
+    h.pool_id = pgp->pool_id;
+    BUILD_BUG_ON(sizeof(h.oid) != sizeof(pgp->inv_oid));
+    memcpy(h.oid, pgp->inv_oid.oid, sizeof(h.oid));
+    h.index = pgp->index;
+    tmh_copy_to_client_buf(buf, &h, 1);
     ret = 1;
 out:
     tmem_spin_unlock(&pers_lists_spinlock);
@@ -2528,7 +2536,7 @@ static int tmemc_restore_put_page(int cl
 
     if ( pool == NULL )
         return -1;
-    return do_tmem_put(pool,oidp,index,0,0,0,bufsize,buf.p);
+    return do_tmem_put(pool, oidp, index, 0, 0, 0, bufsize, buf);
 }
 
 static int tmemc_restore_flush_page(int cli_id, uint32_t pool_id, OID *oidp,
@@ -2732,19 +2740,19 @@ EXPORT long do_tmem_op(tmem_cli_op_t uop
         break;
     case TMEM_NEW_PAGE:
         tmem_ensure_avail_pages();
-        rc = do_tmem_put(pool, oidp,
-                         op.u.gen.index, op.u.gen.cmfn, 0, 0, 0, NULL);
+        rc = do_tmem_put(pool, oidp, op.u.gen.index, op.u.gen.cmfn, 0, 0, 0,
+                         tmh_cli_buf_null);
         break;
     case TMEM_PUT_PAGE:
         tmem_ensure_avail_pages();
-        rc = do_tmem_put(pool, oidp,
-                    op.u.gen.index, op.u.gen.cmfn, 0, 0, PAGE_SIZE, NULL);
+        rc = do_tmem_put(pool, oidp, op.u.gen.index, op.u.gen.cmfn, 0, 0,
+                         PAGE_SIZE, tmh_cli_buf_null);
         if (rc == 1) succ_put = 1;
         else non_succ_put = 1;
         break;
     case TMEM_GET_PAGE:
         rc = do_tmem_get(pool, oidp, op.u.gen.index, op.u.gen.cmfn,
-                         0, 0, PAGE_SIZE, 0);
+                         0, 0, PAGE_SIZE, tmh_cli_buf_null);
         if (rc == 1) succ_get = 1;
         else non_succ_get = 1;
         break;
@@ -2763,13 +2771,13 @@ EXPORT long do_tmem_op(tmem_cli_op_t uop
     case TMEM_READ:
         rc = do_tmem_get(pool, oidp, op.u.gen.index, op.u.gen.cmfn,
                          op.u.gen.tmem_offset, op.u.gen.pfn_offset,
-                         op.u.gen.len,0);
+                         op.u.gen.len, tmh_cli_buf_null);
         break;
     case TMEM_WRITE:
         rc = do_tmem_put(pool, oidp,
                          op.u.gen.index, op.u.gen.cmfn,
                          op.u.gen.tmem_offset, op.u.gen.pfn_offset,
-                         op.u.gen.len, NULL);
+                         op.u.gen.len, tmh_cli_buf_null);
         break;
     case TMEM_XCHG:
         /* need to hold global lock to ensure xchg is atomic */
diff -r b383875a33f0 -r 5bc3e774301c xen/common/tmem_xen.c
--- a/xen/common/tmem_xen.c	Tue Sep 25 12:13:40 2012 +0200
+++ b/xen/common/tmem_xen.c	Tue Sep 25 12:14:31 2012 +0200
@@ -51,6 +51,7 @@ DECL_CYC_COUNTER(pg_copy);
 #define LZO_DSTMEM_PAGES 2
 static DEFINE_PER_CPU_READ_MOSTLY(unsigned char *, workmem);
 static DEFINE_PER_CPU_READ_MOSTLY(unsigned char *, dstmem);
+static DEFINE_PER_CPU_READ_MOSTLY(void *, scratch_page);
 
 #ifdef COMPARE_COPY_PAGE_SSE2
 #include <asm/flushtlb.h>  /* REMOVE ME AFTER TEST */
@@ -115,6 +116,7 @@ static inline void *cli_get_page(tmem_cl
     {
         if ( page )
             put_page(page);
+        return NULL;
     }
 
     if ( cli_write && !get_page_type(page, PGT_writable_page) )
@@ -144,12 +146,12 @@ static inline void cli_put_page(tmem_cli
 
 EXPORT int tmh_copy_from_client(pfp_t *pfp,
     tmem_cli_mfn_t cmfn, pagesize_t tmem_offset,
-    pagesize_t pfn_offset, pagesize_t len, void *cli_va)
+    pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_t clibuf)
 {
     unsigned long tmem_mfn, cli_mfn = 0;
-    void *tmem_va;
+    char *tmem_va, *cli_va = NULL;
     pfp_t *cli_pfp = NULL;
-    bool_t tmemc = cli_va != NULL; /* if true, cli_va is control-op buffer */
+    int rc = 1;
 
     ASSERT(pfp != NULL);
     tmem_mfn = page_to_mfn(pfp);
@@ -160,62 +162,76 @@ EXPORT int tmh_copy_from_client(pfp_t *p
         unmap_domain_page(tmem_va);
         return 1;
     }
-    if ( !tmemc )
+    if ( guest_handle_is_null(clibuf) )
+    {
+        cli_va = cli_get_page(cmfn, &cli_mfn, &cli_pfp, 0);
+        if ( cli_va == NULL )
+        {
+            unmap_domain_page(tmem_va);
+            return -EFAULT;
+        }
+    }
+    mb();
+    if ( len == PAGE_SIZE && !tmem_offset && !pfn_offset && cli_va )
+        tmh_copy_page(tmem_va, cli_va);
+    else if ( (tmem_offset+len <= PAGE_SIZE) &&
+              (pfn_offset+len <= PAGE_SIZE) )
+    {
+        if ( cli_va )
+            memcpy(tmem_va + tmem_offset, cli_va + pfn_offset, len);
+        else if ( copy_from_guest_offset(tmem_va + tmem_offset, clibuf,
+                                         pfn_offset, len) )
+            rc = -EFAULT;
+    }
+    if ( cli_va )
+        cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 0);
+    unmap_domain_page(tmem_va);
+    return rc;
+}
+
+EXPORT int tmh_compress_from_client(tmem_cli_mfn_t cmfn,
+    void **out_va, size_t *out_len, tmem_cli_va_t clibuf)
+{
+    int ret = 0;
+    unsigned char *dmem = this_cpu(dstmem);
+    unsigned char *wmem = this_cpu(workmem);
+    char *scratch = this_cpu(scratch_page);
+    pfp_t *cli_pfp = NULL;
+    unsigned long cli_mfn = 0;
+    void *cli_va = NULL;
+
+    if ( dmem == NULL || wmem == NULL )
+        return 0;  /* no buffer, so can't compress */
+    if ( guest_handle_is_null(clibuf) )
     {
         cli_va = cli_get_page(cmfn, &cli_mfn, &cli_pfp, 0);
         if ( cli_va == NULL )
             return -EFAULT;
     }
+    else if ( !scratch )
+        return 0;
+    else if ( copy_from_guest(scratch, clibuf, PAGE_SIZE) )
+        return -EFAULT;
     mb();
-    if (len == PAGE_SIZE && !tmem_offset && !pfn_offset)
-        tmh_copy_page(tmem_va, cli_va);
-    else if ( (tmem_offset+len <= PAGE_SIZE) &&
-              (pfn_offset+len <= PAGE_SIZE) )
-        memcpy((char *)tmem_va+tmem_offset,(char *)cli_va+pfn_offset,len);
-    if ( !tmemc )
-        cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 0);
-    unmap_domain_page(tmem_va);
-    return 1;
-}
-
-EXPORT int tmh_compress_from_client(tmem_cli_mfn_t cmfn,
-    void **out_va, size_t *out_len, void *cli_va)
-{
-    int ret = 0;
-    unsigned char *dmem = this_cpu(dstmem);
-    unsigned char *wmem = this_cpu(workmem);
-    pfp_t *cli_pfp = NULL;
-    unsigned long cli_mfn = 0;
-    bool_t tmemc = cli_va != NULL; /* if true, cli_va is control-op buffer */
-
-    if ( dmem == NULL || wmem == NULL )
-        return 0;  /* no buffer, so can't compress */
-    if ( !tmemc )
-    {
-        cli_va = cli_get_page(cmfn, &cli_mfn, &cli_pfp, 0);
-        if ( cli_va == NULL )
-            return -EFAULT;
-    }
-    mb();
-    ret = lzo1x_1_compress(cli_va, PAGE_SIZE, dmem, out_len, wmem);
+    ret = lzo1x_1_compress(cli_va ?: scratch, PAGE_SIZE, dmem, out_len, wmem);
     ASSERT(ret == LZO_E_OK);
     *out_va = dmem;
-    if ( !tmemc )
+    if ( cli_va )
         cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 0);
-    unmap_domain_page(cli_va);
     return 1;
 }
 
 EXPORT int tmh_copy_to_client(tmem_cli_mfn_t cmfn, pfp_t *pfp,
-    pagesize_t tmem_offset, pagesize_t pfn_offset, pagesize_t len, void *cli_va)
+    pagesize_t tmem_offset, pagesize_t pfn_offset, pagesize_t len,
+    tmem_cli_va_t clibuf)
 {
     unsigned long tmem_mfn, cli_mfn = 0;
-    void *tmem_va;
+    char *tmem_va, *cli_va = NULL;
     pfp_t *cli_pfp = NULL;
-    bool_t tmemc = cli_va != NULL; /* if true, cli_va is control-op buffer */
+    int rc = 1;
 
     ASSERT(pfp != NULL);
-    if ( !tmemc )
+    if ( guest_handle_is_null(clibuf) )
     {
         cli_va = cli_get_page(cmfn, &cli_mfn, &cli_pfp, 1);
         if ( cli_va == NULL )
@@ -223,37 +239,48 @@ EXPORT int tmh_copy_to_client(tmem_cli_m
     }
     tmem_mfn = page_to_mfn(pfp);
     tmem_va = map_domain_page(tmem_mfn);
-    if (len == PAGE_SIZE && !tmem_offset && !pfn_offset)
+    if ( len == PAGE_SIZE && !tmem_offset && !pfn_offset && cli_va )
         tmh_copy_page(cli_va, tmem_va);
     else if ( (tmem_offset+len <= PAGE_SIZE) && (pfn_offset+len <= PAGE_SIZE) )
-        memcpy((char *)cli_va+pfn_offset,(char *)tmem_va+tmem_offset,len);
+    {
+        if ( cli_va )
+            memcpy(cli_va + pfn_offset, tmem_va + tmem_offset, len);
+        else if ( copy_to_guest_offset(clibuf, pfn_offset,
+                                       tmem_va + tmem_offset, len) )
+            rc = -EFAULT;
+    }
     unmap_domain_page(tmem_va);
-    if ( !tmemc )
+    if ( cli_va )
         cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 1);
     mb();
-    return 1;
+    return rc;
 }
 
 EXPORT int tmh_decompress_to_client(tmem_cli_mfn_t cmfn, void *tmem_va,
-                                    size_t size, void *cli_va)
+                                    size_t size, tmem_cli_va_t clibuf)
 {
     unsigned long cli_mfn = 0;
     pfp_t *cli_pfp = NULL;
+    void *cli_va = NULL;
+    char *scratch = this_cpu(scratch_page);
     size_t out_len = PAGE_SIZE;
-    bool_t tmemc = cli_va != NULL; /* if true, cli_va is control-op buffer */
     int ret;
 
-    if ( !tmemc )
+    if ( guest_handle_is_null(clibuf) )
     {
         cli_va = cli_get_page(cmfn, &cli_mfn, &cli_pfp, 1);
         if ( cli_va == NULL )
             return -EFAULT;
     }
-    ret = lzo1x_decompress_safe(tmem_va, size, cli_va, &out_len);
+    else if ( !scratch )
+        return 0;
+    ret = lzo1x_decompress_safe(tmem_va, size, cli_va ?: scratch, &out_len);
     ASSERT(ret == LZO_E_OK);
     ASSERT(out_len == PAGE_SIZE);
-    if ( !tmemc )
+    if ( cli_va )
         cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 1);
+    else if ( copy_to_guest(clibuf, scratch, PAGE_SIZE) )
+        return -EFAULT;
     mb();
     return 1;
 }
@@ -423,6 +450,11 @@ static int cpu_callback(
             struct page_info *p = alloc_domheap_pages(0, workmem_order, 0);
             per_cpu(workmem, cpu) = p ? page_to_virt(p) : NULL;
         }
+        if ( per_cpu(scratch_page, cpu) == NULL )
+        {
+            struct page_info *p = alloc_domheap_page(NULL, 0);
+            per_cpu(scratch_page, cpu) = p ? page_to_virt(p) : NULL;
+        }
         break;
     }
     case CPU_DEAD:
@@ -439,6 +471,11 @@ static int cpu_callback(
             free_domheap_pages(p, workmem_order);
             per_cpu(workmem, cpu) = NULL;
         }
+        if ( per_cpu(scratch_page, cpu) != NULL )
+        {
+            free_domheap_page(virt_to_page(per_cpu(scratch_page, cpu)));
+            per_cpu(scratch_page, cpu) = NULL;
+        }
         break;
     }
     default:
diff -r b383875a33f0 -r 5bc3e774301c xen/include/xen/tmem_xen.h
--- a/xen/include/xen/tmem_xen.h	Tue Sep 25 12:13:40 2012 +0200
+++ b/xen/include/xen/tmem_xen.h	Tue Sep 25 12:14:31 2012 +0200
@@ -482,27 +482,33 @@ static inline int tmh_get_tmemop_from_cl
     return copy_from_guest(op, uops, 1);
 }
 
+#define tmh_cli_buf_null guest_handle_from_ptr(NULL, char)
+
 static inline void tmh_copy_to_client_buf_offset(tmem_cli_va_t clibuf, int off,
                                            char *tmembuf, int len)
 {
     copy_to_guest_offset(clibuf,off,tmembuf,len);
 }
 
+#define tmh_copy_to_client_buf(clibuf, tmembuf, cnt) \
+    copy_to_guest(guest_handle_cast(clibuf, void), tmembuf, cnt)
+
+#define tmh_client_buf_add guest_handle_add_offset
+
 #define TMH_CLI_ID_NULL ((cli_id_t)((domid_t)-1L))
 
 #define tmh_cli_id_str "domid"
 #define tmh_client_str "domain"
 
-extern int tmh_decompress_to_client(tmem_cli_mfn_t,void*,size_t,void*);
+int tmh_decompress_to_client(tmem_cli_mfn_t, void *, size_t, tmem_cli_va_t);
 
-extern int tmh_compress_from_client(tmem_cli_mfn_t,void**,size_t *,void*);
+int tmh_compress_from_client(tmem_cli_mfn_t, void **, size_t *, tmem_cli_va_t);
 
-extern int tmh_copy_from_client(pfp_t *pfp,
-    tmem_cli_mfn_t cmfn, pagesize_t tmem_offset,
-    pagesize_t pfn_offset, pagesize_t len, void *cva);
+int tmh_copy_from_client(pfp_t *, tmem_cli_mfn_t, pagesize_t tmem_offset,
+    pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_t);
 
-extern int tmh_copy_to_client(tmem_cli_mfn_t cmfn, pfp_t *pfp,
-    pagesize_t tmem_offset, pagesize_t pfn_offset, pagesize_t len, void *cva);
+int tmh_copy_to_client(tmem_cli_mfn_t, pfp_t *, pagesize_t tmem_offset,
+    pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_t);
 
 extern int tmh_copy_tze_to_client(tmem_cli_mfn_t cmfn, void *tmem_va, pagesize_t len);
 

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 14:44:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 14:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGsqY-0000tQ-Ae; Wed, 26 Sep 2012 14:44:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGsqX-0000qn-1U
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:17 +0000
Received: from [85.158.139.211:6744] by server-15.bemta-5.messagelabs.com id
	E4/10-19430-0C413605; Wed, 26 Sep 2012 14:44:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-206.messagelabs.com!1348670654!20064272!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25198 invoked from network); 26 Sep 2012 14:44:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Sep 2012 14:44: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 1TGsqU-0000dG-9Z
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGsqU-0005Nz-8N
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:14 +0000
Message-Id: <E1TGsqU-0005Nz-8N@xenbits.xen.org>
Date: Wed, 26 Sep 2012 14:44:13 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] tmem: cleanup
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348568308 -7200
# Node ID 1853e31bb956699ef0502248a22c21b3aa27efa7
# Parent  7904c87be3f301ae617f17686e267570706be18a
tmem: cleanup

- one more case of checking for a specific rather than any error
- drop no longer needed first parameter from cli_put_page()
- drop a redundant cast

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
xen-unstable changeset: 25860:e4cb84111610
xen-unstable date: Tue Sep 11 12:19:29 UTC 2012
---


diff -r 7904c87be3f3 -r 1853e31bb956 xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:17:52 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:18:28 2012 +0200
@@ -1468,7 +1468,7 @@ static NOINLINE int do_tmem_put_compress
         pgp_free_data(pgp, pgp->us.obj->pool);
     START_CYC_COUNTER(compress);
     ret = tmh_compress_from_client(cmfn, &dst, &size, clibuf);
-    if ( (ret == -EFAULT) || (ret == 0) )
+    if ( ret <= 0 )
         goto out;
     else if ( (size == 0) || (size >= tmem_subpage_maxsize()) ) {
         ret = 0;
diff -r 7904c87be3f3 -r 1853e31bb956 xen/common/tmem_xen.c
--- a/xen/common/tmem_xen.c	Tue Sep 25 12:17:52 2012 +0200
+++ b/xen/common/tmem_xen.c	Tue Sep 25 12:18:28 2012 +0200
@@ -97,7 +97,7 @@ static inline void *cli_get_page(tmem_cl
     return NULL;
 }
 
-static inline void cli_put_page(tmem_cli_mfn_t cmfn, void *cli_va, pfp_t *cli_pfp,
+static inline void cli_put_page(void *cli_va, pfp_t *cli_pfp,
                                 unsigned long cli_mfn, bool_t mark_dirty)
 {
     ASSERT(0);
@@ -126,20 +126,20 @@ static inline void *cli_get_page(tmem_cl
     }
 
     *pcli_mfn = page_to_mfn(page);
-    *pcli_pfp = (pfp_t *)page;
+    *pcli_pfp = page;
     return map_domain_page(*pcli_mfn);
 }
 
-static inline void cli_put_page(tmem_cli_mfn_t cmfn, void *cli_va, pfp_t *cli_pfp,
+static inline void cli_put_page(void *cli_va, pfp_t *cli_pfp,
                                 unsigned long cli_mfn, bool_t mark_dirty)
 {
     if ( mark_dirty )
     {
-        put_page_and_type((struct page_info *)cli_pfp);
+        put_page_and_type(cli_pfp);
         paging_mark_dirty(current->domain,cli_mfn);
     }
     else
-        put_page((struct page_info *)cli_pfp);
+        put_page(cli_pfp);
     unmap_domain_page(cli_va);
 }
 #endif
@@ -188,7 +188,7 @@ EXPORT int tmh_copy_from_client(pfp_t *p
     else if ( len )
         rc = -EINVAL;
     if ( cli_va )
-        cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 0);
+        cli_put_page(cli_va, cli_pfp, cli_mfn, 0);
     unmap_domain_page(tmem_va);
     return rc;
 }
@@ -221,7 +221,7 @@ EXPORT int tmh_compress_from_client(tmem
     ASSERT(ret == LZO_E_OK);
     *out_va = dmem;
     if ( cli_va )
-        cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 0);
+        cli_put_page(cli_va, cli_pfp, cli_mfn, 0);
     return 1;
 }
 
@@ -259,7 +259,7 @@ EXPORT int tmh_copy_to_client(tmem_cli_m
         rc = -EINVAL;
     unmap_domain_page(tmem_va);
     if ( cli_va )
-        cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 1);
+        cli_put_page(cli_va, cli_pfp, cli_mfn, 1);
     mb();
     return rc;
 }
@@ -286,7 +286,7 @@ EXPORT int tmh_decompress_to_client(tmem
     ASSERT(ret == LZO_E_OK);
     ASSERT(out_len == PAGE_SIZE);
     if ( cli_va )
-        cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 1);
+        cli_put_page(cli_va, cli_pfp, cli_mfn, 1);
     else if ( copy_to_guest(clibuf, scratch, PAGE_SIZE) )
         return -EFAULT;
     mb();
@@ -310,7 +310,7 @@ EXPORT int tmh_copy_tze_to_client(tmem_c
         memcpy((char *)cli_va,(char *)tmem_va,len);
     if ( len < PAGE_SIZE )
         memset((char *)cli_va+len,0,PAGE_SIZE-len);
-    cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 1);
+    cli_put_page(cli_va, cli_pfp, cli_mfn, 1);
     mb();
     return 1;
 }

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 14:44:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 14:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGsqY-0000tQ-Ae; Wed, 26 Sep 2012 14:44:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGsqX-0000qn-1U
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:17 +0000
Received: from [85.158.139.211:6744] by server-15.bemta-5.messagelabs.com id
	E4/10-19430-0C413605; Wed, 26 Sep 2012 14:44:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-206.messagelabs.com!1348670654!20064272!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25198 invoked from network); 26 Sep 2012 14:44:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Sep 2012 14:44: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 1TGsqU-0000dG-9Z
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGsqU-0005Nz-8N
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:14 +0000
Message-Id: <E1TGsqU-0005Nz-8N@xenbits.xen.org>
Date: Wed, 26 Sep 2012 14:44:13 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] tmem: cleanup
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348568308 -7200
# Node ID 1853e31bb956699ef0502248a22c21b3aa27efa7
# Parent  7904c87be3f301ae617f17686e267570706be18a
tmem: cleanup

- one more case of checking for a specific rather than any error
- drop no longer needed first parameter from cli_put_page()
- drop a redundant cast

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
xen-unstable changeset: 25860:e4cb84111610
xen-unstable date: Tue Sep 11 12:19:29 UTC 2012
---


diff -r 7904c87be3f3 -r 1853e31bb956 xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:17:52 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:18:28 2012 +0200
@@ -1468,7 +1468,7 @@ static NOINLINE int do_tmem_put_compress
         pgp_free_data(pgp, pgp->us.obj->pool);
     START_CYC_COUNTER(compress);
     ret = tmh_compress_from_client(cmfn, &dst, &size, clibuf);
-    if ( (ret == -EFAULT) || (ret == 0) )
+    if ( ret <= 0 )
         goto out;
     else if ( (size == 0) || (size >= tmem_subpage_maxsize()) ) {
         ret = 0;
diff -r 7904c87be3f3 -r 1853e31bb956 xen/common/tmem_xen.c
--- a/xen/common/tmem_xen.c	Tue Sep 25 12:17:52 2012 +0200
+++ b/xen/common/tmem_xen.c	Tue Sep 25 12:18:28 2012 +0200
@@ -97,7 +97,7 @@ static inline void *cli_get_page(tmem_cl
     return NULL;
 }
 
-static inline void cli_put_page(tmem_cli_mfn_t cmfn, void *cli_va, pfp_t *cli_pfp,
+static inline void cli_put_page(void *cli_va, pfp_t *cli_pfp,
                                 unsigned long cli_mfn, bool_t mark_dirty)
 {
     ASSERT(0);
@@ -126,20 +126,20 @@ static inline void *cli_get_page(tmem_cl
     }
 
     *pcli_mfn = page_to_mfn(page);
-    *pcli_pfp = (pfp_t *)page;
+    *pcli_pfp = page;
     return map_domain_page(*pcli_mfn);
 }
 
-static inline void cli_put_page(tmem_cli_mfn_t cmfn, void *cli_va, pfp_t *cli_pfp,
+static inline void cli_put_page(void *cli_va, pfp_t *cli_pfp,
                                 unsigned long cli_mfn, bool_t mark_dirty)
 {
     if ( mark_dirty )
     {
-        put_page_and_type((struct page_info *)cli_pfp);
+        put_page_and_type(cli_pfp);
         paging_mark_dirty(current->domain,cli_mfn);
     }
     else
-        put_page((struct page_info *)cli_pfp);
+        put_page(cli_pfp);
     unmap_domain_page(cli_va);
 }
 #endif
@@ -188,7 +188,7 @@ EXPORT int tmh_copy_from_client(pfp_t *p
     else if ( len )
         rc = -EINVAL;
     if ( cli_va )
-        cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 0);
+        cli_put_page(cli_va, cli_pfp, cli_mfn, 0);
     unmap_domain_page(tmem_va);
     return rc;
 }
@@ -221,7 +221,7 @@ EXPORT int tmh_compress_from_client(tmem
     ASSERT(ret == LZO_E_OK);
     *out_va = dmem;
     if ( cli_va )
-        cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 0);
+        cli_put_page(cli_va, cli_pfp, cli_mfn, 0);
     return 1;
 }
 
@@ -259,7 +259,7 @@ EXPORT int tmh_copy_to_client(tmem_cli_m
         rc = -EINVAL;
     unmap_domain_page(tmem_va);
     if ( cli_va )
-        cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 1);
+        cli_put_page(cli_va, cli_pfp, cli_mfn, 1);
     mb();
     return rc;
 }
@@ -286,7 +286,7 @@ EXPORT int tmh_decompress_to_client(tmem
     ASSERT(ret == LZO_E_OK);
     ASSERT(out_len == PAGE_SIZE);
     if ( cli_va )
-        cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 1);
+        cli_put_page(cli_va, cli_pfp, cli_mfn, 1);
     else if ( copy_to_guest(clibuf, scratch, PAGE_SIZE) )
         return -EFAULT;
     mb();
@@ -310,7 +310,7 @@ EXPORT int tmh_copy_tze_to_client(tmem_c
         memcpy((char *)cli_va,(char *)tmem_va,len);
     if ( len < PAGE_SIZE )
         memset((char *)cli_va+len,0,PAGE_SIZE-len);
-    cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 1);
+    cli_put_page(cli_va, cli_pfp, cli_mfn, 1);
     mb();
     return 1;
 }

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 14:44:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 14:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGsqT-0000ox-FC; Wed, 26 Sep 2012 14:44:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGsqS-0000oS-B4
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:12 +0000
Received: from [85.158.139.83:47931] by server-16.bemta-5.messagelabs.com id
	7F/F9-05998-BB413605; Wed, 26 Sep 2012 14:44:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-182.messagelabs.com!1348670649!32515479!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17223 invoked from network); 26 Sep 2012 14:44: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;
	26 Sep 2012 14: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 1TGsqP-0000cp-K4
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGsqP-0005Kq-Ip
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:09 +0000
Message-Id: <E1TGsqP-0005Kq-Ip@xenbits.xen.org>
Date: Wed, 26 Sep 2012 14:44:09 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] tmem: consistently make pool_id a
	uint32_t
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1348567924 -7200
# Node ID d188a7ad6c75b8b9ff4ec7335176ec87a047ca28
# Parent  e0dc63c822b2825e84eee3b49cd05052cb0059d3
tmem: consistently make pool_id a uint32_t

Treating it as an int could allow a malicious guest to provide a
negative pool_Id, by passing the MAX_POOLS_PER_DOMAIN limit check and
allowing access to the negative offsets of the pool array.

This is part of XSA-15 / CVE-2012-3497.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 25851:fcf567acc92a
xen-unstable date: Tue Sep 11 12:06:43 UTC 2012
---


diff -r e0dc63c822b2 -r d188a7ad6c75 xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:09:19 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:12:04 2012 +0200
@@ -2417,7 +2417,7 @@ static NOINLINE int tmemc_save_subop(int
     return rc;
 }
 
-static NOINLINE int tmemc_save_get_next_page(int cli_id, int pool_id,
+static NOINLINE int tmemc_save_get_next_page(int cli_id, uint32_t pool_id,
                         tmem_cli_va_t buf, uint32_t bufsize)
 {
     client_t *client = tmh_client_from_cli_id(cli_id);
@@ -2509,7 +2509,7 @@ out:
     return ret;
 }
 
-static int tmemc_restore_put_page(int cli_id, int pool_id, OID *oidp,
+static int tmemc_restore_put_page(int cli_id, uint32_t pool_id, OID *oidp,
                       uint32_t index, tmem_cli_va_t buf, uint32_t bufsize)
 {
     client_t *client = tmh_client_from_cli_id(cli_id);
@@ -2521,7 +2521,7 @@ static int tmemc_restore_put_page(int cl
     return do_tmem_put(pool,oidp,index,0,0,0,bufsize,buf.p);
 }
 
-static int tmemc_restore_flush_page(int cli_id, int pool_id, OID *oidp,
+static int tmemc_restore_flush_page(int cli_id, uint32_t pool_id, OID *oidp,
                         uint32_t index)
 {
     client_t *client = tmh_client_from_cli_id(cli_id);

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 14:44:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 14:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGsqT-0000ox-FC; Wed, 26 Sep 2012 14:44:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGsqS-0000oS-B4
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:12 +0000
Received: from [85.158.139.83:47931] by server-16.bemta-5.messagelabs.com id
	7F/F9-05998-BB413605; Wed, 26 Sep 2012 14:44:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-182.messagelabs.com!1348670649!32515479!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17223 invoked from network); 26 Sep 2012 14:44: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;
	26 Sep 2012 14: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 1TGsqP-0000cp-K4
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGsqP-0005Kq-Ip
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:09 +0000
Message-Id: <E1TGsqP-0005Kq-Ip@xenbits.xen.org>
Date: Wed, 26 Sep 2012 14:44:09 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] tmem: consistently make pool_id a
	uint32_t
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1348567924 -7200
# Node ID d188a7ad6c75b8b9ff4ec7335176ec87a047ca28
# Parent  e0dc63c822b2825e84eee3b49cd05052cb0059d3
tmem: consistently make pool_id a uint32_t

Treating it as an int could allow a malicious guest to provide a
negative pool_Id, by passing the MAX_POOLS_PER_DOMAIN limit check and
allowing access to the negative offsets of the pool array.

This is part of XSA-15 / CVE-2012-3497.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 25851:fcf567acc92a
xen-unstable date: Tue Sep 11 12:06:43 UTC 2012
---


diff -r e0dc63c822b2 -r d188a7ad6c75 xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:09:19 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:12:04 2012 +0200
@@ -2417,7 +2417,7 @@ static NOINLINE int tmemc_save_subop(int
     return rc;
 }
 
-static NOINLINE int tmemc_save_get_next_page(int cli_id, int pool_id,
+static NOINLINE int tmemc_save_get_next_page(int cli_id, uint32_t pool_id,
                         tmem_cli_va_t buf, uint32_t bufsize)
 {
     client_t *client = tmh_client_from_cli_id(cli_id);
@@ -2509,7 +2509,7 @@ out:
     return ret;
 }
 
-static int tmemc_restore_put_page(int cli_id, int pool_id, OID *oidp,
+static int tmemc_restore_put_page(int cli_id, uint32_t pool_id, OID *oidp,
                       uint32_t index, tmem_cli_va_t buf, uint32_t bufsize)
 {
     client_t *client = tmh_client_from_cli_id(cli_id);
@@ -2521,7 +2521,7 @@ static int tmemc_restore_put_page(int cl
     return do_tmem_put(pool,oidp,index,0,0,0,bufsize,buf.p);
 }
 
-static int tmemc_restore_flush_page(int cli_id, int pool_id, OID *oidp,
+static int tmemc_restore_flush_page(int cli_id, uint32_t pool_id, OID *oidp,
                         uint32_t index)
 {
     client_t *client = tmh_client_from_cli_id(cli_id);

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 14:44:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 14:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGsqY-0000t6-5G; Wed, 26 Sep 2012 14:44:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGsqW-0000qD-DZ
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:16 +0000
Received: from [85.158.139.83:48262] by server-13.bemta-5.messagelabs.com id
	7C/4B-16359-FB413605; Wed, 26 Sep 2012 14:44:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-182.messagelabs.com!1348670654!32515497!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17557 invoked from network); 26 Sep 2012 14:44:15 -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;
	26 Sep 2012 14:44: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 1TGsqT-0000dD-Pg
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGsqT-0005Nk-OR
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:13 +0000
Message-Id: <E1TGsqT-0005Nk-OR@xenbits.xen.org>
Date: Wed, 26 Sep 2012 14:44:13 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] tmem: fixup 2010 cleanup patch
	that breaks tmem save/restore
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dan Magenheimer <dan.magenheimer@oracle.com>
# Date 1348568272 -7200
# Node ID 7904c87be3f301ae617f17686e267570706be18a
# Parent  52a0b7ca721b98b23e3ebd61fa0ebcd98bcf471d
tmem: fixup 2010 cleanup patch that breaks tmem save/restore

20918:a3fa6d444b25 "Fix domain reference leaks" (in Feb 2010, by Jan)
does some cleanup in addition to the leak fixes.  Unfortunately, that
cleanup inadvertently resulted in an incorrect fallthrough in a switch
statement which breaks tmem save/restore.

That broken patch was apparently applied to 4.0-testing and 4.1-testing
so those are broken as well.

What is the process now for requesting back-patches to 4.0 and 4.1?

(Side note: This does not by itself entirely fix save/restore in 4.2.)

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 25859:16e0392c6594
xen-unstable date: Tue Sep 11 12:19:03 UTC 2012
---


diff -r 52a0b7ca721b -r 7904c87be3f3 xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:17:05 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:17:52 2012 +0200
@@ -2419,6 +2419,7 @@ static NOINLINE int tmemc_save_subop(int
              break;
         tmh_copy_to_client_buf(buf, pool->uuid, 2);
         rc = 0;
+        break;
     case TMEMC_SAVE_END:
         if ( client == NULL )
             break;
@@ -2429,6 +2430,7 @@ static NOINLINE int tmemc_save_subop(int
                 pgp_free_from_inv_list(client,pgp);
         client->frozen = client->was_frozen;
         rc = 0;
+        break;
     }
     return rc;
 }

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 14:44:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 14:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGsqY-0000t6-5G; Wed, 26 Sep 2012 14:44:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGsqW-0000qD-DZ
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:16 +0000
Received: from [85.158.139.83:48262] by server-13.bemta-5.messagelabs.com id
	7C/4B-16359-FB413605; Wed, 26 Sep 2012 14:44:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-182.messagelabs.com!1348670654!32515497!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17557 invoked from network); 26 Sep 2012 14:44:15 -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;
	26 Sep 2012 14:44: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 1TGsqT-0000dD-Pg
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGsqT-0005Nk-OR
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:13 +0000
Message-Id: <E1TGsqT-0005Nk-OR@xenbits.xen.org>
Date: Wed, 26 Sep 2012 14:44:13 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] tmem: fixup 2010 cleanup patch
	that breaks tmem save/restore
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dan Magenheimer <dan.magenheimer@oracle.com>
# Date 1348568272 -7200
# Node ID 7904c87be3f301ae617f17686e267570706be18a
# Parent  52a0b7ca721b98b23e3ebd61fa0ebcd98bcf471d
tmem: fixup 2010 cleanup patch that breaks tmem save/restore

20918:a3fa6d444b25 "Fix domain reference leaks" (in Feb 2010, by Jan)
does some cleanup in addition to the leak fixes.  Unfortunately, that
cleanup inadvertently resulted in an incorrect fallthrough in a switch
statement which breaks tmem save/restore.

That broken patch was apparently applied to 4.0-testing and 4.1-testing
so those are broken as well.

What is the process now for requesting back-patches to 4.0 and 4.1?

(Side note: This does not by itself entirely fix save/restore in 4.2.)

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 25859:16e0392c6594
xen-unstable date: Tue Sep 11 12:19:03 UTC 2012
---


diff -r 52a0b7ca721b -r 7904c87be3f3 xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:17:05 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:17:52 2012 +0200
@@ -2419,6 +2419,7 @@ static NOINLINE int tmemc_save_subop(int
              break;
         tmh_copy_to_client_buf(buf, pool->uuid, 2);
         rc = 0;
+        break;
     case TMEMC_SAVE_END:
         if ( client == NULL )
             break;
@@ -2429,6 +2430,7 @@ static NOINLINE int tmemc_save_subop(int
                 pgp_free_from_inv_list(client,pgp);
         client->frozen = client->was_frozen;
         rc = 0;
+        break;
     }
     return rc;
 }

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 14:44:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 14:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGsqY-0000tE-7g; Wed, 26 Sep 2012 14:44:18 +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 1TGsqW-0000qc-LG
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:17 +0000
Received: from [85.158.137.99:61995] by server-2.bemta-3.messagelabs.com id
	3C/2F-16514-FB413605; Wed, 26 Sep 2012 14:44:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-217.messagelabs.com!1348670653!19243118!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13843 invoked from network); 26 Sep 2012 14:44:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Sep 2012 14:44: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 1TGsqT-0000dA-C2
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGsqT-0005NV-7Q
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:13 +0000
Message-Id: <E1TGsqT-0005NV-7Q@xenbits.xen.org>
Date: Wed, 26 Sep 2012 14:44:12 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] tmem: reduce severity of log
	messages
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348568225 -7200
# Node ID 52a0b7ca721b98b23e3ebd61fa0ebcd98bcf471d
# Parent  22dfc72fdbf394098027e051bba2ebbd40f2ee32
tmem: reduce severity of log messages

Otherwise they can be used by a guest to spam the hypervisor log with
all settings at their defaults.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
xen-unstable changeset: 25858:0520982a602a
xen-unstable date: Tue Sep 11 12:18:36 UTC 2012
---


diff -r 22dfc72fdbf3 -r 52a0b7ca721b xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:16:34 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:17:05 2012 +0200
@@ -1107,7 +1107,7 @@ static int shared_pool_join(pool_t *pool
     sl->client = new_client;
     list_add_tail(&sl->share_list, &pool->share_list);
     if ( new_client->cli_id != pool->client->cli_id )
-        printk("adding new %s %d to shared pool owned by %s %d\n",
+        tmh_client_info("adding new %s %d to shared pool owned by %s %d\n",
             client_str, new_client->cli_id, client_str, pool->client->cli_id);
     return ++pool->shared_count;
 }
@@ -1137,7 +1137,7 @@ static NOINLINE void shared_pool_reassig
     old_client->eph_count -= _atomic_read(pool->pgp_count);
     list_splice_init(&old_client->ephemeral_page_list,
                      &new_client->ephemeral_page_list);
-    printk("reassigned shared pool from %s=%d to %s=%d pool_id=%d\n",
+    tmh_client_info("reassigned shared pool from %s=%d to %s=%d pool_id=%d\n",
         cli_id_str, old_client->cli_id, cli_id_str, new_client->cli_id, poolid);
     pool->pool_id = poolid;
 }
@@ -1173,7 +1173,7 @@ static NOINLINE int shared_pool_quit(poo
             }
         return 0;
     }
-    printk("tmem: no match unsharing pool, %s=%d\n",
+    tmh_client_warn("tmem: no match unsharing pool, %s=%d\n",
         cli_id_str,pool->client->cli_id);
     return -1;
 }
@@ -1184,17 +1184,18 @@ static void pool_flush(pool_t *pool, cli
     ASSERT(pool != NULL);
     if ( (is_shared(pool)) && (shared_pool_quit(pool,cli_id) > 0) )
     {
-        printk("tmem: %s=%d no longer using shared pool %d owned by %s=%d\n",
+        tmh_client_warn("tmem: %s=%d no longer using shared pool %d owned by %s=%d\n",
            cli_id_str, cli_id, pool->pool_id, cli_id_str,pool->client->cli_id);
         return;
     }
-    printk("%s %s-%s tmem pool ",destroy?"destroying":"flushing",
-        is_persistent(pool) ? "persistent" : "ephemeral" ,
-        is_shared(pool) ? "shared" : "private");
-    printk("%s=%d pool_id=%d\n", cli_id_str,pool->client->cli_id,pool->pool_id);
+    tmh_client_info("%s %s-%s tmem pool %s=%d pool_id=%d\n",
+                    destroy ? "destroying" : "flushing",
+                    is_persistent(pool) ? "persistent" : "ephemeral" ,
+                    is_shared(pool) ? "shared" : "private",
+                    cli_id_str, pool->client->cli_id, pool->pool_id);
     if ( pool->client->live_migrating )
     {
-        printk("can't %s pool while %s is live-migrating\n",
+        tmh_client_warn("can't %s pool while %s is live-migrating\n",
                destroy?"destroy":"flush", client_str);
         return;
     }
@@ -1213,21 +1214,22 @@ static client_t *client_create(cli_id_t 
     client_t *client = tmh_alloc_infra(sizeof(client_t),__alignof__(client_t));
     int i;
 
-    printk("tmem: initializing tmem capability for %s=%d...",cli_id_str,cli_id);
+    tmh_client_info("tmem: initializing tmem capability for %s=%d...",
+                    cli_id_str, cli_id);
     if ( client == NULL )
     {
-        printk("failed... out of memory\n");
+        tmh_client_err("failed... out of memory\n");
         goto fail;
     }
     memset(client,0,sizeof(client_t));
     if ( (client->tmh = tmh_client_init(cli_id)) == NULL )
     {
-        printk("failed... can't allocate host-dependent part of client\n");
+        tmh_client_err("failed... can't allocate host-dependent part of client\n");
         goto fail;
     }
     if ( !tmh_set_client_from_id(client, client->tmh, cli_id) )
     {
-        printk("failed... can't set client\n");
+        tmh_client_err("failed... can't set client\n");
         goto fail;
     }
     client->cli_id = cli_id;
@@ -1249,7 +1251,7 @@ static client_t *client_create(cli_id_t 
     client->eph_count = client->eph_count_max = 0;
     client->total_cycles = 0; client->succ_pers_puts = 0;
     client->succ_eph_gets = 0; client->succ_pers_gets = 0;
-    printk("ok\n");
+    tmh_client_info("ok\n");
     return client;
 
  fail:
@@ -1903,32 +1905,33 @@ static NOINLINE int do_tmem_new_pool(cli
         cli_id = tmh_get_cli_id_from_current();
     else
         cli_id = this_cli_id;
-    printk("tmem: allocating %s-%s tmem pool for %s=%d...",
+    tmh_client_info("tmem: allocating %s-%s tmem pool for %s=%d...",
         persistent ? "persistent" : "ephemeral" ,
         shared ? "shared" : "private", cli_id_str, cli_id);
     if ( specversion != TMEM_SPEC_VERSION )
     {
-        printk("failed... unsupported spec version\n");
+        tmh_client_err("failed... unsupported spec version\n");
         return -EPERM;
     }
     if ( pagebits != (PAGE_SHIFT - 12) )
     {
-        printk("failed... unsupported pagesize %d\n",1<<(pagebits+12));
+        tmh_client_err("failed... unsupported pagesize %d\n",
+                       1 << (pagebits + 12));
         return -EPERM;
     }
     if ( flags & TMEM_POOL_PRECOMPRESSED )
     {
-        printk("failed... precompression flag set but unsupported\n");
+        tmh_client_err("failed... precompression flag set but unsupported\n");
         return -EPERM;
     }
     if ( flags & TMEM_POOL_RESERVED_BITS )
     {
-        printk("failed... reserved bits must be zero\n");
+        tmh_client_err("failed... reserved bits must be zero\n");
         return -EPERM;
     }
     if ( (pool = pool_alloc()) == NULL )
     {
-        printk("failed... out of memory\n");
+        tmh_client_err("failed... out of memory\n");
         return -ENOMEM;
     }
     if ( this_cli_id != CLI_ID_NULL )
@@ -1947,7 +1950,7 @@ static NOINLINE int do_tmem_new_pool(cli
                 break;
         if ( d_poolid >= MAX_POOLS_PER_DOMAIN )
         {
-            printk("failed... no more pool slots available for this %s\n",
+            tmh_client_err("failed... no more pool slots available for this %s\n",
                    client_str);
             goto fail;
         }
@@ -1977,9 +1980,8 @@ static NOINLINE int do_tmem_new_pool(cli
             {
                 if ( shpool->uuid[0] == uuid_lo && shpool->uuid[1] == uuid_hi )
                 {
-                    printk("(matches shared pool uuid=%"PRIx64".%"PRIx64") ",
-                        uuid_hi, uuid_lo);
-                    printk("pool_id=%d\n",d_poolid);
+                    tmh_client_info("(matches shared pool uuid=%"PRIx64".%"PRIx64") pool_id=%d\n",
+                        uuid_hi, uuid_lo, d_poolid);
                     client->pools[d_poolid] = global_shared_pools[s_poolid];
                     shared_pool_join(global_shared_pools[s_poolid], client);
                     pool_free(pool);
@@ -1991,7 +1993,7 @@ static NOINLINE int do_tmem_new_pool(cli
         }
         if ( first_unused_s_poolid == MAX_GLOBAL_SHARED_POOLS )
         {
-            printk("tmem: failed... no global shared pool slots available\n");
+            tmh_client_warn("tmem: failed... no global shared pool slots available\n");
             goto fail;
         }
         else
@@ -2007,7 +2009,7 @@ static NOINLINE int do_tmem_new_pool(cli
     pool->pool_id = d_poolid;
     pool->persistent = persistent;
     pool->uuid[0] = uuid_lo; pool->uuid[1] = uuid_hi;
-    printk("pool_id=%d\n",d_poolid);
+    tmh_client_info("pool_id=%d\n", d_poolid);
     return d_poolid;
 
 fail:
@@ -2030,14 +2032,15 @@ static int tmemc_freeze_pools(cli_id_t c
     {
         list_for_each_entry(client,&global_client_list,client_list)
             client_freeze(client,freeze);
-        printk("tmem: all pools %s for all %ss\n",s,client_str);
+        tmh_client_info("tmem: all pools %s for all %ss\n", s, client_str);
     }
     else
     {
         if ( (client = tmh_client_from_cli_id(cli_id)) == NULL)
             return -1;
         client_freeze(client,freeze);
-        printk("tmem: all pools %s for %s=%d\n",s,cli_id_str,cli_id);
+        tmh_client_info("tmem: all pools %s for %s=%d\n",
+                         s, cli_id_str, cli_id);
     }
     return 0;
 }
@@ -2048,7 +2051,7 @@ static int tmemc_flush_mem(cli_id_t cli_
 
     if ( cli_id != CLI_ID_NULL )
     {
-        printk("tmem: %s-specific flush not supported yet, use --all\n",
+        tmh_client_warn("tmem: %s-specific flush not supported yet, use --all\n",
            client_str);
         return -1;
     }
@@ -2261,13 +2264,15 @@ static int tmemc_set_var_one(client_t *c
     case TMEMC_SET_WEIGHT:
         old_weight = client->weight;
         client->weight = arg1;
-        printk("tmem: weight set to %d for %s=%d\n",arg1,cli_id_str,cli_id);
+        tmh_client_info("tmem: weight set to %d for %s=%d\n",
+                        arg1, cli_id_str, cli_id);
         atomic_sub(old_weight,&client_weight_total);
         atomic_add(client->weight,&client_weight_total);
         break;
     case TMEMC_SET_CAP:
         client->cap = arg1;
-        printk("tmem: cap set to %d for %s=%d\n",arg1,cli_id_str,cli_id);
+        tmh_client_info("tmem: cap set to %d for %s=%d\n",
+                        arg1, cli_id_str, cli_id);
         break;
     case TMEMC_SET_COMPRESS:
 #ifdef __i386__
@@ -2275,17 +2280,17 @@ static int tmemc_set_var_one(client_t *c
 #endif
         if ( tmh_dedup_enabled() )
         {
-            printk("tmem: compression %s for all %ss, cannot be changed "
-                   "when tmem_dedup is enabled\n",
-            tmh_compression_enabled() ? "enabled" : "disabled",client_str);
+            tmh_client_warn("tmem: compression %s for all %ss, cannot be changed when tmem_dedup is enabled\n",
+                            tmh_compression_enabled() ? "enabled" : "disabled",
+                            client_str);
             return -1;
         }
         client->compress = arg1 ? 1 : 0;
-        printk("tmem: compression %s for %s=%d\n",
+        tmh_client_info("tmem: compression %s for %s=%d\n",
             arg1 ? "enabled" : "disabled",cli_id_str,cli_id);
         break;
     default:
-        printk("tmem: unknown subop %d for tmemc_set_var\n",subop);
+        tmh_client_warn("tmem: unknown subop %d for tmemc_set_var\n", subop);
         return -1;
     }
     return 0;
@@ -2668,7 +2673,7 @@ EXPORT long do_tmem_op(tmem_cli_op_t uop
 
     if ( unlikely(tmh_get_tmemop_from_client(&op, uops) != 0) )
     {
-        printk("tmem: can't get tmem struct from %s\n",client_str);
+        tmh_client_err("tmem: can't get tmem struct from %s\n", client_str);
         rc = -EFAULT;
         if ( !tmh_lock_all )
             goto simple_error;
@@ -2702,7 +2707,8 @@ EXPORT long do_tmem_op(tmem_cli_op_t uop
         tmem_write_lock_set = 1;
         if ( (client = client_create(tmh_get_cli_id_from_current())) == NULL )
         {
-            printk("tmem: can't create tmem structure for %s\n",client_str);
+            tmh_client_err("tmem: can't create tmem structure for %s\n",
+                           client_str);
             rc = -ENOMEM;
             goto out;
         }
@@ -2726,8 +2732,8 @@ EXPORT long do_tmem_op(tmem_cli_op_t uop
         if ( ((uint32_t)op.pool_id >= MAX_POOLS_PER_DOMAIN) ||
              ((pool = client->pools[op.pool_id]) == NULL) )
         {
+            tmh_client_err("tmem: operation requested on uncreated pool\n");
             rc = -ENODEV;
-            printk("tmem: operation requested on uncreated pool\n");
             goto out;
         }
         ASSERT_SENTINEL(pool,POOL);
@@ -2783,11 +2789,11 @@ EXPORT long do_tmem_op(tmem_cli_op_t uop
         break;
     case TMEM_XCHG:
         /* need to hold global lock to ensure xchg is atomic */
-        printk("tmem_xchg op not implemented yet\n");
+        tmh_client_warn("tmem_xchg op not implemented yet\n");
         rc = 0;
         break;
     default:
-        printk("tmem: op %d not implemented\n", op.cmd);
+        tmh_client_warn("tmem: op %d not implemented\n", op.cmd);
         rc = 0;
         break;
     }
diff -r 22dfc72fdbf3 -r 52a0b7ca721b xen/include/xen/tmem_xen.h
--- a/xen/include/xen/tmem_xen.h	Tue Sep 25 12:16:34 2012 +0200
+++ b/xen/include/xen/tmem_xen.h	Tue Sep 25 12:17:05 2012 +0200
@@ -512,6 +512,9 @@ int tmh_copy_to_client(tmem_cli_mfn_t, p
 
 extern int tmh_copy_tze_to_client(tmem_cli_mfn_t cmfn, void *tmem_va, pagesize_t len);
 
+#define tmh_client_err(fmt, args...)  printk(XENLOG_G_ERR fmt, ##args)
+#define tmh_client_warn(fmt, args...) printk(XENLOG_G_WARNING fmt, ##args)
+#define tmh_client_info(fmt, args...) printk(XENLOG_G_INFO fmt, ##args)
 
 #define TMEM_PERF
 #ifdef TMEM_PERF

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 14:44:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 14:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TGsqY-0000tE-7g; Wed, 26 Sep 2012 14:44:18 +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 1TGsqW-0000qc-LG
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:17 +0000
Received: from [85.158.137.99:61995] by server-2.bemta-3.messagelabs.com id
	3C/2F-16514-FB413605; Wed, 26 Sep 2012 14:44:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-217.messagelabs.com!1348670653!19243118!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13843 invoked from network); 26 Sep 2012 14:44:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Sep 2012 14:44: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 1TGsqT-0000dA-C2
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGsqT-0005NV-7Q
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:13 +0000
Message-Id: <E1TGsqT-0005NV-7Q@xenbits.xen.org>
Date: Wed, 26 Sep 2012 14:44:12 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] tmem: reduce severity of log
	messages
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348568225 -7200
# Node ID 52a0b7ca721b98b23e3ebd61fa0ebcd98bcf471d
# Parent  22dfc72fdbf394098027e051bba2ebbd40f2ee32
tmem: reduce severity of log messages

Otherwise they can be used by a guest to spam the hypervisor log with
all settings at their defaults.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
xen-unstable changeset: 25858:0520982a602a
xen-unstable date: Tue Sep 11 12:18:36 UTC 2012
---


diff -r 22dfc72fdbf3 -r 52a0b7ca721b xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:16:34 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:17:05 2012 +0200
@@ -1107,7 +1107,7 @@ static int shared_pool_join(pool_t *pool
     sl->client = new_client;
     list_add_tail(&sl->share_list, &pool->share_list);
     if ( new_client->cli_id != pool->client->cli_id )
-        printk("adding new %s %d to shared pool owned by %s %d\n",
+        tmh_client_info("adding new %s %d to shared pool owned by %s %d\n",
             client_str, new_client->cli_id, client_str, pool->client->cli_id);
     return ++pool->shared_count;
 }
@@ -1137,7 +1137,7 @@ static NOINLINE void shared_pool_reassig
     old_client->eph_count -= _atomic_read(pool->pgp_count);
     list_splice_init(&old_client->ephemeral_page_list,
                      &new_client->ephemeral_page_list);
-    printk("reassigned shared pool from %s=%d to %s=%d pool_id=%d\n",
+    tmh_client_info("reassigned shared pool from %s=%d to %s=%d pool_id=%d\n",
         cli_id_str, old_client->cli_id, cli_id_str, new_client->cli_id, poolid);
     pool->pool_id = poolid;
 }
@@ -1173,7 +1173,7 @@ static NOINLINE int shared_pool_quit(poo
             }
         return 0;
     }
-    printk("tmem: no match unsharing pool, %s=%d\n",
+    tmh_client_warn("tmem: no match unsharing pool, %s=%d\n",
         cli_id_str,pool->client->cli_id);
     return -1;
 }
@@ -1184,17 +1184,18 @@ static void pool_flush(pool_t *pool, cli
     ASSERT(pool != NULL);
     if ( (is_shared(pool)) && (shared_pool_quit(pool,cli_id) > 0) )
     {
-        printk("tmem: %s=%d no longer using shared pool %d owned by %s=%d\n",
+        tmh_client_warn("tmem: %s=%d no longer using shared pool %d owned by %s=%d\n",
            cli_id_str, cli_id, pool->pool_id, cli_id_str,pool->client->cli_id);
         return;
     }
-    printk("%s %s-%s tmem pool ",destroy?"destroying":"flushing",
-        is_persistent(pool) ? "persistent" : "ephemeral" ,
-        is_shared(pool) ? "shared" : "private");
-    printk("%s=%d pool_id=%d\n", cli_id_str,pool->client->cli_id,pool->pool_id);
+    tmh_client_info("%s %s-%s tmem pool %s=%d pool_id=%d\n",
+                    destroy ? "destroying" : "flushing",
+                    is_persistent(pool) ? "persistent" : "ephemeral" ,
+                    is_shared(pool) ? "shared" : "private",
+                    cli_id_str, pool->client->cli_id, pool->pool_id);
     if ( pool->client->live_migrating )
     {
-        printk("can't %s pool while %s is live-migrating\n",
+        tmh_client_warn("can't %s pool while %s is live-migrating\n",
                destroy?"destroy":"flush", client_str);
         return;
     }
@@ -1213,21 +1214,22 @@ static client_t *client_create(cli_id_t 
     client_t *client = tmh_alloc_infra(sizeof(client_t),__alignof__(client_t));
     int i;
 
-    printk("tmem: initializing tmem capability for %s=%d...",cli_id_str,cli_id);
+    tmh_client_info("tmem: initializing tmem capability for %s=%d...",
+                    cli_id_str, cli_id);
     if ( client == NULL )
     {
-        printk("failed... out of memory\n");
+        tmh_client_err("failed... out of memory\n");
         goto fail;
     }
     memset(client,0,sizeof(client_t));
     if ( (client->tmh = tmh_client_init(cli_id)) == NULL )
     {
-        printk("failed... can't allocate host-dependent part of client\n");
+        tmh_client_err("failed... can't allocate host-dependent part of client\n");
         goto fail;
     }
     if ( !tmh_set_client_from_id(client, client->tmh, cli_id) )
     {
-        printk("failed... can't set client\n");
+        tmh_client_err("failed... can't set client\n");
         goto fail;
     }
     client->cli_id = cli_id;
@@ -1249,7 +1251,7 @@ static client_t *client_create(cli_id_t 
     client->eph_count = client->eph_count_max = 0;
     client->total_cycles = 0; client->succ_pers_puts = 0;
     client->succ_eph_gets = 0; client->succ_pers_gets = 0;
-    printk("ok\n");
+    tmh_client_info("ok\n");
     return client;
 
  fail:
@@ -1903,32 +1905,33 @@ static NOINLINE int do_tmem_new_pool(cli
         cli_id = tmh_get_cli_id_from_current();
     else
         cli_id = this_cli_id;
-    printk("tmem: allocating %s-%s tmem pool for %s=%d...",
+    tmh_client_info("tmem: allocating %s-%s tmem pool for %s=%d...",
         persistent ? "persistent" : "ephemeral" ,
         shared ? "shared" : "private", cli_id_str, cli_id);
     if ( specversion != TMEM_SPEC_VERSION )
     {
-        printk("failed... unsupported spec version\n");
+        tmh_client_err("failed... unsupported spec version\n");
         return -EPERM;
     }
     if ( pagebits != (PAGE_SHIFT - 12) )
     {
-        printk("failed... unsupported pagesize %d\n",1<<(pagebits+12));
+        tmh_client_err("failed... unsupported pagesize %d\n",
+                       1 << (pagebits + 12));
         return -EPERM;
     }
     if ( flags & TMEM_POOL_PRECOMPRESSED )
     {
-        printk("failed... precompression flag set but unsupported\n");
+        tmh_client_err("failed... precompression flag set but unsupported\n");
         return -EPERM;
     }
     if ( flags & TMEM_POOL_RESERVED_BITS )
     {
-        printk("failed... reserved bits must be zero\n");
+        tmh_client_err("failed... reserved bits must be zero\n");
         return -EPERM;
     }
     if ( (pool = pool_alloc()) == NULL )
     {
-        printk("failed... out of memory\n");
+        tmh_client_err("failed... out of memory\n");
         return -ENOMEM;
     }
     if ( this_cli_id != CLI_ID_NULL )
@@ -1947,7 +1950,7 @@ static NOINLINE int do_tmem_new_pool(cli
                 break;
         if ( d_poolid >= MAX_POOLS_PER_DOMAIN )
         {
-            printk("failed... no more pool slots available for this %s\n",
+            tmh_client_err("failed... no more pool slots available for this %s\n",
                    client_str);
             goto fail;
         }
@@ -1977,9 +1980,8 @@ static NOINLINE int do_tmem_new_pool(cli
             {
                 if ( shpool->uuid[0] == uuid_lo && shpool->uuid[1] == uuid_hi )
                 {
-                    printk("(matches shared pool uuid=%"PRIx64".%"PRIx64") ",
-                        uuid_hi, uuid_lo);
-                    printk("pool_id=%d\n",d_poolid);
+                    tmh_client_info("(matches shared pool uuid=%"PRIx64".%"PRIx64") pool_id=%d\n",
+                        uuid_hi, uuid_lo, d_poolid);
                     client->pools[d_poolid] = global_shared_pools[s_poolid];
                     shared_pool_join(global_shared_pools[s_poolid], client);
                     pool_free(pool);
@@ -1991,7 +1993,7 @@ static NOINLINE int do_tmem_new_pool(cli
         }
         if ( first_unused_s_poolid == MAX_GLOBAL_SHARED_POOLS )
         {
-            printk("tmem: failed... no global shared pool slots available\n");
+            tmh_client_warn("tmem: failed... no global shared pool slots available\n");
             goto fail;
         }
         else
@@ -2007,7 +2009,7 @@ static NOINLINE int do_tmem_new_pool(cli
     pool->pool_id = d_poolid;
     pool->persistent = persistent;
     pool->uuid[0] = uuid_lo; pool->uuid[1] = uuid_hi;
-    printk("pool_id=%d\n",d_poolid);
+    tmh_client_info("pool_id=%d\n", d_poolid);
     return d_poolid;
 
 fail:
@@ -2030,14 +2032,15 @@ static int tmemc_freeze_pools(cli_id_t c
     {
         list_for_each_entry(client,&global_client_list,client_list)
             client_freeze(client,freeze);
-        printk("tmem: all pools %s for all %ss\n",s,client_str);
+        tmh_client_info("tmem: all pools %s for all %ss\n", s, client_str);
     }
     else
     {
         if ( (client = tmh_client_from_cli_id(cli_id)) == NULL)
             return -1;
         client_freeze(client,freeze);
-        printk("tmem: all pools %s for %s=%d\n",s,cli_id_str,cli_id);
+        tmh_client_info("tmem: all pools %s for %s=%d\n",
+                         s, cli_id_str, cli_id);
     }
     return 0;
 }
@@ -2048,7 +2051,7 @@ static int tmemc_flush_mem(cli_id_t cli_
 
     if ( cli_id != CLI_ID_NULL )
     {
-        printk("tmem: %s-specific flush not supported yet, use --all\n",
+        tmh_client_warn("tmem: %s-specific flush not supported yet, use --all\n",
            client_str);
         return -1;
     }
@@ -2261,13 +2264,15 @@ static int tmemc_set_var_one(client_t *c
     case TMEMC_SET_WEIGHT:
         old_weight = client->weight;
         client->weight = arg1;
-        printk("tmem: weight set to %d for %s=%d\n",arg1,cli_id_str,cli_id);
+        tmh_client_info("tmem: weight set to %d for %s=%d\n",
+                        arg1, cli_id_str, cli_id);
         atomic_sub(old_weight,&client_weight_total);
         atomic_add(client->weight,&client_weight_total);
         break;
     case TMEMC_SET_CAP:
         client->cap = arg1;
-        printk("tmem: cap set to %d for %s=%d\n",arg1,cli_id_str,cli_id);
+        tmh_client_info("tmem: cap set to %d for %s=%d\n",
+                        arg1, cli_id_str, cli_id);
         break;
     case TMEMC_SET_COMPRESS:
 #ifdef __i386__
@@ -2275,17 +2280,17 @@ static int tmemc_set_var_one(client_t *c
 #endif
         if ( tmh_dedup_enabled() )
         {
-            printk("tmem: compression %s for all %ss, cannot be changed "
-                   "when tmem_dedup is enabled\n",
-            tmh_compression_enabled() ? "enabled" : "disabled",client_str);
+            tmh_client_warn("tmem: compression %s for all %ss, cannot be changed when tmem_dedup is enabled\n",
+                            tmh_compression_enabled() ? "enabled" : "disabled",
+                            client_str);
             return -1;
         }
         client->compress = arg1 ? 1 : 0;
-        printk("tmem: compression %s for %s=%d\n",
+        tmh_client_info("tmem: compression %s for %s=%d\n",
             arg1 ? "enabled" : "disabled",cli_id_str,cli_id);
         break;
     default:
-        printk("tmem: unknown subop %d for tmemc_set_var\n",subop);
+        tmh_client_warn("tmem: unknown subop %d for tmemc_set_var\n", subop);
         return -1;
     }
     return 0;
@@ -2668,7 +2673,7 @@ EXPORT long do_tmem_op(tmem_cli_op_t uop
 
     if ( unlikely(tmh_get_tmemop_from_client(&op, uops) != 0) )
     {
-        printk("tmem: can't get tmem struct from %s\n",client_str);
+        tmh_client_err("tmem: can't get tmem struct from %s\n", client_str);
         rc = -EFAULT;
         if ( !tmh_lock_all )
             goto simple_error;
@@ -2702,7 +2707,8 @@ EXPORT long do_tmem_op(tmem_cli_op_t uop
         tmem_write_lock_set = 1;
         if ( (client = client_create(tmh_get_cli_id_from_current())) == NULL )
         {
-            printk("tmem: can't create tmem structure for %s\n",client_str);
+            tmh_client_err("tmem: can't create tmem structure for %s\n",
+                           client_str);
             rc = -ENOMEM;
             goto out;
         }
@@ -2726,8 +2732,8 @@ EXPORT long do_tmem_op(tmem_cli_op_t uop
         if ( ((uint32_t)op.pool_id >= MAX_POOLS_PER_DOMAIN) ||
              ((pool = client->pools[op.pool_id]) == NULL) )
         {
+            tmh_client_err("tmem: operation requested on uncreated pool\n");
             rc = -ENODEV;
-            printk("tmem: operation requested on uncreated pool\n");
             goto out;
         }
         ASSERT_SENTINEL(pool,POOL);
@@ -2783,11 +2789,11 @@ EXPORT long do_tmem_op(tmem_cli_op_t uop
         break;
     case TMEM_XCHG:
         /* need to hold global lock to ensure xchg is atomic */
-        printk("tmem_xchg op not implemented yet\n");
+        tmh_client_warn("tmem_xchg op not implemented yet\n");
         rc = 0;
         break;
     default:
-        printk("tmem: op %d not implemented\n", op.cmd);
+        tmh_client_warn("tmem: op %d not implemented\n", op.cmd);
         rc = 0;
         break;
     }
diff -r 22dfc72fdbf3 -r 52a0b7ca721b xen/include/xen/tmem_xen.h
--- a/xen/include/xen/tmem_xen.h	Tue Sep 25 12:16:34 2012 +0200
+++ b/xen/include/xen/tmem_xen.h	Tue Sep 25 12:17:05 2012 +0200
@@ -512,6 +512,9 @@ int tmh_copy_to_client(tmem_cli_mfn_t, p
 
 extern int tmh_copy_tze_to_client(tmem_cli_mfn_t cmfn, void *tmem_va, pagesize_t len);
 
+#define tmh_client_err(fmt, args...)  printk(XENLOG_G_ERR fmt, ##args)
+#define tmh_client_warn(fmt, args...) printk(XENLOG_G_WARNING fmt, ##args)
+#define tmh_client_info(fmt, args...) printk(XENLOG_G_INFO fmt, ##args)
 
 #define TMEM_PERF
 #ifdef TMEM_PERF

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 14:44:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 14: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.xen.org>)
	id 1TGsqZ-0000uU-DL; Wed, 26 Sep 2012 14:44:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGsqX-0000rB-GS
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:17 +0000
Received: from [85.158.139.211:6779] by server-4.bemta-5.messagelabs.com id
	E3/1C-20767-0C413605; Wed, 26 Sep 2012 14:44:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-206.messagelabs.com!1348670654!18544903!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20582 invoked from network); 26 Sep 2012 14:44:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Sep 2012 14:44: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 1TGsqU-0000dJ-QZ
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGsqU-0005OE-PR
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:14 +0000
Message-Id: <E1TGsqU-0005OE-PR@xenbits.xen.org>
Date: Wed, 26 Sep 2012 14:44:14 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] tmem: bump pool version to 1 to
	fix restore issue when tmem enabled
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Zhenzhong Duan <zhenzhong.duan@oracle.com>
# Date 1348568373 -7200
# Node ID 2b59edeb0fddf738d055815ab10c2d98ef724be1
# Parent  1853e31bb956699ef0502248a22c21b3aa27efa7
tmem: bump pool version to 1 to fix restore issue when tmem enabled

Restore fails when tmem is enabled both in hypervisor and guest. This
is due to spec version mismatch when restoring a pool.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
xen-unstable changeset: 25929:fee83ac77d8c
xen-unstable date: Wed Sep 19 15:38:47 UTC 2012
---


diff -r 1853e31bb956 -r 2b59edeb0fdd xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:18:28 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:19:33 2012 +0200
@@ -2407,7 +2407,8 @@ static NOINLINE int tmemc_save_subop(int
              break;
          rc = (pool->persistent ? TMEM_POOL_PERSIST : 0) |
               (pool->shared ? TMEM_POOL_SHARED : 0) |
-              (pool->pageshift << TMEM_POOL_PAGESIZE_SHIFT);
+              (pool->pageshift << TMEM_POOL_PAGESIZE_SHIFT) |
+              (TMEM_SPEC_VERSION << TMEM_POOL_VERSION_SHIFT);
         break;
     case TMEMC_SAVE_GET_POOL_NPAGES:
          if ( pool == NULL )

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

From xen-changelog-bounces@lists.xen.org Wed Sep 26 14:44:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Sep 2012 14: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.xen.org>)
	id 1TGsqZ-0000uU-DL; Wed, 26 Sep 2012 14:44:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGsqX-0000rB-GS
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:17 +0000
Received: from [85.158.139.211:6779] by server-4.bemta-5.messagelabs.com id
	E3/1C-20767-0C413605; Wed, 26 Sep 2012 14:44:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-206.messagelabs.com!1348670654!18544903!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20582 invoked from network); 26 Sep 2012 14:44:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Sep 2012 14:44: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 1TGsqU-0000dJ-QZ
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TGsqU-0005OE-PR
	for xen-changelog@lists.xensource.com; Wed, 26 Sep 2012 14:44:14 +0000
Message-Id: <E1TGsqU-0005OE-PR@xenbits.xen.org>
Date: Wed, 26 Sep 2012 14:44:14 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] tmem: bump pool version to 1 to
	fix restore issue when tmem enabled
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Zhenzhong Duan <zhenzhong.duan@oracle.com>
# Date 1348568373 -7200
# Node ID 2b59edeb0fddf738d055815ab10c2d98ef724be1
# Parent  1853e31bb956699ef0502248a22c21b3aa27efa7
tmem: bump pool version to 1 to fix restore issue when tmem enabled

Restore fails when tmem is enabled both in hypervisor and guest. This
is due to spec version mismatch when restoring a pool.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
xen-unstable changeset: 25929:fee83ac77d8c
xen-unstable date: Wed Sep 19 15:38:47 UTC 2012
---


diff -r 1853e31bb956 -r 2b59edeb0fdd xen/common/tmem.c
--- a/xen/common/tmem.c	Tue Sep 25 12:18:28 2012 +0200
+++ b/xen/common/tmem.c	Tue Sep 25 12:19:33 2012 +0200
@@ -2407,7 +2407,8 @@ static NOINLINE int tmemc_save_subop(int
              break;
          rc = (pool->persistent ? TMEM_POOL_PERSIST : 0) |
               (pool->shared ? TMEM_POOL_SHARED : 0) |
-              (pool->pageshift << TMEM_POOL_PAGESIZE_SHIFT);
+              (pool->pageshift << TMEM_POOL_PAGESIZE_SHIFT) |
+              (TMEM_SPEC_VERSION << TMEM_POOL_VERSION_SHIFT);
         break;
     case TMEMC_SAVE_GET_POOL_NPAGES:
          if ( pool == NULL )

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22:33:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1THMdu-00081c-K8; Thu, 27 Sep 2012 22:33: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 1THMdt-00081H-Le
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:13 +0000
Received: from [85.158.137.99:33526] by server-3.bemta-3.messagelabs.com id
	DA/D5-25962-824D4605; Thu, 27 Sep 2012 22:33:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-217.messagelabs.com!1348785191!19302067!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24671 invoked from network); 27 Sep 2012 22:33:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Sep 2012 22: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 1THMdq-0007H5-Oy
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdq-0003n9-Hz
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:10 +0000
Message-Id: <E1THMdq-0003n9-Hz@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: eliminate code affecting only
	64-bit-incapable CPUs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348233621 -7200
# Node ID 32187301ecc57f06fe659779c2b781a6ebde1101
# Parent  c8873f13cec3246a5e78939588e60fd930a3abb3
x86: eliminate code affecting only 64-bit-incapable CPUs

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


diff -r c8873f13cec3 -r 32187301ecc5 xen/arch/x86/cpu/common.c
--- a/xen/arch/x86/cpu/common.c	Fri Sep 21 14:25:12 2012 +0200
+++ b/xen/arch/x86/cpu/common.c	Fri Sep 21 15:20:21 2012 +0200
@@ -15,9 +15,6 @@
 
 #include "cpu.h"
 
-static int cachesize_override __cpuinitdata = -1;
-size_param("cachesize", cachesize_override);
-
 static bool_t __cpuinitdata use_xsave = 1;
 boolean_param("xsave", use_xsave);
 
@@ -120,17 +117,6 @@ void __cpuinit display_cacheinfo(struct 
 	ecx = cpuid_ecx(0x80000006);
 	l2size = ecx >> 16;
 	
-	/* do processor-specific cache resizing */
-	if (this_cpu->c_size_cache)
-		l2size = this_cpu->c_size_cache(c,l2size);
-
-	/* Allow user to override all this if necessary. */
-	if (cachesize_override != -1)
-		l2size = cachesize_override;
-
-	if ( l2size == 0 )
-		return;		/* Again, no L2 cache is possible */
-
 	c->x86_cache_size = l2size;
 
 	if (opt_cpu_info)
@@ -138,32 +124,6 @@ void __cpuinit display_cacheinfo(struct 
 		       l2size, ecx & 0xFF);
 }
 
-/* Naming convention should be: <Name> [(<Codename>)] */
-/* This table only is used unless init_<vendor>() below doesn't set it; */
-/* in particular, if CPUID levels 0x80000002..4 are supported, this isn't used */
-
-/* Look up CPU names by table lookup. */
-static char __cpuinit *table_lookup_model(struct cpuinfo_x86 *c)
-{
-	struct cpu_model_info *info;
-
-	if ( c->x86_model >= 16 )
-		return NULL;	/* Range check */
-
-	if (!this_cpu)
-		return NULL;
-
-	info = this_cpu->c_models;
-
-	while (info && info->family) {
-		if (info->family == c->x86)
-			return info->model_names[c->x86_model];
-		info++;
-	}
-	return NULL;		/* Not found */
-}
-
-
 static void __cpuinit get_cpu_vendor(struct cpuinfo_x86 *c, int early)
 {
 	char *v = c->x86_vendor_id;
@@ -356,14 +316,9 @@ void __cpuinit identify_cpu(struct cpuin
 
 	/* If the model name is still unset, do table lookup. */
 	if ( !c->x86_model_id[0] ) {
-		char *p;
-		p = table_lookup_model(c);
-		if ( p )
-			safe_strcpy(c->x86_model_id, p);
-		else
-			/* Last resort... */
-			snprintf(c->x86_model_id, sizeof(c->x86_model_id),
-				"%02x/%02x", c->x86_vendor, c->x86_model);
+		/* Last resort... */
+		snprintf(c->x86_model_id, sizeof(c->x86_model_id),
+			"%02x/%02x", c->x86_vendor, c->x86_model);
 	}
 
 	/* Now the feature flags better reflect actual CPU features! */
diff -r c8873f13cec3 -r 32187301ecc5 xen/arch/x86/cpu/cpu.h
--- a/xen/arch/x86/cpu/cpu.h	Fri Sep 21 14:25:12 2012 +0200
+++ b/xen/arch/x86/cpu/cpu.h	Fri Sep 21 15:20:21 2012 +0200
@@ -1,10 +1,3 @@
-
-struct cpu_model_info {
-	int vendor;
-	int family;
-	char *model_names[16];
-};
-
 /* attempt to consolidate cpu attributes */
 struct cpu_dev {
 	char	* c_vendor;
@@ -12,11 +5,8 @@ struct cpu_dev {
 	/* some have two possibilities for cpuid string */
 	char	* c_ident[2];	
 
-	struct		cpu_model_info c_models[4];
-
 	void		(*c_init)(struct cpuinfo_x86 * c);
 	void		(*c_identify)(struct cpuinfo_x86 * c);
-	unsigned int	(*c_size_cache)(struct cpuinfo_x86 * c, unsigned int size);
 };
 
 extern struct cpu_dev * cpu_devs [X86_VENDOR_NUM];
diff -r c8873f13cec3 -r 32187301ecc5 xen/arch/x86/cpu/intel.c
--- a/xen/arch/x86/cpu/intel.c	Fri Sep 21 14:25:12 2012 +0200
+++ b/xen/arch/x86/cpu/intel.c	Fri Sep 21 15:20:21 2012 +0200
@@ -292,49 +292,10 @@ static void __devinit init_intel(struct 
 		set_bit(X86_FEATURE_ARAT, c->x86_capability);
 }
 
-
-static unsigned int intel_size_cache(struct cpuinfo_x86 * c, unsigned int size)
-{
-	/* Intel PIII Tualatin. This comes in two flavours.
-	 * One has 256kb of cache, the other 512. We have no way
-	 * to determine which, so we use a boottime override
-	 * for the 512kb model, and assume 256 otherwise.
-	 */
-	if ((c->x86 == 6) && (c->x86_model == 11) && (size == 0))
-		size = 256;
-	return size;
-}
-
 static struct cpu_dev intel_cpu_dev __cpuinitdata = {
 	.c_vendor	= "Intel",
 	.c_ident 	= { "GenuineIntel" },
-	.c_models = {
-		{ .vendor = X86_VENDOR_INTEL, .family = 6, .model_names =
-		  { 
-			  [0] = "Pentium Pro A-step",
-			  [1] = "Pentium Pro", 
-			  [3] = "Pentium II (Klamath)", 
-			  [4] = "Pentium II (Deschutes)", 
-			  [5] = "Pentium II (Deschutes)", 
-			  [6] = "Mobile Pentium II",
-			  [7] = "Pentium III (Katmai)", 
-			  [8] = "Pentium III (Coppermine)", 
-			  [10] = "Pentium III (Cascades)",
-			  [11] = "Pentium III (Tualatin)",
-		  }
-		},
-		{ .vendor = X86_VENDOR_INTEL, .family = 15, .model_names =
-		  {
-			  [0] = "Pentium 4 (Unknown)",
-			  [1] = "Pentium 4 (Willamette)",
-			  [2] = "Pentium 4 (Northwood)",
-			  [4] = "Pentium 4 (Foster)",
-			  [5] = "Pentium 4 (Foster)",
-		  }
-		},
-	},
 	.c_init		= init_intel,
-	.c_size_cache	= intel_size_cache,
 };
 
 int __init intel_cpu_init(void)

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22:33:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1THMdu-00081c-K8; Thu, 27 Sep 2012 22:33: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 1THMdt-00081H-Le
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:13 +0000
Received: from [85.158.137.99:33526] by server-3.bemta-3.messagelabs.com id
	DA/D5-25962-824D4605; Thu, 27 Sep 2012 22:33:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-217.messagelabs.com!1348785191!19302067!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24671 invoked from network); 27 Sep 2012 22:33:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Sep 2012 22: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 1THMdq-0007H5-Oy
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdq-0003n9-Hz
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:10 +0000
Message-Id: <E1THMdq-0003n9-Hz@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: eliminate code affecting only
	64-bit-incapable CPUs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348233621 -7200
# Node ID 32187301ecc57f06fe659779c2b781a6ebde1101
# Parent  c8873f13cec3246a5e78939588e60fd930a3abb3
x86: eliminate code affecting only 64-bit-incapable CPUs

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


diff -r c8873f13cec3 -r 32187301ecc5 xen/arch/x86/cpu/common.c
--- a/xen/arch/x86/cpu/common.c	Fri Sep 21 14:25:12 2012 +0200
+++ b/xen/arch/x86/cpu/common.c	Fri Sep 21 15:20:21 2012 +0200
@@ -15,9 +15,6 @@
 
 #include "cpu.h"
 
-static int cachesize_override __cpuinitdata = -1;
-size_param("cachesize", cachesize_override);
-
 static bool_t __cpuinitdata use_xsave = 1;
 boolean_param("xsave", use_xsave);
 
@@ -120,17 +117,6 @@ void __cpuinit display_cacheinfo(struct 
 	ecx = cpuid_ecx(0x80000006);
 	l2size = ecx >> 16;
 	
-	/* do processor-specific cache resizing */
-	if (this_cpu->c_size_cache)
-		l2size = this_cpu->c_size_cache(c,l2size);
-
-	/* Allow user to override all this if necessary. */
-	if (cachesize_override != -1)
-		l2size = cachesize_override;
-
-	if ( l2size == 0 )
-		return;		/* Again, no L2 cache is possible */
-
 	c->x86_cache_size = l2size;
 
 	if (opt_cpu_info)
@@ -138,32 +124,6 @@ void __cpuinit display_cacheinfo(struct 
 		       l2size, ecx & 0xFF);
 }
 
-/* Naming convention should be: <Name> [(<Codename>)] */
-/* This table only is used unless init_<vendor>() below doesn't set it; */
-/* in particular, if CPUID levels 0x80000002..4 are supported, this isn't used */
-
-/* Look up CPU names by table lookup. */
-static char __cpuinit *table_lookup_model(struct cpuinfo_x86 *c)
-{
-	struct cpu_model_info *info;
-
-	if ( c->x86_model >= 16 )
-		return NULL;	/* Range check */
-
-	if (!this_cpu)
-		return NULL;
-
-	info = this_cpu->c_models;
-
-	while (info && info->family) {
-		if (info->family == c->x86)
-			return info->model_names[c->x86_model];
-		info++;
-	}
-	return NULL;		/* Not found */
-}
-
-
 static void __cpuinit get_cpu_vendor(struct cpuinfo_x86 *c, int early)
 {
 	char *v = c->x86_vendor_id;
@@ -356,14 +316,9 @@ void __cpuinit identify_cpu(struct cpuin
 
 	/* If the model name is still unset, do table lookup. */
 	if ( !c->x86_model_id[0] ) {
-		char *p;
-		p = table_lookup_model(c);
-		if ( p )
-			safe_strcpy(c->x86_model_id, p);
-		else
-			/* Last resort... */
-			snprintf(c->x86_model_id, sizeof(c->x86_model_id),
-				"%02x/%02x", c->x86_vendor, c->x86_model);
+		/* Last resort... */
+		snprintf(c->x86_model_id, sizeof(c->x86_model_id),
+			"%02x/%02x", c->x86_vendor, c->x86_model);
 	}
 
 	/* Now the feature flags better reflect actual CPU features! */
diff -r c8873f13cec3 -r 32187301ecc5 xen/arch/x86/cpu/cpu.h
--- a/xen/arch/x86/cpu/cpu.h	Fri Sep 21 14:25:12 2012 +0200
+++ b/xen/arch/x86/cpu/cpu.h	Fri Sep 21 15:20:21 2012 +0200
@@ -1,10 +1,3 @@
-
-struct cpu_model_info {
-	int vendor;
-	int family;
-	char *model_names[16];
-};
-
 /* attempt to consolidate cpu attributes */
 struct cpu_dev {
 	char	* c_vendor;
@@ -12,11 +5,8 @@ struct cpu_dev {
 	/* some have two possibilities for cpuid string */
 	char	* c_ident[2];	
 
-	struct		cpu_model_info c_models[4];
-
 	void		(*c_init)(struct cpuinfo_x86 * c);
 	void		(*c_identify)(struct cpuinfo_x86 * c);
-	unsigned int	(*c_size_cache)(struct cpuinfo_x86 * c, unsigned int size);
 };
 
 extern struct cpu_dev * cpu_devs [X86_VENDOR_NUM];
diff -r c8873f13cec3 -r 32187301ecc5 xen/arch/x86/cpu/intel.c
--- a/xen/arch/x86/cpu/intel.c	Fri Sep 21 14:25:12 2012 +0200
+++ b/xen/arch/x86/cpu/intel.c	Fri Sep 21 15:20:21 2012 +0200
@@ -292,49 +292,10 @@ static void __devinit init_intel(struct 
 		set_bit(X86_FEATURE_ARAT, c->x86_capability);
 }
 
-
-static unsigned int intel_size_cache(struct cpuinfo_x86 * c, unsigned int size)
-{
-	/* Intel PIII Tualatin. This comes in two flavours.
-	 * One has 256kb of cache, the other 512. We have no way
-	 * to determine which, so we use a boottime override
-	 * for the 512kb model, and assume 256 otherwise.
-	 */
-	if ((c->x86 == 6) && (c->x86_model == 11) && (size == 0))
-		size = 256;
-	return size;
-}
-
 static struct cpu_dev intel_cpu_dev __cpuinitdata = {
 	.c_vendor	= "Intel",
 	.c_ident 	= { "GenuineIntel" },
-	.c_models = {
-		{ .vendor = X86_VENDOR_INTEL, .family = 6, .model_names =
-		  { 
-			  [0] = "Pentium Pro A-step",
-			  [1] = "Pentium Pro", 
-			  [3] = "Pentium II (Klamath)", 
-			  [4] = "Pentium II (Deschutes)", 
-			  [5] = "Pentium II (Deschutes)", 
-			  [6] = "Mobile Pentium II",
-			  [7] = "Pentium III (Katmai)", 
-			  [8] = "Pentium III (Coppermine)", 
-			  [10] = "Pentium III (Cascades)",
-			  [11] = "Pentium III (Tualatin)",
-		  }
-		},
-		{ .vendor = X86_VENDOR_INTEL, .family = 15, .model_names =
-		  {
-			  [0] = "Pentium 4 (Unknown)",
-			  [1] = "Pentium 4 (Willamette)",
-			  [2] = "Pentium 4 (Northwood)",
-			  [4] = "Pentium 4 (Foster)",
-			  [5] = "Pentium 4 (Foster)",
-		  }
-		},
-	},
 	.c_init		= init_intel,
-	.c_size_cache	= intel_size_cache,
 };
 
 int __init intel_cpu_init(void)

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22:33:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1THMdu-00081T-Hd; Thu, 27 Sep 2012 22:33:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdt-00081G-31
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:13 +0000
Received: from [85.158.139.83:23483] by server-13.bemta-5.messagelabs.com id
	73/C1-16359-824D4605; Thu, 27 Sep 2012 22:33:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1348785189!28502941!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6393 invoked from network); 27 Sep 2012 22:33:10 -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;
	27 Sep 2012 22: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 1THMdp-0007Gy-HI
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdp-0003me-6G
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:09 +0000
Message-Id: <E1THMdp-0003me-6G@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: introduce MWAIT-based,
	ACPI-less CPU idle driver
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348228038 -7200
# Node ID 1e6e6b49b4ac318cb86f413be680fe182e4d9511
# Parent  8eab91903e710d344d2cee20434ee6407644ad5e
x86: introduce MWAIT-based, ACPI-less CPU idle driver

This is a port of Linux'es intel-idle driver serving the same purpose.

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


diff -r 8eab91903e71 -r 1e6e6b49b4ac docs/misc/xen-command-line.markdown
--- a/docs/misc/xen-command-line.markdown	Fri Sep 21 13:45:08 2012 +0200
+++ b/docs/misc/xen-command-line.markdown	Fri Sep 21 13:47:18 2012 +0200
@@ -620,6 +620,14 @@ limit is ignored by Xen.
 
 Specify if the MMConfig space should be enabled.
 
+### mwait-idle
+> `= <boolean>`
+
+> Default: `true`
+
+Use the MWAIT idle driver (with model specific C-state knowledge) instead
+of the ACPI based one.
+
 ### nmi
 > `= ignore | dom0 | fatal`
 
diff -r 8eab91903e71 -r 1e6e6b49b4ac xen/arch/x86/acpi/cpu_idle.c
--- a/xen/arch/x86/acpi/cpu_idle.c	Fri Sep 21 13:45:08 2012 +0200
+++ b/xen/arch/x86/acpi/cpu_idle.c	Fri Sep 21 13:47:18 2012 +0200
@@ -39,7 +39,6 @@
 #include <xen/smp.h>
 #include <xen/guest_access.h>
 #include <xen/keyhandler.h>
-#include <xen/cpuidle.h>
 #include <xen/trace.h>
 #include <xen/sched-if.h>
 #include <xen/irq.h>
@@ -54,6 +53,8 @@
 #include <public/sysctl.h>
 #include <acpi/cpufreq/cpufreq.h>
 #include <asm/apic.h>
+#include <asm/cpuidle.h>
+#include <asm/mwait.h>
 #include <xen/notifier.h>
 #include <xen/cpu.h>
 
@@ -70,18 +71,18 @@
 #define GET_CC7_RES(val)  GET_HW_RES_IN_NS(0x3FE, val) /* SNB only */
 
 static void lapic_timer_nop(void) { }
-static void (*lapic_timer_off)(void);
-static void (*lapic_timer_on)(void);
+void (*__read_mostly lapic_timer_off)(void);
+void (*__read_mostly lapic_timer_on)(void);
 
 static uint64_t (*__read_mostly tick_to_ns)(uint64_t) = acpi_pm_tick_to_ns;
 
-static void (*pm_idle_save) (void) __read_mostly;
+void (*__read_mostly pm_idle_save)(void);
 unsigned int max_cstate __read_mostly = ACPI_PROCESSOR_MAX_POWER - 1;
 integer_param("max_cstate", max_cstate);
 static bool_t __read_mostly local_apic_timer_c2_ok;
 boolean_param("lapic_timer_c2_ok", local_apic_timer_c2_ok);
 
-static struct acpi_processor_power *__read_mostly processor_powers[NR_CPUS];
+struct acpi_processor_power *__read_mostly processor_powers[NR_CPUS];
 
 struct hw_residencies
 {
@@ -236,12 +237,10 @@ static uint64_t acpi_pm_ticks_elapsed(ui
         return ((0xFFFFFFFF - t1) + t2 +1);
 }
 
-static uint64_t (*__read_mostly get_tick)(void) = get_acpi_pm_tick;
+uint64_t (*__read_mostly cpuidle_get_tick)(void) = get_acpi_pm_tick;
 static uint64_t (*__read_mostly ticks_elapsed)(uint64_t, uint64_t)
     = acpi_pm_ticks_elapsed;
 
-#define MWAIT_ECX_INTERRUPT_BREAK   (0x1)
-
 /*
  * The bit is set iff cpu use monitor/mwait to enter C state
  * with this flag set, CPU can be waken up from C state
@@ -263,7 +262,7 @@ void cpuidle_wakeup_mwait(cpumask_t *mas
     cpumask_andnot(mask, mask, &target);
 }
 
-static void mwait_idle_with_hints(unsigned long eax, unsigned long ecx)
+void mwait_idle_with_hints(unsigned int eax, unsigned int ecx)
 {
     unsigned int cpu = smp_processor_id();
     s_time_t expires = per_cpu(timer_deadline, cpu);
@@ -334,7 +333,7 @@ static struct {
     unsigned int count;
 } c3_cpu_status = { .lock = SPIN_LOCK_UNLOCKED };
 
-static inline void trace_exit_reason(u32 *irq_traced)
+void trace_exit_reason(u32 *irq_traced)
 {
     if ( unlikely(tb_init_done) )
     {
@@ -354,15 +353,6 @@ static inline void trace_exit_reason(u32
     }
 }
 
-/* vcpu is urgent if vcpu is polling event channel
- *
- * if urgent vcpu exists, CPU should not enter deep C state
- */
-static int sched_has_urgent_vcpu(void)
-{
-    return atomic_read(&this_cpu(schedule_data).urgent_count);
-}
-
 /*
  * "AAJ72. EOI Transaction May Not be Sent if Software Enters Core C6 During 
  * an Interrupt Service Routine"
@@ -388,10 +378,11 @@ bool_t errata_c6_eoi_workaround(void)
     return (fix_needed && cpu_has_pending_apic_eoi());
 }
 
-static inline void acpi_update_idle_stats(struct acpi_processor_power *power,
-                                          struct acpi_processor_cx *cx,
-                                          int64_t sleep_ticks)
+void update_idle_stats(struct acpi_processor_power *power,
+                       struct acpi_processor_cx *cx,
+                       uint64_t before, uint64_t after)
 {
+    int64_t sleep_ticks = ticks_elapsed(before, after);
     /* Interrupts are disabled */
 
     spin_lock(&power->stat_lock);
@@ -472,19 +463,19 @@ static void acpi_processor_idle(void)
         if ( cx->type == ACPI_STATE_C1 || local_apic_timer_c2_ok )
         {
             /* Get start time (ticks) */
-            t1 = get_tick();
+            t1 = cpuidle_get_tick();
             /* Trace cpu idle entry */
             TRACE_4D(TRC_PM_IDLE_ENTRY, cx->idx, t1, exp, pred);
             /* Invoke C2 */
             acpi_idle_do_entry(cx);
             /* Get end time (ticks) */
-            t2 = get_tick();
+            t2 = cpuidle_get_tick();
             trace_exit_reason(irq_traced);
             /* Trace cpu idle exit */
             TRACE_6D(TRC_PM_IDLE_EXIT, cx->idx, t2,
                      irq_traced[0], irq_traced[1], irq_traced[2], irq_traced[3]);
             /* Update statistics */
-            acpi_update_idle_stats(power, cx, ticks_elapsed(t1, t2));
+            update_idle_stats(power, cx, t1, t2);
             /* Re-enable interrupts */
             local_irq_enable();
             break;
@@ -500,7 +491,7 @@ static void acpi_processor_idle(void)
         lapic_timer_off();
 
         /* Get start time (ticks) */
-        t1 = get_tick();
+        t1 = cpuidle_get_tick();
         /* Trace cpu idle entry */
         TRACE_4D(TRC_PM_IDLE_ENTRY, cx->idx, t1, exp, pred);
 
@@ -549,7 +540,7 @@ static void acpi_processor_idle(void)
         }
 
         /* Get end time (ticks) */
-        t2 = get_tick();
+        t2 = cpuidle_get_tick();
 
         /* recovering TSC */
         cstate_restore_tsc();
@@ -559,7 +550,7 @@ static void acpi_processor_idle(void)
                  irq_traced[0], irq_traced[1], irq_traced[2], irq_traced[3]);
 
         /* Update statistics */
-        acpi_update_idle_stats(power, cx, ticks_elapsed(t1, t2));
+        update_idle_stats(power, cx, t1, t2);
         /* Re-enable interrupts */
         local_irq_enable();
         /* recovering APIC */
@@ -586,7 +577,7 @@ static void acpi_processor_idle(void)
         cpuidle_current_governor->reflect(power);
 }
 
-static void acpi_dead_idle(void)
+void acpi_dead_idle(void)
 {
     struct acpi_processor_power *power;
     struct acpi_processor_cx *cx;
@@ -649,7 +640,7 @@ default_halt:
         halt();
 }
 
-static int cpuidle_init_cpu(int cpu)
+int cpuidle_init_cpu(unsigned int cpu)
 {
     struct acpi_processor_power *acpi_power;
 
@@ -660,7 +651,7 @@ static int cpuidle_init_cpu(int cpu)
 
         if ( cpu == 0 && boot_cpu_has(X86_FEATURE_NONSTOP_TSC) )
         {
-            get_tick = get_stime_tick;
+            cpuidle_get_tick = get_stime_tick;
             ticks_elapsed = stime_ticks_elapsed;
             tick_to_ns = stime_tick_to_ns;
         }
@@ -685,9 +676,6 @@ static int cpuidle_init_cpu(int cpu)
     return 0;
 }
 
-#define MWAIT_SUBSTATE_MASK (0xf)
-#define MWAIT_SUBSTATE_SIZE (4)
-
 static int acpi_processor_ffh_cstate_probe(xen_processor_cx_t *cx)
 {
     struct cpuinfo_x86 *c = &current_cpu_data;
@@ -1026,6 +1014,9 @@ long set_cx_pminfo(uint32_t cpu, struct 
     if ( unlikely(!guest_handle_okay(power->states, power->count)) )
         return -EFAULT;
 
+    if ( pm_idle_save && pm_idle != acpi_processor_idle )
+        return 0;
+
     print_cx_pminfo(cpu, power);
 
     /* map from acpi_id to cpu_id */
@@ -1195,7 +1186,12 @@ static struct notifier_block cpu_nfb = {
 static int __init cpuidle_presmp_init(void)
 {
     void *cpu = (void *)(long)smp_processor_id();
-    cpu_callback(&cpu_nfb, CPU_ONLINE, cpu);
+
+    if ( !xen_cpuidle )
+        return 0;
+
+    mwait_idle_init(&cpu_nfb);
+    cpu_nfb.notifier_call(&cpu_nfb, CPU_ONLINE, cpu);
     register_cpu_notifier(&cpu_nfb);
     return 0;
 }
diff -r 8eab91903e71 -r 1e6e6b49b4ac xen/arch/x86/cpu/Makefile
--- a/xen/arch/x86/cpu/Makefile	Fri Sep 21 13:45:08 2012 +0200
+++ b/xen/arch/x86/cpu/Makefile	Fri Sep 21 13:47:18 2012 +0200
@@ -5,6 +5,7 @@ obj-y += amd.o
 obj-y += common.o
 obj-y += intel.o
 obj-y += intel_cacheinfo.o
+obj-y += mwait-idle.o
 
 # Keeping around for VIA support (JBeulich)
 # obj-$(x86_32) += centaur.o
diff -r 8eab91903e71 -r 1e6e6b49b4ac xen/arch/x86/cpu/mwait-idle.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/x86/cpu/mwait-idle.c	Fri Sep 21 13:47:18 2012 +0200
@@ -0,0 +1,513 @@
+/*
+ * mwait_idle.c - native hardware idle loop for modern processors
+ *
+ * Copyright (c) 2010, Intel Corporation.
+ * Len Brown <len.brown@intel.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope 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.,
+ * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+/*
+ * mwait_idle is a cpuidle driver that loads on specific processors
+ * in lieu of the legacy ACPI processor_idle driver.  The intent is to
+ * make Linux more efficient on these processors, as mwait_idle knows
+ * more than ACPI, as well as make Linux more immune to ACPI BIOS bugs.
+ */
+
+/*
+ * Design Assumptions
+ *
+ * All CPUs have same idle states as boot CPU
+ *
+ * Chipset BM_STS (bus master status) bit is a NOP
+ *	for preventing entry into deep C-states
+ */
+
+/*
+ * Known limitations
+ *
+ * The driver currently initializes for_each_online_cpu() upon load.
+ * It it unaware of subsequent processors hot-added to the system.
+ * This means that if you boot with maxcpus=n and later online
+ * processors above n, those processors will use C1 only.
+ *
+ * ACPI has a .suspend hack to turn off deep C-states during suspend
+ * to avoid complications with the lapic timer workaround.
+ * Have not seen issues with suspend, but may need same workaround here.
+ */
+
+/* un-comment DEBUG to enable pr_debug() statements */
+#define DEBUG
+
+#include <xen/lib.h>
+#include <xen/cpu.h>
+#include <xen/init.h>
+#include <xen/softirq.h>
+#include <xen/trace.h>
+#include <asm/cpuidle.h>
+#include <asm/mwait.h>
+#include <asm/msr.h>
+#include <acpi/cpufreq/cpufreq.h>
+
+#define MWAIT_IDLE_VERSION "0.4"
+#undef PREFIX
+#define PREFIX "mwait-idle: "
+
+#ifdef DEBUG
+# define pr_debug(fmt...) printk(KERN_DEBUG fmt)
+#else
+# define pr_debug(fmt...)
+#endif
+
+static __initdata bool_t no_mwait_idle;
+invbool_param("mwait-idle", no_mwait_idle);
+
+static unsigned int mwait_substates;
+
+#define LAPIC_TIMER_ALWAYS_RELIABLE 0xFFFFFFFF
+/* Reliable LAPIC Timer States, bit 1 for C1 etc. Default to only C1. */
+static unsigned int lapic_timer_reliable_states = (1 << 1);
+
+struct idle_cpu {
+	const struct cpuidle_state *state_table;
+
+	/*
+	 * Hardware C-state auto-demotion may not always be optimal.
+	 * Indicate which enable bits to clear here.
+	 */
+	unsigned long auto_demotion_disable_flags;
+};
+
+static const struct idle_cpu *icpu;
+
+static const struct cpuidle_state {
+	char		name[16];
+	unsigned int	flags;
+	unsigned int	exit_latency; /* in US */
+	int		power_usage; /* in mW */
+	unsigned int	target_residency; /* in US */
+} *cpuidle_state_table;
+
+/*
+ * Set this flag for states where the HW flushes the TLB for us
+ * and so we don't need cross-calls to keep it consistent.
+ * If this flag is set, SW flushes the TLB, so even if the
+ * HW doesn't do the flushing, this flag is safe to use.
+ */
+#define CPUIDLE_FLAG_TLB_FLUSHED	0x10000
+
+/*
+ * States are indexed by the cstate number,
+ * which is also the index into the MWAIT hint array.
+ * Thus C0 is a dummy.
+ */
+static const struct cpuidle_state nehalem_cstates[MWAIT_MAX_NUM_CSTATES] = {
+	{ /* MWAIT C0 */ },
+	{ /* MWAIT C1 */
+		.name = "C1-NHM",
+		.exit_latency = 3,
+		.target_residency = 6,
+	},
+	{ /* MWAIT C2 */
+		.name = "C3-NHM",
+		.flags = CPUIDLE_FLAG_TLB_FLUSHED,
+		.exit_latency = 20,
+		.target_residency = 80,
+	},
+	{ /* MWAIT C3 */
+		.name = "C6-NHM",
+		.flags = CPUIDLE_FLAG_TLB_FLUSHED,
+		.exit_latency = 200,
+		.target_residency = 800,
+	}
+};
+
+static const struct cpuidle_state snb_cstates[MWAIT_MAX_NUM_CSTATES] = {
+	{ /* MWAIT C0 */ },
+	{ /* MWAIT C1 */
+		.name = "C1-SNB",
+		.exit_latency = 1,
+		.target_residency = 1,
+	},
+	{ /* MWAIT C2 */
+		.name = "C3-SNB",
+		.flags = CPUIDLE_FLAG_TLB_FLUSHED,
+		.exit_latency = 80,
+		.target_residency = 211,
+	},
+	{ /* MWAIT C3 */
+		.name = "C6-SNB",
+		.flags = CPUIDLE_FLAG_TLB_FLUSHED,
+		.exit_latency = 104,
+		.target_residency = 345,
+	},
+	{ /* MWAIT C4 */
+		.name = "C7-SNB",
+		.flags = CPUIDLE_FLAG_TLB_FLUSHED,
+		.exit_latency = 109,
+		.target_residency = 345,
+	}
+};
+
+static const struct cpuidle_state ivb_cstates[MWAIT_MAX_NUM_CSTATES] = {
+	{ /* MWAIT C0 */ },
+	{ /* MWAIT C1 */
+		.name = "C1-IVB",
+		.exit_latency = 1,
+		.target_residency = 1,
+	},
+	{ /* MWAIT C2 */
+		.name = "C3-IVB",
+		.flags = CPUIDLE_FLAG_TLB_FLUSHED,
+		.exit_latency = 59,
+		.target_residency = 156,
+	},
+	{ /* MWAIT C3 */
+		.name = "C6-IVB",
+		.flags = CPUIDLE_FLAG_TLB_FLUSHED,
+		.exit_latency = 80,
+		.target_residency = 300,
+	},
+	{ /* MWAIT C4 */
+		.name = "C7-IVB",
+		.flags = CPUIDLE_FLAG_TLB_FLUSHED,
+		.exit_latency = 87,
+		.target_residency = 300,
+	}
+};
+
+static const struct cpuidle_state atom_cstates[MWAIT_MAX_NUM_CSTATES] = {
+	{ /* MWAIT C0 */ },
+	{ /* MWAIT C1 */
+		.name = "C1-ATM",
+		.exit_latency = 1,
+		.target_residency = 4,
+	},
+	{ /* MWAIT C2 */
+		.name = "C2-ATM",
+		.exit_latency = 20,
+		.target_residency = 80,
+	},
+	{ /* MWAIT C3 */ },
+	{ /* MWAIT C4 */
+		.name = "C4-ATM",
+		.flags = CPUIDLE_FLAG_TLB_FLUSHED,
+		.exit_latency = 100,
+		.target_residency = 400,
+	},
+	{ /* MWAIT C5 */ },
+	{ /* MWAIT C6 */
+		.name = "C6-ATM",
+		.flags = CPUIDLE_FLAG_TLB_FLUSHED,
+		.exit_latency = 140,
+		.target_residency = 560,
+	}
+};
+
+static u32 get_driver_data(unsigned int cstate)
+{
+	static const u32 driver_data[] = {
+		[1] /* MWAIT C1 */ = 0x00,
+		[2] /* MWAIT C2 */ = 0x10,
+		[3] /* MWAIT C3 */ = 0x20,
+		[4] /* MWAIT C4 */ = 0x30,
+		[5] /* MWAIT C5 */ = 0x40,
+		[6] /* MWAIT C6 */ = 0x52,
+	};
+
+	return driver_data[cstate < ARRAY_SIZE(driver_data) ? cstate : 0];
+}
+
+static void mwait_idle(void)
+{
+	unsigned int cpu = smp_processor_id();
+	struct acpi_processor_power *power = processor_powers[cpu];
+	struct acpi_processor_cx *cx = NULL;
+	unsigned int eax, next_state, cstate;
+	u64 before, after;
+	u32 exp = 0, pred = 0, irq_traced[4] = { 0 };
+
+	if (max_cstate > 0 && power && !sched_has_urgent_vcpu() &&
+	    (next_state = cpuidle_current_governor->select(power)) > 0) {
+		do {
+			cx = &power->states[next_state];
+		} while (cx->type > max_cstate && --next_state);
+		if (!next_state)
+			cx = NULL;
+		menu_get_trace_data(&exp, &pred);
+	}
+	if (!cx) {
+		if (pm_idle_save)
+			pm_idle_save();
+		else
+			safe_halt();
+		return;
+	}
+
+	cpufreq_dbs_timer_suspend();
+
+	sched_tick_suspend();
+	/* sched_tick_suspend() can raise TIMER_SOFTIRQ. Process it now. */
+	process_pending_softirqs();
+
+	/* Interrupts must be disabled for C2 and higher transitions. */
+	local_irq_disable();
+
+	if (!cpu_is_haltable(cpu)) {
+		local_irq_enable();
+		sched_tick_resume();
+		cpufreq_dbs_timer_resume();
+		return;
+	}
+
+	power->last_state = cx;
+	eax = cx->address;
+	cstate = ((eax >> MWAIT_SUBSTATE_SIZE) & MWAIT_CSTATE_MASK) + 1;
+
+#if 0 /* XXX Can we/do we need to do something similar on Xen? */
+	/*
+	 * leave_mm() to avoid costly and often unnecessary wakeups
+	 * for flushing the user TLB's associated with the active mm.
+	 */
+	if (cpuidle_state_table[].flags & CPUIDLE_FLAG_TLB_FLUSHED)
+		leave_mm(cpu);
+#endif
+
+	if (!(lapic_timer_reliable_states & (1 << cstate)))
+		lapic_timer_off();
+
+	before = cpuidle_get_tick();
+	TRACE_4D(TRC_PM_IDLE_ENTRY, cx->idx, before, exp, pred);
+
+	if (cpu_is_haltable(cpu))
+		mwait_idle_with_hints(eax, MWAIT_ECX_INTERRUPT_BREAK);
+
+	after = cpuidle_get_tick();
+
+	cstate_restore_tsc();
+	trace_exit_reason(irq_traced);
+	TRACE_6D(TRC_PM_IDLE_EXIT, cx->idx, after,
+		irq_traced[0], irq_traced[1], irq_traced[2], irq_traced[3]);
+
+	update_idle_stats(power, cx, before, after);
+	local_irq_enable();
+
+	if (!(lapic_timer_reliable_states & (1 << cstate)))
+		lapic_timer_on();
+
+	/* Now back in C0. */
+	power->last_state = &power->states[0];
+
+	sched_tick_resume();
+	cpufreq_dbs_timer_resume();
+
+	if ( cpuidle_current_governor->reflect )
+		cpuidle_current_governor->reflect(power);
+}
+
+static void auto_demotion_disable(void *dummy)
+{
+	u64 msr_bits;
+
+	rdmsrl(MSR_NHM_SNB_PKG_CST_CFG_CTL, msr_bits);
+	msr_bits &= ~(icpu->auto_demotion_disable_flags);
+	wrmsrl(MSR_NHM_SNB_PKG_CST_CFG_CTL, msr_bits);
+}
+
+static const struct idle_cpu idle_cpu_nehalem = {
+	.state_table = nehalem_cstates,
+	.auto_demotion_disable_flags = NHM_C1_AUTO_DEMOTE | NHM_C3_AUTO_DEMOTE,
+};
+
+static const struct idle_cpu idle_cpu_atom = {
+	.state_table = atom_cstates,
+};
+
+static const struct idle_cpu idle_cpu_lincroft = {
+	.state_table = atom_cstates,
+	.auto_demotion_disable_flags = ATM_LNC_C6_AUTO_DEMOTE,
+};
+
+static const struct idle_cpu idle_cpu_snb = {
+	.state_table = snb_cstates,
+};
+
+static const struct idle_cpu idle_cpu_ivb = {
+	.state_table = ivb_cstates,
+};
+
+#define ICPU(model, cpu) { 6, model, &idle_cpu_##cpu }
+
+static struct intel_idle_id {
+	unsigned int family, model;
+	const struct idle_cpu *data;
+} intel_idle_ids[] __initdata = {
+	ICPU(0x1a, nehalem),
+	ICPU(0x1e, nehalem),
+	ICPU(0x1f, nehalem),
+	ICPU(0x25, nehalem),
+	ICPU(0x2c, nehalem),
+	ICPU(0x2e, nehalem),
+	ICPU(0x2f, nehalem),
+	ICPU(0x1c, atom),
+	ICPU(0x26, lincroft),
+	ICPU(0x2a, snb),
+	ICPU(0x2d, snb),
+	ICPU(0x3a, ivb),
+	{}
+};
+
+static int __init mwait_idle_probe(void)
+{
+	unsigned int eax, ebx, ecx;
+	const struct intel_idle_id *id;
+
+	if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL ||
+	    !boot_cpu_has(X86_FEATURE_MWAIT) ||
+	    boot_cpu_data.cpuid_level < CPUID_MWAIT_LEAF)
+		return -ENODEV;
+
+	for (id = intel_idle_ids; id->family; ++id)
+		if (id->family == boot_cpu_data.x86 &&
+		    id->model == boot_cpu_data.x86_model)
+			break;
+	if (!id->family) {
+		pr_debug(PREFIX "does not run on family %d model %d\n",
+			 boot_cpu_data.x86, boot_cpu_data.x86_model);
+		return -ENODEV;
+	}
+
+	cpuid(CPUID_MWAIT_LEAF, &eax, &ebx, &ecx, &mwait_substates);
+
+	if (!(ecx & CPUID5_ECX_EXTENSIONS_SUPPORTED) ||
+	    !(ecx & CPUID5_ECX_INTERRUPT_BREAK) ||
+	    !mwait_substates)
+		return -ENODEV;
+
+	if (!max_cstate || no_mwait_idle) {
+		pr_debug(PREFIX "disabled\n");
+		return -EPERM;
+	}
+
+	pr_debug(PREFIX "MWAIT substates: %#x\n", mwait_substates);
+
+	icpu = id->data;
+	cpuidle_state_table = icpu->state_table;
+
+	if (boot_cpu_has(X86_FEATURE_ARAT))
+		lapic_timer_reliable_states = LAPIC_TIMER_ALWAYS_RELIABLE;
+
+	pr_debug(PREFIX "v" MWAIT_IDLE_VERSION " model %#x\n",
+		 boot_cpu_data.x86_model);
+
+	pr_debug(PREFIX "lapic_timer_reliable_states %#x\n",
+		 lapic_timer_reliable_states);
+	return 0;
+}
+
+static int mwait_idle_cpu_init(struct notifier_block *nfb,
+			       unsigned long action, void *hcpu)
+{
+	unsigned int cpu = (unsigned long)hcpu, cstate;
+	struct acpi_processor_power *dev = processor_powers[cpu];
+
+	switch (action) {
+	default:
+		return NOTIFY_DONE;
+
+	case CPU_UP_PREPARE:
+		cpuidle_init_cpu(cpu);
+		return NOTIFY_DONE;
+
+	case CPU_ONLINE:
+		if (!dev)
+			return NOTIFY_DONE;
+		break;
+	}
+
+	dev->count = 1;
+
+	for (cstate = 1; cstate < MWAIT_MAX_NUM_CSTATES; ++cstate) {
+		unsigned int num_substates;
+		struct acpi_processor_cx *cx;
+
+		if (cstate > max_cstate) {
+			printk(PREFIX "max C-state %u reached\n", max_cstate);
+			break;
+		}
+
+		/* Does the state exist in CPUID.MWAIT? */
+		num_substates = (mwait_substates >> (cstate * 4))
+			& MWAIT_SUBSTATE_MASK;
+		if (!num_substates)
+			continue;
+		/* Is the state not enabled? */
+		if (!cpuidle_state_table[cstate].target_residency) {
+			/* does the driver not know about the state? */
+			if (!pm_idle_save && !*cpuidle_state_table[cstate].name)
+				pr_debug(PREFIX "unaware of family %#x model %#x MWAIT %u\n",
+					 boot_cpu_data.x86,
+					 boot_cpu_data.x86_model, cstate);
+			continue;
+		}
+
+		if (dev->count >= ACPI_PROCESSOR_MAX_POWER) {
+			printk(PREFIX "max C-state count of %u reached\n",
+			       ACPI_PROCESSOR_MAX_POWER);
+			break;
+		}
+
+		if (cstate > 2 && !boot_cpu_has(X86_FEATURE_NONSTOP_TSC)) {
+			if (pm_idle_save)
+				continue;
+			setup_clear_cpu_cap(X86_FEATURE_TSC_RELIABLE);
+		}
+
+		cx = dev->states + dev->count;
+		cx->type = cstate;
+		cx->address = get_driver_data(cstate);
+		cx->entry_method = ACPI_CSTATE_EM_FFH;
+		cx->power = cpuidle_state_table[cstate].power_usage;
+		cx->latency = cpuidle_state_table[cstate].exit_latency;
+		cx->target_residency =
+			cpuidle_state_table[cstate].target_residency;
+
+		dev->count++;
+	}
+
+	if (icpu->auto_demotion_disable_flags)
+		on_selected_cpus(cpumask_of(cpu), auto_demotion_disable, NULL, 1);
+
+	return NOTIFY_DONE;
+}
+
+int __init mwait_idle_init(struct notifier_block *nfb)
+{
+	int err;
+
+	if (pm_idle_save)
+		return -ENODEV;
+
+	err = mwait_idle_probe();
+	if (!err) {
+		nfb->notifier_call = mwait_idle_cpu_init;
+		mwait_idle_cpu_init(nfb, CPU_UP_PREPARE, NULL);
+
+		pm_idle_save = pm_idle;
+		pm_idle = mwait_idle;
+		dead_idle = acpi_dead_idle;
+	}
+
+	return err;
+}
diff -r 8eab91903e71 -r 1e6e6b49b4ac xen/include/asm-x86/cpuidle.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/include/asm-x86/cpuidle.h	Fri Sep 21 13:47:18 2012 +0200
@@ -0,0 +1,35 @@
+#ifndef __ASM_X86_CPUIDLE_H__
+#define __ASM_X86_CPUIDLE_H__
+
+#include <xen/cpuidle.h>
+#include <xen/notifier.h>
+#include <xen/sched.h>
+#include <xen/sched-if.h>
+
+extern struct acpi_processor_power *processor_powers[];
+
+extern void (*pm_idle_save)(void);
+
+extern void (*lapic_timer_off)(void);
+extern void (*lapic_timer_on)(void);
+
+extern uint64_t (*cpuidle_get_tick)(void);
+
+int mwait_idle_init(struct notifier_block *);
+int cpuidle_init_cpu(unsigned int cpu);
+void acpi_dead_idle(void);
+void trace_exit_reason(u32 *irq_traced);
+void update_idle_stats(struct acpi_processor_power *,
+                       struct acpi_processor_cx *, uint64_t, uint64_t);
+
+/*
+ * vcpu is urgent if vcpu is polling event channel
+ *
+ * if urgent vcpu exists, CPU should not enter deep C state
+ */
+static inline int sched_has_urgent_vcpu(void)
+{
+    return atomic_read(&this_cpu(schedule_data).urgent_count);
+}
+
+#endif /* __X86_ASM_CPUIDLE_H__ */
diff -r 8eab91903e71 -r 1e6e6b49b4ac xen/include/asm-x86/msr-index.h
--- a/xen/include/asm-x86/msr-index.h	Fri Sep 21 13:45:08 2012 +0200
+++ b/xen/include/asm-x86/msr-index.h	Fri Sep 21 13:47:18 2012 +0200
@@ -36,6 +36,11 @@
 #define MSR_IA32_PERFCTR1		0x000000c2
 #define MSR_FSB_FREQ			0x000000cd
 
+#define MSR_NHM_SNB_PKG_CST_CFG_CTL	0x000000e2
+#define NHM_C3_AUTO_DEMOTE		(1UL << 25)
+#define NHM_C1_AUTO_DEMOTE		(1UL << 26)
+#define ATM_LNC_C6_AUTO_DEMOTE		(1UL << 25)
+
 #define MSR_MTRRcap			0x000000fe
 #define MSR_IA32_BBL_CR_CTL		0x00000119
 
diff -r 8eab91903e71 -r 1e6e6b49b4ac xen/include/asm-x86/mwait.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/include/asm-x86/mwait.h	Fri Sep 21 13:47:18 2012 +0200
@@ -0,0 +1,17 @@
+#ifndef __ASM_X86_MWAIT_H__
+#define __ASM_X86_MWAIT_H__
+
+#define MWAIT_SUBSTATE_MASK		0xf
+#define MWAIT_CSTATE_MASK		0xf
+#define MWAIT_SUBSTATE_SIZE		4
+#define MWAIT_MAX_NUM_CSTATES		8
+
+#define CPUID_MWAIT_LEAF		5
+#define CPUID5_ECX_EXTENSIONS_SUPPORTED 0x1
+#define CPUID5_ECX_INTERRUPT_BREAK	0x2
+
+#define MWAIT_ECX_INTERRUPT_BREAK	0x1
+
+void mwait_idle_with_hints(unsigned int eax, unsigned int ecx);
+
+#endif /* __ASM_X86_MWAIT_H__ */

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22:33:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1THMdu-00081T-Hd; Thu, 27 Sep 2012 22:33:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdt-00081G-31
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:13 +0000
Received: from [85.158.139.83:23483] by server-13.bemta-5.messagelabs.com id
	73/C1-16359-824D4605; Thu, 27 Sep 2012 22:33:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1348785189!28502941!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6393 invoked from network); 27 Sep 2012 22:33:10 -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;
	27 Sep 2012 22: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 1THMdp-0007Gy-HI
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdp-0003me-6G
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:09 +0000
Message-Id: <E1THMdp-0003me-6G@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: introduce MWAIT-based,
	ACPI-less CPU idle driver
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348228038 -7200
# Node ID 1e6e6b49b4ac318cb86f413be680fe182e4d9511
# Parent  8eab91903e710d344d2cee20434ee6407644ad5e
x86: introduce MWAIT-based, ACPI-less CPU idle driver

This is a port of Linux'es intel-idle driver serving the same purpose.

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


diff -r 8eab91903e71 -r 1e6e6b49b4ac docs/misc/xen-command-line.markdown
--- a/docs/misc/xen-command-line.markdown	Fri Sep 21 13:45:08 2012 +0200
+++ b/docs/misc/xen-command-line.markdown	Fri Sep 21 13:47:18 2012 +0200
@@ -620,6 +620,14 @@ limit is ignored by Xen.
 
 Specify if the MMConfig space should be enabled.
 
+### mwait-idle
+> `= <boolean>`
+
+> Default: `true`
+
+Use the MWAIT idle driver (with model specific C-state knowledge) instead
+of the ACPI based one.
+
 ### nmi
 > `= ignore | dom0 | fatal`
 
diff -r 8eab91903e71 -r 1e6e6b49b4ac xen/arch/x86/acpi/cpu_idle.c
--- a/xen/arch/x86/acpi/cpu_idle.c	Fri Sep 21 13:45:08 2012 +0200
+++ b/xen/arch/x86/acpi/cpu_idle.c	Fri Sep 21 13:47:18 2012 +0200
@@ -39,7 +39,6 @@
 #include <xen/smp.h>
 #include <xen/guest_access.h>
 #include <xen/keyhandler.h>
-#include <xen/cpuidle.h>
 #include <xen/trace.h>
 #include <xen/sched-if.h>
 #include <xen/irq.h>
@@ -54,6 +53,8 @@
 #include <public/sysctl.h>
 #include <acpi/cpufreq/cpufreq.h>
 #include <asm/apic.h>
+#include <asm/cpuidle.h>
+#include <asm/mwait.h>
 #include <xen/notifier.h>
 #include <xen/cpu.h>
 
@@ -70,18 +71,18 @@
 #define GET_CC7_RES(val)  GET_HW_RES_IN_NS(0x3FE, val) /* SNB only */
 
 static void lapic_timer_nop(void) { }
-static void (*lapic_timer_off)(void);
-static void (*lapic_timer_on)(void);
+void (*__read_mostly lapic_timer_off)(void);
+void (*__read_mostly lapic_timer_on)(void);
 
 static uint64_t (*__read_mostly tick_to_ns)(uint64_t) = acpi_pm_tick_to_ns;
 
-static void (*pm_idle_save) (void) __read_mostly;
+void (*__read_mostly pm_idle_save)(void);
 unsigned int max_cstate __read_mostly = ACPI_PROCESSOR_MAX_POWER - 1;
 integer_param("max_cstate", max_cstate);
 static bool_t __read_mostly local_apic_timer_c2_ok;
 boolean_param("lapic_timer_c2_ok", local_apic_timer_c2_ok);
 
-static struct acpi_processor_power *__read_mostly processor_powers[NR_CPUS];
+struct acpi_processor_power *__read_mostly processor_powers[NR_CPUS];
 
 struct hw_residencies
 {
@@ -236,12 +237,10 @@ static uint64_t acpi_pm_ticks_elapsed(ui
         return ((0xFFFFFFFF - t1) + t2 +1);
 }
 
-static uint64_t (*__read_mostly get_tick)(void) = get_acpi_pm_tick;
+uint64_t (*__read_mostly cpuidle_get_tick)(void) = get_acpi_pm_tick;
 static uint64_t (*__read_mostly ticks_elapsed)(uint64_t, uint64_t)
     = acpi_pm_ticks_elapsed;
 
-#define MWAIT_ECX_INTERRUPT_BREAK   (0x1)
-
 /*
  * The bit is set iff cpu use monitor/mwait to enter C state
  * with this flag set, CPU can be waken up from C state
@@ -263,7 +262,7 @@ void cpuidle_wakeup_mwait(cpumask_t *mas
     cpumask_andnot(mask, mask, &target);
 }
 
-static void mwait_idle_with_hints(unsigned long eax, unsigned long ecx)
+void mwait_idle_with_hints(unsigned int eax, unsigned int ecx)
 {
     unsigned int cpu = smp_processor_id();
     s_time_t expires = per_cpu(timer_deadline, cpu);
@@ -334,7 +333,7 @@ static struct {
     unsigned int count;
 } c3_cpu_status = { .lock = SPIN_LOCK_UNLOCKED };
 
-static inline void trace_exit_reason(u32 *irq_traced)
+void trace_exit_reason(u32 *irq_traced)
 {
     if ( unlikely(tb_init_done) )
     {
@@ -354,15 +353,6 @@ static inline void trace_exit_reason(u32
     }
 }
 
-/* vcpu is urgent if vcpu is polling event channel
- *
- * if urgent vcpu exists, CPU should not enter deep C state
- */
-static int sched_has_urgent_vcpu(void)
-{
-    return atomic_read(&this_cpu(schedule_data).urgent_count);
-}
-
 /*
  * "AAJ72. EOI Transaction May Not be Sent if Software Enters Core C6 During 
  * an Interrupt Service Routine"
@@ -388,10 +378,11 @@ bool_t errata_c6_eoi_workaround(void)
     return (fix_needed && cpu_has_pending_apic_eoi());
 }
 
-static inline void acpi_update_idle_stats(struct acpi_processor_power *power,
-                                          struct acpi_processor_cx *cx,
-                                          int64_t sleep_ticks)
+void update_idle_stats(struct acpi_processor_power *power,
+                       struct acpi_processor_cx *cx,
+                       uint64_t before, uint64_t after)
 {
+    int64_t sleep_ticks = ticks_elapsed(before, after);
     /* Interrupts are disabled */
 
     spin_lock(&power->stat_lock);
@@ -472,19 +463,19 @@ static void acpi_processor_idle(void)
         if ( cx->type == ACPI_STATE_C1 || local_apic_timer_c2_ok )
         {
             /* Get start time (ticks) */
-            t1 = get_tick();
+            t1 = cpuidle_get_tick();
             /* Trace cpu idle entry */
             TRACE_4D(TRC_PM_IDLE_ENTRY, cx->idx, t1, exp, pred);
             /* Invoke C2 */
             acpi_idle_do_entry(cx);
             /* Get end time (ticks) */
-            t2 = get_tick();
+            t2 = cpuidle_get_tick();
             trace_exit_reason(irq_traced);
             /* Trace cpu idle exit */
             TRACE_6D(TRC_PM_IDLE_EXIT, cx->idx, t2,
                      irq_traced[0], irq_traced[1], irq_traced[2], irq_traced[3]);
             /* Update statistics */
-            acpi_update_idle_stats(power, cx, ticks_elapsed(t1, t2));
+            update_idle_stats(power, cx, t1, t2);
             /* Re-enable interrupts */
             local_irq_enable();
             break;
@@ -500,7 +491,7 @@ static void acpi_processor_idle(void)
         lapic_timer_off();
 
         /* Get start time (ticks) */
-        t1 = get_tick();
+        t1 = cpuidle_get_tick();
         /* Trace cpu idle entry */
         TRACE_4D(TRC_PM_IDLE_ENTRY, cx->idx, t1, exp, pred);
 
@@ -549,7 +540,7 @@ static void acpi_processor_idle(void)
         }
 
         /* Get end time (ticks) */
-        t2 = get_tick();
+        t2 = cpuidle_get_tick();
 
         /* recovering TSC */
         cstate_restore_tsc();
@@ -559,7 +550,7 @@ static void acpi_processor_idle(void)
                  irq_traced[0], irq_traced[1], irq_traced[2], irq_traced[3]);
 
         /* Update statistics */
-        acpi_update_idle_stats(power, cx, ticks_elapsed(t1, t2));
+        update_idle_stats(power, cx, t1, t2);
         /* Re-enable interrupts */
         local_irq_enable();
         /* recovering APIC */
@@ -586,7 +577,7 @@ static void acpi_processor_idle(void)
         cpuidle_current_governor->reflect(power);
 }
 
-static void acpi_dead_idle(void)
+void acpi_dead_idle(void)
 {
     struct acpi_processor_power *power;
     struct acpi_processor_cx *cx;
@@ -649,7 +640,7 @@ default_halt:
         halt();
 }
 
-static int cpuidle_init_cpu(int cpu)
+int cpuidle_init_cpu(unsigned int cpu)
 {
     struct acpi_processor_power *acpi_power;
 
@@ -660,7 +651,7 @@ static int cpuidle_init_cpu(int cpu)
 
         if ( cpu == 0 && boot_cpu_has(X86_FEATURE_NONSTOP_TSC) )
         {
-            get_tick = get_stime_tick;
+            cpuidle_get_tick = get_stime_tick;
             ticks_elapsed = stime_ticks_elapsed;
             tick_to_ns = stime_tick_to_ns;
         }
@@ -685,9 +676,6 @@ static int cpuidle_init_cpu(int cpu)
     return 0;
 }
 
-#define MWAIT_SUBSTATE_MASK (0xf)
-#define MWAIT_SUBSTATE_SIZE (4)
-
 static int acpi_processor_ffh_cstate_probe(xen_processor_cx_t *cx)
 {
     struct cpuinfo_x86 *c = &current_cpu_data;
@@ -1026,6 +1014,9 @@ long set_cx_pminfo(uint32_t cpu, struct 
     if ( unlikely(!guest_handle_okay(power->states, power->count)) )
         return -EFAULT;
 
+    if ( pm_idle_save && pm_idle != acpi_processor_idle )
+        return 0;
+
     print_cx_pminfo(cpu, power);
 
     /* map from acpi_id to cpu_id */
@@ -1195,7 +1186,12 @@ static struct notifier_block cpu_nfb = {
 static int __init cpuidle_presmp_init(void)
 {
     void *cpu = (void *)(long)smp_processor_id();
-    cpu_callback(&cpu_nfb, CPU_ONLINE, cpu);
+
+    if ( !xen_cpuidle )
+        return 0;
+
+    mwait_idle_init(&cpu_nfb);
+    cpu_nfb.notifier_call(&cpu_nfb, CPU_ONLINE, cpu);
     register_cpu_notifier(&cpu_nfb);
     return 0;
 }
diff -r 8eab91903e71 -r 1e6e6b49b4ac xen/arch/x86/cpu/Makefile
--- a/xen/arch/x86/cpu/Makefile	Fri Sep 21 13:45:08 2012 +0200
+++ b/xen/arch/x86/cpu/Makefile	Fri Sep 21 13:47:18 2012 +0200
@@ -5,6 +5,7 @@ obj-y += amd.o
 obj-y += common.o
 obj-y += intel.o
 obj-y += intel_cacheinfo.o
+obj-y += mwait-idle.o
 
 # Keeping around for VIA support (JBeulich)
 # obj-$(x86_32) += centaur.o
diff -r 8eab91903e71 -r 1e6e6b49b4ac xen/arch/x86/cpu/mwait-idle.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/x86/cpu/mwait-idle.c	Fri Sep 21 13:47:18 2012 +0200
@@ -0,0 +1,513 @@
+/*
+ * mwait_idle.c - native hardware idle loop for modern processors
+ *
+ * Copyright (c) 2010, Intel Corporation.
+ * Len Brown <len.brown@intel.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope 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.,
+ * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+/*
+ * mwait_idle is a cpuidle driver that loads on specific processors
+ * in lieu of the legacy ACPI processor_idle driver.  The intent is to
+ * make Linux more efficient on these processors, as mwait_idle knows
+ * more than ACPI, as well as make Linux more immune to ACPI BIOS bugs.
+ */
+
+/*
+ * Design Assumptions
+ *
+ * All CPUs have same idle states as boot CPU
+ *
+ * Chipset BM_STS (bus master status) bit is a NOP
+ *	for preventing entry into deep C-states
+ */
+
+/*
+ * Known limitations
+ *
+ * The driver currently initializes for_each_online_cpu() upon load.
+ * It it unaware of subsequent processors hot-added to the system.
+ * This means that if you boot with maxcpus=n and later online
+ * processors above n, those processors will use C1 only.
+ *
+ * ACPI has a .suspend hack to turn off deep C-states during suspend
+ * to avoid complications with the lapic timer workaround.
+ * Have not seen issues with suspend, but may need same workaround here.
+ */
+
+/* un-comment DEBUG to enable pr_debug() statements */
+#define DEBUG
+
+#include <xen/lib.h>
+#include <xen/cpu.h>
+#include <xen/init.h>
+#include <xen/softirq.h>
+#include <xen/trace.h>
+#include <asm/cpuidle.h>
+#include <asm/mwait.h>
+#include <asm/msr.h>
+#include <acpi/cpufreq/cpufreq.h>
+
+#define MWAIT_IDLE_VERSION "0.4"
+#undef PREFIX
+#define PREFIX "mwait-idle: "
+
+#ifdef DEBUG
+# define pr_debug(fmt...) printk(KERN_DEBUG fmt)
+#else
+# define pr_debug(fmt...)
+#endif
+
+static __initdata bool_t no_mwait_idle;
+invbool_param("mwait-idle", no_mwait_idle);
+
+static unsigned int mwait_substates;
+
+#define LAPIC_TIMER_ALWAYS_RELIABLE 0xFFFFFFFF
+/* Reliable LAPIC Timer States, bit 1 for C1 etc. Default to only C1. */
+static unsigned int lapic_timer_reliable_states = (1 << 1);
+
+struct idle_cpu {
+	const struct cpuidle_state *state_table;
+
+	/*
+	 * Hardware C-state auto-demotion may not always be optimal.
+	 * Indicate which enable bits to clear here.
+	 */
+	unsigned long auto_demotion_disable_flags;
+};
+
+static const struct idle_cpu *icpu;
+
+static const struct cpuidle_state {
+	char		name[16];
+	unsigned int	flags;
+	unsigned int	exit_latency; /* in US */
+	int		power_usage; /* in mW */
+	unsigned int	target_residency; /* in US */
+} *cpuidle_state_table;
+
+/*
+ * Set this flag for states where the HW flushes the TLB for us
+ * and so we don't need cross-calls to keep it consistent.
+ * If this flag is set, SW flushes the TLB, so even if the
+ * HW doesn't do the flushing, this flag is safe to use.
+ */
+#define CPUIDLE_FLAG_TLB_FLUSHED	0x10000
+
+/*
+ * States are indexed by the cstate number,
+ * which is also the index into the MWAIT hint array.
+ * Thus C0 is a dummy.
+ */
+static const struct cpuidle_state nehalem_cstates[MWAIT_MAX_NUM_CSTATES] = {
+	{ /* MWAIT C0 */ },
+	{ /* MWAIT C1 */
+		.name = "C1-NHM",
+		.exit_latency = 3,
+		.target_residency = 6,
+	},
+	{ /* MWAIT C2 */
+		.name = "C3-NHM",
+		.flags = CPUIDLE_FLAG_TLB_FLUSHED,
+		.exit_latency = 20,
+		.target_residency = 80,
+	},
+	{ /* MWAIT C3 */
+		.name = "C6-NHM",
+		.flags = CPUIDLE_FLAG_TLB_FLUSHED,
+		.exit_latency = 200,
+		.target_residency = 800,
+	}
+};
+
+static const struct cpuidle_state snb_cstates[MWAIT_MAX_NUM_CSTATES] = {
+	{ /* MWAIT C0 */ },
+	{ /* MWAIT C1 */
+		.name = "C1-SNB",
+		.exit_latency = 1,
+		.target_residency = 1,
+	},
+	{ /* MWAIT C2 */
+		.name = "C3-SNB",
+		.flags = CPUIDLE_FLAG_TLB_FLUSHED,
+		.exit_latency = 80,
+		.target_residency = 211,
+	},
+	{ /* MWAIT C3 */
+		.name = "C6-SNB",
+		.flags = CPUIDLE_FLAG_TLB_FLUSHED,
+		.exit_latency = 104,
+		.target_residency = 345,
+	},
+	{ /* MWAIT C4 */
+		.name = "C7-SNB",
+		.flags = CPUIDLE_FLAG_TLB_FLUSHED,
+		.exit_latency = 109,
+		.target_residency = 345,
+	}
+};
+
+static const struct cpuidle_state ivb_cstates[MWAIT_MAX_NUM_CSTATES] = {
+	{ /* MWAIT C0 */ },
+	{ /* MWAIT C1 */
+		.name = "C1-IVB",
+		.exit_latency = 1,
+		.target_residency = 1,
+	},
+	{ /* MWAIT C2 */
+		.name = "C3-IVB",
+		.flags = CPUIDLE_FLAG_TLB_FLUSHED,
+		.exit_latency = 59,
+		.target_residency = 156,
+	},
+	{ /* MWAIT C3 */
+		.name = "C6-IVB",
+		.flags = CPUIDLE_FLAG_TLB_FLUSHED,
+		.exit_latency = 80,
+		.target_residency = 300,
+	},
+	{ /* MWAIT C4 */
+		.name = "C7-IVB",
+		.flags = CPUIDLE_FLAG_TLB_FLUSHED,
+		.exit_latency = 87,
+		.target_residency = 300,
+	}
+};
+
+static const struct cpuidle_state atom_cstates[MWAIT_MAX_NUM_CSTATES] = {
+	{ /* MWAIT C0 */ },
+	{ /* MWAIT C1 */
+		.name = "C1-ATM",
+		.exit_latency = 1,
+		.target_residency = 4,
+	},
+	{ /* MWAIT C2 */
+		.name = "C2-ATM",
+		.exit_latency = 20,
+		.target_residency = 80,
+	},
+	{ /* MWAIT C3 */ },
+	{ /* MWAIT C4 */
+		.name = "C4-ATM",
+		.flags = CPUIDLE_FLAG_TLB_FLUSHED,
+		.exit_latency = 100,
+		.target_residency = 400,
+	},
+	{ /* MWAIT C5 */ },
+	{ /* MWAIT C6 */
+		.name = "C6-ATM",
+		.flags = CPUIDLE_FLAG_TLB_FLUSHED,
+		.exit_latency = 140,
+		.target_residency = 560,
+	}
+};
+
+static u32 get_driver_data(unsigned int cstate)
+{
+	static const u32 driver_data[] = {
+		[1] /* MWAIT C1 */ = 0x00,
+		[2] /* MWAIT C2 */ = 0x10,
+		[3] /* MWAIT C3 */ = 0x20,
+		[4] /* MWAIT C4 */ = 0x30,
+		[5] /* MWAIT C5 */ = 0x40,
+		[6] /* MWAIT C6 */ = 0x52,
+	};
+
+	return driver_data[cstate < ARRAY_SIZE(driver_data) ? cstate : 0];
+}
+
+static void mwait_idle(void)
+{
+	unsigned int cpu = smp_processor_id();
+	struct acpi_processor_power *power = processor_powers[cpu];
+	struct acpi_processor_cx *cx = NULL;
+	unsigned int eax, next_state, cstate;
+	u64 before, after;
+	u32 exp = 0, pred = 0, irq_traced[4] = { 0 };
+
+	if (max_cstate > 0 && power && !sched_has_urgent_vcpu() &&
+	    (next_state = cpuidle_current_governor->select(power)) > 0) {
+		do {
+			cx = &power->states[next_state];
+		} while (cx->type > max_cstate && --next_state);
+		if (!next_state)
+			cx = NULL;
+		menu_get_trace_data(&exp, &pred);
+	}
+	if (!cx) {
+		if (pm_idle_save)
+			pm_idle_save();
+		else
+			safe_halt();
+		return;
+	}
+
+	cpufreq_dbs_timer_suspend();
+
+	sched_tick_suspend();
+	/* sched_tick_suspend() can raise TIMER_SOFTIRQ. Process it now. */
+	process_pending_softirqs();
+
+	/* Interrupts must be disabled for C2 and higher transitions. */
+	local_irq_disable();
+
+	if (!cpu_is_haltable(cpu)) {
+		local_irq_enable();
+		sched_tick_resume();
+		cpufreq_dbs_timer_resume();
+		return;
+	}
+
+	power->last_state = cx;
+	eax = cx->address;
+	cstate = ((eax >> MWAIT_SUBSTATE_SIZE) & MWAIT_CSTATE_MASK) + 1;
+
+#if 0 /* XXX Can we/do we need to do something similar on Xen? */
+	/*
+	 * leave_mm() to avoid costly and often unnecessary wakeups
+	 * for flushing the user TLB's associated with the active mm.
+	 */
+	if (cpuidle_state_table[].flags & CPUIDLE_FLAG_TLB_FLUSHED)
+		leave_mm(cpu);
+#endif
+
+	if (!(lapic_timer_reliable_states & (1 << cstate)))
+		lapic_timer_off();
+
+	before = cpuidle_get_tick();
+	TRACE_4D(TRC_PM_IDLE_ENTRY, cx->idx, before, exp, pred);
+
+	if (cpu_is_haltable(cpu))
+		mwait_idle_with_hints(eax, MWAIT_ECX_INTERRUPT_BREAK);
+
+	after = cpuidle_get_tick();
+
+	cstate_restore_tsc();
+	trace_exit_reason(irq_traced);
+	TRACE_6D(TRC_PM_IDLE_EXIT, cx->idx, after,
+		irq_traced[0], irq_traced[1], irq_traced[2], irq_traced[3]);
+
+	update_idle_stats(power, cx, before, after);
+	local_irq_enable();
+
+	if (!(lapic_timer_reliable_states & (1 << cstate)))
+		lapic_timer_on();
+
+	/* Now back in C0. */
+	power->last_state = &power->states[0];
+
+	sched_tick_resume();
+	cpufreq_dbs_timer_resume();
+
+	if ( cpuidle_current_governor->reflect )
+		cpuidle_current_governor->reflect(power);
+}
+
+static void auto_demotion_disable(void *dummy)
+{
+	u64 msr_bits;
+
+	rdmsrl(MSR_NHM_SNB_PKG_CST_CFG_CTL, msr_bits);
+	msr_bits &= ~(icpu->auto_demotion_disable_flags);
+	wrmsrl(MSR_NHM_SNB_PKG_CST_CFG_CTL, msr_bits);
+}
+
+static const struct idle_cpu idle_cpu_nehalem = {
+	.state_table = nehalem_cstates,
+	.auto_demotion_disable_flags = NHM_C1_AUTO_DEMOTE | NHM_C3_AUTO_DEMOTE,
+};
+
+static const struct idle_cpu idle_cpu_atom = {
+	.state_table = atom_cstates,
+};
+
+static const struct idle_cpu idle_cpu_lincroft = {
+	.state_table = atom_cstates,
+	.auto_demotion_disable_flags = ATM_LNC_C6_AUTO_DEMOTE,
+};
+
+static const struct idle_cpu idle_cpu_snb = {
+	.state_table = snb_cstates,
+};
+
+static const struct idle_cpu idle_cpu_ivb = {
+	.state_table = ivb_cstates,
+};
+
+#define ICPU(model, cpu) { 6, model, &idle_cpu_##cpu }
+
+static struct intel_idle_id {
+	unsigned int family, model;
+	const struct idle_cpu *data;
+} intel_idle_ids[] __initdata = {
+	ICPU(0x1a, nehalem),
+	ICPU(0x1e, nehalem),
+	ICPU(0x1f, nehalem),
+	ICPU(0x25, nehalem),
+	ICPU(0x2c, nehalem),
+	ICPU(0x2e, nehalem),
+	ICPU(0x2f, nehalem),
+	ICPU(0x1c, atom),
+	ICPU(0x26, lincroft),
+	ICPU(0x2a, snb),
+	ICPU(0x2d, snb),
+	ICPU(0x3a, ivb),
+	{}
+};
+
+static int __init mwait_idle_probe(void)
+{
+	unsigned int eax, ebx, ecx;
+	const struct intel_idle_id *id;
+
+	if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL ||
+	    !boot_cpu_has(X86_FEATURE_MWAIT) ||
+	    boot_cpu_data.cpuid_level < CPUID_MWAIT_LEAF)
+		return -ENODEV;
+
+	for (id = intel_idle_ids; id->family; ++id)
+		if (id->family == boot_cpu_data.x86 &&
+		    id->model == boot_cpu_data.x86_model)
+			break;
+	if (!id->family) {
+		pr_debug(PREFIX "does not run on family %d model %d\n",
+			 boot_cpu_data.x86, boot_cpu_data.x86_model);
+		return -ENODEV;
+	}
+
+	cpuid(CPUID_MWAIT_LEAF, &eax, &ebx, &ecx, &mwait_substates);
+
+	if (!(ecx & CPUID5_ECX_EXTENSIONS_SUPPORTED) ||
+	    !(ecx & CPUID5_ECX_INTERRUPT_BREAK) ||
+	    !mwait_substates)
+		return -ENODEV;
+
+	if (!max_cstate || no_mwait_idle) {
+		pr_debug(PREFIX "disabled\n");
+		return -EPERM;
+	}
+
+	pr_debug(PREFIX "MWAIT substates: %#x\n", mwait_substates);
+
+	icpu = id->data;
+	cpuidle_state_table = icpu->state_table;
+
+	if (boot_cpu_has(X86_FEATURE_ARAT))
+		lapic_timer_reliable_states = LAPIC_TIMER_ALWAYS_RELIABLE;
+
+	pr_debug(PREFIX "v" MWAIT_IDLE_VERSION " model %#x\n",
+		 boot_cpu_data.x86_model);
+
+	pr_debug(PREFIX "lapic_timer_reliable_states %#x\n",
+		 lapic_timer_reliable_states);
+	return 0;
+}
+
+static int mwait_idle_cpu_init(struct notifier_block *nfb,
+			       unsigned long action, void *hcpu)
+{
+	unsigned int cpu = (unsigned long)hcpu, cstate;
+	struct acpi_processor_power *dev = processor_powers[cpu];
+
+	switch (action) {
+	default:
+		return NOTIFY_DONE;
+
+	case CPU_UP_PREPARE:
+		cpuidle_init_cpu(cpu);
+		return NOTIFY_DONE;
+
+	case CPU_ONLINE:
+		if (!dev)
+			return NOTIFY_DONE;
+		break;
+	}
+
+	dev->count = 1;
+
+	for (cstate = 1; cstate < MWAIT_MAX_NUM_CSTATES; ++cstate) {
+		unsigned int num_substates;
+		struct acpi_processor_cx *cx;
+
+		if (cstate > max_cstate) {
+			printk(PREFIX "max C-state %u reached\n", max_cstate);
+			break;
+		}
+
+		/* Does the state exist in CPUID.MWAIT? */
+		num_substates = (mwait_substates >> (cstate * 4))
+			& MWAIT_SUBSTATE_MASK;
+		if (!num_substates)
+			continue;
+		/* Is the state not enabled? */
+		if (!cpuidle_state_table[cstate].target_residency) {
+			/* does the driver not know about the state? */
+			if (!pm_idle_save && !*cpuidle_state_table[cstate].name)
+				pr_debug(PREFIX "unaware of family %#x model %#x MWAIT %u\n",
+					 boot_cpu_data.x86,
+					 boot_cpu_data.x86_model, cstate);
+			continue;
+		}
+
+		if (dev->count >= ACPI_PROCESSOR_MAX_POWER) {
+			printk(PREFIX "max C-state count of %u reached\n",
+			       ACPI_PROCESSOR_MAX_POWER);
+			break;
+		}
+
+		if (cstate > 2 && !boot_cpu_has(X86_FEATURE_NONSTOP_TSC)) {
+			if (pm_idle_save)
+				continue;
+			setup_clear_cpu_cap(X86_FEATURE_TSC_RELIABLE);
+		}
+
+		cx = dev->states + dev->count;
+		cx->type = cstate;
+		cx->address = get_driver_data(cstate);
+		cx->entry_method = ACPI_CSTATE_EM_FFH;
+		cx->power = cpuidle_state_table[cstate].power_usage;
+		cx->latency = cpuidle_state_table[cstate].exit_latency;
+		cx->target_residency =
+			cpuidle_state_table[cstate].target_residency;
+
+		dev->count++;
+	}
+
+	if (icpu->auto_demotion_disable_flags)
+		on_selected_cpus(cpumask_of(cpu), auto_demotion_disable, NULL, 1);
+
+	return NOTIFY_DONE;
+}
+
+int __init mwait_idle_init(struct notifier_block *nfb)
+{
+	int err;
+
+	if (pm_idle_save)
+		return -ENODEV;
+
+	err = mwait_idle_probe();
+	if (!err) {
+		nfb->notifier_call = mwait_idle_cpu_init;
+		mwait_idle_cpu_init(nfb, CPU_UP_PREPARE, NULL);
+
+		pm_idle_save = pm_idle;
+		pm_idle = mwait_idle;
+		dead_idle = acpi_dead_idle;
+	}
+
+	return err;
+}
diff -r 8eab91903e71 -r 1e6e6b49b4ac xen/include/asm-x86/cpuidle.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/include/asm-x86/cpuidle.h	Fri Sep 21 13:47:18 2012 +0200
@@ -0,0 +1,35 @@
+#ifndef __ASM_X86_CPUIDLE_H__
+#define __ASM_X86_CPUIDLE_H__
+
+#include <xen/cpuidle.h>
+#include <xen/notifier.h>
+#include <xen/sched.h>
+#include <xen/sched-if.h>
+
+extern struct acpi_processor_power *processor_powers[];
+
+extern void (*pm_idle_save)(void);
+
+extern void (*lapic_timer_off)(void);
+extern void (*lapic_timer_on)(void);
+
+extern uint64_t (*cpuidle_get_tick)(void);
+
+int mwait_idle_init(struct notifier_block *);
+int cpuidle_init_cpu(unsigned int cpu);
+void acpi_dead_idle(void);
+void trace_exit_reason(u32 *irq_traced);
+void update_idle_stats(struct acpi_processor_power *,
+                       struct acpi_processor_cx *, uint64_t, uint64_t);
+
+/*
+ * vcpu is urgent if vcpu is polling event channel
+ *
+ * if urgent vcpu exists, CPU should not enter deep C state
+ */
+static inline int sched_has_urgent_vcpu(void)
+{
+    return atomic_read(&this_cpu(schedule_data).urgent_count);
+}
+
+#endif /* __X86_ASM_CPUIDLE_H__ */
diff -r 8eab91903e71 -r 1e6e6b49b4ac xen/include/asm-x86/msr-index.h
--- a/xen/include/asm-x86/msr-index.h	Fri Sep 21 13:45:08 2012 +0200
+++ b/xen/include/asm-x86/msr-index.h	Fri Sep 21 13:47:18 2012 +0200
@@ -36,6 +36,11 @@
 #define MSR_IA32_PERFCTR1		0x000000c2
 #define MSR_FSB_FREQ			0x000000cd
 
+#define MSR_NHM_SNB_PKG_CST_CFG_CTL	0x000000e2
+#define NHM_C3_AUTO_DEMOTE		(1UL << 25)
+#define NHM_C1_AUTO_DEMOTE		(1UL << 26)
+#define ATM_LNC_C6_AUTO_DEMOTE		(1UL << 25)
+
 #define MSR_MTRRcap			0x000000fe
 #define MSR_IA32_BBL_CR_CTL		0x00000119
 
diff -r 8eab91903e71 -r 1e6e6b49b4ac xen/include/asm-x86/mwait.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/include/asm-x86/mwait.h	Fri Sep 21 13:47:18 2012 +0200
@@ -0,0 +1,17 @@
+#ifndef __ASM_X86_MWAIT_H__
+#define __ASM_X86_MWAIT_H__
+
+#define MWAIT_SUBSTATE_MASK		0xf
+#define MWAIT_CSTATE_MASK		0xf
+#define MWAIT_SUBSTATE_SIZE		4
+#define MWAIT_MAX_NUM_CSTATES		8
+
+#define CPUID_MWAIT_LEAF		5
+#define CPUID5_ECX_EXTENSIONS_SUPPORTED 0x1
+#define CPUID5_ECX_INTERRUPT_BREAK	0x2
+
+#define MWAIT_ECX_INTERRUPT_BREAK	0x1
+
+void mwait_idle_with_hints(unsigned int eax, unsigned int ecx);
+
+#endif /* __ASM_X86_MWAIT_H__ */

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMdv-000829-U0; Thu, 27 Sep 2012 22:33:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdu-00081O-KR
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:14 +0000
Received: from [85.158.143.35:19168] by server-1.bemta-4.messagelabs.com id
	98/D5-05684-924D4605; Thu, 27 Sep 2012 22:33:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-21.messagelabs.com!1348785191!4440847!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12366 invoked from network); 27 Sep 2012 22:33:12 -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 Sep 2012 22: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 1THMdr-0007H8-C5
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdr-0003nO-4z
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:11 +0000
Message-Id: <E1THMdr-0003nO-4z@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: enable VIA CPU support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348239766 -7200
# Node ID 8f658b463b78de04c8ba3180d6058acb80d01b95
# Parent  32187301ecc57f06fe659779c2b781a6ebde1101
x86: enable VIA CPU support

Newer VIA CPUs have both 64-bit and VMX support. Enable them to be
recognized for these purposes, at once stripping off any 32-bit CPU
only bits from the respective CPU support file, and adding 64-bit ones
found in recent Linux.

This particularly implies untying the VMX == Intel assumption in a few
places.

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


diff -r 32187301ecc5 -r 8f658b463b78 xen/arch/x86/acpi/suspend.c
--- a/xen/arch/x86/acpi/suspend.c	Fri Sep 21 15:20:21 2012 +0200
+++ b/xen/arch/x86/acpi/suspend.c	Fri Sep 21 17:02:46 2012 +0200
@@ -32,7 +32,8 @@ void save_rest_processor_state(void)
     rdmsrl(MSR_SHADOW_GS_BASE, saved_kernel_gs_base);
     rdmsrl(MSR_CSTAR, saved_cstar);
     rdmsrl(MSR_LSTAR, saved_lstar);
-    if ( boot_cpu_data.x86_vendor == X86_VENDOR_INTEL )
+    if ( boot_cpu_data.x86_vendor == X86_VENDOR_INTEL ||
+         boot_cpu_data.x86_vendor == X86_VENDOR_CENTAUR )
     {
         rdmsrl(MSR_IA32_SYSENTER_ESP, saved_sysenter_esp);
         rdmsrl(MSR_IA32_SYSENTER_EIP, saved_sysenter_eip);
@@ -59,7 +60,8 @@ void restore_rest_processor_state(void)
     wrmsrl(MSR_GS_BASE, saved_gs_base);
     wrmsrl(MSR_SHADOW_GS_BASE, saved_kernel_gs_base);
 
-    if ( boot_cpu_data.x86_vendor == X86_VENDOR_INTEL )
+    if ( boot_cpu_data.x86_vendor == X86_VENDOR_INTEL ||
+         boot_cpu_data.x86_vendor == X86_VENDOR_CENTAUR )
     {
         /* Recover sysenter MSRs */
         wrmsrl(MSR_IA32_SYSENTER_ESP, saved_sysenter_esp);
diff -r 32187301ecc5 -r 8f658b463b78 xen/arch/x86/cpu/Makefile
--- a/xen/arch/x86/cpu/Makefile	Fri Sep 21 15:20:21 2012 +0200
+++ b/xen/arch/x86/cpu/Makefile	Fri Sep 21 17:02:46 2012 +0200
@@ -2,10 +2,8 @@ subdir-y += mcheck
 subdir-y += mtrr
 
 obj-y += amd.o
+obj-y += centaur.o
 obj-y += common.o
 obj-y += intel.o
 obj-y += intel_cacheinfo.o
 obj-y += mwait-idle.o
-
-# Keeping around for VIA support (JBeulich)
-# obj-$(x86_32) += centaur.o
diff -r 32187301ecc5 -r 8f658b463b78 xen/arch/x86/cpu/centaur.c
--- a/xen/arch/x86/cpu/centaur.c	Fri Sep 21 15:20:21 2012 +0200
+++ b/xen/arch/x86/cpu/centaur.c	Fri Sep 21 17:02:46 2012 +0200
@@ -45,51 +45,25 @@ static void __init init_c3(struct cpuinf
 		c->x86_capability[5] = cpuid_edx(0xC0000001);
 	}
 
-	/* Cyrix III family needs CX8 & PGE explicity enabled. */
-	if (c->x86_model >=6 && c->x86_model <= 9) {
-		rdmsrl(MSR_VIA_FCR, msr_content);
-		wrmsrl(MSR_VIA_FCR, msr_content | (1ULL << 1 | 1ULL << 7));
-		set_bit(X86_FEATURE_CX8, c->x86_capability);
+	if (c->x86 == 0x6 && c->x86_model >= 0xf) {
+		c->x86_cache_alignment = c->x86_clflush_size * 2;
+		set_bit(X86_FEATURE_CONSTANT_TSC, c->x86_capability);
 	}
 
-	/* Before Nehemiah, the C3's had 3dNOW! */
-	if (c->x86_model >=6 && c->x86_model <9)
-		set_bit(X86_FEATURE_3DNOW, c->x86_capability);
-
 	get_model_name(c);
 	display_cacheinfo(c);
 }
 
 static void __init init_centaur(struct cpuinfo_x86 *c)
 {
-	/* Bit 31 in normal CPUID used for nonstandard 3DNow ID;
-	   3DNow is IDd by bit 31 in extended CPUID (1*32+31) anyway */
-	clear_bit(0*32+31, c->x86_capability);
-
 	if (c->x86 == 6)
 		init_c3(c);
 }
 
-static unsigned int centaur_size_cache(struct cpuinfo_x86 * c, unsigned int size)
-{
-	/* VIA C3 CPUs (670-68F) need further shifting. */
-	if ((c->x86 == 6) && ((c->x86_model == 7) || (c->x86_model == 8)))
-		size >>= 8;
-
-	/* VIA also screwed up Nehemiah stepping 1, and made
-	   it return '65KB' instead of '64KB'
-	   - Note, it seems this may only be in engineering samples. */
-	if ((c->x86==6) && (c->x86_model==9) && (c->x86_mask==1) && (size==65))
-		size -=1;
-
-	return size;
-}
-
 static struct cpu_dev centaur_cpu_dev __cpuinitdata = {
 	.c_vendor	= "Centaur",
 	.c_ident	= { "CentaurHauls" },
 	.c_init		= init_centaur,
-	.c_size_cache	= centaur_size_cache,
 };
 
 int __init centaur_init_cpu(void)
@@ -97,5 +71,3 @@ int __init centaur_init_cpu(void)
 	cpu_devs[X86_VENDOR_CENTAUR] = &centaur_cpu_dev;
 	return 0;
 }
-
-//early_arch_initcall(centaur_init_cpu);
diff -r 32187301ecc5 -r 8f658b463b78 xen/arch/x86/cpu/common.c
--- a/xen/arch/x86/cpu/common.c	Fri Sep 21 15:20:21 2012 +0200
+++ b/xen/arch/x86/cpu/common.c	Fri Sep 21 17:02:46 2012 +0200
@@ -522,6 +522,7 @@ void __init early_cpu_init(void)
 {
 	intel_cpu_init();
 	amd_init_cpu();
+	centaur_init_cpu();
 	early_cpu_detect();
 }
 /*
diff -r 32187301ecc5 -r 8f658b463b78 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Fri Sep 21 15:20:21 2012 +0200
+++ b/xen/arch/x86/hvm/hvm.c	Fri Sep 21 17:02:46 2012 +0200
@@ -111,17 +111,10 @@ static int __init hvm_enable(void)
 {
     struct hvm_function_table *fns = NULL;
 
-    switch ( boot_cpu_data.x86_vendor )
-    {
-    case X86_VENDOR_INTEL:
+    if ( cpu_has_vmx )
         fns = start_vmx();
-        break;
-    case X86_VENDOR_AMD:
+    else if ( cpu_has_svm )
         fns = start_svm();
-        break;
-    default:
-        break;
-    }
 
     if ( fns == NULL )
         return 0;
diff -r 32187301ecc5 -r 8f658b463b78 xen/arch/x86/hvm/nestedhvm.c
--- a/xen/arch/x86/hvm/nestedhvm.c	Fri Sep 21 15:20:21 2012 +0200
+++ b/xen/arch/x86/hvm/nestedhvm.c	Fri Sep 21 17:02:46 2012 +0200
@@ -152,7 +152,7 @@ static int __init
 nestedhvm_setup(void)
 {
     /* Same format and size as hvm_io_bitmap (Intel needs only 2 pages). */
-    unsigned int nr = (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) ? 2 : 3;
+    unsigned nr = cpu_has_vmx ? 2 : 3;
     unsigned int i, order = get_order_from_pages(nr);
 
     if ( !hvm_funcs.name )
diff -r 32187301ecc5 -r 8f658b463b78 xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c	Fri Sep 21 15:20:21 2012 +0200
+++ b/xen/arch/x86/hvm/svm/svm.c	Fri Sep 21 17:02:46 2012 +0200
@@ -1240,9 +1240,6 @@ struct hvm_function_table * __init start
 {
     bool_t printed = 0;
 
-    if ( !test_bit(X86_FEATURE_SVM, &boot_cpu_data.x86_capability) )
-        return NULL;
-
     svm_host_osvw_reset();
 
     if ( svm_cpu_up() )
diff -r 32187301ecc5 -r 8f658b463b78 xen/arch/x86/hvm/viridian.c
--- a/xen/arch/x86/hvm/viridian.c	Fri Sep 21 15:20:21 2012 +0200
+++ b/xen/arch/x86/hvm/viridian.c	Fri Sep 21 17:02:46 2012 +0200
@@ -156,8 +156,7 @@ static void enable_hypercall_page(struct
     *(u32 *)(p + 1) = 0x80000000;
     *(u8  *)(p + 5) = 0x0f; /* vmcall/vmmcall */
     *(u8  *)(p + 6) = 0x01;
-    *(u8  *)(p + 7) = ((boot_cpu_data.x86_vendor == X86_VENDOR_INTEL)
-                       ? 0xc1 : 0xd9);
+    *(u8  *)(p + 7) = (cpu_has_vmx ? 0xc1 : 0xd9);
     *(u8  *)(p + 8) = 0xc3; /* ret */
     memset(p + 9, 0xcc, PAGE_SIZE - 9); /* int3, int3, ... */
 
diff -r 32187301ecc5 -r 8f658b463b78 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Fri Sep 21 15:20:21 2012 +0200
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Fri Sep 21 17:02:46 2012 +0200
@@ -1516,9 +1516,6 @@ static struct hvm_function_table __read_
 
 struct hvm_function_table * __init start_vmx(void)
 {
-    if ( !test_bit(X86_FEATURE_VMXE, &boot_cpu_data.x86_capability) )
-        return NULL;
-
     set_in_cr4(X86_CR4_VMXE);
 
     if ( vmx_cpu_up() )
diff -r 32187301ecc5 -r 8f658b463b78 xen/arch/x86/mm/mem_event.c
--- a/xen/arch/x86/mm/mem_event.c	Fri Sep 21 15:20:21 2012 +0200
+++ b/xen/arch/x86/mm/mem_event.c	Fri Sep 21 17:02:46 2012 +0200
@@ -608,7 +608,7 @@ int mem_event_domctl(struct domain *d, x
                 break;
 
             /* Currently only EPT is supported */
-            if ( boot_cpu_data.x86_vendor != X86_VENDOR_INTEL )
+            if ( !cpu_has_vmx )
                 break;
 
             rc = mem_event_enable(d, mec, med, _VPF_mem_access, 
diff -r 32187301ecc5 -r 8f658b463b78 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Fri Sep 21 15:20:21 2012 +0200
+++ b/xen/arch/x86/mm/p2m.c	Fri Sep 21 17:02:46 2012 +0200
@@ -83,7 +83,7 @@ static void p2m_initialise(struct domain
 
     p2m->cr3 = CR3_EADDR;
 
-    if ( hap_enabled(d) && (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) )
+    if ( hap_enabled(d) && cpu_has_vmx )
         ept_p2m_init(p2m);
     else
         p2m_pt_init(p2m);
diff -r 32187301ecc5 -r 8f658b463b78 xen/arch/x86/x86_64/traps.c
--- a/xen/arch/x86/x86_64/traps.c	Fri Sep 21 15:20:21 2012 +0200
+++ b/xen/arch/x86/x86_64/traps.c	Fri Sep 21 17:02:46 2012 +0200
@@ -399,7 +399,8 @@ void __devinit subarch_percpu_traps_init
     wrmsrl(MSR_LSTAR, (unsigned long)stack);
     stack += write_stack_trampoline(stack, stack_bottom, FLAT_KERNEL_CS64);
 
-    if ( boot_cpu_data.x86_vendor == X86_VENDOR_INTEL )
+    if ( boot_cpu_data.x86_vendor == X86_VENDOR_INTEL ||
+         boot_cpu_data.x86_vendor == X86_VENDOR_CENTAUR )
     {
         /* SYSENTER entry. */
         wrmsrl(MSR_IA32_SYSENTER_ESP, (unsigned long)stack_bottom);

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMdv-000829-U0; Thu, 27 Sep 2012 22:33:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdu-00081O-KR
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:14 +0000
Received: from [85.158.143.35:19168] by server-1.bemta-4.messagelabs.com id
	98/D5-05684-924D4605; Thu, 27 Sep 2012 22:33:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-21.messagelabs.com!1348785191!4440847!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12366 invoked from network); 27 Sep 2012 22:33:12 -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 Sep 2012 22: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 1THMdr-0007H8-C5
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdr-0003nO-4z
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:11 +0000
Message-Id: <E1THMdr-0003nO-4z@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: enable VIA CPU support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348239766 -7200
# Node ID 8f658b463b78de04c8ba3180d6058acb80d01b95
# Parent  32187301ecc57f06fe659779c2b781a6ebde1101
x86: enable VIA CPU support

Newer VIA CPUs have both 64-bit and VMX support. Enable them to be
recognized for these purposes, at once stripping off any 32-bit CPU
only bits from the respective CPU support file, and adding 64-bit ones
found in recent Linux.

This particularly implies untying the VMX == Intel assumption in a few
places.

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


diff -r 32187301ecc5 -r 8f658b463b78 xen/arch/x86/acpi/suspend.c
--- a/xen/arch/x86/acpi/suspend.c	Fri Sep 21 15:20:21 2012 +0200
+++ b/xen/arch/x86/acpi/suspend.c	Fri Sep 21 17:02:46 2012 +0200
@@ -32,7 +32,8 @@ void save_rest_processor_state(void)
     rdmsrl(MSR_SHADOW_GS_BASE, saved_kernel_gs_base);
     rdmsrl(MSR_CSTAR, saved_cstar);
     rdmsrl(MSR_LSTAR, saved_lstar);
-    if ( boot_cpu_data.x86_vendor == X86_VENDOR_INTEL )
+    if ( boot_cpu_data.x86_vendor == X86_VENDOR_INTEL ||
+         boot_cpu_data.x86_vendor == X86_VENDOR_CENTAUR )
     {
         rdmsrl(MSR_IA32_SYSENTER_ESP, saved_sysenter_esp);
         rdmsrl(MSR_IA32_SYSENTER_EIP, saved_sysenter_eip);
@@ -59,7 +60,8 @@ void restore_rest_processor_state(void)
     wrmsrl(MSR_GS_BASE, saved_gs_base);
     wrmsrl(MSR_SHADOW_GS_BASE, saved_kernel_gs_base);
 
-    if ( boot_cpu_data.x86_vendor == X86_VENDOR_INTEL )
+    if ( boot_cpu_data.x86_vendor == X86_VENDOR_INTEL ||
+         boot_cpu_data.x86_vendor == X86_VENDOR_CENTAUR )
     {
         /* Recover sysenter MSRs */
         wrmsrl(MSR_IA32_SYSENTER_ESP, saved_sysenter_esp);
diff -r 32187301ecc5 -r 8f658b463b78 xen/arch/x86/cpu/Makefile
--- a/xen/arch/x86/cpu/Makefile	Fri Sep 21 15:20:21 2012 +0200
+++ b/xen/arch/x86/cpu/Makefile	Fri Sep 21 17:02:46 2012 +0200
@@ -2,10 +2,8 @@ subdir-y += mcheck
 subdir-y += mtrr
 
 obj-y += amd.o
+obj-y += centaur.o
 obj-y += common.o
 obj-y += intel.o
 obj-y += intel_cacheinfo.o
 obj-y += mwait-idle.o
-
-# Keeping around for VIA support (JBeulich)
-# obj-$(x86_32) += centaur.o
diff -r 32187301ecc5 -r 8f658b463b78 xen/arch/x86/cpu/centaur.c
--- a/xen/arch/x86/cpu/centaur.c	Fri Sep 21 15:20:21 2012 +0200
+++ b/xen/arch/x86/cpu/centaur.c	Fri Sep 21 17:02:46 2012 +0200
@@ -45,51 +45,25 @@ static void __init init_c3(struct cpuinf
 		c->x86_capability[5] = cpuid_edx(0xC0000001);
 	}
 
-	/* Cyrix III family needs CX8 & PGE explicity enabled. */
-	if (c->x86_model >=6 && c->x86_model <= 9) {
-		rdmsrl(MSR_VIA_FCR, msr_content);
-		wrmsrl(MSR_VIA_FCR, msr_content | (1ULL << 1 | 1ULL << 7));
-		set_bit(X86_FEATURE_CX8, c->x86_capability);
+	if (c->x86 == 0x6 && c->x86_model >= 0xf) {
+		c->x86_cache_alignment = c->x86_clflush_size * 2;
+		set_bit(X86_FEATURE_CONSTANT_TSC, c->x86_capability);
 	}
 
-	/* Before Nehemiah, the C3's had 3dNOW! */
-	if (c->x86_model >=6 && c->x86_model <9)
-		set_bit(X86_FEATURE_3DNOW, c->x86_capability);
-
 	get_model_name(c);
 	display_cacheinfo(c);
 }
 
 static void __init init_centaur(struct cpuinfo_x86 *c)
 {
-	/* Bit 31 in normal CPUID used for nonstandard 3DNow ID;
-	   3DNow is IDd by bit 31 in extended CPUID (1*32+31) anyway */
-	clear_bit(0*32+31, c->x86_capability);
-
 	if (c->x86 == 6)
 		init_c3(c);
 }
 
-static unsigned int centaur_size_cache(struct cpuinfo_x86 * c, unsigned int size)
-{
-	/* VIA C3 CPUs (670-68F) need further shifting. */
-	if ((c->x86 == 6) && ((c->x86_model == 7) || (c->x86_model == 8)))
-		size >>= 8;
-
-	/* VIA also screwed up Nehemiah stepping 1, and made
-	   it return '65KB' instead of '64KB'
-	   - Note, it seems this may only be in engineering samples. */
-	if ((c->x86==6) && (c->x86_model==9) && (c->x86_mask==1) && (size==65))
-		size -=1;
-
-	return size;
-}
-
 static struct cpu_dev centaur_cpu_dev __cpuinitdata = {
 	.c_vendor	= "Centaur",
 	.c_ident	= { "CentaurHauls" },
 	.c_init		= init_centaur,
-	.c_size_cache	= centaur_size_cache,
 };
 
 int __init centaur_init_cpu(void)
@@ -97,5 +71,3 @@ int __init centaur_init_cpu(void)
 	cpu_devs[X86_VENDOR_CENTAUR] = &centaur_cpu_dev;
 	return 0;
 }
-
-//early_arch_initcall(centaur_init_cpu);
diff -r 32187301ecc5 -r 8f658b463b78 xen/arch/x86/cpu/common.c
--- a/xen/arch/x86/cpu/common.c	Fri Sep 21 15:20:21 2012 +0200
+++ b/xen/arch/x86/cpu/common.c	Fri Sep 21 17:02:46 2012 +0200
@@ -522,6 +522,7 @@ void __init early_cpu_init(void)
 {
 	intel_cpu_init();
 	amd_init_cpu();
+	centaur_init_cpu();
 	early_cpu_detect();
 }
 /*
diff -r 32187301ecc5 -r 8f658b463b78 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Fri Sep 21 15:20:21 2012 +0200
+++ b/xen/arch/x86/hvm/hvm.c	Fri Sep 21 17:02:46 2012 +0200
@@ -111,17 +111,10 @@ static int __init hvm_enable(void)
 {
     struct hvm_function_table *fns = NULL;
 
-    switch ( boot_cpu_data.x86_vendor )
-    {
-    case X86_VENDOR_INTEL:
+    if ( cpu_has_vmx )
         fns = start_vmx();
-        break;
-    case X86_VENDOR_AMD:
+    else if ( cpu_has_svm )
         fns = start_svm();
-        break;
-    default:
-        break;
-    }
 
     if ( fns == NULL )
         return 0;
diff -r 32187301ecc5 -r 8f658b463b78 xen/arch/x86/hvm/nestedhvm.c
--- a/xen/arch/x86/hvm/nestedhvm.c	Fri Sep 21 15:20:21 2012 +0200
+++ b/xen/arch/x86/hvm/nestedhvm.c	Fri Sep 21 17:02:46 2012 +0200
@@ -152,7 +152,7 @@ static int __init
 nestedhvm_setup(void)
 {
     /* Same format and size as hvm_io_bitmap (Intel needs only 2 pages). */
-    unsigned int nr = (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) ? 2 : 3;
+    unsigned nr = cpu_has_vmx ? 2 : 3;
     unsigned int i, order = get_order_from_pages(nr);
 
     if ( !hvm_funcs.name )
diff -r 32187301ecc5 -r 8f658b463b78 xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c	Fri Sep 21 15:20:21 2012 +0200
+++ b/xen/arch/x86/hvm/svm/svm.c	Fri Sep 21 17:02:46 2012 +0200
@@ -1240,9 +1240,6 @@ struct hvm_function_table * __init start
 {
     bool_t printed = 0;
 
-    if ( !test_bit(X86_FEATURE_SVM, &boot_cpu_data.x86_capability) )
-        return NULL;
-
     svm_host_osvw_reset();
 
     if ( svm_cpu_up() )
diff -r 32187301ecc5 -r 8f658b463b78 xen/arch/x86/hvm/viridian.c
--- a/xen/arch/x86/hvm/viridian.c	Fri Sep 21 15:20:21 2012 +0200
+++ b/xen/arch/x86/hvm/viridian.c	Fri Sep 21 17:02:46 2012 +0200
@@ -156,8 +156,7 @@ static void enable_hypercall_page(struct
     *(u32 *)(p + 1) = 0x80000000;
     *(u8  *)(p + 5) = 0x0f; /* vmcall/vmmcall */
     *(u8  *)(p + 6) = 0x01;
-    *(u8  *)(p + 7) = ((boot_cpu_data.x86_vendor == X86_VENDOR_INTEL)
-                       ? 0xc1 : 0xd9);
+    *(u8  *)(p + 7) = (cpu_has_vmx ? 0xc1 : 0xd9);
     *(u8  *)(p + 8) = 0xc3; /* ret */
     memset(p + 9, 0xcc, PAGE_SIZE - 9); /* int3, int3, ... */
 
diff -r 32187301ecc5 -r 8f658b463b78 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Fri Sep 21 15:20:21 2012 +0200
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Fri Sep 21 17:02:46 2012 +0200
@@ -1516,9 +1516,6 @@ static struct hvm_function_table __read_
 
 struct hvm_function_table * __init start_vmx(void)
 {
-    if ( !test_bit(X86_FEATURE_VMXE, &boot_cpu_data.x86_capability) )
-        return NULL;
-
     set_in_cr4(X86_CR4_VMXE);
 
     if ( vmx_cpu_up() )
diff -r 32187301ecc5 -r 8f658b463b78 xen/arch/x86/mm/mem_event.c
--- a/xen/arch/x86/mm/mem_event.c	Fri Sep 21 15:20:21 2012 +0200
+++ b/xen/arch/x86/mm/mem_event.c	Fri Sep 21 17:02:46 2012 +0200
@@ -608,7 +608,7 @@ int mem_event_domctl(struct domain *d, x
                 break;
 
             /* Currently only EPT is supported */
-            if ( boot_cpu_data.x86_vendor != X86_VENDOR_INTEL )
+            if ( !cpu_has_vmx )
                 break;
 
             rc = mem_event_enable(d, mec, med, _VPF_mem_access, 
diff -r 32187301ecc5 -r 8f658b463b78 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Fri Sep 21 15:20:21 2012 +0200
+++ b/xen/arch/x86/mm/p2m.c	Fri Sep 21 17:02:46 2012 +0200
@@ -83,7 +83,7 @@ static void p2m_initialise(struct domain
 
     p2m->cr3 = CR3_EADDR;
 
-    if ( hap_enabled(d) && (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) )
+    if ( hap_enabled(d) && cpu_has_vmx )
         ept_p2m_init(p2m);
     else
         p2m_pt_init(p2m);
diff -r 32187301ecc5 -r 8f658b463b78 xen/arch/x86/x86_64/traps.c
--- a/xen/arch/x86/x86_64/traps.c	Fri Sep 21 15:20:21 2012 +0200
+++ b/xen/arch/x86/x86_64/traps.c	Fri Sep 21 17:02:46 2012 +0200
@@ -399,7 +399,8 @@ void __devinit subarch_percpu_traps_init
     wrmsrl(MSR_LSTAR, (unsigned long)stack);
     stack += write_stack_trampoline(stack, stack_bottom, FLAT_KERNEL_CS64);
 
-    if ( boot_cpu_data.x86_vendor == X86_VENDOR_INTEL )
+    if ( boot_cpu_data.x86_vendor == X86_VENDOR_INTEL ||
+         boot_cpu_data.x86_vendor == X86_VENDOR_CENTAUR )
     {
         /* SYSENTER entry. */
         wrmsrl(MSR_IA32_SYSENTER_ESP, (unsigned long)stack_bottom);

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMdv-00081z-PM; Thu, 27 Sep 2012 22:33:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdu-00081M-BI
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:14 +0000
Received: from [85.158.143.35:2512] by server-3.bemta-4.messagelabs.com id
	6E/50-10986-924D4605; Thu, 27 Sep 2012 22:33:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-21.messagelabs.com!1348785192!16631292!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24621 invoked from network); 27 Sep 2012 22:33:13 -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;
	27 Sep 2012 22: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 1THMdr-0007HB-Tg
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdr-0003nd-M6
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:11 +0000
Message-Id: <E1THMdr-0003nd-M6@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: fix MWAIT-based idle driver for
	CPUs without ARAT
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348554993 -7200
# Node ID b49f7bf52fa92626517386cba89350243b808871
# Parent  8f658b463b78de04c8ba3180d6058acb80d01b95
x86: fix MWAIT-based idle driver for CPUs without ARAT

lapic_timer_{on,off} need to get initialized in this case. This in turn
requires getting HPET broadcast setup to be carried out earlier (and
hence preventing double initialization there).

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


diff -r 8f658b463b78 -r b49f7bf52fa9 xen/arch/x86/acpi/cpu_idle.c
--- a/xen/arch/x86/acpi/cpu_idle.c	Fri Sep 21 17:02:46 2012 +0200
+++ b/xen/arch/x86/acpi/cpu_idle.c	Tue Sep 25 08:36:33 2012 +0200
@@ -74,6 +74,29 @@ static void lapic_timer_nop(void) { }
 void (*__read_mostly lapic_timer_off)(void);
 void (*__read_mostly lapic_timer_on)(void);
 
+bool_t lapic_timer_init(void)
+{
+    if ( boot_cpu_has(X86_FEATURE_ARAT) )
+    {
+        lapic_timer_off = lapic_timer_nop;
+        lapic_timer_on = lapic_timer_nop;
+    }
+    else if ( hpet_broadcast_is_available() )
+    {
+        lapic_timer_off = hpet_broadcast_enter;
+        lapic_timer_on = hpet_broadcast_exit;
+    }
+    else if ( pit_broadcast_is_available() )
+    {
+        lapic_timer_off = pit_broadcast_enter;
+        lapic_timer_on = pit_broadcast_exit;
+    }
+    else
+        return 0;
+
+    return 1;
+}
+
 static uint64_t (*__read_mostly tick_to_ns)(uint64_t) = acpi_pm_tick_to_ns;
 
 void (*__read_mostly pm_idle_save)(void);
@@ -789,25 +812,8 @@ static int check_cx(struct acpi_processo
         if ( local_apic_timer_c2_ok )
             break;
     case ACPI_STATE_C3:
-        if ( boot_cpu_has(X86_FEATURE_ARAT) )
-        {
-            lapic_timer_off = lapic_timer_nop;
-            lapic_timer_on = lapic_timer_nop;
-        }
-        else if ( hpet_broadcast_is_available() )
-        {
-            lapic_timer_off = hpet_broadcast_enter;
-            lapic_timer_on = hpet_broadcast_exit;
-        }
-        else if ( pit_broadcast_is_available() )
-        {
-            lapic_timer_off = pit_broadcast_enter;
-            lapic_timer_on = pit_broadcast_exit;
-        }
-        else
-        {
+        if ( !lapic_timer_init() )
             return -EINVAL;
-        }
 
         /* All the logic here assumes flags.bm_check is same across all CPUs */
         if ( bm_check_flag == -1 )
diff -r 8f658b463b78 -r b49f7bf52fa9 xen/arch/x86/cpu/mwait-idle.c
--- a/xen/arch/x86/cpu/mwait-idle.c	Fri Sep 21 17:02:46 2012 +0200
+++ b/xen/arch/x86/cpu/mwait-idle.c	Tue Sep 25 08:36:33 2012 +0200
@@ -56,6 +56,7 @@
 #include <xen/softirq.h>
 #include <xen/trace.h>
 #include <asm/cpuidle.h>
+#include <asm/hpet.h>
 #include <asm/mwait.h>
 #include <asm/msr.h>
 #include <acpi/cpufreq/cpufreq.h>
@@ -501,6 +502,12 @@ int __init mwait_idle_init(struct notifi
 
 	err = mwait_idle_probe();
 	if (!err) {
+		if (!boot_cpu_has(X86_FEATURE_ARAT))
+			hpet_broadcast_init();
+		if (!lapic_timer_init())
+			err = -EINVAL;
+	}
+	if (!err) {
 		nfb->notifier_call = mwait_idle_cpu_init;
 		mwait_idle_cpu_init(nfb, CPU_UP_PREPARE, NULL);
 
diff -r 8f658b463b78 -r b49f7bf52fa9 xen/arch/x86/hpet.c
--- a/xen/arch/x86/hpet.c	Fri Sep 21 17:02:46 2012 +0200
+++ b/xen/arch/x86/hpet.c	Tue Sep 25 08:36:33 2012 +0200
@@ -495,7 +495,7 @@ void __init hpet_broadcast_init(void)
     u32 hpet_id, cfg;
     unsigned int i, n;
 
-    if ( hpet_rate == 0 )
+    if ( hpet_rate == 0 || hpet_broadcast_is_available() )
         return;
 
     cfg = hpet_read32(HPET_CFG);
diff -r 8f658b463b78 -r b49f7bf52fa9 xen/include/asm-x86/cpuidle.h
--- a/xen/include/asm-x86/cpuidle.h	Fri Sep 21 17:02:46 2012 +0200
+++ b/xen/include/asm-x86/cpuidle.h	Tue Sep 25 08:36:33 2012 +0200
@@ -10,6 +10,7 @@ extern struct acpi_processor_power *proc
 
 extern void (*pm_idle_save)(void);
 
+bool_t lapic_timer_init(void);
 extern void (*lapic_timer_off)(void);
 extern void (*lapic_timer_on)(void);
 

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMdv-00081z-PM; Thu, 27 Sep 2012 22:33:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdu-00081M-BI
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:14 +0000
Received: from [85.158.143.35:2512] by server-3.bemta-4.messagelabs.com id
	6E/50-10986-924D4605; Thu, 27 Sep 2012 22:33:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-21.messagelabs.com!1348785192!16631292!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24621 invoked from network); 27 Sep 2012 22:33:13 -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;
	27 Sep 2012 22: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 1THMdr-0007HB-Tg
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdr-0003nd-M6
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:11 +0000
Message-Id: <E1THMdr-0003nd-M6@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: fix MWAIT-based idle driver for
	CPUs without ARAT
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348554993 -7200
# Node ID b49f7bf52fa92626517386cba89350243b808871
# Parent  8f658b463b78de04c8ba3180d6058acb80d01b95
x86: fix MWAIT-based idle driver for CPUs without ARAT

lapic_timer_{on,off} need to get initialized in this case. This in turn
requires getting HPET broadcast setup to be carried out earlier (and
hence preventing double initialization there).

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


diff -r 8f658b463b78 -r b49f7bf52fa9 xen/arch/x86/acpi/cpu_idle.c
--- a/xen/arch/x86/acpi/cpu_idle.c	Fri Sep 21 17:02:46 2012 +0200
+++ b/xen/arch/x86/acpi/cpu_idle.c	Tue Sep 25 08:36:33 2012 +0200
@@ -74,6 +74,29 @@ static void lapic_timer_nop(void) { }
 void (*__read_mostly lapic_timer_off)(void);
 void (*__read_mostly lapic_timer_on)(void);
 
+bool_t lapic_timer_init(void)
+{
+    if ( boot_cpu_has(X86_FEATURE_ARAT) )
+    {
+        lapic_timer_off = lapic_timer_nop;
+        lapic_timer_on = lapic_timer_nop;
+    }
+    else if ( hpet_broadcast_is_available() )
+    {
+        lapic_timer_off = hpet_broadcast_enter;
+        lapic_timer_on = hpet_broadcast_exit;
+    }
+    else if ( pit_broadcast_is_available() )
+    {
+        lapic_timer_off = pit_broadcast_enter;
+        lapic_timer_on = pit_broadcast_exit;
+    }
+    else
+        return 0;
+
+    return 1;
+}
+
 static uint64_t (*__read_mostly tick_to_ns)(uint64_t) = acpi_pm_tick_to_ns;
 
 void (*__read_mostly pm_idle_save)(void);
@@ -789,25 +812,8 @@ static int check_cx(struct acpi_processo
         if ( local_apic_timer_c2_ok )
             break;
     case ACPI_STATE_C3:
-        if ( boot_cpu_has(X86_FEATURE_ARAT) )
-        {
-            lapic_timer_off = lapic_timer_nop;
-            lapic_timer_on = lapic_timer_nop;
-        }
-        else if ( hpet_broadcast_is_available() )
-        {
-            lapic_timer_off = hpet_broadcast_enter;
-            lapic_timer_on = hpet_broadcast_exit;
-        }
-        else if ( pit_broadcast_is_available() )
-        {
-            lapic_timer_off = pit_broadcast_enter;
-            lapic_timer_on = pit_broadcast_exit;
-        }
-        else
-        {
+        if ( !lapic_timer_init() )
             return -EINVAL;
-        }
 
         /* All the logic here assumes flags.bm_check is same across all CPUs */
         if ( bm_check_flag == -1 )
diff -r 8f658b463b78 -r b49f7bf52fa9 xen/arch/x86/cpu/mwait-idle.c
--- a/xen/arch/x86/cpu/mwait-idle.c	Fri Sep 21 17:02:46 2012 +0200
+++ b/xen/arch/x86/cpu/mwait-idle.c	Tue Sep 25 08:36:33 2012 +0200
@@ -56,6 +56,7 @@
 #include <xen/softirq.h>
 #include <xen/trace.h>
 #include <asm/cpuidle.h>
+#include <asm/hpet.h>
 #include <asm/mwait.h>
 #include <asm/msr.h>
 #include <acpi/cpufreq/cpufreq.h>
@@ -501,6 +502,12 @@ int __init mwait_idle_init(struct notifi
 
 	err = mwait_idle_probe();
 	if (!err) {
+		if (!boot_cpu_has(X86_FEATURE_ARAT))
+			hpet_broadcast_init();
+		if (!lapic_timer_init())
+			err = -EINVAL;
+	}
+	if (!err) {
 		nfb->notifier_call = mwait_idle_cpu_init;
 		mwait_idle_cpu_init(nfb, CPU_UP_PREPARE, NULL);
 
diff -r 8f658b463b78 -r b49f7bf52fa9 xen/arch/x86/hpet.c
--- a/xen/arch/x86/hpet.c	Fri Sep 21 17:02:46 2012 +0200
+++ b/xen/arch/x86/hpet.c	Tue Sep 25 08:36:33 2012 +0200
@@ -495,7 +495,7 @@ void __init hpet_broadcast_init(void)
     u32 hpet_id, cfg;
     unsigned int i, n;
 
-    if ( hpet_rate == 0 )
+    if ( hpet_rate == 0 || hpet_broadcast_is_available() )
         return;
 
     cfg = hpet_read32(HPET_CFG);
diff -r 8f658b463b78 -r b49f7bf52fa9 xen/include/asm-x86/cpuidle.h
--- a/xen/include/asm-x86/cpuidle.h	Fri Sep 21 17:02:46 2012 +0200
+++ b/xen/include/asm-x86/cpuidle.h	Tue Sep 25 08:36:33 2012 +0200
@@ -10,6 +10,7 @@ extern struct acpi_processor_power *proc
 
 extern void (*pm_idle_save)(void);
 
+bool_t lapic_timer_init(void);
 extern void (*lapic_timer_off)(void);
 extern void (*lapic_timer_on)(void);
 

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMdy-00084h-3u; Thu, 27 Sep 2012 22:33:18 +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 1THMdx-00081y-1L
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:17 +0000
Received: from [85.158.137.99:33583] by server-9.bemta-3.messagelabs.com id
	76/DA-20338-B24D4605; Thu, 27 Sep 2012 22:33:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-217.messagelabs.com!1348785193!14359396!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14268 invoked from network); 27 Sep 2012 22:33:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Sep 2012 22:33: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 1THMdt-0007HK-Gi
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdt-0003oO-9U
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:13 +0000
Message-Id: <E1THMdt-0003oO-9U@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl: resume the domain on suspend
	failure
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Bastian Blank <waldi@debian.org>
# Date 1348567431 -3600
# Node ID 16ee1d300cfd15fcb99f743763521d71e7d8b221
# Parent  795c493fe561040805385ef792e6afd6db2cd7ea
xl: resume the domain on suspend failure

The MUST macro calls exit(3) on failure but we need to cleanup and
resume.

Signed-off-by: Bastian Blank <waldi@debian.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 795c493fe561 -r 16ee1d300cfd tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Tue Sep 25 11:03:51 2012 +0100
+++ b/tools/libxl/xl_cmdimpl.c	Tue Sep 25 11:03:51 2012 +0100
@@ -2992,15 +2992,18 @@ static int save_domain(uint32_t domid, c
 
     save_domain_core_writeconfig(fd, filename, config_data, config_len);
 
-    MUST(libxl_domain_suspend(ctx, domid, fd, 0, NULL));
+    int rc = libxl_domain_suspend(ctx, domid, fd, 0, NULL);
     close(fd);
 
-    if (checkpoint)
+    if (rc < 0)
+        fprintf(stderr, "Failed to save domain, resuming domain\n");
+
+    if (checkpoint || rc < 0)
         libxl_domain_resume(ctx, domid, 1, 0);
     else
         libxl_domain_destroy(ctx, domid, 0);
 
-    exit(0);
+    exit(rc < 0 ? 1 : 0);
 }
 
 static pid_t create_migration_child(const char *rune, int *send_fd,

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMdy-00084h-3u; Thu, 27 Sep 2012 22:33:18 +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 1THMdx-00081y-1L
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:17 +0000
Received: from [85.158.137.99:33583] by server-9.bemta-3.messagelabs.com id
	76/DA-20338-B24D4605; Thu, 27 Sep 2012 22:33:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-217.messagelabs.com!1348785193!14359396!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14268 invoked from network); 27 Sep 2012 22:33:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Sep 2012 22:33: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 1THMdt-0007HK-Gi
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdt-0003oO-9U
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:13 +0000
Message-Id: <E1THMdt-0003oO-9U@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl: resume the domain on suspend
	failure
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Bastian Blank <waldi@debian.org>
# Date 1348567431 -3600
# Node ID 16ee1d300cfd15fcb99f743763521d71e7d8b221
# Parent  795c493fe561040805385ef792e6afd6db2cd7ea
xl: resume the domain on suspend failure

The MUST macro calls exit(3) on failure but we need to cleanup and
resume.

Signed-off-by: Bastian Blank <waldi@debian.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 795c493fe561 -r 16ee1d300cfd tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Tue Sep 25 11:03:51 2012 +0100
+++ b/tools/libxl/xl_cmdimpl.c	Tue Sep 25 11:03:51 2012 +0100
@@ -2992,15 +2992,18 @@ static int save_domain(uint32_t domid, c
 
     save_domain_core_writeconfig(fd, filename, config_data, config_len);
 
-    MUST(libxl_domain_suspend(ctx, domid, fd, 0, NULL));
+    int rc = libxl_domain_suspend(ctx, domid, fd, 0, NULL);
     close(fd);
 
-    if (checkpoint)
+    if (rc < 0)
+        fprintf(stderr, "Failed to save domain, resuming domain\n");
+
+    if (checkpoint || rc < 0)
         libxl_domain_resume(ctx, domid, 1, 0);
     else
         libxl_domain_destroy(ctx, domid, 0);
 
-    exit(0);
+    exit(rc < 0 ? 1 : 0);
 }
 
 static pid_t create_migration_child(const char *rune, int *send_fd,

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22:33:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1THMdv-000824-Rh; Thu, 27 Sep 2012 22:33:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdu-00081M-PU
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:14 +0000
Received: from [85.158.143.35:19185] by server-3.bemta-4.messagelabs.com id
	5F/50-10986-A24D4605; Thu, 27 Sep 2012 22:33:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-21.messagelabs.com!1348785192!4440849!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12386 invoked from network); 27 Sep 2012 22:33: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 Sep 2012 22: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 1THMds-0007HE-8o
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMds-0003nu-7W
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:12 +0000
Message-Id: <E1THMds-0003nu-7W@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/S3: add cache flush on secondary
	CPUs before going to sleep
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ben Guthro <ben@guthro.net>
# Date 1348555094 -7200
# Node ID c8d65d91a6f20fa7fae905bbf172e59b335d6371
# Parent  b49f7bf52fa92626517386cba89350243b808871
x86/S3: add cache flush on secondary CPUs before going to sleep

Secondary CPUs, between doing their final memory writes (particularly
updating cpu_initialized) and getting a subsequent INIT, may not write
back all modified data. The INIT itself then causes those modifications
to be lost, so in the cpu_initialized case the CPU would find itself
already initialized, (intentionally) entering an infinite loop instead
of actually coming online.

Signed-off-by: Ben Guthro <ben@guthro.net>

Make acpi_dead_idle() call default_dead_idle() rather than duplicating
the logic there.

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


diff -r b49f7bf52fa9 -r c8d65d91a6f2 xen/arch/x86/acpi/cpu_idle.c
--- a/xen/arch/x86/acpi/cpu_idle.c	Tue Sep 25 08:36:33 2012 +0200
+++ b/xen/arch/x86/acpi/cpu_idle.c	Tue Sep 25 08:38:14 2012 +0200
@@ -659,8 +659,7 @@ void acpi_dead_idle(void)
     }
 
 default_halt:
-    for ( ; ; )
-        halt();
+    default_dead_idle();
 }
 
 int cpuidle_init_cpu(unsigned int cpu)
diff -r b49f7bf52fa9 -r c8d65d91a6f2 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c	Tue Sep 25 08:36:33 2012 +0200
+++ b/xen/arch/x86/domain.c	Tue Sep 25 08:38:14 2012 +0200
@@ -45,6 +45,7 @@
 #include <asm/desc.h>
 #include <asm/i387.h>
 #include <asm/xstate.h>
+#include <asm/cpuidle.h>
 #include <asm/mpspec.h>
 #include <asm/ldt.h>
 #include <asm/fixmap.h>
@@ -64,7 +65,6 @@ DEFINE_PER_CPU(struct vcpu *, curr_vcpu)
 DEFINE_PER_CPU(unsigned long, cr4);
 
 static void default_idle(void);
-static void default_dead_idle(void);
 void (*pm_idle) (void) __read_mostly = default_idle;
 void (*dead_idle) (void) __read_mostly = default_dead_idle;
 
@@ -82,8 +82,14 @@ static void default_idle(void)
         local_irq_enable();
 }
 
-static void default_dead_idle(void)
+void default_dead_idle(void)
 {
+    /*
+     * When going into S3, without flushing caches modified data may be
+     * held by the CPUs spinning here indefinitely, and get discarded by
+     * a subsequent INIT.
+     */
+    wbinvd();
     for ( ; ; )
         halt();
 }
diff -r b49f7bf52fa9 -r c8d65d91a6f2 xen/include/asm-x86/cpuidle.h
--- a/xen/include/asm-x86/cpuidle.h	Tue Sep 25 08:36:33 2012 +0200
+++ b/xen/include/asm-x86/cpuidle.h	Tue Sep 25 08:38:14 2012 +0200
@@ -18,6 +18,7 @@ extern uint64_t (*cpuidle_get_tick)(void
 
 int mwait_idle_init(struct notifier_block *);
 int cpuidle_init_cpu(unsigned int cpu);
+void default_dead_idle(void);
 void acpi_dead_idle(void);
 void trace_exit_reason(u32 *irq_traced);
 void update_idle_stats(struct acpi_processor_power *,

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22:33:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1THMdy-00084m-6d; Thu, 27 Sep 2012 22:33:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdx-00081M-5U
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:17 +0000
Received: from [85.158.143.99:30747] by server-3.bemta-4.messagelabs.com id
	93/60-10986-C24D4605; Thu, 27 Sep 2012 22:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-216.messagelabs.com!1348785194!31718412!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.4 required=7.0 tests=INFO_TLD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1335 invoked from network); 27 Sep 2012 22:33:14 -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;
	27 Sep 2012 22:33: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 1THMdt-0007HN-RM
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdt-0003od-QC
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:13 +0000
Message-Id: <E1THMdt-0003od-QC@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools: bump SONAMEs for changes
	during 4.2 development cycle.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1348576800 -3600
# Node ID 0a64f1a3f72c780a3c1b525de19096d869668349
# Parent  16ee1d300cfd15fcb99f743763521d71e7d8b221
tools: bump SONAMEs for changes during 4.2 development cycle.

We mostly did this as we went along, only a couple of minor number
bumps were missed http://marc.info/?l=xen-devel&m=134366054929255&w=2:
 - Bumped libxl from 1.0.0 -> 1.0.1
 - Bumped libxenstore from 3.0.1 -> 3.0.2

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


diff -r 16ee1d300cfd -r 0a64f1a3f72c tools/libxl/Makefile
--- a/tools/libxl/Makefile	Tue Sep 25 11:03:51 2012 +0100
+++ b/tools/libxl/Makefile	Tue Sep 25 13:40:00 2012 +0100
@@ -9,7 +9,7 @@ MAJOR = 2.0
 MINOR = 0
 
 XLUMAJOR = 1.0
-XLUMINOR = 0
+XLUMINOR = 1
 
 CFLAGS += -Werror -Wno-format-zero-length -Wmissing-declarations \
 	-Wno-declaration-after-statement -Wformat-nonliteral
diff -r 16ee1d300cfd -r 0a64f1a3f72c tools/xenstore/Makefile
--- a/tools/xenstore/Makefile	Tue Sep 25 11:03:51 2012 +0100
+++ b/tools/xenstore/Makefile	Tue Sep 25 13:40:00 2012 +0100
@@ -2,7 +2,7 @@ XEN_ROOT=$(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
 MAJOR = 3.0
-MINOR = 1
+MINOR = 2
 
 CFLAGS += -Werror
 CFLAGS += -I.

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22:33:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1THMdv-000824-Rh; Thu, 27 Sep 2012 22:33:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdu-00081M-PU
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:14 +0000
Received: from [85.158.143.35:19185] by server-3.bemta-4.messagelabs.com id
	5F/50-10986-A24D4605; Thu, 27 Sep 2012 22:33:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-21.messagelabs.com!1348785192!4440849!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12386 invoked from network); 27 Sep 2012 22:33: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 Sep 2012 22: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 1THMds-0007HE-8o
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMds-0003nu-7W
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:12 +0000
Message-Id: <E1THMds-0003nu-7W@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/S3: add cache flush on secondary
	CPUs before going to sleep
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ben Guthro <ben@guthro.net>
# Date 1348555094 -7200
# Node ID c8d65d91a6f20fa7fae905bbf172e59b335d6371
# Parent  b49f7bf52fa92626517386cba89350243b808871
x86/S3: add cache flush on secondary CPUs before going to sleep

Secondary CPUs, between doing their final memory writes (particularly
updating cpu_initialized) and getting a subsequent INIT, may not write
back all modified data. The INIT itself then causes those modifications
to be lost, so in the cpu_initialized case the CPU would find itself
already initialized, (intentionally) entering an infinite loop instead
of actually coming online.

Signed-off-by: Ben Guthro <ben@guthro.net>

Make acpi_dead_idle() call default_dead_idle() rather than duplicating
the logic there.

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


diff -r b49f7bf52fa9 -r c8d65d91a6f2 xen/arch/x86/acpi/cpu_idle.c
--- a/xen/arch/x86/acpi/cpu_idle.c	Tue Sep 25 08:36:33 2012 +0200
+++ b/xen/arch/x86/acpi/cpu_idle.c	Tue Sep 25 08:38:14 2012 +0200
@@ -659,8 +659,7 @@ void acpi_dead_idle(void)
     }
 
 default_halt:
-    for ( ; ; )
-        halt();
+    default_dead_idle();
 }
 
 int cpuidle_init_cpu(unsigned int cpu)
diff -r b49f7bf52fa9 -r c8d65d91a6f2 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c	Tue Sep 25 08:36:33 2012 +0200
+++ b/xen/arch/x86/domain.c	Tue Sep 25 08:38:14 2012 +0200
@@ -45,6 +45,7 @@
 #include <asm/desc.h>
 #include <asm/i387.h>
 #include <asm/xstate.h>
+#include <asm/cpuidle.h>
 #include <asm/mpspec.h>
 #include <asm/ldt.h>
 #include <asm/fixmap.h>
@@ -64,7 +65,6 @@ DEFINE_PER_CPU(struct vcpu *, curr_vcpu)
 DEFINE_PER_CPU(unsigned long, cr4);
 
 static void default_idle(void);
-static void default_dead_idle(void);
 void (*pm_idle) (void) __read_mostly = default_idle;
 void (*dead_idle) (void) __read_mostly = default_dead_idle;
 
@@ -82,8 +82,14 @@ static void default_idle(void)
         local_irq_enable();
 }
 
-static void default_dead_idle(void)
+void default_dead_idle(void)
 {
+    /*
+     * When going into S3, without flushing caches modified data may be
+     * held by the CPUs spinning here indefinitely, and get discarded by
+     * a subsequent INIT.
+     */
+    wbinvd();
     for ( ; ; )
         halt();
 }
diff -r b49f7bf52fa9 -r c8d65d91a6f2 xen/include/asm-x86/cpuidle.h
--- a/xen/include/asm-x86/cpuidle.h	Tue Sep 25 08:36:33 2012 +0200
+++ b/xen/include/asm-x86/cpuidle.h	Tue Sep 25 08:38:14 2012 +0200
@@ -18,6 +18,7 @@ extern uint64_t (*cpuidle_get_tick)(void
 
 int mwait_idle_init(struct notifier_block *);
 int cpuidle_init_cpu(unsigned int cpu);
+void default_dead_idle(void);
 void acpi_dead_idle(void);
 void trace_exit_reason(u32 *irq_traced);
 void update_idle_stats(struct acpi_processor_power *,

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22:33:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1THMdy-00084m-6d; Thu, 27 Sep 2012 22:33:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdx-00081M-5U
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:17 +0000
Received: from [85.158.143.99:30747] by server-3.bemta-4.messagelabs.com id
	93/60-10986-C24D4605; Thu, 27 Sep 2012 22:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-216.messagelabs.com!1348785194!31718412!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.4 required=7.0 tests=INFO_TLD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1335 invoked from network); 27 Sep 2012 22:33:14 -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;
	27 Sep 2012 22:33: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 1THMdt-0007HN-RM
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdt-0003od-QC
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:13 +0000
Message-Id: <E1THMdt-0003od-QC@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools: bump SONAMEs for changes
	during 4.2 development cycle.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1348576800 -3600
# Node ID 0a64f1a3f72c780a3c1b525de19096d869668349
# Parent  16ee1d300cfd15fcb99f743763521d71e7d8b221
tools: bump SONAMEs for changes during 4.2 development cycle.

We mostly did this as we went along, only a couple of minor number
bumps were missed http://marc.info/?l=xen-devel&m=134366054929255&w=2:
 - Bumped libxl from 1.0.0 -> 1.0.1
 - Bumped libxenstore from 3.0.1 -> 3.0.2

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


diff -r 16ee1d300cfd -r 0a64f1a3f72c tools/libxl/Makefile
--- a/tools/libxl/Makefile	Tue Sep 25 11:03:51 2012 +0100
+++ b/tools/libxl/Makefile	Tue Sep 25 13:40:00 2012 +0100
@@ -9,7 +9,7 @@ MAJOR = 2.0
 MINOR = 0
 
 XLUMAJOR = 1.0
-XLUMINOR = 0
+XLUMINOR = 1
 
 CFLAGS += -Werror -Wno-format-zero-length -Wmissing-declarations \
 	-Wno-declaration-after-statement -Wformat-nonliteral
diff -r 16ee1d300cfd -r 0a64f1a3f72c tools/xenstore/Makefile
--- a/tools/xenstore/Makefile	Tue Sep 25 11:03:51 2012 +0100
+++ b/tools/xenstore/Makefile	Tue Sep 25 13:40:00 2012 +0100
@@ -2,7 +2,7 @@ XEN_ROOT=$(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
 MAJOR = 3.0
-MINOR = 1
+MINOR = 2
 
 CFLAGS += -Werror
 CFLAGS += -I.

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22:33:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1THMdy-00084c-0o; Thu, 27 Sep 2012 22:33:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdv-00081x-OC
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:16 +0000
Received: from [85.158.143.35:19203] by server-2.bemta-4.messagelabs.com id
	C6/FB-06610-B24D4605; Thu, 27 Sep 2012 22:33:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-21.messagelabs.com!1348785190!20184718!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22633 invoked from network); 27 Sep 2012 22:33:11 -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 Sep 2012 22: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 1THMdq-0007H2-2h
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdq-0003mt-18
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:10 +0000
Message-Id: <E1THMdq-0003mt-18@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] printk: prefer %#x et at over 0x%x
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348230312 -7200
# Node ID c8873f13cec3246a5e78939588e60fd930a3abb3
# Parent  1e6e6b49b4ac318cb86f413be680fe182e4d9511
printk: prefer %#x et at over 0x%x

Performance is not an issue with printk(), so let the function do
minimally more work and instead save a byte per affected format
specifier.

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


diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/acpi/boot.c
--- a/xen/arch/x86/acpi/boot.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/acpi/boot.c	Fri Sep 21 14:25:12 2012 +0200
@@ -341,14 +341,14 @@ acpi_fadt_parse_sleep_info(struct acpi_t
 	}
 
 	if (facs->length < 24) {
-		printk(KERN_ERR PREFIX "Invalid FACS table length: 0x%x",
+		printk(KERN_ERR PREFIX "Invalid FACS table length: %#x",
 			facs->length);
 		goto bad;
 	}
 
 	if (facs->length < 64)
 		printk(KERN_WARNING PREFIX
-			"FACS is shorter than ACPI spec allow: 0x%x",
+			"FACS is shorter than ACPI spec allow: %#x",
 			facs->length);
 
 	acpi_sinfo.wakeup_vector = facs_pa + 
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/acpi/cpu_idle.c
--- a/xen/arch/x86/acpi/cpu_idle.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/acpi/cpu_idle.c	Fri Sep 21 14:25:12 2012 +0200
@@ -978,11 +978,11 @@ static void print_cx_pminfo(uint32_t cpu
             return;
         
         printk("\tstates[%d]:\n", i);
-        printk("\t\treg.space_id = 0x%x\n", state.reg.space_id);
-        printk("\t\treg.bit_width = 0x%x\n", state.reg.bit_width);
-        printk("\t\treg.bit_offset = 0x%x\n", state.reg.bit_offset);
-        printk("\t\treg.access_size = 0x%x\n", state.reg.access_size);
-        printk("\t\treg.address = 0x%"PRIx64"\n", state.reg.address);
+        printk("\t\treg.space_id = %#x\n", state.reg.space_id);
+        printk("\t\treg.bit_width = %#x\n", state.reg.bit_width);
+        printk("\t\treg.bit_offset = %#x\n", state.reg.bit_offset);
+        printk("\t\treg.access_size = %#x\n", state.reg.access_size);
+        printk("\t\treg.address = %#"PRIx64"\n", state.reg.address);
         printk("\t\ttype    = %d\n", state.type);
         printk("\t\tlatency = %d\n", state.latency);
         printk("\t\tpower   = %d\n", state.power);
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/apic.c
--- a/xen/arch/x86/apic.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/apic.c	Fri Sep 21 14:25:12 2012 +0200
@@ -689,7 +689,7 @@ void __devinit setup_local_APIC(void)
         value = apic_read(APIC_ESR);
         if (value != oldvalue)
             apic_printk(APIC_VERBOSE, "ESR value before enabling "
-                        "vector: 0x%08lx  after: 0x%08lx\n",
+                        "vector: %#lx  after: %#lx\n",
                         oldvalue, value);
     } else {
         if (esr_disable)    
@@ -1210,7 +1210,7 @@ static int __init calibrate_APIC_clock(v
     bus_cycle  = (u32) (1000000000000LL/bus_freq); /* in pico seconds */
     bus_scale  = (1000*262144)/bus_cycle;
 
-    apic_printk(APIC_VERBOSE, "..... bus_scale = 0x%08X\n", bus_scale);
+    apic_printk(APIC_VERBOSE, "..... bus_scale = %#x\n", bus_scale);
     /* reset APIC to zero timeout value */
     __setup_APIC_LVTT(0);
 
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/cpu/mcheck/mce.c
--- a/xen/arch/x86/cpu/mcheck/mce.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/mce.c	Fri Sep 21 14:25:12 2012 +0200
@@ -1147,7 +1147,7 @@ static int x86_mc_msrinject_verify(struc
         }
 
         if (reason != NULL) {
-            printk("HV MSR INJECT ERROR: MSR 0x%llx %s\n",
+            printk("HV MSR INJECT ERROR: MSR %#Lx %s\n",
                    (unsigned long long)mci->mcinj_msr[i].reg, reason);
             errs++;
         }
@@ -1191,8 +1191,7 @@ static void x86_mc_msrinject(void *data)
 
     for (i = 0, msr = &mci->mcinj_msr[0];
          i < mci->mcinj_count; i++, msr++) {
-        printk("HV MSR INJECT (%s) target %u actual %u MSR 0x%llx "
-               "<-- 0x%llx\n",
+        printk("HV MSR INJECT (%s) target %u actual %u MSR %#Lx <-- %#Lx\n",
                intpose ?  "interpose" : "hardware",
                mci->mcinj_cpunr, smp_processor_id(),
                (unsigned long long)msr->reg,
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/cpu/mcheck/vmce.c
--- a/xen/arch/x86/cpu/mcheck/vmce.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/vmce.c	Fri Sep 21 14:25:12 2012 +0200
@@ -88,7 +88,7 @@ static int bank_mce_rdmsr(const struct v
     case MSR_IA32_MC0_CTL:
         /* stick all 1's to MCi_CTL */
         *val = ~0UL;
-        mce_printk(MCE_VERBOSE, "MCE: rdmsr MC%u_CTL 0x%"PRIx64"\n",
+        mce_printk(MCE_VERBOSE, "MCE: rdmsr MC%u_CTL %#"PRIx64"\n",
                    bank, *val);
         break;
     case MSR_IA32_MC0_STATUS:
@@ -102,7 +102,7 @@ static int bank_mce_rdmsr(const struct v
                 *val = entry->mci_status;
                 mce_printk(MCE_VERBOSE,
                            "MCE: rd MC%u_STATUS in vMCE# context "
-                           "value 0x%"PRIx64"\n", bank, *val);
+                           "value %#"PRIx64"\n", bank, *val);
             }
         }
         break;
@@ -116,7 +116,7 @@ static int bank_mce_rdmsr(const struct v
                 *val = entry->mci_addr;
                 mce_printk(MCE_VERBOSE,
                            "MCE: rdmsr MC%u_ADDR in vMCE# context "
-                           "0x%"PRIx64"\n", bank, *val);
+                           "%#"PRIx64"\n", bank, *val);
             }
         }
         break;
@@ -130,7 +130,7 @@ static int bank_mce_rdmsr(const struct v
                 *val = entry->mci_misc;
                 mce_printk(MCE_VERBOSE,
                            "MCE: rd MC%u_MISC in vMCE# context "
-                           "0x%"PRIx64"\n", bank, *val);
+                           "%#"PRIx64"\n", bank, *val);
             }
         }
         break;
@@ -171,18 +171,18 @@ int vmce_rdmsr(uint32_t msr, uint64_t *v
         *val = vmce->mcg_status;
         if (*val)
             mce_printk(MCE_VERBOSE,
-                       "MCE: rdmsr MCG_STATUS 0x%"PRIx64"\n", *val);
+                       "MCE: rdmsr MCG_STATUS %#"PRIx64"\n", *val);
         break;
     case MSR_IA32_MCG_CAP:
         *val = cur->arch.mcg_cap;
-        mce_printk(MCE_VERBOSE, "MCE: rdmsr MCG_CAP 0x%"PRIx64"\n",
+        mce_printk(MCE_VERBOSE, "MCE: rdmsr MCG_CAP %#"PRIx64"\n",
                    *val);
         break;
     case MSR_IA32_MCG_CTL:
         /* Stick all 1's when CTL support, and 0's when no CTL support */
         if ( cur->arch.mcg_cap & MCG_CTL_P )
             *val = ~0ULL;
-        mce_printk(MCE_VERBOSE, "MCE: rdmsr MCG_CTL 0x%"PRIx64"\n", *val);
+        mce_printk(MCE_VERBOSE, "MCE: rdmsr MCG_CTL %#"PRIx64"\n", *val);
         break;
     default:
         ret = mce_bank_msr(cur, msr) ? bank_mce_rdmsr(cur, msr, val) : 0;
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/cpu/mtrr/generic.c
--- a/xen/arch/x86/cpu/mtrr/generic.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/cpu/mtrr/generic.c	Fri Sep 21 14:25:12 2012 +0200
@@ -410,7 +410,7 @@ int generic_validate_add_page(unsigned l
 	    boot_cpu_data.x86_model == 1 &&
 	    boot_cpu_data.x86_mask <= 7) {
 		if (base & ((1 << (22 - PAGE_SHIFT)) - 1)) {
-			printk(KERN_WARNING "mtrr: base(0x%lx000) is not 4 MiB aligned\n", base);
+			printk(KERN_WARNING "mtrr: base(%#lx000) is not 4 MiB aligned\n", base);
 			return -EINVAL;
 		}
 		if (!(base + size < 0x70000 || base > 0x7003F) &&
@@ -427,7 +427,7 @@ int generic_validate_add_page(unsigned l
 	for (lbase = base; !(lbase & 1) && (last & 1);
 	     lbase = lbase >> 1, last = last >> 1) ;
 	if (lbase != last) {
-		printk(KERN_WARNING "mtrr: base(0x%lx000) is not aligned on a size(0x%lx000) boundary\n",
+		printk(KERN_WARNING "mtrr: base(%#lx000) is not aligned on a size(%#lx000) boundary\n",
 		       base, size);
 		return -EINVAL;
 	}
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/cpu/mtrr/main.c
--- a/xen/arch/x86/cpu/mtrr/main.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/cpu/mtrr/main.c	Fri Sep 21 14:25:12 2012 +0200
@@ -366,8 +366,8 @@ int mtrr_add_page(unsigned long base, un
 					continue;
 			}
 			printk(KERN_WARNING
-			       "mtrr: 0x%lx000,0x%lx000 overlaps existing"
-			       " 0x%lx000,0x%lx000\n", base, size, lbase,
+			       "mtrr: %#lx000,%#lx000 overlaps existing"
+			       " %#lx000,%#lx000\n", base, size, lbase,
 			       lsize);
 			goto out;
 		}
@@ -412,7 +412,7 @@ static int mtrr_check(unsigned long base
 		printk(KERN_WARNING
 			"mtrr: size and base must be multiples of 4 kiB\n");
 		printk(KERN_DEBUG
-			"mtrr: size: 0x%lx  base: 0x%lx\n", size, base);
+			"mtrr: size: %#lx  base: %#lx\n", size, base);
 		dump_stack();
 		return -1;
 	}
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/domain_build.c
--- a/xen/arch/x86/domain_build.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/domain_build.c	Fri Sep 21 14:25:12 2012 +0200
@@ -396,13 +396,13 @@ int __init construct_dom0(
     }
     if (elf_64bit(&elf) && machine == EM_X86_64)
         compatible = 1;
-    printk(" Dom0 kernel: %s%s, %s, paddr 0x%" PRIx64 " -> 0x%" PRIx64 "\n",
+    printk(" Dom0 kernel: %s%s, %s, paddr %#" PRIx64 " -> %#" PRIx64 "\n",
            elf_64bit(&elf) ? "64-bit" : "32-bit",
            parms.pae       ? ", PAE"  : "",
            elf_msb(&elf)   ? "msb"    : "lsb",
            elf.pstart, elf.pend);
     if ( elf.bsd_symtab_pstart )
-        printk(" Dom0 symbol map 0x%" PRIx64 " -> 0x%" PRIx64 "\n",
+        printk(" Dom0 symbol map %#" PRIx64 " -> %#" PRIx64 "\n",
                elf.bsd_symtab_pstart, elf.bsd_symtab_pend);
 
     if ( !compatible )
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/hvm/hvm.c	Fri Sep 21 14:25:12 2012 +0200
@@ -1468,7 +1468,7 @@ int hvm_set_efer(uint64_t value)
     if ( !hvm_efer_valid(v->domain, value, efer_validbits) )
     {
         gdprintk(XENLOG_WARNING, "Trying to set reserved bit in "
-                 "EFER: 0x%"PRIx64"\n", value);
+                 "EFER: %#"PRIx64"\n", value);
         hvm_inject_hw_exception(TRAP_gp_fault, 0);
         return X86EMUL_EXCEPTION;
     }
@@ -4095,7 +4095,7 @@ long do_hvm_op(unsigned long op, XEN_GUE
             {
                 put_gfn(d, pfn);
                 gdprintk(XENLOG_WARNING,
-                         "type for pfn 0x%lx changed to grant while "
+                         "type for pfn %#lx changed to grant while "
                          "we were working?\n", pfn);
                 goto param_fail4;
             }
@@ -4106,7 +4106,7 @@ long do_hvm_op(unsigned long op, XEN_GUE
                 {
                     put_gfn(d, pfn);
                     gdprintk(XENLOG_WARNING,
-                             "type of pfn 0x%lx changed from %d to %d while "
+                             "type of pfn %#lx changed from %d to %d while "
                              "we were trying to change it to %d\n",
                              pfn, t, nt, memtype[a.hvmmem_type]);
                     goto param_fail4;
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/hvm/io.c
--- a/xen/arch/x86/hvm/io.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/hvm/io.c	Fri Sep 21 14:25:12 2012 +0200
@@ -393,7 +393,7 @@ int dpci_ioport_intercept(ioreq_t *p)
 
     if ( !ioports_access_permitted(d, mport, mport + p->size - 1) ) 
     {
-        gdprintk(XENLOG_ERR, "Error: access to gport=0x%x denied!\n",
+        gdprintk(XENLOG_ERR, "Error: access to gport=%#x denied!\n",
                  (uint32_t)p->addr);
         return X86EMUL_UNHANDLEABLE;
     }
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/hvm/irq.c
--- a/xen/arch/x86/hvm/irq.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/hvm/irq.c	Fri Sep 21 14:25:12 2012 +0200
@@ -488,7 +488,7 @@ static void irq_dump(struct domain *d)
            hvm_irq->pci_link_assert_count[1],
            hvm_irq->pci_link_assert_count[2],
            hvm_irq->pci_link_assert_count[3]);
-    printk("Callback via %i:0x%"PRIx32",%s asserted\n", 
+    printk("Callback via %i:%#"PRIx32",%s asserted\n",
            hvm_irq->callback_via_type, hvm_irq->callback_via.gsi, 
            hvm_irq->callback_via_asserted ? "" : " not");
 }
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/hvm/svm/intr.c
--- a/xen/arch/x86/hvm/svm/intr.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/hvm/svm/intr.c	Fri Sep 21 14:25:12 2012 +0200
@@ -175,7 +175,7 @@ void svm_intr_assist(void)
                 /* Guest already enabled an interrupt window. */
                 return;
             default:
-                panic("%s: nestedsvm_vcpu_interrupt can't handle value 0x%x\n",
+                panic("%s: nestedsvm_vcpu_interrupt can't handle value %#x\n",
                     __func__, rc);
             }
         }
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/hvm/svm/nestedsvm.c
--- a/xen/arch/x86/hvm/svm/nestedsvm.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c	Fri Sep 21 14:25:12 2012 +0200
@@ -943,7 +943,7 @@ nsvm_vmcb_guest_intercepts_exitcode(stru
         break;
 
     default:
-        gdprintk(XENLOG_ERR, "Illegal exitcode 0x%"PRIx64"\n", exitcode);
+        gdprintk(XENLOG_ERR, "Illegal exitcode %#"PRIx64"\n", exitcode);
         BUG();
         break;
     }
@@ -1235,7 +1235,7 @@ int nsvm_wrmsr(struct vcpu *v, unsigned 
     case MSR_K8_VM_HSAVE_PA:
         if (!nestedsvm_vmcb_isvalid(v, msr_content)) {
             gdprintk(XENLOG_ERR,
-                "MSR_K8_VM_HSAVE_PA value invalid 0x%"PRIx64"\n", msr_content);
+                "MSR_K8_VM_HSAVE_PA value invalid %#"PRIx64"\n", msr_content);
             ret = -1; /* inject #GP */
             break;
         }
@@ -1244,7 +1244,7 @@ int nsvm_wrmsr(struct vcpu *v, unsigned 
     case MSR_AMD64_TSC_RATIO:
         if ((msr_content & ~TSC_RATIO_RSVD_BITS) != msr_content) {
             gdprintk(XENLOG_ERR,
-                "reserved bits set in MSR_AMD64_TSC_RATIO 0x%"PRIx64"\n",
+                "reserved bits set in MSR_AMD64_TSC_RATIO %#"PRIx64"\n",
                 msr_content);
             ret = -1; /* inject #GP */
             break;
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/hvm/svm/svm.c	Fri Sep 21 14:25:12 2012 +0200
@@ -241,7 +241,7 @@ static int svm_vmcb_restore(struct vcpu 
          ((c->pending_type == 1) || (c->pending_type > 6) ||
           (c->pending_reserved != 0)) )
     {
-        gdprintk(XENLOG_ERR, "Invalid pending event 0x%"PRIx32".\n",
+        gdprintk(XENLOG_ERR, "Invalid pending event %#"PRIx32".\n",
                  c->pending_event);
         return -EINVAL;
     }
@@ -254,7 +254,7 @@ static int svm_vmcb_restore(struct vcpu 
                                      NULL, P2M_ALLOC);
             if ( !page )
             {
-                gdprintk(XENLOG_ERR, "Invalid CR3 value=0x%"PRIx64"\n",
+                gdprintk(XENLOG_ERR, "Invalid CR3 value=%#"PRIx64"\n",
                          c->cr3);
                 return -EINVAL;
             }
@@ -289,7 +289,7 @@ static int svm_vmcb_restore(struct vcpu 
 
     if ( c->pending_valid ) 
     {
-        gdprintk(XENLOG_INFO, "Re-injecting 0x%"PRIx32", 0x%"PRIx32"\n",
+        gdprintk(XENLOG_INFO, "Re-injecting %#"PRIx32", %#"PRIx32"\n",
                  c->pending_event, c->error_code);
 
         if ( hvm_event_needs_reinjection(c->pending_type, c->pending_vector) )
@@ -2398,8 +2398,8 @@ void svm_vmexit_handler(struct cpu_user_
 
     default:
     exit_and_crash:
-        gdprintk(XENLOG_ERR, "unexpected VMEXIT: exit reason = 0x%"PRIx64", "
-                 "exitinfo1 = %"PRIx64", exitinfo2 = %"PRIx64"\n",
+        gdprintk(XENLOG_ERR, "unexpected VMEXIT: exit reason = %#"PRIx64", "
+                 "exitinfo1 = %#"PRIx64", exitinfo2 = %#"PRIx64"\n",
                  exit_reason, 
                  (u64)vmcb->exitinfo1, (u64)vmcb->exitinfo2);
         domain_crash(v->domain);
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/hvm/svm/svmdebug.c
--- a/xen/arch/x86/hvm/svm/svmdebug.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/hvm/svm/svmdebug.c	Fri Sep 21 14:25:12 2012 +0200
@@ -32,33 +32,32 @@ static void svm_dump_sel(const char *nam
 void svm_vmcb_dump(const char *from, struct vmcb_struct *vmcb)
 {
     printk("Dumping guest's current state at %s...\n", from);
-    printk("Size of VMCB = %d, paddr = 0x%016lx, vaddr = %p\n",
+    printk("Size of VMCB = %d, paddr = %#lx, vaddr = %p\n",
            (int) sizeof(struct vmcb_struct), virt_to_maddr(vmcb), vmcb);
 
-    printk("cr_intercepts = 0x%08x dr_intercepts = 0x%08x "
-           "exception_intercepts = 0x%08x\n", 
+    printk("cr_intercepts = %#x dr_intercepts = %#x "
+           "exception_intercepts = %#x\n",
            vmcb->_cr_intercepts, vmcb->_dr_intercepts, 
            vmcb->_exception_intercepts);
-    printk("general1_intercepts = 0x%08x general2_intercepts = 0x%08x\n", 
+    printk("general1_intercepts = %#x general2_intercepts = %#x\n",
            vmcb->_general1_intercepts, vmcb->_general2_intercepts);
-    printk("iopm_base_pa = 0x%016llx msrpm_base_pa = 0x%016llx tsc_offset = "
-            "0x%016llx\n", 
+    printk("iopm_base_pa = %#Lx msrpm_base_pa = %#Lx tsc_offset = %#Lx\n",
            (unsigned long long)vmcb->_iopm_base_pa,
            (unsigned long long)vmcb->_msrpm_base_pa,
            (unsigned long long)vmcb->_tsc_offset);
-    printk("tlb_control = 0x%08x vintr = 0x%016llx interrupt_shadow = "
-            "0x%016llx\n", vmcb->tlb_control,
+    printk("tlb_control = %#x vintr = %#Lx interrupt_shadow = %#Lx\n",
+           vmcb->tlb_control,
            (unsigned long long)vmcb->_vintr.bytes,
            (unsigned long long)vmcb->interrupt_shadow);
-    printk("exitcode = 0x%016llx exitintinfo = 0x%016llx\n", 
+    printk("exitcode = %#Lx exitintinfo = %#Lx\n",
            (unsigned long long)vmcb->exitcode,
            (unsigned long long)vmcb->exitintinfo.bytes);
-    printk("exitinfo1 = 0x%016llx exitinfo2 = 0x%016llx \n",
+    printk("exitinfo1 = %#Lx exitinfo2 = %#Lx \n",
            (unsigned long long)vmcb->exitinfo1,
            (unsigned long long)vmcb->exitinfo2);
-    printk("np_enable = 0x%016llx guest_asid = 0x%03x\n", 
+    printk("np_enable = %Lx guest_asid = %#x\n",
            (unsigned long long)vmcb->_np_enable, vmcb->_guest_asid);
-    printk("cpl = %d efer = 0x%016llx star = 0x%016llx lstar = 0x%016llx\n", 
+    printk("cpl = %d efer = %#Lx star = %#Lx lstar = %#Lx\n",
            vmcb->_cpl, (unsigned long long)vmcb->_efer,
            (unsigned long long)vmcb->star, (unsigned long long)vmcb->lstar);
     printk("CR0 = 0x%016llx CR2 = 0x%016llx\n",
@@ -77,7 +76,7 @@ void svm_vmcb_dump(const char *from, str
     printk("KernGSBase = 0x%016llx PAT = 0x%016llx \n", 
            (unsigned long long)vmcb->kerngsbase,
            (unsigned long long)vmcb->_g_pat);
-    printk("H_CR3 = 0x%016llx CleanBits = 0x%08x\n",
+    printk("H_CR3 = 0x%016llx CleanBits = %#x\n",
            (unsigned long long)vmcb->_h_cr3, vmcb->cleanbits.bytes);
 
     /* print out all the selectors */
@@ -104,48 +103,48 @@ svm_vmcb_isvalid(const char *from, struc
     } else return 1;
 
     if ((vmcb->_efer & EFER_SVME) == 0) {
-        PRINTF("EFER: SVME bit not set (0x%"PRIx64")\n", vmcb->_efer);
+        PRINTF("EFER: SVME bit not set (%#"PRIx64")\n", vmcb->_efer);
     }
 
     if ((vmcb->_cr0 & X86_CR0_CD) == 0 && (vmcb->_cr0 & X86_CR0_NW) != 0) {
-        PRINTF("CR0: CD bit is zero and NW bit set (0x%"PRIx64")\n",
+        PRINTF("CR0: CD bit is zero and NW bit set (%#"PRIx64")\n",
                 vmcb->_cr0);
     }
 
     if ((vmcb->_cr0 >> 32U) != 0) {
-        PRINTF("CR0: bits [63:32] are not zero (0x%"PRIx64")\n",
+        PRINTF("CR0: bits [63:32] are not zero (%#"PRIx64")\n",
                 vmcb->_cr0);
     }
 
     if ((vmcb->_cr3 & 0x7) != 0) {
-        PRINTF("CR3: MBZ bits are set (0x%"PRIx64")\n", vmcb->_cr3);
+        PRINTF("CR3: MBZ bits are set (%#"PRIx64")\n", vmcb->_cr3);
     }
     if ((vmcb->_efer & EFER_LMA) && (vmcb->_cr3 & 0xfe) != 0) {
-        PRINTF("CR3: MBZ bits are set (0x%"PRIx64")\n", vmcb->_cr3);
+        PRINTF("CR3: MBZ bits are set (%#"PRIx64")\n", vmcb->_cr3);
     }
 
     if ((vmcb->_cr4 >> 19U) != 0) {
-        PRINTF("CR4: bits [63:19] are not zero (0x%"PRIx64")\n",
+        PRINTF("CR4: bits [63:19] are not zero (%#"PRIx64")\n",
                 vmcb->_cr4);
     }
 
     if (((vmcb->_cr4 >> 11U) & 0x7fU) != 0) {
-        PRINTF("CR4: bits [17:11] are not zero (0x%"PRIx64")\n",
+        PRINTF("CR4: bits [17:11] are not zero (%#"PRIx64")\n",
                 vmcb->_cr4);
     }
 
     if ((vmcb->_dr6 >> 32U) != 0) {
-        PRINTF("DR6: bits [63:32] are not zero (0x%"PRIx64")\n",
+        PRINTF("DR6: bits [63:32] are not zero (%#"PRIx64")\n",
                 vmcb->_dr6);
     }
 
     if ((vmcb->_dr7 >> 32U) != 0) {
-        PRINTF("DR7: bits [63:32] are not zero (0x%"PRIx64")\n",
+        PRINTF("DR7: bits [63:32] are not zero (%#"PRIx64")\n",
                 vmcb->_dr7);
     }
 
     if ((vmcb->_efer >> 15U) != 0) {
-        PRINTF("EFER: bits [63:15] are not zero (0x%"PRIx64")\n",
+        PRINTF("EFER: bits [63:15] are not zero (%#"PRIx64")\n",
                 vmcb->_efer);
     }
 
@@ -168,12 +167,12 @@ svm_vmcb_isvalid(const char *from, struc
     }
 
     if ((vmcb->_general2_intercepts & GENERAL2_INTERCEPT_VMRUN) == 0) {
-        PRINTF("GENERAL2_INTERCEPT: VMRUN intercept bit is clear (0x%"PRIx32")\n",
+        PRINTF("GENERAL2_INTERCEPT: VMRUN intercept bit is clear (%#"PRIx32")\n",
             vmcb->_general2_intercepts);
     }
 
     if (vmcb->eventinj.fields.resvd1 != 0) {
-        PRINTF("eventinj: MBZ bits are set (0x%"PRIx64")\n",
+        PRINTF("eventinj: MBZ bits are set (%#"PRIx64")\n",
                 vmcb->eventinj.bytes);
     }
 
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/hvm/vlapic.c
--- a/xen/arch/x86/hvm/vlapic.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/hvm/vlapic.c	Fri Sep 21 14:25:12 2012 +0200
@@ -172,7 +172,7 @@ static uint32_t vlapic_get_ppr(struct vl
         ppr = isrv & 0xf0;
 
     HVM_DBG_LOG(DBG_LEVEL_VLAPIC_INTERRUPT,
-                "vlapic %p, ppr 0x%x, isr 0x%x, isrv 0x%x",
+                "vlapic %p, ppr %#x, isr %#x, isrv %#x",
                 vlapic, ppr, isr, isrv);
 
     return ppr;
@@ -215,8 +215,8 @@ bool_t vlapic_match_dest(
     struct vlapic *target, struct vlapic *source,
     int short_hand, uint8_t dest, uint8_t dest_mode)
 {
-    HVM_DBG_LOG(DBG_LEVEL_VLAPIC, "target %p, source %p, dest 0x%x, "
-                "dest_mode 0x%x, short_hand 0x%x",
+    HVM_DBG_LOG(DBG_LEVEL_VLAPIC, "target %p, source %p, dest %#x, "
+                "dest_mode %#x, short_hand %#x",
                 target, source, dest, dest_mode, short_hand);
 
     switch ( short_hand )
@@ -562,20 +562,20 @@ static int vlapic_read(
         break;
 
     default:
-        gdprintk(XENLOG_ERR, "Local APIC read with len=0x%lx, "
+        gdprintk(XENLOG_ERR, "Local APIC read with len=%#lx, "
                  "should be 4 instead.\n", len);
         goto exit_and_crash;
     }
 
-    HVM_DBG_LOG(DBG_LEVEL_VLAPIC, "offset 0x%x with length 0x%lx, "
-                "and the result is 0x%lx", offset, len, result);
+    HVM_DBG_LOG(DBG_LEVEL_VLAPIC, "offset %#x with length %#lx, "
+                "and the result is %#lx", offset, len, result);
 
  out:
     *pval = result;
     return X86EMUL_OKAY;
 
  unaligned_exit_and_crash:
-    gdprintk(XENLOG_ERR, "Unaligned LAPIC read len=0x%lx at offset=0x%x.\n",
+    gdprintk(XENLOG_ERR, "Unaligned LAPIC read len=%#lx at offset=%#x.\n",
              len, offset);
  exit_and_crash:
     domain_crash(v->domain);
@@ -759,7 +759,7 @@ static int vlapic_reg_write(struct vcpu 
 
     case APIC_TDCR:
         vlapic_set_tdcr(vlapic, val & 0xb);
-        HVM_DBG_LOG(DBG_LEVEL_VLAPIC_TIMER, "timer divisor is 0x%x",
+        HVM_DBG_LOG(DBG_LEVEL_VLAPIC_TIMER, "timer divisor is %#x",
                     vlapic->hw.timer_divisor);
         break;
 
@@ -768,7 +768,7 @@ static int vlapic_reg_write(struct vcpu 
     }
     if (rc == X86EMUL_UNHANDLEABLE)
         gdprintk(XENLOG_DEBUG,
-                "Local APIC Write wrong to register 0x%x\n", offset);
+                "Local APIC Write wrong to register %#x\n", offset);
     return rc;
 }
 
@@ -781,7 +781,7 @@ static int vlapic_write(struct vcpu *v, 
 
     if ( offset != 0xb0 )
         HVM_DBG_LOG(DBG_LEVEL_VLAPIC,
-                    "offset 0x%x with length 0x%lx, and value is 0x%lx",
+                    "offset %#x with length %#lx, and value is %#lx",
                     offset, len, val);
 
     /*
@@ -827,7 +827,7 @@ static int vlapic_write(struct vcpu *v, 
     return vlapic_reg_write(v, offset, val);
 
  unaligned_exit_and_crash:
-    gdprintk(XENLOG_ERR, "Unaligned LAPIC write len=0x%lx at offset=0x%x.\n",
+    gdprintk(XENLOG_ERR, "Unaligned LAPIC write len=%#lx at offset=%#x.\n",
              len, offset);
  exit_and_crash:
     domain_crash(v->domain);
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/hvm/vmx/vmcs.c
--- a/xen/arch/x86/hvm/vmx/vmcs.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/hvm/vmx/vmcs.c	Fri Sep 21 14:25:12 2012 +0200
@@ -121,7 +121,7 @@ static u32 adjust_vmx_controls(
 static bool_t cap_check(const char *name, u32 expected, u32 saw)
 {
     if ( saw != expected )
-        printk("VMX %s: saw 0x%08x expected 0x%08x\n", name, saw, expected);
+        printk("VMX %s: saw %#x expected %#x\n", name, saw, expected);
     return saw != expected;
 }
 
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Fri Sep 21 14:25:12 2012 +0200
@@ -210,7 +210,7 @@ long_mode_do_msr_read(unsigned int msr, 
         return HNDL_unhandled;
     }
 
-    HVM_DBG_LOG(DBG_LEVEL_0, "msr 0x%x content 0x%"PRIx64, msr, *msr_content);
+    HVM_DBG_LOG(DBG_LEVEL_0, "msr %#x content %#"PRIx64, msr, *msr_content);
 
     return HNDL_done;
 }
@@ -222,7 +222,7 @@ long_mode_do_msr_write(unsigned int msr,
     struct vmx_msr_state *guest_msr_state = &v->arch.hvm_vmx.msr_state;
     struct vmx_msr_state *host_msr_state = &this_cpu(host_msr_state);
 
-    HVM_DBG_LOG(DBG_LEVEL_0, "msr 0x%x content 0x%"PRIx64, msr, msr_content);
+    HVM_DBG_LOG(DBG_LEVEL_0, "msr %#x content %#"PRIx64, msr, msr_content);
 
     switch ( msr )
     {
@@ -466,7 +466,7 @@ static int vmx_restore_cr0_cr3(
                                      NULL, P2M_ALLOC);
             if ( !page )
             {
-                gdprintk(XENLOG_ERR, "Invalid CR3 value=0x%lx\n", cr3);
+                gdprintk(XENLOG_ERR, "Invalid CR3 value=%#lx\n", cr3);
                 return -EINVAL;
             }
         }
@@ -492,7 +492,7 @@ static int vmx_vmcs_restore(struct vcpu 
          ((c->pending_type == 1) || (c->pending_type > 6) ||
           (c->pending_reserved != 0)) )
     {
-        gdprintk(XENLOG_ERR, "Invalid pending event 0x%"PRIx32".\n",
+        gdprintk(XENLOG_ERR, "Invalid pending event %#"PRIx32".\n",
                  c->pending_event);
         return -EINVAL;
     }
@@ -524,7 +524,7 @@ static int vmx_vmcs_restore(struct vcpu 
 
     if ( c->pending_valid )
     {
-        gdprintk(XENLOG_INFO, "Re-injecting 0x%"PRIx32", 0x%"PRIx32"\n",
+        gdprintk(XENLOG_INFO, "Re-injecting %#"PRIx32", %#"PRIx32"\n",
                  c->pending_event, c->error_code);
 
         if ( hvm_event_needs_reinjection(c->pending_type, c->pending_vector) )
@@ -1789,7 +1789,7 @@ static int is_last_branch_msr(u32 ecx)
 
 static int vmx_msr_read_intercept(unsigned int msr, uint64_t *msr_content)
 {
-    HVM_DBG_LOG(DBG_LEVEL_1, "ecx=%x", msr);
+    HVM_DBG_LOG(DBG_LEVEL_1, "ecx=%#x", msr);
 
     switch ( msr )
     {
@@ -1854,7 +1854,7 @@ static int vmx_msr_read_intercept(unsign
     }
 
 done:
-    HVM_DBG_LOG(DBG_LEVEL_1, "returns: ecx=%x, msr_value=0x%"PRIx64,
+    HVM_DBG_LOG(DBG_LEVEL_1, "returns: ecx=%#x, msr_value=%#"PRIx64,
                 msr, *msr_content);
     return X86EMUL_OKAY;
 
@@ -1927,8 +1927,7 @@ static int vmx_msr_write_intercept(unsig
 {
     struct vcpu *v = current;
 
-    HVM_DBG_LOG(DBG_LEVEL_1, "ecx=%x, msr_value=0x%"PRIx64,
-                msr, msr_content);
+    HVM_DBG_LOG(DBG_LEVEL_1, "ecx=%#x, msr_value=%#"PRIx64, msr, msr_content);
 
     switch ( msr )
     {
@@ -2107,7 +2106,7 @@ static void vmx_failed_vmentry(unsigned 
     unsigned long exit_qualification = __vmread(EXIT_QUALIFICATION);
     struct vcpu *curr = current;
 
-    printk("Failed vm entry (exit reason 0x%x) ", exit_reason);
+    printk("Failed vm entry (exit reason %#x) ", exit_reason);
     switch ( failed_vmentry_reason )
     {
     case EXIT_REASON_INVALID_GUEST_STATE:
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/io_apic.c
--- a/xen/arch/x86/io_apic.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/io_apic.c	Fri Sep 21 14:25:12 2012 +0200
@@ -2204,7 +2204,7 @@ int io_apic_set_pci_routing (int ioapic,
     entry.vector = vector;
 
     apic_printk(APIC_DEBUG, KERN_DEBUG "IOAPIC[%d]: Set PCI routing entry "
-		"(%d-%d -> 0x%x -> IRQ %d Mode:%i Active:%i)\n", ioapic,
+		"(%d-%d -> %#x -> IRQ %d Mode:%i Active:%i)\n", ioapic,
 		mp_ioapics[ioapic].mpc_apicid, pin, entry.vector, irq,
 		edge_level, active_high_low);
 
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/microcode_amd.c
--- a/xen/arch/x86/microcode_amd.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/microcode_amd.c	Fri Sep 21 14:25:12 2012 +0200
@@ -88,7 +88,7 @@ static int collect_cpu_info(int cpu, str
 
     rdmsrl(MSR_AMD_PATCHLEVEL, csig->rev);
 
-    printk(KERN_DEBUG "microcode: collect_cpu_info: patch_id=0x%x\n",
+    printk(KERN_DEBUG "microcode: collect_cpu_info: patch_id=%#x\n",
            csig->rev);
 
     return 0;
@@ -132,7 +132,7 @@ static int microcode_fits(const struct m
         return 0;
 
     printk(KERN_DEBUG "microcode: CPU%d found a matching microcode "
-           "update with version 0x%x (current=0x%x)\n",
+           "update with version %#x (current=%#x)\n",
            cpu, mc_header->patch_id, uci->cpu_sig.rev);
 
     return 1;
@@ -169,7 +169,7 @@ static int apply_microcode(int cpu)
     if ( rev != hdr->patch_id )
     {
         printk(KERN_ERR "microcode: CPU%d update from revision "
-               "0x%x to 0x%x failed\n", cpu, hdr->patch_id, rev);
+               "%#x to %#x failed\n", cpu, hdr->patch_id, rev);
         return -EIO;
     }
 
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/microcode_intel.c
--- a/xen/arch/x86/microcode_intel.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/microcode_intel.c	Fri Sep 21 14:25:12 2012 +0200
@@ -122,7 +122,7 @@ static int collect_cpu_info(int cpu_num,
     /* get the current revision from MSR 0x8B */
     rdmsrl(MSR_IA32_UCODE_REV, msr_content);
     csig->rev = (uint32_t)(msr_content >> 32);
-    pr_debug("microcode: collect_cpu_info : sig=0x%x, pf=0x%x, rev=0x%x\n",
+    pr_debug("microcode: collect_cpu_info : sig=%#x, pf=%#x, rev=%#x\n",
              csig->sig, csig->pf, csig->rev);
 
     return 0;
@@ -264,7 +264,7 @@ static int get_matching_microcode(const 
     if ( uci->mc.mc_intel && uci->mc.mc_intel->hdr.rev >= mc_header->rev )
         return 0;
     pr_debug("microcode: CPU%d found a matching microcode update with"
-             " version 0x%x (current=0x%x)\n",
+             " version %#x (current=%#x)\n",
              cpu, mc_header->rev, uci->cpu_sig.rev);
     new_mc = xmalloc_bytes(total_size);
     if ( new_mc == NULL )
@@ -311,11 +311,11 @@ static int apply_microcode(int cpu)
     if ( val[1] != uci->mc.mc_intel->hdr.rev )
     {
         printk(KERN_ERR "microcode: CPU%d update from revision "
-               "0x%x to 0x%x failed\n", cpu_num, uci->cpu_sig.rev, val[1]);
+               "%#x to %#x failed\n", cpu_num, uci->cpu_sig.rev, val[1]);
         return -EIO;
     }
     printk(KERN_INFO "microcode: CPU%d updated from revision "
-           "0x%x to 0x%x, date = %04x-%02x-%02x \n",
+           "%#x to %#x, date = %04x-%02x-%02x \n",
            cpu_num, uci->cpu_sig.rev, val[1],
            uci->mc.mc_intel->hdr.date & 0xffff,
            uci->mc.mc_intel->hdr.date >> 24,
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/mm.c	Fri Sep 21 14:25:12 2012 +0200
@@ -3102,7 +3102,7 @@ long do_mmuext_op(
         }
 
         default:
-            MEM_LOG("Invalid extended pt command 0x%x", op.cmd);
+            MEM_LOG("Invalid extended pt command %#x", op.cmd);
             rc = -ENOSYS;
             okay = 0;
             break;
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/mm/hap/nested_hap.c
--- a/xen/arch/x86/mm/hap/nested_hap.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/mm/hap/nested_hap.c	Fri Sep 21 14:25:12 2012 +0200
@@ -129,7 +129,7 @@ nestedhap_fix_p2m(struct vcpu *v, struct
 
     if (rv == 0) {
         gdprintk(XENLOG_ERR,
-		"failed to set entry for 0x%"PRIx64" -> 0x%"PRIx64"\n",
+		"failed to set entry for %#"PRIx64" -> %#"PRIx64"\n",
 		L2_gpa, L0_gpa);
         BUG();
     }
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/mm/p2m-pt.c
--- a/xen/arch/x86/mm/p2m-pt.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/mm/p2m-pt.c	Fri Sep 21 14:25:12 2012 +0200
@@ -110,8 +110,8 @@ p2m_find_entry(void *table, unsigned lon
     index = *gfn_remainder >> shift;
     if ( index >= max )
     {
-        P2M_DEBUG("gfn=0x%lx out of range "
-                  "(gfn_remainder=0x%lx shift=%d index=0x%x max=0x%x)\n",
+        P2M_DEBUG("gfn=%#lx out of range "
+                  "(gfn_remainder=%#lx shift=%d index=%#x max=%#x)\n",
                   gfn, *gfn_remainder, shift, index, max);
         return NULL;
     }
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/mm/shadow/common.c
--- a/xen/arch/x86/mm/shadow/common.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/mm/shadow/common.c	Fri Sep 21 14:25:12 2012 +0200
@@ -872,7 +872,7 @@ static int sh_skip_sync(struct vcpu *v, 
         return SHADOW_INTERNAL_NAME(sh_safe_not_to_sync, 3)(v, gl1mfn);
     else if ( pg->shadow_flags & SHF_L1_64 )
         return SHADOW_INTERNAL_NAME(sh_safe_not_to_sync, 4)(v, gl1mfn);
-    SHADOW_ERROR("gmfn 0x%lx was OOS but not shadowed as an l1.\n", 
+    SHADOW_ERROR("gmfn %#lx was OOS but not shadowed as an l1.\n",
                  mfn_x(gl1mfn));
     BUG();
     return 0; /* BUG() is no longer __attribute__((noreturn)). */
@@ -2596,8 +2596,8 @@ void sh_remove_shadows(struct vcpu *v, m
     smfn = shadow_hash_lookup(v, mfn_x(gmfn), t);                       \
     if ( unlikely(!mfn_valid(smfn)) )                                   \
     {                                                                   \
-        SHADOW_ERROR(": gmfn %#lx has flags 0x%"PRIx32                  \
-                     " but no type-0x%"PRIx32" shadow\n",               \
+        SHADOW_ERROR(": gmfn %#lx has flags %#"PRIx32                   \
+                     " but no type-%#"PRIx32" shadow\n",                \
                      mfn_x(gmfn), (uint32_t)pg->shadow_flags, t);       \
         break;                                                          \
     }                                                                   \
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/mm/shadow/multi.c
--- a/xen/arch/x86/mm/shadow/multi.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/mm/shadow/multi.c	Fri Sep 21 14:25:12 2012 +0200
@@ -2171,7 +2171,7 @@ static int validate_gl4e(struct vcpu *v,
             // attempt by the guest to write to a xen reserved slot
             //
             SHADOW_PRINTK("%s out-of-range update "
-                           "sl4mfn=%05lx index=0x%x val=%" SH_PRI_pte "\n",
+                           "sl4mfn=%05lx index=%#x val=%" SH_PRI_pte "\n",
                            __func__, mfn_x(sl4mfn), shadow_index, new_sl4e.l4);
             if ( shadow_l4e_get_flags(new_sl4e) & _PAGE_PRESENT )
             {
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/mpparse.c
--- a/xen/arch/x86/mpparse.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/mpparse.c	Fri Sep 21 14:25:12 2012 +0200
@@ -216,7 +216,7 @@ static void __init MP_ioapic_info (struc
 	if (!(m->mpc_flags & MPC_APIC_USABLE))
 		return;
 
-	printk(KERN_INFO "I/O APIC #%d Version %d at 0x%X.\n",
+	printk(KERN_INFO "I/O APIC #%d Version %d at %#x.\n",
 		m->mpc_apicid, m->mpc_apicver, m->mpc_apicaddr);
 	if (nr_ioapics >= MAX_IO_APICS) {
 		printk(KERN_CRIT "Max # of I/O APICs (%d) exceeded (found %d).\n",
@@ -278,7 +278,7 @@ static int __init smp_read_mpc(struct mp
 	unsigned char *mpt=((unsigned char *)mpc)+count;
 
 	if (memcmp(mpc->mpc_signature,MPC_SIGNATURE,4)) {
-		printk(KERN_ERR "SMP mptable: bad signature [0x%x]!\n",
+		printk(KERN_ERR "SMP mptable: bad signature [%#x]!\n",
 			*(u32 *)mpc->mpc_signature);
 		return 0;
 	}
@@ -305,7 +305,7 @@ static int __init smp_read_mpc(struct mp
 
 	mps_oem_check(mpc, oem, str);
 
-	printk("APIC at: 0x%X\n",mpc->mpc_lapic);
+	printk("APIC at: %#x\n", mpc->mpc_lapic);
 
 	/* 
 	 * Save the local APIC address (it might be non-default) -- but only
@@ -881,7 +881,7 @@ void __init mp_register_ioapic (
 	mp_ioapic_routing[idx].gsi_end = gsi_base + 
 		io_apic_get_redir_entries(idx);
 
-	printk("IOAPIC[%d]: apic_id %d, version %d, address 0x%x, "
+	printk("IOAPIC[%d]: apic_id %d, version %d, address %#x, "
 		"GSI %d-%d\n", idx, mp_ioapics[idx].mpc_apicid, 
 		mp_ioapics[idx].mpc_apicver, mp_ioapics[idx].mpc_apicaddr,
 		mp_ioapic_routing[idx].gsi_base,
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/nmi.c
--- a/xen/arch/x86/nmi.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/nmi.c	Fri Sep 21 14:25:12 2012 +0200
@@ -245,7 +245,7 @@ static inline void write_watchdog_counte
 
     do_div(count, nmi_hz);
     if(descr)
-        Dprintk("setting %s to -0x%"PRIx64"\n", descr, count);
+        Dprintk("setting %s to -%#"PRIx64"\n", descr, count);
     wrmsrl(nmi_perfctr_msr, 0 - count);
 }
 
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/oprofile/op_model_athlon.c
--- a/xen/arch/x86/oprofile/op_model_athlon.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/oprofile/op_model_athlon.c	Fri Sep 21 14:25:12 2012 +0200
@@ -478,7 +478,7 @@ static int __init init_ibs_nmi(void)
 					if (value != (IBSCTL_LVTOFFSETVAL |
 						APIC_EILVT_LVTOFF_IBS)) {
 						printk("Xenoprofile: Failed to setup IBS LVT offset, "
-							"IBSCTL = %#08x\n", value);
+							"IBSCTL = %#x\n", value);
 						return 1;
 					}
 					nodes++;
@@ -523,7 +523,7 @@ void __init ibs_init(void)
 		return;
 	}
 
-	printk("Xenoprofile: AMD IBS detected (0x%08x)\n",
+	printk("Xenoprofile: AMD IBS detected (%#x)\n",
 		(unsigned)ibs_caps);
 }
 
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/oprofile/op_model_p4.c
--- a/xen/arch/x86/oprofile/op_model_p4.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/oprofile/op_model_p4.c	Fri Sep 21 14:25:12 2012 +0200
@@ -485,8 +485,7 @@ static void pmc_setup_one_p4_counter(uns
 	
 	/* find our event binding structure. */
 	if (counter_config[ctr].event <= 0 || counter_config[ctr].event > NUM_EVENTS) {
-		printk(KERN_ERR 
-		       "oprofile: P4 event code 0x%lx out of range\n", 
+		printk(KERN_ERR "oprofile: P4 event code %#lx out of range\n",
 		       counter_config[ctr].event);
 		return;
 	}
@@ -526,7 +525,7 @@ static void pmc_setup_one_p4_counter(uns
 	}
 
 	printk(KERN_ERR 
-	       "oprofile: P4 event code 0x%lx no binding, stag %d ctr %d\n",
+	       "oprofile: P4 event code %#lx no binding, stag %d ctr %d\n",
 	       counter_config[ctr].event, stag, ctr);
 }
 
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/setup.c	Fri Sep 21 14:25:12 2012 +0200
@@ -482,13 +482,13 @@ static void __init kexec_reserve_area(st
 
     if ( !reserve_e820_ram(e820, kdump_start, kdump_start + kdump_size) )
     {
-        printk("Kdump: DISABLED (failed to reserve %luMB (%lukB) at 0x%lx)"
+        printk("Kdump: DISABLED (failed to reserve %luMB (%lukB) at %#lx)"
                "\n", kdump_size >> 20, kdump_size >> 10, kdump_start);
         kexec_crash_area.start = kexec_crash_area.size = 0;
     }
     else
     {
-        printk("Kdump: %luMB (%lukB) at 0x%lx\n",
+        printk("Kdump: %luMB (%lukB) at %#lx\n",
                kdump_size >> 20, kdump_size >> 10, kdump_start);
     }
 }
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/tboot.c
--- a/xen/arch/x86/tboot.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/tboot.c	Fri Sep 21 14:25:12 2012 +0200
@@ -119,12 +119,12 @@ void __init tboot_probe(void)
     g_tboot_shared = tboot_shared;
     printk("TBOOT: found shared page at phys addr %lx:\n", p_tboot_shared);
     printk("  version: %d\n", tboot_shared->version);
-    printk("  log_addr: 0x%08x\n", tboot_shared->log_addr);
-    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);
+    printk("  log_addr: %#x\n", tboot_shared->log_addr);
+    printk("  shutdown_entry: %#x\n", tboot_shared->shutdown_entry);
+    printk("  tboot_base: %#x\n", tboot_shared->tboot_base);
+    printk("  tboot_size: %#x\n", tboot_shared->tboot_size);
     if ( tboot_shared->version >= 6 )
-        printk("  flags: 0x%08x\n", tboot_shared->flags);
+        printk("  flags: %#x\n", tboot_shared->flags);
 
     /* these will be needed by tboot_protect_mem_regions() and/or
        tboot_parse_dmar_table(), so get them now */
@@ -352,7 +352,7 @@ void tboot_shutdown(uint32_t shutdown_ty
                            __PAGE_HYPERVISOR);
     if ( err != 0 )
     {
-        printk("error (0x%x) mapping tboot pages (mfns) @ 0x%x, 0x%x\n", err,
+        printk("error (%#x) mapping tboot pages (mfns) @ %#x, %#x\n", err,
                map_base, map_size);
         return;
     }
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/time.c
--- a/xen/arch/x86/time.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/time.c	Fri Sep 21 14:25:12 2012 +0200
@@ -1955,11 +1955,11 @@ static void dump_softtsc(unsigned char k
         printk("dom%u%s: mode=%d",d->domain_id,
                 is_hvm_domain(d) ? "(hvm)" : "", d->arch.tsc_mode);
         if ( d->arch.vtsc_offset )
-            printk(",ofs=0x%"PRIx64"",d->arch.vtsc_offset);
+            printk(",ofs=%#"PRIx64, d->arch.vtsc_offset);
         if ( d->arch.tsc_khz )
-            printk(",khz=%"PRIu32"",d->arch.tsc_khz);
+            printk(",khz=%"PRIu32, d->arch.tsc_khz);
         if ( d->arch.incarnation )
-            printk(",inc=%"PRIu32"",d->arch.incarnation);
+            printk(",inc=%"PRIu32, d->arch.incarnation);
         if ( !(d->arch.vtsc_kerncount | d->arch.vtsc_usercount) )
         {
             printk("\n");
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/xstate.c
--- a/xen/arch/x86/xstate.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/xstate.c	Fri Sep 21 14:25:12 2012 +0200
@@ -163,7 +163,7 @@ void xstate_init(void)
         xsave_cntxt_size = ebx;
         xfeature_mask = eax + ((u64)edx << 32);
         xfeature_mask &= XCNTXT_MASK;
-        printk("%s: using cntxt_size: 0x%x and states: 0x%"PRIx64"\n",
+        printk("%s: using cntxt_size: %#x and states: %#"PRIx64"\n",
             __func__, xsave_cntxt_size, xfeature_mask);
 
         /* Check XSAVEOPT feature. */
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/common/gdbstub.c
--- a/xen/common/gdbstub.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/common/gdbstub.c	Fri Sep 21 14:25:12 2012 +0200
@@ -263,7 +263,7 @@ gdb_write_to_packet_hex(unsigned long x,
     case sizeof(u64):
         break;
     default:
-        dbg_printk("WARNING: %s x: 0x%lx int_size: %d\n",
+        dbg_printk("WARNING: %s x: %#lx int_size: %d\n",
                    __func__, x, int_size);
         break;
     }
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/common/page_alloc.c
--- a/xen/common/page_alloc.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/common/page_alloc.c	Fri Sep 21 14:25:12 2012 +0200
@@ -367,7 +367,7 @@ static void __init setup_low_mem_virq(vo
     low_mem_virq_th = low_mem_virq_orig = 1UL << order;
     low_mem_virq_th_order = order;
 
-    printk("Initial low memory virq threshold set at 0x%lx pages.\n",
+    printk("Initial low memory virq threshold set at %#lx pages.\n",
             low_mem_virq_th);
 }
 
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/common/vsprintf.c
--- a/xen/common/vsprintf.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/common/vsprintf.c	Fri Sep 21 14:25:12 2012 +0200
@@ -171,10 +171,14 @@ static char *number(
         }
     }
     if (type & SPECIAL) {
-        if (base == 16)
+        if (num == 0)
+            type &= ~SPECIAL;
+        else if (base == 16)
             size -= 2;
         else if (base == 8)
             size--;
+        else
+            type &= ~SPECIAL;
     }
     i = 0;
     if (num == 0)
@@ -197,14 +201,10 @@ static char *number(
         ++buf;
     }
     if (type & SPECIAL) {
-        if (base==8) {
-            if (buf <= end)
-                *buf = '0';
-            ++buf;
-        } else if (base==16) {
-            if (buf <= end)
-                *buf = '0';
-            ++buf;
+        if (buf <= end)
+            *buf = '0';
+        ++buf;
+        if (base == 16) {
             if (buf <= end)
                 *buf = digits[33];
             ++buf;
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/common/xencomm.c
--- a/xen/common/xencomm.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/common/xencomm.c	Fri Sep 21 14:25:12 2012 +0200
@@ -58,7 +58,7 @@ xencomm_get_page(unsigned long paddr, st
          * is freed with decrease reservation hypercall at the same time.
          */
         gdprintk(XENLOG_WARNING,
-                 "bad page is passed. paddr 0x%lx maddr 0x%lx\n",
+                 "bad page is passed. paddr %#lx maddr %#lx\n",
                  paddr, maddr);
         return -EFAULT;
     }
@@ -117,7 +117,7 @@ xencomm_ctxt_init(const void *handle, st
     desc = xencomm_vaddr((unsigned long)handle, page);
     if ( desc->magic != XENCOMM_MAGIC )
     {
-        printk("%s: error: %p magic was 0x%x\n", __func__, desc, desc->magic);
+        printk("%s: error: %p magic was %#x\n", __func__, desc, desc->magic);
         put_page(page);
         return -EINVAL;
     }
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/drivers/acpi/numa.c
--- a/xen/drivers/acpi/numa.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/drivers/acpi/numa.c	Fri Sep 21 14:25:12 2012 +0200
@@ -78,8 +78,8 @@ void __init acpi_table_print_srat_entry(
 			if (srat_rev < 2)
 				proximity_domain &= 0xff;
 			ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-					  "SRAT Memory (%#016"PRIx64
-					  " length %#016"PRIx64")"
+					  "SRAT Memory (%#"PRIx64
+					  " length %#"PRIx64")"
 					  " in proximity domain %d %s%s\n",
 					  p->base_address, p->length,
 					  proximity_domain,
@@ -108,7 +108,7 @@ void __init acpi_table_print_srat_entry(
 		break;
 	default:
 		printk(KERN_WARNING PREFIX
-		       "Found unsupported SRAT entry (type = 0x%x)\n",
+		       "Found unsupported SRAT entry (type = %#x)\n",
 		       header->type);
 		break;
 	}
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/drivers/acpi/tables.c
--- a/xen/drivers/acpi/tables.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/drivers/acpi/tables.c	Fri Sep 21 14:25:12 2012 +0200
@@ -95,7 +95,7 @@ void __init acpi_table_print_madt_entry(
 			if (p->inti_flags  &
 			    ~(ACPI_MADT_POLARITY_MASK | ACPI_MADT_TRIGGER_MASK))
 				printk(KERN_INFO PREFIX
-				       "INT_SRC_OVR unexpected reserved flags: 0x%x\n",
+				       "INT_SRC_OVR unexpected reserved flags: %#x\n",
 				       p->inti_flags  &
 					~(ACPI_MADT_POLARITY_MASK | ACPI_MADT_TRIGGER_MASK));
 
@@ -119,7 +119,7 @@ void __init acpi_table_print_madt_entry(
 			struct acpi_madt_local_apic_nmi *p =
 			    (struct acpi_madt_local_apic_nmi *)header;
 			printk(KERN_INFO PREFIX
-			       "LAPIC_NMI (acpi_id[0x%02x] %s %s lint[0x%x])\n",
+			       "LAPIC_NMI (acpi_id[0x%02x] %s %s lint[%#x])\n",
 			       p->processor_id,
 			       mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK	],
 			       mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2],
@@ -137,7 +137,7 @@ void __init acpi_table_print_madt_entry(
 			trigger = (p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2;
 
 			printk(KERN_INFO PREFIX
-			       "X2APIC_NMI (uid[0x%02x] %s %s lint[0x%x])\n",
+			       "X2APIC_NMI (uid[0x%02x] %s %s lint[%#x])\n",
 			       p->uid,
 			       mps_inti_flags_polarity[polarity],
 			       mps_inti_flags_trigger[trigger],
@@ -160,7 +160,7 @@ void __init acpi_table_print_madt_entry(
 			struct acpi_madt_io_sapic *p =
 			    (struct acpi_madt_io_sapic *)header;
 			printk(KERN_INFO PREFIX
-			       "IOSAPIC (id[0x%x] address[%p] gsi_base[%d])\n",
+			       "IOSAPIC (id[%#x] address[%p] gsi_base[%d])\n",
 			       p->id, (void *)(unsigned long)p->address,
 			       p->global_irq_base);
 		}
@@ -182,7 +182,7 @@ void __init acpi_table_print_madt_entry(
 			struct acpi_madt_interrupt_source *p =
 			    (struct acpi_madt_interrupt_source *)header;
 			printk(KERN_INFO PREFIX
-			       "PLAT_INT_SRC (%s %s type[0x%x] id[0x%04x] eid[0x%x] iosapic_vector[0x%x] global_irq[0x%x]\n",
+			       "PLAT_INT_SRC (%s %s type[%#x] id[0x%04x] eid[%#x] iosapic_vector[%#x] global_irq[%#x]\n",
 			       mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK],
 			       mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2],
 			       p->type, p->id, p->eid, p->io_sapic_vector,
@@ -192,7 +192,7 @@ void __init acpi_table_print_madt_entry(
 
 	default:
 		printk(KERN_WARNING PREFIX
-		       "Found unsupported MADT entry (type = 0x%x)\n",
+		       "Found unsupported MADT entry (type = %#x)\n",
 		       header->type);
 		break;
 	}
@@ -242,7 +242,7 @@ acpi_table_parse_entries(char *id,
 		    ((unsigned long)entry + entry->length);
 	}
 	if (max_entries && count > max_entries) {
-		printk(KERN_WARNING PREFIX "[%4.4s:0x%02x] ignored %i entries of "
+		printk(KERN_WARNING PREFIX "[%4.4s:%#x] ignored %i entries of "
 		       "%i found\n", id, entry_id, count - max_entries, count);
 	}
 
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/drivers/acpi/utilities/utglobal.c
--- a/xen/drivers/acpi/utilities/utglobal.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/drivers/acpi/utilities/utglobal.c	Fri Sep 21 14:25:12 2012 +0200
@@ -79,7 +79,7 @@ const char *__init acpi_format_exception
 		/* Exception code was not recognized */
 
 		ACPI_ERROR((AE_INFO,
-			    "Unknown exception code: 0x%8.8X", status));
+			    "Unknown exception code: %#X", status));
 
 		exception = "UNKNOWN_STATUS_CODE";
 		dump_execution_state();
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/drivers/cpufreq/cpufreq.c
--- a/xen/drivers/cpufreq/cpufreq.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/drivers/cpufreq/cpufreq.c	Fri Sep 21 14:25:12 2012 +0200
@@ -377,7 +377,7 @@ static void print_PSS(struct xen_process
     printk("\t_PSS: state_count=%d\n", count);
     for (i=0; i<count; i++){
         printk("\tState%d: %"PRId64"MHz %"PRId64"mW %"PRId64"us "
-               "%"PRId64"us 0x%"PRIx64" 0x%"PRIx64"\n",
+               "%"PRId64"us %#"PRIx64" %#"PRIx64"\n",
                i,
                ptr[i].core_frequency,
                ptr[i].power,
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/drivers/passthrough/amd/iommu_acpi.c
--- a/xen/drivers/passthrough/amd/iommu_acpi.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/drivers/passthrough/amd/iommu_acpi.c	Fri Sep 21 14:25:12 2012 +0200
@@ -196,7 +196,7 @@ static int __init register_exclusion_ran
     iommu = find_iommu_for_device(seg, bdf);
     if ( !iommu )
     {
-        AMD_IOMMU_DEBUG("IVMD Error: No IOMMU for Dev_Id 0x%x!\n", bdf);
+        AMD_IOMMU_DEBUG("IVMD Error: No IOMMU for Dev_Id %#x!\n", bdf);
         return -ENODEV;
     }
     req = ivrs_mappings[bdf].dte_requestor_id;
@@ -278,7 +278,7 @@ static int __init parse_ivmd_device_sele
     bdf = ivmd_block->header.device_id;
     if ( bdf >= ivrs_bdf_entries )
     {
-        AMD_IOMMU_DEBUG("IVMD Error: Invalid Dev_Id 0x%x\n", bdf);
+        AMD_IOMMU_DEBUG("IVMD Error: Invalid Dev_Id %#x\n", bdf);
         return -ENODEV;
     }
 
@@ -296,7 +296,7 @@ static int __init parse_ivmd_device_rang
     if ( first_bdf >= ivrs_bdf_entries )
     {
         AMD_IOMMU_DEBUG("IVMD Error: "
-                        "Invalid Range_First Dev_Id 0x%x\n", first_bdf);
+                        "Invalid Range_First Dev_Id %#x\n", first_bdf);
         return -ENODEV;
     }
 
@@ -304,7 +304,7 @@ static int __init parse_ivmd_device_rang
     if ( (last_bdf >= ivrs_bdf_entries) || (last_bdf <= first_bdf) )
     {
         AMD_IOMMU_DEBUG("IVMD Error: "
-                        "Invalid Range_Last Dev_Id 0x%x\n", last_bdf);
+                        "Invalid Range_Last Dev_Id %#x\n", last_bdf);
         return -ENODEV;
     }
 
@@ -326,7 +326,7 @@ static int __init parse_ivmd_device_iomm
                                     ivmd_block->aux_data);
     if ( !iommu )
     {
-        AMD_IOMMU_DEBUG("IVMD Error: No IOMMU for Dev_Id 0x%x  Cap 0x%x\n",
+        AMD_IOMMU_DEBUG("IVMD Error: No IOMMU for Dev_Id %#x Cap %#x\n",
                         ivmd_block->header.device_id, ivmd_block->aux_data);
         return -ENODEV;
     }
@@ -351,9 +351,9 @@ static int __init parse_ivmd_block(const
     base = start_addr & PAGE_MASK;
     limit = (start_addr + mem_length - 1) & PAGE_MASK;
 
-    AMD_IOMMU_DEBUG("IVMD Block: Type 0x%x\n",ivmd_block->header.type);
-    AMD_IOMMU_DEBUG(" Start_Addr_Phys 0x%lx\n", start_addr);
-    AMD_IOMMU_DEBUG(" Mem_Length 0x%lx\n", mem_length);
+    AMD_IOMMU_DEBUG("IVMD Block: Type %#x\n",ivmd_block->header.type);
+    AMD_IOMMU_DEBUG(" Start_Addr_Phys %#lx\n", start_addr);
+    AMD_IOMMU_DEBUG(" Mem_Length %#lx\n", mem_length);
 
     if ( ivmd_block->header.flags & ACPI_IVMD_EXCLUSION_RANGE )
         iw = ir = IOMMU_CONTROL_ENABLED;
@@ -414,7 +414,7 @@ static u16 __init parse_ivhd_device_sele
     bdf = select->header.id;
     if ( bdf >= ivrs_bdf_entries )
     {
-        AMD_IOMMU_DEBUG("IVHD Error: Invalid Device_Entry Dev_Id 0x%x\n", bdf);
+        AMD_IOMMU_DEBUG("IVHD Error: Invalid Device_Entry Dev_Id %#x\n", bdf);
         return 0;
     }
 
@@ -439,7 +439,7 @@ static u16 __init parse_ivhd_device_rang
     if ( range->end.header.type != ACPI_IVRS_TYPE_END )
     {
         AMD_IOMMU_DEBUG("IVHD Error: "
-                        "Invalid Range: End_Type 0x%x\n",
+                        "Invalid Range: End_Type %#x\n",
                         range->end.header.type);
         return 0;
     }
@@ -448,7 +448,7 @@ static u16 __init parse_ivhd_device_rang
     if ( first_bdf >= ivrs_bdf_entries )
     {
         AMD_IOMMU_DEBUG("IVHD Error: "
-                        "Invalid Range: First Dev_Id 0x%x\n", first_bdf);
+                        "Invalid Range: First Dev_Id %#x\n", first_bdf);
         return 0;
     }
 
@@ -456,11 +456,11 @@ static u16 __init parse_ivhd_device_rang
     if ( (last_bdf >= ivrs_bdf_entries) || (last_bdf <= first_bdf) )
     {
         AMD_IOMMU_DEBUG("IVHD Error: "
-                        "Invalid Range: Last Dev_Id 0x%x\n", last_bdf);
+                        "Invalid Range: Last Dev_Id %#x\n", last_bdf);
         return 0;
     }
 
-    AMD_IOMMU_DEBUG(" Dev_Id Range: 0x%x -> 0x%x\n", first_bdf, last_bdf);
+    AMD_IOMMU_DEBUG(" Dev_Id Range: %#x -> %#x\n", first_bdf, last_bdf);
 
     for ( bdf = first_bdf; bdf <= last_bdf; bdf++ )
         add_ivrs_mapping_entry(bdf, bdf, range->start.header.data_setting,
@@ -485,18 +485,18 @@ static u16 __init parse_ivhd_device_alia
     bdf = alias->header.id;
     if ( bdf >= ivrs_bdf_entries )
     {
-        AMD_IOMMU_DEBUG("IVHD Error: Invalid Device_Entry Dev_Id 0x%x\n", bdf);
+        AMD_IOMMU_DEBUG("IVHD Error: Invalid Device_Entry Dev_Id %#x\n", bdf);
         return 0;
     }
 
     alias_id = alias->used_id;
     if ( alias_id >= ivrs_bdf_entries )
     {
-        AMD_IOMMU_DEBUG("IVHD Error: Invalid Alias Dev_Id 0x%x\n", alias_id);
+        AMD_IOMMU_DEBUG("IVHD Error: Invalid Alias Dev_Id %#x\n", alias_id);
         return 0;
     }
 
-    AMD_IOMMU_DEBUG(" Dev_Id Alias: 0x%x\n", alias_id);
+    AMD_IOMMU_DEBUG(" Dev_Id Alias: %#x\n", alias_id);
 
     add_ivrs_mapping_entry(bdf, alias_id, alias->header.data_setting, iommu);
 
@@ -520,7 +520,7 @@ static u16 __init parse_ivhd_device_alia
     if ( range->end.header.type != ACPI_IVRS_TYPE_END )
     {
         AMD_IOMMU_DEBUG("IVHD Error: "
-                        "Invalid Range: End_Type 0x%x\n",
+                        "Invalid Range: End_Type %#x\n",
                         range->end.header.type);
         return 0;
     }
@@ -529,7 +529,7 @@ static u16 __init parse_ivhd_device_alia
     if ( first_bdf >= ivrs_bdf_entries )
     {
         AMD_IOMMU_DEBUG("IVHD Error: "
-                        "Invalid Range: First Dev_Id 0x%x\n", first_bdf);
+                        "Invalid Range: First Dev_Id %#x\n", first_bdf);
         return 0;
     }
 
@@ -537,19 +537,19 @@ static u16 __init parse_ivhd_device_alia
     if ( last_bdf >= ivrs_bdf_entries || last_bdf <= first_bdf )
     {
         AMD_IOMMU_DEBUG(
-            "IVHD Error: Invalid Range: Last Dev_Id 0x%x\n", last_bdf);
+            "IVHD Error: Invalid Range: Last Dev_Id %#x\n", last_bdf);
         return 0;
     }
 
     alias_id = range->alias.used_id;
     if ( alias_id >= ivrs_bdf_entries )
     {
-        AMD_IOMMU_DEBUG("IVHD Error: Invalid Alias Dev_Id 0x%x\n", alias_id);
+        AMD_IOMMU_DEBUG("IVHD Error: Invalid Alias Dev_Id %#x\n", alias_id);
         return 0;
     }
 
-    AMD_IOMMU_DEBUG(" Dev_Id Range: 0x%x -> 0x%x\n", first_bdf, last_bdf);
-    AMD_IOMMU_DEBUG(" Dev_Id Alias: 0x%x\n", alias_id);
+    AMD_IOMMU_DEBUG(" Dev_Id Range: %#x -> %#x\n", first_bdf, last_bdf);
+    AMD_IOMMU_DEBUG(" Dev_Id Alias: %#x\n", alias_id);
 
     for ( bdf = first_bdf; bdf <= last_bdf; bdf++ )
         add_ivrs_mapping_entry(bdf, alias_id, range->alias.header.data_setting,
@@ -574,7 +574,7 @@ static u16 __init parse_ivhd_device_exte
     bdf = ext->header.id;
     if ( bdf >= ivrs_bdf_entries )
     {
-        AMD_IOMMU_DEBUG("IVHD Error: Invalid Device_Entry Dev_Id 0x%x\n", bdf);
+        AMD_IOMMU_DEBUG("IVHD Error: Invalid Device_Entry Dev_Id %#x\n", bdf);
         return 0;
     }
 
@@ -599,7 +599,7 @@ static u16 __init parse_ivhd_device_exte
     if ( range->end.header.type != ACPI_IVRS_TYPE_END )
     {
         AMD_IOMMU_DEBUG("IVHD Error: "
-                        "Invalid Range: End_Type 0x%x\n",
+                        "Invalid Range: End_Type %#x\n",
                         range->end.header.type);
         return 0;
     }
@@ -608,7 +608,7 @@ static u16 __init parse_ivhd_device_exte
     if ( first_bdf >= ivrs_bdf_entries )
     {
         AMD_IOMMU_DEBUG("IVHD Error: "
-                        "Invalid Range: First Dev_Id 0x%x\n", first_bdf);
+                        "Invalid Range: First Dev_Id %#x\n", first_bdf);
         return 0;
     }
 
@@ -616,11 +616,11 @@ static u16 __init parse_ivhd_device_exte
     if ( (last_bdf >= ivrs_bdf_entries) || (last_bdf <= first_bdf) )
     {
         AMD_IOMMU_DEBUG("IVHD Error: "
-                        "Invalid Range: Last Dev_Id 0x%x\n", last_bdf);
+                        "Invalid Range: Last Dev_Id %#x\n", last_bdf);
         return 0;
     }
 
-    AMD_IOMMU_DEBUG(" Dev_Id Range: 0x%x -> 0x%x\n",
+    AMD_IOMMU_DEBUG(" Dev_Id Range: %#x -> %#x\n",
                     first_bdf, last_bdf);
 
     for ( bdf = first_bdf; bdf <= last_bdf; bdf++ )
@@ -646,7 +646,7 @@ static u16 __init parse_ivhd_device_spec
     bdf = special->used_id;
     if ( bdf >= ivrs_bdf_entries )
     {
-        AMD_IOMMU_DEBUG("IVHD Error: Invalid Device_Entry Dev_Id 0x%x\n", bdf);
+        AMD_IOMMU_DEBUG("IVHD Error: Invalid Device_Entry Dev_Id %#x\n", bdf);
         return 0;
     }
 
@@ -673,7 +673,7 @@ static int __init parse_ivhd_block(const
                                     ivhd_block->capability_offset);
     if ( !iommu )
     {
-        AMD_IOMMU_DEBUG("IVHD Error: No IOMMU for Dev_Id 0x%x  Cap 0x%x\n",
+        AMD_IOMMU_DEBUG("IVHD Error: No IOMMU for Dev_Id %#x Cap %#x\n",
                         ivhd_block->header.device_id,
                         ivhd_block->capability_offset);
         return -ENODEV;
@@ -687,9 +687,9 @@ static int __init parse_ivhd_block(const
         ivhd_device = (const void *)((const u8 *)ivhd_block + block_length);
 
         AMD_IOMMU_DEBUG( "IVHD Device Entry:\n");
-        AMD_IOMMU_DEBUG( " Type 0x%x\n", ivhd_device->header.type);
-        AMD_IOMMU_DEBUG( " Dev_Id 0x%x\n", ivhd_device->header.id);
-        AMD_IOMMU_DEBUG( " Flags 0x%x\n", ivhd_device->header.data_setting);
+        AMD_IOMMU_DEBUG( " Type %#x\n", ivhd_device->header.type);
+        AMD_IOMMU_DEBUG( " Dev_Id %#x\n", ivhd_device->header.id);
+        AMD_IOMMU_DEBUG( " Flags %#x\n", ivhd_device->header.data_setting);
 
         switch ( ivhd_device->header.type )
         {
@@ -788,9 +788,9 @@ static void __init dump_acpi_table_heade
         printk("%c", table->signature[i]);
     printk("\n");
 
-    AMD_IOMMU_DEBUG(" Length 0x%x\n", table->length);
-    AMD_IOMMU_DEBUG(" Revision 0x%x\n", table->revision);
-    AMD_IOMMU_DEBUG(" CheckSum 0x%x\n", table->checksum);
+    AMD_IOMMU_DEBUG(" Length %#x\n", table->length);
+    AMD_IOMMU_DEBUG(" Revision %#x\n", table->revision);
+    AMD_IOMMU_DEBUG(" CheckSum %#x\n", table->checksum);
 
     AMD_IOMMU_DEBUG(" OEM_Id ");
     for ( i = 0; i < ACPI_OEM_ID_SIZE; i++ )
@@ -802,14 +802,14 @@ static void __init dump_acpi_table_heade
         printk("%c", table->oem_table_id[i]);
     printk("\n");
 
-    AMD_IOMMU_DEBUG(" OEM_Revision 0x%x\n", table->oem_revision);
+    AMD_IOMMU_DEBUG(" OEM_Revision %#x\n", table->oem_revision);
 
     AMD_IOMMU_DEBUG(" Creator_Id ");
     for ( i = 0; i < ACPI_NAME_SIZE; i++ )
         printk("%c", table->asl_compiler_id[i]);
     printk("\n");
 
-    AMD_IOMMU_DEBUG(" Creator_Revision 0x%x\n",
+    AMD_IOMMU_DEBUG(" Creator_Revision %#x\n",
                     table->asl_compiler_revision);
 
 }
@@ -832,15 +832,15 @@ static int __init parse_ivrs_table(struc
         ivrs_block = (struct acpi_ivrs_header *)((u8 *)table + length);
 
         AMD_IOMMU_DEBUG("IVRS Block:\n");
-        AMD_IOMMU_DEBUG(" Type 0x%x\n", ivrs_block->type);
-        AMD_IOMMU_DEBUG(" Flags 0x%x\n", ivrs_block->flags);
-        AMD_IOMMU_DEBUG(" Length 0x%x\n", ivrs_block->length);
-        AMD_IOMMU_DEBUG(" Dev_Id 0x%x\n", ivrs_block->device_id);
+        AMD_IOMMU_DEBUG(" Type %#x\n", ivrs_block->type);
+        AMD_IOMMU_DEBUG(" Flags %#x\n", ivrs_block->flags);
+        AMD_IOMMU_DEBUG(" Length %#x\n", ivrs_block->length);
+        AMD_IOMMU_DEBUG(" Dev_Id %#x\n", ivrs_block->device_id);
 
         if ( table->length < (length + ivrs_block->length) )
         {
             AMD_IOMMU_DEBUG("IVRS Error: "
-                            "Table Length Exceeded: 0x%x -> 0x%lx\n",
+                            "Table Length Exceeded: %#x -> %#lx\n",
                             table->length,
                             (length + ivrs_block->length));
             return -ENODEV;
@@ -867,7 +867,7 @@ static int __init detect_iommu_acpi(stru
         checksum += raw_table[i];
     if ( checksum )
     {
-        AMD_IOMMU_DEBUG("IVRS Error: Invalid Checksum 0x%x\n", checksum);
+        AMD_IOMMU_DEBUG("IVRS Error: Invalid Checksum %#x\n", checksum);
         return -ENODEV;
     }
 
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/drivers/passthrough/amd/iommu_init.c	Fri Sep 21 14:25:12 2012 +0200
@@ -616,8 +616,8 @@ static void parse_event_log_entry(struct
                                        IOMMU_EVENT_FLAGS_SHIFT);
         addr= (u64*) (entry + 2);
         printk(XENLOG_ERR "AMD-Vi: "
-               "%s: domain = %d, device id = 0x%04x, "
-               "fault address = 0x%"PRIx64", flags = 0x%03x\n",
+               "%s: domain = %d, device id = %#x, "
+               "fault address = %#"PRIx64", flags = %#x\n",
                event_str[code-1], domain_id, device_id, *addr, flags);
 
         /* Tell the device to stop DMAing; we can't rely on the guest to
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/drivers/passthrough/amd/iommu_map.c
--- a/xen/drivers/passthrough/amd/iommu_map.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/drivers/passthrough/amd/iommu_map.c	Fri Sep 21 14:25:12 2012 +0200
@@ -795,7 +795,7 @@ void amd_iommu_share_p2m(struct domain *
 
         /* When sharing p2m with iommu, paging mode = 4 */
         hd->paging_mode = IOMMU_PAGING_MODE_LEVEL_4;
-        AMD_IOMMU_DEBUG("Share p2m table with iommu: p2m table = 0x%lx\n",
+        AMD_IOMMU_DEBUG("Share p2m table with iommu: p2m table = %#lx\n",
                         mfn_x(pgd_mfn));
     }
 }
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/drivers/passthrough/amd/pci_amd_iommu.c
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c	Fri Sep 21 14:25:12 2012 +0200
@@ -121,8 +121,8 @@ static void amd_iommu_setup_domain_devic
 
         amd_iommu_flush_device(iommu, req_id);
 
-        AMD_IOMMU_DEBUG("Setup I/O page table: device id = 0x%04x, "
-                        "root table = 0x%"PRIx64", "
+        AMD_IOMMU_DEBUG("Setup I/O page table: device id = %#x, "
+                        "root table = %#"PRIx64", "
                         "domain = %d, paging mode = %d\n", req_id,
                         page_to_maddr(hd->root_table),
                         hd->domain_id, hd->paging_mode);
@@ -314,7 +314,7 @@ void amd_iommu_disable_domain_device(str
 
         amd_iommu_flush_device(iommu, req_id);
 
-        AMD_IOMMU_DEBUG("Disable: device id = 0x%04x, "
+        AMD_IOMMU_DEBUG("Disable: device id = %#x, "
                         "domain = %d, paging mode = %d\n",
                         req_id,  domain_hvm_iommu(domain)->domain_id,
                         domain_hvm_iommu(domain)->paging_mode);
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/drivers/passthrough/vtd/dmar.c
--- a/xen/drivers/passthrough/vtd/dmar.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/drivers/passthrough/vtd/dmar.c	Fri Sep 21 14:25:12 2012 +0200
@@ -381,7 +381,7 @@ static int __init acpi_dmar_check_length
     if ( h->length >= min_len )
         return 0;
     dprintk(XENLOG_ERR VTDPREFIX,
-            "Invalid ACPI DMAR entry length: 0x%x\n",
+            "Invalid ACPI DMAR entry length: %#x\n",
             h->length);
     return -EINVAL;
 }
@@ -749,7 +749,7 @@ static int __init acpi_parse_dmar(struct
             break;
         default:
             dprintk(XENLOG_WARNING VTDPREFIX,
-                    "Ignore unknown DMAR structure type (0x%x)\n",
+                    "Ignore unknown DMAR structure type (%#x)\n",
                     entry_header->type);
             break;
         }
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/drivers/passthrough/vtd/intremap.c
--- a/xen/drivers/passthrough/vtd/intremap.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/drivers/passthrough/vtd/intremap.c	Fri Sep 21 14:25:12 2012 +0200
@@ -135,7 +135,7 @@ int iommu_supports_eim(void)
         if ( !ioapic_to_drhd(IO_APIC_ID(apic)) )
     {
             dprintk(XENLOG_WARNING VTDPREFIX,
-                    "There is not a DRHD for IOAPIC 0x%x (id: 0x%x)!\n",
+                    "There is not a DRHD for IOAPIC %#x (id: %#x)!\n",
                     apic, IO_APIC_ID(apic));
             return 0;
     }
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/drivers/passthrough/vtd/iommu.c	Fri Sep 21 14:25:12 2012 +0200
@@ -2035,7 +2035,7 @@ static int init_vtd_hw(void)
             {
                 iommu_intremap = 0;
                 dprintk(XENLOG_ERR VTDPREFIX,
-                    "ioapic_to_iommu: ioapic 0x%x (id: 0x%x) is NULL! "
+                    "ioapic_to_iommu: ioapic %#x (id: %#x) is NULL! "
                     "Will not try to enable Interrupt Remapping.\n",
                     apic, IO_APIC_ID(apic));
                 break;
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/drivers/passthrough/vtd/utils.c
--- a/xen/drivers/passthrough/vtd/utils.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/drivers/passthrough/vtd/utils.c	Fri Sep 21 14:25:12 2012 +0200
@@ -217,7 +217,7 @@ static void dump_iommu_info(unsigned cha
             struct iremap_entry *iremap_entries = NULL;
             int print_cnt = 0;
 
-            printk("  Interrupt remapping table (nr_entry=0x%x. "
+            printk("  Interrupt remapping table (nr_entry=%#x. "
                 "Only dump P=1 entries here):\n", nr_entry);
             printk("       SVT  SQ   SID      DST  V  AVL DLM TM RH DM "
                    "FPD P\n");
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/drivers/video/vesa.c
--- a/xen/drivers/video/vesa.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/drivers/video/vesa.c	Fri Sep 21 14:25:12 2012 +0200
@@ -111,7 +111,7 @@ void __init vesa_init(void)
 
     vga_puts = vesa_redraw_puts;
 
-    printk(XENLOG_INFO "vesafb: framebuffer at 0x%x, mapped to 0x%p, "
+    printk(XENLOG_INFO "vesafb: framebuffer at %#x, mapped to 0x%p, "
            "using %uk, total %uk\n",
            vlfb_info.lfb_base, lfb,
            vram_remap >> 10, vram_total >> 10);

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22:33:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1THMdy-00084c-0o; Thu, 27 Sep 2012 22:33:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdv-00081x-OC
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:16 +0000
Received: from [85.158.143.35:19203] by server-2.bemta-4.messagelabs.com id
	C6/FB-06610-B24D4605; Thu, 27 Sep 2012 22:33:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-21.messagelabs.com!1348785190!20184718!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22633 invoked from network); 27 Sep 2012 22:33:11 -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 Sep 2012 22: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 1THMdq-0007H2-2h
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdq-0003mt-18
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:10 +0000
Message-Id: <E1THMdq-0003mt-18@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] printk: prefer %#x et at over 0x%x
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348230312 -7200
# Node ID c8873f13cec3246a5e78939588e60fd930a3abb3
# Parent  1e6e6b49b4ac318cb86f413be680fe182e4d9511
printk: prefer %#x et at over 0x%x

Performance is not an issue with printk(), so let the function do
minimally more work and instead save a byte per affected format
specifier.

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


diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/acpi/boot.c
--- a/xen/arch/x86/acpi/boot.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/acpi/boot.c	Fri Sep 21 14:25:12 2012 +0200
@@ -341,14 +341,14 @@ acpi_fadt_parse_sleep_info(struct acpi_t
 	}
 
 	if (facs->length < 24) {
-		printk(KERN_ERR PREFIX "Invalid FACS table length: 0x%x",
+		printk(KERN_ERR PREFIX "Invalid FACS table length: %#x",
 			facs->length);
 		goto bad;
 	}
 
 	if (facs->length < 64)
 		printk(KERN_WARNING PREFIX
-			"FACS is shorter than ACPI spec allow: 0x%x",
+			"FACS is shorter than ACPI spec allow: %#x",
 			facs->length);
 
 	acpi_sinfo.wakeup_vector = facs_pa + 
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/acpi/cpu_idle.c
--- a/xen/arch/x86/acpi/cpu_idle.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/acpi/cpu_idle.c	Fri Sep 21 14:25:12 2012 +0200
@@ -978,11 +978,11 @@ static void print_cx_pminfo(uint32_t cpu
             return;
         
         printk("\tstates[%d]:\n", i);
-        printk("\t\treg.space_id = 0x%x\n", state.reg.space_id);
-        printk("\t\treg.bit_width = 0x%x\n", state.reg.bit_width);
-        printk("\t\treg.bit_offset = 0x%x\n", state.reg.bit_offset);
-        printk("\t\treg.access_size = 0x%x\n", state.reg.access_size);
-        printk("\t\treg.address = 0x%"PRIx64"\n", state.reg.address);
+        printk("\t\treg.space_id = %#x\n", state.reg.space_id);
+        printk("\t\treg.bit_width = %#x\n", state.reg.bit_width);
+        printk("\t\treg.bit_offset = %#x\n", state.reg.bit_offset);
+        printk("\t\treg.access_size = %#x\n", state.reg.access_size);
+        printk("\t\treg.address = %#"PRIx64"\n", state.reg.address);
         printk("\t\ttype    = %d\n", state.type);
         printk("\t\tlatency = %d\n", state.latency);
         printk("\t\tpower   = %d\n", state.power);
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/apic.c
--- a/xen/arch/x86/apic.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/apic.c	Fri Sep 21 14:25:12 2012 +0200
@@ -689,7 +689,7 @@ void __devinit setup_local_APIC(void)
         value = apic_read(APIC_ESR);
         if (value != oldvalue)
             apic_printk(APIC_VERBOSE, "ESR value before enabling "
-                        "vector: 0x%08lx  after: 0x%08lx\n",
+                        "vector: %#lx  after: %#lx\n",
                         oldvalue, value);
     } else {
         if (esr_disable)    
@@ -1210,7 +1210,7 @@ static int __init calibrate_APIC_clock(v
     bus_cycle  = (u32) (1000000000000LL/bus_freq); /* in pico seconds */
     bus_scale  = (1000*262144)/bus_cycle;
 
-    apic_printk(APIC_VERBOSE, "..... bus_scale = 0x%08X\n", bus_scale);
+    apic_printk(APIC_VERBOSE, "..... bus_scale = %#x\n", bus_scale);
     /* reset APIC to zero timeout value */
     __setup_APIC_LVTT(0);
 
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/cpu/mcheck/mce.c
--- a/xen/arch/x86/cpu/mcheck/mce.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/mce.c	Fri Sep 21 14:25:12 2012 +0200
@@ -1147,7 +1147,7 @@ static int x86_mc_msrinject_verify(struc
         }
 
         if (reason != NULL) {
-            printk("HV MSR INJECT ERROR: MSR 0x%llx %s\n",
+            printk("HV MSR INJECT ERROR: MSR %#Lx %s\n",
                    (unsigned long long)mci->mcinj_msr[i].reg, reason);
             errs++;
         }
@@ -1191,8 +1191,7 @@ static void x86_mc_msrinject(void *data)
 
     for (i = 0, msr = &mci->mcinj_msr[0];
          i < mci->mcinj_count; i++, msr++) {
-        printk("HV MSR INJECT (%s) target %u actual %u MSR 0x%llx "
-               "<-- 0x%llx\n",
+        printk("HV MSR INJECT (%s) target %u actual %u MSR %#Lx <-- %#Lx\n",
                intpose ?  "interpose" : "hardware",
                mci->mcinj_cpunr, smp_processor_id(),
                (unsigned long long)msr->reg,
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/cpu/mcheck/vmce.c
--- a/xen/arch/x86/cpu/mcheck/vmce.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/vmce.c	Fri Sep 21 14:25:12 2012 +0200
@@ -88,7 +88,7 @@ static int bank_mce_rdmsr(const struct v
     case MSR_IA32_MC0_CTL:
         /* stick all 1's to MCi_CTL */
         *val = ~0UL;
-        mce_printk(MCE_VERBOSE, "MCE: rdmsr MC%u_CTL 0x%"PRIx64"\n",
+        mce_printk(MCE_VERBOSE, "MCE: rdmsr MC%u_CTL %#"PRIx64"\n",
                    bank, *val);
         break;
     case MSR_IA32_MC0_STATUS:
@@ -102,7 +102,7 @@ static int bank_mce_rdmsr(const struct v
                 *val = entry->mci_status;
                 mce_printk(MCE_VERBOSE,
                            "MCE: rd MC%u_STATUS in vMCE# context "
-                           "value 0x%"PRIx64"\n", bank, *val);
+                           "value %#"PRIx64"\n", bank, *val);
             }
         }
         break;
@@ -116,7 +116,7 @@ static int bank_mce_rdmsr(const struct v
                 *val = entry->mci_addr;
                 mce_printk(MCE_VERBOSE,
                            "MCE: rdmsr MC%u_ADDR in vMCE# context "
-                           "0x%"PRIx64"\n", bank, *val);
+                           "%#"PRIx64"\n", bank, *val);
             }
         }
         break;
@@ -130,7 +130,7 @@ static int bank_mce_rdmsr(const struct v
                 *val = entry->mci_misc;
                 mce_printk(MCE_VERBOSE,
                            "MCE: rd MC%u_MISC in vMCE# context "
-                           "0x%"PRIx64"\n", bank, *val);
+                           "%#"PRIx64"\n", bank, *val);
             }
         }
         break;
@@ -171,18 +171,18 @@ int vmce_rdmsr(uint32_t msr, uint64_t *v
         *val = vmce->mcg_status;
         if (*val)
             mce_printk(MCE_VERBOSE,
-                       "MCE: rdmsr MCG_STATUS 0x%"PRIx64"\n", *val);
+                       "MCE: rdmsr MCG_STATUS %#"PRIx64"\n", *val);
         break;
     case MSR_IA32_MCG_CAP:
         *val = cur->arch.mcg_cap;
-        mce_printk(MCE_VERBOSE, "MCE: rdmsr MCG_CAP 0x%"PRIx64"\n",
+        mce_printk(MCE_VERBOSE, "MCE: rdmsr MCG_CAP %#"PRIx64"\n",
                    *val);
         break;
     case MSR_IA32_MCG_CTL:
         /* Stick all 1's when CTL support, and 0's when no CTL support */
         if ( cur->arch.mcg_cap & MCG_CTL_P )
             *val = ~0ULL;
-        mce_printk(MCE_VERBOSE, "MCE: rdmsr MCG_CTL 0x%"PRIx64"\n", *val);
+        mce_printk(MCE_VERBOSE, "MCE: rdmsr MCG_CTL %#"PRIx64"\n", *val);
         break;
     default:
         ret = mce_bank_msr(cur, msr) ? bank_mce_rdmsr(cur, msr, val) : 0;
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/cpu/mtrr/generic.c
--- a/xen/arch/x86/cpu/mtrr/generic.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/cpu/mtrr/generic.c	Fri Sep 21 14:25:12 2012 +0200
@@ -410,7 +410,7 @@ int generic_validate_add_page(unsigned l
 	    boot_cpu_data.x86_model == 1 &&
 	    boot_cpu_data.x86_mask <= 7) {
 		if (base & ((1 << (22 - PAGE_SHIFT)) - 1)) {
-			printk(KERN_WARNING "mtrr: base(0x%lx000) is not 4 MiB aligned\n", base);
+			printk(KERN_WARNING "mtrr: base(%#lx000) is not 4 MiB aligned\n", base);
 			return -EINVAL;
 		}
 		if (!(base + size < 0x70000 || base > 0x7003F) &&
@@ -427,7 +427,7 @@ int generic_validate_add_page(unsigned l
 	for (lbase = base; !(lbase & 1) && (last & 1);
 	     lbase = lbase >> 1, last = last >> 1) ;
 	if (lbase != last) {
-		printk(KERN_WARNING "mtrr: base(0x%lx000) is not aligned on a size(0x%lx000) boundary\n",
+		printk(KERN_WARNING "mtrr: base(%#lx000) is not aligned on a size(%#lx000) boundary\n",
 		       base, size);
 		return -EINVAL;
 	}
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/cpu/mtrr/main.c
--- a/xen/arch/x86/cpu/mtrr/main.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/cpu/mtrr/main.c	Fri Sep 21 14:25:12 2012 +0200
@@ -366,8 +366,8 @@ int mtrr_add_page(unsigned long base, un
 					continue;
 			}
 			printk(KERN_WARNING
-			       "mtrr: 0x%lx000,0x%lx000 overlaps existing"
-			       " 0x%lx000,0x%lx000\n", base, size, lbase,
+			       "mtrr: %#lx000,%#lx000 overlaps existing"
+			       " %#lx000,%#lx000\n", base, size, lbase,
 			       lsize);
 			goto out;
 		}
@@ -412,7 +412,7 @@ static int mtrr_check(unsigned long base
 		printk(KERN_WARNING
 			"mtrr: size and base must be multiples of 4 kiB\n");
 		printk(KERN_DEBUG
-			"mtrr: size: 0x%lx  base: 0x%lx\n", size, base);
+			"mtrr: size: %#lx  base: %#lx\n", size, base);
 		dump_stack();
 		return -1;
 	}
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/domain_build.c
--- a/xen/arch/x86/domain_build.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/domain_build.c	Fri Sep 21 14:25:12 2012 +0200
@@ -396,13 +396,13 @@ int __init construct_dom0(
     }
     if (elf_64bit(&elf) && machine == EM_X86_64)
         compatible = 1;
-    printk(" Dom0 kernel: %s%s, %s, paddr 0x%" PRIx64 " -> 0x%" PRIx64 "\n",
+    printk(" Dom0 kernel: %s%s, %s, paddr %#" PRIx64 " -> %#" PRIx64 "\n",
            elf_64bit(&elf) ? "64-bit" : "32-bit",
            parms.pae       ? ", PAE"  : "",
            elf_msb(&elf)   ? "msb"    : "lsb",
            elf.pstart, elf.pend);
     if ( elf.bsd_symtab_pstart )
-        printk(" Dom0 symbol map 0x%" PRIx64 " -> 0x%" PRIx64 "\n",
+        printk(" Dom0 symbol map %#" PRIx64 " -> %#" PRIx64 "\n",
                elf.bsd_symtab_pstart, elf.bsd_symtab_pend);
 
     if ( !compatible )
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/hvm/hvm.c	Fri Sep 21 14:25:12 2012 +0200
@@ -1468,7 +1468,7 @@ int hvm_set_efer(uint64_t value)
     if ( !hvm_efer_valid(v->domain, value, efer_validbits) )
     {
         gdprintk(XENLOG_WARNING, "Trying to set reserved bit in "
-                 "EFER: 0x%"PRIx64"\n", value);
+                 "EFER: %#"PRIx64"\n", value);
         hvm_inject_hw_exception(TRAP_gp_fault, 0);
         return X86EMUL_EXCEPTION;
     }
@@ -4095,7 +4095,7 @@ long do_hvm_op(unsigned long op, XEN_GUE
             {
                 put_gfn(d, pfn);
                 gdprintk(XENLOG_WARNING,
-                         "type for pfn 0x%lx changed to grant while "
+                         "type for pfn %#lx changed to grant while "
                          "we were working?\n", pfn);
                 goto param_fail4;
             }
@@ -4106,7 +4106,7 @@ long do_hvm_op(unsigned long op, XEN_GUE
                 {
                     put_gfn(d, pfn);
                     gdprintk(XENLOG_WARNING,
-                             "type of pfn 0x%lx changed from %d to %d while "
+                             "type of pfn %#lx changed from %d to %d while "
                              "we were trying to change it to %d\n",
                              pfn, t, nt, memtype[a.hvmmem_type]);
                     goto param_fail4;
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/hvm/io.c
--- a/xen/arch/x86/hvm/io.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/hvm/io.c	Fri Sep 21 14:25:12 2012 +0200
@@ -393,7 +393,7 @@ int dpci_ioport_intercept(ioreq_t *p)
 
     if ( !ioports_access_permitted(d, mport, mport + p->size - 1) ) 
     {
-        gdprintk(XENLOG_ERR, "Error: access to gport=0x%x denied!\n",
+        gdprintk(XENLOG_ERR, "Error: access to gport=%#x denied!\n",
                  (uint32_t)p->addr);
         return X86EMUL_UNHANDLEABLE;
     }
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/hvm/irq.c
--- a/xen/arch/x86/hvm/irq.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/hvm/irq.c	Fri Sep 21 14:25:12 2012 +0200
@@ -488,7 +488,7 @@ static void irq_dump(struct domain *d)
            hvm_irq->pci_link_assert_count[1],
            hvm_irq->pci_link_assert_count[2],
            hvm_irq->pci_link_assert_count[3]);
-    printk("Callback via %i:0x%"PRIx32",%s asserted\n", 
+    printk("Callback via %i:%#"PRIx32",%s asserted\n",
            hvm_irq->callback_via_type, hvm_irq->callback_via.gsi, 
            hvm_irq->callback_via_asserted ? "" : " not");
 }
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/hvm/svm/intr.c
--- a/xen/arch/x86/hvm/svm/intr.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/hvm/svm/intr.c	Fri Sep 21 14:25:12 2012 +0200
@@ -175,7 +175,7 @@ void svm_intr_assist(void)
                 /* Guest already enabled an interrupt window. */
                 return;
             default:
-                panic("%s: nestedsvm_vcpu_interrupt can't handle value 0x%x\n",
+                panic("%s: nestedsvm_vcpu_interrupt can't handle value %#x\n",
                     __func__, rc);
             }
         }
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/hvm/svm/nestedsvm.c
--- a/xen/arch/x86/hvm/svm/nestedsvm.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c	Fri Sep 21 14:25:12 2012 +0200
@@ -943,7 +943,7 @@ nsvm_vmcb_guest_intercepts_exitcode(stru
         break;
 
     default:
-        gdprintk(XENLOG_ERR, "Illegal exitcode 0x%"PRIx64"\n", exitcode);
+        gdprintk(XENLOG_ERR, "Illegal exitcode %#"PRIx64"\n", exitcode);
         BUG();
         break;
     }
@@ -1235,7 +1235,7 @@ int nsvm_wrmsr(struct vcpu *v, unsigned 
     case MSR_K8_VM_HSAVE_PA:
         if (!nestedsvm_vmcb_isvalid(v, msr_content)) {
             gdprintk(XENLOG_ERR,
-                "MSR_K8_VM_HSAVE_PA value invalid 0x%"PRIx64"\n", msr_content);
+                "MSR_K8_VM_HSAVE_PA value invalid %#"PRIx64"\n", msr_content);
             ret = -1; /* inject #GP */
             break;
         }
@@ -1244,7 +1244,7 @@ int nsvm_wrmsr(struct vcpu *v, unsigned 
     case MSR_AMD64_TSC_RATIO:
         if ((msr_content & ~TSC_RATIO_RSVD_BITS) != msr_content) {
             gdprintk(XENLOG_ERR,
-                "reserved bits set in MSR_AMD64_TSC_RATIO 0x%"PRIx64"\n",
+                "reserved bits set in MSR_AMD64_TSC_RATIO %#"PRIx64"\n",
                 msr_content);
             ret = -1; /* inject #GP */
             break;
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/hvm/svm/svm.c	Fri Sep 21 14:25:12 2012 +0200
@@ -241,7 +241,7 @@ static int svm_vmcb_restore(struct vcpu 
          ((c->pending_type == 1) || (c->pending_type > 6) ||
           (c->pending_reserved != 0)) )
     {
-        gdprintk(XENLOG_ERR, "Invalid pending event 0x%"PRIx32".\n",
+        gdprintk(XENLOG_ERR, "Invalid pending event %#"PRIx32".\n",
                  c->pending_event);
         return -EINVAL;
     }
@@ -254,7 +254,7 @@ static int svm_vmcb_restore(struct vcpu 
                                      NULL, P2M_ALLOC);
             if ( !page )
             {
-                gdprintk(XENLOG_ERR, "Invalid CR3 value=0x%"PRIx64"\n",
+                gdprintk(XENLOG_ERR, "Invalid CR3 value=%#"PRIx64"\n",
                          c->cr3);
                 return -EINVAL;
             }
@@ -289,7 +289,7 @@ static int svm_vmcb_restore(struct vcpu 
 
     if ( c->pending_valid ) 
     {
-        gdprintk(XENLOG_INFO, "Re-injecting 0x%"PRIx32", 0x%"PRIx32"\n",
+        gdprintk(XENLOG_INFO, "Re-injecting %#"PRIx32", %#"PRIx32"\n",
                  c->pending_event, c->error_code);
 
         if ( hvm_event_needs_reinjection(c->pending_type, c->pending_vector) )
@@ -2398,8 +2398,8 @@ void svm_vmexit_handler(struct cpu_user_
 
     default:
     exit_and_crash:
-        gdprintk(XENLOG_ERR, "unexpected VMEXIT: exit reason = 0x%"PRIx64", "
-                 "exitinfo1 = %"PRIx64", exitinfo2 = %"PRIx64"\n",
+        gdprintk(XENLOG_ERR, "unexpected VMEXIT: exit reason = %#"PRIx64", "
+                 "exitinfo1 = %#"PRIx64", exitinfo2 = %#"PRIx64"\n",
                  exit_reason, 
                  (u64)vmcb->exitinfo1, (u64)vmcb->exitinfo2);
         domain_crash(v->domain);
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/hvm/svm/svmdebug.c
--- a/xen/arch/x86/hvm/svm/svmdebug.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/hvm/svm/svmdebug.c	Fri Sep 21 14:25:12 2012 +0200
@@ -32,33 +32,32 @@ static void svm_dump_sel(const char *nam
 void svm_vmcb_dump(const char *from, struct vmcb_struct *vmcb)
 {
     printk("Dumping guest's current state at %s...\n", from);
-    printk("Size of VMCB = %d, paddr = 0x%016lx, vaddr = %p\n",
+    printk("Size of VMCB = %d, paddr = %#lx, vaddr = %p\n",
            (int) sizeof(struct vmcb_struct), virt_to_maddr(vmcb), vmcb);
 
-    printk("cr_intercepts = 0x%08x dr_intercepts = 0x%08x "
-           "exception_intercepts = 0x%08x\n", 
+    printk("cr_intercepts = %#x dr_intercepts = %#x "
+           "exception_intercepts = %#x\n",
            vmcb->_cr_intercepts, vmcb->_dr_intercepts, 
            vmcb->_exception_intercepts);
-    printk("general1_intercepts = 0x%08x general2_intercepts = 0x%08x\n", 
+    printk("general1_intercepts = %#x general2_intercepts = %#x\n",
            vmcb->_general1_intercepts, vmcb->_general2_intercepts);
-    printk("iopm_base_pa = 0x%016llx msrpm_base_pa = 0x%016llx tsc_offset = "
-            "0x%016llx\n", 
+    printk("iopm_base_pa = %#Lx msrpm_base_pa = %#Lx tsc_offset = %#Lx\n",
            (unsigned long long)vmcb->_iopm_base_pa,
            (unsigned long long)vmcb->_msrpm_base_pa,
            (unsigned long long)vmcb->_tsc_offset);
-    printk("tlb_control = 0x%08x vintr = 0x%016llx interrupt_shadow = "
-            "0x%016llx\n", vmcb->tlb_control,
+    printk("tlb_control = %#x vintr = %#Lx interrupt_shadow = %#Lx\n",
+           vmcb->tlb_control,
            (unsigned long long)vmcb->_vintr.bytes,
            (unsigned long long)vmcb->interrupt_shadow);
-    printk("exitcode = 0x%016llx exitintinfo = 0x%016llx\n", 
+    printk("exitcode = %#Lx exitintinfo = %#Lx\n",
            (unsigned long long)vmcb->exitcode,
            (unsigned long long)vmcb->exitintinfo.bytes);
-    printk("exitinfo1 = 0x%016llx exitinfo2 = 0x%016llx \n",
+    printk("exitinfo1 = %#Lx exitinfo2 = %#Lx \n",
            (unsigned long long)vmcb->exitinfo1,
            (unsigned long long)vmcb->exitinfo2);
-    printk("np_enable = 0x%016llx guest_asid = 0x%03x\n", 
+    printk("np_enable = %Lx guest_asid = %#x\n",
            (unsigned long long)vmcb->_np_enable, vmcb->_guest_asid);
-    printk("cpl = %d efer = 0x%016llx star = 0x%016llx lstar = 0x%016llx\n", 
+    printk("cpl = %d efer = %#Lx star = %#Lx lstar = %#Lx\n",
            vmcb->_cpl, (unsigned long long)vmcb->_efer,
            (unsigned long long)vmcb->star, (unsigned long long)vmcb->lstar);
     printk("CR0 = 0x%016llx CR2 = 0x%016llx\n",
@@ -77,7 +76,7 @@ void svm_vmcb_dump(const char *from, str
     printk("KernGSBase = 0x%016llx PAT = 0x%016llx \n", 
            (unsigned long long)vmcb->kerngsbase,
            (unsigned long long)vmcb->_g_pat);
-    printk("H_CR3 = 0x%016llx CleanBits = 0x%08x\n",
+    printk("H_CR3 = 0x%016llx CleanBits = %#x\n",
            (unsigned long long)vmcb->_h_cr3, vmcb->cleanbits.bytes);
 
     /* print out all the selectors */
@@ -104,48 +103,48 @@ svm_vmcb_isvalid(const char *from, struc
     } else return 1;
 
     if ((vmcb->_efer & EFER_SVME) == 0) {
-        PRINTF("EFER: SVME bit not set (0x%"PRIx64")\n", vmcb->_efer);
+        PRINTF("EFER: SVME bit not set (%#"PRIx64")\n", vmcb->_efer);
     }
 
     if ((vmcb->_cr0 & X86_CR0_CD) == 0 && (vmcb->_cr0 & X86_CR0_NW) != 0) {
-        PRINTF("CR0: CD bit is zero and NW bit set (0x%"PRIx64")\n",
+        PRINTF("CR0: CD bit is zero and NW bit set (%#"PRIx64")\n",
                 vmcb->_cr0);
     }
 
     if ((vmcb->_cr0 >> 32U) != 0) {
-        PRINTF("CR0: bits [63:32] are not zero (0x%"PRIx64")\n",
+        PRINTF("CR0: bits [63:32] are not zero (%#"PRIx64")\n",
                 vmcb->_cr0);
     }
 
     if ((vmcb->_cr3 & 0x7) != 0) {
-        PRINTF("CR3: MBZ bits are set (0x%"PRIx64")\n", vmcb->_cr3);
+        PRINTF("CR3: MBZ bits are set (%#"PRIx64")\n", vmcb->_cr3);
     }
     if ((vmcb->_efer & EFER_LMA) && (vmcb->_cr3 & 0xfe) != 0) {
-        PRINTF("CR3: MBZ bits are set (0x%"PRIx64")\n", vmcb->_cr3);
+        PRINTF("CR3: MBZ bits are set (%#"PRIx64")\n", vmcb->_cr3);
     }
 
     if ((vmcb->_cr4 >> 19U) != 0) {
-        PRINTF("CR4: bits [63:19] are not zero (0x%"PRIx64")\n",
+        PRINTF("CR4: bits [63:19] are not zero (%#"PRIx64")\n",
                 vmcb->_cr4);
     }
 
     if (((vmcb->_cr4 >> 11U) & 0x7fU) != 0) {
-        PRINTF("CR4: bits [17:11] are not zero (0x%"PRIx64")\n",
+        PRINTF("CR4: bits [17:11] are not zero (%#"PRIx64")\n",
                 vmcb->_cr4);
     }
 
     if ((vmcb->_dr6 >> 32U) != 0) {
-        PRINTF("DR6: bits [63:32] are not zero (0x%"PRIx64")\n",
+        PRINTF("DR6: bits [63:32] are not zero (%#"PRIx64")\n",
                 vmcb->_dr6);
     }
 
     if ((vmcb->_dr7 >> 32U) != 0) {
-        PRINTF("DR7: bits [63:32] are not zero (0x%"PRIx64")\n",
+        PRINTF("DR7: bits [63:32] are not zero (%#"PRIx64")\n",
                 vmcb->_dr7);
     }
 
     if ((vmcb->_efer >> 15U) != 0) {
-        PRINTF("EFER: bits [63:15] are not zero (0x%"PRIx64")\n",
+        PRINTF("EFER: bits [63:15] are not zero (%#"PRIx64")\n",
                 vmcb->_efer);
     }
 
@@ -168,12 +167,12 @@ svm_vmcb_isvalid(const char *from, struc
     }
 
     if ((vmcb->_general2_intercepts & GENERAL2_INTERCEPT_VMRUN) == 0) {
-        PRINTF("GENERAL2_INTERCEPT: VMRUN intercept bit is clear (0x%"PRIx32")\n",
+        PRINTF("GENERAL2_INTERCEPT: VMRUN intercept bit is clear (%#"PRIx32")\n",
             vmcb->_general2_intercepts);
     }
 
     if (vmcb->eventinj.fields.resvd1 != 0) {
-        PRINTF("eventinj: MBZ bits are set (0x%"PRIx64")\n",
+        PRINTF("eventinj: MBZ bits are set (%#"PRIx64")\n",
                 vmcb->eventinj.bytes);
     }
 
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/hvm/vlapic.c
--- a/xen/arch/x86/hvm/vlapic.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/hvm/vlapic.c	Fri Sep 21 14:25:12 2012 +0200
@@ -172,7 +172,7 @@ static uint32_t vlapic_get_ppr(struct vl
         ppr = isrv & 0xf0;
 
     HVM_DBG_LOG(DBG_LEVEL_VLAPIC_INTERRUPT,
-                "vlapic %p, ppr 0x%x, isr 0x%x, isrv 0x%x",
+                "vlapic %p, ppr %#x, isr %#x, isrv %#x",
                 vlapic, ppr, isr, isrv);
 
     return ppr;
@@ -215,8 +215,8 @@ bool_t vlapic_match_dest(
     struct vlapic *target, struct vlapic *source,
     int short_hand, uint8_t dest, uint8_t dest_mode)
 {
-    HVM_DBG_LOG(DBG_LEVEL_VLAPIC, "target %p, source %p, dest 0x%x, "
-                "dest_mode 0x%x, short_hand 0x%x",
+    HVM_DBG_LOG(DBG_LEVEL_VLAPIC, "target %p, source %p, dest %#x, "
+                "dest_mode %#x, short_hand %#x",
                 target, source, dest, dest_mode, short_hand);
 
     switch ( short_hand )
@@ -562,20 +562,20 @@ static int vlapic_read(
         break;
 
     default:
-        gdprintk(XENLOG_ERR, "Local APIC read with len=0x%lx, "
+        gdprintk(XENLOG_ERR, "Local APIC read with len=%#lx, "
                  "should be 4 instead.\n", len);
         goto exit_and_crash;
     }
 
-    HVM_DBG_LOG(DBG_LEVEL_VLAPIC, "offset 0x%x with length 0x%lx, "
-                "and the result is 0x%lx", offset, len, result);
+    HVM_DBG_LOG(DBG_LEVEL_VLAPIC, "offset %#x with length %#lx, "
+                "and the result is %#lx", offset, len, result);
 
  out:
     *pval = result;
     return X86EMUL_OKAY;
 
  unaligned_exit_and_crash:
-    gdprintk(XENLOG_ERR, "Unaligned LAPIC read len=0x%lx at offset=0x%x.\n",
+    gdprintk(XENLOG_ERR, "Unaligned LAPIC read len=%#lx at offset=%#x.\n",
              len, offset);
  exit_and_crash:
     domain_crash(v->domain);
@@ -759,7 +759,7 @@ static int vlapic_reg_write(struct vcpu 
 
     case APIC_TDCR:
         vlapic_set_tdcr(vlapic, val & 0xb);
-        HVM_DBG_LOG(DBG_LEVEL_VLAPIC_TIMER, "timer divisor is 0x%x",
+        HVM_DBG_LOG(DBG_LEVEL_VLAPIC_TIMER, "timer divisor is %#x",
                     vlapic->hw.timer_divisor);
         break;
 
@@ -768,7 +768,7 @@ static int vlapic_reg_write(struct vcpu 
     }
     if (rc == X86EMUL_UNHANDLEABLE)
         gdprintk(XENLOG_DEBUG,
-                "Local APIC Write wrong to register 0x%x\n", offset);
+                "Local APIC Write wrong to register %#x\n", offset);
     return rc;
 }
 
@@ -781,7 +781,7 @@ static int vlapic_write(struct vcpu *v, 
 
     if ( offset != 0xb0 )
         HVM_DBG_LOG(DBG_LEVEL_VLAPIC,
-                    "offset 0x%x with length 0x%lx, and value is 0x%lx",
+                    "offset %#x with length %#lx, and value is %#lx",
                     offset, len, val);
 
     /*
@@ -827,7 +827,7 @@ static int vlapic_write(struct vcpu *v, 
     return vlapic_reg_write(v, offset, val);
 
  unaligned_exit_and_crash:
-    gdprintk(XENLOG_ERR, "Unaligned LAPIC write len=0x%lx at offset=0x%x.\n",
+    gdprintk(XENLOG_ERR, "Unaligned LAPIC write len=%#lx at offset=%#x.\n",
              len, offset);
  exit_and_crash:
     domain_crash(v->domain);
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/hvm/vmx/vmcs.c
--- a/xen/arch/x86/hvm/vmx/vmcs.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/hvm/vmx/vmcs.c	Fri Sep 21 14:25:12 2012 +0200
@@ -121,7 +121,7 @@ static u32 adjust_vmx_controls(
 static bool_t cap_check(const char *name, u32 expected, u32 saw)
 {
     if ( saw != expected )
-        printk("VMX %s: saw 0x%08x expected 0x%08x\n", name, saw, expected);
+        printk("VMX %s: saw %#x expected %#x\n", name, saw, expected);
     return saw != expected;
 }
 
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Fri Sep 21 14:25:12 2012 +0200
@@ -210,7 +210,7 @@ long_mode_do_msr_read(unsigned int msr, 
         return HNDL_unhandled;
     }
 
-    HVM_DBG_LOG(DBG_LEVEL_0, "msr 0x%x content 0x%"PRIx64, msr, *msr_content);
+    HVM_DBG_LOG(DBG_LEVEL_0, "msr %#x content %#"PRIx64, msr, *msr_content);
 
     return HNDL_done;
 }
@@ -222,7 +222,7 @@ long_mode_do_msr_write(unsigned int msr,
     struct vmx_msr_state *guest_msr_state = &v->arch.hvm_vmx.msr_state;
     struct vmx_msr_state *host_msr_state = &this_cpu(host_msr_state);
 
-    HVM_DBG_LOG(DBG_LEVEL_0, "msr 0x%x content 0x%"PRIx64, msr, msr_content);
+    HVM_DBG_LOG(DBG_LEVEL_0, "msr %#x content %#"PRIx64, msr, msr_content);
 
     switch ( msr )
     {
@@ -466,7 +466,7 @@ static int vmx_restore_cr0_cr3(
                                      NULL, P2M_ALLOC);
             if ( !page )
             {
-                gdprintk(XENLOG_ERR, "Invalid CR3 value=0x%lx\n", cr3);
+                gdprintk(XENLOG_ERR, "Invalid CR3 value=%#lx\n", cr3);
                 return -EINVAL;
             }
         }
@@ -492,7 +492,7 @@ static int vmx_vmcs_restore(struct vcpu 
          ((c->pending_type == 1) || (c->pending_type > 6) ||
           (c->pending_reserved != 0)) )
     {
-        gdprintk(XENLOG_ERR, "Invalid pending event 0x%"PRIx32".\n",
+        gdprintk(XENLOG_ERR, "Invalid pending event %#"PRIx32".\n",
                  c->pending_event);
         return -EINVAL;
     }
@@ -524,7 +524,7 @@ static int vmx_vmcs_restore(struct vcpu 
 
     if ( c->pending_valid )
     {
-        gdprintk(XENLOG_INFO, "Re-injecting 0x%"PRIx32", 0x%"PRIx32"\n",
+        gdprintk(XENLOG_INFO, "Re-injecting %#"PRIx32", %#"PRIx32"\n",
                  c->pending_event, c->error_code);
 
         if ( hvm_event_needs_reinjection(c->pending_type, c->pending_vector) )
@@ -1789,7 +1789,7 @@ static int is_last_branch_msr(u32 ecx)
 
 static int vmx_msr_read_intercept(unsigned int msr, uint64_t *msr_content)
 {
-    HVM_DBG_LOG(DBG_LEVEL_1, "ecx=%x", msr);
+    HVM_DBG_LOG(DBG_LEVEL_1, "ecx=%#x", msr);
 
     switch ( msr )
     {
@@ -1854,7 +1854,7 @@ static int vmx_msr_read_intercept(unsign
     }
 
 done:
-    HVM_DBG_LOG(DBG_LEVEL_1, "returns: ecx=%x, msr_value=0x%"PRIx64,
+    HVM_DBG_LOG(DBG_LEVEL_1, "returns: ecx=%#x, msr_value=%#"PRIx64,
                 msr, *msr_content);
     return X86EMUL_OKAY;
 
@@ -1927,8 +1927,7 @@ static int vmx_msr_write_intercept(unsig
 {
     struct vcpu *v = current;
 
-    HVM_DBG_LOG(DBG_LEVEL_1, "ecx=%x, msr_value=0x%"PRIx64,
-                msr, msr_content);
+    HVM_DBG_LOG(DBG_LEVEL_1, "ecx=%#x, msr_value=%#"PRIx64, msr, msr_content);
 
     switch ( msr )
     {
@@ -2107,7 +2106,7 @@ static void vmx_failed_vmentry(unsigned 
     unsigned long exit_qualification = __vmread(EXIT_QUALIFICATION);
     struct vcpu *curr = current;
 
-    printk("Failed vm entry (exit reason 0x%x) ", exit_reason);
+    printk("Failed vm entry (exit reason %#x) ", exit_reason);
     switch ( failed_vmentry_reason )
     {
     case EXIT_REASON_INVALID_GUEST_STATE:
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/io_apic.c
--- a/xen/arch/x86/io_apic.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/io_apic.c	Fri Sep 21 14:25:12 2012 +0200
@@ -2204,7 +2204,7 @@ int io_apic_set_pci_routing (int ioapic,
     entry.vector = vector;
 
     apic_printk(APIC_DEBUG, KERN_DEBUG "IOAPIC[%d]: Set PCI routing entry "
-		"(%d-%d -> 0x%x -> IRQ %d Mode:%i Active:%i)\n", ioapic,
+		"(%d-%d -> %#x -> IRQ %d Mode:%i Active:%i)\n", ioapic,
 		mp_ioapics[ioapic].mpc_apicid, pin, entry.vector, irq,
 		edge_level, active_high_low);
 
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/microcode_amd.c
--- a/xen/arch/x86/microcode_amd.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/microcode_amd.c	Fri Sep 21 14:25:12 2012 +0200
@@ -88,7 +88,7 @@ static int collect_cpu_info(int cpu, str
 
     rdmsrl(MSR_AMD_PATCHLEVEL, csig->rev);
 
-    printk(KERN_DEBUG "microcode: collect_cpu_info: patch_id=0x%x\n",
+    printk(KERN_DEBUG "microcode: collect_cpu_info: patch_id=%#x\n",
            csig->rev);
 
     return 0;
@@ -132,7 +132,7 @@ static int microcode_fits(const struct m
         return 0;
 
     printk(KERN_DEBUG "microcode: CPU%d found a matching microcode "
-           "update with version 0x%x (current=0x%x)\n",
+           "update with version %#x (current=%#x)\n",
            cpu, mc_header->patch_id, uci->cpu_sig.rev);
 
     return 1;
@@ -169,7 +169,7 @@ static int apply_microcode(int cpu)
     if ( rev != hdr->patch_id )
     {
         printk(KERN_ERR "microcode: CPU%d update from revision "
-               "0x%x to 0x%x failed\n", cpu, hdr->patch_id, rev);
+               "%#x to %#x failed\n", cpu, hdr->patch_id, rev);
         return -EIO;
     }
 
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/microcode_intel.c
--- a/xen/arch/x86/microcode_intel.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/microcode_intel.c	Fri Sep 21 14:25:12 2012 +0200
@@ -122,7 +122,7 @@ static int collect_cpu_info(int cpu_num,
     /* get the current revision from MSR 0x8B */
     rdmsrl(MSR_IA32_UCODE_REV, msr_content);
     csig->rev = (uint32_t)(msr_content >> 32);
-    pr_debug("microcode: collect_cpu_info : sig=0x%x, pf=0x%x, rev=0x%x\n",
+    pr_debug("microcode: collect_cpu_info : sig=%#x, pf=%#x, rev=%#x\n",
              csig->sig, csig->pf, csig->rev);
 
     return 0;
@@ -264,7 +264,7 @@ static int get_matching_microcode(const 
     if ( uci->mc.mc_intel && uci->mc.mc_intel->hdr.rev >= mc_header->rev )
         return 0;
     pr_debug("microcode: CPU%d found a matching microcode update with"
-             " version 0x%x (current=0x%x)\n",
+             " version %#x (current=%#x)\n",
              cpu, mc_header->rev, uci->cpu_sig.rev);
     new_mc = xmalloc_bytes(total_size);
     if ( new_mc == NULL )
@@ -311,11 +311,11 @@ static int apply_microcode(int cpu)
     if ( val[1] != uci->mc.mc_intel->hdr.rev )
     {
         printk(KERN_ERR "microcode: CPU%d update from revision "
-               "0x%x to 0x%x failed\n", cpu_num, uci->cpu_sig.rev, val[1]);
+               "%#x to %#x failed\n", cpu_num, uci->cpu_sig.rev, val[1]);
         return -EIO;
     }
     printk(KERN_INFO "microcode: CPU%d updated from revision "
-           "0x%x to 0x%x, date = %04x-%02x-%02x \n",
+           "%#x to %#x, date = %04x-%02x-%02x \n",
            cpu_num, uci->cpu_sig.rev, val[1],
            uci->mc.mc_intel->hdr.date & 0xffff,
            uci->mc.mc_intel->hdr.date >> 24,
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/mm.c	Fri Sep 21 14:25:12 2012 +0200
@@ -3102,7 +3102,7 @@ long do_mmuext_op(
         }
 
         default:
-            MEM_LOG("Invalid extended pt command 0x%x", op.cmd);
+            MEM_LOG("Invalid extended pt command %#x", op.cmd);
             rc = -ENOSYS;
             okay = 0;
             break;
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/mm/hap/nested_hap.c
--- a/xen/arch/x86/mm/hap/nested_hap.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/mm/hap/nested_hap.c	Fri Sep 21 14:25:12 2012 +0200
@@ -129,7 +129,7 @@ nestedhap_fix_p2m(struct vcpu *v, struct
 
     if (rv == 0) {
         gdprintk(XENLOG_ERR,
-		"failed to set entry for 0x%"PRIx64" -> 0x%"PRIx64"\n",
+		"failed to set entry for %#"PRIx64" -> %#"PRIx64"\n",
 		L2_gpa, L0_gpa);
         BUG();
     }
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/mm/p2m-pt.c
--- a/xen/arch/x86/mm/p2m-pt.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/mm/p2m-pt.c	Fri Sep 21 14:25:12 2012 +0200
@@ -110,8 +110,8 @@ p2m_find_entry(void *table, unsigned lon
     index = *gfn_remainder >> shift;
     if ( index >= max )
     {
-        P2M_DEBUG("gfn=0x%lx out of range "
-                  "(gfn_remainder=0x%lx shift=%d index=0x%x max=0x%x)\n",
+        P2M_DEBUG("gfn=%#lx out of range "
+                  "(gfn_remainder=%#lx shift=%d index=%#x max=%#x)\n",
                   gfn, *gfn_remainder, shift, index, max);
         return NULL;
     }
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/mm/shadow/common.c
--- a/xen/arch/x86/mm/shadow/common.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/mm/shadow/common.c	Fri Sep 21 14:25:12 2012 +0200
@@ -872,7 +872,7 @@ static int sh_skip_sync(struct vcpu *v, 
         return SHADOW_INTERNAL_NAME(sh_safe_not_to_sync, 3)(v, gl1mfn);
     else if ( pg->shadow_flags & SHF_L1_64 )
         return SHADOW_INTERNAL_NAME(sh_safe_not_to_sync, 4)(v, gl1mfn);
-    SHADOW_ERROR("gmfn 0x%lx was OOS but not shadowed as an l1.\n", 
+    SHADOW_ERROR("gmfn %#lx was OOS but not shadowed as an l1.\n",
                  mfn_x(gl1mfn));
     BUG();
     return 0; /* BUG() is no longer __attribute__((noreturn)). */
@@ -2596,8 +2596,8 @@ void sh_remove_shadows(struct vcpu *v, m
     smfn = shadow_hash_lookup(v, mfn_x(gmfn), t);                       \
     if ( unlikely(!mfn_valid(smfn)) )                                   \
     {                                                                   \
-        SHADOW_ERROR(": gmfn %#lx has flags 0x%"PRIx32                  \
-                     " but no type-0x%"PRIx32" shadow\n",               \
+        SHADOW_ERROR(": gmfn %#lx has flags %#"PRIx32                   \
+                     " but no type-%#"PRIx32" shadow\n",                \
                      mfn_x(gmfn), (uint32_t)pg->shadow_flags, t);       \
         break;                                                          \
     }                                                                   \
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/mm/shadow/multi.c
--- a/xen/arch/x86/mm/shadow/multi.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/mm/shadow/multi.c	Fri Sep 21 14:25:12 2012 +0200
@@ -2171,7 +2171,7 @@ static int validate_gl4e(struct vcpu *v,
             // attempt by the guest to write to a xen reserved slot
             //
             SHADOW_PRINTK("%s out-of-range update "
-                           "sl4mfn=%05lx index=0x%x val=%" SH_PRI_pte "\n",
+                           "sl4mfn=%05lx index=%#x val=%" SH_PRI_pte "\n",
                            __func__, mfn_x(sl4mfn), shadow_index, new_sl4e.l4);
             if ( shadow_l4e_get_flags(new_sl4e) & _PAGE_PRESENT )
             {
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/mpparse.c
--- a/xen/arch/x86/mpparse.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/mpparse.c	Fri Sep 21 14:25:12 2012 +0200
@@ -216,7 +216,7 @@ static void __init MP_ioapic_info (struc
 	if (!(m->mpc_flags & MPC_APIC_USABLE))
 		return;
 
-	printk(KERN_INFO "I/O APIC #%d Version %d at 0x%X.\n",
+	printk(KERN_INFO "I/O APIC #%d Version %d at %#x.\n",
 		m->mpc_apicid, m->mpc_apicver, m->mpc_apicaddr);
 	if (nr_ioapics >= MAX_IO_APICS) {
 		printk(KERN_CRIT "Max # of I/O APICs (%d) exceeded (found %d).\n",
@@ -278,7 +278,7 @@ static int __init smp_read_mpc(struct mp
 	unsigned char *mpt=((unsigned char *)mpc)+count;
 
 	if (memcmp(mpc->mpc_signature,MPC_SIGNATURE,4)) {
-		printk(KERN_ERR "SMP mptable: bad signature [0x%x]!\n",
+		printk(KERN_ERR "SMP mptable: bad signature [%#x]!\n",
 			*(u32 *)mpc->mpc_signature);
 		return 0;
 	}
@@ -305,7 +305,7 @@ static int __init smp_read_mpc(struct mp
 
 	mps_oem_check(mpc, oem, str);
 
-	printk("APIC at: 0x%X\n",mpc->mpc_lapic);
+	printk("APIC at: %#x\n", mpc->mpc_lapic);
 
 	/* 
 	 * Save the local APIC address (it might be non-default) -- but only
@@ -881,7 +881,7 @@ void __init mp_register_ioapic (
 	mp_ioapic_routing[idx].gsi_end = gsi_base + 
 		io_apic_get_redir_entries(idx);
 
-	printk("IOAPIC[%d]: apic_id %d, version %d, address 0x%x, "
+	printk("IOAPIC[%d]: apic_id %d, version %d, address %#x, "
 		"GSI %d-%d\n", idx, mp_ioapics[idx].mpc_apicid, 
 		mp_ioapics[idx].mpc_apicver, mp_ioapics[idx].mpc_apicaddr,
 		mp_ioapic_routing[idx].gsi_base,
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/nmi.c
--- a/xen/arch/x86/nmi.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/nmi.c	Fri Sep 21 14:25:12 2012 +0200
@@ -245,7 +245,7 @@ static inline void write_watchdog_counte
 
     do_div(count, nmi_hz);
     if(descr)
-        Dprintk("setting %s to -0x%"PRIx64"\n", descr, count);
+        Dprintk("setting %s to -%#"PRIx64"\n", descr, count);
     wrmsrl(nmi_perfctr_msr, 0 - count);
 }
 
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/oprofile/op_model_athlon.c
--- a/xen/arch/x86/oprofile/op_model_athlon.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/oprofile/op_model_athlon.c	Fri Sep 21 14:25:12 2012 +0200
@@ -478,7 +478,7 @@ static int __init init_ibs_nmi(void)
 					if (value != (IBSCTL_LVTOFFSETVAL |
 						APIC_EILVT_LVTOFF_IBS)) {
 						printk("Xenoprofile: Failed to setup IBS LVT offset, "
-							"IBSCTL = %#08x\n", value);
+							"IBSCTL = %#x\n", value);
 						return 1;
 					}
 					nodes++;
@@ -523,7 +523,7 @@ void __init ibs_init(void)
 		return;
 	}
 
-	printk("Xenoprofile: AMD IBS detected (0x%08x)\n",
+	printk("Xenoprofile: AMD IBS detected (%#x)\n",
 		(unsigned)ibs_caps);
 }
 
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/oprofile/op_model_p4.c
--- a/xen/arch/x86/oprofile/op_model_p4.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/oprofile/op_model_p4.c	Fri Sep 21 14:25:12 2012 +0200
@@ -485,8 +485,7 @@ static void pmc_setup_one_p4_counter(uns
 	
 	/* find our event binding structure. */
 	if (counter_config[ctr].event <= 0 || counter_config[ctr].event > NUM_EVENTS) {
-		printk(KERN_ERR 
-		       "oprofile: P4 event code 0x%lx out of range\n", 
+		printk(KERN_ERR "oprofile: P4 event code %#lx out of range\n",
 		       counter_config[ctr].event);
 		return;
 	}
@@ -526,7 +525,7 @@ static void pmc_setup_one_p4_counter(uns
 	}
 
 	printk(KERN_ERR 
-	       "oprofile: P4 event code 0x%lx no binding, stag %d ctr %d\n",
+	       "oprofile: P4 event code %#lx no binding, stag %d ctr %d\n",
 	       counter_config[ctr].event, stag, ctr);
 }
 
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/setup.c	Fri Sep 21 14:25:12 2012 +0200
@@ -482,13 +482,13 @@ static void __init kexec_reserve_area(st
 
     if ( !reserve_e820_ram(e820, kdump_start, kdump_start + kdump_size) )
     {
-        printk("Kdump: DISABLED (failed to reserve %luMB (%lukB) at 0x%lx)"
+        printk("Kdump: DISABLED (failed to reserve %luMB (%lukB) at %#lx)"
                "\n", kdump_size >> 20, kdump_size >> 10, kdump_start);
         kexec_crash_area.start = kexec_crash_area.size = 0;
     }
     else
     {
-        printk("Kdump: %luMB (%lukB) at 0x%lx\n",
+        printk("Kdump: %luMB (%lukB) at %#lx\n",
                kdump_size >> 20, kdump_size >> 10, kdump_start);
     }
 }
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/tboot.c
--- a/xen/arch/x86/tboot.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/tboot.c	Fri Sep 21 14:25:12 2012 +0200
@@ -119,12 +119,12 @@ void __init tboot_probe(void)
     g_tboot_shared = tboot_shared;
     printk("TBOOT: found shared page at phys addr %lx:\n", p_tboot_shared);
     printk("  version: %d\n", tboot_shared->version);
-    printk("  log_addr: 0x%08x\n", tboot_shared->log_addr);
-    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);
+    printk("  log_addr: %#x\n", tboot_shared->log_addr);
+    printk("  shutdown_entry: %#x\n", tboot_shared->shutdown_entry);
+    printk("  tboot_base: %#x\n", tboot_shared->tboot_base);
+    printk("  tboot_size: %#x\n", tboot_shared->tboot_size);
     if ( tboot_shared->version >= 6 )
-        printk("  flags: 0x%08x\n", tboot_shared->flags);
+        printk("  flags: %#x\n", tboot_shared->flags);
 
     /* these will be needed by tboot_protect_mem_regions() and/or
        tboot_parse_dmar_table(), so get them now */
@@ -352,7 +352,7 @@ void tboot_shutdown(uint32_t shutdown_ty
                            __PAGE_HYPERVISOR);
     if ( err != 0 )
     {
-        printk("error (0x%x) mapping tboot pages (mfns) @ 0x%x, 0x%x\n", err,
+        printk("error (%#x) mapping tboot pages (mfns) @ %#x, %#x\n", err,
                map_base, map_size);
         return;
     }
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/time.c
--- a/xen/arch/x86/time.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/time.c	Fri Sep 21 14:25:12 2012 +0200
@@ -1955,11 +1955,11 @@ static void dump_softtsc(unsigned char k
         printk("dom%u%s: mode=%d",d->domain_id,
                 is_hvm_domain(d) ? "(hvm)" : "", d->arch.tsc_mode);
         if ( d->arch.vtsc_offset )
-            printk(",ofs=0x%"PRIx64"",d->arch.vtsc_offset);
+            printk(",ofs=%#"PRIx64, d->arch.vtsc_offset);
         if ( d->arch.tsc_khz )
-            printk(",khz=%"PRIu32"",d->arch.tsc_khz);
+            printk(",khz=%"PRIu32, d->arch.tsc_khz);
         if ( d->arch.incarnation )
-            printk(",inc=%"PRIu32"",d->arch.incarnation);
+            printk(",inc=%"PRIu32, d->arch.incarnation);
         if ( !(d->arch.vtsc_kerncount | d->arch.vtsc_usercount) )
         {
             printk("\n");
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/arch/x86/xstate.c
--- a/xen/arch/x86/xstate.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/arch/x86/xstate.c	Fri Sep 21 14:25:12 2012 +0200
@@ -163,7 +163,7 @@ void xstate_init(void)
         xsave_cntxt_size = ebx;
         xfeature_mask = eax + ((u64)edx << 32);
         xfeature_mask &= XCNTXT_MASK;
-        printk("%s: using cntxt_size: 0x%x and states: 0x%"PRIx64"\n",
+        printk("%s: using cntxt_size: %#x and states: %#"PRIx64"\n",
             __func__, xsave_cntxt_size, xfeature_mask);
 
         /* Check XSAVEOPT feature. */
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/common/gdbstub.c
--- a/xen/common/gdbstub.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/common/gdbstub.c	Fri Sep 21 14:25:12 2012 +0200
@@ -263,7 +263,7 @@ gdb_write_to_packet_hex(unsigned long x,
     case sizeof(u64):
         break;
     default:
-        dbg_printk("WARNING: %s x: 0x%lx int_size: %d\n",
+        dbg_printk("WARNING: %s x: %#lx int_size: %d\n",
                    __func__, x, int_size);
         break;
     }
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/common/page_alloc.c
--- a/xen/common/page_alloc.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/common/page_alloc.c	Fri Sep 21 14:25:12 2012 +0200
@@ -367,7 +367,7 @@ static void __init setup_low_mem_virq(vo
     low_mem_virq_th = low_mem_virq_orig = 1UL << order;
     low_mem_virq_th_order = order;
 
-    printk("Initial low memory virq threshold set at 0x%lx pages.\n",
+    printk("Initial low memory virq threshold set at %#lx pages.\n",
             low_mem_virq_th);
 }
 
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/common/vsprintf.c
--- a/xen/common/vsprintf.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/common/vsprintf.c	Fri Sep 21 14:25:12 2012 +0200
@@ -171,10 +171,14 @@ static char *number(
         }
     }
     if (type & SPECIAL) {
-        if (base == 16)
+        if (num == 0)
+            type &= ~SPECIAL;
+        else if (base == 16)
             size -= 2;
         else if (base == 8)
             size--;
+        else
+            type &= ~SPECIAL;
     }
     i = 0;
     if (num == 0)
@@ -197,14 +201,10 @@ static char *number(
         ++buf;
     }
     if (type & SPECIAL) {
-        if (base==8) {
-            if (buf <= end)
-                *buf = '0';
-            ++buf;
-        } else if (base==16) {
-            if (buf <= end)
-                *buf = '0';
-            ++buf;
+        if (buf <= end)
+            *buf = '0';
+        ++buf;
+        if (base == 16) {
             if (buf <= end)
                 *buf = digits[33];
             ++buf;
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/common/xencomm.c
--- a/xen/common/xencomm.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/common/xencomm.c	Fri Sep 21 14:25:12 2012 +0200
@@ -58,7 +58,7 @@ xencomm_get_page(unsigned long paddr, st
          * is freed with decrease reservation hypercall at the same time.
          */
         gdprintk(XENLOG_WARNING,
-                 "bad page is passed. paddr 0x%lx maddr 0x%lx\n",
+                 "bad page is passed. paddr %#lx maddr %#lx\n",
                  paddr, maddr);
         return -EFAULT;
     }
@@ -117,7 +117,7 @@ xencomm_ctxt_init(const void *handle, st
     desc = xencomm_vaddr((unsigned long)handle, page);
     if ( desc->magic != XENCOMM_MAGIC )
     {
-        printk("%s: error: %p magic was 0x%x\n", __func__, desc, desc->magic);
+        printk("%s: error: %p magic was %#x\n", __func__, desc, desc->magic);
         put_page(page);
         return -EINVAL;
     }
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/drivers/acpi/numa.c
--- a/xen/drivers/acpi/numa.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/drivers/acpi/numa.c	Fri Sep 21 14:25:12 2012 +0200
@@ -78,8 +78,8 @@ void __init acpi_table_print_srat_entry(
 			if (srat_rev < 2)
 				proximity_domain &= 0xff;
 			ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-					  "SRAT Memory (%#016"PRIx64
-					  " length %#016"PRIx64")"
+					  "SRAT Memory (%#"PRIx64
+					  " length %#"PRIx64")"
 					  " in proximity domain %d %s%s\n",
 					  p->base_address, p->length,
 					  proximity_domain,
@@ -108,7 +108,7 @@ void __init acpi_table_print_srat_entry(
 		break;
 	default:
 		printk(KERN_WARNING PREFIX
-		       "Found unsupported SRAT entry (type = 0x%x)\n",
+		       "Found unsupported SRAT entry (type = %#x)\n",
 		       header->type);
 		break;
 	}
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/drivers/acpi/tables.c
--- a/xen/drivers/acpi/tables.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/drivers/acpi/tables.c	Fri Sep 21 14:25:12 2012 +0200
@@ -95,7 +95,7 @@ void __init acpi_table_print_madt_entry(
 			if (p->inti_flags  &
 			    ~(ACPI_MADT_POLARITY_MASK | ACPI_MADT_TRIGGER_MASK))
 				printk(KERN_INFO PREFIX
-				       "INT_SRC_OVR unexpected reserved flags: 0x%x\n",
+				       "INT_SRC_OVR unexpected reserved flags: %#x\n",
 				       p->inti_flags  &
 					~(ACPI_MADT_POLARITY_MASK | ACPI_MADT_TRIGGER_MASK));
 
@@ -119,7 +119,7 @@ void __init acpi_table_print_madt_entry(
 			struct acpi_madt_local_apic_nmi *p =
 			    (struct acpi_madt_local_apic_nmi *)header;
 			printk(KERN_INFO PREFIX
-			       "LAPIC_NMI (acpi_id[0x%02x] %s %s lint[0x%x])\n",
+			       "LAPIC_NMI (acpi_id[0x%02x] %s %s lint[%#x])\n",
 			       p->processor_id,
 			       mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK	],
 			       mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2],
@@ -137,7 +137,7 @@ void __init acpi_table_print_madt_entry(
 			trigger = (p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2;
 
 			printk(KERN_INFO PREFIX
-			       "X2APIC_NMI (uid[0x%02x] %s %s lint[0x%x])\n",
+			       "X2APIC_NMI (uid[0x%02x] %s %s lint[%#x])\n",
 			       p->uid,
 			       mps_inti_flags_polarity[polarity],
 			       mps_inti_flags_trigger[trigger],
@@ -160,7 +160,7 @@ void __init acpi_table_print_madt_entry(
 			struct acpi_madt_io_sapic *p =
 			    (struct acpi_madt_io_sapic *)header;
 			printk(KERN_INFO PREFIX
-			       "IOSAPIC (id[0x%x] address[%p] gsi_base[%d])\n",
+			       "IOSAPIC (id[%#x] address[%p] gsi_base[%d])\n",
 			       p->id, (void *)(unsigned long)p->address,
 			       p->global_irq_base);
 		}
@@ -182,7 +182,7 @@ void __init acpi_table_print_madt_entry(
 			struct acpi_madt_interrupt_source *p =
 			    (struct acpi_madt_interrupt_source *)header;
 			printk(KERN_INFO PREFIX
-			       "PLAT_INT_SRC (%s %s type[0x%x] id[0x%04x] eid[0x%x] iosapic_vector[0x%x] global_irq[0x%x]\n",
+			       "PLAT_INT_SRC (%s %s type[%#x] id[0x%04x] eid[%#x] iosapic_vector[%#x] global_irq[%#x]\n",
 			       mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK],
 			       mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2],
 			       p->type, p->id, p->eid, p->io_sapic_vector,
@@ -192,7 +192,7 @@ void __init acpi_table_print_madt_entry(
 
 	default:
 		printk(KERN_WARNING PREFIX
-		       "Found unsupported MADT entry (type = 0x%x)\n",
+		       "Found unsupported MADT entry (type = %#x)\n",
 		       header->type);
 		break;
 	}
@@ -242,7 +242,7 @@ acpi_table_parse_entries(char *id,
 		    ((unsigned long)entry + entry->length);
 	}
 	if (max_entries && count > max_entries) {
-		printk(KERN_WARNING PREFIX "[%4.4s:0x%02x] ignored %i entries of "
+		printk(KERN_WARNING PREFIX "[%4.4s:%#x] ignored %i entries of "
 		       "%i found\n", id, entry_id, count - max_entries, count);
 	}
 
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/drivers/acpi/utilities/utglobal.c
--- a/xen/drivers/acpi/utilities/utglobal.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/drivers/acpi/utilities/utglobal.c	Fri Sep 21 14:25:12 2012 +0200
@@ -79,7 +79,7 @@ const char *__init acpi_format_exception
 		/* Exception code was not recognized */
 
 		ACPI_ERROR((AE_INFO,
-			    "Unknown exception code: 0x%8.8X", status));
+			    "Unknown exception code: %#X", status));
 
 		exception = "UNKNOWN_STATUS_CODE";
 		dump_execution_state();
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/drivers/cpufreq/cpufreq.c
--- a/xen/drivers/cpufreq/cpufreq.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/drivers/cpufreq/cpufreq.c	Fri Sep 21 14:25:12 2012 +0200
@@ -377,7 +377,7 @@ static void print_PSS(struct xen_process
     printk("\t_PSS: state_count=%d\n", count);
     for (i=0; i<count; i++){
         printk("\tState%d: %"PRId64"MHz %"PRId64"mW %"PRId64"us "
-               "%"PRId64"us 0x%"PRIx64" 0x%"PRIx64"\n",
+               "%"PRId64"us %#"PRIx64" %#"PRIx64"\n",
                i,
                ptr[i].core_frequency,
                ptr[i].power,
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/drivers/passthrough/amd/iommu_acpi.c
--- a/xen/drivers/passthrough/amd/iommu_acpi.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/drivers/passthrough/amd/iommu_acpi.c	Fri Sep 21 14:25:12 2012 +0200
@@ -196,7 +196,7 @@ static int __init register_exclusion_ran
     iommu = find_iommu_for_device(seg, bdf);
     if ( !iommu )
     {
-        AMD_IOMMU_DEBUG("IVMD Error: No IOMMU for Dev_Id 0x%x!\n", bdf);
+        AMD_IOMMU_DEBUG("IVMD Error: No IOMMU for Dev_Id %#x!\n", bdf);
         return -ENODEV;
     }
     req = ivrs_mappings[bdf].dte_requestor_id;
@@ -278,7 +278,7 @@ static int __init parse_ivmd_device_sele
     bdf = ivmd_block->header.device_id;
     if ( bdf >= ivrs_bdf_entries )
     {
-        AMD_IOMMU_DEBUG("IVMD Error: Invalid Dev_Id 0x%x\n", bdf);
+        AMD_IOMMU_DEBUG("IVMD Error: Invalid Dev_Id %#x\n", bdf);
         return -ENODEV;
     }
 
@@ -296,7 +296,7 @@ static int __init parse_ivmd_device_rang
     if ( first_bdf >= ivrs_bdf_entries )
     {
         AMD_IOMMU_DEBUG("IVMD Error: "
-                        "Invalid Range_First Dev_Id 0x%x\n", first_bdf);
+                        "Invalid Range_First Dev_Id %#x\n", first_bdf);
         return -ENODEV;
     }
 
@@ -304,7 +304,7 @@ static int __init parse_ivmd_device_rang
     if ( (last_bdf >= ivrs_bdf_entries) || (last_bdf <= first_bdf) )
     {
         AMD_IOMMU_DEBUG("IVMD Error: "
-                        "Invalid Range_Last Dev_Id 0x%x\n", last_bdf);
+                        "Invalid Range_Last Dev_Id %#x\n", last_bdf);
         return -ENODEV;
     }
 
@@ -326,7 +326,7 @@ static int __init parse_ivmd_device_iomm
                                     ivmd_block->aux_data);
     if ( !iommu )
     {
-        AMD_IOMMU_DEBUG("IVMD Error: No IOMMU for Dev_Id 0x%x  Cap 0x%x\n",
+        AMD_IOMMU_DEBUG("IVMD Error: No IOMMU for Dev_Id %#x Cap %#x\n",
                         ivmd_block->header.device_id, ivmd_block->aux_data);
         return -ENODEV;
     }
@@ -351,9 +351,9 @@ static int __init parse_ivmd_block(const
     base = start_addr & PAGE_MASK;
     limit = (start_addr + mem_length - 1) & PAGE_MASK;
 
-    AMD_IOMMU_DEBUG("IVMD Block: Type 0x%x\n",ivmd_block->header.type);
-    AMD_IOMMU_DEBUG(" Start_Addr_Phys 0x%lx\n", start_addr);
-    AMD_IOMMU_DEBUG(" Mem_Length 0x%lx\n", mem_length);
+    AMD_IOMMU_DEBUG("IVMD Block: Type %#x\n",ivmd_block->header.type);
+    AMD_IOMMU_DEBUG(" Start_Addr_Phys %#lx\n", start_addr);
+    AMD_IOMMU_DEBUG(" Mem_Length %#lx\n", mem_length);
 
     if ( ivmd_block->header.flags & ACPI_IVMD_EXCLUSION_RANGE )
         iw = ir = IOMMU_CONTROL_ENABLED;
@@ -414,7 +414,7 @@ static u16 __init parse_ivhd_device_sele
     bdf = select->header.id;
     if ( bdf >= ivrs_bdf_entries )
     {
-        AMD_IOMMU_DEBUG("IVHD Error: Invalid Device_Entry Dev_Id 0x%x\n", bdf);
+        AMD_IOMMU_DEBUG("IVHD Error: Invalid Device_Entry Dev_Id %#x\n", bdf);
         return 0;
     }
 
@@ -439,7 +439,7 @@ static u16 __init parse_ivhd_device_rang
     if ( range->end.header.type != ACPI_IVRS_TYPE_END )
     {
         AMD_IOMMU_DEBUG("IVHD Error: "
-                        "Invalid Range: End_Type 0x%x\n",
+                        "Invalid Range: End_Type %#x\n",
                         range->end.header.type);
         return 0;
     }
@@ -448,7 +448,7 @@ static u16 __init parse_ivhd_device_rang
     if ( first_bdf >= ivrs_bdf_entries )
     {
         AMD_IOMMU_DEBUG("IVHD Error: "
-                        "Invalid Range: First Dev_Id 0x%x\n", first_bdf);
+                        "Invalid Range: First Dev_Id %#x\n", first_bdf);
         return 0;
     }
 
@@ -456,11 +456,11 @@ static u16 __init parse_ivhd_device_rang
     if ( (last_bdf >= ivrs_bdf_entries) || (last_bdf <= first_bdf) )
     {
         AMD_IOMMU_DEBUG("IVHD Error: "
-                        "Invalid Range: Last Dev_Id 0x%x\n", last_bdf);
+                        "Invalid Range: Last Dev_Id %#x\n", last_bdf);
         return 0;
     }
 
-    AMD_IOMMU_DEBUG(" Dev_Id Range: 0x%x -> 0x%x\n", first_bdf, last_bdf);
+    AMD_IOMMU_DEBUG(" Dev_Id Range: %#x -> %#x\n", first_bdf, last_bdf);
 
     for ( bdf = first_bdf; bdf <= last_bdf; bdf++ )
         add_ivrs_mapping_entry(bdf, bdf, range->start.header.data_setting,
@@ -485,18 +485,18 @@ static u16 __init parse_ivhd_device_alia
     bdf = alias->header.id;
     if ( bdf >= ivrs_bdf_entries )
     {
-        AMD_IOMMU_DEBUG("IVHD Error: Invalid Device_Entry Dev_Id 0x%x\n", bdf);
+        AMD_IOMMU_DEBUG("IVHD Error: Invalid Device_Entry Dev_Id %#x\n", bdf);
         return 0;
     }
 
     alias_id = alias->used_id;
     if ( alias_id >= ivrs_bdf_entries )
     {
-        AMD_IOMMU_DEBUG("IVHD Error: Invalid Alias Dev_Id 0x%x\n", alias_id);
+        AMD_IOMMU_DEBUG("IVHD Error: Invalid Alias Dev_Id %#x\n", alias_id);
         return 0;
     }
 
-    AMD_IOMMU_DEBUG(" Dev_Id Alias: 0x%x\n", alias_id);
+    AMD_IOMMU_DEBUG(" Dev_Id Alias: %#x\n", alias_id);
 
     add_ivrs_mapping_entry(bdf, alias_id, alias->header.data_setting, iommu);
 
@@ -520,7 +520,7 @@ static u16 __init parse_ivhd_device_alia
     if ( range->end.header.type != ACPI_IVRS_TYPE_END )
     {
         AMD_IOMMU_DEBUG("IVHD Error: "
-                        "Invalid Range: End_Type 0x%x\n",
+                        "Invalid Range: End_Type %#x\n",
                         range->end.header.type);
         return 0;
     }
@@ -529,7 +529,7 @@ static u16 __init parse_ivhd_device_alia
     if ( first_bdf >= ivrs_bdf_entries )
     {
         AMD_IOMMU_DEBUG("IVHD Error: "
-                        "Invalid Range: First Dev_Id 0x%x\n", first_bdf);
+                        "Invalid Range: First Dev_Id %#x\n", first_bdf);
         return 0;
     }
 
@@ -537,19 +537,19 @@ static u16 __init parse_ivhd_device_alia
     if ( last_bdf >= ivrs_bdf_entries || last_bdf <= first_bdf )
     {
         AMD_IOMMU_DEBUG(
-            "IVHD Error: Invalid Range: Last Dev_Id 0x%x\n", last_bdf);
+            "IVHD Error: Invalid Range: Last Dev_Id %#x\n", last_bdf);
         return 0;
     }
 
     alias_id = range->alias.used_id;
     if ( alias_id >= ivrs_bdf_entries )
     {
-        AMD_IOMMU_DEBUG("IVHD Error: Invalid Alias Dev_Id 0x%x\n", alias_id);
+        AMD_IOMMU_DEBUG("IVHD Error: Invalid Alias Dev_Id %#x\n", alias_id);
         return 0;
     }
 
-    AMD_IOMMU_DEBUG(" Dev_Id Range: 0x%x -> 0x%x\n", first_bdf, last_bdf);
-    AMD_IOMMU_DEBUG(" Dev_Id Alias: 0x%x\n", alias_id);
+    AMD_IOMMU_DEBUG(" Dev_Id Range: %#x -> %#x\n", first_bdf, last_bdf);
+    AMD_IOMMU_DEBUG(" Dev_Id Alias: %#x\n", alias_id);
 
     for ( bdf = first_bdf; bdf <= last_bdf; bdf++ )
         add_ivrs_mapping_entry(bdf, alias_id, range->alias.header.data_setting,
@@ -574,7 +574,7 @@ static u16 __init parse_ivhd_device_exte
     bdf = ext->header.id;
     if ( bdf >= ivrs_bdf_entries )
     {
-        AMD_IOMMU_DEBUG("IVHD Error: Invalid Device_Entry Dev_Id 0x%x\n", bdf);
+        AMD_IOMMU_DEBUG("IVHD Error: Invalid Device_Entry Dev_Id %#x\n", bdf);
         return 0;
     }
 
@@ -599,7 +599,7 @@ static u16 __init parse_ivhd_device_exte
     if ( range->end.header.type != ACPI_IVRS_TYPE_END )
     {
         AMD_IOMMU_DEBUG("IVHD Error: "
-                        "Invalid Range: End_Type 0x%x\n",
+                        "Invalid Range: End_Type %#x\n",
                         range->end.header.type);
         return 0;
     }
@@ -608,7 +608,7 @@ static u16 __init parse_ivhd_device_exte
     if ( first_bdf >= ivrs_bdf_entries )
     {
         AMD_IOMMU_DEBUG("IVHD Error: "
-                        "Invalid Range: First Dev_Id 0x%x\n", first_bdf);
+                        "Invalid Range: First Dev_Id %#x\n", first_bdf);
         return 0;
     }
 
@@ -616,11 +616,11 @@ static u16 __init parse_ivhd_device_exte
     if ( (last_bdf >= ivrs_bdf_entries) || (last_bdf <= first_bdf) )
     {
         AMD_IOMMU_DEBUG("IVHD Error: "
-                        "Invalid Range: Last Dev_Id 0x%x\n", last_bdf);
+                        "Invalid Range: Last Dev_Id %#x\n", last_bdf);
         return 0;
     }
 
-    AMD_IOMMU_DEBUG(" Dev_Id Range: 0x%x -> 0x%x\n",
+    AMD_IOMMU_DEBUG(" Dev_Id Range: %#x -> %#x\n",
                     first_bdf, last_bdf);
 
     for ( bdf = first_bdf; bdf <= last_bdf; bdf++ )
@@ -646,7 +646,7 @@ static u16 __init parse_ivhd_device_spec
     bdf = special->used_id;
     if ( bdf >= ivrs_bdf_entries )
     {
-        AMD_IOMMU_DEBUG("IVHD Error: Invalid Device_Entry Dev_Id 0x%x\n", bdf);
+        AMD_IOMMU_DEBUG("IVHD Error: Invalid Device_Entry Dev_Id %#x\n", bdf);
         return 0;
     }
 
@@ -673,7 +673,7 @@ static int __init parse_ivhd_block(const
                                     ivhd_block->capability_offset);
     if ( !iommu )
     {
-        AMD_IOMMU_DEBUG("IVHD Error: No IOMMU for Dev_Id 0x%x  Cap 0x%x\n",
+        AMD_IOMMU_DEBUG("IVHD Error: No IOMMU for Dev_Id %#x Cap %#x\n",
                         ivhd_block->header.device_id,
                         ivhd_block->capability_offset);
         return -ENODEV;
@@ -687,9 +687,9 @@ static int __init parse_ivhd_block(const
         ivhd_device = (const void *)((const u8 *)ivhd_block + block_length);
 
         AMD_IOMMU_DEBUG( "IVHD Device Entry:\n");
-        AMD_IOMMU_DEBUG( " Type 0x%x\n", ivhd_device->header.type);
-        AMD_IOMMU_DEBUG( " Dev_Id 0x%x\n", ivhd_device->header.id);
-        AMD_IOMMU_DEBUG( " Flags 0x%x\n", ivhd_device->header.data_setting);
+        AMD_IOMMU_DEBUG( " Type %#x\n", ivhd_device->header.type);
+        AMD_IOMMU_DEBUG( " Dev_Id %#x\n", ivhd_device->header.id);
+        AMD_IOMMU_DEBUG( " Flags %#x\n", ivhd_device->header.data_setting);
 
         switch ( ivhd_device->header.type )
         {
@@ -788,9 +788,9 @@ static void __init dump_acpi_table_heade
         printk("%c", table->signature[i]);
     printk("\n");
 
-    AMD_IOMMU_DEBUG(" Length 0x%x\n", table->length);
-    AMD_IOMMU_DEBUG(" Revision 0x%x\n", table->revision);
-    AMD_IOMMU_DEBUG(" CheckSum 0x%x\n", table->checksum);
+    AMD_IOMMU_DEBUG(" Length %#x\n", table->length);
+    AMD_IOMMU_DEBUG(" Revision %#x\n", table->revision);
+    AMD_IOMMU_DEBUG(" CheckSum %#x\n", table->checksum);
 
     AMD_IOMMU_DEBUG(" OEM_Id ");
     for ( i = 0; i < ACPI_OEM_ID_SIZE; i++ )
@@ -802,14 +802,14 @@ static void __init dump_acpi_table_heade
         printk("%c", table->oem_table_id[i]);
     printk("\n");
 
-    AMD_IOMMU_DEBUG(" OEM_Revision 0x%x\n", table->oem_revision);
+    AMD_IOMMU_DEBUG(" OEM_Revision %#x\n", table->oem_revision);
 
     AMD_IOMMU_DEBUG(" Creator_Id ");
     for ( i = 0; i < ACPI_NAME_SIZE; i++ )
         printk("%c", table->asl_compiler_id[i]);
     printk("\n");
 
-    AMD_IOMMU_DEBUG(" Creator_Revision 0x%x\n",
+    AMD_IOMMU_DEBUG(" Creator_Revision %#x\n",
                     table->asl_compiler_revision);
 
 }
@@ -832,15 +832,15 @@ static int __init parse_ivrs_table(struc
         ivrs_block = (struct acpi_ivrs_header *)((u8 *)table + length);
 
         AMD_IOMMU_DEBUG("IVRS Block:\n");
-        AMD_IOMMU_DEBUG(" Type 0x%x\n", ivrs_block->type);
-        AMD_IOMMU_DEBUG(" Flags 0x%x\n", ivrs_block->flags);
-        AMD_IOMMU_DEBUG(" Length 0x%x\n", ivrs_block->length);
-        AMD_IOMMU_DEBUG(" Dev_Id 0x%x\n", ivrs_block->device_id);
+        AMD_IOMMU_DEBUG(" Type %#x\n", ivrs_block->type);
+        AMD_IOMMU_DEBUG(" Flags %#x\n", ivrs_block->flags);
+        AMD_IOMMU_DEBUG(" Length %#x\n", ivrs_block->length);
+        AMD_IOMMU_DEBUG(" Dev_Id %#x\n", ivrs_block->device_id);
 
         if ( table->length < (length + ivrs_block->length) )
         {
             AMD_IOMMU_DEBUG("IVRS Error: "
-                            "Table Length Exceeded: 0x%x -> 0x%lx\n",
+                            "Table Length Exceeded: %#x -> %#lx\n",
                             table->length,
                             (length + ivrs_block->length));
             return -ENODEV;
@@ -867,7 +867,7 @@ static int __init detect_iommu_acpi(stru
         checksum += raw_table[i];
     if ( checksum )
     {
-        AMD_IOMMU_DEBUG("IVRS Error: Invalid Checksum 0x%x\n", checksum);
+        AMD_IOMMU_DEBUG("IVRS Error: Invalid Checksum %#x\n", checksum);
         return -ENODEV;
     }
 
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/drivers/passthrough/amd/iommu_init.c	Fri Sep 21 14:25:12 2012 +0200
@@ -616,8 +616,8 @@ static void parse_event_log_entry(struct
                                        IOMMU_EVENT_FLAGS_SHIFT);
         addr= (u64*) (entry + 2);
         printk(XENLOG_ERR "AMD-Vi: "
-               "%s: domain = %d, device id = 0x%04x, "
-               "fault address = 0x%"PRIx64", flags = 0x%03x\n",
+               "%s: domain = %d, device id = %#x, "
+               "fault address = %#"PRIx64", flags = %#x\n",
                event_str[code-1], domain_id, device_id, *addr, flags);
 
         /* Tell the device to stop DMAing; we can't rely on the guest to
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/drivers/passthrough/amd/iommu_map.c
--- a/xen/drivers/passthrough/amd/iommu_map.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/drivers/passthrough/amd/iommu_map.c	Fri Sep 21 14:25:12 2012 +0200
@@ -795,7 +795,7 @@ void amd_iommu_share_p2m(struct domain *
 
         /* When sharing p2m with iommu, paging mode = 4 */
         hd->paging_mode = IOMMU_PAGING_MODE_LEVEL_4;
-        AMD_IOMMU_DEBUG("Share p2m table with iommu: p2m table = 0x%lx\n",
+        AMD_IOMMU_DEBUG("Share p2m table with iommu: p2m table = %#lx\n",
                         mfn_x(pgd_mfn));
     }
 }
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/drivers/passthrough/amd/pci_amd_iommu.c
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c	Fri Sep 21 14:25:12 2012 +0200
@@ -121,8 +121,8 @@ static void amd_iommu_setup_domain_devic
 
         amd_iommu_flush_device(iommu, req_id);
 
-        AMD_IOMMU_DEBUG("Setup I/O page table: device id = 0x%04x, "
-                        "root table = 0x%"PRIx64", "
+        AMD_IOMMU_DEBUG("Setup I/O page table: device id = %#x, "
+                        "root table = %#"PRIx64", "
                         "domain = %d, paging mode = %d\n", req_id,
                         page_to_maddr(hd->root_table),
                         hd->domain_id, hd->paging_mode);
@@ -314,7 +314,7 @@ void amd_iommu_disable_domain_device(str
 
         amd_iommu_flush_device(iommu, req_id);
 
-        AMD_IOMMU_DEBUG("Disable: device id = 0x%04x, "
+        AMD_IOMMU_DEBUG("Disable: device id = %#x, "
                         "domain = %d, paging mode = %d\n",
                         req_id,  domain_hvm_iommu(domain)->domain_id,
                         domain_hvm_iommu(domain)->paging_mode);
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/drivers/passthrough/vtd/dmar.c
--- a/xen/drivers/passthrough/vtd/dmar.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/drivers/passthrough/vtd/dmar.c	Fri Sep 21 14:25:12 2012 +0200
@@ -381,7 +381,7 @@ static int __init acpi_dmar_check_length
     if ( h->length >= min_len )
         return 0;
     dprintk(XENLOG_ERR VTDPREFIX,
-            "Invalid ACPI DMAR entry length: 0x%x\n",
+            "Invalid ACPI DMAR entry length: %#x\n",
             h->length);
     return -EINVAL;
 }
@@ -749,7 +749,7 @@ static int __init acpi_parse_dmar(struct
             break;
         default:
             dprintk(XENLOG_WARNING VTDPREFIX,
-                    "Ignore unknown DMAR structure type (0x%x)\n",
+                    "Ignore unknown DMAR structure type (%#x)\n",
                     entry_header->type);
             break;
         }
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/drivers/passthrough/vtd/intremap.c
--- a/xen/drivers/passthrough/vtd/intremap.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/drivers/passthrough/vtd/intremap.c	Fri Sep 21 14:25:12 2012 +0200
@@ -135,7 +135,7 @@ int iommu_supports_eim(void)
         if ( !ioapic_to_drhd(IO_APIC_ID(apic)) )
     {
             dprintk(XENLOG_WARNING VTDPREFIX,
-                    "There is not a DRHD for IOAPIC 0x%x (id: 0x%x)!\n",
+                    "There is not a DRHD for IOAPIC %#x (id: %#x)!\n",
                     apic, IO_APIC_ID(apic));
             return 0;
     }
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/drivers/passthrough/vtd/iommu.c	Fri Sep 21 14:25:12 2012 +0200
@@ -2035,7 +2035,7 @@ static int init_vtd_hw(void)
             {
                 iommu_intremap = 0;
                 dprintk(XENLOG_ERR VTDPREFIX,
-                    "ioapic_to_iommu: ioapic 0x%x (id: 0x%x) is NULL! "
+                    "ioapic_to_iommu: ioapic %#x (id: %#x) is NULL! "
                     "Will not try to enable Interrupt Remapping.\n",
                     apic, IO_APIC_ID(apic));
                 break;
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/drivers/passthrough/vtd/utils.c
--- a/xen/drivers/passthrough/vtd/utils.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/drivers/passthrough/vtd/utils.c	Fri Sep 21 14:25:12 2012 +0200
@@ -217,7 +217,7 @@ static void dump_iommu_info(unsigned cha
             struct iremap_entry *iremap_entries = NULL;
             int print_cnt = 0;
 
-            printk("  Interrupt remapping table (nr_entry=0x%x. "
+            printk("  Interrupt remapping table (nr_entry=%#x. "
                 "Only dump P=1 entries here):\n", nr_entry);
             printk("       SVT  SQ   SID      DST  V  AVL DLM TM RH DM "
                    "FPD P\n");
diff -r 1e6e6b49b4ac -r c8873f13cec3 xen/drivers/video/vesa.c
--- a/xen/drivers/video/vesa.c	Fri Sep 21 13:47:18 2012 +0200
+++ b/xen/drivers/video/vesa.c	Fri Sep 21 14:25:12 2012 +0200
@@ -111,7 +111,7 @@ void __init vesa_init(void)
 
     vga_puts = vesa_redraw_puts;
 
-    printk(XENLOG_INFO "vesafb: framebuffer at 0x%x, mapped to 0x%p, "
+    printk(XENLOG_INFO "vesafb: framebuffer at %#x, mapped to 0x%p, "
            "using %uk, total %uk\n",
            vlfb_info.lfb_base, lfb,
            vram_remap >> 10, vram_total >> 10);

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMdz-00086E-HT; Thu, 27 Sep 2012 22:33:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdx-00084J-Mb
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:17 +0000
Received: from [85.158.139.211:15212] by server-14.bemta-5.messagelabs.com id
	60/75-05772-C24D4605; Thu, 27 Sep 2012 22:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-206.messagelabs.com!1348785193!20186644!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2668 invoked from network); 27 Sep 2012 22:33:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Sep 2012 22:33: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 1THMds-0007HH-SM
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMds-0003o9-OF
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:12 +0000
Message-Id: <E1THMds-0003o9-OF@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] pygrub: always append --args
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1348567431 -3600
# Node ID 795c493fe561040805385ef792e6afd6db2cd7ea
# Parent  c8d65d91a6f20fa7fae905bbf172e59b335d6371
pygrub: always append --args

If a bootloader entry in menu.lst has no additional kernel command line
options listed and the domU.cfg has 'bootargs="--args=something"' the
additional arguments from the config file are not passed to the kernel.
The reason for that incorrect behaviour is that run_grub appends arg
only if the parsed config file has arguments listed.

Fix this by appending args from image section and the config file separatly.
To avoid adding to a NoneType initialize grubcfg['args'] to an empty string.
This does not change behaviour but simplifies the code which appends the
string.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r c8d65d91a6f2 -r 795c493fe561 tools/pygrub/src/pygrub
--- a/tools/pygrub/src/pygrub	Tue Sep 25 08:38:14 2012 +0200
+++ b/tools/pygrub/src/pygrub	Tue Sep 25 11:03:51 2012 +0100
@@ -615,13 +615,15 @@ def run_grub(file, entry, fs, arg):
     except IndexError:
         img = g.cf.images[0]
 
-    grubcfg = { "kernel": None, "ramdisk": None, "args": None }
+    grubcfg = { "kernel": None, "ramdisk": None, "args": "" }
 
     grubcfg["kernel"] = img.kernel[1]
     if img.initrd:
         grubcfg["ramdisk"] = img.initrd[1]
     if img.args:
-        grubcfg["args"] = img.args + " " + arg
+        grubcfg["args"] += img.args
+    if arg:
+        grubcfg["args"] += " " + args
 
     return grubcfg
 

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMdz-00086E-HT; Thu, 27 Sep 2012 22:33:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdx-00084J-Mb
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:17 +0000
Received: from [85.158.139.211:15212] by server-14.bemta-5.messagelabs.com id
	60/75-05772-C24D4605; Thu, 27 Sep 2012 22:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-206.messagelabs.com!1348785193!20186644!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2668 invoked from network); 27 Sep 2012 22:33:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Sep 2012 22:33: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 1THMds-0007HH-SM
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMds-0003o9-OF
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:12 +0000
Message-Id: <E1THMds-0003o9-OF@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] pygrub: always append --args
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1348567431 -3600
# Node ID 795c493fe561040805385ef792e6afd6db2cd7ea
# Parent  c8d65d91a6f20fa7fae905bbf172e59b335d6371
pygrub: always append --args

If a bootloader entry in menu.lst has no additional kernel command line
options listed and the domU.cfg has 'bootargs="--args=something"' the
additional arguments from the config file are not passed to the kernel.
The reason for that incorrect behaviour is that run_grub appends arg
only if the parsed config file has arguments listed.

Fix this by appending args from image section and the config file separatly.
To avoid adding to a NoneType initialize grubcfg['args'] to an empty string.
This does not change behaviour but simplifies the code which appends the
string.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r c8d65d91a6f2 -r 795c493fe561 tools/pygrub/src/pygrub
--- a/tools/pygrub/src/pygrub	Tue Sep 25 08:38:14 2012 +0200
+++ b/tools/pygrub/src/pygrub	Tue Sep 25 11:03:51 2012 +0100
@@ -615,13 +615,15 @@ def run_grub(file, entry, fs, arg):
     except IndexError:
         img = g.cf.images[0]
 
-    grubcfg = { "kernel": None, "ramdisk": None, "args": None }
+    grubcfg = { "kernel": None, "ramdisk": None, "args": "" }
 
     grubcfg["kernel"] = img.kernel[1]
     if img.initrd:
         grubcfg["ramdisk"] = img.initrd[1]
     if img.args:
-        grubcfg["args"] = img.args + " " + arg
+        grubcfg["args"] += img.args
+    if arg:
+        grubcfg["args"] += " " + args
 
     return grubcfg
 

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMdz-00087L-Ut; Thu, 27 Sep 2012 22:33:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdy-000858-VB
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:19 +0000
Received: from [85.158.139.83:23799] by server-2.bemta-5.messagelabs.com id
	71/28-28944-E24D4605; Thu, 27 Sep 2012 22:33:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-182.messagelabs.com!1348785196!18370754!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13098 invoked from network); 27 Sep 2012 22:33:17 -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;
	27 Sep 2012 22:33: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 1THMdw-0007Hc-Ei
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdw-0003pq-DX
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:16 +0000
Message-Id: <E1THMdw-0003pq-DX@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: use compiler visible "add"
	instead of inline assembly "or" in get_cpu_info()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348652996 -7200
# Node ID d49e0c5ffe8ada4db156ac53ad8bc6adee077c7d
# Parent  42bacb953f6b8d2ae1df8cbe8d6347d02eaeeccb
x86: use compiler visible "add" instead of inline assembly "or" in get_cpu_info()

This follows the same idea as the previous patch, just that the effect
is much more visible here: With a half-way [dr]ecent gcc this reduced
.text size by over 12k for me.

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


diff -r 42bacb953f6b -r d49e0c5ffe8a xen/include/asm-x86/current.h
--- a/xen/include/asm-x86/current.h	Wed Sep 26 11:48:21 2012 +0200
+++ b/xen/include/asm-x86/current.h	Wed Sep 26 11:49:56 2012 +0200
@@ -25,12 +25,9 @@ struct cpu_info {
 
 static inline struct cpu_info *get_cpu_info(void)
 {
-    struct cpu_info *cpu_info;
-    __asm__ ( "and %%"__OP"sp,%0; or %2,%0"
-              : "=r" (cpu_info)
-              : "0" (~(STACK_SIZE-1)), "i" (STACK_SIZE-sizeof(struct cpu_info))
-        );
-    return cpu_info;
+    unsigned long tos;
+    __asm__ ( "and %%rsp,%0" : "=r" (tos) : "0" (~(STACK_SIZE-1)) );
+    return (struct cpu_info *)(tos + STACK_SIZE) - 1;
 }
 
 #define get_current()         (get_cpu_info()->current_vcpu)

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMdz-00087L-Ut; Thu, 27 Sep 2012 22:33:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdy-000858-VB
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:19 +0000
Received: from [85.158.139.83:23799] by server-2.bemta-5.messagelabs.com id
	71/28-28944-E24D4605; Thu, 27 Sep 2012 22:33:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-182.messagelabs.com!1348785196!18370754!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13098 invoked from network); 27 Sep 2012 22:33:17 -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;
	27 Sep 2012 22:33: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 1THMdw-0007Hc-Ei
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdw-0003pq-DX
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:16 +0000
Message-Id: <E1THMdw-0003pq-DX@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: use compiler visible "add"
	instead of inline assembly "or" in get_cpu_info()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348652996 -7200
# Node ID d49e0c5ffe8ada4db156ac53ad8bc6adee077c7d
# Parent  42bacb953f6b8d2ae1df8cbe8d6347d02eaeeccb
x86: use compiler visible "add" instead of inline assembly "or" in get_cpu_info()

This follows the same idea as the previous patch, just that the effect
is much more visible here: With a half-way [dr]ecent gcc this reduced
.text size by over 12k for me.

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


diff -r 42bacb953f6b -r d49e0c5ffe8a xen/include/asm-x86/current.h
--- a/xen/include/asm-x86/current.h	Wed Sep 26 11:48:21 2012 +0200
+++ b/xen/include/asm-x86/current.h	Wed Sep 26 11:49:56 2012 +0200
@@ -25,12 +25,9 @@ struct cpu_info {
 
 static inline struct cpu_info *get_cpu_info(void)
 {
-    struct cpu_info *cpu_info;
-    __asm__ ( "and %%"__OP"sp,%0; or %2,%0"
-              : "=r" (cpu_info)
-              : "0" (~(STACK_SIZE-1)), "i" (STACK_SIZE-sizeof(struct cpu_info))
-        );
-    return cpu_info;
+    unsigned long tos;
+    __asm__ ( "and %%rsp,%0" : "=r" (tos) : "0" (~(STACK_SIZE-1)) );
+    return (struct cpu_info *)(tos + STACK_SIZE) - 1;
 }
 
 #define get_current()         (get_cpu_info()->current_vcpu)

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMdz-00086p-QM; Thu, 27 Sep 2012 22:33:19 +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 1THMdy-00084n-Me
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:18 +0000
Received: from [85.158.138.51:37166] by server-6.bemta-3.messagelabs.com id
	BC/88-11085-D24D4605; Thu, 27 Sep 2012 22:33:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-174.messagelabs.com!1348785194!24180801!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28254 invoked from network); 27 Sep 2012 22:33:15 -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;
	27 Sep 2012 22:33: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 1THMdu-0007HQ-IL
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdu-0003os-B4
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:14 +0000
Message-Id: <E1THMdu-0003os-B4@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: network diagrams for the wiki
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1348594280 -3600
# Node ID 6ec80d1a5630e9dea93a5c1f192ffef4129f14e5
# Parent  0a64f1a3f72c780a3c1b525de19096d869668349
docs: network diagrams for the wiki

We provide two new diagrams
  docs/figs/network-{bridge,basic}.fig
which are converted to pngs by the Makefiles and intended for
consumption by http://wiki.xen.org/wiki/Xen_Networking.

This is perhaps not the ideal location for this source code but we
don't have a better one.

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 0a64f1a3f72c -r 6ec80d1a5630 .gitignore
--- a/.gitignore	Tue Sep 25 13:40:00 2012 +0100
+++ b/.gitignore	Tue Sep 25 18:31:20 2012 +0100
@@ -374,3 +374,4 @@ tools/xenstore/xenstore-watch
 
 docs/txt/misc/*.txt
 docs/txt/man/*.txt
+docs/figs/*.png
diff -r 0a64f1a3f72c -r 6ec80d1a5630 .hgignore
--- a/.hgignore	Tue Sep 25 13:40:00 2012 +0100
+++ b/.hgignore	Tue Sep 25 18:31:20 2012 +0100
@@ -45,6 +45,7 @@
 ^docs/interface/interface\.css$
 ^docs/interface/interface\.html$
 ^docs/interface/labels\.pl$
+^docs/figs/.*\.png
 ^docs/man1/
 ^docs/man5/
 ^docs/pdf/.*$
diff -r 0a64f1a3f72c -r 6ec80d1a5630 docs/Makefile
--- a/docs/Makefile	Tue Sep 25 13:40:00 2012 +0100
+++ b/docs/Makefile	Tue Sep 25 18:31:20 2012 +0100
@@ -25,7 +25,7 @@ DOC_TXT         := $(patsubst %.txt,txt/
 all: build
 
 .PHONY: build
-build: html txt man-pages
+build: html txt man-pages figs
 	@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,6 +40,10 @@ html: $(DOC_HTML) html/index.html
 .PHONY: txt
 txt: $(DOC_TXT)
 
+.PHONY: figs
+figs:
+	$(MAKE) -C figs
+
 .PHONY: python-dev-docs
 python-dev-docs:
 	@mkdir -v -p api/tools/python
@@ -68,6 +72,7 @@ man5/%.5: man/%.pod.5 Makefile
 .PHONY: clean
 clean:
 	$(MAKE) -C xen-api clean
+	$(MAKE) -C figs clean
 	rm -rf .word_count *.aux *.dvi *.bbl *.blg *.glo *.idx *~ 
 	rm -rf *.ilg *.log *.ind *.toc *.bak core
 	rm -rf html txt

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMdz-00085s-Ct; Thu, 27 Sep 2012 22:33:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdx-00083r-EC
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:17 +0000
Received: from [85.158.139.211:62958] by server-8.bemta-5.messagelabs.com id
	B6/D8-18073-C24D4605; Thu, 27 Sep 2012 22:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-206.messagelabs.com!1348785195!20186645!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2687 invoked from network); 27 Sep 2012 22:33:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Sep 2012 22:33: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 1THMdu-0007HT-Su
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdu-0003p7-Ri
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:14 +0000
Message-Id: <E1THMdu-0003p7-Ri@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: network network diagrams for
	the wiki (Makefile)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1348594779 -3600
# Node ID 0604d4676c6b1305f597bf7790fb57a70fdf2a7f
# Parent  6ec80d1a5630e9dea93a5c1f192ffef4129f14e5
docs: network network diagrams for the wiki (Makefile)

Add the Makefile in hg as well as git.  Sorry.

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


diff -r 6ec80d1a5630 -r 0604d4676c6b docs/figs/Makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/figs/Makefile	Tue Sep 25 18:39:39 2012 +0100
@@ -0,0 +1,15 @@
+
+XEN_ROOT=$(CURDIR)/../..
+include $(XEN_ROOT)/Config.mk
+include $(XEN_ROOT)/docs/Docs.mk
+
+TARGETS= network-bridge.png network-basic.png
+
+all: $(TARGETS)
+
+%.png:	%.fig
+	$(FIG2DEV) -L png $< >$@.tmp
+	mv -f $@.tmp $@
+
+clean:
+	rm -f *~ *.png

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMdz-00085s-Ct; Thu, 27 Sep 2012 22:33:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdx-00083r-EC
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:17 +0000
Received: from [85.158.139.211:62958] by server-8.bemta-5.messagelabs.com id
	B6/D8-18073-C24D4605; Thu, 27 Sep 2012 22:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-206.messagelabs.com!1348785195!20186645!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2687 invoked from network); 27 Sep 2012 22:33:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Sep 2012 22:33: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 1THMdu-0007HT-Su
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdu-0003p7-Ri
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:14 +0000
Message-Id: <E1THMdu-0003p7-Ri@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: network network diagrams for
	the wiki (Makefile)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1348594779 -3600
# Node ID 0604d4676c6b1305f597bf7790fb57a70fdf2a7f
# Parent  6ec80d1a5630e9dea93a5c1f192ffef4129f14e5
docs: network network diagrams for the wiki (Makefile)

Add the Makefile in hg as well as git.  Sorry.

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


diff -r 6ec80d1a5630 -r 0604d4676c6b docs/figs/Makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/figs/Makefile	Tue Sep 25 18:39:39 2012 +0100
@@ -0,0 +1,15 @@
+
+XEN_ROOT=$(CURDIR)/../..
+include $(XEN_ROOT)/Config.mk
+include $(XEN_ROOT)/docs/Docs.mk
+
+TARGETS= network-bridge.png network-basic.png
+
+all: $(TARGETS)
+
+%.png:	%.fig
+	$(FIG2DEV) -L png $< >$@.tmp
+	mv -f $@.tmp $@
+
+clean:
+	rm -f *~ *.png

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMdz-00086p-QM; Thu, 27 Sep 2012 22:33:19 +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 1THMdy-00084n-Me
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:18 +0000
Received: from [85.158.138.51:37166] by server-6.bemta-3.messagelabs.com id
	BC/88-11085-D24D4605; Thu, 27 Sep 2012 22:33:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-174.messagelabs.com!1348785194!24180801!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28254 invoked from network); 27 Sep 2012 22:33:15 -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;
	27 Sep 2012 22:33: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 1THMdu-0007HQ-IL
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdu-0003os-B4
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:14 +0000
Message-Id: <E1THMdu-0003os-B4@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: network diagrams for the wiki
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1348594280 -3600
# Node ID 6ec80d1a5630e9dea93a5c1f192ffef4129f14e5
# Parent  0a64f1a3f72c780a3c1b525de19096d869668349
docs: network diagrams for the wiki

We provide two new diagrams
  docs/figs/network-{bridge,basic}.fig
which are converted to pngs by the Makefiles and intended for
consumption by http://wiki.xen.org/wiki/Xen_Networking.

This is perhaps not the ideal location for this source code but we
don't have a better one.

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 0a64f1a3f72c -r 6ec80d1a5630 .gitignore
--- a/.gitignore	Tue Sep 25 13:40:00 2012 +0100
+++ b/.gitignore	Tue Sep 25 18:31:20 2012 +0100
@@ -374,3 +374,4 @@ tools/xenstore/xenstore-watch
 
 docs/txt/misc/*.txt
 docs/txt/man/*.txt
+docs/figs/*.png
diff -r 0a64f1a3f72c -r 6ec80d1a5630 .hgignore
--- a/.hgignore	Tue Sep 25 13:40:00 2012 +0100
+++ b/.hgignore	Tue Sep 25 18:31:20 2012 +0100
@@ -45,6 +45,7 @@
 ^docs/interface/interface\.css$
 ^docs/interface/interface\.html$
 ^docs/interface/labels\.pl$
+^docs/figs/.*\.png
 ^docs/man1/
 ^docs/man5/
 ^docs/pdf/.*$
diff -r 0a64f1a3f72c -r 6ec80d1a5630 docs/Makefile
--- a/docs/Makefile	Tue Sep 25 13:40:00 2012 +0100
+++ b/docs/Makefile	Tue Sep 25 18:31:20 2012 +0100
@@ -25,7 +25,7 @@ DOC_TXT         := $(patsubst %.txt,txt/
 all: build
 
 .PHONY: build
-build: html txt man-pages
+build: html txt man-pages figs
 	@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,6 +40,10 @@ html: $(DOC_HTML) html/index.html
 .PHONY: txt
 txt: $(DOC_TXT)
 
+.PHONY: figs
+figs:
+	$(MAKE) -C figs
+
 .PHONY: python-dev-docs
 python-dev-docs:
 	@mkdir -v -p api/tools/python
@@ -68,6 +72,7 @@ man5/%.5: man/%.pod.5 Makefile
 .PHONY: clean
 clean:
 	$(MAKE) -C xen-api clean
+	$(MAKE) -C figs clean
 	rm -rf .word_count *.aux *.dvi *.bbl *.blg *.glo *.idx *~ 
 	rm -rf *.ilg *.log *.ind *.toc *.bak core
 	rm -rf html txt

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMe0-00087l-4G; Thu, 27 Sep 2012 22:33:20 +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 1THMdz-00085A-0n
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:19 +0000
Received: from [85.158.138.51:37201] by server-12.bemta-3.messagelabs.com id
	0A/76-23730-E24D4605; Thu, 27 Sep 2012 22:33:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-174.messagelabs.com!1348785195!30472841!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31403 invoked from network); 27 Sep 2012 22:33:16 -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 Sep 2012 22:33: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 1THMdv-0007HW-Lm
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdv-0003pM-Bz
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:15 +0000
Message-Id: <E1THMdv-0003pM-Bz@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: network network diagrams for
	the wiki (figs)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1348595104 -3600
# Node ID 656662f7ea59790cd81d22c563541dc0a46b59eb
# Parent  0604d4676c6b1305f597bf7790fb57a70fdf2a7f
docs: network network diagrams for the wiki (figs)

Add the figs in hg as well as git.  Sorry (again)!

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


diff -r 0604d4676c6b -r 656662f7ea59 docs/figs/network-basic.fig
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/figs/network-basic.fig	Tue Sep 25 18:45:04 2012 +0100
@@ -0,0 +1,73 @@
+#FIG 3.2  Produced by xfig version 3.2.5b
+Landscape
+Center
+Metric
+A4      
+100.00
+Single
+-2
+1200 2
+0 32 #c0c0c0
+6 4275 5160 6105 6315
+2 2 0 2 0 11 50 -1 28 0.000 0 0 7 0 0 5
+	 6090 5175 4290 5175 4290 6075 6090 6075 6090 5175
+2 2 0 2 0 11 50 -1 28 0.000 0 0 7 0 0 5
+	 4965 6075 5865 6075 5865 6300 4965 6300 4965 6075
+2 1 0 2 0 11 50 -1 28 0.000 0 0 7 0 0 4
+	 6090 5400 5865 5400 5865 5625 6090 5625
+-6
+6 7170 5145 9000 6300
+2 2 0 2 0 11 50 -1 28 0.000 0 0 7 0 0 5
+	 7185 5160 8985 5160 8985 6060 7185 6060 7185 5160
+2 2 0 2 0 11 50 -1 28 0.000 0 0 7 0 0 5
+	 8310 6060 7410 6060 7410 6285 8310 6285 8310 6060
+2 1 0 2 0 11 50 -1 28 0.000 0 0 7 0 0 4
+	 7185 5385 7410 5385 7410 5610 7185 5610
+-6
+6 900 4050 9225 4950
+4 0 0 50 -1 0 16 0.0000 4 195 1335 1170 4860 of the world\001
+4 0 0 50 -1 0 16 0.0000 4 240 1815 1080 4590 interface, to rest\001
+4 0 0 50 -1 0 16 0.0000 4 255 1890 990 4320 Physical network\001
+4 0 0 50 -1 0 16 0.0000 4 255 1485 4050 4860 guest's traffic\001
+4 0 0 50 -1 0 16 0.0000 4 195 1305 4050 4590 backend for\001
+4 0 0 50 -1 0 16 0.0000 4 195 1905 3960 4320 Virtual interface:\001
+4 0 0 50 -1 0 16 0.0000 4 195 1290 7515 4860 Xen drivers\001
+4 0 0 50 -1 0 16 0.0000 4 255 1290 7425 4590 provided by\001
+4 0 0 50 -1 0 16 0.0000 4 195 1905 7155 4320 Virtual interface:\001
+-6
+2 2 0 2 0 29 50 -1 20 0.000 0 0 7 0 0 5
+	 660 5160 2460 5160 2460 6060 660 6060 660 5160
+2 2 0 2 0 29 50 -1 20 0.000 0 0 7 0 0 5
+	 1785 6060 885 6060 885 6285 1785 6285 1785 6060
+2 1 0 2 0 29 50 -1 20 0.000 0 0 7 0 0 4
+	 660 5385 885 5385 900 5625 675 5625
+2 1 0 2 0 29 50 -1 -1 0.000 0 0 7 0 0 3
+	 675 6300 675 4950 450 4950
+2 1 0 3 1 29 50 -1 -1 0.000 0 0 7 0 0 2
+	 6075 5490 7200 5490
+2 1 0 3 4 29 50 -1 -1 0.000 0 0 -1 0 0 2
+	 675 5490 0 5490
+2 1 0 3 4 29 50 -1 -1 0.000 0 0 -1 0 0 2
+	 0 2475 0 6525
+2 2 0 1 0 32 100 -1 20 0.000 0 0 7 0 0 5
+	 675 2250 9675 2250 9675 6750 675 6750 675 2250
+2 2 0 1 0 7 70 -1 20 0.000 0 0 7 0 0 5
+	 6300 2925 900 2925 900 6525 6300 6525 6300 2925
+2 2 0 1 0 7 70 -1 20 0.000 0 0 7 0 0 5
+	 6975 6525 9450 6525 9450 2925 6975 2925 6975 6525
+2 2 0 1 7 7 125 -1 20 0.000 0 0 -1 0 0 5
+	 -225 2025 9900 2025 9900 6975 -225 6975 -225 2025
+4 0 0 50 -1 18 20 0.0000 4 240 735 1170 5490 ethN\001
+4 0 0 50 -1 18 20 0.0000 4 240 945 4500 5490 vifA.B\001
+4 0 0 50 -1 16 20 0.0000 4 315 1410 4500 5850 e.g. vif4.0\001
+4 0 0 50 -1 16 20 0.0000 4 315 1260 1125 5850 e.g. eth0\001
+4 0 0 50 -1 0 16 1.5708 4 255 1395 225 5400 physical link\001
+4 0 0 50 -1 18 20 0.0000 4 240 735 7875 5490 ethB\001
+4 0 0 50 -1 16 20 0.0000 4 315 1260 7650 5850 e.g. eth0\001
+4 0 0 50 -1 0 20 0.0000 4 300 1995 1530 3870 typically dom0\001
+4 0 0 50 -1 0 20 0.0000 4 285 3330 990 3420 Backend (driver) domain\001
+4 0 0 50 -1 0 20 0.0000 4 300 1785 7155 3420 guest domain\001
+4 0 0 50 -1 0 20 0.0000 4 300 1410 7155 3810 domU e.g.\001
+4 0 0 50 -1 16 20 0.0000 4 240 810 8550 3825 dom4\001
+4 0 0 50 -1 0 20 0.0000 4 300 1320 900 2700 Computer\001
+4 0 0 50 -1 0 16 1.5708 4 195 1350 6750 6210 virtual   link\001
diff -r 0604d4676c6b -r 656662f7ea59 docs/figs/network-bridge.fig
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/figs/network-bridge.fig	Tue Sep 25 18:45:04 2012 +0100
@@ -0,0 +1,125 @@
+#FIG 3.2  Produced by xfig version 3.2.5b
+Landscape
+Center
+Metric
+A4      
+100.00
+Single
+-2
+1200 2
+0 32 #ffc3ff
+0 33 #c0c0c0
+6 -225 3825 2475 8325
+2 2 0 2 0 29 50 -1 20 0.000 0 0 7 0 0 5
+	 660 6735 2460 6735 2460 7635 660 7635 660 6735
+2 2 0 2 0 29 50 -1 20 0.000 0 0 7 0 0 5
+	 1785 7635 885 7635 885 7860 1785 7860 1785 7635
+2 1 0 2 0 29 50 -1 20 0.000 0 0 7 0 0 4
+	 660 6960 885 6960 900 7200 675 7200
+2 1 0 2 0 29 50 -1 -1 0.000 0 0 7 0 0 3
+	 675 7875 675 6525 450 6525
+2 1 0 3 4 29 50 -1 -1 0.000 0 0 -1 0 0 2
+	 675 7065 0 7065
+2 1 0 3 4 29 50 -1 -1 0.000 0 0 -1 0 0 2
+	 0 4050 0 8100
+4 0 0 50 -1 18 20 0.0000 4 240 675 1170 7065 eth0\001
+-6
+6 1936 4020 3149 5850
+2 2 0 2 0 32 50 -1 19 0.000 0 0 7 0 0 5
+	 1951 5835 1951 4035 2898 4035 2898 5835 1951 5835
+2 2 0 2 0 32 50 -1 19 0.000 0 0 7 0 0 5
+	 2898 4710 2898 5610 3134 5610 3134 4710 2898 4710
+2 1 0 2 0 32 50 -1 19 0.000 0 0 7 0 0 4
+	 2187 5835 2187 5610 2424 5610 2424 5835
+-6
+6 4275 5160 6105 6315
+2 2 0 2 0 11 50 -1 28 0.000 0 0 7 0 0 5
+	 6090 5175 4290 5175 4290 6075 6090 6075 6090 5175
+2 2 0 2 0 11 50 -1 28 0.000 0 0 7 0 0 5
+	 4965 6075 5865 6075 5865 6300 4965 6300 4965 6075
+2 1 0 2 0 11 50 -1 28 0.000 0 0 7 0 0 4
+	 6090 5400 5865 5400 5865 5625 6090 5625
+-6
+6 7170 5145 9000 6300
+2 2 0 2 0 11 50 -1 28 0.000 0 0 7 0 0 5
+	 7185 5160 8985 5160 8985 6060 7185 6060 7185 5160
+2 2 0 2 0 11 50 -1 28 0.000 0 0 7 0 0 5
+	 8310 6060 7410 6060 7410 6285 8310 6285 8310 6060
+2 1 0 2 0 11 50 -1 28 0.000 0 0 7 0 0 4
+	 7185 5385 7410 5385 7410 5610 7185 5610
+-6
+6 4275 7815 6105 8970
+2 2 0 2 0 11 50 -1 28 0.000 0 0 7 0 0 5
+	 6090 7830 4290 7830 4290 8730 6090 8730 6090 7830
+2 2 0 2 0 11 50 -1 28 0.000 0 0 7 0 0 5
+	 4965 8730 5865 8730 5865 8955 4965 8955 4965 8730
+2 1 0 2 0 11 50 -1 28 0.000 0 0 7 0 0 4
+	 6090 8055 5865 8055 5865 8280 6090 8280
+-6
+6 7170 7800 9000 8955
+2 2 0 2 0 11 50 -1 28 0.000 0 0 7 0 0 5
+	 7185 7815 8985 7815 8985 8715 7185 8715 7185 7815
+2 2 0 2 0 11 50 -1 28 0.000 0 0 7 0 0 5
+	 8310 8715 7410 8715 7410 8940 8310 8940 8310 8715
+2 1 0 2 0 11 50 -1 28 0.000 0 0 7 0 0 4
+	 7185 8040 7410 8040 7410 8265 7185 8265
+-6
+6 6975 6750 9450 9225
+6 6975 6750 9450 9225
+2 2 0 1 0 7 70 -1 20 0.000 0 0 7 0 0 5
+	 6975 9225 9450 9225 9450 6750 6975 6750 6975 9225
+4 0 0 50 -1 0 20 0.0000 4 270 705 7200 7200 guest\001
+4 0 0 50 -1 16 20 0.0000 4 240 810 8100 7200 dom7\001
+4 0 0 50 -1 16 20 0.0000 4 225 2070 7200 7650 198.51.100.32\001
+-6
+-6
+2 1 0 3 1 29 50 -1 -1 0.000 0 0 -1 0 0 2
+	 4275 5625 3375 5625
+2 1 0 3 1 29 50 -1 -1 0.000 0 0 -1 0 0 2
+	 4275 8325 3375 8325
+2 1 0 3 1 29 50 -1 -1 0.000 0 0 -1 0 0 2
+	 3375 7200 2475 7200
+2 1 0 3 1 29 50 -1 -1 0.000 0 0 -1 0 0 2
+	 3375 9000 3375 5220
+2 1 0 3 1 29 50 -1 -1 0.000 0 0 -1 0 0 3
+	 2250 5850 2250 6300 3375 6300
+2 2 0 1 0 7 70 -1 20 0.000 0 0 7 0 0 5
+	 6300 2925 900 2925 900 9450 6300 9450 6300 2925
+2 2 0 1 0 33 100 -1 20 0.000 0 0 7 0 0 5
+	 675 2250 9675 2250 9675 9675 675 9675 675 2250
+2 2 0 1 7 7 125 -1 20 0.000 0 0 7 0 0 5
+	 -225 9900 9900 9900 9900 2025 -225 2025 -225 9900
+2 1 0 3 1 29 50 -1 -1 0.000 0 0 7 0 0 2
+	 6075 5490 7200 5490
+2 2 0 1 0 7 70 -1 20 0.000 0 0 7 0 0 5
+	 6975 6525 9450 6525 9450 2925 6975 2925 6975 6525
+2 1 0 3 1 29 50 -1 -1 0.000 0 0 7 0 0 2
+	 6075 8145 7200 8145
+2 2 0 1 0 7 70 -1 20 0.000 0 0 7 0 0 5
+	 6975 6525 9450 6525 9450 5580 6975 5580 6975 6525
+2 2 0 1 0 29 50 -1 -1 0.000 0 0 -1 0 0 5
+	 1395 4230 5670 4230 5670 9180 1395 9180 1395 4230
+4 0 0 50 -1 0 16 1.5708 4 255 1395 225 5400 physical link\001
+4 0 0 50 -1 0 20 0.0000 4 300 1320 900 2700 Computer\001
+4 0 0 50 -1 0 20 0.0000 4 285 3330 990 3420 Backend (driver) domain\001
+4 0 0 50 -1 0 16 1.5708 4 195 1515 3690 7560 virtual switch\001
+4 0 0 50 -1 16 20 0.0000 4 225 1890 1440 3960 198.51.100.1\001
+4 0 0 50 -1 18 20 1.5708 4 240 1095 2250 5400 xenbr0\001
+4 0 0 50 -1 0 16 1.5708 4 255 1185 2520 5490 O/S bridge\001
+4 0 0 50 -1 0 16 1.5708 4 195 990 2790 5310 interface\001
+4 0 0 50 -1 0 20 0.0000 4 300 840 4680 4590 bridge\001
+4 0 0 50 -1 0 20 0.0000 4 225 1185 3330 4590 Software\001
+4 0 0 50 -1 0 20 0.0000 4 300 1785 7155 3420 guest domain\001
+4 0 0 50 -1 0 20 0.0000 4 300 1410 7155 3810 domU e.g.\001
+4 0 0 50 -1 16 20 0.0000 4 240 810 8550 3825 dom4\001
+4 0 0 50 -1 18 20 0.0000 4 240 825 4500 5490 vif4.0\001
+4 0 0 50 -1 18 20 0.0000 4 240 675 7875 5490 eth0\001
+4 0 0 50 -1 16 20 0.0000 4 225 2070 7200 4950 198.51.100.27\001
+4 0 0 50 -1 0 16 0.0000 4 255 1080 4500 5850 (netback)\001
+4 0 0 50 -1 0 16 0.0000 4 255 1140 7560 5850 (netfront)\001
+4 0 0 50 -1 0 16 1.5708 4 195 1350 6750 6210 virtual   link\001
+4 0 0 50 -1 0 16 0.0000 4 255 1080 4500 8505 (netback)\001
+4 0 0 50 -1 0 16 0.0000 4 255 1140 7560 8505 (netfront)\001
+4 0 0 50 -1 0 16 1.5708 4 195 1350 6750 8865 virtual   link\001
+4 0 0 50 -1 18 20 0.0000 4 240 825 4500 8190 vif7.0\001
+4 0 0 50 -1 18 20 0.0000 4 240 675 7830 8190 eth0\001

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMe0-00087l-4G; Thu, 27 Sep 2012 22:33:20 +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 1THMdz-00085A-0n
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:19 +0000
Received: from [85.158.138.51:37201] by server-12.bemta-3.messagelabs.com id
	0A/76-23730-E24D4605; Thu, 27 Sep 2012 22:33:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-174.messagelabs.com!1348785195!30472841!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31403 invoked from network); 27 Sep 2012 22:33:16 -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 Sep 2012 22:33: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 1THMdv-0007HW-Lm
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdv-0003pM-Bz
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:15 +0000
Message-Id: <E1THMdv-0003pM-Bz@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: network network diagrams for
	the wiki (figs)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1348595104 -3600
# Node ID 656662f7ea59790cd81d22c563541dc0a46b59eb
# Parent  0604d4676c6b1305f597bf7790fb57a70fdf2a7f
docs: network network diagrams for the wiki (figs)

Add the figs in hg as well as git.  Sorry (again)!

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


diff -r 0604d4676c6b -r 656662f7ea59 docs/figs/network-basic.fig
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/figs/network-basic.fig	Tue Sep 25 18:45:04 2012 +0100
@@ -0,0 +1,73 @@
+#FIG 3.2  Produced by xfig version 3.2.5b
+Landscape
+Center
+Metric
+A4      
+100.00
+Single
+-2
+1200 2
+0 32 #c0c0c0
+6 4275 5160 6105 6315
+2 2 0 2 0 11 50 -1 28 0.000 0 0 7 0 0 5
+	 6090 5175 4290 5175 4290 6075 6090 6075 6090 5175
+2 2 0 2 0 11 50 -1 28 0.000 0 0 7 0 0 5
+	 4965 6075 5865 6075 5865 6300 4965 6300 4965 6075
+2 1 0 2 0 11 50 -1 28 0.000 0 0 7 0 0 4
+	 6090 5400 5865 5400 5865 5625 6090 5625
+-6
+6 7170 5145 9000 6300
+2 2 0 2 0 11 50 -1 28 0.000 0 0 7 0 0 5
+	 7185 5160 8985 5160 8985 6060 7185 6060 7185 5160
+2 2 0 2 0 11 50 -1 28 0.000 0 0 7 0 0 5
+	 8310 6060 7410 6060 7410 6285 8310 6285 8310 6060
+2 1 0 2 0 11 50 -1 28 0.000 0 0 7 0 0 4
+	 7185 5385 7410 5385 7410 5610 7185 5610
+-6
+6 900 4050 9225 4950
+4 0 0 50 -1 0 16 0.0000 4 195 1335 1170 4860 of the world\001
+4 0 0 50 -1 0 16 0.0000 4 240 1815 1080 4590 interface, to rest\001
+4 0 0 50 -1 0 16 0.0000 4 255 1890 990 4320 Physical network\001
+4 0 0 50 -1 0 16 0.0000 4 255 1485 4050 4860 guest's traffic\001
+4 0 0 50 -1 0 16 0.0000 4 195 1305 4050 4590 backend for\001
+4 0 0 50 -1 0 16 0.0000 4 195 1905 3960 4320 Virtual interface:\001
+4 0 0 50 -1 0 16 0.0000 4 195 1290 7515 4860 Xen drivers\001
+4 0 0 50 -1 0 16 0.0000 4 255 1290 7425 4590 provided by\001
+4 0 0 50 -1 0 16 0.0000 4 195 1905 7155 4320 Virtual interface:\001
+-6
+2 2 0 2 0 29 50 -1 20 0.000 0 0 7 0 0 5
+	 660 5160 2460 5160 2460 6060 660 6060 660 5160
+2 2 0 2 0 29 50 -1 20 0.000 0 0 7 0 0 5
+	 1785 6060 885 6060 885 6285 1785 6285 1785 6060
+2 1 0 2 0 29 50 -1 20 0.000 0 0 7 0 0 4
+	 660 5385 885 5385 900 5625 675 5625
+2 1 0 2 0 29 50 -1 -1 0.000 0 0 7 0 0 3
+	 675 6300 675 4950 450 4950
+2 1 0 3 1 29 50 -1 -1 0.000 0 0 7 0 0 2
+	 6075 5490 7200 5490
+2 1 0 3 4 29 50 -1 -1 0.000 0 0 -1 0 0 2
+	 675 5490 0 5490
+2 1 0 3 4 29 50 -1 -1 0.000 0 0 -1 0 0 2
+	 0 2475 0 6525
+2 2 0 1 0 32 100 -1 20 0.000 0 0 7 0 0 5
+	 675 2250 9675 2250 9675 6750 675 6750 675 2250
+2 2 0 1 0 7 70 -1 20 0.000 0 0 7 0 0 5
+	 6300 2925 900 2925 900 6525 6300 6525 6300 2925
+2 2 0 1 0 7 70 -1 20 0.000 0 0 7 0 0 5
+	 6975 6525 9450 6525 9450 2925 6975 2925 6975 6525
+2 2 0 1 7 7 125 -1 20 0.000 0 0 -1 0 0 5
+	 -225 2025 9900 2025 9900 6975 -225 6975 -225 2025
+4 0 0 50 -1 18 20 0.0000 4 240 735 1170 5490 ethN\001
+4 0 0 50 -1 18 20 0.0000 4 240 945 4500 5490 vifA.B\001
+4 0 0 50 -1 16 20 0.0000 4 315 1410 4500 5850 e.g. vif4.0\001
+4 0 0 50 -1 16 20 0.0000 4 315 1260 1125 5850 e.g. eth0\001
+4 0 0 50 -1 0 16 1.5708 4 255 1395 225 5400 physical link\001
+4 0 0 50 -1 18 20 0.0000 4 240 735 7875 5490 ethB\001
+4 0 0 50 -1 16 20 0.0000 4 315 1260 7650 5850 e.g. eth0\001
+4 0 0 50 -1 0 20 0.0000 4 300 1995 1530 3870 typically dom0\001
+4 0 0 50 -1 0 20 0.0000 4 285 3330 990 3420 Backend (driver) domain\001
+4 0 0 50 -1 0 20 0.0000 4 300 1785 7155 3420 guest domain\001
+4 0 0 50 -1 0 20 0.0000 4 300 1410 7155 3810 domU e.g.\001
+4 0 0 50 -1 16 20 0.0000 4 240 810 8550 3825 dom4\001
+4 0 0 50 -1 0 20 0.0000 4 300 1320 900 2700 Computer\001
+4 0 0 50 -1 0 16 1.5708 4 195 1350 6750 6210 virtual   link\001
diff -r 0604d4676c6b -r 656662f7ea59 docs/figs/network-bridge.fig
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/figs/network-bridge.fig	Tue Sep 25 18:45:04 2012 +0100
@@ -0,0 +1,125 @@
+#FIG 3.2  Produced by xfig version 3.2.5b
+Landscape
+Center
+Metric
+A4      
+100.00
+Single
+-2
+1200 2
+0 32 #ffc3ff
+0 33 #c0c0c0
+6 -225 3825 2475 8325
+2 2 0 2 0 29 50 -1 20 0.000 0 0 7 0 0 5
+	 660 6735 2460 6735 2460 7635 660 7635 660 6735
+2 2 0 2 0 29 50 -1 20 0.000 0 0 7 0 0 5
+	 1785 7635 885 7635 885 7860 1785 7860 1785 7635
+2 1 0 2 0 29 50 -1 20 0.000 0 0 7 0 0 4
+	 660 6960 885 6960 900 7200 675 7200
+2 1 0 2 0 29 50 -1 -1 0.000 0 0 7 0 0 3
+	 675 7875 675 6525 450 6525
+2 1 0 3 4 29 50 -1 -1 0.000 0 0 -1 0 0 2
+	 675 7065 0 7065
+2 1 0 3 4 29 50 -1 -1 0.000 0 0 -1 0 0 2
+	 0 4050 0 8100
+4 0 0 50 -1 18 20 0.0000 4 240 675 1170 7065 eth0\001
+-6
+6 1936 4020 3149 5850
+2 2 0 2 0 32 50 -1 19 0.000 0 0 7 0 0 5
+	 1951 5835 1951 4035 2898 4035 2898 5835 1951 5835
+2 2 0 2 0 32 50 -1 19 0.000 0 0 7 0 0 5
+	 2898 4710 2898 5610 3134 5610 3134 4710 2898 4710
+2 1 0 2 0 32 50 -1 19 0.000 0 0 7 0 0 4
+	 2187 5835 2187 5610 2424 5610 2424 5835
+-6
+6 4275 5160 6105 6315
+2 2 0 2 0 11 50 -1 28 0.000 0 0 7 0 0 5
+	 6090 5175 4290 5175 4290 6075 6090 6075 6090 5175
+2 2 0 2 0 11 50 -1 28 0.000 0 0 7 0 0 5
+	 4965 6075 5865 6075 5865 6300 4965 6300 4965 6075
+2 1 0 2 0 11 50 -1 28 0.000 0 0 7 0 0 4
+	 6090 5400 5865 5400 5865 5625 6090 5625
+-6
+6 7170 5145 9000 6300
+2 2 0 2 0 11 50 -1 28 0.000 0 0 7 0 0 5
+	 7185 5160 8985 5160 8985 6060 7185 6060 7185 5160
+2 2 0 2 0 11 50 -1 28 0.000 0 0 7 0 0 5
+	 8310 6060 7410 6060 7410 6285 8310 6285 8310 6060
+2 1 0 2 0 11 50 -1 28 0.000 0 0 7 0 0 4
+	 7185 5385 7410 5385 7410 5610 7185 5610
+-6
+6 4275 7815 6105 8970
+2 2 0 2 0 11 50 -1 28 0.000 0 0 7 0 0 5
+	 6090 7830 4290 7830 4290 8730 6090 8730 6090 7830
+2 2 0 2 0 11 50 -1 28 0.000 0 0 7 0 0 5
+	 4965 8730 5865 8730 5865 8955 4965 8955 4965 8730
+2 1 0 2 0 11 50 -1 28 0.000 0 0 7 0 0 4
+	 6090 8055 5865 8055 5865 8280 6090 8280
+-6
+6 7170 7800 9000 8955
+2 2 0 2 0 11 50 -1 28 0.000 0 0 7 0 0 5
+	 7185 7815 8985 7815 8985 8715 7185 8715 7185 7815
+2 2 0 2 0 11 50 -1 28 0.000 0 0 7 0 0 5
+	 8310 8715 7410 8715 7410 8940 8310 8940 8310 8715
+2 1 0 2 0 11 50 -1 28 0.000 0 0 7 0 0 4
+	 7185 8040 7410 8040 7410 8265 7185 8265
+-6
+6 6975 6750 9450 9225
+6 6975 6750 9450 9225
+2 2 0 1 0 7 70 -1 20 0.000 0 0 7 0 0 5
+	 6975 9225 9450 9225 9450 6750 6975 6750 6975 9225
+4 0 0 50 -1 0 20 0.0000 4 270 705 7200 7200 guest\001
+4 0 0 50 -1 16 20 0.0000 4 240 810 8100 7200 dom7\001
+4 0 0 50 -1 16 20 0.0000 4 225 2070 7200 7650 198.51.100.32\001
+-6
+-6
+2 1 0 3 1 29 50 -1 -1 0.000 0 0 -1 0 0 2
+	 4275 5625 3375 5625
+2 1 0 3 1 29 50 -1 -1 0.000 0 0 -1 0 0 2
+	 4275 8325 3375 8325
+2 1 0 3 1 29 50 -1 -1 0.000 0 0 -1 0 0 2
+	 3375 7200 2475 7200
+2 1 0 3 1 29 50 -1 -1 0.000 0 0 -1 0 0 2
+	 3375 9000 3375 5220
+2 1 0 3 1 29 50 -1 -1 0.000 0 0 -1 0 0 3
+	 2250 5850 2250 6300 3375 6300
+2 2 0 1 0 7 70 -1 20 0.000 0 0 7 0 0 5
+	 6300 2925 900 2925 900 9450 6300 9450 6300 2925
+2 2 0 1 0 33 100 -1 20 0.000 0 0 7 0 0 5
+	 675 2250 9675 2250 9675 9675 675 9675 675 2250
+2 2 0 1 7 7 125 -1 20 0.000 0 0 7 0 0 5
+	 -225 9900 9900 9900 9900 2025 -225 2025 -225 9900
+2 1 0 3 1 29 50 -1 -1 0.000 0 0 7 0 0 2
+	 6075 5490 7200 5490
+2 2 0 1 0 7 70 -1 20 0.000 0 0 7 0 0 5
+	 6975 6525 9450 6525 9450 2925 6975 2925 6975 6525
+2 1 0 3 1 29 50 -1 -1 0.000 0 0 7 0 0 2
+	 6075 8145 7200 8145
+2 2 0 1 0 7 70 -1 20 0.000 0 0 7 0 0 5
+	 6975 6525 9450 6525 9450 5580 6975 5580 6975 6525
+2 2 0 1 0 29 50 -1 -1 0.000 0 0 -1 0 0 5
+	 1395 4230 5670 4230 5670 9180 1395 9180 1395 4230
+4 0 0 50 -1 0 16 1.5708 4 255 1395 225 5400 physical link\001
+4 0 0 50 -1 0 20 0.0000 4 300 1320 900 2700 Computer\001
+4 0 0 50 -1 0 20 0.0000 4 285 3330 990 3420 Backend (driver) domain\001
+4 0 0 50 -1 0 16 1.5708 4 195 1515 3690 7560 virtual switch\001
+4 0 0 50 -1 16 20 0.0000 4 225 1890 1440 3960 198.51.100.1\001
+4 0 0 50 -1 18 20 1.5708 4 240 1095 2250 5400 xenbr0\001
+4 0 0 50 -1 0 16 1.5708 4 255 1185 2520 5490 O/S bridge\001
+4 0 0 50 -1 0 16 1.5708 4 195 990 2790 5310 interface\001
+4 0 0 50 -1 0 20 0.0000 4 300 840 4680 4590 bridge\001
+4 0 0 50 -1 0 20 0.0000 4 225 1185 3330 4590 Software\001
+4 0 0 50 -1 0 20 0.0000 4 300 1785 7155 3420 guest domain\001
+4 0 0 50 -1 0 20 0.0000 4 300 1410 7155 3810 domU e.g.\001
+4 0 0 50 -1 16 20 0.0000 4 240 810 8550 3825 dom4\001
+4 0 0 50 -1 18 20 0.0000 4 240 825 4500 5490 vif4.0\001
+4 0 0 50 -1 18 20 0.0000 4 240 675 7875 5490 eth0\001
+4 0 0 50 -1 16 20 0.0000 4 225 2070 7200 4950 198.51.100.27\001
+4 0 0 50 -1 0 16 0.0000 4 255 1080 4500 5850 (netback)\001
+4 0 0 50 -1 0 16 0.0000 4 255 1140 7560 5850 (netfront)\001
+4 0 0 50 -1 0 16 1.5708 4 195 1350 6750 6210 virtual   link\001
+4 0 0 50 -1 0 16 0.0000 4 255 1080 4500 8505 (netback)\001
+4 0 0 50 -1 0 16 0.0000 4 255 1140 7560 8505 (netfront)\001
+4 0 0 50 -1 0 16 1.5708 4 195 1350 6750 8865 virtual   link\001
+4 0 0 50 -1 18 20 0.0000 4 240 825 4500 8190 vif7.0\001
+4 0 0 50 -1 18 20 0.0000 4 240 675 7830 8190 eth0\001

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMdz-00086W-Ld; Thu, 27 Sep 2012 22:33:19 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdy-00081x-0d
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:18 +0000
Received: from [85.158.143.99:30761] by server-2.bemta-4.messagelabs.com id
	E9/FB-06610-D24D4605; Thu, 27 Sep 2012 22:33:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-216.messagelabs.com!1348785196!25052710!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28223 invoked from network); 27 Sep 2012 22:33:17 -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 Sep 2012 22:33: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 1THMdv-0007HZ-Tq
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdv-0003pb-Si
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:15 +0000
Message-Id: <E1THMdv-0003pb-Si@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: enhance rsp-relative
	calculations
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348652901 -7200
# Node ID 42bacb953f6b8d2ae1df8cbe8d6347d02eaeeccb
# Parent  656662f7ea59790cd81d22c563541dc0a46b59eb
x86: enhance rsp-relative calculations

The use of "or" in GET_CPUINFO_FIELD so far wasn't ideal, as it doesn't
lend itself to folding this operation with a possibly subsequent one
(e.g. the well known mov+add=lea conversion). Split out the sub-
operations, and shorten assembly code slightly with this.

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


diff -r 656662f7ea59 -r 42bacb953f6b xen/arch/x86/x86_64/entry.S
--- a/xen/arch/x86/x86_64/entry.S	Tue Sep 25 18:45:04 2012 +0100
+++ b/xen/arch/x86/x86_64/entry.S	Wed Sep 26 11:48:21 2012 +0200
@@ -445,10 +445,10 @@ domain_crash_synchronous_string:
 
 ENTRY(domain_crash_synchronous)
         # Get out of the guest-save area of the stack.
-        GET_CPUINFO_FIELD(CPUINFO_guest_cpu_user_regs,%rax)
-        movq  %rax,%rsp
+        GET_STACK_BASE(%rax)
+        leaq  STACK_CPUINFO_FIELD(guest_cpu_user_regs)(%rax),%rsp
         # create_bounce_frame() temporarily clobbers CS.RPL. Fix up.
-        GET_CURRENT(%rax)
+        __GET_CURRENT(%rax)
         movq  VCPU_domain(%rax),%rax
         testb $1,DOMAIN_is_32bit_pv(%rax)
         setz  %al
@@ -622,7 +622,7 @@ handle_ist_exception:
         testb $3,UREGS_cs(%rsp)
         jz    1f
         /* Interrupted guest context. Copy the context to stack bottom. */
-        GET_CPUINFO_FIELD(CPUINFO_guest_cpu_user_regs,%rdi)
+        GET_CPUINFO_FIELD(guest_cpu_user_regs,%rdi)
         movq  %rsp,%rsi
         movl  $UREGS_kernel_sizeof/8,%ecx
         movq  %rdi,%rsp
diff -r 656662f7ea59 -r 42bacb953f6b xen/include/asm-x86/asm_defns.h
--- a/xen/include/asm-x86/asm_defns.h	Tue Sep 25 18:45:04 2012 +0100
+++ b/xen/include/asm-x86/asm_defns.h	Wed Sep 26 11:48:21 2012 +0200
@@ -44,6 +44,21 @@ void ret_from_intr(void);
         .subsection 0;            \
         .Llikely.tag:
 
+#define STACK_CPUINFO_FIELD(field) (STACK_SIZE-CPUINFO_sizeof+CPUINFO_##field)
+#define GET_STACK_BASE(reg)                       \
+        movq $~(STACK_SIZE-1),reg;                \
+        andq %rsp,reg
+
+#define GET_CPUINFO_FIELD(field, reg)             \
+        GET_STACK_BASE(reg);                      \
+        addq $STACK_CPUINFO_FIELD(field),reg
+
+#define __GET_CURRENT(reg)                        \
+        movq STACK_CPUINFO_FIELD(current_vcpu)(reg),reg
+#define GET_CURRENT(reg)                          \
+        GET_STACK_BASE(reg);                      \
+        __GET_CURRENT(reg)
+
 #endif
 
 #endif /* __X86_ASM_DEFNS_H__ */
diff -r 656662f7ea59 -r 42bacb953f6b xen/include/asm-x86/x86_64/asm_defns.h
--- a/xen/include/asm-x86/x86_64/asm_defns.h	Tue Sep 25 18:45:04 2012 +0100
+++ b/xen/include/asm-x86/x86_64/asm_defns.h	Wed Sep 26 11:48:21 2012 +0200
@@ -111,14 +111,6 @@ STR(IRQ) #nr "_interrupt:\n\t"          
     "movl $"#nr",4(%rsp)\n\t"                   \
     "jmp common_interrupt");
 
-#define GET_CPUINFO_FIELD(field,reg)                    \
-        movq $~(STACK_SIZE-1),reg;                      \
-        andq %rsp,reg;                                  \
-        orq  $(STACK_SIZE-CPUINFO_sizeof+field),reg;
-#define GET_CURRENT(reg)                                \
-        GET_CPUINFO_FIELD(CPUINFO_current_vcpu,reg)     \
-        movq (reg),reg;
-
 #ifdef __ASSEMBLY__
 # define _ASM_EX(p) p-.
 #else

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMdz-00086W-Ld; Thu, 27 Sep 2012 22:33:19 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdy-00081x-0d
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:18 +0000
Received: from [85.158.143.99:30761] by server-2.bemta-4.messagelabs.com id
	E9/FB-06610-D24D4605; Thu, 27 Sep 2012 22:33:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-216.messagelabs.com!1348785196!25052710!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28223 invoked from network); 27 Sep 2012 22:33:17 -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 Sep 2012 22:33: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 1THMdv-0007HZ-Tq
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdv-0003pb-Si
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:15 +0000
Message-Id: <E1THMdv-0003pb-Si@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: enhance rsp-relative
	calculations
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348652901 -7200
# Node ID 42bacb953f6b8d2ae1df8cbe8d6347d02eaeeccb
# Parent  656662f7ea59790cd81d22c563541dc0a46b59eb
x86: enhance rsp-relative calculations

The use of "or" in GET_CPUINFO_FIELD so far wasn't ideal, as it doesn't
lend itself to folding this operation with a possibly subsequent one
(e.g. the well known mov+add=lea conversion). Split out the sub-
operations, and shorten assembly code slightly with this.

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


diff -r 656662f7ea59 -r 42bacb953f6b xen/arch/x86/x86_64/entry.S
--- a/xen/arch/x86/x86_64/entry.S	Tue Sep 25 18:45:04 2012 +0100
+++ b/xen/arch/x86/x86_64/entry.S	Wed Sep 26 11:48:21 2012 +0200
@@ -445,10 +445,10 @@ domain_crash_synchronous_string:
 
 ENTRY(domain_crash_synchronous)
         # Get out of the guest-save area of the stack.
-        GET_CPUINFO_FIELD(CPUINFO_guest_cpu_user_regs,%rax)
-        movq  %rax,%rsp
+        GET_STACK_BASE(%rax)
+        leaq  STACK_CPUINFO_FIELD(guest_cpu_user_regs)(%rax),%rsp
         # create_bounce_frame() temporarily clobbers CS.RPL. Fix up.
-        GET_CURRENT(%rax)
+        __GET_CURRENT(%rax)
         movq  VCPU_domain(%rax),%rax
         testb $1,DOMAIN_is_32bit_pv(%rax)
         setz  %al
@@ -622,7 +622,7 @@ handle_ist_exception:
         testb $3,UREGS_cs(%rsp)
         jz    1f
         /* Interrupted guest context. Copy the context to stack bottom. */
-        GET_CPUINFO_FIELD(CPUINFO_guest_cpu_user_regs,%rdi)
+        GET_CPUINFO_FIELD(guest_cpu_user_regs,%rdi)
         movq  %rsp,%rsi
         movl  $UREGS_kernel_sizeof/8,%ecx
         movq  %rdi,%rsp
diff -r 656662f7ea59 -r 42bacb953f6b xen/include/asm-x86/asm_defns.h
--- a/xen/include/asm-x86/asm_defns.h	Tue Sep 25 18:45:04 2012 +0100
+++ b/xen/include/asm-x86/asm_defns.h	Wed Sep 26 11:48:21 2012 +0200
@@ -44,6 +44,21 @@ void ret_from_intr(void);
         .subsection 0;            \
         .Llikely.tag:
 
+#define STACK_CPUINFO_FIELD(field) (STACK_SIZE-CPUINFO_sizeof+CPUINFO_##field)
+#define GET_STACK_BASE(reg)                       \
+        movq $~(STACK_SIZE-1),reg;                \
+        andq %rsp,reg
+
+#define GET_CPUINFO_FIELD(field, reg)             \
+        GET_STACK_BASE(reg);                      \
+        addq $STACK_CPUINFO_FIELD(field),reg
+
+#define __GET_CURRENT(reg)                        \
+        movq STACK_CPUINFO_FIELD(current_vcpu)(reg),reg
+#define GET_CURRENT(reg)                          \
+        GET_STACK_BASE(reg);                      \
+        __GET_CURRENT(reg)
+
 #endif
 
 #endif /* __X86_ASM_DEFNS_H__ */
diff -r 656662f7ea59 -r 42bacb953f6b xen/include/asm-x86/x86_64/asm_defns.h
--- a/xen/include/asm-x86/x86_64/asm_defns.h	Tue Sep 25 18:45:04 2012 +0100
+++ b/xen/include/asm-x86/x86_64/asm_defns.h	Wed Sep 26 11:48:21 2012 +0200
@@ -111,14 +111,6 @@ STR(IRQ) #nr "_interrupt:\n\t"          
     "movl $"#nr",4(%rsp)\n\t"                   \
     "jmp common_interrupt");
 
-#define GET_CPUINFO_FIELD(field,reg)                    \
-        movq $~(STACK_SIZE-1),reg;                      \
-        andq %rsp,reg;                                  \
-        orq  $(STACK_SIZE-CPUINFO_sizeof+field),reg;
-#define GET_CURRENT(reg)                                \
-        GET_CPUINFO_FIELD(CPUINFO_current_vcpu,reg)     \
-        movq (reg),reg;
-
 #ifdef __ASSEMBLY__
 # define _ASM_EX(p) p-.
 #else

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMe1-00089p-Fq; Thu, 27 Sep 2012 22:33:21 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdz-00081x-ID
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:19 +0000
Received: from [85.158.143.99:30790] by server-2.bemta-4.messagelabs.com id
	0C/FB-06610-F24D4605; Thu, 27 Sep 2012 22:33:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-216.messagelabs.com!1348785197!31718418!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1376 invoked from network); 27 Sep 2012 22:33:18 -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;
	27 Sep 2012 22:33: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 1THMdx-0007Hi-GY
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdx-0003qK-FK
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:17 +0000
Message-Id: <E1THMdx-0003qK-FK@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: clean up interrupt stub
	generation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348653123 -7200
# Node ID 4876f914a8a08773597cbe2b567808a91494af8f
# Parent  a5e59ccf21f58281e5392e12ab55a202f40bdbce
x86: clean up interrupt stub generation

Apart from moving some code that is only used here from the header file
to the actual source one, this also
- moves interrupt[] into .init.data,
- prevents generating (unused) stubs for vectors below
  FIRST_DYNAMIC_VECTOR, and
- shortens and sanitizes the names of the stubs.

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


diff -r a5e59ccf21f5 -r 4876f914a8a0 xen/arch/x86/i8259.c
--- a/xen/arch/x86/i8259.c	Wed Sep 26 11:51:27 2012 +0200
+++ b/xen/arch/x86/i8259.c	Wed Sep 26 11:52:03 2012 +0200
@@ -37,26 +37,35 @@ __asm__(".section .text");
 
 BUILD_COMMON_IRQ()
 
-#define BI(x,y) \
-    BUILD_IRQ(x##y)
+#define IRQ_NAME(nr) VEC##nr##_interrupt
+
+#define BI(nr)                                           \
+void IRQ_NAME(nr)(void);                                 \
+__asm__(                                                 \
+".if " STR(0x##nr) " >= " STR(FIRST_DYNAMIC_VECTOR) "\n" \
+__ALIGN_STR "\n"                                         \
+STR(IRQ_NAME(nr)) ":\n\t"                                \
+BUILD_IRQ(0x##nr) "\n"                                   \
+".else\n"                                                \
+".equ " STR(IRQ_NAME(nr)) ", 0\n"                        \
+".endif\n")
 
 #define BUILD_16_IRQS(x) \
-    BI(x,0) BI(x,1) BI(x,2) BI(x,3) \
-    BI(x,4) BI(x,5) BI(x,6) BI(x,7) \
-    BI(x,8) BI(x,9) BI(x,a) BI(x,b) \
-    BI(x,c) BI(x,d) BI(x,e) BI(x,f)
+    BI(x##0); BI(x##1); BI(x##2); BI(x##3); \
+    BI(x##4); BI(x##5); BI(x##6); BI(x##7); \
+    BI(x##8); BI(x##9); BI(x##a); BI(x##b); \
+    BI(x##c); BI(x##d); BI(x##e); BI(x##f)
 
-BUILD_16_IRQS(0x0) BUILD_16_IRQS(0x1) BUILD_16_IRQS(0x2) BUILD_16_IRQS(0x3)
-BUILD_16_IRQS(0x4) BUILD_16_IRQS(0x5) BUILD_16_IRQS(0x6) BUILD_16_IRQS(0x7)
-BUILD_16_IRQS(0x8) BUILD_16_IRQS(0x9) BUILD_16_IRQS(0xa) BUILD_16_IRQS(0xb)
-BUILD_16_IRQS(0xc) BUILD_16_IRQS(0xd) BUILD_16_IRQS(0xe) BUILD_16_IRQS(0xf)
+BUILD_16_IRQS(0); BUILD_16_IRQS(1); BUILD_16_IRQS(2); BUILD_16_IRQS(3);
+BUILD_16_IRQS(4); BUILD_16_IRQS(5); BUILD_16_IRQS(6); BUILD_16_IRQS(7);
+BUILD_16_IRQS(8); BUILD_16_IRQS(9); BUILD_16_IRQS(a); BUILD_16_IRQS(b);
+BUILD_16_IRQS(c); BUILD_16_IRQS(d); BUILD_16_IRQS(e); BUILD_16_IRQS(f);
 
 #undef BUILD_16_IRQS
 #undef BI
 
 
-#define IRQ(x,y) \
-    IRQ##x##y##_interrupt
+#define IRQ(x,y) IRQ_NAME(x##y)
 
 #define IRQLIST_16(x) \
     IRQ(x,0), IRQ(x,1), IRQ(x,2), IRQ(x,3), \
@@ -64,12 +73,12 @@ BUILD_16_IRQS(0xc) BUILD_16_IRQS(0xd) BU
     IRQ(x,8), IRQ(x,9), IRQ(x,a), IRQ(x,b), \
     IRQ(x,c), IRQ(x,d), IRQ(x,e), IRQ(x,f)
 
-    static void (*interrupt[])(void) = {
-        IRQLIST_16(0x0), IRQLIST_16(0x1), IRQLIST_16(0x2), IRQLIST_16(0x3),
-        IRQLIST_16(0x4), IRQLIST_16(0x5), IRQLIST_16(0x6), IRQLIST_16(0x7),
-        IRQLIST_16(0x8), IRQLIST_16(0x9), IRQLIST_16(0xa), IRQLIST_16(0xb),
-        IRQLIST_16(0xc), IRQLIST_16(0xd), IRQLIST_16(0xe), IRQLIST_16(0xf)
-    };
+static void (*__initdata interrupt[NR_VECTORS])(void) = {
+    IRQLIST_16(0), IRQLIST_16(1), IRQLIST_16(2), IRQLIST_16(3),
+    IRQLIST_16(4), IRQLIST_16(5), IRQLIST_16(6), IRQLIST_16(7),
+    IRQLIST_16(8), IRQLIST_16(9), IRQLIST_16(a), IRQLIST_16(b),
+    IRQLIST_16(c), IRQLIST_16(d), IRQLIST_16(e), IRQLIST_16(f)
+};
 
 #undef IRQ
 #undef IRQLIST_16
@@ -400,6 +409,7 @@ void __init init_IRQ(void)
     {
         if (vector == HYPERCALL_VECTOR || vector == LEGACY_SYSCALL_VECTOR)
             continue;
+        BUG_ON(!interrupt[vector]);
         set_intr_gate(vector, interrupt[vector]);
     }
 
diff -r a5e59ccf21f5 -r 4876f914a8a0 xen/include/asm-x86/x86_64/asm_defns.h
--- a/xen/include/asm-x86/x86_64/asm_defns.h	Wed Sep 26 11:51:27 2012 +0200
+++ b/xen/include/asm-x86/x86_64/asm_defns.h	Wed Sep 26 11:52:03 2012 +0200
@@ -99,17 +99,10 @@ __asm__(                                
     "callq " STR(do_IRQ) "\n\t"                 \
     "jmp ret_from_intr\n");
 
-#define IRQ_NAME2(nr) nr##_interrupt(void)
-#define IRQ_NAME(nr) IRQ_NAME2(IRQ##nr)
-
 #define BUILD_IRQ(nr)                           \
-void IRQ_NAME(nr);                   \
-__asm__(                                        \
-"\n"__ALIGN_STR"\n"                             \
-STR(IRQ) #nr "_interrupt:\n\t"                  \
     "pushq $0\n\t"                              \
     "movl $"#nr",4(%rsp)\n\t"                   \
-    "jmp common_interrupt");
+    "jmp common_interrupt"
 
 #ifdef __ASSEMBLY__
 # define _ASM_EX(p) p-.

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMe1-0008AG-MA; Thu, 27 Sep 2012 22:33: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 1THMdz-00081S-JV
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-27.messagelabs.com!1348785192!5659118!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24004 invoked from network); 27 Sep 2012 22:33:13 -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 Sep 2012 22: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 1THMdp-0007Gw-6y
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdo-0003mP-IJ
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:08 +0000
Message-Id: <E1THMdo-0003mP-IJ@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] cpuidle: remove unused latency_ticks
	member
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348227908 -7200
# Node ID 8eab91903e710d344d2cee20434ee6407644ad5e
# Parent  d364becfb0835f69e85d273fe2b29035c2d975df
cpuidle: remove unused latency_ticks member

... and code used only for initializing it.

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


diff -r d364becfb083 -r 8eab91903e71 xen/arch/x86/acpi/cpu_idle.c
--- a/xen/arch/x86/acpi/cpu_idle.c	Thu Sep 20 13:31:19 2012 +0200
+++ b/xen/arch/x86/acpi/cpu_idle.c	Fri Sep 21 13:45:08 2012 +0200
@@ -74,7 +74,6 @@ static void (*lapic_timer_off)(void);
 static void (*lapic_timer_on)(void);
 
 static uint64_t (*__read_mostly tick_to_ns)(uint64_t) = acpi_pm_tick_to_ns;
-static uint64_t (*__read_mostly ns_to_tick)(uint64_t) = ns_to_acpi_pm_tick;
 
 static void (*pm_idle_save) (void) __read_mostly;
 unsigned int max_cstate __read_mostly = ACPI_PROCESSOR_MAX_POWER - 1;
@@ -225,7 +224,6 @@ __initcall(cpu_idle_key_init);
 static uint64_t get_stime_tick(void) { return (uint64_t)NOW(); }
 static uint64_t stime_ticks_elapsed(uint64_t t1, uint64_t t2) { return t2 - t1; }
 static uint64_t stime_tick_to_ns(uint64_t ticks) { return ticks; }
-static uint64_t ns_to_stime_tick(uint64_t ns) { return ns; }
 
 static uint64_t get_acpi_pm_tick(void) { return (uint64_t)inl(pmtmr_ioport); }
 static uint64_t acpi_pm_ticks_elapsed(uint64_t t1, uint64_t t2)
@@ -665,7 +663,6 @@ static int cpuidle_init_cpu(int cpu)
             get_tick = get_stime_tick;
             ticks_elapsed = stime_ticks_elapsed;
             tick_to_ns = stime_tick_to_ns;
-            ns_to_tick = ns_to_stime_tick;
         }
 
         acpi_power = xzalloc(struct acpi_processor_power);
@@ -943,7 +940,6 @@ static void set_cx(
     cx->latency  = xen_cx->latency;
     cx->power    = xen_cx->power;
     
-    cx->latency_ticks = ns_to_tick(cx->latency * 1000UL);
     cx->target_residency = cx->latency * latency_factor;
     if ( cx->type == ACPI_STATE_C1 || cx->type == ACPI_STATE_C2 )
         acpi_power->safe_state = cx;
diff -r d364becfb083 -r 8eab91903e71 xen/include/xen/cpuidle.h
--- a/xen/include/xen/cpuidle.h	Thu Sep 20 13:31:19 2012 +0200
+++ b/xen/include/xen/cpuidle.h	Fri Sep 21 13:45:08 2012 +0200
@@ -45,11 +45,10 @@ struct acpi_processor_cx
     u8 entry_method; /* ACPI_CSTATE_EM_xxx */
     u32 address;
     u32 latency;
-    u32 latency_ticks;
+    u32 target_residency;
     u32 power;
     u32 usage;
     u64 time;
-    u32 target_residency;
 };
 
 struct acpi_processor_flags

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMe1-00089p-Fq; Thu, 27 Sep 2012 22:33:21 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdz-00081x-ID
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:19 +0000
Received: from [85.158.143.99:30790] by server-2.bemta-4.messagelabs.com id
	0C/FB-06610-F24D4605; Thu, 27 Sep 2012 22:33:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-216.messagelabs.com!1348785197!31718418!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1376 invoked from network); 27 Sep 2012 22:33:18 -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;
	27 Sep 2012 22:33: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 1THMdx-0007Hi-GY
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdx-0003qK-FK
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:17 +0000
Message-Id: <E1THMdx-0003qK-FK@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: clean up interrupt stub
	generation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348653123 -7200
# Node ID 4876f914a8a08773597cbe2b567808a91494af8f
# Parent  a5e59ccf21f58281e5392e12ab55a202f40bdbce
x86: clean up interrupt stub generation

Apart from moving some code that is only used here from the header file
to the actual source one, this also
- moves interrupt[] into .init.data,
- prevents generating (unused) stubs for vectors below
  FIRST_DYNAMIC_VECTOR, and
- shortens and sanitizes the names of the stubs.

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


diff -r a5e59ccf21f5 -r 4876f914a8a0 xen/arch/x86/i8259.c
--- a/xen/arch/x86/i8259.c	Wed Sep 26 11:51:27 2012 +0200
+++ b/xen/arch/x86/i8259.c	Wed Sep 26 11:52:03 2012 +0200
@@ -37,26 +37,35 @@ __asm__(".section .text");
 
 BUILD_COMMON_IRQ()
 
-#define BI(x,y) \
-    BUILD_IRQ(x##y)
+#define IRQ_NAME(nr) VEC##nr##_interrupt
+
+#define BI(nr)                                           \
+void IRQ_NAME(nr)(void);                                 \
+__asm__(                                                 \
+".if " STR(0x##nr) " >= " STR(FIRST_DYNAMIC_VECTOR) "\n" \
+__ALIGN_STR "\n"                                         \
+STR(IRQ_NAME(nr)) ":\n\t"                                \
+BUILD_IRQ(0x##nr) "\n"                                   \
+".else\n"                                                \
+".equ " STR(IRQ_NAME(nr)) ", 0\n"                        \
+".endif\n")
 
 #define BUILD_16_IRQS(x) \
-    BI(x,0) BI(x,1) BI(x,2) BI(x,3) \
-    BI(x,4) BI(x,5) BI(x,6) BI(x,7) \
-    BI(x,8) BI(x,9) BI(x,a) BI(x,b) \
-    BI(x,c) BI(x,d) BI(x,e) BI(x,f)
+    BI(x##0); BI(x##1); BI(x##2); BI(x##3); \
+    BI(x##4); BI(x##5); BI(x##6); BI(x##7); \
+    BI(x##8); BI(x##9); BI(x##a); BI(x##b); \
+    BI(x##c); BI(x##d); BI(x##e); BI(x##f)
 
-BUILD_16_IRQS(0x0) BUILD_16_IRQS(0x1) BUILD_16_IRQS(0x2) BUILD_16_IRQS(0x3)
-BUILD_16_IRQS(0x4) BUILD_16_IRQS(0x5) BUILD_16_IRQS(0x6) BUILD_16_IRQS(0x7)
-BUILD_16_IRQS(0x8) BUILD_16_IRQS(0x9) BUILD_16_IRQS(0xa) BUILD_16_IRQS(0xb)
-BUILD_16_IRQS(0xc) BUILD_16_IRQS(0xd) BUILD_16_IRQS(0xe) BUILD_16_IRQS(0xf)
+BUILD_16_IRQS(0); BUILD_16_IRQS(1); BUILD_16_IRQS(2); BUILD_16_IRQS(3);
+BUILD_16_IRQS(4); BUILD_16_IRQS(5); BUILD_16_IRQS(6); BUILD_16_IRQS(7);
+BUILD_16_IRQS(8); BUILD_16_IRQS(9); BUILD_16_IRQS(a); BUILD_16_IRQS(b);
+BUILD_16_IRQS(c); BUILD_16_IRQS(d); BUILD_16_IRQS(e); BUILD_16_IRQS(f);
 
 #undef BUILD_16_IRQS
 #undef BI
 
 
-#define IRQ(x,y) \
-    IRQ##x##y##_interrupt
+#define IRQ(x,y) IRQ_NAME(x##y)
 
 #define IRQLIST_16(x) \
     IRQ(x,0), IRQ(x,1), IRQ(x,2), IRQ(x,3), \
@@ -64,12 +73,12 @@ BUILD_16_IRQS(0xc) BUILD_16_IRQS(0xd) BU
     IRQ(x,8), IRQ(x,9), IRQ(x,a), IRQ(x,b), \
     IRQ(x,c), IRQ(x,d), IRQ(x,e), IRQ(x,f)
 
-    static void (*interrupt[])(void) = {
-        IRQLIST_16(0x0), IRQLIST_16(0x1), IRQLIST_16(0x2), IRQLIST_16(0x3),
-        IRQLIST_16(0x4), IRQLIST_16(0x5), IRQLIST_16(0x6), IRQLIST_16(0x7),
-        IRQLIST_16(0x8), IRQLIST_16(0x9), IRQLIST_16(0xa), IRQLIST_16(0xb),
-        IRQLIST_16(0xc), IRQLIST_16(0xd), IRQLIST_16(0xe), IRQLIST_16(0xf)
-    };
+static void (*__initdata interrupt[NR_VECTORS])(void) = {
+    IRQLIST_16(0), IRQLIST_16(1), IRQLIST_16(2), IRQLIST_16(3),
+    IRQLIST_16(4), IRQLIST_16(5), IRQLIST_16(6), IRQLIST_16(7),
+    IRQLIST_16(8), IRQLIST_16(9), IRQLIST_16(a), IRQLIST_16(b),
+    IRQLIST_16(c), IRQLIST_16(d), IRQLIST_16(e), IRQLIST_16(f)
+};
 
 #undef IRQ
 #undef IRQLIST_16
@@ -400,6 +409,7 @@ void __init init_IRQ(void)
     {
         if (vector == HYPERCALL_VECTOR || vector == LEGACY_SYSCALL_VECTOR)
             continue;
+        BUG_ON(!interrupt[vector]);
         set_intr_gate(vector, interrupt[vector]);
     }
 
diff -r a5e59ccf21f5 -r 4876f914a8a0 xen/include/asm-x86/x86_64/asm_defns.h
--- a/xen/include/asm-x86/x86_64/asm_defns.h	Wed Sep 26 11:51:27 2012 +0200
+++ b/xen/include/asm-x86/x86_64/asm_defns.h	Wed Sep 26 11:52:03 2012 +0200
@@ -99,17 +99,10 @@ __asm__(                                
     "callq " STR(do_IRQ) "\n\t"                 \
     "jmp ret_from_intr\n");
 
-#define IRQ_NAME2(nr) nr##_interrupt(void)
-#define IRQ_NAME(nr) IRQ_NAME2(IRQ##nr)
-
 #define BUILD_IRQ(nr)                           \
-void IRQ_NAME(nr);                   \
-__asm__(                                        \
-"\n"__ALIGN_STR"\n"                             \
-STR(IRQ) #nr "_interrupt:\n\t"                  \
     "pushq $0\n\t"                              \
     "movl $"#nr",4(%rsp)\n\t"                   \
-    "jmp common_interrupt");
+    "jmp common_interrupt"
 
 #ifdef __ASSEMBLY__
 # define _ASM_EX(p) p-.

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMe1-0008AG-MA; Thu, 27 Sep 2012 22:33: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 1THMdz-00081S-JV
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-27.messagelabs.com!1348785192!5659118!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24004 invoked from network); 27 Sep 2012 22:33:13 -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 Sep 2012 22: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 1THMdp-0007Gw-6y
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdo-0003mP-IJ
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:08 +0000
Message-Id: <E1THMdo-0003mP-IJ@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] cpuidle: remove unused latency_ticks
	member
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348227908 -7200
# Node ID 8eab91903e710d344d2cee20434ee6407644ad5e
# Parent  d364becfb0835f69e85d273fe2b29035c2d975df
cpuidle: remove unused latency_ticks member

... and code used only for initializing it.

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


diff -r d364becfb083 -r 8eab91903e71 xen/arch/x86/acpi/cpu_idle.c
--- a/xen/arch/x86/acpi/cpu_idle.c	Thu Sep 20 13:31:19 2012 +0200
+++ b/xen/arch/x86/acpi/cpu_idle.c	Fri Sep 21 13:45:08 2012 +0200
@@ -74,7 +74,6 @@ static void (*lapic_timer_off)(void);
 static void (*lapic_timer_on)(void);
 
 static uint64_t (*__read_mostly tick_to_ns)(uint64_t) = acpi_pm_tick_to_ns;
-static uint64_t (*__read_mostly ns_to_tick)(uint64_t) = ns_to_acpi_pm_tick;
 
 static void (*pm_idle_save) (void) __read_mostly;
 unsigned int max_cstate __read_mostly = ACPI_PROCESSOR_MAX_POWER - 1;
@@ -225,7 +224,6 @@ __initcall(cpu_idle_key_init);
 static uint64_t get_stime_tick(void) { return (uint64_t)NOW(); }
 static uint64_t stime_ticks_elapsed(uint64_t t1, uint64_t t2) { return t2 - t1; }
 static uint64_t stime_tick_to_ns(uint64_t ticks) { return ticks; }
-static uint64_t ns_to_stime_tick(uint64_t ns) { return ns; }
 
 static uint64_t get_acpi_pm_tick(void) { return (uint64_t)inl(pmtmr_ioport); }
 static uint64_t acpi_pm_ticks_elapsed(uint64_t t1, uint64_t t2)
@@ -665,7 +663,6 @@ static int cpuidle_init_cpu(int cpu)
             get_tick = get_stime_tick;
             ticks_elapsed = stime_ticks_elapsed;
             tick_to_ns = stime_tick_to_ns;
-            ns_to_tick = ns_to_stime_tick;
         }
 
         acpi_power = xzalloc(struct acpi_processor_power);
@@ -943,7 +940,6 @@ static void set_cx(
     cx->latency  = xen_cx->latency;
     cx->power    = xen_cx->power;
     
-    cx->latency_ticks = ns_to_tick(cx->latency * 1000UL);
     cx->target_residency = cx->latency * latency_factor;
     if ( cx->type == ACPI_STATE_C1 || cx->type == ACPI_STATE_C2 )
         acpi_power->safe_state = cx;
diff -r d364becfb083 -r 8eab91903e71 xen/include/xen/cpuidle.h
--- a/xen/include/xen/cpuidle.h	Thu Sep 20 13:31:19 2012 +0200
+++ b/xen/include/xen/cpuidle.h	Fri Sep 21 13:45:08 2012 +0200
@@ -45,11 +45,10 @@ struct acpi_processor_cx
     u8 entry_method; /* ACPI_CSTATE_EM_xxx */
     u32 address;
     u32 latency;
-    u32 latency_ticks;
+    u32 target_residency;
     u32 power;
     u32 usage;
     u64 time;
-    u32 target_residency;
 };
 
 struct acpi_processor_flags

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMe2-0008BP-56; Thu, 27 Sep 2012 22:33:22 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMe0-00084J-MS
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:20 +0000
Received: from [85.158.139.211:3289] by server-14.bemta-5.messagelabs.com id
	67/75-05772-034D4605; Thu, 27 Sep 2012 22:33:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-206.messagelabs.com!1348785198!20230812!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22966 invoked from network); 27 Sep 2012 22:33:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Sep 2012 22:33: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 1THMdy-0007Ho-IV
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdy-0003qo-HJ
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:18 +0000
Message-Id: <E1THMdy-0003qo-HJ@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: check remote MMIO remap
	permissions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Daniel De Graaf <dgdegra@tycho.nsa.gov>
# Date 1348653367 -7200
# Node ID 8278d7d8fa485996f51134c5265fceaf239adf6a
# Parent  b83f414ccf7a6e4e077a10bc422cf3f6c7d30566
x86: check remote MMIO remap permissions

When a domain is mapping pages from a different pg_owner domain, the
iomem_access checks are currently only applied to the pg_owner domain,
potentially allowing a domain with a more restrictive iomem_access
policy to have the pages mapped into its page tables. To catch this,
also check the owner of the page tables. The current domain does not
need to be checked because the ability to manipulate a domain's page
tables implies full access to the target domain, so checking that
domain's permission is sufficient.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r b83f414ccf7a -r 8278d7d8fa48 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Wed Sep 26 11:53:38 2012 +0200
+++ b/xen/arch/x86/mm.c	Wed Sep 26 11:56:07 2012 +0200
@@ -754,6 +754,19 @@ get_page_from_l1e(
             return -EINVAL;
         }
 
+        if ( pg_owner != l1e_owner &&
+             !iomem_access_permitted(l1e_owner, mfn, mfn) )
+        {
+            if ( mfn != (PADDR_MASK >> PAGE_SHIFT) ) /* INVALID_MFN? */
+            {
+                MEM_LOG("Dom%u attempted to map I/O space %08lx in dom%u to dom%u",
+                        curr->domain->domain_id, mfn, pg_owner->domain_id,
+                        l1e_owner->domain_id);
+                return -EPERM;
+            }
+            return -EINVAL;
+        }
+
         if ( !(l1f & _PAGE_RW) ||
              !rangeset_contains_singleton(mmio_ro_ranges, mfn) )
             return 0;

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMe2-0008BP-56; Thu, 27 Sep 2012 22:33:22 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMe0-00084J-MS
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:20 +0000
Received: from [85.158.139.211:3289] by server-14.bemta-5.messagelabs.com id
	67/75-05772-034D4605; Thu, 27 Sep 2012 22:33:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-206.messagelabs.com!1348785198!20230812!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22966 invoked from network); 27 Sep 2012 22:33:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Sep 2012 22:33: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 1THMdy-0007Ho-IV
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdy-0003qo-HJ
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:18 +0000
Message-Id: <E1THMdy-0003qo-HJ@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: check remote MMIO remap
	permissions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Daniel De Graaf <dgdegra@tycho.nsa.gov>
# Date 1348653367 -7200
# Node ID 8278d7d8fa485996f51134c5265fceaf239adf6a
# Parent  b83f414ccf7a6e4e077a10bc422cf3f6c7d30566
x86: check remote MMIO remap permissions

When a domain is mapping pages from a different pg_owner domain, the
iomem_access checks are currently only applied to the pg_owner domain,
potentially allowing a domain with a more restrictive iomem_access
policy to have the pages mapped into its page tables. To catch this,
also check the owner of the page tables. The current domain does not
need to be checked because the ability to manipulate a domain's page
tables implies full access to the target domain, so checking that
domain's permission is sufficient.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r b83f414ccf7a -r 8278d7d8fa48 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Wed Sep 26 11:53:38 2012 +0200
+++ b/xen/arch/x86/mm.c	Wed Sep 26 11:56:07 2012 +0200
@@ -754,6 +754,19 @@ get_page_from_l1e(
             return -EINVAL;
         }
 
+        if ( pg_owner != l1e_owner &&
+             !iomem_access_permitted(l1e_owner, mfn, mfn) )
+        {
+            if ( mfn != (PADDR_MASK >> PAGE_SHIFT) ) /* INVALID_MFN? */
+            {
+                MEM_LOG("Dom%u attempted to map I/O space %08lx in dom%u to dom%u",
+                        curr->domain->domain_id, mfn, pg_owner->domain_id,
+                        l1e_owner->domain_id);
+                return -EPERM;
+            }
+            return -EINVAL;
+        }
+
         if ( !(l1f & _PAGE_RW) ||
              !rangeset_contains_singleton(mmio_ro_ranges, mfn) )
             return 0;

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMe2-0008B6-0t; Thu, 27 Sep 2012 22:33:22 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMe0-00081M-12
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:20 +0000
Received: from [85.158.143.99:30801] by server-3.bemta-4.messagelabs.com id
	47/60-10986-F24D4605; Thu, 27 Sep 2012 22:33:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-216.messagelabs.com!1348785198!31145192!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14065 invoked from network); 27 Sep 2012 22:33:19 -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 Sep 2012 22:33: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 1THMdy-0007Hl-1b
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdy-0003qZ-0Q
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:18 +0000
Message-Id: <E1THMdy-0003qZ-0Q@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: slightly improve stack trace on
	debug builds
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348653218 -7200
# Node ID b83f414ccf7a6e4e077a10bc422cf3f6c7d30566
# Parent  4876f914a8a08773597cbe2b567808a91494af8f
x86: slightly improve stack trace on debug builds

As was rather obvious from crashes recently happening in stage testing,
the debug hypervisor, in that special case, has a drawback compared to
the non-debug one: When a call through a bad pointer happens, there's
no frame, and the top level (and frequently most important for
analysis) stack entry would get skipped:

(XEN) ----[ Xen-4.3-unstable  x86_64  debug=y  Not tainted ]----
(XEN) CPU:    1
(XEN) RIP:    e008:[<0000000000000000>] ???
(XEN) RFLAGS: 0000000000010046   CONTEXT: hypervisor
(XEN) rax: 0000000000000008   rbx: 0000000000000001   rcx: 0000000000000003
(XEN) rdx: 0000003db54eb700   rsi: 7fffffffffffffff   rdi: 0000000000000001
(XEN) rbp: ffff8302357e7ee0   rsp: ffff8302357e7e58   r8:  0000000000000000
(XEN) r9:  000000000000003e   r10: ffff8302357e7f18   r11: ffff8302357e7f18
(XEN) r12: ffff8302357ee340   r13: ffff82c480263980   r14: ffff8302357ee3d0
(XEN) r15: 0000000000000001   cr0: 000000008005003b   cr4: 00000000000026f0
(XEN) cr3: 00000000bf473000   cr2: 0000000000000000
(XEN) ds: 0000   es: 0000   fs: 0000   gs: 0000   ss: 0000   cs: e008
(XEN) Xen stack trace from rsp=ffff8302357e7e58:
(XEN)    ffff82c4801a3d05 ffff8302357eca70 0000000800000020 ffff82c4802ead60
(XEN)    0000000000000001 ffff8302357e7ea0 ffff82c48016bf07 0000000000000000
(XEN)    0000000000000000 ffff8302357e7ee0 fffff830fffff830 0000000000000046
(XEN)    ffff8302357e7f18 ffff82c480263980 ffff8302357e7f18 0000000000000000
(XEN)    0000000000000000 ffff8302357e7f10 ffff82c48015c2be 8302357dc0000fff
...
(XEN) Xen call trace:
(XEN)    [<0000000000000000>] ???
(XEN)    [<ffff82c48015c2be>] idle_loop+0x6c/0x7a
(XEN)
(XEN) Pagetable walk from 0000000000000000:

Since the bad pointer is being printed anyway (as part of the register
state), replace it with the top of stack value in such a case.

With the introduction of is_active_kernel_text(), use it also at the
(few) other suitable places (I intentionally didn't replace the use in
xen/arch/arm/mm.c - while it would be functionally correct, the
dependency on system_state wouldn't be from an abstract perspective).

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


diff -r 4876f914a8a0 -r b83f414ccf7a xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c	Wed Sep 26 11:52:03 2012 +0200
+++ b/xen/arch/x86/traps.c	Wed Sep 26 11:53:38 2012 +0200
@@ -199,7 +199,7 @@ static void show_trace(struct cpu_user_r
     while ( ((long)stack & (STACK_SIZE-BYTES_PER_LONG)) != 0 )
     {
         addr = *stack++;
-        if ( is_kernel_text(addr) || is_kernel_inittext(addr) )
+        if ( is_active_kernel_text(addr) )
         {
             printk("[<%p>]", _p(addr));
             print_symbol(" %s\n   ", addr);
@@ -217,8 +217,16 @@ static void show_trace(struct cpu_user_r
 
     printk("Xen call trace:\n   ");
 
-    printk("[<%p>]", _p(regs->eip));
-    print_symbol(" %s\n   ", regs->eip);
+    /*
+     * If RIP is not pointing into hypervisor code then someone may have
+     * called into oblivion. Peek to see if they left a return address at
+     * top of stack.
+     */
+    addr = is_active_kernel_text(regs->eip) ||
+           !is_active_kernel_text(*ESP_BEFORE_EXCEPTION(regs)) ?
+           regs->eip : *ESP_BEFORE_EXCEPTION(regs);
+    printk("[<%p>]", _p(addr));
+    print_symbol(" %s\n   ", addr);
 
     /* Bounds for range of valid frame pointer. */
     low  = (unsigned long)(ESP_BEFORE_EXCEPTION(regs) - 2);
@@ -322,7 +330,7 @@ void show_stack_overflow(unsigned int cp
     while ( ((long)stack & (STACK_SIZE-BYTES_PER_LONG)) != 0 )
     {
         addr = *stack++;
-        if ( is_kernel_text(addr) || is_kernel_inittext(addr) )
+        if ( is_active_kernel_text(addr) )
         {
             printk("%p: [<%p>]", stack, _p(addr));
             print_symbol(" %s\n   ", addr);
diff -r 4876f914a8a0 -r b83f414ccf7a xen/common/symbols.c
--- a/xen/common/symbols.c	Wed Sep 26 11:52:03 2012 +0200
+++ b/xen/common/symbols.c	Wed Sep 26 11:53:38 2012 +0200
@@ -93,6 +93,12 @@ static unsigned int get_symbol_offset(un
     return name - symbols_names;
 }
 
+bool_t is_active_kernel_text(unsigned long addr)
+{
+    return (is_kernel_text(addr) ||
+            (system_state == SYS_STATE_boot && is_kernel_inittext(addr)));
+}
+
 const char *symbols_lookup(unsigned long addr,
                            unsigned long *symbolsize,
                            unsigned long *offset,
@@ -104,7 +110,7 @@ const char *symbols_lookup(unsigned long
     namebuf[KSYM_NAME_LEN] = 0;
     namebuf[0] = 0;
 
-    if (!is_kernel_text(addr) && !is_kernel_inittext(addr))
+    if (!is_active_kernel_text(addr))
         return NULL;
 
         /* do a binary search on the sorted symbols_addresses array */
diff -r 4876f914a8a0 -r b83f414ccf7a xen/include/xen/kernel.h
--- a/xen/include/xen/kernel.h	Wed Sep 26 11:52:03 2012 +0200
+++ b/xen/include/xen/kernel.h	Wed Sep 26 11:53:38 2012 +0200
@@ -5,6 +5,8 @@
  * 'kernel.h' contains some often-used function prototypes etc
  */
 
+#include <xen/types.h>
+
 /*
  * min()/max() macros that also do
  * strict type-checking.. See the
@@ -95,5 +97,7 @@ extern enum system_state {
     SYS_STATE_resume
 } system_state;
 
+bool_t is_active_kernel_text(unsigned long addr);
+
 #endif /* _LINUX_KERNEL_H */
 

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMe1-0008Av-SP; Thu, 27 Sep 2012 22:33:21 +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 1THMdz-00085k-Jy
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:19 +0000
Received: from [85.158.138.51:20821] by server-5.bemta-3.messagelabs.com id
	72/63-00589-E24D4605; Thu, 27 Sep 2012 22:33:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-174.messagelabs.com!1348785197!30472844!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31428 invoked from network); 27 Sep 2012 22:33:18 -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 Sep 2012 22:33: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 1THMdw-0007Hf-Vt
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdw-0003q5-Ub
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:16 +0000
Message-Id: <E1THMdw-0003q5-Ub@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: slightly streamline
	__prepare_to_wait() inline assembly
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348653087 -7200
# Node ID a5e59ccf21f58281e5392e12ab55a202f40bdbce
# Parent  d49e0c5ffe8ada4db156ac53ad8bc6adee077c7d
x86: slightly streamline __prepare_to_wait() inline assembly

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


diff -r d49e0c5ffe8a -r a5e59ccf21f5 xen/common/wait.c
--- a/xen/common/wait.c	Wed Sep 26 11:49:56 2012 +0200
+++ b/xen/common/wait.c	Wed Sep 26 11:51:27 2012 +0200
@@ -143,15 +143,13 @@ static void __prepare_to_wait(struct wai
         "push %%rax; push %%rbx; push %%rdx; "
         "push %%rbp; push %%r8; push %%r9; push %%r10; push %%r11; "
         "push %%r12; push %%r13; push %%r14; push %%r15; call 1f; "
-        "1: mov %%rsp,%%rsi; addq $2f-1b,(%%rsp); "
-        "sub %%rsi,%%rcx; cmp %3,%%rcx; jbe 2f; "
-        "xor %%esi,%%esi; jmp 3f; "
-        "2: rep movsb; mov %%rsp,%%rsi; 3: pop %%rax; "
+        "1: addq $2f-1b,(%%rsp); sub %%esp,%%ecx; cmp %3,%%ecx; jbe 3f; "
+        "mov %%rsp,%%rsi; 2: rep movsb; mov %%rsp,%%rsi; 3: pop %%rax; "
         "pop %%r15; pop %%r14; pop %%r13; pop %%r12; "
         "pop %%r11; pop %%r10; pop %%r9; pop %%r8; "
         "pop %%rbp; pop %%rdx; pop %%rbx; pop %%rax"
         : "=&S" (wqv->esp), "=&c" (dummy), "=&D" (dummy)
-        : "i" (PAGE_SIZE), "1" (cpu_info), "2" (wqv->stack)
+        : "i" (PAGE_SIZE), "0" (0), "1" (cpu_info), "2" (wqv->stack)
         : "memory" );
 
     if ( unlikely(wqv->esp == 0) )

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMe2-0008B6-0t; Thu, 27 Sep 2012 22:33:22 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMe0-00081M-12
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:20 +0000
Received: from [85.158.143.99:30801] by server-3.bemta-4.messagelabs.com id
	47/60-10986-F24D4605; Thu, 27 Sep 2012 22:33:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-216.messagelabs.com!1348785198!31145192!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14065 invoked from network); 27 Sep 2012 22:33:19 -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 Sep 2012 22:33: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 1THMdy-0007Hl-1b
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdy-0003qZ-0Q
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:18 +0000
Message-Id: <E1THMdy-0003qZ-0Q@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: slightly improve stack trace on
	debug builds
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348653218 -7200
# Node ID b83f414ccf7a6e4e077a10bc422cf3f6c7d30566
# Parent  4876f914a8a08773597cbe2b567808a91494af8f
x86: slightly improve stack trace on debug builds

As was rather obvious from crashes recently happening in stage testing,
the debug hypervisor, in that special case, has a drawback compared to
the non-debug one: When a call through a bad pointer happens, there's
no frame, and the top level (and frequently most important for
analysis) stack entry would get skipped:

(XEN) ----[ Xen-4.3-unstable  x86_64  debug=y  Not tainted ]----
(XEN) CPU:    1
(XEN) RIP:    e008:[<0000000000000000>] ???
(XEN) RFLAGS: 0000000000010046   CONTEXT: hypervisor
(XEN) rax: 0000000000000008   rbx: 0000000000000001   rcx: 0000000000000003
(XEN) rdx: 0000003db54eb700   rsi: 7fffffffffffffff   rdi: 0000000000000001
(XEN) rbp: ffff8302357e7ee0   rsp: ffff8302357e7e58   r8:  0000000000000000
(XEN) r9:  000000000000003e   r10: ffff8302357e7f18   r11: ffff8302357e7f18
(XEN) r12: ffff8302357ee340   r13: ffff82c480263980   r14: ffff8302357ee3d0
(XEN) r15: 0000000000000001   cr0: 000000008005003b   cr4: 00000000000026f0
(XEN) cr3: 00000000bf473000   cr2: 0000000000000000
(XEN) ds: 0000   es: 0000   fs: 0000   gs: 0000   ss: 0000   cs: e008
(XEN) Xen stack trace from rsp=ffff8302357e7e58:
(XEN)    ffff82c4801a3d05 ffff8302357eca70 0000000800000020 ffff82c4802ead60
(XEN)    0000000000000001 ffff8302357e7ea0 ffff82c48016bf07 0000000000000000
(XEN)    0000000000000000 ffff8302357e7ee0 fffff830fffff830 0000000000000046
(XEN)    ffff8302357e7f18 ffff82c480263980 ffff8302357e7f18 0000000000000000
(XEN)    0000000000000000 ffff8302357e7f10 ffff82c48015c2be 8302357dc0000fff
...
(XEN) Xen call trace:
(XEN)    [<0000000000000000>] ???
(XEN)    [<ffff82c48015c2be>] idle_loop+0x6c/0x7a
(XEN)
(XEN) Pagetable walk from 0000000000000000:

Since the bad pointer is being printed anyway (as part of the register
state), replace it with the top of stack value in such a case.

With the introduction of is_active_kernel_text(), use it also at the
(few) other suitable places (I intentionally didn't replace the use in
xen/arch/arm/mm.c - while it would be functionally correct, the
dependency on system_state wouldn't be from an abstract perspective).

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


diff -r 4876f914a8a0 -r b83f414ccf7a xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c	Wed Sep 26 11:52:03 2012 +0200
+++ b/xen/arch/x86/traps.c	Wed Sep 26 11:53:38 2012 +0200
@@ -199,7 +199,7 @@ static void show_trace(struct cpu_user_r
     while ( ((long)stack & (STACK_SIZE-BYTES_PER_LONG)) != 0 )
     {
         addr = *stack++;
-        if ( is_kernel_text(addr) || is_kernel_inittext(addr) )
+        if ( is_active_kernel_text(addr) )
         {
             printk("[<%p>]", _p(addr));
             print_symbol(" %s\n   ", addr);
@@ -217,8 +217,16 @@ static void show_trace(struct cpu_user_r
 
     printk("Xen call trace:\n   ");
 
-    printk("[<%p>]", _p(regs->eip));
-    print_symbol(" %s\n   ", regs->eip);
+    /*
+     * If RIP is not pointing into hypervisor code then someone may have
+     * called into oblivion. Peek to see if they left a return address at
+     * top of stack.
+     */
+    addr = is_active_kernel_text(regs->eip) ||
+           !is_active_kernel_text(*ESP_BEFORE_EXCEPTION(regs)) ?
+           regs->eip : *ESP_BEFORE_EXCEPTION(regs);
+    printk("[<%p>]", _p(addr));
+    print_symbol(" %s\n   ", addr);
 
     /* Bounds for range of valid frame pointer. */
     low  = (unsigned long)(ESP_BEFORE_EXCEPTION(regs) - 2);
@@ -322,7 +330,7 @@ void show_stack_overflow(unsigned int cp
     while ( ((long)stack & (STACK_SIZE-BYTES_PER_LONG)) != 0 )
     {
         addr = *stack++;
-        if ( is_kernel_text(addr) || is_kernel_inittext(addr) )
+        if ( is_active_kernel_text(addr) )
         {
             printk("%p: [<%p>]", stack, _p(addr));
             print_symbol(" %s\n   ", addr);
diff -r 4876f914a8a0 -r b83f414ccf7a xen/common/symbols.c
--- a/xen/common/symbols.c	Wed Sep 26 11:52:03 2012 +0200
+++ b/xen/common/symbols.c	Wed Sep 26 11:53:38 2012 +0200
@@ -93,6 +93,12 @@ static unsigned int get_symbol_offset(un
     return name - symbols_names;
 }
 
+bool_t is_active_kernel_text(unsigned long addr)
+{
+    return (is_kernel_text(addr) ||
+            (system_state == SYS_STATE_boot && is_kernel_inittext(addr)));
+}
+
 const char *symbols_lookup(unsigned long addr,
                            unsigned long *symbolsize,
                            unsigned long *offset,
@@ -104,7 +110,7 @@ const char *symbols_lookup(unsigned long
     namebuf[KSYM_NAME_LEN] = 0;
     namebuf[0] = 0;
 
-    if (!is_kernel_text(addr) && !is_kernel_inittext(addr))
+    if (!is_active_kernel_text(addr))
         return NULL;
 
         /* do a binary search on the sorted symbols_addresses array */
diff -r 4876f914a8a0 -r b83f414ccf7a xen/include/xen/kernel.h
--- a/xen/include/xen/kernel.h	Wed Sep 26 11:52:03 2012 +0200
+++ b/xen/include/xen/kernel.h	Wed Sep 26 11:53:38 2012 +0200
@@ -5,6 +5,8 @@
  * 'kernel.h' contains some often-used function prototypes etc
  */
 
+#include <xen/types.h>
+
 /*
  * min()/max() macros that also do
  * strict type-checking.. See the
@@ -95,5 +97,7 @@ extern enum system_state {
     SYS_STATE_resume
 } system_state;
 
+bool_t is_active_kernel_text(unsigned long addr);
+
 #endif /* _LINUX_KERNEL_H */
 

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMe1-0008Av-SP; Thu, 27 Sep 2012 22:33:21 +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 1THMdz-00085k-Jy
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:19 +0000
Received: from [85.158.138.51:20821] by server-5.bemta-3.messagelabs.com id
	72/63-00589-E24D4605; Thu, 27 Sep 2012 22:33:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-174.messagelabs.com!1348785197!30472844!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31428 invoked from network); 27 Sep 2012 22:33:18 -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 Sep 2012 22:33: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 1THMdw-0007Hf-Vt
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdw-0003q5-Ub
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:16 +0000
Message-Id: <E1THMdw-0003q5-Ub@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: slightly streamline
	__prepare_to_wait() inline assembly
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348653087 -7200
# Node ID a5e59ccf21f58281e5392e12ab55a202f40bdbce
# Parent  d49e0c5ffe8ada4db156ac53ad8bc6adee077c7d
x86: slightly streamline __prepare_to_wait() inline assembly

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


diff -r d49e0c5ffe8a -r a5e59ccf21f5 xen/common/wait.c
--- a/xen/common/wait.c	Wed Sep 26 11:49:56 2012 +0200
+++ b/xen/common/wait.c	Wed Sep 26 11:51:27 2012 +0200
@@ -143,15 +143,13 @@ static void __prepare_to_wait(struct wai
         "push %%rax; push %%rbx; push %%rdx; "
         "push %%rbp; push %%r8; push %%r9; push %%r10; push %%r11; "
         "push %%r12; push %%r13; push %%r14; push %%r15; call 1f; "
-        "1: mov %%rsp,%%rsi; addq $2f-1b,(%%rsp); "
-        "sub %%rsi,%%rcx; cmp %3,%%rcx; jbe 2f; "
-        "xor %%esi,%%esi; jmp 3f; "
-        "2: rep movsb; mov %%rsp,%%rsi; 3: pop %%rax; "
+        "1: addq $2f-1b,(%%rsp); sub %%esp,%%ecx; cmp %3,%%ecx; jbe 3f; "
+        "mov %%rsp,%%rsi; 2: rep movsb; mov %%rsp,%%rsi; 3: pop %%rax; "
         "pop %%r15; pop %%r14; pop %%r13; pop %%r12; "
         "pop %%r11; pop %%r10; pop %%r9; pop %%r8; "
         "pop %%rbp; pop %%rdx; pop %%rbx; pop %%rax"
         : "=&S" (wqv->esp), "=&c" (dummy), "=&D" (dummy)
-        : "i" (PAGE_SIZE), "1" (cpu_info), "2" (wqv->stack)
+        : "i" (PAGE_SIZE), "0" (0), "1" (cpu_info), "2" (wqv->stack)
         : "memory" );
 
     if ( unlikely(wqv->esp == 0) )

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMe3-0008DP-B0; Thu, 27 Sep 2012 22:33:23 +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 1THMe1-00085k-Vj
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:22 +0000
Received: from [85.158.137.99:34793] by server-5.bemta-3.messagelabs.com id
	D6/63-00589-134D4605; Thu, 27 Sep 2012 22:33:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-217.messagelabs.com!1348785199!18222017!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6255 invoked from network); 27 Sep 2012 22:33:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Sep 2012 22:33: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 1THMdz-0007Hu-P8
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdz-0003rI-KS
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:19 +0000
Message-Id: <E1THMdz-0003rI-KS@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: vMCE injection
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Liu, Jinsong <jinsong.liu@intel.com>
# Date 1348653910 -7200
# Node ID 8f8fabafec86bd0e5ba65a0c2ea28027eb1278eb
# Parent  08b7e65a5d936bb766f076dde2d026569ad60e4c
x86: vMCE injection

In our test for win8 guest mce, we find a bug that no matter what
SRAO/SRAR error xen inject to win8 guest, it always reboot.

The root cause is, current Xen vMCE logic inject vMCE# only to vcpu0,
this is not correct for Intel MCE (Under Intel arch, h/w generate MCE#
to all CPUs).

This patch fixes vMCE injection bug, injecting vMCE# to all vcpus on
Intel platforms.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>

- increase flexibility be making new second argument of inject_vmce() a
  VCPU ID rather than just a boolean

Acked-by: Christoph Egger <Christoph.Egger@amd.com> (on just this change)

- fix condition evaluation order in inject_vmce()

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


diff -r 08b7e65a5d93 -r 8f8fabafec86 xen/arch/x86/cpu/mcheck/mce.h
--- a/xen/arch/x86/cpu/mcheck/mce.h	Wed Sep 26 12:04:00 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/mce.h	Wed Sep 26 12:05:10 2012 +0200
@@ -168,7 +168,7 @@ void x86_mcinfo_dump(struct mc_info *mi)
 
 int fill_vmsr_data(struct mcinfo_bank *mc_bank, struct domain *d,
     uint64_t gstatus);
-int inject_vmce(struct domain *d);
+int inject_vmce(struct domain *d, int vcpu);
 
 static inline int mce_vendor_bank_msr(const struct vcpu *v, uint32_t msr)
 {
diff -r 08b7e65a5d93 -r 8f8fabafec86 xen/arch/x86/cpu/mcheck/mce_intel.c
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c	Wed Sep 26 12:04:00 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c	Wed Sep 26 12:05:10 2012 +0200
@@ -359,7 +359,7 @@ static void intel_memerr_dhandler(
                 }
 
                 /* We will inject vMCE to DOMU*/
-                if ( inject_vmce(d) < 0 )
+                if ( inject_vmce(d, -1) < 0 )
                 {
                     mce_printk(MCE_QUIET, "inject vMCE to DOM%d"
                       " failed\n", d->domain_id);
diff -r 08b7e65a5d93 -r 8f8fabafec86 xen/arch/x86/cpu/mcheck/vmce.c
--- a/xen/arch/x86/cpu/mcheck/vmce.c	Wed Sep 26 12:04:00 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/vmce.c	Wed Sep 26 12:05:10 2012 +0200
@@ -324,51 +324,39 @@ static int vmce_load_vcpu_ctxt(struct do
 HVM_REGISTER_SAVE_RESTORE(VMCE_VCPU, vmce_save_vcpu_ctxt,
                           vmce_load_vcpu_ctxt, 1, HVMSR_PER_VCPU);
 
-int inject_vmce(struct domain *d)
+/*
+ * for Intel MCE, broadcast vMCE to all vcpus
+ * for AMD MCE, only inject vMCE to vcpu0
+ */
+int inject_vmce(struct domain *d, int vcpu)
 {
-    int cpu = smp_processor_id();
+    struct vcpu *v;
 
-    /* PV guest and HVM guest have different vMCE# injection methods. */
-    if ( !test_and_set_bool(d->vcpu[0]->mce_pending) )
+    for_each_vcpu ( d, v )
     {
-        if ( d->is_hvm )
+        if ( vcpu >= 0 && v->vcpu_id != vcpu )
+            continue;
+
+        if ( (is_hvm_domain(d) ||
+              guest_has_trap_callback(d, v->vcpu_id, TRAP_machine_check)) &&
+             !test_and_set_bool(v->mce_pending) )
         {
-            mce_printk(MCE_VERBOSE, "MCE: inject vMCE to HVM DOM %d\n",
-                       d->domain_id);
-            vcpu_kick(d->vcpu[0]);
+            mce_printk(MCE_VERBOSE, "MCE: inject vMCE to d%d:v%d\n",
+                       d->domain_id, v->vcpu_id);
+            vcpu_kick(v);
         }
         else
         {
-            mce_printk(MCE_VERBOSE, "MCE: inject vMCE to PV DOM%d\n",
-                       d->domain_id);
-            if ( guest_has_trap_callback(d, 0, TRAP_machine_check) )
-            {
-                cpumask_copy(d->vcpu[0]->cpu_affinity_tmp,
-                             d->vcpu[0]->cpu_affinity);
-                mce_printk(MCE_VERBOSE, "MCE: CPU%d set affinity, old %d\n",
-                           cpu, d->vcpu[0]->processor);
-                vcpu_set_affinity(d->vcpu[0], cpumask_of(cpu));
-                vcpu_kick(d->vcpu[0]);
-            }
-            else
-            {
-                mce_printk(MCE_VERBOSE,
-                           "MCE: Kill PV guest with No MCE handler\n");
-                domain_crash(d);
-            }
+            mce_printk(MCE_QUIET, "Failed to inject vMCE to d%d:v%d\n",
+                       d->domain_id, v->vcpu_id);
+            return -EBUSY;
         }
+
+        if ( vcpu >= 0 )
+            return 0;
     }
-    else
-    {
-        /* new vMCE comes while first one has not been injected yet,
-         * in this case, inject fail. [We can't lose this vMCE for
-         * the mce node's consistency].
-         */
-        mce_printk(MCE_QUIET, "There's a pending vMCE waiting to be injected "
-                   " to this DOM%d!\n", d->domain_id);
-        return -1;
-    }
-    return 0;
+
+    return v ? -ESRCH : 0;
 }
 
 int fill_vmsr_data(struct mcinfo_bank *mc_bank, struct domain *d,

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMe3-0008DP-B0; Thu, 27 Sep 2012 22:33:23 +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 1THMe1-00085k-Vj
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:22 +0000
Received: from [85.158.137.99:34793] by server-5.bemta-3.messagelabs.com id
	D6/63-00589-134D4605; Thu, 27 Sep 2012 22:33:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-217.messagelabs.com!1348785199!18222017!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6255 invoked from network); 27 Sep 2012 22:33:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Sep 2012 22:33: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 1THMdz-0007Hu-P8
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdz-0003rI-KS
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:19 +0000
Message-Id: <E1THMdz-0003rI-KS@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: vMCE injection
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Liu, Jinsong <jinsong.liu@intel.com>
# Date 1348653910 -7200
# Node ID 8f8fabafec86bd0e5ba65a0c2ea28027eb1278eb
# Parent  08b7e65a5d936bb766f076dde2d026569ad60e4c
x86: vMCE injection

In our test for win8 guest mce, we find a bug that no matter what
SRAO/SRAR error xen inject to win8 guest, it always reboot.

The root cause is, current Xen vMCE logic inject vMCE# only to vcpu0,
this is not correct for Intel MCE (Under Intel arch, h/w generate MCE#
to all CPUs).

This patch fixes vMCE injection bug, injecting vMCE# to all vcpus on
Intel platforms.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>

- increase flexibility be making new second argument of inject_vmce() a
  VCPU ID rather than just a boolean

Acked-by: Christoph Egger <Christoph.Egger@amd.com> (on just this change)

- fix condition evaluation order in inject_vmce()

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


diff -r 08b7e65a5d93 -r 8f8fabafec86 xen/arch/x86/cpu/mcheck/mce.h
--- a/xen/arch/x86/cpu/mcheck/mce.h	Wed Sep 26 12:04:00 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/mce.h	Wed Sep 26 12:05:10 2012 +0200
@@ -168,7 +168,7 @@ void x86_mcinfo_dump(struct mc_info *mi)
 
 int fill_vmsr_data(struct mcinfo_bank *mc_bank, struct domain *d,
     uint64_t gstatus);
-int inject_vmce(struct domain *d);
+int inject_vmce(struct domain *d, int vcpu);
 
 static inline int mce_vendor_bank_msr(const struct vcpu *v, uint32_t msr)
 {
diff -r 08b7e65a5d93 -r 8f8fabafec86 xen/arch/x86/cpu/mcheck/mce_intel.c
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c	Wed Sep 26 12:04:00 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c	Wed Sep 26 12:05:10 2012 +0200
@@ -359,7 +359,7 @@ static void intel_memerr_dhandler(
                 }
 
                 /* We will inject vMCE to DOMU*/
-                if ( inject_vmce(d) < 0 )
+                if ( inject_vmce(d, -1) < 0 )
                 {
                     mce_printk(MCE_QUIET, "inject vMCE to DOM%d"
                       " failed\n", d->domain_id);
diff -r 08b7e65a5d93 -r 8f8fabafec86 xen/arch/x86/cpu/mcheck/vmce.c
--- a/xen/arch/x86/cpu/mcheck/vmce.c	Wed Sep 26 12:04:00 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/vmce.c	Wed Sep 26 12:05:10 2012 +0200
@@ -324,51 +324,39 @@ static int vmce_load_vcpu_ctxt(struct do
 HVM_REGISTER_SAVE_RESTORE(VMCE_VCPU, vmce_save_vcpu_ctxt,
                           vmce_load_vcpu_ctxt, 1, HVMSR_PER_VCPU);
 
-int inject_vmce(struct domain *d)
+/*
+ * for Intel MCE, broadcast vMCE to all vcpus
+ * for AMD MCE, only inject vMCE to vcpu0
+ */
+int inject_vmce(struct domain *d, int vcpu)
 {
-    int cpu = smp_processor_id();
+    struct vcpu *v;
 
-    /* PV guest and HVM guest have different vMCE# injection methods. */
-    if ( !test_and_set_bool(d->vcpu[0]->mce_pending) )
+    for_each_vcpu ( d, v )
     {
-        if ( d->is_hvm )
+        if ( vcpu >= 0 && v->vcpu_id != vcpu )
+            continue;
+
+        if ( (is_hvm_domain(d) ||
+              guest_has_trap_callback(d, v->vcpu_id, TRAP_machine_check)) &&
+             !test_and_set_bool(v->mce_pending) )
         {
-            mce_printk(MCE_VERBOSE, "MCE: inject vMCE to HVM DOM %d\n",
-                       d->domain_id);
-            vcpu_kick(d->vcpu[0]);
+            mce_printk(MCE_VERBOSE, "MCE: inject vMCE to d%d:v%d\n",
+                       d->domain_id, v->vcpu_id);
+            vcpu_kick(v);
         }
         else
         {
-            mce_printk(MCE_VERBOSE, "MCE: inject vMCE to PV DOM%d\n",
-                       d->domain_id);
-            if ( guest_has_trap_callback(d, 0, TRAP_machine_check) )
-            {
-                cpumask_copy(d->vcpu[0]->cpu_affinity_tmp,
-                             d->vcpu[0]->cpu_affinity);
-                mce_printk(MCE_VERBOSE, "MCE: CPU%d set affinity, old %d\n",
-                           cpu, d->vcpu[0]->processor);
-                vcpu_set_affinity(d->vcpu[0], cpumask_of(cpu));
-                vcpu_kick(d->vcpu[0]);
-            }
-            else
-            {
-                mce_printk(MCE_VERBOSE,
-                           "MCE: Kill PV guest with No MCE handler\n");
-                domain_crash(d);
-            }
+            mce_printk(MCE_QUIET, "Failed to inject vMCE to d%d:v%d\n",
+                       d->domain_id, v->vcpu_id);
+            return -EBUSY;
         }
+
+        if ( vcpu >= 0 )
+            return 0;
     }
-    else
-    {
-        /* new vMCE comes while first one has not been injected yet,
-         * in this case, inject fail. [We can't lose this vMCE for
-         * the mce node's consistency].
-         */
-        mce_printk(MCE_QUIET, "There's a pending vMCE waiting to be injected "
-                   " to this DOM%d!\n", d->domain_id);
-        return -1;
-    }
-    return 0;
+
+    return v ? -ESRCH : 0;
 }
 
 int fill_vmsr_data(struct mcinfo_bank *mc_bank, struct domain *d,

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMe4-0008Er-JV; Thu, 27 Sep 2012 22:33:24 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMe3-0008Cn-5j
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:23 +0000
Received: from [85.158.139.83:23968] by server-6.bemta-5.messagelabs.com id
	88/69-14717-234D4605; Thu, 27 Sep 2012 22:33:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-182.messagelabs.com!1348785200!25116807!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4816 invoked from network); 27 Sep 2012 22:33: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;
	27 Sep 2012 22:33: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 1THMe0-0007Hx-7G
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMe0-0003rX-61
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:20 +0000
Message-Id: <E1THMe0-0003rX-61@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: vMCE save and restore
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Liu, Jinsong <jinsong.liu@intel.com>
# Date 1348653955 -7200
# Node ID 07d0d5b3a0054d2534f09bcf90437678df2bfc54
# Parent  8f8fabafec86bd0e5ba65a0c2ea28027eb1278eb
x86: vMCE save and restore

This patch provides vMCE save/restore when migration.
1. MCG_CAP is well-defined. However, considering future cap extension,
   we keep save/restore logic that Jan implement at c/s 24887;
2. MCi_CTL2 initialized by guestos when booting, so need save/restore
   otherwise guest would surprise;
3. Other MSRs do not need save/restore since they are either error-
   related and pointless to save/restore, or, unified among all vMCE
   platform;

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>

- fix handling of partial data in XEN_DOMCTL_set_ext_vcpucontext
- fix adjustment of xen_domctl_ext_vcpucontext

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


diff -r 8f8fabafec86 -r 07d0d5b3a005 tools/misc/xen-hvmctx.c
--- a/tools/misc/xen-hvmctx.c	Wed Sep 26 12:05:10 2012 +0200
+++ b/tools/misc/xen-hvmctx.c	Wed Sep 26 12:05:55 2012 +0200
@@ -388,6 +388,8 @@ static void dump_vmce_vcpu(void)
     HVM_SAVE_TYPE(VMCE_VCPU) p;
     READ(p);
     printf("    VMCE_VCPU: caps %" PRIx64 "\n", p.caps);
+    printf("    VMCE_VCPU: bank0 mci_ctl2 %" PRIx64 "\n", p.mci_ctl2_bank0);
+    printf("    VMCE_VCPU: bank1 mci_ctl2 %" PRIx64 "\n", p.mci_ctl2_bank1);
 }
 
 int main(int argc, char **argv)
diff -r 8f8fabafec86 -r 07d0d5b3a005 xen/arch/x86/cpu/mcheck/vmce.c
--- a/xen/arch/x86/cpu/mcheck/vmce.c	Wed Sep 26 12:05:10 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/vmce.c	Wed Sep 26 12:05:55 2012 +0200
@@ -68,7 +68,7 @@ void vmce_init_vcpu(struct vcpu *v)
     spin_lock_init(&v->arch.vmce.lock);
 }
 
-int vmce_restore_vcpu(struct vcpu *v, uint64_t caps)
+int vmce_restore_vcpu(struct vcpu *v, const struct hvm_vmce_vcpu *ctxt)
 {
     unsigned long guest_mcg_cap;
 
@@ -77,16 +77,20 @@ int vmce_restore_vcpu(struct vcpu *v, ui
     else
         guest_mcg_cap = AMD_GUEST_MCG_CAP;
 
-    if ( caps & ~guest_mcg_cap & ~MCG_CAP_COUNT & ~MCG_CTL_P )
+    if ( ctxt->caps & ~guest_mcg_cap & ~MCG_CAP_COUNT & ~MCG_CTL_P )
     {
         dprintk(XENLOG_G_ERR, "%s restore: unsupported MCA capabilities"
                 " %#" PRIx64 " for d%d:v%u (supported: %#Lx)\n",
-                is_hvm_vcpu(v) ? "HVM" : "PV", caps, v->domain->domain_id,
-                v->vcpu_id, guest_mcg_cap & ~MCG_CAP_COUNT);
+                is_hvm_vcpu(v) ? "HVM" : "PV", ctxt->caps,
+                v->domain->domain_id, v->vcpu_id,
+                guest_mcg_cap & ~MCG_CAP_COUNT);
         return -EPERM;
     }
 
-    v->arch.vmce.mcg_cap = caps;
+    v->arch.vmce.mcg_cap = ctxt->caps;
+    v->arch.vmce.bank[0].mci_ctl2 = ctxt->mci_ctl2_bank0;
+    v->arch.vmce.bank[1].mci_ctl2 = ctxt->mci_ctl2_bank1;
+
     return 0;
 }
 
@@ -291,7 +295,9 @@ static int vmce_save_vcpu_ctxt(struct do
 
     for_each_vcpu( d, v ) {
         struct hvm_vmce_vcpu ctxt = {
-            .caps = v->arch.vmce.mcg_cap
+            .caps = v->arch.vmce.mcg_cap,
+            .mci_ctl2_bank0 = v->arch.vmce.bank[0].mci_ctl2,
+            .mci_ctl2_bank1 = v->arch.vmce.bank[1].mci_ctl2
         };
 
         err = hvm_save_entry(VMCE_VCPU, v->vcpu_id, h, &ctxt);
@@ -316,9 +322,9 @@ static int vmce_load_vcpu_ctxt(struct do
         err = -EINVAL;
     }
     else
-        err = hvm_load_entry(VMCE_VCPU, h, &ctxt);
+        err = hvm_load_entry_zeroextend(VMCE_VCPU, h, &ctxt);
 
-    return err ?: vmce_restore_vcpu(v, ctxt.caps);
+    return err ?: vmce_restore_vcpu(v, &ctxt);
 }
 
 HVM_REGISTER_SAVE_RESTORE(VMCE_VCPU, vmce_save_vcpu_ctxt,
diff -r 8f8fabafec86 -r 07d0d5b3a005 xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Wed Sep 26 12:05:10 2012 +0200
+++ b/xen/arch/x86/domctl.c	Wed Sep 26 12:05:55 2012 +0200
@@ -1066,12 +1066,14 @@ long arch_do_domctl(
                 evc->syscall32_callback_eip    = 0;
                 evc->syscall32_disables_events = 0;
             }
-            evc->mcg_cap = v->arch.vmce.mcg_cap;
+            evc->vmce.caps = v->arch.vmce.mcg_cap;
+            evc->vmce.mci_ctl2_bank0 = v->arch.vmce.bank[0].mci_ctl2;
+            evc->vmce.mci_ctl2_bank1 = v->arch.vmce.bank[1].mci_ctl2;
         }
         else
         {
             ret = -EINVAL;
-            if ( evc->size < offsetof(typeof(*evc), mcg_cap) )
+            if ( evc->size < offsetof(typeof(*evc), vmce) )
                 goto ext_vcpucontext_out;
             if ( !is_hvm_domain(d) )
             {
@@ -1101,9 +1103,21 @@ long arch_do_domctl(
                  evc->syscall32_callback_eip )
                 goto ext_vcpucontext_out;
 
-            if ( evc->size >= offsetof(typeof(*evc), mcg_cap) +
-                              sizeof(evc->mcg_cap) )
-                ret = vmce_restore_vcpu(v, evc->mcg_cap);
+            BUILD_BUG_ON(offsetof(struct xen_domctl_ext_vcpucontext,
+                                  mcg_cap) !=
+                         offsetof(struct xen_domctl_ext_vcpucontext,
+                                  vmce.caps));
+            BUILD_BUG_ON(sizeof(evc->mcg_cap) != sizeof(evc->vmce.caps));
+            if ( evc->size >= offsetof(typeof(*evc), vmce) +
+                              sizeof(evc->vmce) )
+                ret = vmce_restore_vcpu(v, &evc->vmce);
+            else if ( evc->size >= offsetof(typeof(*evc), mcg_cap) +
+                                   sizeof(evc->mcg_cap) )
+            {
+                struct hvm_vmce_vcpu vmce = { .caps = evc->mcg_cap };
+
+                ret = vmce_restore_vcpu(v, &vmce);
+            }
         }
 
         ret = 0;
diff -r 8f8fabafec86 -r 07d0d5b3a005 xen/include/asm-x86/mce.h
--- a/xen/include/asm-x86/mce.h	Wed Sep 26 12:05:10 2012 +0200
+++ b/xen/include/asm-x86/mce.h	Wed Sep 26 12:05:55 2012 +0200
@@ -33,7 +33,7 @@ struct vmce {
 
 /* Guest vMCE MSRs virtualization */
 extern void vmce_init_vcpu(struct vcpu *);
-extern int vmce_restore_vcpu(struct vcpu *, uint64_t caps);
+extern int vmce_restore_vcpu(struct vcpu *, const struct hvm_vmce_vcpu *);
 extern int vmce_wrmsr(uint32_t msr, uint64_t val);
 extern int vmce_rdmsr(uint32_t msr, uint64_t *val);
 
diff -r 8f8fabafec86 -r 07d0d5b3a005 xen/include/public/arch-x86/hvm/save.h
--- a/xen/include/public/arch-x86/hvm/save.h	Wed Sep 26 12:05:10 2012 +0200
+++ b/xen/include/public/arch-x86/hvm/save.h	Wed Sep 26 12:05:55 2012 +0200
@@ -577,6 +577,8 @@ DECLARE_HVM_SAVE_TYPE(VIRIDIAN_VCPU, 17,
 
 struct hvm_vmce_vcpu {
     uint64_t caps;
+    uint64_t mci_ctl2_bank0;
+    uint64_t mci_ctl2_bank1;
 };
 
 DECLARE_HVM_SAVE_TYPE(VMCE_VCPU, 18, struct hvm_vmce_vcpu);
diff -r 8f8fabafec86 -r 07d0d5b3a005 xen/include/public/domctl.h
--- a/xen/include/public/domctl.h	Wed Sep 26 12:05:10 2012 +0200
+++ b/xen/include/public/domctl.h	Wed Sep 26 12:05:55 2012 +0200
@@ -32,6 +32,7 @@
 #error "domctl operations are intended for use by node control tools only"
 #endif
 
+#include <xen/hvm/save.h>
 #include "xen.h"
 #include "grant_table.h"
 
@@ -564,7 +565,14 @@ struct xen_domctl_ext_vcpucontext {
     uint16_t         sysenter_callback_cs;
     uint8_t          syscall32_disables_events;
     uint8_t          sysenter_disables_events;
-    uint64_aligned_t mcg_cap;
+#if defined(__GNUC__)
+    union {
+        uint64_aligned_t mcg_cap;
+        struct hvm_vmce_vcpu vmce;
+    };
+#else
+    struct hvm_vmce_vcpu vmce;
+#endif
 #endif
 };
 typedef struct xen_domctl_ext_vcpucontext xen_domctl_ext_vcpucontext_t;

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMe4-0008Er-JV; Thu, 27 Sep 2012 22:33:24 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMe3-0008Cn-5j
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:23 +0000
Received: from [85.158.139.83:23968] by server-6.bemta-5.messagelabs.com id
	88/69-14717-234D4605; Thu, 27 Sep 2012 22:33:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-182.messagelabs.com!1348785200!25116807!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4816 invoked from network); 27 Sep 2012 22:33: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;
	27 Sep 2012 22:33: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 1THMe0-0007Hx-7G
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMe0-0003rX-61
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:20 +0000
Message-Id: <E1THMe0-0003rX-61@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: vMCE save and restore
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Liu, Jinsong <jinsong.liu@intel.com>
# Date 1348653955 -7200
# Node ID 07d0d5b3a0054d2534f09bcf90437678df2bfc54
# Parent  8f8fabafec86bd0e5ba65a0c2ea28027eb1278eb
x86: vMCE save and restore

This patch provides vMCE save/restore when migration.
1. MCG_CAP is well-defined. However, considering future cap extension,
   we keep save/restore logic that Jan implement at c/s 24887;
2. MCi_CTL2 initialized by guestos when booting, so need save/restore
   otherwise guest would surprise;
3. Other MSRs do not need save/restore since they are either error-
   related and pointless to save/restore, or, unified among all vMCE
   platform;

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>

- fix handling of partial data in XEN_DOMCTL_set_ext_vcpucontext
- fix adjustment of xen_domctl_ext_vcpucontext

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


diff -r 8f8fabafec86 -r 07d0d5b3a005 tools/misc/xen-hvmctx.c
--- a/tools/misc/xen-hvmctx.c	Wed Sep 26 12:05:10 2012 +0200
+++ b/tools/misc/xen-hvmctx.c	Wed Sep 26 12:05:55 2012 +0200
@@ -388,6 +388,8 @@ static void dump_vmce_vcpu(void)
     HVM_SAVE_TYPE(VMCE_VCPU) p;
     READ(p);
     printf("    VMCE_VCPU: caps %" PRIx64 "\n", p.caps);
+    printf("    VMCE_VCPU: bank0 mci_ctl2 %" PRIx64 "\n", p.mci_ctl2_bank0);
+    printf("    VMCE_VCPU: bank1 mci_ctl2 %" PRIx64 "\n", p.mci_ctl2_bank1);
 }
 
 int main(int argc, char **argv)
diff -r 8f8fabafec86 -r 07d0d5b3a005 xen/arch/x86/cpu/mcheck/vmce.c
--- a/xen/arch/x86/cpu/mcheck/vmce.c	Wed Sep 26 12:05:10 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/vmce.c	Wed Sep 26 12:05:55 2012 +0200
@@ -68,7 +68,7 @@ void vmce_init_vcpu(struct vcpu *v)
     spin_lock_init(&v->arch.vmce.lock);
 }
 
-int vmce_restore_vcpu(struct vcpu *v, uint64_t caps)
+int vmce_restore_vcpu(struct vcpu *v, const struct hvm_vmce_vcpu *ctxt)
 {
     unsigned long guest_mcg_cap;
 
@@ -77,16 +77,20 @@ int vmce_restore_vcpu(struct vcpu *v, ui
     else
         guest_mcg_cap = AMD_GUEST_MCG_CAP;
 
-    if ( caps & ~guest_mcg_cap & ~MCG_CAP_COUNT & ~MCG_CTL_P )
+    if ( ctxt->caps & ~guest_mcg_cap & ~MCG_CAP_COUNT & ~MCG_CTL_P )
     {
         dprintk(XENLOG_G_ERR, "%s restore: unsupported MCA capabilities"
                 " %#" PRIx64 " for d%d:v%u (supported: %#Lx)\n",
-                is_hvm_vcpu(v) ? "HVM" : "PV", caps, v->domain->domain_id,
-                v->vcpu_id, guest_mcg_cap & ~MCG_CAP_COUNT);
+                is_hvm_vcpu(v) ? "HVM" : "PV", ctxt->caps,
+                v->domain->domain_id, v->vcpu_id,
+                guest_mcg_cap & ~MCG_CAP_COUNT);
         return -EPERM;
     }
 
-    v->arch.vmce.mcg_cap = caps;
+    v->arch.vmce.mcg_cap = ctxt->caps;
+    v->arch.vmce.bank[0].mci_ctl2 = ctxt->mci_ctl2_bank0;
+    v->arch.vmce.bank[1].mci_ctl2 = ctxt->mci_ctl2_bank1;
+
     return 0;
 }
 
@@ -291,7 +295,9 @@ static int vmce_save_vcpu_ctxt(struct do
 
     for_each_vcpu( d, v ) {
         struct hvm_vmce_vcpu ctxt = {
-            .caps = v->arch.vmce.mcg_cap
+            .caps = v->arch.vmce.mcg_cap,
+            .mci_ctl2_bank0 = v->arch.vmce.bank[0].mci_ctl2,
+            .mci_ctl2_bank1 = v->arch.vmce.bank[1].mci_ctl2
         };
 
         err = hvm_save_entry(VMCE_VCPU, v->vcpu_id, h, &ctxt);
@@ -316,9 +322,9 @@ static int vmce_load_vcpu_ctxt(struct do
         err = -EINVAL;
     }
     else
-        err = hvm_load_entry(VMCE_VCPU, h, &ctxt);
+        err = hvm_load_entry_zeroextend(VMCE_VCPU, h, &ctxt);
 
-    return err ?: vmce_restore_vcpu(v, ctxt.caps);
+    return err ?: vmce_restore_vcpu(v, &ctxt);
 }
 
 HVM_REGISTER_SAVE_RESTORE(VMCE_VCPU, vmce_save_vcpu_ctxt,
diff -r 8f8fabafec86 -r 07d0d5b3a005 xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Wed Sep 26 12:05:10 2012 +0200
+++ b/xen/arch/x86/domctl.c	Wed Sep 26 12:05:55 2012 +0200
@@ -1066,12 +1066,14 @@ long arch_do_domctl(
                 evc->syscall32_callback_eip    = 0;
                 evc->syscall32_disables_events = 0;
             }
-            evc->mcg_cap = v->arch.vmce.mcg_cap;
+            evc->vmce.caps = v->arch.vmce.mcg_cap;
+            evc->vmce.mci_ctl2_bank0 = v->arch.vmce.bank[0].mci_ctl2;
+            evc->vmce.mci_ctl2_bank1 = v->arch.vmce.bank[1].mci_ctl2;
         }
         else
         {
             ret = -EINVAL;
-            if ( evc->size < offsetof(typeof(*evc), mcg_cap) )
+            if ( evc->size < offsetof(typeof(*evc), vmce) )
                 goto ext_vcpucontext_out;
             if ( !is_hvm_domain(d) )
             {
@@ -1101,9 +1103,21 @@ long arch_do_domctl(
                  evc->syscall32_callback_eip )
                 goto ext_vcpucontext_out;
 
-            if ( evc->size >= offsetof(typeof(*evc), mcg_cap) +
-                              sizeof(evc->mcg_cap) )
-                ret = vmce_restore_vcpu(v, evc->mcg_cap);
+            BUILD_BUG_ON(offsetof(struct xen_domctl_ext_vcpucontext,
+                                  mcg_cap) !=
+                         offsetof(struct xen_domctl_ext_vcpucontext,
+                                  vmce.caps));
+            BUILD_BUG_ON(sizeof(evc->mcg_cap) != sizeof(evc->vmce.caps));
+            if ( evc->size >= offsetof(typeof(*evc), vmce) +
+                              sizeof(evc->vmce) )
+                ret = vmce_restore_vcpu(v, &evc->vmce);
+            else if ( evc->size >= offsetof(typeof(*evc), mcg_cap) +
+                                   sizeof(evc->mcg_cap) )
+            {
+                struct hvm_vmce_vcpu vmce = { .caps = evc->mcg_cap };
+
+                ret = vmce_restore_vcpu(v, &vmce);
+            }
         }
 
         ret = 0;
diff -r 8f8fabafec86 -r 07d0d5b3a005 xen/include/asm-x86/mce.h
--- a/xen/include/asm-x86/mce.h	Wed Sep 26 12:05:10 2012 +0200
+++ b/xen/include/asm-x86/mce.h	Wed Sep 26 12:05:55 2012 +0200
@@ -33,7 +33,7 @@ struct vmce {
 
 /* Guest vMCE MSRs virtualization */
 extern void vmce_init_vcpu(struct vcpu *);
-extern int vmce_restore_vcpu(struct vcpu *, uint64_t caps);
+extern int vmce_restore_vcpu(struct vcpu *, const struct hvm_vmce_vcpu *);
 extern int vmce_wrmsr(uint32_t msr, uint64_t val);
 extern int vmce_rdmsr(uint32_t msr, uint64_t *val);
 
diff -r 8f8fabafec86 -r 07d0d5b3a005 xen/include/public/arch-x86/hvm/save.h
--- a/xen/include/public/arch-x86/hvm/save.h	Wed Sep 26 12:05:10 2012 +0200
+++ b/xen/include/public/arch-x86/hvm/save.h	Wed Sep 26 12:05:55 2012 +0200
@@ -577,6 +577,8 @@ DECLARE_HVM_SAVE_TYPE(VIRIDIAN_VCPU, 17,
 
 struct hvm_vmce_vcpu {
     uint64_t caps;
+    uint64_t mci_ctl2_bank0;
+    uint64_t mci_ctl2_bank1;
 };
 
 DECLARE_HVM_SAVE_TYPE(VMCE_VCPU, 18, struct hvm_vmce_vcpu);
diff -r 8f8fabafec86 -r 07d0d5b3a005 xen/include/public/domctl.h
--- a/xen/include/public/domctl.h	Wed Sep 26 12:05:10 2012 +0200
+++ b/xen/include/public/domctl.h	Wed Sep 26 12:05:55 2012 +0200
@@ -32,6 +32,7 @@
 #error "domctl operations are intended for use by node control tools only"
 #endif
 
+#include <xen/hvm/save.h>
 #include "xen.h"
 #include "grant_table.h"
 
@@ -564,7 +565,14 @@ struct xen_domctl_ext_vcpucontext {
     uint16_t         sysenter_callback_cs;
     uint8_t          syscall32_disables_events;
     uint8_t          sysenter_disables_events;
-    uint64_aligned_t mcg_cap;
+#if defined(__GNUC__)
+    union {
+        uint64_aligned_t mcg_cap;
+        struct hvm_vmce_vcpu vmce;
+    };
+#else
+    struct hvm_vmce_vcpu vmce;
+#endif
 #endif
 };
 typedef struct xen_domctl_ext_vcpucontext xen_domctl_ext_vcpucontext_t;

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMe4-0008Ej-GC; Thu, 27 Sep 2012 22:33:24 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMe3-00081M-4y
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:23 +0000
Received: from [85.158.143.35:19345] by server-3.bemta-4.messagelabs.com id
	8E/60-10986-234D4605; Thu, 27 Sep 2012 22:33:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-21.messagelabs.com!1348785200!13366335!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13076 invoked from network); 27 Sep 2012 22:33:21 -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;
	27 Sep 2012 22:33: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 1THMe0-0007I0-OV
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMe0-0003rm-NI
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:20 +0000
Message-Id: <E1THMe0-0003rm-NI@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/vMCE: Add AMD support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Christoph Egger <Christoph.Egger@amd.com>
# Date 1348654062 -7200
# Node ID 5d63c633a60b9a1d695594f9c17cf933240bec81
# Parent  07d0d5b3a0054d2534f09bcf90437678df2bfc54
x86/vMCE: Add AMD support

Add vMCE support for AMD. Add vmce namespace to Intel specific vMCE MSR
functions. Move vMCE prototypes from mce.h to vmce.h.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>

- fix inverted return values from vmce_amd_{rd,wr}msr()
- remove bogus printk()-s from those functions

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


diff -r 07d0d5b3a005 -r 5d63c633a60b xen/arch/x86/cpu/mcheck/amd_f10.c
--- a/xen/arch/x86/cpu/mcheck/amd_f10.c	Wed Sep 26 12:05:55 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/amd_f10.c	Wed Sep 26 12:07:42 2012 +0200
@@ -104,3 +104,28 @@ enum mcheck_type amd_f10_mcheck_init(str
 
 	return mcheck_amd_famXX;
 }
+
+/* amd specific MCA MSR */
+int vmce_amd_wrmsr(struct vcpu *v, uint32_t msr, uint64_t val)
+{
+        switch (msr) {
+        case MSR_F10_MC4_MISC1:
+        case MSR_F10_MC4_MISC2:
+        case MSR_F10_MC4_MISC3:
+                break;
+        }
+
+        return 1;
+}
+
+int vmce_amd_rdmsr(const struct vcpu *v, uint32_t msr, uint64_t *val)
+{
+        switch (msr) {
+        case MSR_F10_MC4_MISC1:
+        case MSR_F10_MC4_MISC2:
+        case MSR_F10_MC4_MISC3:
+                break;
+        }
+
+        return 1;
+}
diff -r 07d0d5b3a005 -r 5d63c633a60b xen/arch/x86/cpu/mcheck/amd_nonfatal.c
--- a/xen/arch/x86/cpu/mcheck/amd_nonfatal.c	Wed Sep 26 12:05:55 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/amd_nonfatal.c	Wed Sep 26 12:07:42 2012 +0200
@@ -64,6 +64,7 @@
 #include <asm/msr.h>
 
 #include "mce.h"
+#include "vmce.h"
 
 static struct timer mce_timer;
 
diff -r 07d0d5b3a005 -r 5d63c633a60b xen/arch/x86/cpu/mcheck/mce.c
--- a/xen/arch/x86/cpu/mcheck/mce.c	Wed Sep 26 12:05:55 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/mce.c	Wed Sep 26 12:07:42 2012 +0200
@@ -25,6 +25,7 @@
 #include "mce.h"
 #include "barrier.h"
 #include "util.h"
+#include "vmce.h"
 
 bool_t __read_mostly mce_disabled;
 invbool_param("mce", mce_disabled);
diff -r 07d0d5b3a005 -r 5d63c633a60b xen/arch/x86/cpu/mcheck/mce.h
--- a/xen/arch/x86/cpu/mcheck/mce.h	Wed Sep 26 12:05:55 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/mce.h	Wed Sep 26 12:07:42 2012 +0200
@@ -49,15 +49,9 @@ void intel_mcheck_timer(struct cpuinfo_x
 void mce_intel_feature_init(struct cpuinfo_x86 *c);
 void amd_nonfatal_mcheck_init(struct cpuinfo_x86 *c);
 
-int is_vmce_ready(struct mcinfo_bank *bank, struct domain *d);
-int unmmap_broken_page(struct domain *d, mfn_t mfn, unsigned long gfn);
-
-u64 mce_cap_init(void);
+uint64_t mce_cap_init(void);
 extern unsigned int firstbank;
 
-int intel_mce_rdmsr(const struct vcpu *, uint32_t msr, uint64_t *val);
-int intel_mce_wrmsr(struct vcpu *, uint32_t msr, uint64_t val);
-
 struct mcinfo_extended *intel_get_extended_msrs(
     struct mcinfo_global *mig, struct mc_info *mi);
 
@@ -69,9 +63,6 @@ void mc_panic(char *s);
 void x86_mc_get_cpu_info(unsigned, uint32_t *, uint16_t *, uint16_t *,
 			 uint32_t *, uint32_t *, uint32_t *, uint32_t *);
 
-#define dom0_vmce_enabled() (dom0 && dom0->max_vcpus && dom0->vcpu[0] \
-	&& guest_enabled_event(dom0->vcpu[0], VIRQ_MCA))
-
 /* Register a handler for machine check exceptions. */
 typedef void (*x86_mce_vector_t)(struct cpu_user_regs *, long);
 extern void x86_mce_vector_register(x86_mce_vector_t);
@@ -166,10 +157,6 @@ void *x86_mcinfo_add(struct mc_info *mi,
 void *x86_mcinfo_reserve(struct mc_info *mi, int size);
 void x86_mcinfo_dump(struct mc_info *mi);
 
-int fill_vmsr_data(struct mcinfo_bank *mc_bank, struct domain *d,
-    uint64_t gstatus);
-int inject_vmce(struct domain *d, int vcpu);
-
 static inline int mce_vendor_bank_msr(const struct vcpu *v, uint32_t msr)
 {
     switch (boot_cpu_data.x86_vendor) {
diff -r 07d0d5b3a005 -r 5d63c633a60b xen/arch/x86/cpu/mcheck/mce_intel.c
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c	Wed Sep 26 12:05:55 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c	Wed Sep 26 12:07:42 2012 +0200
@@ -18,6 +18,7 @@
 #include "x86_mca.h"
 #include "barrier.h"
 #include "util.h"
+#include "vmce.h"
 
 DEFINE_PER_CPU(struct mca_banks *, mce_banks_owned);
 DEFINE_PER_CPU(struct mca_banks *, no_cmci_banks);
@@ -980,7 +981,7 @@ enum mcheck_type intel_mcheck_init(struc
 }
 
 /* intel specific MCA MSR */
-int intel_mce_wrmsr(struct vcpu *v, uint32_t msr, uint64_t val)
+int vmce_intel_wrmsr(struct vcpu *v, uint32_t msr, uint64_t val)
 {
     unsigned int bank = msr - MSR_IA32_MC0_CTL2;
 
@@ -993,7 +994,7 @@ int intel_mce_wrmsr(struct vcpu *v, uint
     return 1;
 }
 
-int intel_mce_rdmsr(const struct vcpu *v, uint32_t msr, uint64_t *val)
+int vmce_intel_rdmsr(const struct vcpu *v, uint32_t msr, uint64_t *val)
 {
     unsigned int bank = msr - MSR_IA32_MC0_CTL2;
 
diff -r 07d0d5b3a005 -r 5d63c633a60b xen/arch/x86/cpu/mcheck/non-fatal.c
--- a/xen/arch/x86/cpu/mcheck/non-fatal.c	Wed Sep 26 12:05:55 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/non-fatal.c	Wed Sep 26 12:07:42 2012 +0200
@@ -21,6 +21,7 @@
 #include <asm/msr.h>
 
 #include "mce.h"
+#include "vmce.h"
 
 DEFINE_PER_CPU(struct mca_banks *, poll_bankmask);
 static struct timer mce_timer;
diff -r 07d0d5b3a005 -r 5d63c633a60b xen/arch/x86/cpu/mcheck/vmce.c
--- a/xen/arch/x86/cpu/mcheck/vmce.c	Wed Sep 26 12:05:55 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/vmce.c	Wed Sep 26 12:07:42 2012 +0200
@@ -33,8 +33,10 @@
 #include <asm/system.h>
 #include <asm/msr.h>
 #include <asm/p2m.h>
+
 #include "mce.h"
 #include "x86_mca.h"
+#include "vmce.h"
 
 /*
  * MCG_SER_P:  software error recovery supported
@@ -143,7 +145,10 @@ static int bank_mce_rdmsr(const struct v
         switch ( boot_cpu_data.x86_vendor )
         {
         case X86_VENDOR_INTEL:
-            ret = intel_mce_rdmsr(v, msr, val);
+            ret = vmce_intel_rdmsr(v, msr, val);
+            break;
+        case X86_VENDOR_AMD:
+            ret = vmce_amd_rdmsr(v, msr, val);
             break;
         default:
             ret = 0;
@@ -200,7 +205,7 @@ int vmce_rdmsr(uint32_t msr, uint64_t *v
  * For historic version reason, bank number may greater than GUEST_MC_BANK_NUM,
  * when migratie from old vMCE version to new vMCE.
  */
-static int bank_mce_wrmsr(struct vcpu *v, u32 msr, u64 val)
+static int bank_mce_wrmsr(struct vcpu *v, uint32_t msr, uint64_t val)
 {
     int ret = 1;
     unsigned int bank = (msr - MSR_IA32_MC0_CTL) / 4;
@@ -238,7 +243,10 @@ static int bank_mce_wrmsr(struct vcpu *v
         switch ( boot_cpu_data.x86_vendor )
         {
         case X86_VENDOR_INTEL:
-            ret = intel_mce_wrmsr(v, msr, val);
+            ret = vmce_intel_wrmsr(v, msr, val);
+            break;
+        case X86_VENDOR_AMD:
+            ret = vmce_amd_wrmsr(v, msr, val);
             break;
         default:
             ret = 0;
@@ -255,7 +263,7 @@ static int bank_mce_wrmsr(struct vcpu *v
  * = 0: Not handled, should be handled by other components
  * > 0: Success
  */
-int vmce_wrmsr(u32 msr, u64 val)
+int vmce_wrmsr(uint32_t msr, uint64_t val)
 {
     struct vcpu *cur = current;
     int ret = 1;
diff -r 07d0d5b3a005 -r 5d63c633a60b xen/arch/x86/cpu/mcheck/vmce.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/x86/cpu/mcheck/vmce.h	Wed Sep 26 12:07:42 2012 +0200
@@ -0,0 +1,23 @@
+#ifndef _MCHECK_VMCE_H
+#define _MCHECK_VMCE_H
+
+#include "x86_mca.h"
+
+int vmce_init(struct cpuinfo_x86 *c);
+
+#define dom0_vmce_enabled() (dom0 && dom0->max_vcpus && dom0->vcpu[0] \
+        && guest_enabled_event(dom0->vcpu[0], VIRQ_MCA))
+
+int is_vmce_ready(struct mcinfo_bank *bank, struct domain *d);
+int unmmap_broken_page(struct domain *d, mfn_t mfn, unsigned long gfn);
+
+int vmce_intel_rdmsr(const struct vcpu *, uint32_t msr, uint64_t *val);
+int vmce_intel_wrmsr(struct vcpu *, uint32_t msr, uint64_t val);
+int vmce_amd_rdmsr(const struct vcpu *, uint32_t msr, uint64_t *val);
+int vmce_amd_wrmsr(struct vcpu *, uint32_t msr, uint64_t val);
+
+int fill_vmsr_data(struct mcinfo_bank *mc_bank, struct domain *d,
+    uint64_t gstatus);
+int inject_vmce(struct domain *d, int vcpu);
+
+#endif

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMe4-0008F6-PD; Thu, 27 Sep 2012 22:33:24 +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 1THMe2-0008Be-W3
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:23 +0000
Received: from [85.158.138.51:20895] by server-8.bemta-3.messagelabs.com id
	F6/67-16337-234D4605; Thu, 27 Sep 2012 22:33:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-174.messagelabs.com!1348785199!32341826!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14939 invoked from network); 27 Sep 2012 22:33:20 -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;
	27 Sep 2012 22:33: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 1THMdz-0007Hr-46
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdz-0003r3-2n
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:19 +0000
Message-Id: <E1THMdz-0003r3-2n@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: vMCE emulation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Liu, Jinsong <jinsong.liu@intel.com>
# Date 1348653840 -7200
# Node ID 08b7e65a5d936bb766f076dde2d026569ad60e4c
# Parent  8278d7d8fa485996f51134c5265fceaf239adf6a
x86: vMCE emulation

This patch provides virtual MCE support to guest. It emulates a simple
and clean MCE MSRs interface to guest by faking caps to guest if needed
and masking caps if unnecessary:
1. Providing a well-defined MCG_CAP to guest, filter out un-necessary
   caps and provide only guest needed caps;
2. Disabling MCG_CTL to avoid model specific;
3. Sticking all 1's to MCi_CTL to guest to avoid model specific;
4. Enabling CMCI cap but never really inject to guest to prevent
   polling periodically;
5. Masking MSCOD field of MCi_STATUS to avoid model specific;
6. Keeping natural semantics by per-vcpu instead of per-domain
   variables;
7. Using bank1 and reserving bank0 to work around 'bank0 quirk' of some
   very old processors;
8. Cleaning some vMCE# injection logic which shared by Intel and AMD
   but useless under new vMCE implement;
9. Keeping compatilbe w/ old xen version which has been backported to
   SLES11 SP2, so that old vMCE would not blocked when migrate to new
   vMCE;

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>

- make printing consistent (and non-exploitable)
- fix return values of intel_mce_{rd,wr}msr() for out of range banks
- miscellaneous cleanup

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


diff -r 8278d7d8fa48 -r 08b7e65a5d93 xen/arch/x86/cpu/mcheck/mce.h
--- a/xen/arch/x86/cpu/mcheck/mce.h	Wed Sep 26 11:56:07 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/mce.h	Wed Sep 26 12:04:00 2012 +0200
@@ -169,15 +169,13 @@ void x86_mcinfo_dump(struct mc_info *mi)
 int fill_vmsr_data(struct mcinfo_bank *mc_bank, struct domain *d,
     uint64_t gstatus);
 int inject_vmce(struct domain *d);
-int vmce_domain_inject(struct mcinfo_bank *bank, struct domain *d,
-    struct mcinfo_global *global);
 
 static inline int mce_vendor_bank_msr(const struct vcpu *v, uint32_t msr)
 {
     switch (boot_cpu_data.x86_vendor) {
     case X86_VENDOR_INTEL:
         if (msr >= MSR_IA32_MC0_CTL2 &&
-            msr < MSR_IA32_MCx_CTL2(v->arch.mcg_cap & MCG_CAP_COUNT) )
+            msr < MSR_IA32_MCx_CTL2(v->arch.vmce.mcg_cap & MCG_CAP_COUNT) )
             return 1;
         break;
     case X86_VENDOR_AMD:
@@ -195,7 +193,7 @@ static inline int mce_vendor_bank_msr(co
 static inline int mce_bank_msr(const struct vcpu *v, uint32_t msr)
 {
     if ( (msr >= MSR_IA32_MC0_CTL &&
-          msr < MSR_IA32_MCx_CTL(v->arch.mcg_cap & MCG_CAP_COUNT)) ||
+         msr < MSR_IA32_MCx_CTL(v->arch.vmce.mcg_cap & MCG_CAP_COUNT)) ||
          mce_vendor_bank_msr(v, msr) )
         return 1;
     return 0;
diff -r 8278d7d8fa48 -r 08b7e65a5d93 xen/arch/x86/cpu/mcheck/mce_intel.c
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c	Wed Sep 26 11:56:07 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c	Wed Sep 26 12:04:00 2012 +0200
@@ -982,31 +982,27 @@ enum mcheck_type intel_mcheck_init(struc
 /* intel specific MCA MSR */
 int intel_mce_wrmsr(struct vcpu *v, uint32_t msr, uint64_t val)
 {
-    int ret = 0;
+    unsigned int bank = msr - MSR_IA32_MC0_CTL2;
 
-    if ( msr >= MSR_IA32_MC0_CTL2 &&
-         msr < MSR_IA32_MCx_CTL2(v->arch.mcg_cap & MCG_CAP_COUNT) )
+    if ( bank < GUEST_MC_BANK_NUM )
     {
-        mce_printk(MCE_QUIET, "We have disabled CMCI capability, "
-                 "Guest should not write this MSR!\n");
-         ret = 1;
+        v->arch.vmce.bank[bank].mci_ctl2 = val;
+        mce_printk(MCE_VERBOSE, "MCE: wr MC%u_CTL2 %#"PRIx64"\n", bank, val);
     }
 
-    return ret;
+    return 1;
 }
 
 int intel_mce_rdmsr(const struct vcpu *v, uint32_t msr, uint64_t *val)
 {
-    int ret = 0;
+    unsigned int bank = msr - MSR_IA32_MC0_CTL2;
 
-    if ( msr >= MSR_IA32_MC0_CTL2 &&
-         msr < MSR_IA32_MCx_CTL2(v->arch.mcg_cap & MCG_CAP_COUNT) )
+    if ( bank < GUEST_MC_BANK_NUM )
     {
-        mce_printk(MCE_QUIET, "We have disabled CMCI capability, "
-                 "Guest should not read this MSR!\n");
-        ret = 1;
+        *val = v->arch.vmce.bank[bank].mci_ctl2;
+        mce_printk(MCE_VERBOSE, "MCE: rd MC%u_CTL2 %#"PRIx64"\n", bank, *val);
     }
 
-    return ret;
+    return 1;
 }
 
diff -r 8278d7d8fa48 -r 08b7e65a5d93 xen/arch/x86/cpu/mcheck/vmce.c
--- a/xen/arch/x86/cpu/mcheck/vmce.c	Wed Sep 26 11:56:07 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/vmce.c	Wed Sep 26 12:04:00 2012 +0200
@@ -1,5 +1,22 @@
 /*
- * vmce.c - virtual MCE support
+ * vmce.c - provide software emulated vMCE support to guest
+ *
+ * Copyright (C) 2010, 2011 Jiang, Yunhong <yunhong.jiang@intel.com>
+ * Copyright (C) 2012, 2013 Liu, Jinsong <jinsong.liu@intel.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/init.h>
@@ -20,66 +37,67 @@
 #include "x86_mca.h"
 
 /*
- * Emulate 2 banks for guest
- * Bank0: reserved for 'bank0 quirk' occur at some very old processors:
- *   1). Intel cpu whose family-model value < 06-1A;
- *   2). AMD K7
- * Bank1: used to transfer error info to guest
+ * MCG_SER_P:  software error recovery supported
+ * MCG_TES_P:  to avoid MCi_status bit56:53 model specific
+ * MCG_CMCI_P: expose CMCI capability but never really inject it to guest,
+ *             for sake of performance since guest not polling periodically
  */
-#define GUEST_BANK_NUM 2
-#define GUEST_MCG_CAP (MCG_TES_P | MCG_SER_P | GUEST_BANK_NUM)
+#define INTEL_GUEST_MCG_CAP (MCG_SER_P |	\
+                             MCG_TES_P |	\
+                             MCG_CMCI_P |	\
+                             GUEST_MC_BANK_NUM)
 
-#define dom_vmce(x)   ((x)->arch.vmca_msrs)
-
-int vmce_init_msr(struct domain *d)
-{
-    dom_vmce(d) = xmalloc(struct domain_mca_msrs);
-    if ( !dom_vmce(d) )
-        return -ENOMEM;
-
-    dom_vmce(d)->mcg_status = 0x0;
-    dom_vmce(d)->nr_injection = 0;
-
-    INIT_LIST_HEAD(&dom_vmce(d)->impact_header);
-    spin_lock_init(&dom_vmce(d)->lock);
-
-    return 0;
-}
-
-void vmce_destroy_msr(struct domain *d)
-{
-    if ( !dom_vmce(d) )
-        return;
-    xfree(dom_vmce(d));
-    dom_vmce(d) = NULL;
-}
+#define AMD_GUEST_MCG_CAP GUEST_MC_BANK_NUM
 
 void vmce_init_vcpu(struct vcpu *v)
 {
-    v->arch.mcg_cap = GUEST_MCG_CAP;
+    int i;
+
+    /* global MCA MSRs init */
+    if ( boot_cpu_data.x86_vendor == X86_VENDOR_INTEL )
+        v->arch.vmce.mcg_cap = INTEL_GUEST_MCG_CAP;
+    else
+        v->arch.vmce.mcg_cap = AMD_GUEST_MCG_CAP;
+
+    v->arch.vmce.mcg_status = 0;
+
+    /* per-bank MCA MSRs init */
+    for ( i = 0; i < GUEST_MC_BANK_NUM; i++ )
+        memset(&v->arch.vmce.bank[i], 0, sizeof(struct vmce_bank));
+
+    spin_lock_init(&v->arch.vmce.lock);
 }
 
 int vmce_restore_vcpu(struct vcpu *v, uint64_t caps)
 {
-    if ( caps & ~GUEST_MCG_CAP & ~MCG_CAP_COUNT & ~MCG_CTL_P )
+    unsigned long guest_mcg_cap;
+
+    if ( boot_cpu_data.x86_vendor == X86_VENDOR_INTEL )
+        guest_mcg_cap = INTEL_GUEST_MCG_CAP;
+    else
+        guest_mcg_cap = AMD_GUEST_MCG_CAP;
+
+    if ( caps & ~guest_mcg_cap & ~MCG_CAP_COUNT & ~MCG_CTL_P )
     {
         dprintk(XENLOG_G_ERR, "%s restore: unsupported MCA capabilities"
                 " %#" PRIx64 " for d%d:v%u (supported: %#Lx)\n",
                 is_hvm_vcpu(v) ? "HVM" : "PV", caps, v->domain->domain_id,
-                v->vcpu_id, GUEST_MCG_CAP & ~MCG_CAP_COUNT);
+                v->vcpu_id, guest_mcg_cap & ~MCG_CAP_COUNT);
         return -EPERM;
     }
 
-    v->arch.mcg_cap = caps;
+    v->arch.vmce.mcg_cap = caps;
     return 0;
 }
 
+/*
+ * For historic version reason, bank number may greater than GUEST_MC_BANK_NUM,
+ * when migrating from old vMCE version to new vMCE.
+ */
 static int bank_mce_rdmsr(const struct vcpu *v, uint32_t msr, uint64_t *val)
 {
     int ret = 1;
     unsigned int bank = (msr - MSR_IA32_MC0_CTL) / 4;
-    struct domain_mca_msrs *vmce = dom_vmce(v->domain);
-    struct bank_entry *entry;
 
     *val = 0;
 
@@ -88,50 +106,33 @@ static int bank_mce_rdmsr(const struct v
     case MSR_IA32_MC0_CTL:
         /* stick all 1's to MCi_CTL */
         *val = ~0UL;
-        mce_printk(MCE_VERBOSE, "MCE: rdmsr MC%u_CTL %#"PRIx64"\n",
-                   bank, *val);
+        mce_printk(MCE_VERBOSE, "MCE: rd MC%u_CTL %#"PRIx64"\n", bank, *val);
         break;
     case MSR_IA32_MC0_STATUS:
-        /* Only error bank is read. Non-error banks simply return. */
-        if ( !list_empty(&vmce->impact_header) )
+        if ( bank < GUEST_MC_BANK_NUM )
         {
-            entry = list_entry(vmce->impact_header.next,
-                               struct bank_entry, list);
-            if ( entry->bank == bank )
-            {
-                *val = entry->mci_status;
-                mce_printk(MCE_VERBOSE,
-                           "MCE: rd MC%u_STATUS in vMCE# context "
-                           "value %#"PRIx64"\n", bank, *val);
-            }
+            *val = v->arch.vmce.bank[bank].mci_status;
+            if ( *val )
+                mce_printk(MCE_VERBOSE, "MCE: rd MC%u_STATUS %#"PRIx64"\n",
+                           bank, *val);
         }
         break;
     case MSR_IA32_MC0_ADDR:
-        if ( !list_empty(&vmce->impact_header) )
+        if ( bank < GUEST_MC_BANK_NUM )
         {
-            entry = list_entry(vmce->impact_header.next,
-                               struct bank_entry, list);
-            if ( entry->bank == bank )
-            {
-                *val = entry->mci_addr;
-                mce_printk(MCE_VERBOSE,
-                           "MCE: rdmsr MC%u_ADDR in vMCE# context "
-                           "%#"PRIx64"\n", bank, *val);
-            }
+            *val = v->arch.vmce.bank[bank].mci_addr;
+            if ( *val )
+                mce_printk(MCE_VERBOSE, "MCE: rd MC%u_ADDR %#"PRIx64"\n",
+                           bank, *val);
         }
         break;
     case MSR_IA32_MC0_MISC:
-        if ( !list_empty(&vmce->impact_header) )
+        if ( bank < GUEST_MC_BANK_NUM )
         {
-            entry = list_entry(vmce->impact_header.next,
-                               struct bank_entry, list);
-            if ( entry->bank == bank )
-            {
-                *val = entry->mci_misc;
-                mce_printk(MCE_VERBOSE,
-                           "MCE: rd MC%u_MISC in vMCE# context "
-                           "%#"PRIx64"\n", bank, *val);
-            }
+            *val = v->arch.vmce.bank[bank].mci_misc;
+            if ( *val )
+                mce_printk(MCE_VERBOSE, "MCE: rd MC%u_MISC %#"PRIx64"\n",
+                           bank, *val);
         }
         break;
     default:
@@ -157,56 +158,48 @@ static int bank_mce_rdmsr(const struct v
  */
 int vmce_rdmsr(uint32_t msr, uint64_t *val)
 {
-    const struct vcpu *cur = current;
-    struct domain_mca_msrs *vmce = dom_vmce(cur->domain);
+    struct vcpu *cur = current;
     int ret = 1;
 
     *val = 0;
 
-    spin_lock(&vmce->lock);
+    spin_lock(&cur->arch.vmce.lock);
 
     switch ( msr )
     {
     case MSR_IA32_MCG_STATUS:
-        *val = vmce->mcg_status;
+        *val = cur->arch.vmce.mcg_status;
         if (*val)
             mce_printk(MCE_VERBOSE,
-                       "MCE: rdmsr MCG_STATUS %#"PRIx64"\n", *val);
+                       "MCE: rd MCG_STATUS %#"PRIx64"\n", *val);
         break;
     case MSR_IA32_MCG_CAP:
-        *val = cur->arch.mcg_cap;
-        mce_printk(MCE_VERBOSE, "MCE: rdmsr MCG_CAP %#"PRIx64"\n",
-                   *val);
+        *val = cur->arch.vmce.mcg_cap;
+        mce_printk(MCE_VERBOSE, "MCE: rd MCG_CAP %#"PRIx64"\n", *val);
         break;
     case MSR_IA32_MCG_CTL:
-        /* Stick all 1's when CTL support, and 0's when no CTL support */
-        if ( cur->arch.mcg_cap & MCG_CTL_P )
+        if ( cur->arch.vmce.mcg_cap & MCG_CTL_P )
             *val = ~0ULL;
-        mce_printk(MCE_VERBOSE, "MCE: rdmsr MCG_CTL %#"PRIx64"\n", *val);
+        mce_printk(MCE_VERBOSE, "MCE: rd MCG_CTL %#"PRIx64"\n", *val);
         break;
     default:
         ret = mce_bank_msr(cur, msr) ? bank_mce_rdmsr(cur, msr, val) : 0;
         break;
     }
 
-    spin_unlock(&vmce->lock);
+    spin_unlock(&cur->arch.vmce.lock);
+
     return ret;
 }
 
+/*
+ * For historic version reason, bank number may greater than GUEST_MC_BANK_NUM,
+ * when migratie from old vMCE version to new vMCE.
+ */
 static int bank_mce_wrmsr(struct vcpu *v, u32 msr, u64 val)
 {
     int ret = 1;
     unsigned int bank = (msr - MSR_IA32_MC0_CTL) / 4;
-    struct domain_mca_msrs *vmce = dom_vmce(v->domain);
-    struct bank_entry *entry = NULL;
-
-    /* Give the first entry of the list, it corresponds to current
-     * vMCE# injection. When vMCE# is finished processing by the
-     * the guest, this node will be deleted.
-     * Only error bank is written. Non-error banks simply return.
-     */
-    if ( !list_empty(&vmce->impact_header) )
-        entry = list_entry(vmce->impact_header.next, struct bank_entry, list);
 
     switch ( msr & (MSR_IA32_MC0_CTL | 3) )
     {
@@ -217,50 +210,25 @@ static int bank_mce_wrmsr(struct vcpu *v
          */
         break;
     case MSR_IA32_MC0_STATUS:
-        if ( entry && (entry->bank == bank) )
-        {
-            entry->mci_status = val;
-            mce_printk(MCE_VERBOSE,
-                       "MCE: wr MC%u_STATUS %"PRIx64" in vMCE#\n",
-                       bank, val);
-        }
-        else
-            mce_printk(MCE_VERBOSE,
-                       "MCE: wr MC%u_STATUS %"PRIx64"\n", bank, val);
+        mce_printk(MCE_VERBOSE, "MCE: wr MC%u_STATUS %#"PRIx64"\n", bank, val);
+        if ( val )
+            ret = -1;
+        else if ( bank < GUEST_MC_BANK_NUM )
+            v->arch.vmce.bank[bank].mci_status = val;
         break;
     case MSR_IA32_MC0_ADDR:
-        if ( !~val )
-        {
-            mce_printk(MCE_QUIET,
-                       "MCE: wr MC%u_ADDR with all 1s will cause #GP\n", bank);
+        mce_printk(MCE_VERBOSE, "MCE: wr MC%u_ADDR %#"PRIx64"\n", bank, val);
+        if ( val )
             ret = -1;
-        }
-        else if ( entry && (entry->bank == bank) )
-        {
-            entry->mci_addr = val;
-            mce_printk(MCE_VERBOSE,
-                       "MCE: wr MC%u_ADDR %"PRIx64" in vMCE#\n", bank, val);
-        }
-        else
-            mce_printk(MCE_VERBOSE,
-                       "MCE: wr MC%u_ADDR %"PRIx64"\n", bank, val);
+        else if ( bank < GUEST_MC_BANK_NUM )
+            v->arch.vmce.bank[bank].mci_addr = val;
         break;
     case MSR_IA32_MC0_MISC:
-        if ( !~val )
-        {
-            mce_printk(MCE_QUIET,
-                       "MCE: wr MC%u_MISC with all 1s will cause #GP\n", bank);
+        mce_printk(MCE_VERBOSE, "MCE: wr MC%u_MISC %#"PRIx64"\n", bank, val);
+        if ( val )
             ret = -1;
-        }
-        else if ( entry && (entry->bank == bank) )
-        {
-            entry->mci_misc = val;
-            mce_printk(MCE_VERBOSE,
-                       "MCE: wr MC%u_MISC %"PRIx64" in vMCE#\n", bank, val);
-        }
-        else
-            mce_printk(MCE_VERBOSE,
-                       "MCE: wr MC%u_MISC %"PRIx64"\n", bank, val);
+        else if ( bank < GUEST_MC_BANK_NUM )
+            v->arch.vmce.bank[bank].mci_misc = val;
         break;
     default:
         switch ( boot_cpu_data.x86_vendor )
@@ -286,52 +254,33 @@ static int bank_mce_wrmsr(struct vcpu *v
 int vmce_wrmsr(u32 msr, u64 val)
 {
     struct vcpu *cur = current;
-    struct bank_entry *entry = NULL;
-    struct domain_mca_msrs *vmce = dom_vmce(cur->domain);
     int ret = 1;
 
-    spin_lock(&vmce->lock);
+    spin_lock(&cur->arch.vmce.lock);
 
     switch ( msr )
     {
     case MSR_IA32_MCG_CTL:
+        /* If MCG_CTL exists then stick to all 1's, else ignore. */
         break;
     case MSR_IA32_MCG_STATUS:
-        vmce->mcg_status = val;
-        mce_printk(MCE_VERBOSE, "MCE: wrmsr MCG_STATUS %"PRIx64"\n", val);
-        /* For HVM guest, this is the point for deleting vMCE injection node */
-        if ( is_hvm_vcpu(cur) && (vmce->nr_injection > 0) )
-        {
-            vmce->nr_injection--; /* Should be 0 */
-            if ( !list_empty(&vmce->impact_header) )
-            {
-                entry = list_entry(vmce->impact_header.next,
-                                   struct bank_entry, list);
-                if ( entry->mci_status & MCi_STATUS_VAL )
-                    mce_printk(MCE_QUIET, "MCE: MCi_STATUS MSR should have "
-                               "been cleared before write MCG_STATUS MSR\n");
-
-                mce_printk(MCE_QUIET, "MCE: Delete HVM last injection "
-                           "Node, nr_injection %u\n",
-                           vmce->nr_injection);
-                list_del(&entry->list);
-                xfree(entry);
-            }
-            else
-                mce_printk(MCE_QUIET, "MCE: Not found HVM guest"
-                           " last injection Node, something Wrong!\n");
-        }
+        cur->arch.vmce.mcg_status = val;
+        mce_printk(MCE_VERBOSE, "MCE: wr MCG_STATUS %"PRIx64"\n", val);
         break;
     case MSR_IA32_MCG_CAP:
-        mce_printk(MCE_QUIET, "MCE: MCG_CAP is read-only\n");
-        ret = -1;
+        /*
+         * According to Intel SDM, IA32_MCG_CAP is a read-only register,
+         * the effect of writing to the IA32_MCG_CAP is undefined. Here we
+         * treat writing as 'write not change'. Guest would not surprise.
+         */
+        mce_printk(MCE_VERBOSE, "MCE: MCG_CAP is r/o\n");
         break;
     default:
         ret = mce_bank_msr(cur, msr) ? bank_mce_wrmsr(cur, msr, val) : 0;
         break;
     }
 
-    spin_unlock(&vmce->lock);
+    spin_unlock(&cur->arch.vmce.lock);
     return ret;
 }
 
@@ -342,7 +291,7 @@ static int vmce_save_vcpu_ctxt(struct do
 
     for_each_vcpu( d, v ) {
         struct hvm_vmce_vcpu ctxt = {
-            .caps = v->arch.mcg_cap
+            .caps = v->arch.vmce.mcg_cap
         };
 
         err = hvm_save_entry(VMCE_VCPU, v->vcpu_id, h, &ctxt);
@@ -422,93 +371,38 @@ int inject_vmce(struct domain *d)
     return 0;
 }
 
-/* This node list records errors impacting a domain. when one
- * MCE# happens, one error bank impacts a domain. This error node
- * will be inserted to the tail of the per_dom data for vMCE# MSR
- * virtualization. When one vMCE# injection is finished processing
- * processed by guest, the corresponding node will be deleted.
- * This node list is for GUEST vMCE# MSRS virtualization.
- */
-static struct bank_entry* alloc_bank_entry(void)
+int fill_vmsr_data(struct mcinfo_bank *mc_bank, struct domain *d,
+                   uint64_t gstatus)
 {
-    struct bank_entry *entry;
+    struct vcpu *v = d->vcpu[0];
 
-    entry = xzalloc(struct bank_entry);
-    if ( entry == NULL )
-    {
-        printk(KERN_ERR "MCE: malloc bank_entry failed\n");
-        return NULL;
-    }
-
-    INIT_LIST_HEAD(&entry->list);
-    return entry;
-}
-
-/* Fill error bank info for #vMCE injection and GUEST vMCE#
- * MSR virtualization data
- * 1) Log down how many nr_injections of the impacted.
- * 2) Copy MCE# error bank to impacted DOM node list,
- *    for vMCE# MSRs virtualization
- */
-int fill_vmsr_data(struct mcinfo_bank *mc_bank, struct domain *d,
-                   uint64_t gstatus) {
-    struct bank_entry *entry;
-
-    /* This error bank impacts one domain, we need to fill domain related
-     * data for vMCE MSRs virtualization and vMCE# injection */
     if ( mc_bank->mc_domid != (uint16_t)~0 )
     {
-        /* For HVM guest, Only when first vMCE is consumed by HVM guest
-         * successfully, will we generete another node and inject another vMCE.
-         */
-        if ( d->is_hvm && (dom_vmce(d)->nr_injection > 0) )
+        if ( v->arch.vmce.mcg_status & MCG_STATUS_MCIP )
         {
-            mce_printk(MCE_QUIET, "MCE: HVM guest has not handled previous"
+            mce_printk(MCE_QUIET, "MCE: guest has not handled previous"
                        " vMCE yet!\n");
             return -1;
         }
 
-        entry = alloc_bank_entry();
-        if ( entry == NULL )
-            return -1;
+        spin_lock(&v->arch.vmce.lock);
 
-        entry->mci_status = mc_bank->mc_status;
-        entry->mci_addr = mc_bank->mc_addr;
-        entry->mci_misc = mc_bank->mc_misc;
-        entry->bank = mc_bank->mc_bank;
+        v->arch.vmce.mcg_status = gstatus;
+        /*
+         * 1. Skip bank 0 to avoid 'bank 0 quirk' of old processors
+         * 2. Filter MCi_STATUS MSCOD model specific error code to guest
+         */
+        v->arch.vmce.bank[1].mci_status = mc_bank->mc_status &
+                                              MCi_STATUS_MSCOD_MASK;
+        v->arch.vmce.bank[1].mci_addr = mc_bank->mc_addr;
+        v->arch.vmce.bank[1].mci_misc = mc_bank->mc_misc;
 
-        spin_lock(&dom_vmce(d)->lock);
-        /* New error Node, insert to the tail of the per_dom data */
-        list_add_tail(&entry->list, &dom_vmce(d)->impact_header);
-        /* Fill MSR global status */
-        dom_vmce(d)->mcg_status = gstatus;
-        /* New node impact the domain, need another vMCE# injection*/
-        dom_vmce(d)->nr_injection++;
-        spin_unlock(&dom_vmce(d)->lock);
-
-        mce_printk(MCE_VERBOSE,"MCE: Found error @[BANK%d "
-                   "status %"PRIx64" addr %"PRIx64" domid %d]\n ",
-                   mc_bank->mc_bank, mc_bank->mc_status, mc_bank->mc_addr,
-                   mc_bank->mc_domid);
+        spin_unlock(&v->arch.vmce.lock);
     }
 
     return 0;
 }
 
-#if 0 /* currently unused */
-int vmce_domain_inject(
-    struct mcinfo_bank *bank, struct domain *d, struct mcinfo_global *global)
-{
-    int ret;
-
-    ret = fill_vmsr_data(bank, d, global->mc_gstatus);
-    if ( ret < 0 )
-        return ret;
-
-    return inject_vmce(d);
-}
-#endif
-
 static int is_hvm_vmce_ready(struct mcinfo_bank *bank, struct domain *d)
 {
     struct vcpu *v;
diff -r 8278d7d8fa48 -r 08b7e65a5d93 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c	Wed Sep 26 11:56:07 2012 +0200
+++ b/xen/arch/x86/domain.c	Wed Sep 26 12:04:00 2012 +0200
@@ -577,9 +577,6 @@ int arch_domain_create(struct domain *d,
 
         if ( (rc = iommu_domain_init(d)) != 0 )
             goto fail;
-
-        /* For Guest vMCE MSRs virtualization */
-        vmce_init_msr(d);
     }
 
     if ( is_hvm_domain(d) )
@@ -606,7 +603,6 @@ int arch_domain_create(struct domain *d,
 
  fail:
     d->is_dying = DOMDYING_dead;
-    vmce_destroy_msr(d);
     cleanup_domain_irq_mapping(d);
     free_xenheap_page(d->shared_info);
     if ( paging_initialised )
@@ -629,7 +625,6 @@ void arch_domain_destroy(struct domain *
     else
         xfree(d->arch.pv_domain.e820);
 
-    vmce_destroy_msr(d);
     free_domain_pirqs(d);
     if ( !is_idle_domain(d) )
         iommu_domain_destroy(d);
diff -r 8278d7d8fa48 -r 08b7e65a5d93 xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Wed Sep 26 11:56:07 2012 +0200
+++ b/xen/arch/x86/domctl.c	Wed Sep 26 12:04:00 2012 +0200
@@ -1066,7 +1066,7 @@ long arch_do_domctl(
                 evc->syscall32_callback_eip    = 0;
                 evc->syscall32_disables_events = 0;
             }
-            evc->mcg_cap = v->arch.mcg_cap;
+            evc->mcg_cap = v->arch.vmce.mcg_cap;
         }
         else
         {
diff -r 8278d7d8fa48 -r 08b7e65a5d93 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c	Wed Sep 26 11:56:07 2012 +0200
+++ b/xen/arch/x86/traps.c	Wed Sep 26 12:04:00 2012 +0200
@@ -3141,50 +3141,6 @@ void async_exception_cleanup(struct vcpu
                 break;
     ASSERT(trap <= VCPU_TRAP_LAST);
 
-    /* inject vMCE to PV_Guest including DOM0. */
-    if ( trap == VCPU_TRAP_MCE )
-    {
-        gdprintk(XENLOG_DEBUG, "MCE: Return from vMCE# trap!\n");
-        if ( curr->vcpu_id == 0 )
-        {
-            struct domain *d = curr->domain;
-
-            if ( !d->arch.vmca_msrs->nr_injection )
-            {
-                printk(XENLOG_WARNING "MCE: ret from vMCE#, "
-                       "no injection node\n");
-                goto end;
-            }
-
-            d->arch.vmca_msrs->nr_injection--;
-            if ( !list_empty(&d->arch.vmca_msrs->impact_header) )
-            {
-                struct bank_entry *entry;
-
-                entry = list_entry(d->arch.vmca_msrs->impact_header.next,
-                                   struct bank_entry, list);
-                gdprintk(XENLOG_DEBUG, "MCE: delete last injection node\n");
-                list_del(&entry->list);
-            }
-            else
-                printk(XENLOG_ERR "MCE: didn't found last injection node\n");
-
-            /* further injection */
-            if ( d->arch.vmca_msrs->nr_injection > 0 &&
-                 guest_has_trap_callback(d, 0, TRAP_machine_check) &&
-                 !test_and_set_bool(curr->mce_pending) )
-            {
-                int cpu = smp_processor_id();
-
-                cpumask_copy(curr->cpu_affinity_tmp, curr->cpu_affinity);
-                printk(XENLOG_DEBUG "MCE: CPU%d set affinity, old %d\n",
-                       cpu, curr->processor);
-                vcpu_set_affinity(curr, cpumask_of(cpu));
-            }
-        }
-    }
-
-end:
     /* Restore previous asynchronous exception mask. */
     curr->async_exception_mask = curr->async_exception_state(trap).old_mask;
 }
diff -r 8278d7d8fa48 -r 08b7e65a5d93 xen/include/asm-x86/domain.h
--- a/xen/include/asm-x86/domain.h	Wed Sep 26 11:56:07 2012 +0200
+++ b/xen/include/asm-x86/domain.h	Wed Sep 26 12:04:00 2012 +0200
@@ -296,9 +296,6 @@ struct arch_domain
 
     struct PITState vpit;
 
-    /* For Guest vMCA handling */
-    struct domain_mca_msrs *vmca_msrs;
-
     /* TSC management (emulation, pv, scaling, stats) */
     int tsc_mode;            /* see include/asm-x86/time.h */
     bool_t vtsc;             /* tsc is emulated (may change after migrate) */
@@ -438,8 +435,8 @@ struct arch_vcpu
      * and thus should be saved/restored. */
     bool_t nonlazy_xstate_used;
 
-    uint64_t mcg_cap;
-    
+    struct vmce vmce;
+
     struct paging_vcpu paging;
 
     uint32_t gdbsx_vcpu_event;
diff -r 8278d7d8fa48 -r 08b7e65a5d93 xen/include/asm-x86/mce.h
--- a/xen/include/asm-x86/mce.h	Wed Sep 26 11:56:07 2012 +0200
+++ b/xen/include/asm-x86/mce.h	Wed Sep 26 12:04:00 2012 +0200
@@ -3,28 +3,35 @@
 #ifndef _XEN_X86_MCE_H
 #define _XEN_X86_MCE_H
 
-/* This entry is for recording bank nodes for the impacted domain,
- * put into impact_header list. */
-struct bank_entry {
-    struct list_head list;
-    uint16_t bank;
+/*
+ * Emulate 2 banks for guest
+ * Bank0: reserved for 'bank0 quirk' occur at some very old processors:
+ *   1). Intel cpu whose family-model value < 06-1A;
+ *   2). AMD K7
+ * Bank1: used to transfer error info to guest
+ */
+#define GUEST_MC_BANK_NUM 2
+
+/* Filter MSCOD model specific error code to guest */
+#define MCi_STATUS_MSCOD_MASK (~(0xffffULL << 16))
+
+/* No mci_ctl since it stick all 1's */
+struct vmce_bank {
     uint64_t mci_status;
     uint64_t mci_addr;
     uint64_t mci_misc;
+    uint64_t mci_ctl2;
 };
 
-struct domain_mca_msrs
-{
-    /* Guest should not change below values after DOM boot up */
+/* No mcg_ctl since it not expose to guest */
+struct vmce {
+    uint64_t mcg_cap;
     uint64_t mcg_status;
-    uint16_t nr_injection;
-    struct list_head impact_header;
     spinlock_t lock;
+    struct vmce_bank bank[GUEST_MC_BANK_NUM];
 };
 
 /* Guest vMCE MSRs virtualization */
-extern int vmce_init_msr(struct domain *d);
-extern void vmce_destroy_msr(struct domain *d);
 extern void vmce_init_vcpu(struct vcpu *);
 extern int vmce_restore_vcpu(struct vcpu *, uint64_t caps);
 extern int vmce_wrmsr(uint32_t msr, uint64_t val);

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMe4-0008Ej-GC; Thu, 27 Sep 2012 22:33:24 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMe3-00081M-4y
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:23 +0000
Received: from [85.158.143.35:19345] by server-3.bemta-4.messagelabs.com id
	8E/60-10986-234D4605; Thu, 27 Sep 2012 22:33:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-21.messagelabs.com!1348785200!13366335!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13076 invoked from network); 27 Sep 2012 22:33:21 -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;
	27 Sep 2012 22:33: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 1THMe0-0007I0-OV
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMe0-0003rm-NI
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:20 +0000
Message-Id: <E1THMe0-0003rm-NI@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/vMCE: Add AMD support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Christoph Egger <Christoph.Egger@amd.com>
# Date 1348654062 -7200
# Node ID 5d63c633a60b9a1d695594f9c17cf933240bec81
# Parent  07d0d5b3a0054d2534f09bcf90437678df2bfc54
x86/vMCE: Add AMD support

Add vMCE support for AMD. Add vmce namespace to Intel specific vMCE MSR
functions. Move vMCE prototypes from mce.h to vmce.h.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>

- fix inverted return values from vmce_amd_{rd,wr}msr()
- remove bogus printk()-s from those functions

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


diff -r 07d0d5b3a005 -r 5d63c633a60b xen/arch/x86/cpu/mcheck/amd_f10.c
--- a/xen/arch/x86/cpu/mcheck/amd_f10.c	Wed Sep 26 12:05:55 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/amd_f10.c	Wed Sep 26 12:07:42 2012 +0200
@@ -104,3 +104,28 @@ enum mcheck_type amd_f10_mcheck_init(str
 
 	return mcheck_amd_famXX;
 }
+
+/* amd specific MCA MSR */
+int vmce_amd_wrmsr(struct vcpu *v, uint32_t msr, uint64_t val)
+{
+        switch (msr) {
+        case MSR_F10_MC4_MISC1:
+        case MSR_F10_MC4_MISC2:
+        case MSR_F10_MC4_MISC3:
+                break;
+        }
+
+        return 1;
+}
+
+int vmce_amd_rdmsr(const struct vcpu *v, uint32_t msr, uint64_t *val)
+{
+        switch (msr) {
+        case MSR_F10_MC4_MISC1:
+        case MSR_F10_MC4_MISC2:
+        case MSR_F10_MC4_MISC3:
+                break;
+        }
+
+        return 1;
+}
diff -r 07d0d5b3a005 -r 5d63c633a60b xen/arch/x86/cpu/mcheck/amd_nonfatal.c
--- a/xen/arch/x86/cpu/mcheck/amd_nonfatal.c	Wed Sep 26 12:05:55 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/amd_nonfatal.c	Wed Sep 26 12:07:42 2012 +0200
@@ -64,6 +64,7 @@
 #include <asm/msr.h>
 
 #include "mce.h"
+#include "vmce.h"
 
 static struct timer mce_timer;
 
diff -r 07d0d5b3a005 -r 5d63c633a60b xen/arch/x86/cpu/mcheck/mce.c
--- a/xen/arch/x86/cpu/mcheck/mce.c	Wed Sep 26 12:05:55 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/mce.c	Wed Sep 26 12:07:42 2012 +0200
@@ -25,6 +25,7 @@
 #include "mce.h"
 #include "barrier.h"
 #include "util.h"
+#include "vmce.h"
 
 bool_t __read_mostly mce_disabled;
 invbool_param("mce", mce_disabled);
diff -r 07d0d5b3a005 -r 5d63c633a60b xen/arch/x86/cpu/mcheck/mce.h
--- a/xen/arch/x86/cpu/mcheck/mce.h	Wed Sep 26 12:05:55 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/mce.h	Wed Sep 26 12:07:42 2012 +0200
@@ -49,15 +49,9 @@ void intel_mcheck_timer(struct cpuinfo_x
 void mce_intel_feature_init(struct cpuinfo_x86 *c);
 void amd_nonfatal_mcheck_init(struct cpuinfo_x86 *c);
 
-int is_vmce_ready(struct mcinfo_bank *bank, struct domain *d);
-int unmmap_broken_page(struct domain *d, mfn_t mfn, unsigned long gfn);
-
-u64 mce_cap_init(void);
+uint64_t mce_cap_init(void);
 extern unsigned int firstbank;
 
-int intel_mce_rdmsr(const struct vcpu *, uint32_t msr, uint64_t *val);
-int intel_mce_wrmsr(struct vcpu *, uint32_t msr, uint64_t val);
-
 struct mcinfo_extended *intel_get_extended_msrs(
     struct mcinfo_global *mig, struct mc_info *mi);
 
@@ -69,9 +63,6 @@ void mc_panic(char *s);
 void x86_mc_get_cpu_info(unsigned, uint32_t *, uint16_t *, uint16_t *,
 			 uint32_t *, uint32_t *, uint32_t *, uint32_t *);
 
-#define dom0_vmce_enabled() (dom0 && dom0->max_vcpus && dom0->vcpu[0] \
-	&& guest_enabled_event(dom0->vcpu[0], VIRQ_MCA))
-
 /* Register a handler for machine check exceptions. */
 typedef void (*x86_mce_vector_t)(struct cpu_user_regs *, long);
 extern void x86_mce_vector_register(x86_mce_vector_t);
@@ -166,10 +157,6 @@ void *x86_mcinfo_add(struct mc_info *mi,
 void *x86_mcinfo_reserve(struct mc_info *mi, int size);
 void x86_mcinfo_dump(struct mc_info *mi);
 
-int fill_vmsr_data(struct mcinfo_bank *mc_bank, struct domain *d,
-    uint64_t gstatus);
-int inject_vmce(struct domain *d, int vcpu);
-
 static inline int mce_vendor_bank_msr(const struct vcpu *v, uint32_t msr)
 {
     switch (boot_cpu_data.x86_vendor) {
diff -r 07d0d5b3a005 -r 5d63c633a60b xen/arch/x86/cpu/mcheck/mce_intel.c
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c	Wed Sep 26 12:05:55 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c	Wed Sep 26 12:07:42 2012 +0200
@@ -18,6 +18,7 @@
 #include "x86_mca.h"
 #include "barrier.h"
 #include "util.h"
+#include "vmce.h"
 
 DEFINE_PER_CPU(struct mca_banks *, mce_banks_owned);
 DEFINE_PER_CPU(struct mca_banks *, no_cmci_banks);
@@ -980,7 +981,7 @@ enum mcheck_type intel_mcheck_init(struc
 }
 
 /* intel specific MCA MSR */
-int intel_mce_wrmsr(struct vcpu *v, uint32_t msr, uint64_t val)
+int vmce_intel_wrmsr(struct vcpu *v, uint32_t msr, uint64_t val)
 {
     unsigned int bank = msr - MSR_IA32_MC0_CTL2;
 
@@ -993,7 +994,7 @@ int intel_mce_wrmsr(struct vcpu *v, uint
     return 1;
 }
 
-int intel_mce_rdmsr(const struct vcpu *v, uint32_t msr, uint64_t *val)
+int vmce_intel_rdmsr(const struct vcpu *v, uint32_t msr, uint64_t *val)
 {
     unsigned int bank = msr - MSR_IA32_MC0_CTL2;
 
diff -r 07d0d5b3a005 -r 5d63c633a60b xen/arch/x86/cpu/mcheck/non-fatal.c
--- a/xen/arch/x86/cpu/mcheck/non-fatal.c	Wed Sep 26 12:05:55 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/non-fatal.c	Wed Sep 26 12:07:42 2012 +0200
@@ -21,6 +21,7 @@
 #include <asm/msr.h>
 
 #include "mce.h"
+#include "vmce.h"
 
 DEFINE_PER_CPU(struct mca_banks *, poll_bankmask);
 static struct timer mce_timer;
diff -r 07d0d5b3a005 -r 5d63c633a60b xen/arch/x86/cpu/mcheck/vmce.c
--- a/xen/arch/x86/cpu/mcheck/vmce.c	Wed Sep 26 12:05:55 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/vmce.c	Wed Sep 26 12:07:42 2012 +0200
@@ -33,8 +33,10 @@
 #include <asm/system.h>
 #include <asm/msr.h>
 #include <asm/p2m.h>
+
 #include "mce.h"
 #include "x86_mca.h"
+#include "vmce.h"
 
 /*
  * MCG_SER_P:  software error recovery supported
@@ -143,7 +145,10 @@ static int bank_mce_rdmsr(const struct v
         switch ( boot_cpu_data.x86_vendor )
         {
         case X86_VENDOR_INTEL:
-            ret = intel_mce_rdmsr(v, msr, val);
+            ret = vmce_intel_rdmsr(v, msr, val);
+            break;
+        case X86_VENDOR_AMD:
+            ret = vmce_amd_rdmsr(v, msr, val);
             break;
         default:
             ret = 0;
@@ -200,7 +205,7 @@ int vmce_rdmsr(uint32_t msr, uint64_t *v
  * For historic version reason, bank number may greater than GUEST_MC_BANK_NUM,
  * when migratie from old vMCE version to new vMCE.
  */
-static int bank_mce_wrmsr(struct vcpu *v, u32 msr, u64 val)
+static int bank_mce_wrmsr(struct vcpu *v, uint32_t msr, uint64_t val)
 {
     int ret = 1;
     unsigned int bank = (msr - MSR_IA32_MC0_CTL) / 4;
@@ -238,7 +243,10 @@ static int bank_mce_wrmsr(struct vcpu *v
         switch ( boot_cpu_data.x86_vendor )
         {
         case X86_VENDOR_INTEL:
-            ret = intel_mce_wrmsr(v, msr, val);
+            ret = vmce_intel_wrmsr(v, msr, val);
+            break;
+        case X86_VENDOR_AMD:
+            ret = vmce_amd_wrmsr(v, msr, val);
             break;
         default:
             ret = 0;
@@ -255,7 +263,7 @@ static int bank_mce_wrmsr(struct vcpu *v
  * = 0: Not handled, should be handled by other components
  * > 0: Success
  */
-int vmce_wrmsr(u32 msr, u64 val)
+int vmce_wrmsr(uint32_t msr, uint64_t val)
 {
     struct vcpu *cur = current;
     int ret = 1;
diff -r 07d0d5b3a005 -r 5d63c633a60b xen/arch/x86/cpu/mcheck/vmce.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/x86/cpu/mcheck/vmce.h	Wed Sep 26 12:07:42 2012 +0200
@@ -0,0 +1,23 @@
+#ifndef _MCHECK_VMCE_H
+#define _MCHECK_VMCE_H
+
+#include "x86_mca.h"
+
+int vmce_init(struct cpuinfo_x86 *c);
+
+#define dom0_vmce_enabled() (dom0 && dom0->max_vcpus && dom0->vcpu[0] \
+        && guest_enabled_event(dom0->vcpu[0], VIRQ_MCA))
+
+int is_vmce_ready(struct mcinfo_bank *bank, struct domain *d);
+int unmmap_broken_page(struct domain *d, mfn_t mfn, unsigned long gfn);
+
+int vmce_intel_rdmsr(const struct vcpu *, uint32_t msr, uint64_t *val);
+int vmce_intel_wrmsr(struct vcpu *, uint32_t msr, uint64_t val);
+int vmce_amd_rdmsr(const struct vcpu *, uint32_t msr, uint64_t *val);
+int vmce_amd_wrmsr(struct vcpu *, uint32_t msr, uint64_t val);
+
+int fill_vmsr_data(struct mcinfo_bank *mc_bank, struct domain *d,
+    uint64_t gstatus);
+int inject_vmce(struct domain *d, int vcpu);
+
+#endif

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMe4-0008F6-PD; Thu, 27 Sep 2012 22:33:24 +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 1THMe2-0008Be-W3
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:23 +0000
Received: from [85.158.138.51:20895] by server-8.bemta-3.messagelabs.com id
	F6/67-16337-234D4605; Thu, 27 Sep 2012 22:33:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-174.messagelabs.com!1348785199!32341826!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14939 invoked from network); 27 Sep 2012 22:33:20 -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;
	27 Sep 2012 22:33: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 1THMdz-0007Hr-46
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMdz-0003r3-2n
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:19 +0000
Message-Id: <E1THMdz-0003r3-2n@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: vMCE emulation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Liu, Jinsong <jinsong.liu@intel.com>
# Date 1348653840 -7200
# Node ID 08b7e65a5d936bb766f076dde2d026569ad60e4c
# Parent  8278d7d8fa485996f51134c5265fceaf239adf6a
x86: vMCE emulation

This patch provides virtual MCE support to guest. It emulates a simple
and clean MCE MSRs interface to guest by faking caps to guest if needed
and masking caps if unnecessary:
1. Providing a well-defined MCG_CAP to guest, filter out un-necessary
   caps and provide only guest needed caps;
2. Disabling MCG_CTL to avoid model specific;
3. Sticking all 1's to MCi_CTL to guest to avoid model specific;
4. Enabling CMCI cap but never really inject to guest to prevent
   polling periodically;
5. Masking MSCOD field of MCi_STATUS to avoid model specific;
6. Keeping natural semantics by per-vcpu instead of per-domain
   variables;
7. Using bank1 and reserving bank0 to work around 'bank0 quirk' of some
   very old processors;
8. Cleaning some vMCE# injection logic which shared by Intel and AMD
   but useless under new vMCE implement;
9. Keeping compatilbe w/ old xen version which has been backported to
   SLES11 SP2, so that old vMCE would not blocked when migrate to new
   vMCE;

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>

- make printing consistent (and non-exploitable)
- fix return values of intel_mce_{rd,wr}msr() for out of range banks
- miscellaneous cleanup

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


diff -r 8278d7d8fa48 -r 08b7e65a5d93 xen/arch/x86/cpu/mcheck/mce.h
--- a/xen/arch/x86/cpu/mcheck/mce.h	Wed Sep 26 11:56:07 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/mce.h	Wed Sep 26 12:04:00 2012 +0200
@@ -169,15 +169,13 @@ void x86_mcinfo_dump(struct mc_info *mi)
 int fill_vmsr_data(struct mcinfo_bank *mc_bank, struct domain *d,
     uint64_t gstatus);
 int inject_vmce(struct domain *d);
-int vmce_domain_inject(struct mcinfo_bank *bank, struct domain *d,
-    struct mcinfo_global *global);
 
 static inline int mce_vendor_bank_msr(const struct vcpu *v, uint32_t msr)
 {
     switch (boot_cpu_data.x86_vendor) {
     case X86_VENDOR_INTEL:
         if (msr >= MSR_IA32_MC0_CTL2 &&
-            msr < MSR_IA32_MCx_CTL2(v->arch.mcg_cap & MCG_CAP_COUNT) )
+            msr < MSR_IA32_MCx_CTL2(v->arch.vmce.mcg_cap & MCG_CAP_COUNT) )
             return 1;
         break;
     case X86_VENDOR_AMD:
@@ -195,7 +193,7 @@ static inline int mce_vendor_bank_msr(co
 static inline int mce_bank_msr(const struct vcpu *v, uint32_t msr)
 {
     if ( (msr >= MSR_IA32_MC0_CTL &&
-          msr < MSR_IA32_MCx_CTL(v->arch.mcg_cap & MCG_CAP_COUNT)) ||
+         msr < MSR_IA32_MCx_CTL(v->arch.vmce.mcg_cap & MCG_CAP_COUNT)) ||
          mce_vendor_bank_msr(v, msr) )
         return 1;
     return 0;
diff -r 8278d7d8fa48 -r 08b7e65a5d93 xen/arch/x86/cpu/mcheck/mce_intel.c
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c	Wed Sep 26 11:56:07 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c	Wed Sep 26 12:04:00 2012 +0200
@@ -982,31 +982,27 @@ enum mcheck_type intel_mcheck_init(struc
 /* intel specific MCA MSR */
 int intel_mce_wrmsr(struct vcpu *v, uint32_t msr, uint64_t val)
 {
-    int ret = 0;
+    unsigned int bank = msr - MSR_IA32_MC0_CTL2;
 
-    if ( msr >= MSR_IA32_MC0_CTL2 &&
-         msr < MSR_IA32_MCx_CTL2(v->arch.mcg_cap & MCG_CAP_COUNT) )
+    if ( bank < GUEST_MC_BANK_NUM )
     {
-        mce_printk(MCE_QUIET, "We have disabled CMCI capability, "
-                 "Guest should not write this MSR!\n");
-         ret = 1;
+        v->arch.vmce.bank[bank].mci_ctl2 = val;
+        mce_printk(MCE_VERBOSE, "MCE: wr MC%u_CTL2 %#"PRIx64"\n", bank, val);
     }
 
-    return ret;
+    return 1;
 }
 
 int intel_mce_rdmsr(const struct vcpu *v, uint32_t msr, uint64_t *val)
 {
-    int ret = 0;
+    unsigned int bank = msr - MSR_IA32_MC0_CTL2;
 
-    if ( msr >= MSR_IA32_MC0_CTL2 &&
-         msr < MSR_IA32_MCx_CTL2(v->arch.mcg_cap & MCG_CAP_COUNT) )
+    if ( bank < GUEST_MC_BANK_NUM )
     {
-        mce_printk(MCE_QUIET, "We have disabled CMCI capability, "
-                 "Guest should not read this MSR!\n");
-        ret = 1;
+        *val = v->arch.vmce.bank[bank].mci_ctl2;
+        mce_printk(MCE_VERBOSE, "MCE: rd MC%u_CTL2 %#"PRIx64"\n", bank, *val);
     }
 
-    return ret;
+    return 1;
 }
 
diff -r 8278d7d8fa48 -r 08b7e65a5d93 xen/arch/x86/cpu/mcheck/vmce.c
--- a/xen/arch/x86/cpu/mcheck/vmce.c	Wed Sep 26 11:56:07 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/vmce.c	Wed Sep 26 12:04:00 2012 +0200
@@ -1,5 +1,22 @@
 /*
- * vmce.c - virtual MCE support
+ * vmce.c - provide software emulated vMCE support to guest
+ *
+ * Copyright (C) 2010, 2011 Jiang, Yunhong <yunhong.jiang@intel.com>
+ * Copyright (C) 2012, 2013 Liu, Jinsong <jinsong.liu@intel.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/init.h>
@@ -20,66 +37,67 @@
 #include "x86_mca.h"
 
 /*
- * Emulate 2 banks for guest
- * Bank0: reserved for 'bank0 quirk' occur at some very old processors:
- *   1). Intel cpu whose family-model value < 06-1A;
- *   2). AMD K7
- * Bank1: used to transfer error info to guest
+ * MCG_SER_P:  software error recovery supported
+ * MCG_TES_P:  to avoid MCi_status bit56:53 model specific
+ * MCG_CMCI_P: expose CMCI capability but never really inject it to guest,
+ *             for sake of performance since guest not polling periodically
  */
-#define GUEST_BANK_NUM 2
-#define GUEST_MCG_CAP (MCG_TES_P | MCG_SER_P | GUEST_BANK_NUM)
+#define INTEL_GUEST_MCG_CAP (MCG_SER_P |	\
+                             MCG_TES_P |	\
+                             MCG_CMCI_P |	\
+                             GUEST_MC_BANK_NUM)
 
-#define dom_vmce(x)   ((x)->arch.vmca_msrs)
-
-int vmce_init_msr(struct domain *d)
-{
-    dom_vmce(d) = xmalloc(struct domain_mca_msrs);
-    if ( !dom_vmce(d) )
-        return -ENOMEM;
-
-    dom_vmce(d)->mcg_status = 0x0;
-    dom_vmce(d)->nr_injection = 0;
-
-    INIT_LIST_HEAD(&dom_vmce(d)->impact_header);
-    spin_lock_init(&dom_vmce(d)->lock);
-
-    return 0;
-}
-
-void vmce_destroy_msr(struct domain *d)
-{
-    if ( !dom_vmce(d) )
-        return;
-    xfree(dom_vmce(d));
-    dom_vmce(d) = NULL;
-}
+#define AMD_GUEST_MCG_CAP GUEST_MC_BANK_NUM
 
 void vmce_init_vcpu(struct vcpu *v)
 {
-    v->arch.mcg_cap = GUEST_MCG_CAP;
+    int i;
+
+    /* global MCA MSRs init */
+    if ( boot_cpu_data.x86_vendor == X86_VENDOR_INTEL )
+        v->arch.vmce.mcg_cap = INTEL_GUEST_MCG_CAP;
+    else
+        v->arch.vmce.mcg_cap = AMD_GUEST_MCG_CAP;
+
+    v->arch.vmce.mcg_status = 0;
+
+    /* per-bank MCA MSRs init */
+    for ( i = 0; i < GUEST_MC_BANK_NUM; i++ )
+        memset(&v->arch.vmce.bank[i], 0, sizeof(struct vmce_bank));
+
+    spin_lock_init(&v->arch.vmce.lock);
 }
 
 int vmce_restore_vcpu(struct vcpu *v, uint64_t caps)
 {
-    if ( caps & ~GUEST_MCG_CAP & ~MCG_CAP_COUNT & ~MCG_CTL_P )
+    unsigned long guest_mcg_cap;
+
+    if ( boot_cpu_data.x86_vendor == X86_VENDOR_INTEL )
+        guest_mcg_cap = INTEL_GUEST_MCG_CAP;
+    else
+        guest_mcg_cap = AMD_GUEST_MCG_CAP;
+
+    if ( caps & ~guest_mcg_cap & ~MCG_CAP_COUNT & ~MCG_CTL_P )
     {
         dprintk(XENLOG_G_ERR, "%s restore: unsupported MCA capabilities"
                 " %#" PRIx64 " for d%d:v%u (supported: %#Lx)\n",
                 is_hvm_vcpu(v) ? "HVM" : "PV", caps, v->domain->domain_id,
-                v->vcpu_id, GUEST_MCG_CAP & ~MCG_CAP_COUNT);
+                v->vcpu_id, guest_mcg_cap & ~MCG_CAP_COUNT);
         return -EPERM;
     }
 
-    v->arch.mcg_cap = caps;
+    v->arch.vmce.mcg_cap = caps;
     return 0;
 }
 
+/*
+ * For historic version reason, bank number may greater than GUEST_MC_BANK_NUM,
+ * when migrating from old vMCE version to new vMCE.
+ */
 static int bank_mce_rdmsr(const struct vcpu *v, uint32_t msr, uint64_t *val)
 {
     int ret = 1;
     unsigned int bank = (msr - MSR_IA32_MC0_CTL) / 4;
-    struct domain_mca_msrs *vmce = dom_vmce(v->domain);
-    struct bank_entry *entry;
 
     *val = 0;
 
@@ -88,50 +106,33 @@ static int bank_mce_rdmsr(const struct v
     case MSR_IA32_MC0_CTL:
         /* stick all 1's to MCi_CTL */
         *val = ~0UL;
-        mce_printk(MCE_VERBOSE, "MCE: rdmsr MC%u_CTL %#"PRIx64"\n",
-                   bank, *val);
+        mce_printk(MCE_VERBOSE, "MCE: rd MC%u_CTL %#"PRIx64"\n", bank, *val);
         break;
     case MSR_IA32_MC0_STATUS:
-        /* Only error bank is read. Non-error banks simply return. */
-        if ( !list_empty(&vmce->impact_header) )
+        if ( bank < GUEST_MC_BANK_NUM )
         {
-            entry = list_entry(vmce->impact_header.next,
-                               struct bank_entry, list);
-            if ( entry->bank == bank )
-            {
-                *val = entry->mci_status;
-                mce_printk(MCE_VERBOSE,
-                           "MCE: rd MC%u_STATUS in vMCE# context "
-                           "value %#"PRIx64"\n", bank, *val);
-            }
+            *val = v->arch.vmce.bank[bank].mci_status;
+            if ( *val )
+                mce_printk(MCE_VERBOSE, "MCE: rd MC%u_STATUS %#"PRIx64"\n",
+                           bank, *val);
         }
         break;
     case MSR_IA32_MC0_ADDR:
-        if ( !list_empty(&vmce->impact_header) )
+        if ( bank < GUEST_MC_BANK_NUM )
         {
-            entry = list_entry(vmce->impact_header.next,
-                               struct bank_entry, list);
-            if ( entry->bank == bank )
-            {
-                *val = entry->mci_addr;
-                mce_printk(MCE_VERBOSE,
-                           "MCE: rdmsr MC%u_ADDR in vMCE# context "
-                           "%#"PRIx64"\n", bank, *val);
-            }
+            *val = v->arch.vmce.bank[bank].mci_addr;
+            if ( *val )
+                mce_printk(MCE_VERBOSE, "MCE: rd MC%u_ADDR %#"PRIx64"\n",
+                           bank, *val);
         }
         break;
     case MSR_IA32_MC0_MISC:
-        if ( !list_empty(&vmce->impact_header) )
+        if ( bank < GUEST_MC_BANK_NUM )
         {
-            entry = list_entry(vmce->impact_header.next,
-                               struct bank_entry, list);
-            if ( entry->bank == bank )
-            {
-                *val = entry->mci_misc;
-                mce_printk(MCE_VERBOSE,
-                           "MCE: rd MC%u_MISC in vMCE# context "
-                           "%#"PRIx64"\n", bank, *val);
-            }
+            *val = v->arch.vmce.bank[bank].mci_misc;
+            if ( *val )
+                mce_printk(MCE_VERBOSE, "MCE: rd MC%u_MISC %#"PRIx64"\n",
+                           bank, *val);
         }
         break;
     default:
@@ -157,56 +158,48 @@ static int bank_mce_rdmsr(const struct v
  */
 int vmce_rdmsr(uint32_t msr, uint64_t *val)
 {
-    const struct vcpu *cur = current;
-    struct domain_mca_msrs *vmce = dom_vmce(cur->domain);
+    struct vcpu *cur = current;
     int ret = 1;
 
     *val = 0;
 
-    spin_lock(&vmce->lock);
+    spin_lock(&cur->arch.vmce.lock);
 
     switch ( msr )
     {
     case MSR_IA32_MCG_STATUS:
-        *val = vmce->mcg_status;
+        *val = cur->arch.vmce.mcg_status;
         if (*val)
             mce_printk(MCE_VERBOSE,
-                       "MCE: rdmsr MCG_STATUS %#"PRIx64"\n", *val);
+                       "MCE: rd MCG_STATUS %#"PRIx64"\n", *val);
         break;
     case MSR_IA32_MCG_CAP:
-        *val = cur->arch.mcg_cap;
-        mce_printk(MCE_VERBOSE, "MCE: rdmsr MCG_CAP %#"PRIx64"\n",
-                   *val);
+        *val = cur->arch.vmce.mcg_cap;
+        mce_printk(MCE_VERBOSE, "MCE: rd MCG_CAP %#"PRIx64"\n", *val);
         break;
     case MSR_IA32_MCG_CTL:
-        /* Stick all 1's when CTL support, and 0's when no CTL support */
-        if ( cur->arch.mcg_cap & MCG_CTL_P )
+        if ( cur->arch.vmce.mcg_cap & MCG_CTL_P )
             *val = ~0ULL;
-        mce_printk(MCE_VERBOSE, "MCE: rdmsr MCG_CTL %#"PRIx64"\n", *val);
+        mce_printk(MCE_VERBOSE, "MCE: rd MCG_CTL %#"PRIx64"\n", *val);
         break;
     default:
         ret = mce_bank_msr(cur, msr) ? bank_mce_rdmsr(cur, msr, val) : 0;
         break;
     }
 
-    spin_unlock(&vmce->lock);
+    spin_unlock(&cur->arch.vmce.lock);
+
     return ret;
 }
 
+/*
+ * For historic version reason, bank number may greater than GUEST_MC_BANK_NUM,
+ * when migratie from old vMCE version to new vMCE.
+ */
 static int bank_mce_wrmsr(struct vcpu *v, u32 msr, u64 val)
 {
     int ret = 1;
     unsigned int bank = (msr - MSR_IA32_MC0_CTL) / 4;
-    struct domain_mca_msrs *vmce = dom_vmce(v->domain);
-    struct bank_entry *entry = NULL;
-
-    /* Give the first entry of the list, it corresponds to current
-     * vMCE# injection. When vMCE# is finished processing by the
-     * the guest, this node will be deleted.
-     * Only error bank is written. Non-error banks simply return.
-     */
-    if ( !list_empty(&vmce->impact_header) )
-        entry = list_entry(vmce->impact_header.next, struct bank_entry, list);
 
     switch ( msr & (MSR_IA32_MC0_CTL | 3) )
     {
@@ -217,50 +210,25 @@ static int bank_mce_wrmsr(struct vcpu *v
          */
         break;
     case MSR_IA32_MC0_STATUS:
-        if ( entry && (entry->bank == bank) )
-        {
-            entry->mci_status = val;
-            mce_printk(MCE_VERBOSE,
-                       "MCE: wr MC%u_STATUS %"PRIx64" in vMCE#\n",
-                       bank, val);
-        }
-        else
-            mce_printk(MCE_VERBOSE,
-                       "MCE: wr MC%u_STATUS %"PRIx64"\n", bank, val);
+        mce_printk(MCE_VERBOSE, "MCE: wr MC%u_STATUS %#"PRIx64"\n", bank, val);
+        if ( val )
+            ret = -1;
+        else if ( bank < GUEST_MC_BANK_NUM )
+            v->arch.vmce.bank[bank].mci_status = val;
         break;
     case MSR_IA32_MC0_ADDR:
-        if ( !~val )
-        {
-            mce_printk(MCE_QUIET,
-                       "MCE: wr MC%u_ADDR with all 1s will cause #GP\n", bank);
+        mce_printk(MCE_VERBOSE, "MCE: wr MC%u_ADDR %#"PRIx64"\n", bank, val);
+        if ( val )
             ret = -1;
-        }
-        else if ( entry && (entry->bank == bank) )
-        {
-            entry->mci_addr = val;
-            mce_printk(MCE_VERBOSE,
-                       "MCE: wr MC%u_ADDR %"PRIx64" in vMCE#\n", bank, val);
-        }
-        else
-            mce_printk(MCE_VERBOSE,
-                       "MCE: wr MC%u_ADDR %"PRIx64"\n", bank, val);
+        else if ( bank < GUEST_MC_BANK_NUM )
+            v->arch.vmce.bank[bank].mci_addr = val;
         break;
     case MSR_IA32_MC0_MISC:
-        if ( !~val )
-        {
-            mce_printk(MCE_QUIET,
-                       "MCE: wr MC%u_MISC with all 1s will cause #GP\n", bank);
+        mce_printk(MCE_VERBOSE, "MCE: wr MC%u_MISC %#"PRIx64"\n", bank, val);
+        if ( val )
             ret = -1;
-        }
-        else if ( entry && (entry->bank == bank) )
-        {
-            entry->mci_misc = val;
-            mce_printk(MCE_VERBOSE,
-                       "MCE: wr MC%u_MISC %"PRIx64" in vMCE#\n", bank, val);
-        }
-        else
-            mce_printk(MCE_VERBOSE,
-                       "MCE: wr MC%u_MISC %"PRIx64"\n", bank, val);
+        else if ( bank < GUEST_MC_BANK_NUM )
+            v->arch.vmce.bank[bank].mci_misc = val;
         break;
     default:
         switch ( boot_cpu_data.x86_vendor )
@@ -286,52 +254,33 @@ static int bank_mce_wrmsr(struct vcpu *v
 int vmce_wrmsr(u32 msr, u64 val)
 {
     struct vcpu *cur = current;
-    struct bank_entry *entry = NULL;
-    struct domain_mca_msrs *vmce = dom_vmce(cur->domain);
     int ret = 1;
 
-    spin_lock(&vmce->lock);
+    spin_lock(&cur->arch.vmce.lock);
 
     switch ( msr )
     {
     case MSR_IA32_MCG_CTL:
+        /* If MCG_CTL exists then stick to all 1's, else ignore. */
         break;
     case MSR_IA32_MCG_STATUS:
-        vmce->mcg_status = val;
-        mce_printk(MCE_VERBOSE, "MCE: wrmsr MCG_STATUS %"PRIx64"\n", val);
-        /* For HVM guest, this is the point for deleting vMCE injection node */
-        if ( is_hvm_vcpu(cur) && (vmce->nr_injection > 0) )
-        {
-            vmce->nr_injection--; /* Should be 0 */
-            if ( !list_empty(&vmce->impact_header) )
-            {
-                entry = list_entry(vmce->impact_header.next,
-                                   struct bank_entry, list);
-                if ( entry->mci_status & MCi_STATUS_VAL )
-                    mce_printk(MCE_QUIET, "MCE: MCi_STATUS MSR should have "
-                               "been cleared before write MCG_STATUS MSR\n");
-
-                mce_printk(MCE_QUIET, "MCE: Delete HVM last injection "
-                           "Node, nr_injection %u\n",
-                           vmce->nr_injection);
-                list_del(&entry->list);
-                xfree(entry);
-            }
-            else
-                mce_printk(MCE_QUIET, "MCE: Not found HVM guest"
-                           " last injection Node, something Wrong!\n");
-        }
+        cur->arch.vmce.mcg_status = val;
+        mce_printk(MCE_VERBOSE, "MCE: wr MCG_STATUS %"PRIx64"\n", val);
         break;
     case MSR_IA32_MCG_CAP:
-        mce_printk(MCE_QUIET, "MCE: MCG_CAP is read-only\n");
-        ret = -1;
+        /*
+         * According to Intel SDM, IA32_MCG_CAP is a read-only register,
+         * the effect of writing to the IA32_MCG_CAP is undefined. Here we
+         * treat writing as 'write not change'. Guest would not surprise.
+         */
+        mce_printk(MCE_VERBOSE, "MCE: MCG_CAP is r/o\n");
         break;
     default:
         ret = mce_bank_msr(cur, msr) ? bank_mce_wrmsr(cur, msr, val) : 0;
         break;
     }
 
-    spin_unlock(&vmce->lock);
+    spin_unlock(&cur->arch.vmce.lock);
     return ret;
 }
 
@@ -342,7 +291,7 @@ static int vmce_save_vcpu_ctxt(struct do
 
     for_each_vcpu( d, v ) {
         struct hvm_vmce_vcpu ctxt = {
-            .caps = v->arch.mcg_cap
+            .caps = v->arch.vmce.mcg_cap
         };
 
         err = hvm_save_entry(VMCE_VCPU, v->vcpu_id, h, &ctxt);
@@ -422,93 +371,38 @@ int inject_vmce(struct domain *d)
     return 0;
 }
 
-/* This node list records errors impacting a domain. when one
- * MCE# happens, one error bank impacts a domain. This error node
- * will be inserted to the tail of the per_dom data for vMCE# MSR
- * virtualization. When one vMCE# injection is finished processing
- * processed by guest, the corresponding node will be deleted.
- * This node list is for GUEST vMCE# MSRS virtualization.
- */
-static struct bank_entry* alloc_bank_entry(void)
+int fill_vmsr_data(struct mcinfo_bank *mc_bank, struct domain *d,
+                   uint64_t gstatus)
 {
-    struct bank_entry *entry;
+    struct vcpu *v = d->vcpu[0];
 
-    entry = xzalloc(struct bank_entry);
-    if ( entry == NULL )
-    {
-        printk(KERN_ERR "MCE: malloc bank_entry failed\n");
-        return NULL;
-    }
-
-    INIT_LIST_HEAD(&entry->list);
-    return entry;
-}
-
-/* Fill error bank info for #vMCE injection and GUEST vMCE#
- * MSR virtualization data
- * 1) Log down how many nr_injections of the impacted.
- * 2) Copy MCE# error bank to impacted DOM node list,
- *    for vMCE# MSRs virtualization
- */
-int fill_vmsr_data(struct mcinfo_bank *mc_bank, struct domain *d,
-                   uint64_t gstatus) {
-    struct bank_entry *entry;
-
-    /* This error bank impacts one domain, we need to fill domain related
-     * data for vMCE MSRs virtualization and vMCE# injection */
     if ( mc_bank->mc_domid != (uint16_t)~0 )
     {
-        /* For HVM guest, Only when first vMCE is consumed by HVM guest
-         * successfully, will we generete another node and inject another vMCE.
-         */
-        if ( d->is_hvm && (dom_vmce(d)->nr_injection > 0) )
+        if ( v->arch.vmce.mcg_status & MCG_STATUS_MCIP )
         {
-            mce_printk(MCE_QUIET, "MCE: HVM guest has not handled previous"
+            mce_printk(MCE_QUIET, "MCE: guest has not handled previous"
                        " vMCE yet!\n");
             return -1;
         }
 
-        entry = alloc_bank_entry();
-        if ( entry == NULL )
-            return -1;
+        spin_lock(&v->arch.vmce.lock);
 
-        entry->mci_status = mc_bank->mc_status;
-        entry->mci_addr = mc_bank->mc_addr;
-        entry->mci_misc = mc_bank->mc_misc;
-        entry->bank = mc_bank->mc_bank;
+        v->arch.vmce.mcg_status = gstatus;
+        /*
+         * 1. Skip bank 0 to avoid 'bank 0 quirk' of old processors
+         * 2. Filter MCi_STATUS MSCOD model specific error code to guest
+         */
+        v->arch.vmce.bank[1].mci_status = mc_bank->mc_status &
+                                              MCi_STATUS_MSCOD_MASK;
+        v->arch.vmce.bank[1].mci_addr = mc_bank->mc_addr;
+        v->arch.vmce.bank[1].mci_misc = mc_bank->mc_misc;
 
-        spin_lock(&dom_vmce(d)->lock);
-        /* New error Node, insert to the tail of the per_dom data */
-        list_add_tail(&entry->list, &dom_vmce(d)->impact_header);
-        /* Fill MSR global status */
-        dom_vmce(d)->mcg_status = gstatus;
-        /* New node impact the domain, need another vMCE# injection*/
-        dom_vmce(d)->nr_injection++;
-        spin_unlock(&dom_vmce(d)->lock);
-
-        mce_printk(MCE_VERBOSE,"MCE: Found error @[BANK%d "
-                   "status %"PRIx64" addr %"PRIx64" domid %d]\n ",
-                   mc_bank->mc_bank, mc_bank->mc_status, mc_bank->mc_addr,
-                   mc_bank->mc_domid);
+        spin_unlock(&v->arch.vmce.lock);
     }
 
     return 0;
 }
 
-#if 0 /* currently unused */
-int vmce_domain_inject(
-    struct mcinfo_bank *bank, struct domain *d, struct mcinfo_global *global)
-{
-    int ret;
-
-    ret = fill_vmsr_data(bank, d, global->mc_gstatus);
-    if ( ret < 0 )
-        return ret;
-
-    return inject_vmce(d);
-}
-#endif
-
 static int is_hvm_vmce_ready(struct mcinfo_bank *bank, struct domain *d)
 {
     struct vcpu *v;
diff -r 8278d7d8fa48 -r 08b7e65a5d93 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c	Wed Sep 26 11:56:07 2012 +0200
+++ b/xen/arch/x86/domain.c	Wed Sep 26 12:04:00 2012 +0200
@@ -577,9 +577,6 @@ int arch_domain_create(struct domain *d,
 
         if ( (rc = iommu_domain_init(d)) != 0 )
             goto fail;
-
-        /* For Guest vMCE MSRs virtualization */
-        vmce_init_msr(d);
     }
 
     if ( is_hvm_domain(d) )
@@ -606,7 +603,6 @@ int arch_domain_create(struct domain *d,
 
  fail:
     d->is_dying = DOMDYING_dead;
-    vmce_destroy_msr(d);
     cleanup_domain_irq_mapping(d);
     free_xenheap_page(d->shared_info);
     if ( paging_initialised )
@@ -629,7 +625,6 @@ void arch_domain_destroy(struct domain *
     else
         xfree(d->arch.pv_domain.e820);
 
-    vmce_destroy_msr(d);
     free_domain_pirqs(d);
     if ( !is_idle_domain(d) )
         iommu_domain_destroy(d);
diff -r 8278d7d8fa48 -r 08b7e65a5d93 xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Wed Sep 26 11:56:07 2012 +0200
+++ b/xen/arch/x86/domctl.c	Wed Sep 26 12:04:00 2012 +0200
@@ -1066,7 +1066,7 @@ long arch_do_domctl(
                 evc->syscall32_callback_eip    = 0;
                 evc->syscall32_disables_events = 0;
             }
-            evc->mcg_cap = v->arch.mcg_cap;
+            evc->mcg_cap = v->arch.vmce.mcg_cap;
         }
         else
         {
diff -r 8278d7d8fa48 -r 08b7e65a5d93 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c	Wed Sep 26 11:56:07 2012 +0200
+++ b/xen/arch/x86/traps.c	Wed Sep 26 12:04:00 2012 +0200
@@ -3141,50 +3141,6 @@ void async_exception_cleanup(struct vcpu
                 break;
     ASSERT(trap <= VCPU_TRAP_LAST);
 
-    /* inject vMCE to PV_Guest including DOM0. */
-    if ( trap == VCPU_TRAP_MCE )
-    {
-        gdprintk(XENLOG_DEBUG, "MCE: Return from vMCE# trap!\n");
-        if ( curr->vcpu_id == 0 )
-        {
-            struct domain *d = curr->domain;
-
-            if ( !d->arch.vmca_msrs->nr_injection )
-            {
-                printk(XENLOG_WARNING "MCE: ret from vMCE#, "
-                       "no injection node\n");
-                goto end;
-            }
-
-            d->arch.vmca_msrs->nr_injection--;
-            if ( !list_empty(&d->arch.vmca_msrs->impact_header) )
-            {
-                struct bank_entry *entry;
-
-                entry = list_entry(d->arch.vmca_msrs->impact_header.next,
-                                   struct bank_entry, list);
-                gdprintk(XENLOG_DEBUG, "MCE: delete last injection node\n");
-                list_del(&entry->list);
-            }
-            else
-                printk(XENLOG_ERR "MCE: didn't found last injection node\n");
-
-            /* further injection */
-            if ( d->arch.vmca_msrs->nr_injection > 0 &&
-                 guest_has_trap_callback(d, 0, TRAP_machine_check) &&
-                 !test_and_set_bool(curr->mce_pending) )
-            {
-                int cpu = smp_processor_id();
-
-                cpumask_copy(curr->cpu_affinity_tmp, curr->cpu_affinity);
-                printk(XENLOG_DEBUG "MCE: CPU%d set affinity, old %d\n",
-                       cpu, curr->processor);
-                vcpu_set_affinity(curr, cpumask_of(cpu));
-            }
-        }
-    }
-
-end:
     /* Restore previous asynchronous exception mask. */
     curr->async_exception_mask = curr->async_exception_state(trap).old_mask;
 }
diff -r 8278d7d8fa48 -r 08b7e65a5d93 xen/include/asm-x86/domain.h
--- a/xen/include/asm-x86/domain.h	Wed Sep 26 11:56:07 2012 +0200
+++ b/xen/include/asm-x86/domain.h	Wed Sep 26 12:04:00 2012 +0200
@@ -296,9 +296,6 @@ struct arch_domain
 
     struct PITState vpit;
 
-    /* For Guest vMCA handling */
-    struct domain_mca_msrs *vmca_msrs;
-
     /* TSC management (emulation, pv, scaling, stats) */
     int tsc_mode;            /* see include/asm-x86/time.h */
     bool_t vtsc;             /* tsc is emulated (may change after migrate) */
@@ -438,8 +435,8 @@ struct arch_vcpu
      * and thus should be saved/restored. */
     bool_t nonlazy_xstate_used;
 
-    uint64_t mcg_cap;
-    
+    struct vmce vmce;
+
     struct paging_vcpu paging;
 
     uint32_t gdbsx_vcpu_event;
diff -r 8278d7d8fa48 -r 08b7e65a5d93 xen/include/asm-x86/mce.h
--- a/xen/include/asm-x86/mce.h	Wed Sep 26 11:56:07 2012 +0200
+++ b/xen/include/asm-x86/mce.h	Wed Sep 26 12:04:00 2012 +0200
@@ -3,28 +3,35 @@
 #ifndef _XEN_X86_MCE_H
 #define _XEN_X86_MCE_H
 
-/* This entry is for recording bank nodes for the impacted domain,
- * put into impact_header list. */
-struct bank_entry {
-    struct list_head list;
-    uint16_t bank;
+/*
+ * Emulate 2 banks for guest
+ * Bank0: reserved for 'bank0 quirk' occur at some very old processors:
+ *   1). Intel cpu whose family-model value < 06-1A;
+ *   2). AMD K7
+ * Bank1: used to transfer error info to guest
+ */
+#define GUEST_MC_BANK_NUM 2
+
+/* Filter MSCOD model specific error code to guest */
+#define MCi_STATUS_MSCOD_MASK (~(0xffffULL << 16))
+
+/* No mci_ctl since it stick all 1's */
+struct vmce_bank {
     uint64_t mci_status;
     uint64_t mci_addr;
     uint64_t mci_misc;
+    uint64_t mci_ctl2;
 };
 
-struct domain_mca_msrs
-{
-    /* Guest should not change below values after DOM boot up */
+/* No mcg_ctl since it not expose to guest */
+struct vmce {
+    uint64_t mcg_cap;
     uint64_t mcg_status;
-    uint16_t nr_injection;
-    struct list_head impact_header;
     spinlock_t lock;
+    struct vmce_bank bank[GUEST_MC_BANK_NUM];
 };
 
 /* Guest vMCE MSRs virtualization */
-extern int vmce_init_msr(struct domain *d);
-extern void vmce_destroy_msr(struct domain *d);
 extern void vmce_init_vcpu(struct vcpu *);
 extern int vmce_restore_vcpu(struct vcpu *, uint64_t caps);
 extern int vmce_wrmsr(uint32_t msr, uint64_t val);

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMe5-0008GS-Cl; Thu, 27 Sep 2012 22:33:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMe3-0008Dc-TU
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:24 +0000
Received: from [85.158.139.83:23986] by server-13.bemta-5.messagelabs.com id
	6A/D1-16359-334D4605; Thu, 27 Sep 2012 22:33:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1348785201!32277343!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5194 invoked from network); 27 Sep 2012 22:33:22 -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 Sep 2012 22:33: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 1THMe1-0007I5-9m
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMe1-0003s1-8a
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:21 +0000
Message-Id: <E1THMe1-0003s1-8a@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: Implement TSC adjust feature
	for HVM guest
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Liu, Jinsong <jinsong.liu@intel.com>
# Date 1348654362 -7200
# Node ID c47ef9592fb39325e33f8406b4bd736cc84482e5
# Parent  5d63c633a60b9a1d695594f9c17cf933240bec81
x86: Implement TSC adjust feature for HVM guest

IA32_TSC_ADJUST MSR is maintained separately for each logical
processor. A logical processor maintains and uses the IA32_TSC_ADJUST
MSR as follows:
1). On RESET, the value of the IA32_TSC_ADJUST MSR is 0;
2). If an execution of WRMSR to the IA32_TIME_STAMP_COUNTER MSR adds
    (or subtracts) value X from the TSC, the logical processor also
    adds (or subtracts) value X from the IA32_TSC_ADJUST MSR;
3). If an execution of WRMSR to the IA32_TSC_ADJUST MSR adds (or
    subtracts) value X from that MSR, the logical processor also adds
    (or subtracts) value X from the TSC.

This patch provides tsc adjust support for hvm guest, with it guest OS
would be happy when sync tsc.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 5d63c633a60b -r c47ef9592fb3 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Wed Sep 26 12:07:42 2012 +0200
+++ b/xen/arch/x86/hvm/hvm.c	Wed Sep 26 12:12:42 2012 +0200
@@ -237,6 +237,7 @@ int hvm_set_guest_pat(struct vcpu *v, u6
 void hvm_set_guest_tsc(struct vcpu *v, u64 guest_tsc)
 {
     uint64_t tsc;
+    uint64_t delta_tsc;
 
     if ( v->domain->arch.vtsc )
     {
@@ -248,10 +249,22 @@ void hvm_set_guest_tsc(struct vcpu *v, u
         rdtscll(tsc);
     }
 
-    v->arch.hvm_vcpu.cache_tsc_offset = guest_tsc - tsc;
+    delta_tsc = guest_tsc - tsc;
+    v->arch.hvm_vcpu.msr_tsc_adjust += delta_tsc
+                          - v->arch.hvm_vcpu.cache_tsc_offset;
+    v->arch.hvm_vcpu.cache_tsc_offset = delta_tsc;
+
     hvm_funcs.set_tsc_offset(v, v->arch.hvm_vcpu.cache_tsc_offset);
 }
 
+void hvm_set_guest_tsc_adjust(struct vcpu *v, u64 tsc_adjust)
+{
+    v->arch.hvm_vcpu.cache_tsc_offset += tsc_adjust
+                            - v->arch.hvm_vcpu.msr_tsc_adjust;
+    hvm_funcs.set_tsc_offset(v, v->arch.hvm_vcpu.cache_tsc_offset);
+    v->arch.hvm_vcpu.msr_tsc_adjust = tsc_adjust;
+}
+
 u64 hvm_get_guest_tsc(struct vcpu *v)
 {
     uint64_t tsc;
@@ -270,6 +283,11 @@ u64 hvm_get_guest_tsc(struct vcpu *v)
     return tsc + v->arch.hvm_vcpu.cache_tsc_offset;
 }
 
+u64 hvm_get_guest_tsc_adjust(struct vcpu *v)
+{
+    return v->arch.hvm_vcpu.msr_tsc_adjust;
+}
+
 void hvm_migrate_timers(struct vcpu *v)
 {
     rtc_migrate_timers(v);
@@ -2769,6 +2787,10 @@ int hvm_msr_read_intercept(unsigned int 
         *msr_content = hvm_get_guest_tsc(v);
         break;
 
+    case MSR_IA32_TSC_ADJUST:
+        *msr_content = hvm_get_guest_tsc_adjust(v);
+        break;
+
     case MSR_TSC_AUX:
         *msr_content = hvm_msr_tsc_aux(v);
         break;
@@ -2882,6 +2904,10 @@ int hvm_msr_write_intercept(unsigned int
         hvm_set_guest_tsc(v, msr_content);
         break;
 
+    case MSR_IA32_TSC_ADJUST:
+        hvm_set_guest_tsc_adjust(v, msr_content);
+        break;
+
     case MSR_TSC_AUX:
         v->arch.hvm_vcpu.msr_tsc_aux = (uint32_t)msr_content;
         if ( cpu_has_rdtscp
@@ -3429,6 +3455,8 @@ void hvm_vcpu_reset_state(struct vcpu *v
         v->domain->vcpu[0]->arch.hvm_vcpu.cache_tsc_offset;
     hvm_funcs.set_tsc_offset(v, v->arch.hvm_vcpu.cache_tsc_offset);
 
+    v->arch.hvm_vcpu.msr_tsc_adjust = 0;
+
     paging_update_paging_modes(v);
 
     v->arch.flags |= TF_kernel_mode;
diff -r 5d63c633a60b -r c47ef9592fb3 xen/include/asm-x86/hvm/vcpu.h
--- a/xen/include/asm-x86/hvm/vcpu.h	Wed Sep 26 12:07:42 2012 +0200
+++ b/xen/include/asm-x86/hvm/vcpu.h	Wed Sep 26 12:12:42 2012 +0200
@@ -137,6 +137,7 @@ struct hvm_vcpu {
     struct hvm_vcpu_asid n1asid;
 
     u32                 msr_tsc_aux;
+    u64                 msr_tsc_adjust;
 
     /* VPMU */
     struct vpmu_struct  vpmu;
diff -r 5d63c633a60b -r c47ef9592fb3 xen/include/asm-x86/msr-index.h
--- a/xen/include/asm-x86/msr-index.h	Wed Sep 26 12:07:42 2012 +0200
+++ b/xen/include/asm-x86/msr-index.h	Wed Sep 26 12:12:42 2012 +0200
@@ -289,6 +289,7 @@
 #define MSR_IA32_PLATFORM_ID		0x00000017
 #define MSR_IA32_EBL_CR_POWERON		0x0000002a
 #define MSR_IA32_EBC_FREQUENCY_ID	0x0000002c
+#define MSR_IA32_TSC_ADJUST		0x0000003b
 
 #define MSR_IA32_APICBASE		0x0000001b
 #define MSR_IA32_APICBASE_BSP		(1<<8)

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMe5-0008GS-Cl; Thu, 27 Sep 2012 22:33:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMe3-0008Dc-TU
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:24 +0000
Received: from [85.158.139.83:23986] by server-13.bemta-5.messagelabs.com id
	6A/D1-16359-334D4605; Thu, 27 Sep 2012 22:33:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1348785201!32277343!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5194 invoked from network); 27 Sep 2012 22:33:22 -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 Sep 2012 22:33: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 1THMe1-0007I5-9m
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMe1-0003s1-8a
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:21 +0000
Message-Id: <E1THMe1-0003s1-8a@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: Implement TSC adjust feature
	for HVM guest
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Liu, Jinsong <jinsong.liu@intel.com>
# Date 1348654362 -7200
# Node ID c47ef9592fb39325e33f8406b4bd736cc84482e5
# Parent  5d63c633a60b9a1d695594f9c17cf933240bec81
x86: Implement TSC adjust feature for HVM guest

IA32_TSC_ADJUST MSR is maintained separately for each logical
processor. A logical processor maintains and uses the IA32_TSC_ADJUST
MSR as follows:
1). On RESET, the value of the IA32_TSC_ADJUST MSR is 0;
2). If an execution of WRMSR to the IA32_TIME_STAMP_COUNTER MSR adds
    (or subtracts) value X from the TSC, the logical processor also
    adds (or subtracts) value X from the IA32_TSC_ADJUST MSR;
3). If an execution of WRMSR to the IA32_TSC_ADJUST MSR adds (or
    subtracts) value X from that MSR, the logical processor also adds
    (or subtracts) value X from the TSC.

This patch provides tsc adjust support for hvm guest, with it guest OS
would be happy when sync tsc.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 5d63c633a60b -r c47ef9592fb3 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Wed Sep 26 12:07:42 2012 +0200
+++ b/xen/arch/x86/hvm/hvm.c	Wed Sep 26 12:12:42 2012 +0200
@@ -237,6 +237,7 @@ int hvm_set_guest_pat(struct vcpu *v, u6
 void hvm_set_guest_tsc(struct vcpu *v, u64 guest_tsc)
 {
     uint64_t tsc;
+    uint64_t delta_tsc;
 
     if ( v->domain->arch.vtsc )
     {
@@ -248,10 +249,22 @@ void hvm_set_guest_tsc(struct vcpu *v, u
         rdtscll(tsc);
     }
 
-    v->arch.hvm_vcpu.cache_tsc_offset = guest_tsc - tsc;
+    delta_tsc = guest_tsc - tsc;
+    v->arch.hvm_vcpu.msr_tsc_adjust += delta_tsc
+                          - v->arch.hvm_vcpu.cache_tsc_offset;
+    v->arch.hvm_vcpu.cache_tsc_offset = delta_tsc;
+
     hvm_funcs.set_tsc_offset(v, v->arch.hvm_vcpu.cache_tsc_offset);
 }
 
+void hvm_set_guest_tsc_adjust(struct vcpu *v, u64 tsc_adjust)
+{
+    v->arch.hvm_vcpu.cache_tsc_offset += tsc_adjust
+                            - v->arch.hvm_vcpu.msr_tsc_adjust;
+    hvm_funcs.set_tsc_offset(v, v->arch.hvm_vcpu.cache_tsc_offset);
+    v->arch.hvm_vcpu.msr_tsc_adjust = tsc_adjust;
+}
+
 u64 hvm_get_guest_tsc(struct vcpu *v)
 {
     uint64_t tsc;
@@ -270,6 +283,11 @@ u64 hvm_get_guest_tsc(struct vcpu *v)
     return tsc + v->arch.hvm_vcpu.cache_tsc_offset;
 }
 
+u64 hvm_get_guest_tsc_adjust(struct vcpu *v)
+{
+    return v->arch.hvm_vcpu.msr_tsc_adjust;
+}
+
 void hvm_migrate_timers(struct vcpu *v)
 {
     rtc_migrate_timers(v);
@@ -2769,6 +2787,10 @@ int hvm_msr_read_intercept(unsigned int 
         *msr_content = hvm_get_guest_tsc(v);
         break;
 
+    case MSR_IA32_TSC_ADJUST:
+        *msr_content = hvm_get_guest_tsc_adjust(v);
+        break;
+
     case MSR_TSC_AUX:
         *msr_content = hvm_msr_tsc_aux(v);
         break;
@@ -2882,6 +2904,10 @@ int hvm_msr_write_intercept(unsigned int
         hvm_set_guest_tsc(v, msr_content);
         break;
 
+    case MSR_IA32_TSC_ADJUST:
+        hvm_set_guest_tsc_adjust(v, msr_content);
+        break;
+
     case MSR_TSC_AUX:
         v->arch.hvm_vcpu.msr_tsc_aux = (uint32_t)msr_content;
         if ( cpu_has_rdtscp
@@ -3429,6 +3455,8 @@ void hvm_vcpu_reset_state(struct vcpu *v
         v->domain->vcpu[0]->arch.hvm_vcpu.cache_tsc_offset;
     hvm_funcs.set_tsc_offset(v, v->arch.hvm_vcpu.cache_tsc_offset);
 
+    v->arch.hvm_vcpu.msr_tsc_adjust = 0;
+
     paging_update_paging_modes(v);
 
     v->arch.flags |= TF_kernel_mode;
diff -r 5d63c633a60b -r c47ef9592fb3 xen/include/asm-x86/hvm/vcpu.h
--- a/xen/include/asm-x86/hvm/vcpu.h	Wed Sep 26 12:07:42 2012 +0200
+++ b/xen/include/asm-x86/hvm/vcpu.h	Wed Sep 26 12:12:42 2012 +0200
@@ -137,6 +137,7 @@ struct hvm_vcpu {
     struct hvm_vcpu_asid n1asid;
 
     u32                 msr_tsc_aux;
+    u64                 msr_tsc_adjust;
 
     /* VPMU */
     struct vpmu_struct  vpmu;
diff -r 5d63c633a60b -r c47ef9592fb3 xen/include/asm-x86/msr-index.h
--- a/xen/include/asm-x86/msr-index.h	Wed Sep 26 12:07:42 2012 +0200
+++ b/xen/include/asm-x86/msr-index.h	Wed Sep 26 12:12:42 2012 +0200
@@ -289,6 +289,7 @@
 #define MSR_IA32_PLATFORM_ID		0x00000017
 #define MSR_IA32_EBL_CR_POWERON		0x0000002a
 #define MSR_IA32_EBC_FREQUENCY_ID	0x0000002c
+#define MSR_IA32_TSC_ADJUST		0x0000003b
 
 #define MSR_IA32_APICBASE		0x0000001b
 #define MSR_IA32_APICBASE_BSP		(1<<8)

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMe5-0008Gg-Hl; Thu, 27 Sep 2012 22:33:25 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMe4-00081M-PJ
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:24 +0000
Received: from [85.158.143.35:2736] by server-3.bemta-4.messagelabs.com id
	23/70-10986-434D4605; Thu, 27 Sep 2012 22:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-21.messagelabs.com!1348785203!5431276!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 542 invoked from network); 27 Sep 2012 22:33:23 -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;
	27 Sep 2012 22:33: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 1THMe2-0007IR-UA
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMe2-0003sk-SA
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:22 +0000
Message-Id: <E1THMe2-0003sk-SA@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: default-disable MWAIT-based
	idle driver for CPUs without ARAT
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348672299 -7200
# Node ID 6bf8b882df8f66ab5500e4d9cc0c3338ae5a6cb9
# Parent  3aa66543a51ba77cb73e8c874e2416d065426a22
x86: default-disable MWAIT-based idle driver for CPUs without ARAT

Without ARAT, and apparently only when using HPET broadcast mode as
replacement, CPUs occasionally fail to wake up, causing the system to
(transiently) hang. Until the reason is understood, disable the driver
on such systems.

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


diff -r 3aa66543a51b -r 6bf8b882df8f xen/arch/x86/cpu/mwait-idle.c
--- a/xen/arch/x86/cpu/mwait-idle.c	Wed Sep 26 12:14:30 2012 +0200
+++ b/xen/arch/x86/cpu/mwait-idle.c	Wed Sep 26 17:11:39 2012 +0200
@@ -71,7 +71,7 @@
 # define pr_debug(fmt...)
 #endif
 
-static __initdata bool_t no_mwait_idle;
+static __initdata s8 no_mwait_idle = -1;
 invbool_param("mwait-idle", no_mwait_idle);
 
 static unsigned int mwait_substates;
@@ -500,6 +500,13 @@ int __init mwait_idle_init(struct notifi
 	if (pm_idle_save)
 		return -ENODEV;
 
+	/* XXX The no-ARAT case is supposedly being taken care of, but at
+	 * least some systems without ARAT hang for some reason, apparently
+	 * only when using HPET broadcast mode (PIT broadcast mode seems to
+	 * be fine). */
+	if (no_mwait_idle < 0 && boot_cpu_has(X86_FEATURE_ARAT))
+		no_mwait_idle = 0;
+
 	err = mwait_idle_probe();
 	if (!err) {
 		if (!boot_cpu_has(X86_FEATURE_ARAT))

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMe5-0008H3-MU; Thu, 27 Sep 2012 22:33:25 +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 1THMe4-0008EI-NJ
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:24 +0000
Received: from [85.158.137.99:37775] by server-7.bemta-3.messagelabs.com id
	23/B0-15765-334D4605; Thu, 27 Sep 2012 22:33:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-217.messagelabs.com!1348785202!19443876!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13450 invoked from network); 27 Sep 2012 22:33:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Sep 2012 22:33: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 1THMe1-0007IE-Qx
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMe1-0003sG-Pn
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:21 +0000
Message-Id: <E1THMe1-0003sG-Pn@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: Save/restore TSC adjust during
	HVM guest migration
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Liu, Jinsong <jinsong.liu@intel.com>
# Date 1348654418 -7200
# Node ID 56fb977ce6eb4626a02d4a7a34e85009bb8ee3e0
# Parent  c47ef9592fb39325e33f8406b4bd736cc84482e5
x86: Save/restore TSC adjust during HVM guest migration

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r c47ef9592fb3 -r 56fb977ce6eb tools/misc/xen-hvmctx.c
--- a/tools/misc/xen-hvmctx.c	Wed Sep 26 12:12:42 2012 +0200
+++ b/tools/misc/xen-hvmctx.c	Wed Sep 26 12:13:38 2012 +0200
@@ -392,6 +392,13 @@ static void dump_vmce_vcpu(void)
     printf("    VMCE_VCPU: bank1 mci_ctl2 %" PRIx64 "\n", p.mci_ctl2_bank1);
 }
 
+static void dump_tsc_adjust(void)
+{
+    HVM_SAVE_TYPE(TSC_ADJUST) p;
+    READ(p);
+    printf("    TSC_ADJUST: tsc_adjust %" PRIx64 "\n", p.tsc_adjust);
+}
+
 int main(int argc, char **argv)
 {
     int entry, domid;
@@ -459,6 +466,7 @@ int main(int argc, char **argv)
         case HVM_SAVE_CODE(VIRIDIAN_DOMAIN): dump_viridian_domain(); break;
         case HVM_SAVE_CODE(VIRIDIAN_VCPU): dump_viridian_vcpu(); break;
         case HVM_SAVE_CODE(VMCE_VCPU): dump_vmce_vcpu(); break;
+        case HVM_SAVE_CODE(TSC_ADJUST): dump_tsc_adjust(); break;
         case HVM_SAVE_CODE(END): break;
         default:
             printf(" ** Don't understand type %u: skipping\n",
diff -r c47ef9592fb3 -r 56fb977ce6eb xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Wed Sep 26 12:12:42 2012 +0200
+++ b/xen/arch/x86/hvm/hvm.c	Wed Sep 26 12:13:38 2012 +0200
@@ -603,6 +603,46 @@ void hvm_domain_destroy(struct domain *d
     hvm_destroy_cacheattr_region_list(d);
 }
 
+static int hvm_save_tsc_adjust(struct domain *d, hvm_domain_context_t *h)
+{
+    struct vcpu *v;
+    struct hvm_tsc_adjust ctxt;
+    int err = 0;
+
+    for_each_vcpu ( d, v )
+    {
+        ctxt.tsc_adjust = v->arch.hvm_vcpu.msr_tsc_adjust;
+        err = hvm_save_entry(TSC_ADJUST, v->vcpu_id, h, &ctxt);
+        if ( err )
+            break;
+    }
+
+    return err;
+}
+
+static int hvm_load_tsc_adjust(struct domain *d, hvm_domain_context_t *h)
+{
+    unsigned int vcpuid = hvm_load_instance(h);
+    struct vcpu *v;
+    struct hvm_tsc_adjust ctxt;
+
+    if ( vcpuid >= d->max_vcpus || (v = d->vcpu[vcpuid]) == NULL )
+    {
+        dprintk(XENLOG_G_ERR, "HVM restore: dom%d has no vcpu%u\n",
+                d->domain_id, vcpuid);
+        return -EINVAL;
+    }
+
+    if ( hvm_load_entry(TSC_ADJUST, h, &ctxt) != 0 )
+        return -EINVAL;
+
+    v->arch.hvm_vcpu.msr_tsc_adjust = ctxt.tsc_adjust;
+    return 0;
+}
+
+HVM_REGISTER_SAVE_RESTORE(TSC_ADJUST, hvm_save_tsc_adjust,
+                          hvm_load_tsc_adjust, 1, HVMSR_PER_VCPU);
+
 static int hvm_save_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
 {
     struct vcpu *v;
diff -r c47ef9592fb3 -r 56fb977ce6eb xen/include/public/arch-x86/hvm/save.h
--- a/xen/include/public/arch-x86/hvm/save.h	Wed Sep 26 12:12:42 2012 +0200
+++ b/xen/include/public/arch-x86/hvm/save.h	Wed Sep 26 12:13:38 2012 +0200
@@ -583,9 +583,15 @@ struct hvm_vmce_vcpu {
 
 DECLARE_HVM_SAVE_TYPE(VMCE_VCPU, 18, struct hvm_vmce_vcpu);
 
+struct hvm_tsc_adjust {
+    uint64_t tsc_adjust;
+};
+
+DECLARE_HVM_SAVE_TYPE(TSC_ADJUST, 19, struct hvm_tsc_adjust);
+
 /* 
  * Largest type-code in use
  */
-#define HVM_SAVE_CODE_MAX 18
+#define HVM_SAVE_CODE_MAX 19
 
 #endif /* __XEN_PUBLIC_HVM_SAVE_X86_H__ */

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMe5-0008H3-MU; Thu, 27 Sep 2012 22:33:25 +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 1THMe4-0008EI-NJ
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:24 +0000
Received: from [85.158.137.99:37775] by server-7.bemta-3.messagelabs.com id
	23/B0-15765-334D4605; Thu, 27 Sep 2012 22:33:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-217.messagelabs.com!1348785202!19443876!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13450 invoked from network); 27 Sep 2012 22:33:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Sep 2012 22:33: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 1THMe1-0007IE-Qx
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMe1-0003sG-Pn
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:21 +0000
Message-Id: <E1THMe1-0003sG-Pn@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: Save/restore TSC adjust during
	HVM guest migration
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Liu, Jinsong <jinsong.liu@intel.com>
# Date 1348654418 -7200
# Node ID 56fb977ce6eb4626a02d4a7a34e85009bb8ee3e0
# Parent  c47ef9592fb39325e33f8406b4bd736cc84482e5
x86: Save/restore TSC adjust during HVM guest migration

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r c47ef9592fb3 -r 56fb977ce6eb tools/misc/xen-hvmctx.c
--- a/tools/misc/xen-hvmctx.c	Wed Sep 26 12:12:42 2012 +0200
+++ b/tools/misc/xen-hvmctx.c	Wed Sep 26 12:13:38 2012 +0200
@@ -392,6 +392,13 @@ static void dump_vmce_vcpu(void)
     printf("    VMCE_VCPU: bank1 mci_ctl2 %" PRIx64 "\n", p.mci_ctl2_bank1);
 }
 
+static void dump_tsc_adjust(void)
+{
+    HVM_SAVE_TYPE(TSC_ADJUST) p;
+    READ(p);
+    printf("    TSC_ADJUST: tsc_adjust %" PRIx64 "\n", p.tsc_adjust);
+}
+
 int main(int argc, char **argv)
 {
     int entry, domid;
@@ -459,6 +466,7 @@ int main(int argc, char **argv)
         case HVM_SAVE_CODE(VIRIDIAN_DOMAIN): dump_viridian_domain(); break;
         case HVM_SAVE_CODE(VIRIDIAN_VCPU): dump_viridian_vcpu(); break;
         case HVM_SAVE_CODE(VMCE_VCPU): dump_vmce_vcpu(); break;
+        case HVM_SAVE_CODE(TSC_ADJUST): dump_tsc_adjust(); break;
         case HVM_SAVE_CODE(END): break;
         default:
             printf(" ** Don't understand type %u: skipping\n",
diff -r c47ef9592fb3 -r 56fb977ce6eb xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Wed Sep 26 12:12:42 2012 +0200
+++ b/xen/arch/x86/hvm/hvm.c	Wed Sep 26 12:13:38 2012 +0200
@@ -603,6 +603,46 @@ void hvm_domain_destroy(struct domain *d
     hvm_destroy_cacheattr_region_list(d);
 }
 
+static int hvm_save_tsc_adjust(struct domain *d, hvm_domain_context_t *h)
+{
+    struct vcpu *v;
+    struct hvm_tsc_adjust ctxt;
+    int err = 0;
+
+    for_each_vcpu ( d, v )
+    {
+        ctxt.tsc_adjust = v->arch.hvm_vcpu.msr_tsc_adjust;
+        err = hvm_save_entry(TSC_ADJUST, v->vcpu_id, h, &ctxt);
+        if ( err )
+            break;
+    }
+
+    return err;
+}
+
+static int hvm_load_tsc_adjust(struct domain *d, hvm_domain_context_t *h)
+{
+    unsigned int vcpuid = hvm_load_instance(h);
+    struct vcpu *v;
+    struct hvm_tsc_adjust ctxt;
+
+    if ( vcpuid >= d->max_vcpus || (v = d->vcpu[vcpuid]) == NULL )
+    {
+        dprintk(XENLOG_G_ERR, "HVM restore: dom%d has no vcpu%u\n",
+                d->domain_id, vcpuid);
+        return -EINVAL;
+    }
+
+    if ( hvm_load_entry(TSC_ADJUST, h, &ctxt) != 0 )
+        return -EINVAL;
+
+    v->arch.hvm_vcpu.msr_tsc_adjust = ctxt.tsc_adjust;
+    return 0;
+}
+
+HVM_REGISTER_SAVE_RESTORE(TSC_ADJUST, hvm_save_tsc_adjust,
+                          hvm_load_tsc_adjust, 1, HVMSR_PER_VCPU);
+
 static int hvm_save_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
 {
     struct vcpu *v;
diff -r c47ef9592fb3 -r 56fb977ce6eb xen/include/public/arch-x86/hvm/save.h
--- a/xen/include/public/arch-x86/hvm/save.h	Wed Sep 26 12:12:42 2012 +0200
+++ b/xen/include/public/arch-x86/hvm/save.h	Wed Sep 26 12:13:38 2012 +0200
@@ -583,9 +583,15 @@ struct hvm_vmce_vcpu {
 
 DECLARE_HVM_SAVE_TYPE(VMCE_VCPU, 18, struct hvm_vmce_vcpu);
 
+struct hvm_tsc_adjust {
+    uint64_t tsc_adjust;
+};
+
+DECLARE_HVM_SAVE_TYPE(TSC_ADJUST, 19, struct hvm_tsc_adjust);
+
 /* 
  * Largest type-code in use
  */
-#define HVM_SAVE_CODE_MAX 18
+#define HVM_SAVE_CODE_MAX 19
 
 #endif /* __XEN_PUBLIC_HVM_SAVE_X86_H__ */

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMe5-0008Gg-Hl; Thu, 27 Sep 2012 22:33:25 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMe4-00081M-PJ
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:24 +0000
Received: from [85.158.143.35:2736] by server-3.bemta-4.messagelabs.com id
	23/70-10986-434D4605; Thu, 27 Sep 2012 22:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-21.messagelabs.com!1348785203!5431276!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 542 invoked from network); 27 Sep 2012 22:33:23 -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;
	27 Sep 2012 22:33: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 1THMe2-0007IR-UA
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMe2-0003sk-SA
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:22 +0000
Message-Id: <E1THMe2-0003sk-SA@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: default-disable MWAIT-based
	idle driver for CPUs without ARAT
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348672299 -7200
# Node ID 6bf8b882df8f66ab5500e4d9cc0c3338ae5a6cb9
# Parent  3aa66543a51ba77cb73e8c874e2416d065426a22
x86: default-disable MWAIT-based idle driver for CPUs without ARAT

Without ARAT, and apparently only when using HPET broadcast mode as
replacement, CPUs occasionally fail to wake up, causing the system to
(transiently) hang. Until the reason is understood, disable the driver
on such systems.

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


diff -r 3aa66543a51b -r 6bf8b882df8f xen/arch/x86/cpu/mwait-idle.c
--- a/xen/arch/x86/cpu/mwait-idle.c	Wed Sep 26 12:14:30 2012 +0200
+++ b/xen/arch/x86/cpu/mwait-idle.c	Wed Sep 26 17:11:39 2012 +0200
@@ -71,7 +71,7 @@
 # define pr_debug(fmt...)
 #endif
 
-static __initdata bool_t no_mwait_idle;
+static __initdata s8 no_mwait_idle = -1;
 invbool_param("mwait-idle", no_mwait_idle);
 
 static unsigned int mwait_substates;
@@ -500,6 +500,13 @@ int __init mwait_idle_init(struct notifi
 	if (pm_idle_save)
 		return -ENODEV;
 
+	/* XXX The no-ARAT case is supposedly being taken care of, but at
+	 * least some systems without ARAT hang for some reason, apparently
+	 * only when using HPET broadcast mode (PIT broadcast mode seems to
+	 * be fine). */
+	if (no_mwait_idle < 0 && boot_cpu_has(X86_FEATURE_ARAT))
+		no_mwait_idle = 0;
+
 	err = mwait_idle_probe();
 	if (!err) {
 		if (!boot_cpu_has(X86_FEATURE_ARAT))

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMe5-0008HK-S8; Thu, 27 Sep 2012 22:33:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMe4-0008EX-Oa
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:24 +0000
Received: from [85.158.139.211:3321] by server-3.bemta-5.messagelabs.com id
	06/52-16108-434D4605; Thu, 27 Sep 2012 22:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-206.messagelabs.com!1348785202!20229998!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11948 invoked from network); 27 Sep 2012 22:33:23 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Sep 2012 22:33: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 1THMe2-0007IM-CC
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMe2-0003sV-AS
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:22 +0000
Message-Id: <E1THMe2-0003sV-AS@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: Expose TSC adjust to HVM guest
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Liu, Jinsong <jinsong.liu@intel.com>
# Date 1348654470 -7200
# Node ID 3aa66543a51ba77cb73e8c874e2416d065426a22
# Parent  56fb977ce6eb4626a02d4a7a34e85009bb8ee3e0
x86: Expose TSC adjust to HVM guest

Intel latest SDM (17.13.3) release a new MSR CPUID.7.0.EBX[1]=1
indicates TSC_ADJUST MSR 0x3b is supported.

This patch expose it to hvm guest.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 56fb977ce6eb -r 3aa66543a51b tools/libxc/xc_cpufeature.h
--- a/tools/libxc/xc_cpufeature.h	Wed Sep 26 12:13:38 2012 +0200
+++ b/tools/libxc/xc_cpufeature.h	Wed Sep 26 12:14:30 2012 +0200
@@ -128,6 +128,7 @@
 
 /* Intel-defined CPU features, CPUID level 0x00000007:0 (ebx) */
 #define X86_FEATURE_FSGSBASE     0 /* {RD,WR}{FS,GS}BASE instructions */
+#define X86_FEATURE_TSC_ADJUST   1 /* Tsc thread offset */
 #define X86_FEATURE_BMI1         3 /* 1st group bit manipulation extensions */
 #define X86_FEATURE_HLE          4 /* Hardware Lock Elision */
 #define X86_FEATURE_AVX2         5 /* AVX2 instructions */
diff -r 56fb977ce6eb -r 3aa66543a51b tools/libxc/xc_cpuid_x86.c
--- a/tools/libxc/xc_cpuid_x86.c	Wed Sep 26 12:13:38 2012 +0200
+++ b/tools/libxc/xc_cpuid_x86.c	Wed Sep 26 12:14:30 2012 +0200
@@ -362,7 +362,8 @@ static void xc_cpuid_hvm_policy(
 
     case 0x00000007: /* Intel-defined CPU features */
         if ( input[1] == 0 ) {
-            regs[1] &= (bitmaskof(X86_FEATURE_BMI1) |
+            regs[1] &= (bitmaskof(X86_FEATURE_TSC_ADJUST) |
+                        bitmaskof(X86_FEATURE_BMI1) |
                         bitmaskof(X86_FEATURE_HLE)  |
                         bitmaskof(X86_FEATURE_AVX2) |
                         bitmaskof(X86_FEATURE_SMEP) |

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

From xen-changelog-bounces@lists.xen.org Thu Sep 27 22:33:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Sep 2012 22: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.xen.org>)
	id 1THMe5-0008HK-S8; Thu, 27 Sep 2012 22:33:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMe4-0008EX-Oa
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:24 +0000
Received: from [85.158.139.211:3321] by server-3.bemta-5.messagelabs.com id
	06/52-16108-434D4605; Thu, 27 Sep 2012 22:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-206.messagelabs.com!1348785202!20229998!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11948 invoked from network); 27 Sep 2012 22:33:23 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Sep 2012 22:33: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 1THMe2-0007IM-CC
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THMe2-0003sV-AS
	for xen-changelog@lists.xensource.com; Thu, 27 Sep 2012 22:33:22 +0000
Message-Id: <E1THMe2-0003sV-AS@xenbits.xen.org>
Date: Thu, 27 Sep 2012 22:33:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: Expose TSC adjust to HVM guest
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Liu, Jinsong <jinsong.liu@intel.com>
# Date 1348654470 -7200
# Node ID 3aa66543a51ba77cb73e8c874e2416d065426a22
# Parent  56fb977ce6eb4626a02d4a7a34e85009bb8ee3e0
x86: Expose TSC adjust to HVM guest

Intel latest SDM (17.13.3) release a new MSR CPUID.7.0.EBX[1]=1
indicates TSC_ADJUST MSR 0x3b is supported.

This patch expose it to hvm guest.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 56fb977ce6eb -r 3aa66543a51b tools/libxc/xc_cpufeature.h
--- a/tools/libxc/xc_cpufeature.h	Wed Sep 26 12:13:38 2012 +0200
+++ b/tools/libxc/xc_cpufeature.h	Wed Sep 26 12:14:30 2012 +0200
@@ -128,6 +128,7 @@
 
 /* Intel-defined CPU features, CPUID level 0x00000007:0 (ebx) */
 #define X86_FEATURE_FSGSBASE     0 /* {RD,WR}{FS,GS}BASE instructions */
+#define X86_FEATURE_TSC_ADJUST   1 /* Tsc thread offset */
 #define X86_FEATURE_BMI1         3 /* 1st group bit manipulation extensions */
 #define X86_FEATURE_HLE          4 /* Hardware Lock Elision */
 #define X86_FEATURE_AVX2         5 /* AVX2 instructions */
diff -r 56fb977ce6eb -r 3aa66543a51b tools/libxc/xc_cpuid_x86.c
--- a/tools/libxc/xc_cpuid_x86.c	Wed Sep 26 12:13:38 2012 +0200
+++ b/tools/libxc/xc_cpuid_x86.c	Wed Sep 26 12:14:30 2012 +0200
@@ -362,7 +362,8 @@ static void xc_cpuid_hvm_policy(
 
     case 0x00000007: /* Intel-defined CPU features */
         if ( input[1] == 0 ) {
-            regs[1] &= (bitmaskof(X86_FEATURE_BMI1) |
+            regs[1] &= (bitmaskof(X86_FEATURE_TSC_ADJUST) |
+                        bitmaskof(X86_FEATURE_BMI1) |
                         bitmaskof(X86_FEATURE_HLE)  |
                         bitmaskof(X86_FEATURE_AVX2) |
                         bitmaskof(X86_FEATURE_SMEP) |

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

From xen-changelog-bounces@lists.xen.org Fri Sep 28 15:11:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Sep 2012 15:11:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1THcDi-0007Ma-Iv; Fri, 28 Sep 2012 15:11:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THcDg-0007Lh-Mo
	for xen-changelog@lists.xensource.com; Fri, 28 Sep 2012 15:11:12 +0000
Received: from [85.158.139.211:59201] by server-3.bemta-5.messagelabs.com id
	B9/28-16108-01EB5605; Fri, 28 Sep 2012 15:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-206.messagelabs.com!1348845070!16373323!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26610 invoked from network); 28 Sep 2012 15:11:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Sep 2012 15:11: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 1THcDe-0002fO-Ff
	for xen-changelog@lists.xensource.com; Fri, 28 Sep 2012 15:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THcDe-00044P-Ds
	for xen-changelog@lists.xensource.com; Fri, 28 Sep 2012 15:11:10 +0000
Message-Id: <E1THcDe-00044P-Ds@xenbits.xen.org>
Date: Fri, 28 Sep 2012 15:11:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/ucode: fix Intel case of resume
	handling on boot CPU
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348817291 -7200
# Node ID 4496d56c68a0e57ed9f03b482028093f1e7fdf6c
# Parent  00c05b9d76247d063a8ebc75050246e488323f50
x86/ucode: fix Intel case of resume handling on boot CPU

Checking the stored version doesn't tell us anything about the need to
apply the update (during resume, what is stored doesn't necessarily
match what is loaded).

Note that the check can be removed altogether because once switched to
use what was read from the CPU (uci->cpu_sig.rev, as used in the
subsequent pr_debug()), it would become redundant with the checks that
lead to microcode_update_match() returning the indication that an
update should be applied.

Note further that this was not an issue on APs since they start with
uci->mc.mc_intel being NULL.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Ben Guthro <ben@guthro.net>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 00c05b9d7624 -r 4496d56c68a0 xen/arch/x86/microcode_intel.c
--- a/xen/arch/x86/microcode_intel.c	Fri Sep 28 09:26:46 2012 +0200
+++ b/xen/arch/x86/microcode_intel.c	Fri Sep 28 09:28:11 2012 +0200
@@ -261,8 +261,6 @@ static int get_matching_microcode(const 
     }
     return 0;
  find:
-    if ( uci->mc.mc_intel && uci->mc.mc_intel->hdr.rev >= mc_header->rev )
-        return 0;
     pr_debug("microcode: CPU%d found a matching microcode update with"
              " version %#x (current=%#x)\n",
              cpu, mc_header->rev, uci->cpu_sig.rev);

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

From xen-changelog-bounces@lists.xen.org Fri Sep 28 15:11:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Sep 2012 15:11:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1THcDi-0007Ma-Iv; Fri, 28 Sep 2012 15:11:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THcDg-0007Lh-Mo
	for xen-changelog@lists.xensource.com; Fri, 28 Sep 2012 15:11:12 +0000
Received: from [85.158.139.211:59201] by server-3.bemta-5.messagelabs.com id
	B9/28-16108-01EB5605; Fri, 28 Sep 2012 15:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-206.messagelabs.com!1348845070!16373323!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26610 invoked from network); 28 Sep 2012 15:11:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Sep 2012 15:11: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 1THcDe-0002fO-Ff
	for xen-changelog@lists.xensource.com; Fri, 28 Sep 2012 15:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THcDe-00044P-Ds
	for xen-changelog@lists.xensource.com; Fri, 28 Sep 2012 15:11:10 +0000
Message-Id: <E1THcDe-00044P-Ds@xenbits.xen.org>
Date: Fri, 28 Sep 2012 15:11:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/ucode: fix Intel case of resume
	handling on boot CPU
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348817291 -7200
# Node ID 4496d56c68a0e57ed9f03b482028093f1e7fdf6c
# Parent  00c05b9d76247d063a8ebc75050246e488323f50
x86/ucode: fix Intel case of resume handling on boot CPU

Checking the stored version doesn't tell us anything about the need to
apply the update (during resume, what is stored doesn't necessarily
match what is loaded).

Note that the check can be removed altogether because once switched to
use what was read from the CPU (uci->cpu_sig.rev, as used in the
subsequent pr_debug()), it would become redundant with the checks that
lead to microcode_update_match() returning the indication that an
update should be applied.

Note further that this was not an issue on APs since they start with
uci->mc.mc_intel being NULL.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Ben Guthro <ben@guthro.net>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 00c05b9d7624 -r 4496d56c68a0 xen/arch/x86/microcode_intel.c
--- a/xen/arch/x86/microcode_intel.c	Fri Sep 28 09:26:46 2012 +0200
+++ b/xen/arch/x86/microcode_intel.c	Fri Sep 28 09:28:11 2012 +0200
@@ -261,8 +261,6 @@ static int get_matching_microcode(const 
     }
     return 0;
  find:
-    if ( uci->mc.mc_intel && uci->mc.mc_intel->hdr.rev >= mc_header->rev )
-        return 0;
     pr_debug("microcode: CPU%d found a matching microcode update with"
              " version %#x (current=%#x)\n",
              cpu, mc_header->rev, uci->cpu_sig.rev);

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

From xen-changelog-bounces@lists.xen.org Fri Sep 28 15:11:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Sep 2012 15:11:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1THcDi-0007Mf-LQ; Fri, 28 Sep 2012 15:11:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THcDh-0007M4-9M
	for xen-changelog@lists.xensource.com; Fri, 28 Sep 2012 15:11:13 +0000
Received: from [85.158.143.35:38847] by server-2.bemta-4.messagelabs.com id
	E5/CC-06610-01EB5605; Fri, 28 Sep 2012 15:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-21.messagelabs.com!1348845070!13177045!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30740 invoked from network); 28 Sep 2012 15:11: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;
	28 Sep 2012 15:11: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 1THcDe-0002fL-8I
	for xen-changelog@lists.xensource.com; Fri, 28 Sep 2012 15:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THcDd-00044A-Si
	for xen-changelog@lists.xensource.com; Fri, 28 Sep 2012 15:11:09 +0000
Message-Id: <E1THcDd-00044A-Si@xenbits.xen.org>
Date: Fri, 28 Sep 2012 15:11:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: remove further code applicable
	to 32-bit CPUs only
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348817206 -7200
# Node ID 00c05b9d76247d063a8ebc75050246e488323f50
# Parent  b7de1713ab8d280b36ebad86254801bea5041537
x86: remove further code applicable to 32-bit CPUs only

On the AMD side, anything prior to family 0xf can now be ignored, as
well as very low model numbers of family 6 on the Intel side.

Apart from that, there were several made up CPU features that turned
out entirely unused throughout the tree.

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


diff -r b7de1713ab8d -r 00c05b9d7624 xen/arch/x86/cpu/amd.c
--- a/xen/arch/x86/cpu/amd.c	Fri Sep 28 09:25:42 2012 +0200
+++ b/xen/arch/x86/cpu/amd.c	Fri Sep 28 09:26:46 2012 +0200
@@ -180,7 +180,7 @@ static void __devinit set_cpuidmask(cons
 	if (c->x86 >= 0x10) {
 		wrmsr(MSR_K8_FEATURE_MASK, feat_edx, feat_ecx);
 		wrmsr(MSR_K8_EXT_FEATURE_MASK, extfeat_edx, extfeat_ecx);
-	} else if (c->x86 == 0x0f) {
+	} else {
 		wrmsr_amd(MSR_K8_FEATURE_MASK, feat_edx, feat_ecx);
 		wrmsr_amd(MSR_K8_EXT_FEATURE_MASK, extfeat_edx, extfeat_ecx);
 	}
@@ -234,14 +234,7 @@ int cpu_has_amd_erratum(const struct cpu
 /* Can this system suffer from TSC drift due to C1 clock ramping? */
 static int c1_ramping_may_cause_clock_drift(struct cpuinfo_x86 *c) 
 { 
-	if (c->x86 < 0xf) {
-		/*
-		 * TSC drift doesn't exist on 7th Gen or less
-		 * However, OS still needs to consider effects
-		 * of P-state changes on TSC
-		 */
-		return 0;
-	} else if (cpuid_edx(0x80000007) & (1<<8)) {
+	if (cpuid_edx(0x80000007) & (1<<8)) {
 		/*
 		 * CPUID.AdvPowerMgmtInfo.TscInvariant
 		 * EDX bit 8, 8000_0007
@@ -416,41 +409,7 @@ static void __devinit init_amd(struct cp
 
 	switch(c->x86)
 	{
-	case 6: /* An Athlon/Duron */
- 
-		/* Bit 15 of Athlon specific MSR 15, needs to be 0
-		 * to enable SSE on Palomino/Morgan/Barton CPU's.
-		 * If the BIOS didn't enable it already, enable it here.
-		 */
-		if (c->x86_model >= 6 && c->x86_model <= 10) {
-			if (!cpu_has(c, X86_FEATURE_XMM)) {
-				printk(KERN_INFO "Enabling disabled K7/SSE Support.\n");
-				rdmsr(MSR_K7_HWCR, l, h);
-				l &= ~0x00008000;
-				wrmsr(MSR_K7_HWCR, l, h);
-				set_bit(X86_FEATURE_XMM, c->x86_capability);
-			}
-		}
-
-		/* It's been determined by AMD that Athlons since model 8 stepping 1
-		 * are more robust with CLK_CTL set to 200xxxxx instead of 600xxxxx
-		 * As per AMD technical note 27212 0.2
-		 */
-		if ((c->x86_model == 8 && c->x86_mask>=1) || (c->x86_model > 8)) {
-			rdmsr(MSR_K7_CLK_CTL, l, h);
-			if ((l & 0xfff00000) != 0x20000000) {
-				printk ("CPU: CLK_CTL MSR was %x. Reprogramming to %x\n", l,
-					((l & 0x000fffff)|0x20000000));
-				wrmsr(MSR_K7_CLK_CTL, (l & 0x000fffff)|0x20000000, h);
-			}
-		}
-		set_bit(X86_FEATURE_K7, c->x86_capability);
-		break;
-
-	case 0xf:
-	/* Use K8 tuning for Fam10h and Fam11h */
-	case 0x10 ... 0x17:
-		set_bit(X86_FEATURE_K8, c->x86_capability);
+	case 0xf ... 0x17:
 		disable_c1e(NULL);
 		if (acpi_smi_cmd && (acpi_enable_value | acpi_disable_value))
 			pv_post_outb_hook = check_disable_c1e;
diff -r b7de1713ab8d -r 00c05b9d7624 xen/arch/x86/cpu/intel.c
--- a/xen/arch/x86/cpu/intel.c	Fri Sep 28 09:25:42 2012 +0200
+++ b/xen/arch/x86/cpu/intel.c	Fri Sep 28 09:26:46 2012 +0200
@@ -192,7 +192,6 @@ static int __devinit num_cpu_cores(struc
 static void __devinit init_intel(struct cpuinfo_x86 *c)
 {
 	unsigned int l2 = 0;
-	char *p = NULL;
 
 	/* Detect the extended topology information if available */
 	detect_extended_topology(c);
@@ -210,37 +209,6 @@ static void __devinit init_intel(struct 
 	if ((c->x86<<8 | c->x86_model<<4 | c->x86_mask) < 0x633)
 		clear_bit(X86_FEATURE_SEP, c->x86_capability);
 
-	/* Names for the Pentium II/Celeron processors 
-	   detectable only by also checking the cache size.
-	   Dixon is NOT a Celeron. */
-	if (c->x86 == 6) {
-		switch (c->x86_model) {
-		case 5:
-			if (c->x86_mask == 0) {
-				if (l2 == 0)
-					p = "Celeron (Covington)";
-				else if (l2 == 256)
-					p = "Mobile Pentium II (Dixon)";
-			}
-			break;
-			
-		case 6:
-			if (l2 == 128)
-				p = "Celeron (Mendocino)";
-			else if (c->x86_mask == 0 || c->x86_mask == 5)
-				p = "Celeron-A";
-			break;
-			
-		case 8:
-			if (l2 == 128)
-				p = "Celeron (Coppermine)";
-			break;
-		}
-	}
-
-	if ( p )
-		safe_strcpy(c->x86_model_id, p);
-
 	if ( !cpu_has(c, X86_FEATURE_XTOPOLOGY) )
 	{
 		c->x86_max_cores = num_cpu_cores(c);
@@ -275,10 +243,6 @@ static void __devinit init_intel(struct 
 	}
 #endif
 
-	if (c->x86 == 15)
-		set_bit(X86_FEATURE_P4, c->x86_capability);
-	if (c->x86 == 6) 
-		set_bit(X86_FEATURE_P3, c->x86_capability);
 	if ((c->x86 == 0xf && c->x86_model >= 0x03) ||
 		(c->x86 == 0x6 && c->x86_model >= 0x0e))
 		set_bit(X86_FEATURE_CONSTANT_TSC, c->x86_capability);
diff -r b7de1713ab8d -r 00c05b9d7624 xen/include/asm-x86/cpufeature.h
--- a/xen/include/asm-x86/cpufeature.h	Fri Sep 28 09:25:42 2012 +0200
+++ b/xen/include/asm-x86/cpufeature.h	Fri Sep 28 09:26:46 2012 +0200
@@ -64,15 +64,6 @@
 
 /* Other features, Linux-defined mapping, word 3 */
 /* This range is used for feature bits which conflict or are synthesized */
-#define X86_FEATURE_CXMMX	(3*32+ 0) /* Cyrix MMX extensions */
-#define X86_FEATURE_K6_MTRR	(3*32+ 1) /* AMD K6 nonstandard MTRRs */
-#define X86_FEATURE_CYRIX_ARR	(3*32+ 2) /* Cyrix ARRs (= MTRRs) */
-#define X86_FEATURE_CENTAUR_MCR	(3*32+ 3) /* Centaur MCRs (= MTRRs) */
-/* cpu types for specific tunings: */
-#define X86_FEATURE_K8		(3*32+ 4) /* Opteron, Athlon64 */
-#define X86_FEATURE_K7		(3*32+ 5) /* Athlon */
-#define X86_FEATURE_P3		(3*32+ 6) /* P3 */
-#define X86_FEATURE_P4		(3*32+ 7) /* P4 */
 #define X86_FEATURE_CONSTANT_TSC (3*32+ 8) /* TSC ticks at a constant rate */
 #define X86_FEATURE_NONSTOP_TSC	(3*32+ 9) /* TSC does not stop in C states */
 #define X86_FEATURE_ARAT	(3*32+ 10) /* Always running APIC timer */

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

From xen-changelog-bounces@lists.xen.org Fri Sep 28 15:11:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Sep 2012 15:11:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1THcDi-0007Mf-LQ; Fri, 28 Sep 2012 15:11:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THcDh-0007M4-9M
	for xen-changelog@lists.xensource.com; Fri, 28 Sep 2012 15:11:13 +0000
Received: from [85.158.143.35:38847] by server-2.bemta-4.messagelabs.com id
	E5/CC-06610-01EB5605; Fri, 28 Sep 2012 15:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-21.messagelabs.com!1348845070!13177045!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30740 invoked from network); 28 Sep 2012 15:11: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;
	28 Sep 2012 15:11: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 1THcDe-0002fL-8I
	for xen-changelog@lists.xensource.com; Fri, 28 Sep 2012 15:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THcDd-00044A-Si
	for xen-changelog@lists.xensource.com; Fri, 28 Sep 2012 15:11:09 +0000
Message-Id: <E1THcDd-00044A-Si@xenbits.xen.org>
Date: Fri, 28 Sep 2012 15:11:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: remove further code applicable
	to 32-bit CPUs only
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348817206 -7200
# Node ID 00c05b9d76247d063a8ebc75050246e488323f50
# Parent  b7de1713ab8d280b36ebad86254801bea5041537
x86: remove further code applicable to 32-bit CPUs only

On the AMD side, anything prior to family 0xf can now be ignored, as
well as very low model numbers of family 6 on the Intel side.

Apart from that, there were several made up CPU features that turned
out entirely unused throughout the tree.

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


diff -r b7de1713ab8d -r 00c05b9d7624 xen/arch/x86/cpu/amd.c
--- a/xen/arch/x86/cpu/amd.c	Fri Sep 28 09:25:42 2012 +0200
+++ b/xen/arch/x86/cpu/amd.c	Fri Sep 28 09:26:46 2012 +0200
@@ -180,7 +180,7 @@ static void __devinit set_cpuidmask(cons
 	if (c->x86 >= 0x10) {
 		wrmsr(MSR_K8_FEATURE_MASK, feat_edx, feat_ecx);
 		wrmsr(MSR_K8_EXT_FEATURE_MASK, extfeat_edx, extfeat_ecx);
-	} else if (c->x86 == 0x0f) {
+	} else {
 		wrmsr_amd(MSR_K8_FEATURE_MASK, feat_edx, feat_ecx);
 		wrmsr_amd(MSR_K8_EXT_FEATURE_MASK, extfeat_edx, extfeat_ecx);
 	}
@@ -234,14 +234,7 @@ int cpu_has_amd_erratum(const struct cpu
 /* Can this system suffer from TSC drift due to C1 clock ramping? */
 static int c1_ramping_may_cause_clock_drift(struct cpuinfo_x86 *c) 
 { 
-	if (c->x86 < 0xf) {
-		/*
-		 * TSC drift doesn't exist on 7th Gen or less
-		 * However, OS still needs to consider effects
-		 * of P-state changes on TSC
-		 */
-		return 0;
-	} else if (cpuid_edx(0x80000007) & (1<<8)) {
+	if (cpuid_edx(0x80000007) & (1<<8)) {
 		/*
 		 * CPUID.AdvPowerMgmtInfo.TscInvariant
 		 * EDX bit 8, 8000_0007
@@ -416,41 +409,7 @@ static void __devinit init_amd(struct cp
 
 	switch(c->x86)
 	{
-	case 6: /* An Athlon/Duron */
- 
-		/* Bit 15 of Athlon specific MSR 15, needs to be 0
-		 * to enable SSE on Palomino/Morgan/Barton CPU's.
-		 * If the BIOS didn't enable it already, enable it here.
-		 */
-		if (c->x86_model >= 6 && c->x86_model <= 10) {
-			if (!cpu_has(c, X86_FEATURE_XMM)) {
-				printk(KERN_INFO "Enabling disabled K7/SSE Support.\n");
-				rdmsr(MSR_K7_HWCR, l, h);
-				l &= ~0x00008000;
-				wrmsr(MSR_K7_HWCR, l, h);
-				set_bit(X86_FEATURE_XMM, c->x86_capability);
-			}
-		}
-
-		/* It's been determined by AMD that Athlons since model 8 stepping 1
-		 * are more robust with CLK_CTL set to 200xxxxx instead of 600xxxxx
-		 * As per AMD technical note 27212 0.2
-		 */
-		if ((c->x86_model == 8 && c->x86_mask>=1) || (c->x86_model > 8)) {
-			rdmsr(MSR_K7_CLK_CTL, l, h);
-			if ((l & 0xfff00000) != 0x20000000) {
-				printk ("CPU: CLK_CTL MSR was %x. Reprogramming to %x\n", l,
-					((l & 0x000fffff)|0x20000000));
-				wrmsr(MSR_K7_CLK_CTL, (l & 0x000fffff)|0x20000000, h);
-			}
-		}
-		set_bit(X86_FEATURE_K7, c->x86_capability);
-		break;
-
-	case 0xf:
-	/* Use K8 tuning for Fam10h and Fam11h */
-	case 0x10 ... 0x17:
-		set_bit(X86_FEATURE_K8, c->x86_capability);
+	case 0xf ... 0x17:
 		disable_c1e(NULL);
 		if (acpi_smi_cmd && (acpi_enable_value | acpi_disable_value))
 			pv_post_outb_hook = check_disable_c1e;
diff -r b7de1713ab8d -r 00c05b9d7624 xen/arch/x86/cpu/intel.c
--- a/xen/arch/x86/cpu/intel.c	Fri Sep 28 09:25:42 2012 +0200
+++ b/xen/arch/x86/cpu/intel.c	Fri Sep 28 09:26:46 2012 +0200
@@ -192,7 +192,6 @@ static int __devinit num_cpu_cores(struc
 static void __devinit init_intel(struct cpuinfo_x86 *c)
 {
 	unsigned int l2 = 0;
-	char *p = NULL;
 
 	/* Detect the extended topology information if available */
 	detect_extended_topology(c);
@@ -210,37 +209,6 @@ static void __devinit init_intel(struct 
 	if ((c->x86<<8 | c->x86_model<<4 | c->x86_mask) < 0x633)
 		clear_bit(X86_FEATURE_SEP, c->x86_capability);
 
-	/* Names for the Pentium II/Celeron processors 
-	   detectable only by also checking the cache size.
-	   Dixon is NOT a Celeron. */
-	if (c->x86 == 6) {
-		switch (c->x86_model) {
-		case 5:
-			if (c->x86_mask == 0) {
-				if (l2 == 0)
-					p = "Celeron (Covington)";
-				else if (l2 == 256)
-					p = "Mobile Pentium II (Dixon)";
-			}
-			break;
-			
-		case 6:
-			if (l2 == 128)
-				p = "Celeron (Mendocino)";
-			else if (c->x86_mask == 0 || c->x86_mask == 5)
-				p = "Celeron-A";
-			break;
-			
-		case 8:
-			if (l2 == 128)
-				p = "Celeron (Coppermine)";
-			break;
-		}
-	}
-
-	if ( p )
-		safe_strcpy(c->x86_model_id, p);
-
 	if ( !cpu_has(c, X86_FEATURE_XTOPOLOGY) )
 	{
 		c->x86_max_cores = num_cpu_cores(c);
@@ -275,10 +243,6 @@ static void __devinit init_intel(struct 
 	}
 #endif
 
-	if (c->x86 == 15)
-		set_bit(X86_FEATURE_P4, c->x86_capability);
-	if (c->x86 == 6) 
-		set_bit(X86_FEATURE_P3, c->x86_capability);
 	if ((c->x86 == 0xf && c->x86_model >= 0x03) ||
 		(c->x86 == 0x6 && c->x86_model >= 0x0e))
 		set_bit(X86_FEATURE_CONSTANT_TSC, c->x86_capability);
diff -r b7de1713ab8d -r 00c05b9d7624 xen/include/asm-x86/cpufeature.h
--- a/xen/include/asm-x86/cpufeature.h	Fri Sep 28 09:25:42 2012 +0200
+++ b/xen/include/asm-x86/cpufeature.h	Fri Sep 28 09:26:46 2012 +0200
@@ -64,15 +64,6 @@
 
 /* Other features, Linux-defined mapping, word 3 */
 /* This range is used for feature bits which conflict or are synthesized */
-#define X86_FEATURE_CXMMX	(3*32+ 0) /* Cyrix MMX extensions */
-#define X86_FEATURE_K6_MTRR	(3*32+ 1) /* AMD K6 nonstandard MTRRs */
-#define X86_FEATURE_CYRIX_ARR	(3*32+ 2) /* Cyrix ARRs (= MTRRs) */
-#define X86_FEATURE_CENTAUR_MCR	(3*32+ 3) /* Centaur MCRs (= MTRRs) */
-/* cpu types for specific tunings: */
-#define X86_FEATURE_K8		(3*32+ 4) /* Opteron, Athlon64 */
-#define X86_FEATURE_K7		(3*32+ 5) /* Athlon */
-#define X86_FEATURE_P3		(3*32+ 6) /* P3 */
-#define X86_FEATURE_P4		(3*32+ 7) /* P4 */
 #define X86_FEATURE_CONSTANT_TSC (3*32+ 8) /* TSC ticks at a constant rate */
 #define X86_FEATURE_NONSTOP_TSC	(3*32+ 9) /* TSC does not stop in C states */
 #define X86_FEATURE_ARAT	(3*32+ 10) /* Always running APIC timer */

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

From xen-changelog-bounces@lists.xen.org Fri Sep 28 15:11:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Sep 2012 15:11:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1THcDh-0007MH-GF; Fri, 28 Sep 2012 15:11:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THcDf-0007Lj-VK
	for xen-changelog@lists.xensource.com; Fri, 28 Sep 2012 15:11:12 +0000
Received: from [85.158.139.211:12923] by server-7.bemta-5.messagelabs.com id
	19/32-00431-F0EB5605; Fri, 28 Sep 2012 15:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-206.messagelabs.com!1348845069!20386523!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25547 invoked from network); 28 Sep 2012 15:11:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Sep 2012 15: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 1THcDd-0002fI-DO
	for xen-changelog@lists.xensource.com; Fri, 28 Sep 2012 15:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THcDd-00043v-Ak
	for xen-changelog@lists.xensource.com; Fri, 28 Sep 2012 15:11:09 +0000
Message-Id: <E1THcDd-00043v-Ak@xenbits.xen.org>
Date: Fri, 28 Sep 2012 15:11:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/HPET: don't needlessly set up
	channels for broadcast
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348817142 -7200
# Node ID b7de1713ab8d280b36ebad86254801bea5041537
# Parent  41f523f1b5e5af9cf8e85160f2412456da83050f
x86/HPET: don't needlessly set up channels for broadcast

When there are more FSB delivery capable HPET channels than CPU cores
(or threads), we can simply use a dedicated channel per CPU. This
avoids wasting the resources to handle the excess channels (including
the pointless triggering of the respective interrupt on each
wraparound) as well as the ping-pong of the interrupts' affinities
(when getting assigned to different CPUs).

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


diff -r 41f523f1b5e5 -r b7de1713ab8d xen/arch/x86/hpet.c
--- a/xen/arch/x86/hpet.c	Fri Sep 28 09:23:34 2012 +0200
+++ b/xen/arch/x86/hpet.c	Fri Sep 28 09:25:42 2012 +0200
@@ -369,7 +369,7 @@ static void __init hpet_fsb_cap_lookup(v
     if ( !hpet_events )
         return;
 
-    for ( i = 0; i < num_chs; i++ )
+    for ( i = 0; i < num_chs && num_hpets_used < nr_cpu_ids; i++ )
     {
         struct hpet_event_channel *ch = &hpet_events[num_hpets_used];
         u32 cfg = hpet_read32(HPET_Tn_CFG(i));
@@ -408,6 +408,9 @@ static struct hpet_event_channel *hpet_g
     if ( num_hpets_used == 0 )
         return hpet_events;
 
+    if ( num_hpets_used >= nr_cpu_ids )
+        return &hpet_events[cpu];
+
     do {
         next = next_channel;
         if ( (i = next + 1) == num_hpets_used )

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

From xen-changelog-bounces@lists.xen.org Fri Sep 28 15:11:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Sep 2012 15:11:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1THcDh-0007MC-DW; Fri, 28 Sep 2012 15:11:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THcDf-0007Li-MK
	for xen-changelog@lists.xensource.com; Fri, 28 Sep 2012 15:11:11 +0000
Received: from [85.158.139.83:6066] by server-14.bemta-5.messagelabs.com id
	FA/23-05772-F0EB5605; Fri, 28 Sep 2012 15:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-182.messagelabs.com!1348845068!32212841!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14388 invoked from network); 28 Sep 2012 15:11:10 -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;
	28 Sep 2012 15: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 1THcDc-0002fC-FP
	for xen-changelog@lists.xensource.com; Fri, 28 Sep 2012 15:11:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THcDc-00043R-2x
	for xen-changelog@lists.xensource.com; Fri, 28 Sep 2012 15:11:08 +0000
Message-Id: <E1THcDc-00043R-2x@xenbits.xen.org>
Date: Fri, 28 Sep 2012 15:11:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/HPET: don't disable interrupt
	delivery right after setting it up
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348816934 -7200
# Node ID 6a581212909478bba0c7b4dfc6c370270dee825c
# Parent  6bf8b882df8f66ab5500e4d9cc0c3338ae5a6cb9
x86/HPET: don't disable interrupt delivery right after setting it up

We shouldn't clear HPET_TN_FSB right after we (indirectly, via
request_irq()) enabled it for the channels we intend to use for
broadcasts.

This fixes a regression introduced by c/s 25103:0b0e42dc4f0a.

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


diff -r 6bf8b882df8f -r 6a5812129094 xen/arch/x86/hpet.c
--- a/xen/arch/x86/hpet.c	Wed Sep 26 17:11:39 2012 +0200
+++ b/xen/arch/x86/hpet.c	Fri Sep 28 09:22:14 2012 +0200
@@ -533,7 +533,7 @@ void __init hpet_broadcast_init(void)
     {
         /* set HPET Tn as oneshot */
         cfg = hpet_read32(HPET_Tn_CFG(hpet_events[i].idx));
-        cfg &= ~(HPET_TN_LEVEL | HPET_TN_PERIODIC | HPET_TN_FSB);
+        cfg &= ~(HPET_TN_LEVEL | HPET_TN_PERIODIC);
         cfg |= HPET_TN_ENABLE | HPET_TN_32BIT;
         hpet_write32(cfg, HPET_Tn_CFG(hpet_events[i].idx));
 
@@ -590,7 +590,7 @@ void hpet_broadcast_resume(void)
 
         /* set HPET Tn as oneshot */
         cfg = hpet_read32(HPET_Tn_CFG(hpet_events[i].idx));
-        cfg &= ~(HPET_TN_LEVEL | HPET_TN_PERIODIC | HPET_TN_FSB);
+        cfg &= ~(HPET_TN_LEVEL | HPET_TN_PERIODIC);
         cfg |= HPET_TN_ENABLE | HPET_TN_32BIT;
         hpet_write32(cfg, HPET_Tn_CFG(hpet_events[i].idx));
 

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

From xen-changelog-bounces@lists.xen.org Fri Sep 28 15:11:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Sep 2012 15:11:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1THcDh-0007M7-BB; Fri, 28 Sep 2012 15:11:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THcDf-0007Lh-LU
	for xen-changelog@lists.xensource.com; Fri, 28 Sep 2012 15:11:11 +0000
Received: from [85.158.139.211:59161] by server-3.bemta-5.messagelabs.com id
	FE/18-16108-E0EB5605; Fri, 28 Sep 2012 15:11:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-206.messagelabs.com!1348845069!20358485!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28206 invoked from network); 28 Sep 2012 15:11:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Sep 2012 15: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 1THcDd-0002fF-4b
	for xen-changelog@lists.xensource.com; Fri, 28 Sep 2012 15:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THcDc-00043g-Pg
	for xen-changelog@lists.xensource.com; Fri, 28 Sep 2012 15:11:08 +0000
Message-Id: <E1THcDc-00043g-Pg@xenbits.xen.org>
Date: Fri, 28 Sep 2012 15:11:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/IRQ: fix valid-old-vector checks
	in __assign_irq_vector()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348817014 -7200
# Node ID 41f523f1b5e5af9cf8e85160f2412456da83050f
# Parent  6a581212909478bba0c7b4dfc6c370270dee825c
x86/IRQ: fix valid-old-vector checks in __assign_irq_vector()

There are two greater-than-zero checks for the old vector retrieved,
which don't work when a negative value got stashed into the respective
arch_irq_desc field. The effect of this was that for interrupts that
are intended to get their affinity adjusted the first time before the
first interrupt occurs, the affinity change would fail, because the
original vector assignment would have caused the move_in_progress flag
to get set (which causes subsequent re-assignments to fail until it
gets cleared, which only happens from the ->ack() actor, i.e. when an
interrupt actually occurred).

This addresses a problem introduced in c/s 23816:7f357e1ef60a (by
changing IRQ_VECTOR_UNASSIGNED from 0 to -1).

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


diff -r 6a5812129094 -r 41f523f1b5e5 xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c	Fri Sep 28 09:22:14 2012 +0200
+++ b/xen/arch/x86/irq.c	Fri Sep 28 09:23:34 2012 +0200
@@ -430,8 +430,7 @@ static int __assign_irq_vector(
      * 0x80, because int 0x80 is hm, kind of importantish. ;)
      */
     static int current_vector = FIRST_DYNAMIC_VECTOR, current_offset = 0;
-    unsigned int old_vector;
-    int cpu, err;
+    int cpu, err, old_vector;
     cpumask_t tmp_mask;
     vmask_t *irq_used_vectors = NULL;
 

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

From xen-changelog-bounces@lists.xen.org Fri Sep 28 15:11:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Sep 2012 15:11:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1THcDh-0007MH-GF; Fri, 28 Sep 2012 15:11:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THcDf-0007Lj-VK
	for xen-changelog@lists.xensource.com; Fri, 28 Sep 2012 15:11:12 +0000
Received: from [85.158.139.211:12923] by server-7.bemta-5.messagelabs.com id
	19/32-00431-F0EB5605; Fri, 28 Sep 2012 15:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-206.messagelabs.com!1348845069!20386523!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25547 invoked from network); 28 Sep 2012 15:11:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Sep 2012 15: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 1THcDd-0002fI-DO
	for xen-changelog@lists.xensource.com; Fri, 28 Sep 2012 15:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THcDd-00043v-Ak
	for xen-changelog@lists.xensource.com; Fri, 28 Sep 2012 15:11:09 +0000
Message-Id: <E1THcDd-00043v-Ak@xenbits.xen.org>
Date: Fri, 28 Sep 2012 15:11:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/HPET: don't needlessly set up
	channels for broadcast
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348817142 -7200
# Node ID b7de1713ab8d280b36ebad86254801bea5041537
# Parent  41f523f1b5e5af9cf8e85160f2412456da83050f
x86/HPET: don't needlessly set up channels for broadcast

When there are more FSB delivery capable HPET channels than CPU cores
(or threads), we can simply use a dedicated channel per CPU. This
avoids wasting the resources to handle the excess channels (including
the pointless triggering of the respective interrupt on each
wraparound) as well as the ping-pong of the interrupts' affinities
(when getting assigned to different CPUs).

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


diff -r 41f523f1b5e5 -r b7de1713ab8d xen/arch/x86/hpet.c
--- a/xen/arch/x86/hpet.c	Fri Sep 28 09:23:34 2012 +0200
+++ b/xen/arch/x86/hpet.c	Fri Sep 28 09:25:42 2012 +0200
@@ -369,7 +369,7 @@ static void __init hpet_fsb_cap_lookup(v
     if ( !hpet_events )
         return;
 
-    for ( i = 0; i < num_chs; i++ )
+    for ( i = 0; i < num_chs && num_hpets_used < nr_cpu_ids; i++ )
     {
         struct hpet_event_channel *ch = &hpet_events[num_hpets_used];
         u32 cfg = hpet_read32(HPET_Tn_CFG(i));
@@ -408,6 +408,9 @@ static struct hpet_event_channel *hpet_g
     if ( num_hpets_used == 0 )
         return hpet_events;
 
+    if ( num_hpets_used >= nr_cpu_ids )
+        return &hpet_events[cpu];
+
     do {
         next = next_channel;
         if ( (i = next + 1) == num_hpets_used )

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

From xen-changelog-bounces@lists.xen.org Fri Sep 28 15:11:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Sep 2012 15:11:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1THcDh-0007MC-DW; Fri, 28 Sep 2012 15:11:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THcDf-0007Li-MK
	for xen-changelog@lists.xensource.com; Fri, 28 Sep 2012 15:11:11 +0000
Received: from [85.158.139.83:6066] by server-14.bemta-5.messagelabs.com id
	FA/23-05772-F0EB5605; Fri, 28 Sep 2012 15:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-182.messagelabs.com!1348845068!32212841!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14388 invoked from network); 28 Sep 2012 15:11:10 -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;
	28 Sep 2012 15: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 1THcDc-0002fC-FP
	for xen-changelog@lists.xensource.com; Fri, 28 Sep 2012 15:11:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THcDc-00043R-2x
	for xen-changelog@lists.xensource.com; Fri, 28 Sep 2012 15:11:08 +0000
Message-Id: <E1THcDc-00043R-2x@xenbits.xen.org>
Date: Fri, 28 Sep 2012 15:11:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/HPET: don't disable interrupt
	delivery right after setting it up
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348816934 -7200
# Node ID 6a581212909478bba0c7b4dfc6c370270dee825c
# Parent  6bf8b882df8f66ab5500e4d9cc0c3338ae5a6cb9
x86/HPET: don't disable interrupt delivery right after setting it up

We shouldn't clear HPET_TN_FSB right after we (indirectly, via
request_irq()) enabled it for the channels we intend to use for
broadcasts.

This fixes a regression introduced by c/s 25103:0b0e42dc4f0a.

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


diff -r 6bf8b882df8f -r 6a5812129094 xen/arch/x86/hpet.c
--- a/xen/arch/x86/hpet.c	Wed Sep 26 17:11:39 2012 +0200
+++ b/xen/arch/x86/hpet.c	Fri Sep 28 09:22:14 2012 +0200
@@ -533,7 +533,7 @@ void __init hpet_broadcast_init(void)
     {
         /* set HPET Tn as oneshot */
         cfg = hpet_read32(HPET_Tn_CFG(hpet_events[i].idx));
-        cfg &= ~(HPET_TN_LEVEL | HPET_TN_PERIODIC | HPET_TN_FSB);
+        cfg &= ~(HPET_TN_LEVEL | HPET_TN_PERIODIC);
         cfg |= HPET_TN_ENABLE | HPET_TN_32BIT;
         hpet_write32(cfg, HPET_Tn_CFG(hpet_events[i].idx));
 
@@ -590,7 +590,7 @@ void hpet_broadcast_resume(void)
 
         /* set HPET Tn as oneshot */
         cfg = hpet_read32(HPET_Tn_CFG(hpet_events[i].idx));
-        cfg &= ~(HPET_TN_LEVEL | HPET_TN_PERIODIC | HPET_TN_FSB);
+        cfg &= ~(HPET_TN_LEVEL | HPET_TN_PERIODIC);
         cfg |= HPET_TN_ENABLE | HPET_TN_32BIT;
         hpet_write32(cfg, HPET_Tn_CFG(hpet_events[i].idx));
 

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

From xen-changelog-bounces@lists.xen.org Fri Sep 28 15:11:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Sep 2012 15:11:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1THcDh-0007M7-BB; Fri, 28 Sep 2012 15:11:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THcDf-0007Lh-LU
	for xen-changelog@lists.xensource.com; Fri, 28 Sep 2012 15:11:11 +0000
Received: from [85.158.139.211:59161] by server-3.bemta-5.messagelabs.com id
	FE/18-16108-E0EB5605; Fri, 28 Sep 2012 15:11:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-206.messagelabs.com!1348845069!20358485!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28206 invoked from network); 28 Sep 2012 15:11:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Sep 2012 15: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 1THcDd-0002fF-4b
	for xen-changelog@lists.xensource.com; Fri, 28 Sep 2012 15:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THcDc-00043g-Pg
	for xen-changelog@lists.xensource.com; Fri, 28 Sep 2012 15:11:08 +0000
Message-Id: <E1THcDc-00043g-Pg@xenbits.xen.org>
Date: Fri, 28 Sep 2012 15:11:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/IRQ: fix valid-old-vector checks
	in __assign_irq_vector()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348817014 -7200
# Node ID 41f523f1b5e5af9cf8e85160f2412456da83050f
# Parent  6a581212909478bba0c7b4dfc6c370270dee825c
x86/IRQ: fix valid-old-vector checks in __assign_irq_vector()

There are two greater-than-zero checks for the old vector retrieved,
which don't work when a negative value got stashed into the respective
arch_irq_desc field. The effect of this was that for interrupts that
are intended to get their affinity adjusted the first time before the
first interrupt occurs, the affinity change would fail, because the
original vector assignment would have caused the move_in_progress flag
to get set (which causes subsequent re-assignments to fail until it
gets cleared, which only happens from the ->ack() actor, i.e. when an
interrupt actually occurred).

This addresses a problem introduced in c/s 23816:7f357e1ef60a (by
changing IRQ_VECTOR_UNASSIGNED from 0 to -1).

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


diff -r 6a5812129094 -r 41f523f1b5e5 xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c	Fri Sep 28 09:22:14 2012 +0200
+++ b/xen/arch/x86/irq.c	Fri Sep 28 09:23:34 2012 +0200
@@ -430,8 +430,7 @@ static int __assign_irq_vector(
      * 0x80, because int 0x80 is hm, kind of importantish. ;)
      */
     static int current_vector = FIRST_DYNAMIC_VECTOR, current_offset = 0;
-    unsigned int old_vector;
-    int cpu, err;
+    int cpu, err, old_vector;
     cpumask_t tmp_mask;
     vmask_t *irq_used_vectors = NULL;
 

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

From xen-changelog-bounces@lists.xen.org Fri Sep 28 15:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Sep 2012 15:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1THcDj-0007N4-Qk; Fri, 28 Sep 2012 15:11:15 +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 1THcDi-0007MV-M2
	for xen-changelog@lists.xensource.com; Fri, 28 Sep 2012 15:11:14 +0000
Received: from [85.158.137.99:58641] by server-7.bemta-3.messagelabs.com id
	F8/3A-15765-11EB5605; Fri, 28 Sep 2012 15:11:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-217.messagelabs.com!1348845071!16377908!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11241 invoked from network); 28 Sep 2012 15:11:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Sep 2012 15:11: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 1THcDf-0002fU-Il
	for xen-changelog@lists.xensource.com; Fri, 28 Sep 2012 15:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THcDf-00044w-HO
	for xen-changelog@lists.xensource.com; Fri, 28 Sep 2012 15:11:11 +0000
Message-Id: <E1THcDf-00044w-HO@xenbits.xen.org>
Date: Fri, 28 Sep 2012 15:11:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: replace literal numbers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348822781 -7200
# Node ID bd953fda6106aa1b1cce43379fdf1c946c1e1293
# Parent  ae1d62ad0333557721088fab73124966b067b46f
x86: replace literal numbers

In various cases, 256 was being used instead of NR_VECTORS or a derived
ARRAY_SIZE() expression. In one case (guest_has_trap_callback()), a
wrong (unrelated) constant was used instead of NR_VECTORS.

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


diff -r ae1d62ad0333 -r bd953fda6106 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c	Fri Sep 28 09:36:32 2012 +0200
+++ b/xen/arch/x86/domain.c	Fri Sep 28 10:59:41 2012 +0200
@@ -374,8 +374,9 @@ int switch_compat(struct domain *d)
 
 static inline bool_t standalone_trap_ctxt(struct vcpu *v)
 {
-    BUILD_BUG_ON(256 * sizeof(*v->arch.pv_vcpu.trap_ctxt) > PAGE_SIZE);
-    return 256 * sizeof(*v->arch.pv_vcpu.trap_ctxt) + sizeof(*v) > PAGE_SIZE;
+    BUILD_BUG_ON(NR_VECTORS * sizeof(*v->arch.pv_vcpu.trap_ctxt) > PAGE_SIZE);
+    return NR_VECTORS * sizeof(*v->arch.pv_vcpu.trap_ctxt) + sizeof(*v)
+           > PAGE_SIZE;
 }
 
 int vcpu_initialise(struct vcpu *v)
@@ -432,7 +433,7 @@ int vcpu_initialise(struct vcpu *v)
         }
         else
             v->arch.pv_vcpu.trap_ctxt = (void *)v + PAGE_SIZE -
-                256 * sizeof(*v->arch.pv_vcpu.trap_ctxt);
+                NR_VECTORS * sizeof(*v->arch.pv_vcpu.trap_ctxt);
 
         /* PV guests by default have a 100Hz ticker. */
         v->periodic_period = MILLISECS(10);
@@ -702,7 +703,7 @@ int arch_set_info_guest(
             fixup_guest_stack_selector(d, c.nat->kernel_ss);
             fixup_guest_code_selector(d, c.nat->user_regs.cs);
 
-            for ( i = 0; i < 256; i++ )
+            for ( i = 0; i < ARRAY_SIZE(c.nat->trap_ctxt); i++ )
             {
                 if ( !is_canonical_address(c.nat->trap_ctxt[i].address) )
                     return -EINVAL;
@@ -725,7 +726,7 @@ int arch_set_info_guest(
             fixup_guest_code_selector(d, c.cmp->event_callback_cs);
             fixup_guest_code_selector(d, c.cmp->failsafe_callback_cs);
 
-            for ( i = 0; i < 256; i++ )
+            for ( i = 0; i < ARRAY_SIZE(c.cmp->trap_ctxt); i++ )
                 fixup_guest_code_selector(d, c.cmp->trap_ctxt[i].cs);
 
             /* LDT safety checks. */
diff -r ae1d62ad0333 -r bd953fda6106 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c	Fri Sep 28 09:36:32 2012 +0200
+++ b/xen/arch/x86/traps.c	Fri Sep 28 10:59:41 2012 +0200
@@ -3506,7 +3506,7 @@ int guest_has_trap_callback(struct domai
     BUG_ON(vcpuid >= d->max_vcpus);
 
     /* Sanity check - XXX should be more fine grained. */
-    BUG_ON(trap_nr > TRAP_syscall);
+    BUG_ON(trap_nr >= NR_VECTORS);
 
     v = d->vcpu[vcpuid];
     t = &v->arch.pv_vcpu.trap_ctxt[trap_nr];
@@ -3574,7 +3574,7 @@ long do_set_trap_table(XEN_GUEST_HANDLE(
     /* If no table is presented then clear the entire virtual IDT. */
     if ( guest_handle_is_null(traps) )
     {
-        memset(dst, 0, 256 * sizeof(*dst));
+        memset(dst, 0, NR_VECTORS * sizeof(*dst));
         init_int80_direct_trap(curr);
         return 0;
     }
diff -r ae1d62ad0333 -r bd953fda6106 xen/arch/x86/x86_64/compat/traps.c
--- a/xen/arch/x86/x86_64/compat/traps.c	Fri Sep 28 09:36:32 2012 +0200
+++ b/xen/arch/x86/x86_64/compat/traps.c	Fri Sep 28 10:59:41 2012 +0200
@@ -317,7 +317,7 @@ int compat_set_trap_table(XEN_GUEST_HAND
     /* If no table is presented then clear the entire virtual IDT. */
     if ( guest_handle_is_null(traps) )
     {
-        memset(dst, 0, 256 * sizeof(*dst));
+        memset(dst, 0, NR_VECTORS * sizeof(*dst));
         return 0;
     }
 

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

From xen-changelog-bounces@lists.xen.org Fri Sep 28 15:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Sep 2012 15:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1THcDj-0007N4-Qk; Fri, 28 Sep 2012 15:11:15 +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 1THcDi-0007MV-M2
	for xen-changelog@lists.xensource.com; Fri, 28 Sep 2012 15:11:14 +0000
Received: from [85.158.137.99:58641] by server-7.bemta-3.messagelabs.com id
	F8/3A-15765-11EB5605; Fri, 28 Sep 2012 15:11:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-217.messagelabs.com!1348845071!16377908!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11241 invoked from network); 28 Sep 2012 15:11:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Sep 2012 15:11: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 1THcDf-0002fU-Il
	for xen-changelog@lists.xensource.com; Fri, 28 Sep 2012 15:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THcDf-00044w-HO
	for xen-changelog@lists.xensource.com; Fri, 28 Sep 2012 15:11:11 +0000
Message-Id: <E1THcDf-00044w-HO@xenbits.xen.org>
Date: Fri, 28 Sep 2012 15:11:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: replace literal numbers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348822781 -7200
# Node ID bd953fda6106aa1b1cce43379fdf1c946c1e1293
# Parent  ae1d62ad0333557721088fab73124966b067b46f
x86: replace literal numbers

In various cases, 256 was being used instead of NR_VECTORS or a derived
ARRAY_SIZE() expression. In one case (guest_has_trap_callback()), a
wrong (unrelated) constant was used instead of NR_VECTORS.

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


diff -r ae1d62ad0333 -r bd953fda6106 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c	Fri Sep 28 09:36:32 2012 +0200
+++ b/xen/arch/x86/domain.c	Fri Sep 28 10:59:41 2012 +0200
@@ -374,8 +374,9 @@ int switch_compat(struct domain *d)
 
 static inline bool_t standalone_trap_ctxt(struct vcpu *v)
 {
-    BUILD_BUG_ON(256 * sizeof(*v->arch.pv_vcpu.trap_ctxt) > PAGE_SIZE);
-    return 256 * sizeof(*v->arch.pv_vcpu.trap_ctxt) + sizeof(*v) > PAGE_SIZE;
+    BUILD_BUG_ON(NR_VECTORS * sizeof(*v->arch.pv_vcpu.trap_ctxt) > PAGE_SIZE);
+    return NR_VECTORS * sizeof(*v->arch.pv_vcpu.trap_ctxt) + sizeof(*v)
+           > PAGE_SIZE;
 }
 
 int vcpu_initialise(struct vcpu *v)
@@ -432,7 +433,7 @@ int vcpu_initialise(struct vcpu *v)
         }
         else
             v->arch.pv_vcpu.trap_ctxt = (void *)v + PAGE_SIZE -
-                256 * sizeof(*v->arch.pv_vcpu.trap_ctxt);
+                NR_VECTORS * sizeof(*v->arch.pv_vcpu.trap_ctxt);
 
         /* PV guests by default have a 100Hz ticker. */
         v->periodic_period = MILLISECS(10);
@@ -702,7 +703,7 @@ int arch_set_info_guest(
             fixup_guest_stack_selector(d, c.nat->kernel_ss);
             fixup_guest_code_selector(d, c.nat->user_regs.cs);
 
-            for ( i = 0; i < 256; i++ )
+            for ( i = 0; i < ARRAY_SIZE(c.nat->trap_ctxt); i++ )
             {
                 if ( !is_canonical_address(c.nat->trap_ctxt[i].address) )
                     return -EINVAL;
@@ -725,7 +726,7 @@ int arch_set_info_guest(
             fixup_guest_code_selector(d, c.cmp->event_callback_cs);
             fixup_guest_code_selector(d, c.cmp->failsafe_callback_cs);
 
-            for ( i = 0; i < 256; i++ )
+            for ( i = 0; i < ARRAY_SIZE(c.cmp->trap_ctxt); i++ )
                 fixup_guest_code_selector(d, c.cmp->trap_ctxt[i].cs);
 
             /* LDT safety checks. */
diff -r ae1d62ad0333 -r bd953fda6106 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c	Fri Sep 28 09:36:32 2012 +0200
+++ b/xen/arch/x86/traps.c	Fri Sep 28 10:59:41 2012 +0200
@@ -3506,7 +3506,7 @@ int guest_has_trap_callback(struct domai
     BUG_ON(vcpuid >= d->max_vcpus);
 
     /* Sanity check - XXX should be more fine grained. */
-    BUG_ON(trap_nr > TRAP_syscall);
+    BUG_ON(trap_nr >= NR_VECTORS);
 
     v = d->vcpu[vcpuid];
     t = &v->arch.pv_vcpu.trap_ctxt[trap_nr];
@@ -3574,7 +3574,7 @@ long do_set_trap_table(XEN_GUEST_HANDLE(
     /* If no table is presented then clear the entire virtual IDT. */
     if ( guest_handle_is_null(traps) )
     {
-        memset(dst, 0, 256 * sizeof(*dst));
+        memset(dst, 0, NR_VECTORS * sizeof(*dst));
         init_int80_direct_trap(curr);
         return 0;
     }
diff -r ae1d62ad0333 -r bd953fda6106 xen/arch/x86/x86_64/compat/traps.c
--- a/xen/arch/x86/x86_64/compat/traps.c	Fri Sep 28 09:36:32 2012 +0200
+++ b/xen/arch/x86/x86_64/compat/traps.c	Fri Sep 28 10:59:41 2012 +0200
@@ -317,7 +317,7 @@ int compat_set_trap_table(XEN_GUEST_HAND
     /* If no table is presented then clear the entire virtual IDT. */
     if ( guest_handle_is_null(traps) )
     {
-        memset(dst, 0, 256 * sizeof(*dst));
+        memset(dst, 0, NR_VECTORS * sizeof(*dst));
         return 0;
     }
 

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

From xen-changelog-bounces@lists.xen.org Fri Sep 28 15:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Sep 2012 15:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1THcDj-0007Mz-O2; Fri, 28 Sep 2012 15:11:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THcDh-0007M6-IP
	for xen-changelog@lists.xensource.com; Fri, 28 Sep 2012 15:11:13 +0000
Received: from [85.158.143.99:55566] by server-3.bemta-4.messagelabs.com id
	65/0F-10986-01EB5605; Fri, 28 Sep 2012 15:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-216.messagelabs.com!1348845071!26045612!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3494 invoked from network); 28 Sep 2012 15:11:12 -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;
	28 Sep 2012 15:11: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 1THcDf-0002fR-6F
	for xen-changelog@lists.xensource.com; Fri, 28 Sep 2012 15:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THcDe-00044f-VP
	for xen-changelog@lists.xensource.com; Fri, 28 Sep 2012 15:11:10 +0000
Message-Id: <E1THcDe-00044f-VP@xenbits.xen.org>
Date: Fri, 28 Sep 2012 15:11:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Revert 25960:6bf8b882df8f (x86:
	default-disable MWAIT-based idle driver ...)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348817792 -7200
# Node ID ae1d62ad0333557721088fab73124966b067b46f
# Parent  4496d56c68a0e57ed9f03b482028093f1e7fdf6c
Revert 25960:6bf8b882df8f (x86: default-disable MWAIT-based idle driver ...)

The problem this was working around should be resolved with c/s
25961:6a5812129094 (x86/HPET: don't disable interrupt delivery right
after setting it up).
---


diff -r 4496d56c68a0 -r ae1d62ad0333 xen/arch/x86/cpu/mwait-idle.c
--- a/xen/arch/x86/cpu/mwait-idle.c	Fri Sep 28 09:28:11 2012 +0200
+++ b/xen/arch/x86/cpu/mwait-idle.c	Fri Sep 28 09:36:32 2012 +0200
@@ -71,7 +71,7 @@
 # define pr_debug(fmt...)
 #endif
 
-static __initdata s8 no_mwait_idle = -1;
+static __initdata bool_t no_mwait_idle;
 invbool_param("mwait-idle", no_mwait_idle);
 
 static unsigned int mwait_substates;
@@ -500,13 +500,6 @@ int __init mwait_idle_init(struct notifi
 	if (pm_idle_save)
 		return -ENODEV;
 
-	/* XXX The no-ARAT case is supposedly being taken care of, but at
-	 * least some systems without ARAT hang for some reason, apparently
-	 * only when using HPET broadcast mode (PIT broadcast mode seems to
-	 * be fine). */
-	if (no_mwait_idle < 0 && boot_cpu_has(X86_FEATURE_ARAT))
-		no_mwait_idle = 0;
-
 	err = mwait_idle_probe();
 	if (!err) {
 		if (!boot_cpu_has(X86_FEATURE_ARAT))

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

From xen-changelog-bounces@lists.xen.org Fri Sep 28 15:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Sep 2012 15:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1THcDj-0007Mz-O2; Fri, 28 Sep 2012 15:11:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THcDh-0007M6-IP
	for xen-changelog@lists.xensource.com; Fri, 28 Sep 2012 15:11:13 +0000
Received: from [85.158.143.99:55566] by server-3.bemta-4.messagelabs.com id
	65/0F-10986-01EB5605; Fri, 28 Sep 2012 15:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-216.messagelabs.com!1348845071!26045612!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3494 invoked from network); 28 Sep 2012 15:11:12 -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;
	28 Sep 2012 15:11: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 1THcDf-0002fR-6F
	for xen-changelog@lists.xensource.com; Fri, 28 Sep 2012 15:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1THcDe-00044f-VP
	for xen-changelog@lists.xensource.com; Fri, 28 Sep 2012 15:11:10 +0000
Message-Id: <E1THcDe-00044f-VP@xenbits.xen.org>
Date: Fri, 28 Sep 2012 15:11:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Revert 25960:6bf8b882df8f (x86:
	default-disable MWAIT-based idle driver ...)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1348817792 -7200
# Node ID ae1d62ad0333557721088fab73124966b067b46f
# Parent  4496d56c68a0e57ed9f03b482028093f1e7fdf6c
Revert 25960:6bf8b882df8f (x86: default-disable MWAIT-based idle driver ...)

The problem this was working around should be resolved with c/s
25961:6a5812129094 (x86/HPET: don't disable interrupt delivery right
after setting it up).
---


diff -r 4496d56c68a0 -r ae1d62ad0333 xen/arch/x86/cpu/mwait-idle.c
--- a/xen/arch/x86/cpu/mwait-idle.c	Fri Sep 28 09:28:11 2012 +0200
+++ b/xen/arch/x86/cpu/mwait-idle.c	Fri Sep 28 09:36:32 2012 +0200
@@ -71,7 +71,7 @@
 # define pr_debug(fmt...)
 #endif
 
-static __initdata s8 no_mwait_idle = -1;
+static __initdata bool_t no_mwait_idle;
 invbool_param("mwait-idle", no_mwait_idle);
 
 static unsigned int mwait_substates;
@@ -500,13 +500,6 @@ int __init mwait_idle_init(struct notifi
 	if (pm_idle_save)
 		return -ENODEV;
 
-	/* XXX The no-ARAT case is supposedly being taken care of, but at
-	 * least some systems without ARAT hang for some reason, apparently
-	 * only when using HPET broadcast mode (PIT broadcast mode seems to
-	 * be fine). */
-	if (no_mwait_idle < 0 && boot_cpu_has(X86_FEATURE_ARAT))
-		no_mwait_idle = 0;
-
 	err = mwait_idle_probe();
 	if (!err) {
 		if (!boot_cpu_has(X86_FEATURE_ARAT))

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

