From xen-changelog-bounces@lists.xensource.com Thu Nov 17 16:17:03 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 17 Nov 2011 16:17:03 +0000
Received: from lists.colo.xensource.com ([70.42.241.110] helo=lists.xensource.com)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RR4e7-00029f-OQ
	for archives@lists.xen.org; Thu, 17 Nov 2011 16:17:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com)
	by lists.xensource.com with esmtp (Exim 4.43)
	id 1RR4dp-0002ry-8k; Thu, 17 Nov 2011 08:16:45 -0800
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xensource.com with esmtp (Exim 4.43) id 1RR4YY-0001s1-G2
	for xen-changelog@lists.xensource.com; Thu, 17 Nov 2011 08:11:19 -0800
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-21.messagelabs.com!1321546273!4543334!1
X-Originating-IP: [93.93.131.152]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30611 invoked from network); 17 Nov 2011 16:11:14 -0000
Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Nov 2011 16:11:14 -0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RR4YT-0003ez-6O
	for xen-changelog@lists.xensource.com; Thu, 17 Nov 2011 16:11:13 +0000
Message-Id: <E1RR4YT-0003ez-6O@xenbits.xen.org>
Date: Thu, 17 Nov 2011 16:11:11 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] [shadow] Disable higher level
	pagetables early unshadow only when the "process dying"
	hypercall is used.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Gianluca Guida <gianluca.guida@citrix.com>
# Date 1321461605 0
# Node ID c16b0a997a05e32b38fb33a70d59523375186f9c
# Parent  cdff7052bad8e0ee5fce18c9db54386b517c7d96
[shadow] Disable higher level pagetables early unshadow only when the "process dying" hypercall is used.

This patch fixes a performance problem in fully virtualized guests.

Signed-off-by: Gianluca Guida <gianluca.guida@citrix.com>
Tested-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24148:3ecc8fef4281
xen-unstable date:        Wed Nov 16 15:19:33 2011 +0000
---


diff -r cdff7052bad8 -r c16b0a997a05 xen/arch/x86/mm/shadow/multi.c
--- a/xen/arch/x86/mm/shadow/multi.c	Sat Nov 12 16:15:19 2011 +0000
+++ b/xen/arch/x86/mm/shadow/multi.c	Wed Nov 16 16:40:05 2011 +0000
@@ -2710,8 +2710,9 @@
            || ( !v->domain->arch.paging.shadow.pagetable_dying_op
                 && v->arch.paging.shadow.last_emulated_mfn_for_unshadow == mfn_x(gmfn) ) )
          && sh_mfn_is_a_page_table(gmfn)
-         && !(mfn_to_page(gmfn)->shadow_flags
-              & (SHF_L2_32|SHF_L2_PAE|SHF_L2H_PAE|SHF_L4_64)) )
+         && (!v->domain->arch.paging.shadow.pagetable_dying_op ||
+             !(mfn_to_page(gmfn)->shadow_flags
+               & (SHF_L2_32|SHF_L2_PAE|SHF_L2H_PAE|SHF_L4_64))) )
     {
         perfc_incr(shadow_early_unshadow);
         sh_remove_shadows(v, gmfn, 1, 0 /* Fast, can fail to unshadow */ );

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

From xen-changelog-bounces@lists.xensource.com Thu Nov 17 16:17:03 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 17 Nov 2011 16:17:03 +0000
Received: from lists.colo.xensource.com ([70.42.241.110] helo=lists.xensource.com)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RR4e7-00029f-OQ
	for archives@lists.xen.org; Thu, 17 Nov 2011 16:17:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com)
	by lists.xensource.com with esmtp (Exim 4.43)
	id 1RR4dp-0002ry-8k; Thu, 17 Nov 2011 08:16:45 -0800
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xensource.com with esmtp (Exim 4.43) id 1RR4YY-0001s1-G2
	for xen-changelog@lists.xensource.com; Thu, 17 Nov 2011 08:11:19 -0800
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-21.messagelabs.com!1321546273!4543334!1
X-Originating-IP: [93.93.131.152]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30611 invoked from network); 17 Nov 2011 16:11:14 -0000
Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Nov 2011 16:11:14 -0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RR4YT-0003ez-6O
	for xen-changelog@lists.xensource.com; Thu, 17 Nov 2011 16:11:13 +0000
Message-Id: <E1RR4YT-0003ez-6O@xenbits.xen.org>
Date: Thu, 17 Nov 2011 16:11:11 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] [shadow] Disable higher level
	pagetables early unshadow only when the "process dying"
	hypercall is used.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Gianluca Guida <gianluca.guida@citrix.com>
# Date 1321461605 0
# Node ID c16b0a997a05e32b38fb33a70d59523375186f9c
# Parent  cdff7052bad8e0ee5fce18c9db54386b517c7d96
[shadow] Disable higher level pagetables early unshadow only when the "process dying" hypercall is used.

This patch fixes a performance problem in fully virtualized guests.

Signed-off-by: Gianluca Guida <gianluca.guida@citrix.com>
Tested-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24148:3ecc8fef4281
xen-unstable date:        Wed Nov 16 15:19:33 2011 +0000
---


diff -r cdff7052bad8 -r c16b0a997a05 xen/arch/x86/mm/shadow/multi.c
--- a/xen/arch/x86/mm/shadow/multi.c	Sat Nov 12 16:15:19 2011 +0000
+++ b/xen/arch/x86/mm/shadow/multi.c	Wed Nov 16 16:40:05 2011 +0000
@@ -2710,8 +2710,9 @@
            || ( !v->domain->arch.paging.shadow.pagetable_dying_op
                 && v->arch.paging.shadow.last_emulated_mfn_for_unshadow == mfn_x(gmfn) ) )
          && sh_mfn_is_a_page_table(gmfn)
-         && !(mfn_to_page(gmfn)->shadow_flags
-              & (SHF_L2_32|SHF_L2_PAE|SHF_L2H_PAE|SHF_L4_64)) )
+         && (!v->domain->arch.paging.shadow.pagetable_dying_op ||
+             !(mfn_to_page(gmfn)->shadow_flags
+               & (SHF_L2_32|SHF_L2_PAE|SHF_L2H_PAE|SHF_L4_64))) )
     {
         perfc_incr(shadow_early_unshadow);
         sh_remove_shadows(v, gmfn, 1, 0 /* Fast, can fail to unshadow */ );

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

From xen-changelog-bounces@lists.xensource.com Fri Nov 18 02:55:38 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Nov 2011 02:55:38 +0000
Received: from lists.colo.xensource.com ([70.42.241.110] helo=lists.xensource.com)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RREc6-00032c-1d
	for archives@lists.xen.org; Fri, 18 Nov 2011 02:55:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com)
	by lists.xensource.com with esmtp (Exim 4.43)
	id 1RREbk-00018g-Ro; Thu, 17 Nov 2011 18:55:16 -0800
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xensource.com with esmtp (Exim 4.43) id 1RREbh-00018H-SO
	for xen-changelog@lists.xensource.com; Thu, 17 Nov 2011 18:55:14 -0800
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-27.messagelabs.com!1321584878!44405703!1
X-Originating-IP: [93.93.131.152]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25111 invoked from network); 18 Nov 2011 02:54:38 -0000
Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Nov 2011 02:54:38 -0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RREbe-00060H-7X
	for xen-changelog@lists.xensource.com; Fri, 18 Nov 2011 02:55:10 +0000
Message-Id: <E1RREbe-00060H-7X@xenbits.xen.org>
Date: Fri, 18 Nov 2011 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] xen: avoid crash enabling turbo
	mode
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1321461469 0
# Node ID 4a91cf045893035f8cfd7f97ab6c134250d8411a
# Parent  98ba0aceaf302a3d89a9f4f4a165d991a96aa1a1
xen: avoid crash enabling turbo mode

On a system which has not had P-state information pushed down into the
hypervisor running "xenpm enable-turbo-mode" will reliably crash the
host.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset:   24144:cd3ef25f207a
xen-unstable date:        Tue Nov 15 14:24:38 2011 +0100
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 98ba0aceaf30 -r 4a91cf045893 xen/drivers/cpufreq/utility.c
--- a/xen/drivers/cpufreq/utility.c	Wed Nov 16 16:33:58 2011 +0000
+++ b/xen/drivers/cpufreq/utility.c	Wed Nov 16 16:37:49 2011 +0000
@@ -400,7 +400,7 @@
     struct cpufreq_policy *policy;
 
     policy = per_cpu(cpufreq_cpu_policy, cpuid);
-    if (policy->turbo != CPUFREQ_TURBO_UNSUPPORTED)
+    if (policy && policy->turbo != CPUFREQ_TURBO_UNSUPPORTED)
         policy->turbo = CPUFREQ_TURBO_ENABLED;
 }
 
@@ -409,7 +409,7 @@
     struct cpufreq_policy *policy;
 
     policy = per_cpu(cpufreq_cpu_policy, cpuid);
-    if (policy->turbo != CPUFREQ_TURBO_UNSUPPORTED)
+    if (policy && policy->turbo != CPUFREQ_TURBO_UNSUPPORTED)
         policy->turbo = CPUFREQ_TURBO_DISABLED;
 }
 
@@ -418,7 +418,7 @@
     struct cpufreq_policy *policy;
 
     policy = per_cpu(cpufreq_cpu_policy, cpuid);
-    return policy->turbo;
+    return policy && policy->turbo;
 }
 
 /*********************************************************************

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

From xen-changelog-bounces@lists.xensource.com Fri Nov 18 02:55:38 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Nov 2011 02:55:38 +0000
Received: from lists.colo.xensource.com ([70.42.241.110] helo=lists.xensource.com)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RREc6-00032c-1d
	for archives@lists.xen.org; Fri, 18 Nov 2011 02:55:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com)
	by lists.xensource.com with esmtp (Exim 4.43)
	id 1RREbk-00018g-Ro; Thu, 17 Nov 2011 18:55:16 -0800
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xensource.com with esmtp (Exim 4.43) id 1RREbh-00018H-SO
	for xen-changelog@lists.xensource.com; Thu, 17 Nov 2011 18:55:14 -0800
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-27.messagelabs.com!1321584878!44405703!1
X-Originating-IP: [93.93.131.152]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25111 invoked from network); 18 Nov 2011 02:54:38 -0000
Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Nov 2011 02:54:38 -0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RREbe-00060H-7X
	for xen-changelog@lists.xensource.com; Fri, 18 Nov 2011 02:55:10 +0000
Message-Id: <E1RREbe-00060H-7X@xenbits.xen.org>
Date: Fri, 18 Nov 2011 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] xen: avoid crash enabling turbo
	mode
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1321461469 0
# Node ID 4a91cf045893035f8cfd7f97ab6c134250d8411a
# Parent  98ba0aceaf302a3d89a9f4f4a165d991a96aa1a1
xen: avoid crash enabling turbo mode

On a system which has not had P-state information pushed down into the
hypervisor running "xenpm enable-turbo-mode" will reliably crash the
host.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset:   24144:cd3ef25f207a
xen-unstable date:        Tue Nov 15 14:24:38 2011 +0100
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 98ba0aceaf30 -r 4a91cf045893 xen/drivers/cpufreq/utility.c
--- a/xen/drivers/cpufreq/utility.c	Wed Nov 16 16:33:58 2011 +0000
+++ b/xen/drivers/cpufreq/utility.c	Wed Nov 16 16:37:49 2011 +0000
@@ -400,7 +400,7 @@
     struct cpufreq_policy *policy;
 
     policy = per_cpu(cpufreq_cpu_policy, cpuid);
-    if (policy->turbo != CPUFREQ_TURBO_UNSUPPORTED)
+    if (policy && policy->turbo != CPUFREQ_TURBO_UNSUPPORTED)
         policy->turbo = CPUFREQ_TURBO_ENABLED;
 }
 
@@ -409,7 +409,7 @@
     struct cpufreq_policy *policy;
 
     policy = per_cpu(cpufreq_cpu_policy, cpuid);
-    if (policy->turbo != CPUFREQ_TURBO_UNSUPPORTED)
+    if (policy && policy->turbo != CPUFREQ_TURBO_UNSUPPORTED)
         policy->turbo = CPUFREQ_TURBO_DISABLED;
 }
 
@@ -418,7 +418,7 @@
     struct cpufreq_policy *policy;
 
     policy = per_cpu(cpufreq_cpu_policy, cpuid);
-    return policy->turbo;
+    return policy && policy->turbo;
 }
 
 /*********************************************************************

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

From xen-changelog-bounces@lists.xensource.com Fri Nov 18 02:55:48 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Nov 2011 02:55:48 +0000
Received: from lists.colo.xensource.com ([70.42.241.110] helo=lists.xensource.com)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RREcG-00032q-1N
	for archives@lists.xen.org; Fri, 18 Nov 2011 02:55:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com)
	by lists.xensource.com with esmtp (Exim 4.43)
	id 1RREbx-0001Bj-Tn; Thu, 17 Nov 2011 18:55:29 -0800
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xensource.com with esmtp (Exim 4.43) id 1RREbi-00018I-Jn
	for xen-changelog@lists.xensource.com; Thu, 17 Nov 2011 18:55:14 -0800
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-21.messagelabs.com!1321584910!4663037!1
X-Originating-IP: [93.93.131.152]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18557 invoked from network); 18 Nov 2011 02:55:10 -0000
Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Nov 2011 02:55:10 -0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RREbd-000603-Mk
	for xen-changelog@lists.xensource.com; Fri, 18 Nov 2011 02:55:09 +0000
Message-Id: <E1RREbd-000603-Mk@xenbits.xen.org>
Date: Fri, 18 Nov 2011 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] x86: re-inject emulated level
	pirqs in PV on HVM guests if still asserted
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1321461238 0
# Node ID 98ba0aceaf302a3d89a9f4f4a165d991a96aa1a1
# Parent  9702967e89dd005a8b3f24eb1d10c46712c2e3ed
x86: re-inject emulated level pirqs in PV on HVM guests if still asserted

PV on HVM guests can loose level interrupts coming from emulated
devices if they have been remapped onto event channels.  The reason is
that we are missing the code to inject a pirq again in the guest when
the guest EOIs it, if it corresponds to an emulated level interrupt
and the interrupt is still asserted.

Fix this issue and also return error when the guest tries to get the
irq_status of a non-existing pirq.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24007:0526644ad2a6
xen-unstable date:        Thu Oct 27 16:07:18 2011 +0100
---


diff -r 9702967e89dd -r 98ba0aceaf30 xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c	Sat Nov 12 16:14:02 2011 +0000
+++ b/xen/arch/x86/physdev.c	Wed Nov 16 16:33:58 2011 +0000
@@ -261,6 +261,7 @@
         ret = -EINVAL;
         if ( eoi.irq >= v->domain->nr_pirqs )
             break;
+        spin_lock(&v->domain->event_lock);
         if ( v->domain->arch.pirq_eoi_map )
             evtchn_unmask(v->domain->pirq_to_evtchn[eoi.irq]);
         if ( !is_hvm_domain(v->domain) ||
@@ -268,6 +269,19 @@
             ret = pirq_guest_eoi(v->domain, eoi.irq);
         else
             ret = 0;
+        if ( is_hvm_domain(v->domain) &&
+                domain_pirq_to_emuirq(v->domain, eoi.irq) > 0 )
+        {
+            struct hvm_irq *hvm_irq = &v->domain->arch.hvm_domain.irq;
+            int gsi = domain_pirq_to_emuirq(v->domain, eoi.irq);
+
+            /* if this is a level irq and count > 0, send another
+             * notification */ 
+            if ( gsi >= NR_ISAIRQS /* ISA irqs are edge triggered */
+                    && hvm_irq->gsi_assert_count[gsi] )
+                send_guest_pirq(v->domain, eoi.irq);
+        }
+        spin_unlock(&v->domain->event_lock);
         break;
     }
 
@@ -323,9 +337,10 @@
             break;
         irq_status_query.flags = 0;
         if ( is_hvm_domain(v->domain) &&
-             domain_pirq_to_irq(v->domain, irq) <= 0 )
+                domain_pirq_to_irq(v->domain, irq) <= 0 &&
+                domain_pirq_to_emuirq(v->domain, irq) == IRQ_UNBOUND )
         {
-            ret = copy_to_guest(arg, &irq_status_query, 1) ? -EFAULT : 0;
+            ret = -EINVAL;
             break;
         }
 

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

From xen-changelog-bounces@lists.xensource.com Fri Nov 18 02:55:48 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Nov 2011 02:55:48 +0000
Received: from lists.colo.xensource.com ([70.42.241.110] helo=lists.xensource.com)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RREcG-00032q-1N
	for archives@lists.xen.org; Fri, 18 Nov 2011 02:55:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com)
	by lists.xensource.com with esmtp (Exim 4.43)
	id 1RREbx-0001Bj-Tn; Thu, 17 Nov 2011 18:55:29 -0800
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xensource.com with esmtp (Exim 4.43) id 1RREbi-00018I-Jn
	for xen-changelog@lists.xensource.com; Thu, 17 Nov 2011 18:55:14 -0800
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-21.messagelabs.com!1321584910!4663037!1
X-Originating-IP: [93.93.131.152]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18557 invoked from network); 18 Nov 2011 02:55:10 -0000
Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Nov 2011 02:55:10 -0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RREbd-000603-Mk
	for xen-changelog@lists.xensource.com; Fri, 18 Nov 2011 02:55:09 +0000
Message-Id: <E1RREbd-000603-Mk@xenbits.xen.org>
Date: Fri, 18 Nov 2011 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] x86: re-inject emulated level
	pirqs in PV on HVM guests if still asserted
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1321461238 0
# Node ID 98ba0aceaf302a3d89a9f4f4a165d991a96aa1a1
# Parent  9702967e89dd005a8b3f24eb1d10c46712c2e3ed
x86: re-inject emulated level pirqs in PV on HVM guests if still asserted

PV on HVM guests can loose level interrupts coming from emulated
devices if they have been remapped onto event channels.  The reason is
that we are missing the code to inject a pirq again in the guest when
the guest EOIs it, if it corresponds to an emulated level interrupt
and the interrupt is still asserted.

Fix this issue and also return error when the guest tries to get the
irq_status of a non-existing pirq.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24007:0526644ad2a6
xen-unstable date:        Thu Oct 27 16:07:18 2011 +0100
---


diff -r 9702967e89dd -r 98ba0aceaf30 xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c	Sat Nov 12 16:14:02 2011 +0000
+++ b/xen/arch/x86/physdev.c	Wed Nov 16 16:33:58 2011 +0000
@@ -261,6 +261,7 @@
         ret = -EINVAL;
         if ( eoi.irq >= v->domain->nr_pirqs )
             break;
+        spin_lock(&v->domain->event_lock);
         if ( v->domain->arch.pirq_eoi_map )
             evtchn_unmask(v->domain->pirq_to_evtchn[eoi.irq]);
         if ( !is_hvm_domain(v->domain) ||
@@ -268,6 +269,19 @@
             ret = pirq_guest_eoi(v->domain, eoi.irq);
         else
             ret = 0;
+        if ( is_hvm_domain(v->domain) &&
+                domain_pirq_to_emuirq(v->domain, eoi.irq) > 0 )
+        {
+            struct hvm_irq *hvm_irq = &v->domain->arch.hvm_domain.irq;
+            int gsi = domain_pirq_to_emuirq(v->domain, eoi.irq);
+
+            /* if this is a level irq and count > 0, send another
+             * notification */ 
+            if ( gsi >= NR_ISAIRQS /* ISA irqs are edge triggered */
+                    && hvm_irq->gsi_assert_count[gsi] )
+                send_guest_pirq(v->domain, eoi.irq);
+        }
+        spin_unlock(&v->domain->event_lock);
         break;
     }
 
@@ -323,9 +337,10 @@
             break;
         irq_status_query.flags = 0;
         if ( is_hvm_domain(v->domain) &&
-             domain_pirq_to_irq(v->domain, irq) <= 0 )
+                domain_pirq_to_irq(v->domain, irq) <= 0 &&
+                domain_pirq_to_emuirq(v->domain, irq) == IRQ_UNBOUND )
         {
-            ret = copy_to_guest(arg, &irq_status_query, 1) ? -EFAULT : 0;
+            ret = -EINVAL;
             break;
         }
 

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

From xen-changelog-bounces@lists.xensource.com Fri Nov 18 02:56:00 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Nov 2011 02:56:00 +0000
Received: from lists.colo.xensource.com ([70.42.241.110] helo=lists.xensource.com)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RREcS-000333-8T
	for archives@lists.xen.org; Fri, 18 Nov 2011 02:56:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com)
	by lists.xensource.com with esmtp (Exim 4.43)
	id 1RREcA-0001Ep-4x; Thu, 17 Nov 2011 18:55:42 -0800
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xensource.com with esmtp (Exim 4.43) id 1RREbi-00018J-Oq
	for xen-changelog@lists.xensource.com; Thu, 17 Nov 2011 18:55:15 -0800
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-174.messagelabs.com!1321584911!1971618!1
X-Originating-IP: [93.93.131.152]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7426 invoked from network); 18 Nov 2011 02:55:11 -0000
Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152)
	by server-3.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Nov 2011 02:55:11 -0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RREbf-00060m-5x
	for xen-changelog@lists.xensource.com; Fri, 18 Nov 2011 02:55:11 +0000
Message-Id: <E1RREbf-00060m-5x@xenbits.xen.org>
Date: Fri, 18 Nov 2011 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] x86-64/test_x86_emulate: fix
	blowfish test
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1321461542 0
# Node ID 51f58b21044755c50f9375068e37f93325bc861d
# Parent  efd132eee40c96a991bc8f354d39a186b6de3219
x86-64/test_x86_emulate: fix blowfish test

Incorrect register usage in the _start() wrapper caused the 64-bit
execution emulation to fail.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24149:753b21aa4087
xen-unstable date:        Wed Nov 16 15:20:25 2011 +0000
---


diff -r efd132eee40c -r 51f58b210447 tools/tests/x86_emulator/blowfish.c
--- a/tools/tests/x86_emulator/blowfish.c	Wed Nov 16 16:38:27 2011 +0000
+++ b/tools/tests/x86_emulator/blowfish.c	Wed Nov 16 16:39:02 2011 +0000
@@ -30,7 +30,7 @@
 #else
     "shlq $32,%rdx; movl %eax,%edi; orq %rdx,%rdi; "
     "call blowfish_test; "
-    "movq %rax,%rdi; movl %eax,%eax; shrq $32,%rdx; "
+    "movq %rax,%rdx; movl %eax,%eax; shrq $32,%rdx; "
 #endif
     "ret"
     );

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

From xen-changelog-bounces@lists.xensource.com Fri Nov 18 02:56:00 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Nov 2011 02:56:00 +0000
Received: from lists.colo.xensource.com ([70.42.241.110] helo=lists.xensource.com)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RREcS-000333-8T
	for archives@lists.xen.org; Fri, 18 Nov 2011 02:56:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com)
	by lists.xensource.com with esmtp (Exim 4.43)
	id 1RREcA-0001Ep-4x; Thu, 17 Nov 2011 18:55:42 -0800
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xensource.com with esmtp (Exim 4.43) id 1RREbi-00018J-Oq
	for xen-changelog@lists.xensource.com; Thu, 17 Nov 2011 18:55:15 -0800
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-174.messagelabs.com!1321584911!1971618!1
X-Originating-IP: [93.93.131.152]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7426 invoked from network); 18 Nov 2011 02:55:11 -0000
Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152)
	by server-3.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Nov 2011 02:55:11 -0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RREbf-00060m-5x
	for xen-changelog@lists.xensource.com; Fri, 18 Nov 2011 02:55:11 +0000
Message-Id: <E1RREbf-00060m-5x@xenbits.xen.org>
Date: Fri, 18 Nov 2011 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] x86-64/test_x86_emulate: fix
	blowfish test
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1321461542 0
# Node ID 51f58b21044755c50f9375068e37f93325bc861d
# Parent  efd132eee40c96a991bc8f354d39a186b6de3219
x86-64/test_x86_emulate: fix blowfish test

Incorrect register usage in the _start() wrapper caused the 64-bit
execution emulation to fail.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24149:753b21aa4087
xen-unstable date:        Wed Nov 16 15:20:25 2011 +0000
---


diff -r efd132eee40c -r 51f58b210447 tools/tests/x86_emulator/blowfish.c
--- a/tools/tests/x86_emulator/blowfish.c	Wed Nov 16 16:38:27 2011 +0000
+++ b/tools/tests/x86_emulator/blowfish.c	Wed Nov 16 16:39:02 2011 +0000
@@ -30,7 +30,7 @@
 #else
     "shlq $32,%rdx; movl %eax,%edi; orq %rdx,%rdi; "
     "call blowfish_test; "
-    "movq %rax,%rdi; movl %eax,%eax; shrq $32,%rdx; "
+    "movq %rax,%rdx; movl %eax,%eax; shrq $32,%rdx; "
 #endif
     "ret"
     );

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

From xen-changelog-bounces@lists.xensource.com Fri Nov 18 02:56:10 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Nov 2011 02:56:10 +0000
Received: from lists.colo.xensource.com ([70.42.241.110] helo=lists.xensource.com)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RREcc-00033G-Hj
	for archives@lists.xen.org; Fri, 18 Nov 2011 02:56:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com)
	by lists.xensource.com with esmtp (Exim 4.43)
	id 1RREcK-0001Hv-E0; Thu, 17 Nov 2011 18:55:52 -0800
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xensource.com with esmtp (Exim 4.43) id 1RREbi-00018K-S9
	for xen-changelog@lists.xensource.com; Thu, 17 Nov 2011 18:55:15 -0800
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1321584911!3994836!1
X-Originating-IP: [93.93.131.152]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24468 invoked from network); 18 Nov 2011 02:55:11 -0000
Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152)
	by server-4.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Nov 2011 02:55:11 -0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RREbe-00060X-NG
	for xen-changelog@lists.xensource.com; Fri, 18 Nov 2011 02:55:10 +0000
Message-Id: <E1RREbe-00060X-NG@xenbits.xen.org>
Date: Fri, 18 Nov 2011 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] [shadow] Disable higher level
	pagetables early unshadow only when the "process dying"
	hypercall is used.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Gianluca Guida <gianluca.guida@citrix.com>
# Date 1321461507 0
# Node ID efd132eee40c96a991bc8f354d39a186b6de3219
# Parent  4a91cf045893035f8cfd7f97ab6c134250d8411a
[shadow] Disable higher level pagetables early unshadow only when the "process dying" hypercall is used.

This patch fixes a performance problem in fully virtualized guests.

Signed-off-by: Gianluca Guida <gianluca.guida@citrix.com>
Tested-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24148:3ecc8fef4281
xen-unstable date:        Wed Nov 16 15:19:33 2011 +0000
---


diff -r 4a91cf045893 -r efd132eee40c xen/arch/x86/mm/shadow/multi.c
--- a/xen/arch/x86/mm/shadow/multi.c	Wed Nov 16 16:37:49 2011 +0000
+++ b/xen/arch/x86/mm/shadow/multi.c	Wed Nov 16 16:38:27 2011 +0000
@@ -2743,8 +2743,9 @@
            || ( !v->domain->arch.paging.shadow.pagetable_dying_op
                 && v->arch.paging.shadow.last_emulated_mfn_for_unshadow == mfn_x(gmfn) ) )
          && sh_mfn_is_a_page_table(gmfn)
-         && !(mfn_to_page(gmfn)->shadow_flags
-              & (SHF_L2_32|SHF_L2_PAE|SHF_L2H_PAE|SHF_L4_64)) )
+         && (!v->domain->arch.paging.shadow.pagetable_dying_op ||
+             !(mfn_to_page(gmfn)->shadow_flags
+               & (SHF_L2_32|SHF_L2_PAE|SHF_L2H_PAE|SHF_L4_64))) )
     {
         perfc_incr(shadow_early_unshadow);
         sh_remove_shadows(v, gmfn, 1, 0 /* Fast, can fail to unshadow */ );

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

From xen-changelog-bounces@lists.xensource.com Fri Nov 18 02:56:10 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Nov 2011 02:56:10 +0000
Received: from lists.colo.xensource.com ([70.42.241.110] helo=lists.xensource.com)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RREcc-00033G-Hj
	for archives@lists.xen.org; Fri, 18 Nov 2011 02:56:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com)
	by lists.xensource.com with esmtp (Exim 4.43)
	id 1RREcK-0001Hv-E0; Thu, 17 Nov 2011 18:55:52 -0800
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xensource.com with esmtp (Exim 4.43) id 1RREbi-00018K-S9
	for xen-changelog@lists.xensource.com; Thu, 17 Nov 2011 18:55:15 -0800
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1321584911!3994836!1
X-Originating-IP: [93.93.131.152]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24468 invoked from network); 18 Nov 2011 02:55:11 -0000
Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152)
	by server-4.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Nov 2011 02:55:11 -0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RREbe-00060X-NG
	for xen-changelog@lists.xensource.com; Fri, 18 Nov 2011 02:55:10 +0000
Message-Id: <E1RREbe-00060X-NG@xenbits.xen.org>
Date: Fri, 18 Nov 2011 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] [shadow] Disable higher level
	pagetables early unshadow only when the "process dying"
	hypercall is used.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Gianluca Guida <gianluca.guida@citrix.com>
# Date 1321461507 0
# Node ID efd132eee40c96a991bc8f354d39a186b6de3219
# Parent  4a91cf045893035f8cfd7f97ab6c134250d8411a
[shadow] Disable higher level pagetables early unshadow only when the "process dying" hypercall is used.

This patch fixes a performance problem in fully virtualized guests.

Signed-off-by: Gianluca Guida <gianluca.guida@citrix.com>
Tested-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24148:3ecc8fef4281
xen-unstable date:        Wed Nov 16 15:19:33 2011 +0000
---


diff -r 4a91cf045893 -r efd132eee40c xen/arch/x86/mm/shadow/multi.c
--- a/xen/arch/x86/mm/shadow/multi.c	Wed Nov 16 16:37:49 2011 +0000
+++ b/xen/arch/x86/mm/shadow/multi.c	Wed Nov 16 16:38:27 2011 +0000
@@ -2743,8 +2743,9 @@
            || ( !v->domain->arch.paging.shadow.pagetable_dying_op
                 && v->arch.paging.shadow.last_emulated_mfn_for_unshadow == mfn_x(gmfn) ) )
          && sh_mfn_is_a_page_table(gmfn)
-         && !(mfn_to_page(gmfn)->shadow_flags
-              & (SHF_L2_32|SHF_L2_PAE|SHF_L2H_PAE|SHF_L4_64)) )
+         && (!v->domain->arch.paging.shadow.pagetable_dying_op ||
+             !(mfn_to_page(gmfn)->shadow_flags
+               & (SHF_L2_32|SHF_L2_PAE|SHF_L2H_PAE|SHF_L4_64))) )
     {
         perfc_incr(shadow_early_unshadow);
         sh_remove_shadows(v, gmfn, 1, 0 /* Fast, can fail to unshadow */ );

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

From xen-changelog-bounces@lists.xensource.com Fri Nov 18 02:56:20 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Nov 2011 02:56:20 +0000
Received: from lists.colo.xensource.com ([70.42.241.110] helo=lists.xensource.com)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RREcm-00033T-Bl
	for archives@lists.xen.org; Fri, 18 Nov 2011 02:56:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com)
	by lists.xensource.com with esmtp (Exim 4.43)
	id 1RREcU-0001L3-4J; Thu, 17 Nov 2011 18:56:02 -0800
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xensource.com with esmtp (Exim 4.43) id 1RREbj-00018M-L7
	for xen-changelog@lists.xensource.com; Thu, 17 Nov 2011 18:55:16 -0800
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-21.messagelabs.com!1321584912!2694474!1
X-Originating-IP: [93.93.131.152]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17220 invoked from network); 18 Nov 2011 02:55:12 -0000
Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Nov 2011 02:55:12 -0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RREbg-00061G-5e
	for xen-changelog@lists.xensource.com; Fri, 18 Nov 2011 02:55:12 +0000
Message-Id: <E1RREbg-00061G-5e@xenbits.xen.org>
Date: Fri, 18 Nov 2011 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] xsm: Add support for
	HVMOP_track_dirty_vram.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jean Guyader <jean.guyader@eu.citrix.com>
# Date 1321521120 0
# Node ID 344dddd4160bec210e7cb97e772a5bcc2b0a5fa0
# Parent  1bbf2940ef6146923593e642b34f7c55d1c58f92
xsm: Add support for HVMOP_track_dirty_vram.

Xen try to inforce the xsm policy when a HVMOP_track_dirty_vram
is received (xen/arch/x86/hvm/hvm.c:3637). It was failing because
in flask_hvmcontext, xsm didn't have any case for this operation.

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24107:fb1b32c9d03d
xen-unstable date:        Tue Nov 08 19:41:47 2011 +0000
---


diff -r 1bbf2940ef61 -r 344dddd4160b tools/flask/policy/policy/flask/access_vectors
--- a/tools/flask/policy/policy/flask/access_vectors	Thu Nov 17 09:10:07 2011 +0000
+++ b/tools/flask/policy/policy/flask/access_vectors	Thu Nov 17 09:12:00 2011 +0000
@@ -90,6 +90,7 @@
     pciroute
 	bind_irq
 	cacheattr
+    trackdirtyvram
 }
 
 class event
diff -r 1bbf2940ef61 -r 344dddd4160b tools/flask/policy/policy/modules/xen/xen.if
--- a/tools/flask/policy/policy/modules/xen/xen.if	Thu Nov 17 09:10:07 2011 +0000
+++ b/tools/flask/policy/policy/modules/xen/xen.if	Thu Nov 17 09:12:00 2011 +0000
@@ -22,7 +22,7 @@
 ################################################################################
 define(`create_hvm_dom', `
 	create_domain($1, $2, $3)
-	allow $1 $2:hvm { setparam getparam cacheattr pciroute irqlevel	pcilevel };
+	allow $1 $2:hvm { setparam getparam cacheattr pciroute irqlevel	pcilevel trackdirtyvram };
 	allow $2 $2:hvm setparam;
 ')	
 
diff -r 1bbf2940ef61 -r 344dddd4160b xen/xsm/flask/hooks.c
--- a/xen/xsm/flask/hooks.c	Thu Nov 17 09:10:07 2011 +0000
+++ b/xen/xsm/flask/hooks.c	Thu Nov 17 09:12:00 2011 +0000
@@ -835,6 +835,9 @@
     case XEN_DOMCTL_gethvmcontext_partial:
         perm = HVM__GETHVMC;
         break;
+    case HVMOP_track_dirty_vram:
+        perm = HVM__TRACKDIRTYVRAM;
+        break;
     default:
         return -EPERM;
     }
diff -r 1bbf2940ef61 -r 344dddd4160b xen/xsm/flask/include/av_perm_to_string.h
--- a/xen/xsm/flask/include/av_perm_to_string.h	Thu Nov 17 09:10:07 2011 +0000
+++ b/xen/xsm/flask/include/av_perm_to_string.h	Thu Nov 17 09:12:00 2011 +0000
@@ -56,6 +56,7 @@
    S_(SECCLASS_HVM, HVM__GETHVMC, "gethvmc")
    S_(SECCLASS_HVM, HVM__SETPARAM, "setparam")
    S_(SECCLASS_HVM, HVM__GETPARAM, "getparam")
+   S_(SECCLASS_HVM, HVM__TRACKDIRTYVRAM, "trackdirtyvram")
    S_(SECCLASS_HVM, HVM__PCILEVEL, "pcilevel")
    S_(SECCLASS_HVM, HVM__IRQLEVEL, "irqlevel")
    S_(SECCLASS_HVM, HVM__PCIROUTE, "pciroute")
diff -r 1bbf2940ef61 -r 344dddd4160b xen/xsm/flask/include/av_permissions.h
--- a/xen/xsm/flask/include/av_permissions.h	Thu Nov 17 09:10:07 2011 +0000
+++ b/xen/xsm/flask/include/av_permissions.h	Thu Nov 17 09:12:00 2011 +0000
@@ -63,6 +63,7 @@
 #define HVM__PCIROUTE                             0x00000040UL
 #define HVM__BIND_IRQ                             0x00000080UL
 #define HVM__CACHEATTR                            0x00000100UL
+#define HVM__TRACKDIRTYVRAM                       0x00000200UL
 
 #define EVENT__BIND                               0x00000001UL
 #define EVENT__SEND                               0x00000002UL

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

From xen-changelog-bounces@lists.xensource.com Fri Nov 18 02:56:20 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Nov 2011 02:56:20 +0000
Received: from lists.colo.xensource.com ([70.42.241.110] helo=lists.xensource.com)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RREcm-00033T-Bl
	for archives@lists.xen.org; Fri, 18 Nov 2011 02:56:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com)
	by lists.xensource.com with esmtp (Exim 4.43)
	id 1RREcU-0001L3-4J; Thu, 17 Nov 2011 18:56:02 -0800
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xensource.com with esmtp (Exim 4.43) id 1RREbj-00018M-L7
	for xen-changelog@lists.xensource.com; Thu, 17 Nov 2011 18:55:16 -0800
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-21.messagelabs.com!1321584912!2694474!1
X-Originating-IP: [93.93.131.152]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17220 invoked from network); 18 Nov 2011 02:55:12 -0000
Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Nov 2011 02:55:12 -0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RREbg-00061G-5e
	for xen-changelog@lists.xensource.com; Fri, 18 Nov 2011 02:55:12 +0000
Message-Id: <E1RREbg-00061G-5e@xenbits.xen.org>
Date: Fri, 18 Nov 2011 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] xsm: Add support for
	HVMOP_track_dirty_vram.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jean Guyader <jean.guyader@eu.citrix.com>
# Date 1321521120 0
# Node ID 344dddd4160bec210e7cb97e772a5bcc2b0a5fa0
# Parent  1bbf2940ef6146923593e642b34f7c55d1c58f92
xsm: Add support for HVMOP_track_dirty_vram.

Xen try to inforce the xsm policy when a HVMOP_track_dirty_vram
is received (xen/arch/x86/hvm/hvm.c:3637). It was failing because
in flask_hvmcontext, xsm didn't have any case for this operation.

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24107:fb1b32c9d03d
xen-unstable date:        Tue Nov 08 19:41:47 2011 +0000
---


diff -r 1bbf2940ef61 -r 344dddd4160b tools/flask/policy/policy/flask/access_vectors
--- a/tools/flask/policy/policy/flask/access_vectors	Thu Nov 17 09:10:07 2011 +0000
+++ b/tools/flask/policy/policy/flask/access_vectors	Thu Nov 17 09:12:00 2011 +0000
@@ -90,6 +90,7 @@
     pciroute
 	bind_irq
 	cacheattr
+    trackdirtyvram
 }
 
 class event
diff -r 1bbf2940ef61 -r 344dddd4160b tools/flask/policy/policy/modules/xen/xen.if
--- a/tools/flask/policy/policy/modules/xen/xen.if	Thu Nov 17 09:10:07 2011 +0000
+++ b/tools/flask/policy/policy/modules/xen/xen.if	Thu Nov 17 09:12:00 2011 +0000
@@ -22,7 +22,7 @@
 ################################################################################
 define(`create_hvm_dom', `
 	create_domain($1, $2, $3)
-	allow $1 $2:hvm { setparam getparam cacheattr pciroute irqlevel	pcilevel };
+	allow $1 $2:hvm { setparam getparam cacheattr pciroute irqlevel	pcilevel trackdirtyvram };
 	allow $2 $2:hvm setparam;
 ')	
 
diff -r 1bbf2940ef61 -r 344dddd4160b xen/xsm/flask/hooks.c
--- a/xen/xsm/flask/hooks.c	Thu Nov 17 09:10:07 2011 +0000
+++ b/xen/xsm/flask/hooks.c	Thu Nov 17 09:12:00 2011 +0000
@@ -835,6 +835,9 @@
     case XEN_DOMCTL_gethvmcontext_partial:
         perm = HVM__GETHVMC;
         break;
+    case HVMOP_track_dirty_vram:
+        perm = HVM__TRACKDIRTYVRAM;
+        break;
     default:
         return -EPERM;
     }
diff -r 1bbf2940ef61 -r 344dddd4160b xen/xsm/flask/include/av_perm_to_string.h
--- a/xen/xsm/flask/include/av_perm_to_string.h	Thu Nov 17 09:10:07 2011 +0000
+++ b/xen/xsm/flask/include/av_perm_to_string.h	Thu Nov 17 09:12:00 2011 +0000
@@ -56,6 +56,7 @@
    S_(SECCLASS_HVM, HVM__GETHVMC, "gethvmc")
    S_(SECCLASS_HVM, HVM__SETPARAM, "setparam")
    S_(SECCLASS_HVM, HVM__GETPARAM, "getparam")
+   S_(SECCLASS_HVM, HVM__TRACKDIRTYVRAM, "trackdirtyvram")
    S_(SECCLASS_HVM, HVM__PCILEVEL, "pcilevel")
    S_(SECCLASS_HVM, HVM__IRQLEVEL, "irqlevel")
    S_(SECCLASS_HVM, HVM__PCIROUTE, "pciroute")
diff -r 1bbf2940ef61 -r 344dddd4160b xen/xsm/flask/include/av_permissions.h
--- a/xen/xsm/flask/include/av_permissions.h	Thu Nov 17 09:10:07 2011 +0000
+++ b/xen/xsm/flask/include/av_permissions.h	Thu Nov 17 09:12:00 2011 +0000
@@ -63,6 +63,7 @@
 #define HVM__PCIROUTE                             0x00000040UL
 #define HVM__BIND_IRQ                             0x00000080UL
 #define HVM__CACHEATTR                            0x00000100UL
+#define HVM__TRACKDIRTYVRAM                       0x00000200UL
 
 #define EVENT__BIND                               0x00000001UL
 #define EVENT__SEND                               0x00000002UL

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

From xen-changelog-bounces@lists.xensource.com Fri Nov 18 02:56:29 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Nov 2011 02:56:29 +0000
Received: from lists.colo.xensource.com ([70.42.241.110] helo=lists.xensource.com)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RREcv-00033g-3j
	for archives@lists.xen.org; Fri, 18 Nov 2011 02:56:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com)
	by lists.xensource.com with esmtp (Exim 4.43)
	id 1RREcd-0001Of-8n; Thu, 17 Nov 2011 18:56:11 -0800
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xensource.com with esmtp (Exim 4.43) id 1RREbj-00018L-O9
	for xen-changelog@lists.xensource.com; Thu, 17 Nov 2011 18:55:16 -0800
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-182.messagelabs.com!1321584912!3616624!1
X-Originating-IP: [93.93.131.152]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13345 invoked from network); 18 Nov 2011 02:55:12 -0000
Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152)
	by server-3.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Nov 2011 02:55:12 -0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RREbf-000611-MI
	for xen-changelog@lists.xensource.com; Fri, 18 Nov 2011 02:55:11 +0000
Message-Id: <E1RREbf-000611-MI@xenbits.xen.org>
Date: Fri, 18 Nov 2011 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] Revert 23183:98ba0aceaf30
	(xen-unstable:24007:0526644ad2a6).
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1321521007 0
# Node ID 1bbf2940ef6146923593e642b34f7c55d1c58f92
# Parent  51f58b21044755c50f9375068e37f93325bc861d
Revert 23183:98ba0aceaf30 (xen-unstable:24007:0526644ad2a6).

Locking is broken (calls evtchn_unmask with lock already held).

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


diff -r 51f58b210447 -r 1bbf2940ef61 xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c	Wed Nov 16 16:39:02 2011 +0000
+++ b/xen/arch/x86/physdev.c	Thu Nov 17 09:10:07 2011 +0000
@@ -261,7 +261,6 @@
         ret = -EINVAL;
         if ( eoi.irq >= v->domain->nr_pirqs )
             break;
-        spin_lock(&v->domain->event_lock);
         if ( v->domain->arch.pirq_eoi_map )
             evtchn_unmask(v->domain->pirq_to_evtchn[eoi.irq]);
         if ( !is_hvm_domain(v->domain) ||
@@ -269,19 +268,6 @@
             ret = pirq_guest_eoi(v->domain, eoi.irq);
         else
             ret = 0;
-        if ( is_hvm_domain(v->domain) &&
-                domain_pirq_to_emuirq(v->domain, eoi.irq) > 0 )
-        {
-            struct hvm_irq *hvm_irq = &v->domain->arch.hvm_domain.irq;
-            int gsi = domain_pirq_to_emuirq(v->domain, eoi.irq);
-
-            /* if this is a level irq and count > 0, send another
-             * notification */ 
-            if ( gsi >= NR_ISAIRQS /* ISA irqs are edge triggered */
-                    && hvm_irq->gsi_assert_count[gsi] )
-                send_guest_pirq(v->domain, eoi.irq);
-        }
-        spin_unlock(&v->domain->event_lock);
         break;
     }
 
@@ -337,10 +323,9 @@
             break;
         irq_status_query.flags = 0;
         if ( is_hvm_domain(v->domain) &&
-                domain_pirq_to_irq(v->domain, irq) <= 0 &&
-                domain_pirq_to_emuirq(v->domain, irq) == IRQ_UNBOUND )
+             domain_pirq_to_irq(v->domain, irq) <= 0 )
         {
-            ret = -EINVAL;
+            ret = copy_to_guest(arg, &irq_status_query, 1) ? -EFAULT : 0;
             break;
         }
 

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

From xen-changelog-bounces@lists.xensource.com Fri Nov 18 02:56:29 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Nov 2011 02:56:29 +0000
Received: from lists.colo.xensource.com ([70.42.241.110] helo=lists.xensource.com)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RREcv-00033g-3j
	for archives@lists.xen.org; Fri, 18 Nov 2011 02:56:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com)
	by lists.xensource.com with esmtp (Exim 4.43)
	id 1RREcd-0001Of-8n; Thu, 17 Nov 2011 18:56:11 -0800
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xensource.com with esmtp (Exim 4.43) id 1RREbj-00018L-O9
	for xen-changelog@lists.xensource.com; Thu, 17 Nov 2011 18:55:16 -0800
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-182.messagelabs.com!1321584912!3616624!1
X-Originating-IP: [93.93.131.152]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13345 invoked from network); 18 Nov 2011 02:55:12 -0000
Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152)
	by server-3.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Nov 2011 02:55:12 -0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RREbf-000611-MI
	for xen-changelog@lists.xensource.com; Fri, 18 Nov 2011 02:55:11 +0000
Message-Id: <E1RREbf-000611-MI@xenbits.xen.org>
Date: Fri, 18 Nov 2011 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] Revert 23183:98ba0aceaf30
	(xen-unstable:24007:0526644ad2a6).
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1321521007 0
# Node ID 1bbf2940ef6146923593e642b34f7c55d1c58f92
# Parent  51f58b21044755c50f9375068e37f93325bc861d
Revert 23183:98ba0aceaf30 (xen-unstable:24007:0526644ad2a6).

Locking is broken (calls evtchn_unmask with lock already held).

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


diff -r 51f58b210447 -r 1bbf2940ef61 xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c	Wed Nov 16 16:39:02 2011 +0000
+++ b/xen/arch/x86/physdev.c	Thu Nov 17 09:10:07 2011 +0000
@@ -261,7 +261,6 @@
         ret = -EINVAL;
         if ( eoi.irq >= v->domain->nr_pirqs )
             break;
-        spin_lock(&v->domain->event_lock);
         if ( v->domain->arch.pirq_eoi_map )
             evtchn_unmask(v->domain->pirq_to_evtchn[eoi.irq]);
         if ( !is_hvm_domain(v->domain) ||
@@ -269,19 +268,6 @@
             ret = pirq_guest_eoi(v->domain, eoi.irq);
         else
             ret = 0;
-        if ( is_hvm_domain(v->domain) &&
-                domain_pirq_to_emuirq(v->domain, eoi.irq) > 0 )
-        {
-            struct hvm_irq *hvm_irq = &v->domain->arch.hvm_domain.irq;
-            int gsi = domain_pirq_to_emuirq(v->domain, eoi.irq);
-
-            /* if this is a level irq and count > 0, send another
-             * notification */ 
-            if ( gsi >= NR_ISAIRQS /* ISA irqs are edge triggered */
-                    && hvm_irq->gsi_assert_count[gsi] )
-                send_guest_pirq(v->domain, eoi.irq);
-        }
-        spin_unlock(&v->domain->event_lock);
         break;
     }
 
@@ -337,10 +323,9 @@
             break;
         irq_status_query.flags = 0;
         if ( is_hvm_domain(v->domain) &&
-                domain_pirq_to_irq(v->domain, irq) <= 0 &&
-                domain_pirq_to_emuirq(v->domain, irq) == IRQ_UNBOUND )
+             domain_pirq_to_irq(v->domain, irq) <= 0 )
         {
-            ret = -EINVAL;
+            ret = copy_to_guest(arg, &irq_status_query, 1) ? -EFAULT : 0;
             break;
         }
 

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

From xen-changelog-bounces@lists.xensource.com Fri Nov 18 02:56:37 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Nov 2011 02:56:37 +0000
Received: from lists.colo.xensource.com ([70.42.241.110] helo=lists.xensource.com)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RREd3-00033t-3i
	for archives@lists.xen.org; Fri, 18 Nov 2011 02:56:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com)
	by lists.xensource.com with esmtp (Exim 4.43)
	id 1RREck-0001Rm-Rm; Thu, 17 Nov 2011 18:56:18 -0800
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xensource.com with esmtp (Exim 4.43) id 1RREbk-00018N-3y
	for xen-changelog@lists.xensource.com; Thu, 17 Nov 2011 18:55:16 -0800
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-21.messagelabs.com!1321584913!4709071!1
X-Originating-IP: [93.93.131.152]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20345 invoked from network); 18 Nov 2011 02:55:13 -0000
Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Nov 2011 02:55:13 -0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RREbg-00061V-LX
	for xen-changelog@lists.xensource.com; Fri, 18 Nov 2011 02:55:12 +0000
Message-Id: <E1RREbg-00061V-LX@xenbits.xen.org>
Date: Fri, 18 Nov 2011 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] Hypercall continuation
	cancelation in compat mode for XENMEM_get/set_pod_target
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jean Guyader <jean.guyader@eu.citrix.com>
# Date 1321521205 0
# Node ID e73ada19a69daf821aa7d80323f1bd76239b9bae
# Parent  344dddd4160bec210e7cb97e772a5bcc2b0a5fa0
Hypercall continuation cancelation in compat mode for XENMEM_get/set_pod_target

If copy_to_guest failed in the compat code after a continuation as
been done in the native code we need to cancel it so we won't
reexecute the hypercall but return from the hypercall with the
appropriate error.

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset:   24116:a095cf28f2b6
xen-unstable date:        Fri Nov 11 10:14:22 2011 +0100
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 344dddd4160b -r e73ada19a69d xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c	Thu Nov 17 09:12:00 2011 +0000
+++ b/xen/arch/x86/domain.c	Thu Nov 17 09:13:25 2011 +0000
@@ -1585,6 +1585,24 @@
     __arg;                                                                  \
 })
 
+void hypercall_cancel_continuation(void)
+{
+    struct cpu_user_regs *regs = guest_cpu_user_regs();
+    struct mc_state *mcs = &current->mc_state;
+
+    if ( test_bit(_MCSF_in_multicall, &mcs->flags) )
+    {
+        __clear_bit(_MCSF_call_preempted, &mcs->flags);
+    }
+    else
+    {
+        if ( !is_hvm_vcpu(current) )
+            regs->eip += 2; /* skip re-execute 'syscall' / 'int $xx' */
+        else
+            current->arch.hvm_vcpu.hcall_preempted = 0;
+    }
+}
+
 unsigned long hypercall_create_continuation(
     unsigned int op, const char *format, ...)
 {
diff -r 344dddd4160b -r e73ada19a69d xen/arch/x86/x86_64/compat/mm.c
--- a/xen/arch/x86/x86_64/compat/mm.c	Thu Nov 17 09:12:00 2011 +0000
+++ b/xen/arch/x86/x86_64/compat/mm.c	Thu Nov 17 09:13:25 2011 +0000
@@ -133,7 +133,11 @@
         XLAT_pod_target(&cmp, nat);
 
         if ( copy_to_guest(arg, &cmp, 1) )
+        {
+            if ( rc == __HYPERVISOR_memory_op )
+                hypercall_cancel_continuation();
             rc = -EFAULT;
+        }
 
         break;
     }
diff -r 344dddd4160b -r e73ada19a69d xen/include/xen/sched.h
--- a/xen/include/xen/sched.h	Thu Nov 17 09:12:00 2011 +0000
+++ b/xen/include/xen/sched.h	Thu Nov 17 09:13:25 2011 +0000
@@ -554,6 +554,7 @@
  */
 unsigned long hypercall_create_continuation(
     unsigned int op, const char *format, ...);
+void hypercall_cancel_continuation(void);
 
 #define hypercall_preempt_check() (unlikely(    \
         softirq_pending(smp_processor_id()) |   \

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

From xen-changelog-bounces@lists.xensource.com Fri Nov 18 02:56:37 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Nov 2011 02:56:37 +0000
Received: from lists.colo.xensource.com ([70.42.241.110] helo=lists.xensource.com)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RREd3-00033t-3i
	for archives@lists.xen.org; Fri, 18 Nov 2011 02:56:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com)
	by lists.xensource.com with esmtp (Exim 4.43)
	id 1RREck-0001Rm-Rm; Thu, 17 Nov 2011 18:56:18 -0800
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xensource.com with esmtp (Exim 4.43) id 1RREbk-00018N-3y
	for xen-changelog@lists.xensource.com; Thu, 17 Nov 2011 18:55:16 -0800
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-21.messagelabs.com!1321584913!4709071!1
X-Originating-IP: [93.93.131.152]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20345 invoked from network); 18 Nov 2011 02:55:13 -0000
Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Nov 2011 02:55:13 -0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RREbg-00061V-LX
	for xen-changelog@lists.xensource.com; Fri, 18 Nov 2011 02:55:12 +0000
Message-Id: <E1RREbg-00061V-LX@xenbits.xen.org>
Date: Fri, 18 Nov 2011 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] Hypercall continuation
	cancelation in compat mode for XENMEM_get/set_pod_target
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jean Guyader <jean.guyader@eu.citrix.com>
# Date 1321521205 0
# Node ID e73ada19a69daf821aa7d80323f1bd76239b9bae
# Parent  344dddd4160bec210e7cb97e772a5bcc2b0a5fa0
Hypercall continuation cancelation in compat mode for XENMEM_get/set_pod_target

If copy_to_guest failed in the compat code after a continuation as
been done in the native code we need to cancel it so we won't
reexecute the hypercall but return from the hypercall with the
appropriate error.

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset:   24116:a095cf28f2b6
xen-unstable date:        Fri Nov 11 10:14:22 2011 +0100
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 344dddd4160b -r e73ada19a69d xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c	Thu Nov 17 09:12:00 2011 +0000
+++ b/xen/arch/x86/domain.c	Thu Nov 17 09:13:25 2011 +0000
@@ -1585,6 +1585,24 @@
     __arg;                                                                  \
 })
 
+void hypercall_cancel_continuation(void)
+{
+    struct cpu_user_regs *regs = guest_cpu_user_regs();
+    struct mc_state *mcs = &current->mc_state;
+
+    if ( test_bit(_MCSF_in_multicall, &mcs->flags) )
+    {
+        __clear_bit(_MCSF_call_preempted, &mcs->flags);
+    }
+    else
+    {
+        if ( !is_hvm_vcpu(current) )
+            regs->eip += 2; /* skip re-execute 'syscall' / 'int $xx' */
+        else
+            current->arch.hvm_vcpu.hcall_preempted = 0;
+    }
+}
+
 unsigned long hypercall_create_continuation(
     unsigned int op, const char *format, ...)
 {
diff -r 344dddd4160b -r e73ada19a69d xen/arch/x86/x86_64/compat/mm.c
--- a/xen/arch/x86/x86_64/compat/mm.c	Thu Nov 17 09:12:00 2011 +0000
+++ b/xen/arch/x86/x86_64/compat/mm.c	Thu Nov 17 09:13:25 2011 +0000
@@ -133,7 +133,11 @@
         XLAT_pod_target(&cmp, nat);
 
         if ( copy_to_guest(arg, &cmp, 1) )
+        {
+            if ( rc == __HYPERVISOR_memory_op )
+                hypercall_cancel_continuation();
             rc = -EFAULT;
+        }
 
         break;
     }
diff -r 344dddd4160b -r e73ada19a69d xen/include/xen/sched.h
--- a/xen/include/xen/sched.h	Thu Nov 17 09:12:00 2011 +0000
+++ b/xen/include/xen/sched.h	Thu Nov 17 09:13:25 2011 +0000
@@ -554,6 +554,7 @@
  */
 unsigned long hypercall_create_continuation(
     unsigned int op, const char *format, ...);
+void hypercall_cancel_continuation(void);
 
 #define hypercall_preempt_check() (unlikely(    \
         softirq_pending(smp_processor_id()) |   \

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 21 11:11:29 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 21 Nov 2011 11:11:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSRmY-00067w-3G; Mon, 21 Nov 2011 11:11:26 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSRmX-00067K-8F
	for xen-changelog@lists.xensource.com; Mon, 21 Nov 2011 11:11:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1321873855!2388330!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1921 invoked from network); 21 Nov 2011 11:10:56 -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;
	21 Nov 2011 11:10:56 -0000
Received: from 50-57-170-242.static.cloud-ips.com ([50.57.170.242]
	helo=xenbits.xen.org) by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSRs9-0000sF-VJ
	for xen-changelog@lists.xensource.com; Mon, 21 Nov 2011 11:17:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSRmH-0003yc-RB
	for xen-changelog@lists.xensource.com; Mon, 21 Nov 2011 11:11:09 +0000
Message-Id: <E1RSRmH-0003yc-RB@xenbits.xen.org>
Date: Mon, 21 Nov 2011 11:11:09 +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] netback: use correct index for
	invalidation in netbk_tx_check_mop()
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1321864396 -3600
# Node ID 3c4ee62def8335bc5b9d3333479d9f1f69621b90
# Parent  985b8f62df2525dc15ad573b2d748622cda9d2db
netback: use correct index for invalidation in netbk_tx_check_mop()

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


diff -r 985b8f62df25 -r 3c4ee62def83 drivers/xen/netback/netback.c
--- a/drivers/xen/netback/netback.c	Fri Nov 11 10:02:39 2011 +0100
+++ b/drivers/xen/netback/netback.c	Mon Nov 21 09:33:16 2011 +0100
@@ -1155,7 +1155,7 @@
 		pending_idx = *((u16 *)skb->data);
 		netif_idx_release(pending_idx);
 		for (j = start; j < i; j++) {
-			pending_idx = (unsigned long)shinfo->frags[i].page;
+			pending_idx = (unsigned long)shinfo->frags[j].page;
 			netif_idx_release(pending_idx);
 		}
 

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 21 11:11:29 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 21 Nov 2011 11:11:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSRmY-00067w-3G; Mon, 21 Nov 2011 11:11:26 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSRmX-00067K-8F
	for xen-changelog@lists.xensource.com; Mon, 21 Nov 2011 11:11:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1321873855!2388330!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1921 invoked from network); 21 Nov 2011 11:10:56 -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;
	21 Nov 2011 11:10:56 -0000
Received: from 50-57-170-242.static.cloud-ips.com ([50.57.170.242]
	helo=xenbits.xen.org) by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSRs9-0000sF-VJ
	for xen-changelog@lists.xensource.com; Mon, 21 Nov 2011 11:17:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSRmH-0003yc-RB
	for xen-changelog@lists.xensource.com; Mon, 21 Nov 2011 11:11:09 +0000
Message-Id: <E1RSRmH-0003yc-RB@xenbits.xen.org>
Date: Mon, 21 Nov 2011 11:11:09 +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] netback: use correct index for
	invalidation in netbk_tx_check_mop()
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1321864396 -3600
# Node ID 3c4ee62def8335bc5b9d3333479d9f1f69621b90
# Parent  985b8f62df2525dc15ad573b2d748622cda9d2db
netback: use correct index for invalidation in netbk_tx_check_mop()

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


diff -r 985b8f62df25 -r 3c4ee62def83 drivers/xen/netback/netback.c
--- a/drivers/xen/netback/netback.c	Fri Nov 11 10:02:39 2011 +0100
+++ b/drivers/xen/netback/netback.c	Mon Nov 21 09:33:16 2011 +0100
@@ -1155,7 +1155,7 @@
 		pending_idx = *((u16 *)skb->data);
 		netif_idx_release(pending_idx);
 		for (j = start; j < i; j++) {
-			pending_idx = (unsigned long)shinfo->frags[i].page;
+			pending_idx = (unsigned long)shinfo->frags[j].page;
 			netif_idx_release(pending_idx);
 		}
 

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 21 11:11:30 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 21 Nov 2011 11:11:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSRmX-00067m-V0; Mon, 21 Nov 2011 11:11:25 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSRmV-00067J-N5
	for xen-changelog@lists.xensource.com; Mon, 21 Nov 2011 11:11:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-21.messagelabs.com!1321873855!5055162!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2523 invoked from network); 21 Nov 2011 11:10:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Nov 2011 11:10:56 -0000
Received: from 50-57-170-242.static.cloud-ips.com ([50.57.170.242]
	helo=xenbits.xen.org) by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSRs8-0000sC-IK
	for xen-changelog@lists.xensource.com; Mon, 21 Nov 2011 11:17:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSRmG-0003ww-Cc
	for xen-changelog@lists.xensource.com; Mon, 21 Nov 2011 11:11:08 +0000
Message-Id: <E1RSRmG-0003ww-Cc@xenbits.xen.org>
Date: Mon, 21 Nov 2011 11:11:07 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86: re-inject emulated level
	pirqs in PV on HVM guests if still asserted
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1321623485 0
# Node ID 5a00ccfc63915650b8e1a262c2cad8e8d8670612
# Parent  e73ada19a69daf821aa7d80323f1bd76239b9bae
x86: re-inject emulated level pirqs in PV on HVM guests if still asserted

PV on HVM guests can loose level interrupts coming from emulated
devices if they have been remapped onto event channels.  The reason is
that we are missing the code to inject a pirq again in the guest when
the guest EOIs it, if it corresponds to an emulated level interrupt
and the interrupt is still asserted.

Fix this issue and also return error when the guest tries to get the
irq_status of a non-existing pirq.

Changes in this backport:
 - move the spinlock afterward to cover the new code only.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24007:0526644ad2a6
xen-unstable date:        Thu Oct 27 16:07:18 2011 +0100
---


diff -r e73ada19a69d -r 5a00ccfc6391 xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c	Thu Nov 17 09:13:25 2011 +0000
+++ b/xen/arch/x86/physdev.c	Fri Nov 18 13:38:05 2011 +0000
@@ -268,6 +268,20 @@
             ret = pirq_guest_eoi(v->domain, eoi.irq);
         else
             ret = 0;
+        spin_lock(&v->domain->event_lock);
+        if ( is_hvm_domain(v->domain) &&
+                domain_pirq_to_emuirq(v->domain, eoi.irq) > 0 )
+        {
+            struct hvm_irq *hvm_irq = &v->domain->arch.hvm_domain.irq;
+            int gsi = domain_pirq_to_emuirq(v->domain, eoi.irq);
+
+            /* if this is a level irq and count > 0, send another
+             * notification */ 
+            if ( gsi >= NR_ISAIRQS /* ISA irqs are edge triggered */
+                    && hvm_irq->gsi_assert_count[gsi] )
+                send_guest_pirq(v->domain, eoi.irq);
+        }
+        spin_unlock(&v->domain->event_lock);
         break;
     }
 
@@ -323,9 +337,10 @@
             break;
         irq_status_query.flags = 0;
         if ( is_hvm_domain(v->domain) &&
-             domain_pirq_to_irq(v->domain, irq) <= 0 )
+                domain_pirq_to_irq(v->domain, irq) <= 0 &&
+                domain_pirq_to_emuirq(v->domain, irq) == IRQ_UNBOUND )
         {
-            ret = copy_to_guest(arg, &irq_status_query, 1) ? -EFAULT : 0;
+            ret = -EINVAL;
             break;
         }
 

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 21 11:11:30 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 21 Nov 2011 11:11:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSRmX-00067m-V0; Mon, 21 Nov 2011 11:11:25 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSRmV-00067J-N5
	for xen-changelog@lists.xensource.com; Mon, 21 Nov 2011 11:11:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-21.messagelabs.com!1321873855!5055162!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2523 invoked from network); 21 Nov 2011 11:10:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Nov 2011 11:10:56 -0000
Received: from 50-57-170-242.static.cloud-ips.com ([50.57.170.242]
	helo=xenbits.xen.org) by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSRs8-0000sC-IK
	for xen-changelog@lists.xensource.com; Mon, 21 Nov 2011 11:17:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSRmG-0003ww-Cc
	for xen-changelog@lists.xensource.com; Mon, 21 Nov 2011 11:11:08 +0000
Message-Id: <E1RSRmG-0003ww-Cc@xenbits.xen.org>
Date: Mon, 21 Nov 2011 11:11:07 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86: re-inject emulated level
	pirqs in PV on HVM guests if still asserted
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1321623485 0
# Node ID 5a00ccfc63915650b8e1a262c2cad8e8d8670612
# Parent  e73ada19a69daf821aa7d80323f1bd76239b9bae
x86: re-inject emulated level pirqs in PV on HVM guests if still asserted

PV on HVM guests can loose level interrupts coming from emulated
devices if they have been remapped onto event channels.  The reason is
that we are missing the code to inject a pirq again in the guest when
the guest EOIs it, if it corresponds to an emulated level interrupt
and the interrupt is still asserted.

Fix this issue and also return error when the guest tries to get the
irq_status of a non-existing pirq.

Changes in this backport:
 - move the spinlock afterward to cover the new code only.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24007:0526644ad2a6
xen-unstable date:        Thu Oct 27 16:07:18 2011 +0100
---


diff -r e73ada19a69d -r 5a00ccfc6391 xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c	Thu Nov 17 09:13:25 2011 +0000
+++ b/xen/arch/x86/physdev.c	Fri Nov 18 13:38:05 2011 +0000
@@ -268,6 +268,20 @@
             ret = pirq_guest_eoi(v->domain, eoi.irq);
         else
             ret = 0;
+        spin_lock(&v->domain->event_lock);
+        if ( is_hvm_domain(v->domain) &&
+                domain_pirq_to_emuirq(v->domain, eoi.irq) > 0 )
+        {
+            struct hvm_irq *hvm_irq = &v->domain->arch.hvm_domain.irq;
+            int gsi = domain_pirq_to_emuirq(v->domain, eoi.irq);
+
+            /* if this is a level irq and count > 0, send another
+             * notification */ 
+            if ( gsi >= NR_ISAIRQS /* ISA irqs are edge triggered */
+                    && hvm_irq->gsi_assert_count[gsi] )
+                send_guest_pirq(v->domain, eoi.irq);
+        }
+        spin_unlock(&v->domain->event_lock);
         break;
     }
 
@@ -323,9 +337,10 @@
             break;
         irq_status_query.flags = 0;
         if ( is_hvm_domain(v->domain) &&
-             domain_pirq_to_irq(v->domain, irq) <= 0 )
+                domain_pirq_to_irq(v->domain, irq) <= 0 &&
+                domain_pirq_to_emuirq(v->domain, irq) == IRQ_UNBOUND )
         {
-            ret = copy_to_guest(arg, &irq_status_query, 1) ? -EFAULT : 0;
+            ret = -EINVAL;
             break;
         }
 

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 08:22:23 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 08:22:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSlcR-0000ex-1d; Tue, 22 Nov 2011 08:22:19 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSlcP-0000eK-E6
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 08:22:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1321950108!5200254!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14399 invoked from network); 22 Nov 2011 08:21:49 -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;
	22 Nov 2011 08:21:49 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSli4-0000Ro-LM
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 08:28:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSlcB-0002sV-HS
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 08:22:03 +0000
Message-Id: <E1RSlcB-0002sV-HS@xenbits.xen.org>
Date: Tue, 22 Nov 2011 08:22:03 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] backends: remove version
	specific code
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1321949832 -3600
# Node ID da0850ab55d66d74a4a304484f9a1933919306bf
# Parent  3c4ee62def8335bc5b9d3333479d9f1f69621b90
backends: remove version specific code

Backends, other than frontends and come parts of core code, aren't
meant to be built against multiple Linux versions (and they wouldn't
really build anyway), so remove the code dealing with this case.

This really is mostly the removal of pointless inclusions of
linux/version.h, but in the case of blktap2 also includes some dead
code elimination.

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


diff -r 3c4ee62def83 -r da0850ab55d6 drivers/xen/blkback/common.h
--- a/drivers/xen/blkback/common.h	Mon Nov 21 09:33:16 2011 +0100
+++ b/drivers/xen/blkback/common.h	Tue Nov 22 09:17:12 2011 +0100
@@ -27,7 +27,6 @@
 #ifndef __BLKIF__BACKEND__COMMON_H__
 #define __BLKIF__BACKEND__COMMON_H__
 
-#include <linux/version.h>
 #include <linux/module.h>
 #include <linux/interrupt.h>
 #include <linux/slab.h>
diff -r 3c4ee62def83 -r da0850ab55d6 drivers/xen/blktap/common.h
--- a/drivers/xen/blktap/common.h	Mon Nov 21 09:33:16 2011 +0100
+++ b/drivers/xen/blktap/common.h	Tue Nov 22 09:17:12 2011 +0100
@@ -27,7 +27,6 @@
 #ifndef __BLKIF__BACKEND__COMMON_H__
 #define __BLKIF__BACKEND__COMMON_H__
 
-#include <linux/version.h>
 #include <linux/module.h>
 #include <linux/interrupt.h>
 #include <linux/slab.h>
diff -r 3c4ee62def83 -r da0850ab55d6 drivers/xen/blktap2/device.c
--- a/drivers/xen/blktap2/device.c	Mon Nov 21 09:33:16 2011 +0100
+++ b/drivers/xen/blktap2/device.c	Tue Nov 22 09:17:12 2011 +0100
@@ -93,27 +93,6 @@
 		      command, (long)argument, inode->i_rdev);
 
 	switch (command) {
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16)
-	case HDIO_GETGEO: {
-		struct block_device *bd = inode->i_bdev;
-		struct hd_geometry geo;
-		int ret;
-
-                if (!argument)
-                        return -EINVAL;
-
-		geo.start = get_start_sect(bd);
-		ret = blktap_device_getgeo(bd, &geo);
-		if (ret)
-			return ret;
-
-		if (copy_to_user((struct hd_geometry __user *)argument, &geo,
-				 sizeof(geo)))
-                        return -EFAULT;
-
-                return 0;
-	}
-#endif
 	case CDROMMULTISESSION:
 		BTDBG("FIXME: support multisession CDs later\n");
 		for (i = 0; i < sizeof(struct cdrom_multisession); i++)
@@ -146,9 +125,7 @@
 	.open      = blktap_device_open,
 	.release   = blktap_device_release,
 	.ioctl     = blktap_device_ioctl,
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
 	.getgeo    = blktap_device_getgeo
-#endif
 };
 
 static int
@@ -1135,11 +1112,7 @@
 	if (!rq)
 		goto error;
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
 	elevator_init(rq, "noop");
-#else
-	elevator_init(rq, &elevator_noop);
-#endif
 
 	gd->queue     = rq;
 	rq->queuedata = dev;
diff -r 3c4ee62def83 -r da0850ab55d6 drivers/xen/netback/common.h
--- a/drivers/xen/netback/common.h	Mon Nov 21 09:33:16 2011 +0100
+++ b/drivers/xen/netback/common.h	Tue Nov 22 09:17:12 2011 +0100
@@ -29,7 +29,6 @@
 #ifndef __NETIF__BACKEND__COMMON_H__
 #define __NETIF__BACKEND__COMMON_H__
 
-#include <linux/version.h>
 #include <linux/module.h>
 #include <linux/interrupt.h>
 #include <linux/slab.h>
diff -r 3c4ee62def83 -r da0850ab55d6 drivers/xen/pcifront/pci_op.c
--- a/drivers/xen/pcifront/pci_op.c	Mon Nov 21 09:33:16 2011 +0100
+++ b/drivers/xen/pcifront/pci_op.c	Tue Nov 22 09:17:12 2011 +0100
@@ -4,7 +4,6 @@
  *   Author: Ryan Wilson <hap9@epoch.ncsc.mil>
  */
 #include <linux/module.h>
-#include <linux/version.h>
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/spinlock.h>
diff -r 3c4ee62def83 -r da0850ab55d6 drivers/xen/scsiback/common.h
--- a/drivers/xen/scsiback/common.h	Mon Nov 21 09:33:16 2011 +0100
+++ b/drivers/xen/scsiback/common.h	Tue Nov 22 09:17:12 2011 +0100
@@ -31,7 +31,6 @@
 #ifndef __SCSIIF__BACKEND__COMMON_H__
 #define __SCSIIF__BACKEND__COMMON_H__
 
-#include <linux/version.h>
 #include <linux/module.h>
 #include <linux/interrupt.h>
 #include <linux/slab.h>
diff -r 3c4ee62def83 -r da0850ab55d6 drivers/xen/tpmback/common.h
--- a/drivers/xen/tpmback/common.h	Mon Nov 21 09:33:16 2011 +0100
+++ b/drivers/xen/tpmback/common.h	Tue Nov 22 09:17:12 2011 +0100
@@ -5,7 +5,6 @@
 #ifndef __TPM__BACKEND__COMMON_H__
 #define __TPM__BACKEND__COMMON_H__
 
-#include <linux/version.h>
 #include <linux/module.h>
 #include <linux/interrupt.h>
 #include <linux/mm.h>

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 08:22:23 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 08:22:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSlcR-0000ex-1d; Tue, 22 Nov 2011 08:22:19 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSlcP-0000eK-E6
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 08:22:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1321950108!5200254!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14399 invoked from network); 22 Nov 2011 08:21:49 -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;
	22 Nov 2011 08:21:49 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSli4-0000Ro-LM
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 08:28:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSlcB-0002sV-HS
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 08:22:03 +0000
Message-Id: <E1RSlcB-0002sV-HS@xenbits.xen.org>
Date: Tue, 22 Nov 2011 08:22:03 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] backends: remove version
	specific code
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1321949832 -3600
# Node ID da0850ab55d66d74a4a304484f9a1933919306bf
# Parent  3c4ee62def8335bc5b9d3333479d9f1f69621b90
backends: remove version specific code

Backends, other than frontends and come parts of core code, aren't
meant to be built against multiple Linux versions (and they wouldn't
really build anyway), so remove the code dealing with this case.

This really is mostly the removal of pointless inclusions of
linux/version.h, but in the case of blktap2 also includes some dead
code elimination.

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


diff -r 3c4ee62def83 -r da0850ab55d6 drivers/xen/blkback/common.h
--- a/drivers/xen/blkback/common.h	Mon Nov 21 09:33:16 2011 +0100
+++ b/drivers/xen/blkback/common.h	Tue Nov 22 09:17:12 2011 +0100
@@ -27,7 +27,6 @@
 #ifndef __BLKIF__BACKEND__COMMON_H__
 #define __BLKIF__BACKEND__COMMON_H__
 
-#include <linux/version.h>
 #include <linux/module.h>
 #include <linux/interrupt.h>
 #include <linux/slab.h>
diff -r 3c4ee62def83 -r da0850ab55d6 drivers/xen/blktap/common.h
--- a/drivers/xen/blktap/common.h	Mon Nov 21 09:33:16 2011 +0100
+++ b/drivers/xen/blktap/common.h	Tue Nov 22 09:17:12 2011 +0100
@@ -27,7 +27,6 @@
 #ifndef __BLKIF__BACKEND__COMMON_H__
 #define __BLKIF__BACKEND__COMMON_H__
 
-#include <linux/version.h>
 #include <linux/module.h>
 #include <linux/interrupt.h>
 #include <linux/slab.h>
diff -r 3c4ee62def83 -r da0850ab55d6 drivers/xen/blktap2/device.c
--- a/drivers/xen/blktap2/device.c	Mon Nov 21 09:33:16 2011 +0100
+++ b/drivers/xen/blktap2/device.c	Tue Nov 22 09:17:12 2011 +0100
@@ -93,27 +93,6 @@
 		      command, (long)argument, inode->i_rdev);
 
 	switch (command) {
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16)
-	case HDIO_GETGEO: {
-		struct block_device *bd = inode->i_bdev;
-		struct hd_geometry geo;
-		int ret;
-
-                if (!argument)
-                        return -EINVAL;
-
-		geo.start = get_start_sect(bd);
-		ret = blktap_device_getgeo(bd, &geo);
-		if (ret)
-			return ret;
-
-		if (copy_to_user((struct hd_geometry __user *)argument, &geo,
-				 sizeof(geo)))
-                        return -EFAULT;
-
-                return 0;
-	}
-#endif
 	case CDROMMULTISESSION:
 		BTDBG("FIXME: support multisession CDs later\n");
 		for (i = 0; i < sizeof(struct cdrom_multisession); i++)
@@ -146,9 +125,7 @@
 	.open      = blktap_device_open,
 	.release   = blktap_device_release,
 	.ioctl     = blktap_device_ioctl,
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
 	.getgeo    = blktap_device_getgeo
-#endif
 };
 
 static int
@@ -1135,11 +1112,7 @@
 	if (!rq)
 		goto error;
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
 	elevator_init(rq, "noop");
-#else
-	elevator_init(rq, &elevator_noop);
-#endif
 
 	gd->queue     = rq;
 	rq->queuedata = dev;
diff -r 3c4ee62def83 -r da0850ab55d6 drivers/xen/netback/common.h
--- a/drivers/xen/netback/common.h	Mon Nov 21 09:33:16 2011 +0100
+++ b/drivers/xen/netback/common.h	Tue Nov 22 09:17:12 2011 +0100
@@ -29,7 +29,6 @@
 #ifndef __NETIF__BACKEND__COMMON_H__
 #define __NETIF__BACKEND__COMMON_H__
 
-#include <linux/version.h>
 #include <linux/module.h>
 #include <linux/interrupt.h>
 #include <linux/slab.h>
diff -r 3c4ee62def83 -r da0850ab55d6 drivers/xen/pcifront/pci_op.c
--- a/drivers/xen/pcifront/pci_op.c	Mon Nov 21 09:33:16 2011 +0100
+++ b/drivers/xen/pcifront/pci_op.c	Tue Nov 22 09:17:12 2011 +0100
@@ -4,7 +4,6 @@
  *   Author: Ryan Wilson <hap9@epoch.ncsc.mil>
  */
 #include <linux/module.h>
-#include <linux/version.h>
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/spinlock.h>
diff -r 3c4ee62def83 -r da0850ab55d6 drivers/xen/scsiback/common.h
--- a/drivers/xen/scsiback/common.h	Mon Nov 21 09:33:16 2011 +0100
+++ b/drivers/xen/scsiback/common.h	Tue Nov 22 09:17:12 2011 +0100
@@ -31,7 +31,6 @@
 #ifndef __SCSIIF__BACKEND__COMMON_H__
 #define __SCSIIF__BACKEND__COMMON_H__
 
-#include <linux/version.h>
 #include <linux/module.h>
 #include <linux/interrupt.h>
 #include <linux/slab.h>
diff -r 3c4ee62def83 -r da0850ab55d6 drivers/xen/tpmback/common.h
--- a/drivers/xen/tpmback/common.h	Mon Nov 21 09:33:16 2011 +0100
+++ b/drivers/xen/tpmback/common.h	Tue Nov 22 09:17:12 2011 +0100
@@ -5,7 +5,6 @@
 #ifndef __TPM__BACKEND__COMMON_H__
 #define __TPM__BACKEND__COMMON_H__
 
-#include <linux/version.h>
 #include <linux/module.h>
 #include <linux/interrupt.h>
 #include <linux/mm.h>

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 09:44:24 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 09:44:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSmtm-0004mV-J4; Tue, 22 Nov 2011 09:44:18 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmtl-0004mI-93
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1321955004!49418850!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2634 invoked from network); 22 Nov 2011 09:43:25 -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;
	22 Nov 2011 09:43: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 1RSmzV-0001NI-JO
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:50:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmtc-0004lX-5f
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:08 +0000
Message-Id: <E1RSmtc-0004lX-5f@xenbits.xen.org>
Date: Tue, 22 Nov 2011 09:44:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/IRQ: prevent vector sharing
	within IO-APICs
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1321604484 -3600
# Node ID f29b5bd6e25fd78409baa5461914c67065f7579f
# Parent  0d50e704834fb53c6c86b8b0badd19d88e73c4ed
x86/IRQ: prevent vector sharing within IO-APICs

Following the prevention of vector sharing for MSIs, this change
enforces the same within IO-APICs: Pin based interrupts use the IO-APIC
as their identifying device under the AMD IOMMU (and just like for
MSIs, only the identifying device is used to remap interrupts here,
with no regard to an interrupt's destination).

Additionally, LAPIC initiated EOIs (for level triggered interrupts) too
use only the vector for identifying which interrupts to end. While this
generally causes no significant problem (at worst an interrupt would be
re-raised without a new interrupt event actually having occurred), it
still seems better to avoid the situation.

For this second aspect, a distinction is being made between the
traditional and the directed-EOI cases: In the former, vectors should
not be shared throughout all IO-APICs in the system, while in the
latter case only individual IO-APICs need to be contrained (or, if the
firmware indicates so, sub- groups of them having the same GSI appear
at multiple pins).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---


diff -r 0d50e704834f -r f29b5bd6e25f xen/arch/x86/io_apic.c
--- a/xen/arch/x86/io_apic.c	Fri Nov 18 09:18:41 2011 +0100
+++ b/xen/arch/x86/io_apic.c	Fri Nov 18 09:21:24 2011 +0100
@@ -69,6 +69,34 @@
 
 #define ioapic_has_eoi_reg(apic) (mp_ioapics[(apic)].mpc_apicver >= 0x20)
 
+static int apic_pin_2_gsi_irq(int apic, int pin);
+
+static vmask_t *__read_mostly vector_map[MAX_IO_APICS];
+
+static void share_vector_maps(unsigned int src, unsigned int dst)
+{
+    unsigned int pin;
+
+    if (vector_map[src] == vector_map[dst])
+        return;
+
+    bitmap_or(vector_map[src]->_bits, vector_map[src]->_bits,
+              vector_map[dst]->_bits, NR_VECTORS);
+
+    for (pin = 0; pin < nr_ioapic_entries[dst]; ++pin) {
+        int irq = apic_pin_2_gsi_irq(dst, pin);
+        struct irq_desc *desc;
+
+        if (irq < 0)
+            continue;
+        desc = irq_to_desc(irq);
+        if (desc->arch.used_vectors == vector_map[dst])
+            desc->arch.used_vectors = vector_map[src];
+    }
+
+    vector_map[dst] = vector_map[src];
+}
+
 /*
  * This is performance-critical, we want to do it O(1)
  *
@@ -109,6 +137,7 @@
     }
     entry->apic = apic;
     entry->pin = pin;
+    share_vector_maps(irq_2_pin[irq].apic, apic);
 }
 
 /*
@@ -124,6 +153,7 @@
         if (entry->apic == oldapic && entry->pin == oldpin) {
             entry->apic = newapic;
             entry->pin = newpin;
+            share_vector_maps(oldapic, newapic);
         }
         if (!entry->next)
             break;
@@ -131,6 +161,16 @@
     }
 }
 
+vmask_t *io_apic_get_used_vector_map(unsigned int irq)
+{
+    struct irq_pin_list *entry = irq_2_pin + irq;
+
+    if (entry->pin == -1)
+        return NULL;
+
+    return vector_map[entry->apic];
+}
+
 struct IO_APIC_route_entry **alloc_ioapic_entries(void)
 {
     int apic;
@@ -1190,6 +1230,18 @@
     for (i = irq_2_pin_free_entry = nr_irqs_gsi; i < PIN_MAP_SIZE; i++)
         irq_2_pin[i].next = i + 1;
 
+    if (directed_eoi_enabled) {
+        for (apic = 0; apic < nr_ioapics; apic++) {
+            vector_map[apic] = xzalloc(vmask_t);
+            BUG_ON(!vector_map[apic]);
+        }
+    } else {
+        vector_map[0] = xzalloc(vmask_t);
+        BUG_ON(!vector_map[0]);
+        for (apic = 1; apic < nr_ioapics; apic++)
+            vector_map[apic] = vector_map[0];
+    }
+
     for(apic = 0; apic < nr_ioapics; apic++) {
         int pin;
         /* See if any of the pins is in ExtINT mode */
@@ -2287,13 +2339,12 @@
     }
 
     if ( desc->arch.vector <= 0 || desc->arch.vector > LAST_DYNAMIC_VECTOR ) {
+        add_pin_to_irq(irq, apic, pin);
         vector = assign_irq_vector(irq);
         if ( vector < 0 )
             return vector;
 
         printk(XENLOG_INFO "allocated vector %02x for irq %d\n", vector, irq);
-
-        add_pin_to_irq(irq, apic, pin);
     }
     spin_lock(&dom0->event_lock);
     ret = map_domain_pirq(dom0, pirq, irq,
diff -r 0d50e704834f -r f29b5bd6e25f xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c	Fri Nov 18 09:18:41 2011 +0100
+++ b/xen/arch/x86/irq.c	Fri Nov 18 09:21:24 2011 +0100
@@ -395,6 +395,11 @@
             }
         }
     }
+    else if ( IO_APIC_IRQ(irq) &&
+              opt_irq_vector_map != OPT_IRQ_VECTOR_MAP_NONE )
+    {
+        ret = io_apic_get_used_vector_map(irq);
+    }
 
     return ret;
 }
diff -r 0d50e704834f -r f29b5bd6e25f xen/include/asm-x86/irq.h
--- a/xen/include/asm-x86/irq.h	Fri Nov 18 09:18:41 2011 +0100
+++ b/xen/include/asm-x86/irq.h	Fri Nov 18 09:21:24 2011 +0100
@@ -116,6 +116,7 @@
 void setup_IO_APIC(void);
 void disable_IO_APIC(void);
 void setup_ioapic_dest(void);
+vmask_t *io_apic_get_used_vector_map(unsigned int irq);
 
 extern unsigned int io_apic_irqs;
 

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 09:44:24 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 09:44:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSmtm-0004mV-J4; Tue, 22 Nov 2011 09:44:18 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmtl-0004mI-93
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1321955004!49418850!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2634 invoked from network); 22 Nov 2011 09:43:25 -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;
	22 Nov 2011 09:43: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 1RSmzV-0001NI-JO
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:50:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmtc-0004lX-5f
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:08 +0000
Message-Id: <E1RSmtc-0004lX-5f@xenbits.xen.org>
Date: Tue, 22 Nov 2011 09:44:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/IRQ: prevent vector sharing
	within IO-APICs
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1321604484 -3600
# Node ID f29b5bd6e25fd78409baa5461914c67065f7579f
# Parent  0d50e704834fb53c6c86b8b0badd19d88e73c4ed
x86/IRQ: prevent vector sharing within IO-APICs

Following the prevention of vector sharing for MSIs, this change
enforces the same within IO-APICs: Pin based interrupts use the IO-APIC
as their identifying device under the AMD IOMMU (and just like for
MSIs, only the identifying device is used to remap interrupts here,
with no regard to an interrupt's destination).

Additionally, LAPIC initiated EOIs (for level triggered interrupts) too
use only the vector for identifying which interrupts to end. While this
generally causes no significant problem (at worst an interrupt would be
re-raised without a new interrupt event actually having occurred), it
still seems better to avoid the situation.

For this second aspect, a distinction is being made between the
traditional and the directed-EOI cases: In the former, vectors should
not be shared throughout all IO-APICs in the system, while in the
latter case only individual IO-APICs need to be contrained (or, if the
firmware indicates so, sub- groups of them having the same GSI appear
at multiple pins).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---


diff -r 0d50e704834f -r f29b5bd6e25f xen/arch/x86/io_apic.c
--- a/xen/arch/x86/io_apic.c	Fri Nov 18 09:18:41 2011 +0100
+++ b/xen/arch/x86/io_apic.c	Fri Nov 18 09:21:24 2011 +0100
@@ -69,6 +69,34 @@
 
 #define ioapic_has_eoi_reg(apic) (mp_ioapics[(apic)].mpc_apicver >= 0x20)
 
+static int apic_pin_2_gsi_irq(int apic, int pin);
+
+static vmask_t *__read_mostly vector_map[MAX_IO_APICS];
+
+static void share_vector_maps(unsigned int src, unsigned int dst)
+{
+    unsigned int pin;
+
+    if (vector_map[src] == vector_map[dst])
+        return;
+
+    bitmap_or(vector_map[src]->_bits, vector_map[src]->_bits,
+              vector_map[dst]->_bits, NR_VECTORS);
+
+    for (pin = 0; pin < nr_ioapic_entries[dst]; ++pin) {
+        int irq = apic_pin_2_gsi_irq(dst, pin);
+        struct irq_desc *desc;
+
+        if (irq < 0)
+            continue;
+        desc = irq_to_desc(irq);
+        if (desc->arch.used_vectors == vector_map[dst])
+            desc->arch.used_vectors = vector_map[src];
+    }
+
+    vector_map[dst] = vector_map[src];
+}
+
 /*
  * This is performance-critical, we want to do it O(1)
  *
@@ -109,6 +137,7 @@
     }
     entry->apic = apic;
     entry->pin = pin;
+    share_vector_maps(irq_2_pin[irq].apic, apic);
 }
 
 /*
@@ -124,6 +153,7 @@
         if (entry->apic == oldapic && entry->pin == oldpin) {
             entry->apic = newapic;
             entry->pin = newpin;
+            share_vector_maps(oldapic, newapic);
         }
         if (!entry->next)
             break;
@@ -131,6 +161,16 @@
     }
 }
 
+vmask_t *io_apic_get_used_vector_map(unsigned int irq)
+{
+    struct irq_pin_list *entry = irq_2_pin + irq;
+
+    if (entry->pin == -1)
+        return NULL;
+
+    return vector_map[entry->apic];
+}
+
 struct IO_APIC_route_entry **alloc_ioapic_entries(void)
 {
     int apic;
@@ -1190,6 +1230,18 @@
     for (i = irq_2_pin_free_entry = nr_irqs_gsi; i < PIN_MAP_SIZE; i++)
         irq_2_pin[i].next = i + 1;
 
+    if (directed_eoi_enabled) {
+        for (apic = 0; apic < nr_ioapics; apic++) {
+            vector_map[apic] = xzalloc(vmask_t);
+            BUG_ON(!vector_map[apic]);
+        }
+    } else {
+        vector_map[0] = xzalloc(vmask_t);
+        BUG_ON(!vector_map[0]);
+        for (apic = 1; apic < nr_ioapics; apic++)
+            vector_map[apic] = vector_map[0];
+    }
+
     for(apic = 0; apic < nr_ioapics; apic++) {
         int pin;
         /* See if any of the pins is in ExtINT mode */
@@ -2287,13 +2339,12 @@
     }
 
     if ( desc->arch.vector <= 0 || desc->arch.vector > LAST_DYNAMIC_VECTOR ) {
+        add_pin_to_irq(irq, apic, pin);
         vector = assign_irq_vector(irq);
         if ( vector < 0 )
             return vector;
 
         printk(XENLOG_INFO "allocated vector %02x for irq %d\n", vector, irq);
-
-        add_pin_to_irq(irq, apic, pin);
     }
     spin_lock(&dom0->event_lock);
     ret = map_domain_pirq(dom0, pirq, irq,
diff -r 0d50e704834f -r f29b5bd6e25f xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c	Fri Nov 18 09:18:41 2011 +0100
+++ b/xen/arch/x86/irq.c	Fri Nov 18 09:21:24 2011 +0100
@@ -395,6 +395,11 @@
             }
         }
     }
+    else if ( IO_APIC_IRQ(irq) &&
+              opt_irq_vector_map != OPT_IRQ_VECTOR_MAP_NONE )
+    {
+        ret = io_apic_get_used_vector_map(irq);
+    }
 
     return ret;
 }
diff -r 0d50e704834f -r f29b5bd6e25f xen/include/asm-x86/irq.h
--- a/xen/include/asm-x86/irq.h	Fri Nov 18 09:18:41 2011 +0100
+++ b/xen/include/asm-x86/irq.h	Fri Nov 18 09:21:24 2011 +0100
@@ -116,6 +116,7 @@
 void setup_IO_APIC(void);
 void disable_IO_APIC(void);
 void setup_ioapic_dest(void);
+vmask_t *io_apic_get_used_vector_map(unsigned int irq);
 
 extern unsigned int io_apic_irqs;
 

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 09:44:24 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 09:44:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSmto-0004n2-P1; Tue, 22 Nov 2011 09: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 1RSmtn-0004mb-Cp
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-27.messagelabs.com!1321955006!53703788!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20356 invoked from network); 22 Nov 2011 09:43:27 -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;
	22 Nov 2011 09:43: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 1RSmzX-0001NU-Jb
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:50:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmte-0004mV-84
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:10 +0000
Message-Id: <E1RSmte-0004mV-84@xenbits.xen.org>
Date: Tue, 22 Nov 2011 09:44:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] sched_sedf: Avoid panic when
	adjusting sedf parameters
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Juergen Gross <juergen.gross@ts.fujitsu.com>
# Date 1321623283 0
# Node ID d7e6bfa114d05fc4da83a55d995fb031970a94d8
# Parent  0965e589fdcca22af04f70274a6fa54acc42e281
sched_sedf: Avoid panic when adjusting sedf parameters

When using sedf scheduler in a cpupool the system might panic when
setting sedf scheduling parameters for a domain.  Introduces
for_each_domain_in_cpupool macro as it is usable 4 times now.  Add
appropriate locking in cpupool_unassign_cpu().

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 0965e589fdcc -r d7e6bfa114d0 xen/common/cpupool.c
--- a/xen/common/cpupool.c	Fri Nov 18 13:32:50 2011 +0000
+++ b/xen/common/cpupool.c	Fri Nov 18 13:34:43 2011 +0000
@@ -309,10 +309,9 @@
     if ( (c->n_dom > 0) && (cpumask_weight(c->cpu_valid) == 1) &&
          (cpu != cpupool_moving_cpu) )
     {
-        for_each_domain(d)
+        rcu_read_lock(&domlist_read_lock);
+        for_each_domain_in_cpupool(d, c)
         {
-            if ( d->cpupool != c )
-                continue;
             if ( !d->is_dying )
             {
                 ret = -EBUSY;
@@ -327,6 +326,7 @@
             }
             cpupool0->n_dom++;
         }
+        rcu_read_unlock(&domlist_read_lock);
         if ( ret )
             goto out;
     }
diff -r 0965e589fdcc -r d7e6bfa114d0 xen/common/sched_sedf.c
--- a/xen/common/sched_sedf.c	Fri Nov 18 13:32:50 2011 +0000
+++ b/xen/common/sched_sedf.c	Fri Nov 18 13:34:43 2011 +0000
@@ -1304,6 +1304,8 @@
     rcu_read_lock(&domlist_read_lock);
     for_each_domain ( d )
     {
+        if ( (d->cpupool ? d->cpupool->sched : &sched_sedf_def) != ops )
+            continue;
         for_each_vcpu(d, ed)
         {
             if ( !__task_on_queue(ed) && (ed->processor == i) )
@@ -1335,10 +1337,8 @@
 
     /* Sum across all weights. */
     rcu_read_lock(&domlist_read_lock);
-    for_each_domain( d )
+    for_each_domain_in_cpupool( d, c )
     {
-        if ( c != d->cpupool )
-            continue;
         for_each_vcpu( d, p )
         {
             if ( (cpu = p->processor) >= nr_cpus )
@@ -1367,7 +1367,7 @@
 
     /* Adjust all slices (and periods) to the new weight. */
     rcu_read_lock(&domlist_read_lock);
-    for_each_domain( d )
+    for_each_domain_in_cpupool( d, c )
     {
         for_each_vcpu ( d, p )
         {
diff -r 0965e589fdcc -r d7e6bfa114d0 xen/common/schedule.c
--- a/xen/common/schedule.c	Fri Nov 18 13:32:50 2011 +0000
+++ b/xen/common/schedule.c	Fri Nov 18 13:34:43 2011 +0000
@@ -538,11 +538,8 @@
     if ( c == NULL )
         return ret;
 
-    for_each_domain ( d )
+    for_each_domain_in_cpupool ( d, c )
     {
-        if ( d->cpupool != c )
-            continue;
-
         affinity_broken = 0;
 
         for_each_vcpu ( d, v )
diff -r 0965e589fdcc -r d7e6bfa114d0 xen/include/xen/sched.h
--- a/xen/include/xen/sched.h	Fri Nov 18 13:32:50 2011 +0000
+++ b/xen/include/xen/sched.h	Fri Nov 18 13:34:43 2011 +0000
@@ -564,11 +564,31 @@
 extern struct domain *domain_list;
 
 /* Caller must hold the domlist_read_lock or domlist_update_lock. */
+static inline struct domain *first_domain_in_cpupool( struct cpupool *c)
+{
+    struct domain *d;
+    for (d = rcu_dereference(domain_list); d && d->cpupool != c;
+         d = rcu_dereference(d->next_in_list));
+    return d;
+}
+static inline struct domain *next_domain_in_cpupool(
+    struct domain *d, struct cpupool *c)
+{
+    for (d = rcu_dereference(d->next_in_list); d && d->cpupool != c;
+         d = rcu_dereference(d->next_in_list));
+    return d;
+}
+
 #define for_each_domain(_d)                     \
  for ( (_d) = rcu_dereference(domain_list);     \
        (_d) != NULL;                            \
        (_d) = rcu_dereference((_d)->next_in_list )) \
 
+#define for_each_domain_in_cpupool(_d,_c)       \
+ for ( (_d) = first_domain_in_cpupool(_c);      \
+       (_d) != NULL;                            \
+       (_d) = next_domain_in_cpupool((_d), (_c)))
+
 #define for_each_vcpu(_d,_v)                    \
  for ( (_v) = (_d)->vcpu ? (_d)->vcpu[0] : NULL; \
        (_v) != NULL;                            \

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 09:44:24 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 09:44:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSmto-0004n2-P1; Tue, 22 Nov 2011 09: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 1RSmtn-0004mb-Cp
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-27.messagelabs.com!1321955006!53703788!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20356 invoked from network); 22 Nov 2011 09:43:27 -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;
	22 Nov 2011 09:43: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 1RSmzX-0001NU-Jb
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:50:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmte-0004mV-84
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:10 +0000
Message-Id: <E1RSmte-0004mV-84@xenbits.xen.org>
Date: Tue, 22 Nov 2011 09:44:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] sched_sedf: Avoid panic when
	adjusting sedf parameters
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Juergen Gross <juergen.gross@ts.fujitsu.com>
# Date 1321623283 0
# Node ID d7e6bfa114d05fc4da83a55d995fb031970a94d8
# Parent  0965e589fdcca22af04f70274a6fa54acc42e281
sched_sedf: Avoid panic when adjusting sedf parameters

When using sedf scheduler in a cpupool the system might panic when
setting sedf scheduling parameters for a domain.  Introduces
for_each_domain_in_cpupool macro as it is usable 4 times now.  Add
appropriate locking in cpupool_unassign_cpu().

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 0965e589fdcc -r d7e6bfa114d0 xen/common/cpupool.c
--- a/xen/common/cpupool.c	Fri Nov 18 13:32:50 2011 +0000
+++ b/xen/common/cpupool.c	Fri Nov 18 13:34:43 2011 +0000
@@ -309,10 +309,9 @@
     if ( (c->n_dom > 0) && (cpumask_weight(c->cpu_valid) == 1) &&
          (cpu != cpupool_moving_cpu) )
     {
-        for_each_domain(d)
+        rcu_read_lock(&domlist_read_lock);
+        for_each_domain_in_cpupool(d, c)
         {
-            if ( d->cpupool != c )
-                continue;
             if ( !d->is_dying )
             {
                 ret = -EBUSY;
@@ -327,6 +326,7 @@
             }
             cpupool0->n_dom++;
         }
+        rcu_read_unlock(&domlist_read_lock);
         if ( ret )
             goto out;
     }
diff -r 0965e589fdcc -r d7e6bfa114d0 xen/common/sched_sedf.c
--- a/xen/common/sched_sedf.c	Fri Nov 18 13:32:50 2011 +0000
+++ b/xen/common/sched_sedf.c	Fri Nov 18 13:34:43 2011 +0000
@@ -1304,6 +1304,8 @@
     rcu_read_lock(&domlist_read_lock);
     for_each_domain ( d )
     {
+        if ( (d->cpupool ? d->cpupool->sched : &sched_sedf_def) != ops )
+            continue;
         for_each_vcpu(d, ed)
         {
             if ( !__task_on_queue(ed) && (ed->processor == i) )
@@ -1335,10 +1337,8 @@
 
     /* Sum across all weights. */
     rcu_read_lock(&domlist_read_lock);
-    for_each_domain( d )
+    for_each_domain_in_cpupool( d, c )
     {
-        if ( c != d->cpupool )
-            continue;
         for_each_vcpu( d, p )
         {
             if ( (cpu = p->processor) >= nr_cpus )
@@ -1367,7 +1367,7 @@
 
     /* Adjust all slices (and periods) to the new weight. */
     rcu_read_lock(&domlist_read_lock);
-    for_each_domain( d )
+    for_each_domain_in_cpupool( d, c )
     {
         for_each_vcpu ( d, p )
         {
diff -r 0965e589fdcc -r d7e6bfa114d0 xen/common/schedule.c
--- a/xen/common/schedule.c	Fri Nov 18 13:32:50 2011 +0000
+++ b/xen/common/schedule.c	Fri Nov 18 13:34:43 2011 +0000
@@ -538,11 +538,8 @@
     if ( c == NULL )
         return ret;
 
-    for_each_domain ( d )
+    for_each_domain_in_cpupool ( d, c )
     {
-        if ( d->cpupool != c )
-            continue;
-
         affinity_broken = 0;
 
         for_each_vcpu ( d, v )
diff -r 0965e589fdcc -r d7e6bfa114d0 xen/include/xen/sched.h
--- a/xen/include/xen/sched.h	Fri Nov 18 13:32:50 2011 +0000
+++ b/xen/include/xen/sched.h	Fri Nov 18 13:34:43 2011 +0000
@@ -564,11 +564,31 @@
 extern struct domain *domain_list;
 
 /* Caller must hold the domlist_read_lock or domlist_update_lock. */
+static inline struct domain *first_domain_in_cpupool( struct cpupool *c)
+{
+    struct domain *d;
+    for (d = rcu_dereference(domain_list); d && d->cpupool != c;
+         d = rcu_dereference(d->next_in_list));
+    return d;
+}
+static inline struct domain *next_domain_in_cpupool(
+    struct domain *d, struct cpupool *c)
+{
+    for (d = rcu_dereference(d->next_in_list); d && d->cpupool != c;
+         d = rcu_dereference(d->next_in_list));
+    return d;
+}
+
 #define for_each_domain(_d)                     \
  for ( (_d) = rcu_dereference(domain_list);     \
        (_d) != NULL;                            \
        (_d) = rcu_dereference((_d)->next_in_list )) \
 
+#define for_each_domain_in_cpupool(_d,_c)       \
+ for ( (_d) = first_domain_in_cpupool(_c);      \
+       (_d) != NULL;                            \
+       (_d) = next_domain_in_cpupool((_d), (_c)))
+
 #define for_each_vcpu(_d,_v)                    \
  for ( (_v) = (_d)->vcpu ? (_d)->vcpu[0] : NULL; \
        (_v) != NULL;                            \

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 09:44:25 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 09:44:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSmtr-0004ne-0f; Tue, 22 Nov 2011 09:44:23 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmtq-0004mH-1l
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-182.messagelabs.com!1321955032!4091737!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23867 invoked from network); 22 Nov 2011 09:43:53 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Nov 2011 09:43:53 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmzV-0001NF-0q
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:50:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmtb-0004lI-LC
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:07 +0000
Message-Id: <E1RSmtb-0004lI-LC@xenbits.xen.org>
Date: Tue, 22 Nov 2011 09:44:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/IO-APIC: refine EOI-ing of
	migrating level interrupts
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1321604321 -3600
# Node ID 0d50e704834fb53c6c86b8b0badd19d88e73c4ed
# Parent  dbdc840f8f62db58321b5009e5e0f7833066386f
x86/IO-APIC: refine EOI-ing of migrating level interrupts

Rather than going through all IO-APICs and calling io_apic_eoi_vector()
for the vector in question, just use eoi_IO_APIC_irq().

This in turn allows to eliminate quite a bit of other code.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---


diff -r dbdc840f8f62 -r 0d50e704834f xen/arch/x86/io_apic.c
--- a/xen/arch/x86/io_apic.c	Wed Nov 16 18:21:14 2011 +0000
+++ b/xen/arch/x86/io_apic.c	Fri Nov 18 09:18:41 2011 +0100
@@ -69,10 +69,6 @@
 
 #define ioapic_has_eoi_reg(apic) (mp_ioapics[(apic)].mpc_apicver >= 0x20)
 
-#define io_apic_eoi_vector(apic, vector) io_apic_eoi((apic), (vector), -1)
-#define io_apic_eoi_pin(apic, pin) io_apic_eoi((apic), -1, (pin))
-
-
 /*
  * This is performance-critical, we want to do it O(1)
  *
@@ -213,21 +209,18 @@
     spin_unlock_irqrestore(&ioapic_lock, flags);
 }
 
-/* EOI an IO-APIC entry.  One of vector or pin may be -1, indicating that
- * it should be worked out using the other.  This function expect that the
- * ioapic_lock is taken, and interrupts are disabled (or there is a good reason
- * not to), and that if both pin and vector are passed, that they refer to the
+/* EOI an IO-APIC entry.  Vector may be -1, indicating that it should be
+ * worked out using the pin.  This function expects that the ioapic_lock is
+ * being held, and interrupts are disabled (or there is a good reason not
+ * to), and that if both pin and vector are passed, that they refer to the
  * same redirection entry in the IO-APIC. */
 static void __io_apic_eoi(unsigned int apic, unsigned int vector, unsigned int pin)
 {
-    /* Ensure some useful information is passed in */
-    BUG_ON( (vector == -1 && pin == -1) );
-    
     /* Prefer the use of the EOI register if available */
     if ( ioapic_has_eoi_reg(apic) )
     {
         /* If vector is unknown, read it from the IO-APIC */
-        if ( vector == -1 )
+        if ( vector == IRQ_VECTOR_UNASSIGNED )
             vector = __ioapic_read_entry(apic, pin, TRUE).vector;
 
         *(IO_APIC_BASE(apic)+16) = vector;
@@ -239,42 +232,6 @@
         struct IO_APIC_route_entry entry;
         bool_t need_to_unmask = 0;
 
-        /* If pin is unknown, search for it */
-        if ( pin == -1 )
-        {
-            unsigned int p;
-            for ( p = 0; p < nr_ioapic_entries[apic]; ++p )
-            {
-                entry = __ioapic_read_entry(apic, p, TRUE);
-                if ( entry.vector == vector )
-                {
-                    pin = p;
-                    /* break; */
-
-                    /* Here should be a break out of the loop, but at the 
-                     * Xen code doesn't actually prevent multiple IO-APIC
-                     * entries being assigned the same vector, so EOI all
-                     * pins which have the correct vector.
-                     *
-                     * Remove the following code when the above assertion
-                     * is fulfilled. */
-                    __io_apic_eoi(apic, vector, p);
-                }
-            }
-            
-            /* If search fails, nothing to do */
-
-            /* if ( pin == -1 ) */
-
-            /* Because the loop wasn't broken out of (see comment above),
-             * all relevant pins have been EOI, so we can always return.
-             * 
-             * Re-instate the if statement above when the Xen logic has been
-             * fixed.*/
-
-            return;
-        }
-
         entry = __ioapic_read_entry(apic, pin, TRUE);
 
         if ( ! entry.mask )
@@ -301,17 +258,6 @@
     }
 }
 
-/* EOI an IO-APIC entry.  One of vector or pin may be -1, indicating that
- * it should be worked out using the other.  This function disables interrupts
- * and takes the ioapic_lock */
-static void io_apic_eoi(unsigned int apic, unsigned int vector, unsigned int pin)
-{
-    unsigned int flags;
-    spin_lock_irqsave(&ioapic_lock, flags);
-    __io_apic_eoi(apic, vector, pin);
-    spin_unlock_irqrestore(&ioapic_lock, flags);
-}
-
 /*
  * Saves all the IO-APIC RTE's
  */
@@ -1693,11 +1639,7 @@
 
     /* Manually EOI the old vector if we are moving to the new */
     if ( vector && i != vector )
-    {
-        int ioapic;
-        for (ioapic = 0; ioapic < nr_ioapics; ioapic++)
-            io_apic_eoi_vector(ioapic, i);
-    }
+        eoi_IO_APIC_irq(desc);
 
     v = apic_read(APIC_TMR + ((i & ~0x1f) >> 1));
 

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 09:44:25 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 09:44:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSmtr-0004ne-0f; Tue, 22 Nov 2011 09:44:23 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmtq-0004mH-1l
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-182.messagelabs.com!1321955032!4091737!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23867 invoked from network); 22 Nov 2011 09:43:53 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Nov 2011 09:43:53 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmzV-0001NF-0q
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:50:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmtb-0004lI-LC
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:07 +0000
Message-Id: <E1RSmtb-0004lI-LC@xenbits.xen.org>
Date: Tue, 22 Nov 2011 09:44:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/IO-APIC: refine EOI-ing of
	migrating level interrupts
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1321604321 -3600
# Node ID 0d50e704834fb53c6c86b8b0badd19d88e73c4ed
# Parent  dbdc840f8f62db58321b5009e5e0f7833066386f
x86/IO-APIC: refine EOI-ing of migrating level interrupts

Rather than going through all IO-APICs and calling io_apic_eoi_vector()
for the vector in question, just use eoi_IO_APIC_irq().

This in turn allows to eliminate quite a bit of other code.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---


diff -r dbdc840f8f62 -r 0d50e704834f xen/arch/x86/io_apic.c
--- a/xen/arch/x86/io_apic.c	Wed Nov 16 18:21:14 2011 +0000
+++ b/xen/arch/x86/io_apic.c	Fri Nov 18 09:18:41 2011 +0100
@@ -69,10 +69,6 @@
 
 #define ioapic_has_eoi_reg(apic) (mp_ioapics[(apic)].mpc_apicver >= 0x20)
 
-#define io_apic_eoi_vector(apic, vector) io_apic_eoi((apic), (vector), -1)
-#define io_apic_eoi_pin(apic, pin) io_apic_eoi((apic), -1, (pin))
-
-
 /*
  * This is performance-critical, we want to do it O(1)
  *
@@ -213,21 +209,18 @@
     spin_unlock_irqrestore(&ioapic_lock, flags);
 }
 
-/* EOI an IO-APIC entry.  One of vector or pin may be -1, indicating that
- * it should be worked out using the other.  This function expect that the
- * ioapic_lock is taken, and interrupts are disabled (or there is a good reason
- * not to), and that if both pin and vector are passed, that they refer to the
+/* EOI an IO-APIC entry.  Vector may be -1, indicating that it should be
+ * worked out using the pin.  This function expects that the ioapic_lock is
+ * being held, and interrupts are disabled (or there is a good reason not
+ * to), and that if both pin and vector are passed, that they refer to the
  * same redirection entry in the IO-APIC. */
 static void __io_apic_eoi(unsigned int apic, unsigned int vector, unsigned int pin)
 {
-    /* Ensure some useful information is passed in */
-    BUG_ON( (vector == -1 && pin == -1) );
-    
     /* Prefer the use of the EOI register if available */
     if ( ioapic_has_eoi_reg(apic) )
     {
         /* If vector is unknown, read it from the IO-APIC */
-        if ( vector == -1 )
+        if ( vector == IRQ_VECTOR_UNASSIGNED )
             vector = __ioapic_read_entry(apic, pin, TRUE).vector;
 
         *(IO_APIC_BASE(apic)+16) = vector;
@@ -239,42 +232,6 @@
         struct IO_APIC_route_entry entry;
         bool_t need_to_unmask = 0;
 
-        /* If pin is unknown, search for it */
-        if ( pin == -1 )
-        {
-            unsigned int p;
-            for ( p = 0; p < nr_ioapic_entries[apic]; ++p )
-            {
-                entry = __ioapic_read_entry(apic, p, TRUE);
-                if ( entry.vector == vector )
-                {
-                    pin = p;
-                    /* break; */
-
-                    /* Here should be a break out of the loop, but at the 
-                     * Xen code doesn't actually prevent multiple IO-APIC
-                     * entries being assigned the same vector, so EOI all
-                     * pins which have the correct vector.
-                     *
-                     * Remove the following code when the above assertion
-                     * is fulfilled. */
-                    __io_apic_eoi(apic, vector, p);
-                }
-            }
-            
-            /* If search fails, nothing to do */
-
-            /* if ( pin == -1 ) */
-
-            /* Because the loop wasn't broken out of (see comment above),
-             * all relevant pins have been EOI, so we can always return.
-             * 
-             * Re-instate the if statement above when the Xen logic has been
-             * fixed.*/
-
-            return;
-        }
-
         entry = __ioapic_read_entry(apic, pin, TRUE);
 
         if ( ! entry.mask )
@@ -301,17 +258,6 @@
     }
 }
 
-/* EOI an IO-APIC entry.  One of vector or pin may be -1, indicating that
- * it should be worked out using the other.  This function disables interrupts
- * and takes the ioapic_lock */
-static void io_apic_eoi(unsigned int apic, unsigned int vector, unsigned int pin)
-{
-    unsigned int flags;
-    spin_lock_irqsave(&ioapic_lock, flags);
-    __io_apic_eoi(apic, vector, pin);
-    spin_unlock_irqrestore(&ioapic_lock, flags);
-}
-
 /*
  * Saves all the IO-APIC RTE's
  */
@@ -1693,11 +1639,7 @@
 
     /* Manually EOI the old vector if we are moving to the new */
     if ( vector && i != vector )
-    {
-        int ioapic;
-        for (ioapic = 0; ioapic < nr_ioapics; ioapic++)
-            io_apic_eoi_vector(ioapic, i);
-    }
+        eoi_IO_APIC_irq(desc);
 
     v = apic_read(APIC_TMR + ((i & ~0x1f) >> 1));
 

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 09:44:25 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 09:44:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSmto-0004mx-M2; Tue, 22 Nov 2011 09: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 1RSmtm-0004mU-Nd
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-27.messagelabs.com!1321955005!53703785!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20309 invoked from network); 22 Nov 2011 09:43:26 -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;
	22 Nov 2011 09:43:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmzW-0001NR-SO
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:50:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmtd-0004mG-NH
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:09 +0000
Message-Id: <E1RSmtd-0004mG-NH@xenbits.xen.org>
Date: Tue, 22 Nov 2011 09:44:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hvmloader: Add configuration options
	to selectively disable S3 and S4 ACPI power states.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Paul Durrant <paul.durrant@citrix.com>
# Date 1321623170 0
# Node ID 0965e589fdcca22af04f70274a6fa54acc42e281
# Parent  4fa1c13f8bb1286c5090b8260e12e67ef7618f5f
hvmloader: Add configuration options to selectively disable S3 and S4 ACPI power states.

Introduce acpi_s3 and acpi_s4 configuration options (default=1). The
S3 and S4 packages are moved into separate SSDTs and their inclusion
is controlled by the new configuration options.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 4fa1c13f8bb1 -r 0965e589fdcc tools/firmware/hvmloader/acpi/Makefile
--- a/tools/firmware/hvmloader/acpi/Makefile	Fri Nov 18 13:31:43 2011 +0000
+++ b/tools/firmware/hvmloader/acpi/Makefile	Fri Nov 18 13:32:50 2011 +0000
@@ -26,7 +26,7 @@
 vpath iasl $(PATH)
 all: acpi.a
 
-ssdt_pm.h ssdt_tpm.h: %.h: %.asl iasl
+ssdt_s3.h ssdt_s4.h ssdt_pm.h ssdt_tpm.h: %.h: %.asl iasl
 	iasl -vs -p $* -tc $<
 	sed -e 's/AmlCode/$*/g' $*.hex >$@
 	rm -f $*.hex $*.aml
@@ -57,7 +57,7 @@
 	@echo 
 	@exit 1
 
-build.o: ssdt_pm.h ssdt_tpm.h
+build.o: ssdt_s3.h ssdt_s4.h ssdt_pm.h ssdt_tpm.h
 
 acpi.a: $(OBJS)
 	$(AR) rc $@ $(OBJS)
diff -r 4fa1c13f8bb1 -r 0965e589fdcc tools/firmware/hvmloader/acpi/build.c
--- a/tools/firmware/hvmloader/acpi/build.c	Fri Nov 18 13:31:43 2011 +0000
+++ b/tools/firmware/hvmloader/acpi/build.c	Fri Nov 18 13:32:50 2011 +0000
@@ -17,6 +17,8 @@
  */
 
 #include "acpi2_0.h"
+#include "ssdt_s3.h"
+#include "ssdt_s4.h"
 #include "ssdt_tpm.h"
 #include "ssdt_pm.h"
 #include "../config.h"
@@ -235,6 +237,26 @@
         table_ptrs[nr_tables++] = (unsigned long)ssdt;
     }
 
+    if ( !strncmp(xenstore_read("platform/acpi_s3", "1"), "1", 1) )
+    {
+        ssdt = mem_alloc(sizeof(ssdt_s3), 16);
+        if (!ssdt) return -1;
+        memcpy(ssdt, ssdt_s3, sizeof(ssdt_s3));
+        table_ptrs[nr_tables++] = (unsigned long)ssdt;
+    } else {
+        printf("S3 disabled\n");
+    }
+
+    if ( !strncmp(xenstore_read("platform/acpi_s4", "1"), "1", 1) )
+    {
+        ssdt = mem_alloc(sizeof(ssdt_s4), 16);
+        if (!ssdt) return -1;
+        memcpy(ssdt, ssdt_s4, sizeof(ssdt_s4));
+        table_ptrs[nr_tables++] = (unsigned long)ssdt;
+    } else {
+        printf("S4 disabled\n");
+    }
+
     /* TPM TCPA and SSDT. */
     tis_hdr = (uint16_t *)0xFED40F00;
     if ( (tis_hdr[0] == tis_signature[0]) &&
diff -r 4fa1c13f8bb1 -r 0965e589fdcc tools/firmware/hvmloader/acpi/dsdt.asl
--- a/tools/firmware/hvmloader/acpi/dsdt.asl	Fri Nov 18 13:31:43 2011 +0000
+++ b/tools/firmware/hvmloader/acpi/dsdt.asl	Fri Nov 18 13:32:50 2011 +0000
@@ -27,24 +27,7 @@
     Name (\APCL, 0x00010000)
     Name (\PUID, 0x00)
 
-    /*
-     * S3 (suspend-to-ram), S4 (suspend-to-disc) and S5 (power-off) type codes:
-     * must match piix4 emulation.
-     */
-    Name (\_S3, Package (0x04)
-    {
-        0x01,  /* PM1a_CNT.SLP_TYP */
-        0x01,  /* PM1b_CNT.SLP_TYP */
-        0x0,   /* reserved */
-        0x0    /* reserved */
-    })
-    Name (\_S4, Package (0x04)
-    {
-        0x00,  /* PM1a_CNT.SLP_TYP */
-        0x00,  /* PM1b_CNT.SLP_TYP */
-        0x00,  /* reserved */
-        0x00   /* reserved */
-    })
+    /* _S3 and _S4 are in separate SSDTs */
     Name (\_S5, Package (0x04)
     {
         0x00,  /* PM1a_CNT.SLP_TYP */
diff -r 4fa1c13f8bb1 -r 0965e589fdcc tools/firmware/hvmloader/acpi/ssdt_s3.asl
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/firmware/hvmloader/acpi/ssdt_s3.asl	Fri Nov 18 13:32:50 2011 +0000
@@ -0,0 +1,32 @@
+/*
+ * ssdt_s3.asl
+ *
+ * Copyright (c) 2011  Citrix Systems, 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 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
+ */
+
+DefinitionBlock ("SSDT_S3.aml", "SSDT", 2, "Xen", "HVM", 0)
+{
+    /* Must match piix emulation */
+    Name (\_S3, Package (0x04)
+    {
+        0x01,  /* PM1a_CNT.SLP_TYP */
+        0x01,  /* PM1b_CNT.SLP_TYP */
+        0x0,   /* reserved */
+        0x0    /* reserved */
+    })
+}
+
diff -r 4fa1c13f8bb1 -r 0965e589fdcc tools/firmware/hvmloader/acpi/ssdt_s4.asl
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/firmware/hvmloader/acpi/ssdt_s4.asl	Fri Nov 18 13:32:50 2011 +0000
@@ -0,0 +1,32 @@
+/*
+ * ssdt_s4.asl
+ *
+ * Copyright (c) 2011  Citrix Systems, 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 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
+ */
+
+DefinitionBlock ("SSDT_S4.aml", "SSDT", 2, "Xen", "HVM", 0)
+{
+    /* Must match piix emulation */
+    Name (\_S4, Package (0x04)
+    {
+        0x00,  /* PM1a_CNT.SLP_TYP */
+        0x00,  /* PM1b_CNT.SLP_TYP */
+        0x00,  /* reserved */
+        0x00   /* reserved */
+    })
+}
+
diff -r 4fa1c13f8bb1 -r 0965e589fdcc tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Fri Nov 18 13:31:43 2011 +0000
+++ b/tools/libxl/libxl_create.c	Fri Nov 18 13:32:50 2011 +0000
@@ -93,6 +93,8 @@
         b_info->u.hvm.pae = 1;
         b_info->u.hvm.apic = 1;
         b_info->u.hvm.acpi = 1;
+        b_info->u.hvm.acpi_s3 = 1;
+        b_info->u.hvm.acpi_s4 = 1;
         b_info->u.hvm.nx = 1;
         b_info->u.hvm.viridian = 0;
         b_info->u.hvm.hpet = 1;
@@ -189,9 +191,13 @@
         vments[4] = "start_time";
         vments[5] = libxl__sprintf(gc, "%lu.%02d", start_time.tv_sec,(int)start_time.tv_usec/10000);
 
-        localents = libxl__calloc(gc, 3, sizeof(char *));
+        localents = libxl__calloc(gc, 7, sizeof(char *));
         localents[0] = "platform/acpi";
         localents[1] = (info->u.hvm.acpi) ? "1" : "0";
+        localents[2] = "platform/acpi_s3";
+        localents[3] = (info->u.hvm.acpi_s3) ? "1" : "0";
+        localents[4] = "platform/acpi_s4";
+        localents[5] = (info->u.hvm.acpi_s4) ? "1" : "0";
 
         break;
     case LIBXL_DOMAIN_TYPE_PV:
diff -r 4fa1c13f8bb1 -r 0965e589fdcc tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Fri Nov 18 13:31:43 2011 +0000
+++ b/tools/libxl/libxl_types.idl	Fri Nov 18 13:32:50 2011 +0000
@@ -167,6 +167,8 @@
                                        ("pae", bool),
                                        ("apic", bool),
                                        ("acpi", bool),
+                                       ("acpi_s3", bool),
+                                       ("acpi_s4", bool),
                                        ("nx", bool),
                                        ("viridian", bool),
                                        ("timeoffset", string),
diff -r 4fa1c13f8bb1 -r 0965e589fdcc tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Fri Nov 18 13:31:43 2011 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Fri Nov 18 13:32:50 2011 +0000
@@ -683,6 +683,10 @@
             b_info->u.hvm.apic = l;
         if (!xlu_cfg_get_long (config, "acpi", &l))
             b_info->u.hvm.acpi = l;
+        if (!xlu_cfg_get_long (config, "acpi_s3", &l))
+            b_info->u.hvm.acpi_s3 = l;
+        if (!xlu_cfg_get_long (config, "acpi_s4", &l))
+            b_info->u.hvm.acpi_s4 = l;
         if (!xlu_cfg_get_long (config, "nx", &l))
             b_info->u.hvm.nx = l;
         if (!xlu_cfg_get_long (config, "viridian", &l))

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 09:44:25 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 09:44:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSmto-0004mx-M2; Tue, 22 Nov 2011 09: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 1RSmtm-0004mU-Nd
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-27.messagelabs.com!1321955005!53703785!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20309 invoked from network); 22 Nov 2011 09:43:26 -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;
	22 Nov 2011 09:43:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmzW-0001NR-SO
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:50:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmtd-0004mG-NH
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:09 +0000
Message-Id: <E1RSmtd-0004mG-NH@xenbits.xen.org>
Date: Tue, 22 Nov 2011 09:44:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hvmloader: Add configuration options
	to selectively disable S3 and S4 ACPI power states.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Paul Durrant <paul.durrant@citrix.com>
# Date 1321623170 0
# Node ID 0965e589fdcca22af04f70274a6fa54acc42e281
# Parent  4fa1c13f8bb1286c5090b8260e12e67ef7618f5f
hvmloader: Add configuration options to selectively disable S3 and S4 ACPI power states.

Introduce acpi_s3 and acpi_s4 configuration options (default=1). The
S3 and S4 packages are moved into separate SSDTs and their inclusion
is controlled by the new configuration options.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 4fa1c13f8bb1 -r 0965e589fdcc tools/firmware/hvmloader/acpi/Makefile
--- a/tools/firmware/hvmloader/acpi/Makefile	Fri Nov 18 13:31:43 2011 +0000
+++ b/tools/firmware/hvmloader/acpi/Makefile	Fri Nov 18 13:32:50 2011 +0000
@@ -26,7 +26,7 @@
 vpath iasl $(PATH)
 all: acpi.a
 
-ssdt_pm.h ssdt_tpm.h: %.h: %.asl iasl
+ssdt_s3.h ssdt_s4.h ssdt_pm.h ssdt_tpm.h: %.h: %.asl iasl
 	iasl -vs -p $* -tc $<
 	sed -e 's/AmlCode/$*/g' $*.hex >$@
 	rm -f $*.hex $*.aml
@@ -57,7 +57,7 @@
 	@echo 
 	@exit 1
 
-build.o: ssdt_pm.h ssdt_tpm.h
+build.o: ssdt_s3.h ssdt_s4.h ssdt_pm.h ssdt_tpm.h
 
 acpi.a: $(OBJS)
 	$(AR) rc $@ $(OBJS)
diff -r 4fa1c13f8bb1 -r 0965e589fdcc tools/firmware/hvmloader/acpi/build.c
--- a/tools/firmware/hvmloader/acpi/build.c	Fri Nov 18 13:31:43 2011 +0000
+++ b/tools/firmware/hvmloader/acpi/build.c	Fri Nov 18 13:32:50 2011 +0000
@@ -17,6 +17,8 @@
  */
 
 #include "acpi2_0.h"
+#include "ssdt_s3.h"
+#include "ssdt_s4.h"
 #include "ssdt_tpm.h"
 #include "ssdt_pm.h"
 #include "../config.h"
@@ -235,6 +237,26 @@
         table_ptrs[nr_tables++] = (unsigned long)ssdt;
     }
 
+    if ( !strncmp(xenstore_read("platform/acpi_s3", "1"), "1", 1) )
+    {
+        ssdt = mem_alloc(sizeof(ssdt_s3), 16);
+        if (!ssdt) return -1;
+        memcpy(ssdt, ssdt_s3, sizeof(ssdt_s3));
+        table_ptrs[nr_tables++] = (unsigned long)ssdt;
+    } else {
+        printf("S3 disabled\n");
+    }
+
+    if ( !strncmp(xenstore_read("platform/acpi_s4", "1"), "1", 1) )
+    {
+        ssdt = mem_alloc(sizeof(ssdt_s4), 16);
+        if (!ssdt) return -1;
+        memcpy(ssdt, ssdt_s4, sizeof(ssdt_s4));
+        table_ptrs[nr_tables++] = (unsigned long)ssdt;
+    } else {
+        printf("S4 disabled\n");
+    }
+
     /* TPM TCPA and SSDT. */
     tis_hdr = (uint16_t *)0xFED40F00;
     if ( (tis_hdr[0] == tis_signature[0]) &&
diff -r 4fa1c13f8bb1 -r 0965e589fdcc tools/firmware/hvmloader/acpi/dsdt.asl
--- a/tools/firmware/hvmloader/acpi/dsdt.asl	Fri Nov 18 13:31:43 2011 +0000
+++ b/tools/firmware/hvmloader/acpi/dsdt.asl	Fri Nov 18 13:32:50 2011 +0000
@@ -27,24 +27,7 @@
     Name (\APCL, 0x00010000)
     Name (\PUID, 0x00)
 
-    /*
-     * S3 (suspend-to-ram), S4 (suspend-to-disc) and S5 (power-off) type codes:
-     * must match piix4 emulation.
-     */
-    Name (\_S3, Package (0x04)
-    {
-        0x01,  /* PM1a_CNT.SLP_TYP */
-        0x01,  /* PM1b_CNT.SLP_TYP */
-        0x0,   /* reserved */
-        0x0    /* reserved */
-    })
-    Name (\_S4, Package (0x04)
-    {
-        0x00,  /* PM1a_CNT.SLP_TYP */
-        0x00,  /* PM1b_CNT.SLP_TYP */
-        0x00,  /* reserved */
-        0x00   /* reserved */
-    })
+    /* _S3 and _S4 are in separate SSDTs */
     Name (\_S5, Package (0x04)
     {
         0x00,  /* PM1a_CNT.SLP_TYP */
diff -r 4fa1c13f8bb1 -r 0965e589fdcc tools/firmware/hvmloader/acpi/ssdt_s3.asl
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/firmware/hvmloader/acpi/ssdt_s3.asl	Fri Nov 18 13:32:50 2011 +0000
@@ -0,0 +1,32 @@
+/*
+ * ssdt_s3.asl
+ *
+ * Copyright (c) 2011  Citrix Systems, 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 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
+ */
+
+DefinitionBlock ("SSDT_S3.aml", "SSDT", 2, "Xen", "HVM", 0)
+{
+    /* Must match piix emulation */
+    Name (\_S3, Package (0x04)
+    {
+        0x01,  /* PM1a_CNT.SLP_TYP */
+        0x01,  /* PM1b_CNT.SLP_TYP */
+        0x0,   /* reserved */
+        0x0    /* reserved */
+    })
+}
+
diff -r 4fa1c13f8bb1 -r 0965e589fdcc tools/firmware/hvmloader/acpi/ssdt_s4.asl
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/firmware/hvmloader/acpi/ssdt_s4.asl	Fri Nov 18 13:32:50 2011 +0000
@@ -0,0 +1,32 @@
+/*
+ * ssdt_s4.asl
+ *
+ * Copyright (c) 2011  Citrix Systems, 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 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
+ */
+
+DefinitionBlock ("SSDT_S4.aml", "SSDT", 2, "Xen", "HVM", 0)
+{
+    /* Must match piix emulation */
+    Name (\_S4, Package (0x04)
+    {
+        0x00,  /* PM1a_CNT.SLP_TYP */
+        0x00,  /* PM1b_CNT.SLP_TYP */
+        0x00,  /* reserved */
+        0x00   /* reserved */
+    })
+}
+
diff -r 4fa1c13f8bb1 -r 0965e589fdcc tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Fri Nov 18 13:31:43 2011 +0000
+++ b/tools/libxl/libxl_create.c	Fri Nov 18 13:32:50 2011 +0000
@@ -93,6 +93,8 @@
         b_info->u.hvm.pae = 1;
         b_info->u.hvm.apic = 1;
         b_info->u.hvm.acpi = 1;
+        b_info->u.hvm.acpi_s3 = 1;
+        b_info->u.hvm.acpi_s4 = 1;
         b_info->u.hvm.nx = 1;
         b_info->u.hvm.viridian = 0;
         b_info->u.hvm.hpet = 1;
@@ -189,9 +191,13 @@
         vments[4] = "start_time";
         vments[5] = libxl__sprintf(gc, "%lu.%02d", start_time.tv_sec,(int)start_time.tv_usec/10000);
 
-        localents = libxl__calloc(gc, 3, sizeof(char *));
+        localents = libxl__calloc(gc, 7, sizeof(char *));
         localents[0] = "platform/acpi";
         localents[1] = (info->u.hvm.acpi) ? "1" : "0";
+        localents[2] = "platform/acpi_s3";
+        localents[3] = (info->u.hvm.acpi_s3) ? "1" : "0";
+        localents[4] = "platform/acpi_s4";
+        localents[5] = (info->u.hvm.acpi_s4) ? "1" : "0";
 
         break;
     case LIBXL_DOMAIN_TYPE_PV:
diff -r 4fa1c13f8bb1 -r 0965e589fdcc tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Fri Nov 18 13:31:43 2011 +0000
+++ b/tools/libxl/libxl_types.idl	Fri Nov 18 13:32:50 2011 +0000
@@ -167,6 +167,8 @@
                                        ("pae", bool),
                                        ("apic", bool),
                                        ("acpi", bool),
+                                       ("acpi_s3", bool),
+                                       ("acpi_s4", bool),
                                        ("nx", bool),
                                        ("viridian", bool),
                                        ("timeoffset", string),
diff -r 4fa1c13f8bb1 -r 0965e589fdcc tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Fri Nov 18 13:31:43 2011 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Fri Nov 18 13:32:50 2011 +0000
@@ -683,6 +683,10 @@
             b_info->u.hvm.apic = l;
         if (!xlu_cfg_get_long (config, "acpi", &l))
             b_info->u.hvm.acpi = l;
+        if (!xlu_cfg_get_long (config, "acpi_s3", &l))
+            b_info->u.hvm.acpi_s3 = l;
+        if (!xlu_cfg_get_long (config, "acpi_s4", &l))
+            b_info->u.hvm.acpi_s4 = l;
         if (!xlu_cfg_get_long (config, "nx", &l))
             b_info->u.hvm.nx = l;
         if (!xlu_cfg_get_long (config, "viridian", &l))

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 09:44:25 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 09:44:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSmtp-0004nO-U2; Tue, 22 Nov 2011 09:44: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 1RSmto-0004mu-Po
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-27.messagelabs.com!1321955007!53703796!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20427 invoked from network); 22 Nov 2011 09:43:28 -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;
	22 Nov 2011 09:43: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 1RSmzY-0001Nd-Uc
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:50:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmtf-0004nE-Pu
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:11 +0000
Message-Id: <E1RSmtf-0004nE-Pu@xenbits.xen.org>
Date: Tue, 22 Nov 2011 09:44:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] add_to_physmap: Move the code for
	XENMEM_add_to_physmap
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jean Guyader <jean.guyader@eu.citrix.com>
# Date 1321623693 0
# Node ID 7a9a1261a6b01b31b68d4d00e35beab09fe6d20b
# Parent  9a1a71f7bef2ca58d045d8067b965fcdc7c76cb2
add_to_physmap: Move the code for XENMEM_add_to_physmap

Move the code for the XENMEM_add_to_physmap case into it's own
function (xenmem_add_to_physmap).

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 9a1a71f7bef2 -r 7a9a1261a6b0 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Fri Nov 18 13:40:56 2011 +0000
+++ b/xen/arch/x86/mm.c	Fri Nov 18 13:41:33 2011 +0000
@@ -4677,37 +4677,18 @@
     return 0;
 }
 
-long arch_memory_op(int op, XEN_GUEST_HANDLE(void) arg)
+static int xenmem_add_to_physmap(struct domain *d,
+                                 const struct xen_add_to_physmap *xatp)
 {
     struct page_info *page = NULL;
     unsigned long gfn = 0; /* gcc ... */
+    unsigned long prev_mfn, mfn = 0, gpfn, idx;
     int rc;
 
-    switch ( op )
+    switch ( xatp->space )
     {
-    case XENMEM_add_to_physmap:
-    {
-        struct xen_add_to_physmap xatp;
-        unsigned long prev_mfn, mfn = 0, gpfn;
-        struct domain *d;
-
-        if ( copy_from_guest(&xatp, arg, 1) )
-            return -EFAULT;
-
-        rc = rcu_lock_target_domain_by_id(xatp.domid, &d);
-        if ( rc != 0 )
-            return rc;
-
-        if ( xsm_add_to_physmap(current->domain, d) )
-        {
-            rcu_unlock_domain(d);
-            return -EPERM;
-        }
-
-        switch ( xatp.space )
-        {
         case XENMAPSPACE_shared_info:
-            if ( xatp.idx == 0 )
+            if ( xatp->idx == 0 )
                 mfn = virt_to_mfn(d->shared_info);
             break;
         case XENMAPSPACE_grant_table:
@@ -4716,21 +4697,22 @@
             if ( d->grant_table->gt_version == 0 )
                 d->grant_table->gt_version = 1;
 
+            idx = xatp->idx;
             if ( d->grant_table->gt_version == 2 &&
-                 (xatp.idx & XENMAPIDX_grant_table_status) )
+                 (xatp->idx & XENMAPIDX_grant_table_status) )
             {
-                xatp.idx &= ~XENMAPIDX_grant_table_status;
-                if ( xatp.idx < nr_status_frames(d->grant_table) )
-                    mfn = virt_to_mfn(d->grant_table->status[xatp.idx]);
+                idx &= ~XENMAPIDX_grant_table_status;
+                if ( xatp->idx < nr_status_frames(d->grant_table) )
+                    mfn = virt_to_mfn(d->grant_table->status[idx]);
             }
             else
             {
-                if ( (xatp.idx >= nr_grant_frames(d->grant_table)) &&
-                     (xatp.idx < max_nr_grant_frames) )
-                    gnttab_grow_table(d, xatp.idx + 1);
-
-                if ( xatp.idx < nr_grant_frames(d->grant_table) )
-                    mfn = virt_to_mfn(d->grant_table->shared_raw[xatp.idx]);
+                if ( (idx >= nr_grant_frames(d->grant_table)) &&
+                     (idx < max_nr_grant_frames) )
+                    gnttab_grow_table(d, idx + 1);
+
+                if ( idx < nr_grant_frames(d->grant_table) )
+                    mfn = virt_to_mfn(d->grant_table->shared_raw[idx]);
             }
 
             spin_unlock(&d->grant_table->lock);
@@ -4738,9 +4720,9 @@
         case XENMAPSPACE_gmfn:
         {
             p2m_type_t p2mt;
-            gfn = xatp.idx;
-
-            xatp.idx = mfn_x(get_gfn_unshare(d, xatp.idx, &p2mt));
+            gfn = xatp->idx;
+
+            idx = mfn_x(get_gfn_unshare(d, xatp->idx, &p2mt));
             /* If the page is still shared, exit early */
             if ( p2m_is_shared(p2mt) )
             {
@@ -4748,58 +4730,89 @@
                 rcu_unlock_domain(d);
                 return -ENOMEM;
             }
-            if ( !get_page_from_pagenr(xatp.idx, d) )
+            if ( !get_page_from_pagenr(idx, d) )
                 break;
-            mfn = xatp.idx;
+            mfn = idx;
             page = mfn_to_page(mfn);
             break;
         }
         default:
             break;
-        }
-
-        if ( !paging_mode_translate(d) || (mfn == 0) )
-        {
-            if ( page )
-                put_page(page);
-            if ( xatp.space == XENMAPSPACE_gmfn )
-                put_gfn(d, gfn);
-            rcu_unlock_domain(d);
-            return -EINVAL;
-        }
-
-        domain_lock(d);
-
+    }
+
+    if ( !paging_mode_translate(d) || (mfn == 0) )
+    {
         if ( page )
             put_page(page);
-
-        /* Remove previously mapped page if it was present. */
-        prev_mfn = get_gfn_untyped(d, xatp.gpfn);
-        if ( mfn_valid(prev_mfn) )
+        if ( xatp->space == XENMAPSPACE_gmfn )
+            put_gfn(d, gfn);
+        rcu_unlock_domain(d);
+        return -EINVAL;
+    }
+
+    domain_lock(d);
+
+    if ( page )
+        put_page(page);
+
+    /* Remove previously mapped page if it was present. */
+    prev_mfn = get_gfn_untyped(d, xatp->gpfn);
+    if ( mfn_valid(prev_mfn) )
+    {
+        if ( is_xen_heap_mfn(prev_mfn) )
+            /* Xen heap frames are simply unhooked from this phys slot. */
+            guest_physmap_remove_page(d, xatp->gpfn, prev_mfn, PAGE_ORDER_4K);
+        else
+            /* Normal domain memory is freed, to avoid leaking memory. */
+            guest_remove_page(d, xatp->gpfn);
+    }
+    /* In the XENMAPSPACE_gmfn case we still hold a ref on the old page. */
+    put_gfn(d, xatp->gpfn);
+
+    /* Unmap from old location, if any. */
+    gpfn = get_gpfn_from_mfn(mfn);
+    ASSERT( gpfn != SHARED_M2P_ENTRY );
+    if ( gpfn != INVALID_M2P_ENTRY )
+        guest_physmap_remove_page(d, gpfn, mfn, PAGE_ORDER_4K);
+
+    /* Map at new location. */
+    rc = guest_physmap_add_page(d, xatp->gpfn, mfn, PAGE_ORDER_4K);
+
+    /* In the XENMAPSPACE_gmfn, we took a ref and locked the p2m at the top */
+    if ( xatp->space == XENMAPSPACE_gmfn )
+        put_gfn(d, gfn);
+    domain_unlock(d);
+
+    rcu_unlock_domain(d);
+
+    return rc;
+}
+
+long arch_memory_op(int op, XEN_GUEST_HANDLE(void) arg)
+{
+    int rc;
+
+    switch ( op )
+    {
+    case XENMEM_add_to_physmap:
+    {
+        struct xen_add_to_physmap xatp;
+        struct domain *d;
+
+        if ( copy_from_guest(&xatp, arg, 1) )
+            return -EFAULT;
+
+        rc = rcu_lock_target_domain_by_id(xatp.domid, &d);
+        if ( rc != 0 )
+            return rc;
+
+        if ( xsm_add_to_physmap(current->domain, d) )
         {
-            if ( is_xen_heap_mfn(prev_mfn) )
-                /* Xen heap frames are simply unhooked from this phys slot. */
-                guest_physmap_remove_page(d, xatp.gpfn, prev_mfn, PAGE_ORDER_4K);
-            else
-                /* Normal domain memory is freed, to avoid leaking memory. */
-                guest_remove_page(d, xatp.gpfn);
+            rcu_unlock_domain(d);
+            return -EPERM;
         }
-        /* In the XENMAPSPACE_gmfn case we still hold a ref on the old page. */
-        put_gfn(d, xatp.gpfn);
-
-        /* Unmap from old location, if any. */
-        gpfn = get_gpfn_from_mfn(mfn);
-        ASSERT( gpfn != SHARED_M2P_ENTRY );
-        if ( gpfn != INVALID_M2P_ENTRY )
-            guest_physmap_remove_page(d, gpfn, mfn, PAGE_ORDER_4K);
-
-        /* Map at new location. */
-        rc = guest_physmap_add_page(d, xatp.gpfn, mfn, PAGE_ORDER_4K);
-
-        /* In the XENMAPSPACE_gmfn, we took a ref and locked the p2m at the top */
-        if ( xatp.space == XENMAPSPACE_gmfn )
-            put_gfn(d, gfn);
-        domain_unlock(d);
+
+        rc = xenmem_add_to_physmap(d, &xatp);
 
         rcu_unlock_domain(d);
 

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 09:44:25 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 09:44:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSmtp-0004nO-U2; Tue, 22 Nov 2011 09:44: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 1RSmto-0004mu-Po
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-27.messagelabs.com!1321955007!53703796!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20427 invoked from network); 22 Nov 2011 09:43:28 -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;
	22 Nov 2011 09:43: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 1RSmzY-0001Nd-Uc
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:50:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmtf-0004nE-Pu
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:11 +0000
Message-Id: <E1RSmtf-0004nE-Pu@xenbits.xen.org>
Date: Tue, 22 Nov 2011 09:44:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] add_to_physmap: Move the code for
	XENMEM_add_to_physmap
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jean Guyader <jean.guyader@eu.citrix.com>
# Date 1321623693 0
# Node ID 7a9a1261a6b01b31b68d4d00e35beab09fe6d20b
# Parent  9a1a71f7bef2ca58d045d8067b965fcdc7c76cb2
add_to_physmap: Move the code for XENMEM_add_to_physmap

Move the code for the XENMEM_add_to_physmap case into it's own
function (xenmem_add_to_physmap).

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 9a1a71f7bef2 -r 7a9a1261a6b0 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Fri Nov 18 13:40:56 2011 +0000
+++ b/xen/arch/x86/mm.c	Fri Nov 18 13:41:33 2011 +0000
@@ -4677,37 +4677,18 @@
     return 0;
 }
 
-long arch_memory_op(int op, XEN_GUEST_HANDLE(void) arg)
+static int xenmem_add_to_physmap(struct domain *d,
+                                 const struct xen_add_to_physmap *xatp)
 {
     struct page_info *page = NULL;
     unsigned long gfn = 0; /* gcc ... */
+    unsigned long prev_mfn, mfn = 0, gpfn, idx;
     int rc;
 
-    switch ( op )
+    switch ( xatp->space )
     {
-    case XENMEM_add_to_physmap:
-    {
-        struct xen_add_to_physmap xatp;
-        unsigned long prev_mfn, mfn = 0, gpfn;
-        struct domain *d;
-
-        if ( copy_from_guest(&xatp, arg, 1) )
-            return -EFAULT;
-
-        rc = rcu_lock_target_domain_by_id(xatp.domid, &d);
-        if ( rc != 0 )
-            return rc;
-
-        if ( xsm_add_to_physmap(current->domain, d) )
-        {
-            rcu_unlock_domain(d);
-            return -EPERM;
-        }
-
-        switch ( xatp.space )
-        {
         case XENMAPSPACE_shared_info:
-            if ( xatp.idx == 0 )
+            if ( xatp->idx == 0 )
                 mfn = virt_to_mfn(d->shared_info);
             break;
         case XENMAPSPACE_grant_table:
@@ -4716,21 +4697,22 @@
             if ( d->grant_table->gt_version == 0 )
                 d->grant_table->gt_version = 1;
 
+            idx = xatp->idx;
             if ( d->grant_table->gt_version == 2 &&
-                 (xatp.idx & XENMAPIDX_grant_table_status) )
+                 (xatp->idx & XENMAPIDX_grant_table_status) )
             {
-                xatp.idx &= ~XENMAPIDX_grant_table_status;
-                if ( xatp.idx < nr_status_frames(d->grant_table) )
-                    mfn = virt_to_mfn(d->grant_table->status[xatp.idx]);
+                idx &= ~XENMAPIDX_grant_table_status;
+                if ( xatp->idx < nr_status_frames(d->grant_table) )
+                    mfn = virt_to_mfn(d->grant_table->status[idx]);
             }
             else
             {
-                if ( (xatp.idx >= nr_grant_frames(d->grant_table)) &&
-                     (xatp.idx < max_nr_grant_frames) )
-                    gnttab_grow_table(d, xatp.idx + 1);
-
-                if ( xatp.idx < nr_grant_frames(d->grant_table) )
-                    mfn = virt_to_mfn(d->grant_table->shared_raw[xatp.idx]);
+                if ( (idx >= nr_grant_frames(d->grant_table)) &&
+                     (idx < max_nr_grant_frames) )
+                    gnttab_grow_table(d, idx + 1);
+
+                if ( idx < nr_grant_frames(d->grant_table) )
+                    mfn = virt_to_mfn(d->grant_table->shared_raw[idx]);
             }
 
             spin_unlock(&d->grant_table->lock);
@@ -4738,9 +4720,9 @@
         case XENMAPSPACE_gmfn:
         {
             p2m_type_t p2mt;
-            gfn = xatp.idx;
-
-            xatp.idx = mfn_x(get_gfn_unshare(d, xatp.idx, &p2mt));
+            gfn = xatp->idx;
+
+            idx = mfn_x(get_gfn_unshare(d, xatp->idx, &p2mt));
             /* If the page is still shared, exit early */
             if ( p2m_is_shared(p2mt) )
             {
@@ -4748,58 +4730,89 @@
                 rcu_unlock_domain(d);
                 return -ENOMEM;
             }
-            if ( !get_page_from_pagenr(xatp.idx, d) )
+            if ( !get_page_from_pagenr(idx, d) )
                 break;
-            mfn = xatp.idx;
+            mfn = idx;
             page = mfn_to_page(mfn);
             break;
         }
         default:
             break;
-        }
-
-        if ( !paging_mode_translate(d) || (mfn == 0) )
-        {
-            if ( page )
-                put_page(page);
-            if ( xatp.space == XENMAPSPACE_gmfn )
-                put_gfn(d, gfn);
-            rcu_unlock_domain(d);
-            return -EINVAL;
-        }
-
-        domain_lock(d);
-
+    }
+
+    if ( !paging_mode_translate(d) || (mfn == 0) )
+    {
         if ( page )
             put_page(page);
-
-        /* Remove previously mapped page if it was present. */
-        prev_mfn = get_gfn_untyped(d, xatp.gpfn);
-        if ( mfn_valid(prev_mfn) )
+        if ( xatp->space == XENMAPSPACE_gmfn )
+            put_gfn(d, gfn);
+        rcu_unlock_domain(d);
+        return -EINVAL;
+    }
+
+    domain_lock(d);
+
+    if ( page )
+        put_page(page);
+
+    /* Remove previously mapped page if it was present. */
+    prev_mfn = get_gfn_untyped(d, xatp->gpfn);
+    if ( mfn_valid(prev_mfn) )
+    {
+        if ( is_xen_heap_mfn(prev_mfn) )
+            /* Xen heap frames are simply unhooked from this phys slot. */
+            guest_physmap_remove_page(d, xatp->gpfn, prev_mfn, PAGE_ORDER_4K);
+        else
+            /* Normal domain memory is freed, to avoid leaking memory. */
+            guest_remove_page(d, xatp->gpfn);
+    }
+    /* In the XENMAPSPACE_gmfn case we still hold a ref on the old page. */
+    put_gfn(d, xatp->gpfn);
+
+    /* Unmap from old location, if any. */
+    gpfn = get_gpfn_from_mfn(mfn);
+    ASSERT( gpfn != SHARED_M2P_ENTRY );
+    if ( gpfn != INVALID_M2P_ENTRY )
+        guest_physmap_remove_page(d, gpfn, mfn, PAGE_ORDER_4K);
+
+    /* Map at new location. */
+    rc = guest_physmap_add_page(d, xatp->gpfn, mfn, PAGE_ORDER_4K);
+
+    /* In the XENMAPSPACE_gmfn, we took a ref and locked the p2m at the top */
+    if ( xatp->space == XENMAPSPACE_gmfn )
+        put_gfn(d, gfn);
+    domain_unlock(d);
+
+    rcu_unlock_domain(d);
+
+    return rc;
+}
+
+long arch_memory_op(int op, XEN_GUEST_HANDLE(void) arg)
+{
+    int rc;
+
+    switch ( op )
+    {
+    case XENMEM_add_to_physmap:
+    {
+        struct xen_add_to_physmap xatp;
+        struct domain *d;
+
+        if ( copy_from_guest(&xatp, arg, 1) )
+            return -EFAULT;
+
+        rc = rcu_lock_target_domain_by_id(xatp.domid, &d);
+        if ( rc != 0 )
+            return rc;
+
+        if ( xsm_add_to_physmap(current->domain, d) )
         {
-            if ( is_xen_heap_mfn(prev_mfn) )
-                /* Xen heap frames are simply unhooked from this phys slot. */
-                guest_physmap_remove_page(d, xatp.gpfn, prev_mfn, PAGE_ORDER_4K);
-            else
-                /* Normal domain memory is freed, to avoid leaking memory. */
-                guest_remove_page(d, xatp.gpfn);
+            rcu_unlock_domain(d);
+            return -EPERM;
         }
-        /* In the XENMAPSPACE_gmfn case we still hold a ref on the old page. */
-        put_gfn(d, xatp.gpfn);
-
-        /* Unmap from old location, if any. */
-        gpfn = get_gpfn_from_mfn(mfn);
-        ASSERT( gpfn != SHARED_M2P_ENTRY );
-        if ( gpfn != INVALID_M2P_ENTRY )
-            guest_physmap_remove_page(d, gpfn, mfn, PAGE_ORDER_4K);
-
-        /* Map at new location. */
-        rc = guest_physmap_add_page(d, xatp.gpfn, mfn, PAGE_ORDER_4K);
-
-        /* In the XENMAPSPACE_gmfn, we took a ref and locked the p2m at the top */
-        if ( xatp.space == XENMAPSPACE_gmfn )
-            put_gfn(d, gfn);
-        domain_unlock(d);
+
+        rc = xenmem_add_to_physmap(d, &xatp);
 
         rcu_unlock_domain(d);
 

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 09:44:26 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 09:44:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSmts-0004nw-5q; Tue, 22 Nov 2011 09:44:24 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmtr-0004mR-Ff
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-182.messagelabs.com!1321955033!4091741!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23938 invoked from network); 22 Nov 2011 09:43:54 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Nov 2011 09:43:54 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmzW-0001NO-Cv
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:50:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmtd-0004m1-6a
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:09 +0000
Message-Id: <E1RSmtd-0004m1-6a@xenbits.xen.org>
Date: Tue, 22 Nov 2011 09:44:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hvmloader: Move acpi_enabled out of
	hvm_info_table into xenstore
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Paul Durrant <paul.durrant@citrix.com>
# Date 1321623103 0
# Node ID 4fa1c13f8bb1286c5090b8260e12e67ef7618f5f
# Parent  7b5e1cb94bfa43a9268479b9a255fb88c07e4ce2
hvmloader: Move acpi_enabled out of hvm_info_table into xenstore

Since hvmloader has a xentore client, use a platform key in xenstore
to indicate whether ACPI is enabled or not rather than the shared
hvm_info_table structure.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 7b5e1cb94bfa -r 4fa1c13f8bb1 tools/firmware/hvmloader/hvmloader.c
--- a/tools/firmware/hvmloader/hvmloader.c	Fri Nov 18 09:22:45 2011 +0100
+++ b/tools/firmware/hvmloader/hvmloader.c	Fri Nov 18 13:31:43 2011 +0000
@@ -423,6 +423,7 @@
     const struct bios_config *bios;
     int option_rom_sz = 0, vgabios_sz = 0, etherboot_sz = 0;
     uint32_t etherboot_phys_addr = 0, option_rom_phys_addr = 0;
+    int acpi_enabled;
 
     /* Initialise hypercall stubs with RET, rendering them no-ops. */
     memset((void *)HYPERCALL_PHYSICAL_ADDRESS, 0xc3 /* RET */, PAGE_SIZE);
@@ -506,7 +507,9 @@
                                              option_rom_phys_addr);
     }
 
-    if ( hvm_info->acpi_enabled )
+    acpi_enabled = !strncmp(xenstore_read("platform/acpi", "1"), "1", 1);
+
+    if ( acpi_enabled )
     {
         struct xen_hvm_param p = {
             .domid = DOMID_SELF,
diff -r 7b5e1cb94bfa -r 4fa1c13f8bb1 tools/libxc/xc_hvm_build.c
--- a/tools/libxc/xc_hvm_build.c	Fri Nov 18 09:22:45 2011 +0100
+++ b/tools/libxc/xc_hvm_build.c	Fri Nov 18 13:31:43 2011 +0000
@@ -67,7 +67,6 @@
     hvm_info->length = sizeof(struct hvm_info_table);
 
     /* Sensible defaults: these can be overridden by the caller. */
-    hvm_info->acpi_enabled = 1;
     hvm_info->apic_mode = 1;
     hvm_info->nr_vcpus = 1;
     memset(hvm_info->vcpu_online, 0xff, sizeof(hvm_info->vcpu_online));
diff -r 7b5e1cb94bfa -r 4fa1c13f8bb1 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Fri Nov 18 09:22:45 2011 +0100
+++ b/tools/libxl/libxl_create.c	Fri Nov 18 13:31:43 2011 +0000
@@ -188,6 +188,11 @@
         vments[3] = "hvm";
         vments[4] = "start_time";
         vments[5] = libxl__sprintf(gc, "%lu.%02d", start_time.tv_sec,(int)start_time.tv_usec/10000);
+
+        localents = libxl__calloc(gc, 3, sizeof(char *));
+        localents[0] = "platform/acpi";
+        localents[1] = (info->u.hvm.acpi) ? "1" : "0";
+
         break;
     case LIBXL_DOMAIN_TYPE_PV:
         ret = libxl__build_pv(gc, domid, info, state);
diff -r 7b5e1cb94bfa -r 4fa1c13f8bb1 tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c	Fri Nov 18 09:22:45 2011 +0100
+++ b/tools/libxl/libxl_dom.c	Fri Nov 18 13:31:43 2011 +0000
@@ -248,7 +248,6 @@
         return -1;
 
     va_hvm = (struct hvm_info_table *)(va_map + HVM_INFO_OFFSET);
-    va_hvm->acpi_enabled = info->u.hvm.acpi;
     va_hvm->apic_mode = info->u.hvm.apic;
     va_hvm->nr_vcpus = info->max_vcpus;
     memcpy(va_hvm->vcpu_online, &info->cur_vcpus, sizeof(info->cur_vcpus));
diff -r 7b5e1cb94bfa -r 4fa1c13f8bb1 tools/python/xen/lowlevel/xc/xc.c
--- a/tools/python/xen/lowlevel/xc/xc.c	Fri Nov 18 09:22:45 2011 +0100
+++ b/tools/python/xen/lowlevel/xc/xc.c	Fri Nov 18 13:31:43 2011 +0000
@@ -996,7 +996,6 @@
     if ( va_map == NULL )
         return PyErr_SetFromErrno(xc_error_obj);
     va_hvm = (struct hvm_info_table *)(va_map + HVM_INFO_OFFSET);
-    va_hvm->acpi_enabled = acpi;
     va_hvm->apic_mode    = apic;
     va_hvm->nr_vcpus     = vcpus;
     memcpy(va_hvm->vcpu_online, vcpu_avail, sizeof(vcpu_avail));
diff -r 7b5e1cb94bfa -r 4fa1c13f8bb1 xen/include/public/hvm/hvm_info_table.h
--- a/xen/include/public/hvm/hvm_info_table.h	Fri Nov 18 09:22:45 2011 +0100
+++ b/xen/include/public/hvm/hvm_info_table.h	Fri Nov 18 13:31:43 2011 +0000
@@ -37,9 +37,6 @@
     uint32_t    length;
     uint8_t     checksum;
 
-    /* Should firmware build ACPI tables? */
-    uint8_t     acpi_enabled;
-
     /* Should firmware build APIC descriptors (APIC MADT / MP BIOS)? */
     uint8_t     apic_mode;
 

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 09:44:26 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 09:44:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSmts-0004nw-5q; Tue, 22 Nov 2011 09:44:24 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmtr-0004mR-Ff
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-182.messagelabs.com!1321955033!4091741!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23938 invoked from network); 22 Nov 2011 09:43:54 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Nov 2011 09:43:54 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmzW-0001NO-Cv
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:50:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmtd-0004m1-6a
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:09 +0000
Message-Id: <E1RSmtd-0004m1-6a@xenbits.xen.org>
Date: Tue, 22 Nov 2011 09:44:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hvmloader: Move acpi_enabled out of
	hvm_info_table into xenstore
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Paul Durrant <paul.durrant@citrix.com>
# Date 1321623103 0
# Node ID 4fa1c13f8bb1286c5090b8260e12e67ef7618f5f
# Parent  7b5e1cb94bfa43a9268479b9a255fb88c07e4ce2
hvmloader: Move acpi_enabled out of hvm_info_table into xenstore

Since hvmloader has a xentore client, use a platform key in xenstore
to indicate whether ACPI is enabled or not rather than the shared
hvm_info_table structure.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 7b5e1cb94bfa -r 4fa1c13f8bb1 tools/firmware/hvmloader/hvmloader.c
--- a/tools/firmware/hvmloader/hvmloader.c	Fri Nov 18 09:22:45 2011 +0100
+++ b/tools/firmware/hvmloader/hvmloader.c	Fri Nov 18 13:31:43 2011 +0000
@@ -423,6 +423,7 @@
     const struct bios_config *bios;
     int option_rom_sz = 0, vgabios_sz = 0, etherboot_sz = 0;
     uint32_t etherboot_phys_addr = 0, option_rom_phys_addr = 0;
+    int acpi_enabled;
 
     /* Initialise hypercall stubs with RET, rendering them no-ops. */
     memset((void *)HYPERCALL_PHYSICAL_ADDRESS, 0xc3 /* RET */, PAGE_SIZE);
@@ -506,7 +507,9 @@
                                              option_rom_phys_addr);
     }
 
-    if ( hvm_info->acpi_enabled )
+    acpi_enabled = !strncmp(xenstore_read("platform/acpi", "1"), "1", 1);
+
+    if ( acpi_enabled )
     {
         struct xen_hvm_param p = {
             .domid = DOMID_SELF,
diff -r 7b5e1cb94bfa -r 4fa1c13f8bb1 tools/libxc/xc_hvm_build.c
--- a/tools/libxc/xc_hvm_build.c	Fri Nov 18 09:22:45 2011 +0100
+++ b/tools/libxc/xc_hvm_build.c	Fri Nov 18 13:31:43 2011 +0000
@@ -67,7 +67,6 @@
     hvm_info->length = sizeof(struct hvm_info_table);
 
     /* Sensible defaults: these can be overridden by the caller. */
-    hvm_info->acpi_enabled = 1;
     hvm_info->apic_mode = 1;
     hvm_info->nr_vcpus = 1;
     memset(hvm_info->vcpu_online, 0xff, sizeof(hvm_info->vcpu_online));
diff -r 7b5e1cb94bfa -r 4fa1c13f8bb1 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Fri Nov 18 09:22:45 2011 +0100
+++ b/tools/libxl/libxl_create.c	Fri Nov 18 13:31:43 2011 +0000
@@ -188,6 +188,11 @@
         vments[3] = "hvm";
         vments[4] = "start_time";
         vments[5] = libxl__sprintf(gc, "%lu.%02d", start_time.tv_sec,(int)start_time.tv_usec/10000);
+
+        localents = libxl__calloc(gc, 3, sizeof(char *));
+        localents[0] = "platform/acpi";
+        localents[1] = (info->u.hvm.acpi) ? "1" : "0";
+
         break;
     case LIBXL_DOMAIN_TYPE_PV:
         ret = libxl__build_pv(gc, domid, info, state);
diff -r 7b5e1cb94bfa -r 4fa1c13f8bb1 tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c	Fri Nov 18 09:22:45 2011 +0100
+++ b/tools/libxl/libxl_dom.c	Fri Nov 18 13:31:43 2011 +0000
@@ -248,7 +248,6 @@
         return -1;
 
     va_hvm = (struct hvm_info_table *)(va_map + HVM_INFO_OFFSET);
-    va_hvm->acpi_enabled = info->u.hvm.acpi;
     va_hvm->apic_mode = info->u.hvm.apic;
     va_hvm->nr_vcpus = info->max_vcpus;
     memcpy(va_hvm->vcpu_online, &info->cur_vcpus, sizeof(info->cur_vcpus));
diff -r 7b5e1cb94bfa -r 4fa1c13f8bb1 tools/python/xen/lowlevel/xc/xc.c
--- a/tools/python/xen/lowlevel/xc/xc.c	Fri Nov 18 09:22:45 2011 +0100
+++ b/tools/python/xen/lowlevel/xc/xc.c	Fri Nov 18 13:31:43 2011 +0000
@@ -996,7 +996,6 @@
     if ( va_map == NULL )
         return PyErr_SetFromErrno(xc_error_obj);
     va_hvm = (struct hvm_info_table *)(va_map + HVM_INFO_OFFSET);
-    va_hvm->acpi_enabled = acpi;
     va_hvm->apic_mode    = apic;
     va_hvm->nr_vcpus     = vcpus;
     memcpy(va_hvm->vcpu_online, vcpu_avail, sizeof(vcpu_avail));
diff -r 7b5e1cb94bfa -r 4fa1c13f8bb1 xen/include/public/hvm/hvm_info_table.h
--- a/xen/include/public/hvm/hvm_info_table.h	Fri Nov 18 09:22:45 2011 +0100
+++ b/xen/include/public/hvm/hvm_info_table.h	Fri Nov 18 13:31:43 2011 +0000
@@ -37,9 +37,6 @@
     uint32_t    length;
     uint8_t     checksum;
 
-    /* Should firmware build ACPI tables? */
-    uint8_t     acpi_enabled;
-
     /* Should firmware build APIC descriptors (APIC MADT / MP BIOS)? */
     uint8_t     apic_mode;
 

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 09:44:28 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 09:44:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSmtu-0004qO-C4; Tue, 22 Nov 2011 09:44:26 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmtt-0004mq-6a
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1321955035!2513509!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30692 invoked from network); 22 Nov 2011 09:43:56 -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;
	22 Nov 2011 09:43:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmzX-0001NX-UE
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:50:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmte-0004mk-Oz
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:10 +0000
Message-Id: <E1RSmte-0004mk-Oz@xenbits.xen.org>
Date: Tue, 22 Nov 2011 09:44:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] vtd: Refactor iotlb flush code
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jean Guyader <jean.guyader@eu.citrix.com>
# Date 1321623619 0
# Node ID aeb628c5af3fa0e21b04ca27508f742ffa2050e4
# Parent  d7e6bfa114d05fc4da83a55d995fb031970a94d8
vtd: Refactor iotlb flush code

Factorize the iotlb flush code from map_page and unmap_page into
it's own function.

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r d7e6bfa114d0 -r aeb628c5af3f xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c	Fri Nov 18 13:34:43 2011 +0000
+++ b/xen/drivers/passthrough/vtd/iommu.c	Fri Nov 18 13:40:19 2011 +0000
@@ -581,16 +581,53 @@
     }
 }
 
+static void __intel_iommu_iotlb_flush(struct domain *d, unsigned long gfn,
+        int dma_old_pte_present, unsigned int page_count)
+{
+    struct hvm_iommu *hd = domain_hvm_iommu(d);
+    struct acpi_drhd_unit *drhd;
+    struct iommu *iommu;
+    int flush_dev_iotlb;
+    int iommu_domid;
+
+    /*
+     * No need pcideves_lock here because we have flush
+     * when assign/deassign device
+     */
+    for_each_drhd_unit ( drhd )
+    {
+        iommu = drhd->iommu;
+
+        if ( !test_bit(iommu->index, &hd->iommu_bitmap) )
+            continue;
+
+        flush_dev_iotlb = find_ats_dev_drhd(iommu) ? 1 : 0;
+        iommu_domid= domain_iommu_domid(d, iommu);
+        if ( iommu_domid == -1 )
+            continue;
+
+        if ( page_count > 1 || gfn == -1 )
+        {
+            if ( iommu_flush_iotlb_dsi(iommu, iommu_domid,
+                        0, flush_dev_iotlb) )
+                iommu_flush_write_buffer(iommu);
+        }
+        else
+        {
+            if ( iommu_flush_iotlb_psi(iommu, iommu_domid,
+                        (paddr_t)gfn << PAGE_SHIFT_4K, 0,
+                        !dma_old_pte_present, flush_dev_iotlb) )
+                iommu_flush_write_buffer(iommu);
+        }
+    }
+}
+
 /* clear one page's page table */
 static void dma_pte_clear_one(struct domain *domain, u64 addr)
 {
     struct hvm_iommu *hd = domain_hvm_iommu(domain);
-    struct acpi_drhd_unit *drhd;
-    struct iommu *iommu;
     struct dma_pte *page = NULL, *pte = NULL;
     u64 pg_maddr;
-    int flush_dev_iotlb;
-    int iommu_domid;
     struct mapped_rmrr *mrmrr;
 
     spin_lock(&hd->mapping_lock);
@@ -616,21 +653,7 @@
     spin_unlock(&hd->mapping_lock);
     iommu_flush_cache_entry(pte, sizeof(struct dma_pte));
 
-    /* No need pcidevs_lock here since do that on assign/deassign device*/
-    for_each_drhd_unit ( drhd )
-    {
-        iommu = drhd->iommu;
-        if ( test_bit(iommu->index, &hd->iommu_bitmap) )
-        {
-            flush_dev_iotlb = find_ats_dev_drhd(iommu) ? 1 : 0;
-            iommu_domid= domain_iommu_domid(domain, iommu);
-            if ( iommu_domid == -1 )
-                continue;
-            if ( iommu_flush_iotlb_psi(iommu, iommu_domid, addr,
-                                       0, 0, flush_dev_iotlb) )
-                iommu_flush_write_buffer(iommu);
-        }
-    }
+    __intel_iommu_iotlb_flush(domain, addr >> PAGE_SHIFT_4K , 0, 1);
 
     unmap_vtd_domain_page(page);
 
@@ -1684,12 +1707,8 @@
     unsigned int flags)
 {
     struct hvm_iommu *hd = domain_hvm_iommu(d);
-    struct acpi_drhd_unit *drhd;
-    struct iommu *iommu;
     struct dma_pte *page = NULL, *pte = NULL, old, new = { 0 };
     u64 pg_maddr;
-    int flush_dev_iotlb;
-    int iommu_domid;
 
     /* Do nothing if VT-d shares EPT page table */
     if ( iommu_use_hap_pt(d) )
@@ -1731,26 +1750,7 @@
     spin_unlock(&hd->mapping_lock);
     unmap_vtd_domain_page(page);
 
-    /*
-     * No need pcideves_lock here because we have flush
-     * when assign/deassign device
-     */
-    for_each_drhd_unit ( drhd )
-    {
-        iommu = drhd->iommu;
-
-        if ( !test_bit(iommu->index, &hd->iommu_bitmap) )
-            continue;
-
-        flush_dev_iotlb = find_ats_dev_drhd(iommu) ? 1 : 0;
-        iommu_domid= domain_iommu_domid(d, iommu);
-        if ( iommu_domid == -1 )
-            continue;
-        if ( iommu_flush_iotlb_psi(iommu, iommu_domid,
-                                   (paddr_t)gfn << PAGE_SHIFT_4K, 0,
-                                   !dma_pte_present(old), flush_dev_iotlb) )
-            iommu_flush_write_buffer(iommu);
-    }
+    __intel_iommu_iotlb_flush(d, gfn, dma_pte_present(old), 1);
 
     return 0;
 }

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 09:44:28 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 09:44:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSmtu-0004qO-C4; Tue, 22 Nov 2011 09:44:26 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmtt-0004mq-6a
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1321955035!2513509!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30692 invoked from network); 22 Nov 2011 09:43:56 -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;
	22 Nov 2011 09:43:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmzX-0001NX-UE
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:50:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmte-0004mk-Oz
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:10 +0000
Message-Id: <E1RSmte-0004mk-Oz@xenbits.xen.org>
Date: Tue, 22 Nov 2011 09:44:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] vtd: Refactor iotlb flush code
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jean Guyader <jean.guyader@eu.citrix.com>
# Date 1321623619 0
# Node ID aeb628c5af3fa0e21b04ca27508f742ffa2050e4
# Parent  d7e6bfa114d05fc4da83a55d995fb031970a94d8
vtd: Refactor iotlb flush code

Factorize the iotlb flush code from map_page and unmap_page into
it's own function.

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r d7e6bfa114d0 -r aeb628c5af3f xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c	Fri Nov 18 13:34:43 2011 +0000
+++ b/xen/drivers/passthrough/vtd/iommu.c	Fri Nov 18 13:40:19 2011 +0000
@@ -581,16 +581,53 @@
     }
 }
 
+static void __intel_iommu_iotlb_flush(struct domain *d, unsigned long gfn,
+        int dma_old_pte_present, unsigned int page_count)
+{
+    struct hvm_iommu *hd = domain_hvm_iommu(d);
+    struct acpi_drhd_unit *drhd;
+    struct iommu *iommu;
+    int flush_dev_iotlb;
+    int iommu_domid;
+
+    /*
+     * No need pcideves_lock here because we have flush
+     * when assign/deassign device
+     */
+    for_each_drhd_unit ( drhd )
+    {
+        iommu = drhd->iommu;
+
+        if ( !test_bit(iommu->index, &hd->iommu_bitmap) )
+            continue;
+
+        flush_dev_iotlb = find_ats_dev_drhd(iommu) ? 1 : 0;
+        iommu_domid= domain_iommu_domid(d, iommu);
+        if ( iommu_domid == -1 )
+            continue;
+
+        if ( page_count > 1 || gfn == -1 )
+        {
+            if ( iommu_flush_iotlb_dsi(iommu, iommu_domid,
+                        0, flush_dev_iotlb) )
+                iommu_flush_write_buffer(iommu);
+        }
+        else
+        {
+            if ( iommu_flush_iotlb_psi(iommu, iommu_domid,
+                        (paddr_t)gfn << PAGE_SHIFT_4K, 0,
+                        !dma_old_pte_present, flush_dev_iotlb) )
+                iommu_flush_write_buffer(iommu);
+        }
+    }
+}
+
 /* clear one page's page table */
 static void dma_pte_clear_one(struct domain *domain, u64 addr)
 {
     struct hvm_iommu *hd = domain_hvm_iommu(domain);
-    struct acpi_drhd_unit *drhd;
-    struct iommu *iommu;
     struct dma_pte *page = NULL, *pte = NULL;
     u64 pg_maddr;
-    int flush_dev_iotlb;
-    int iommu_domid;
     struct mapped_rmrr *mrmrr;
 
     spin_lock(&hd->mapping_lock);
@@ -616,21 +653,7 @@
     spin_unlock(&hd->mapping_lock);
     iommu_flush_cache_entry(pte, sizeof(struct dma_pte));
 
-    /* No need pcidevs_lock here since do that on assign/deassign device*/
-    for_each_drhd_unit ( drhd )
-    {
-        iommu = drhd->iommu;
-        if ( test_bit(iommu->index, &hd->iommu_bitmap) )
-        {
-            flush_dev_iotlb = find_ats_dev_drhd(iommu) ? 1 : 0;
-            iommu_domid= domain_iommu_domid(domain, iommu);
-            if ( iommu_domid == -1 )
-                continue;
-            if ( iommu_flush_iotlb_psi(iommu, iommu_domid, addr,
-                                       0, 0, flush_dev_iotlb) )
-                iommu_flush_write_buffer(iommu);
-        }
-    }
+    __intel_iommu_iotlb_flush(domain, addr >> PAGE_SHIFT_4K , 0, 1);
 
     unmap_vtd_domain_page(page);
 
@@ -1684,12 +1707,8 @@
     unsigned int flags)
 {
     struct hvm_iommu *hd = domain_hvm_iommu(d);
-    struct acpi_drhd_unit *drhd;
-    struct iommu *iommu;
     struct dma_pte *page = NULL, *pte = NULL, old, new = { 0 };
     u64 pg_maddr;
-    int flush_dev_iotlb;
-    int iommu_domid;
 
     /* Do nothing if VT-d shares EPT page table */
     if ( iommu_use_hap_pt(d) )
@@ -1731,26 +1750,7 @@
     spin_unlock(&hd->mapping_lock);
     unmap_vtd_domain_page(page);
 
-    /*
-     * No need pcideves_lock here because we have flush
-     * when assign/deassign device
-     */
-    for_each_drhd_unit ( drhd )
-    {
-        iommu = drhd->iommu;
-
-        if ( !test_bit(iommu->index, &hd->iommu_bitmap) )
-            continue;
-
-        flush_dev_iotlb = find_ats_dev_drhd(iommu) ? 1 : 0;
-        iommu_domid= domain_iommu_domid(d, iommu);
-        if ( iommu_domid == -1 )
-            continue;
-        if ( iommu_flush_iotlb_psi(iommu, iommu_domid,
-                                   (paddr_t)gfn << PAGE_SHIFT_4K, 0,
-                                   !dma_pte_present(old), flush_dev_iotlb) )
-            iommu_flush_write_buffer(iommu);
-    }
+    __intel_iommu_iotlb_flush(d, gfn, dma_pte_present(old), 1);
 
     return 0;
 }

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 09:44:28 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 09:44:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSmtt-0004ou-92; Tue, 22 Nov 2011 09:44:25 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmts-0004mY-1z
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-182.messagelabs.com!1321955033!4092072!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27823 invoked from network); 22 Nov 2011 09:43:54 -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;
	22 Nov 2011 09:43:54 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmzV-0001NL-Qi
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:50:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmtc-0004lm-MN
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:08 +0000
Message-Id: <E1RSmtc-0004lm-MN@xenbits.xen.org>
Date: Tue, 22 Nov 2011 09:44:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/xsave: provide guests with
	finit-like environment
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1321604565 -3600
# Node ID 7b5e1cb94bfa43a9268479b9a255fb88c07e4ce2
# Parent  f29b5bd6e25fd78409baa5461914c67065f7579f
x86/xsave: provide guests with finit-like environment

Without the use of xsave, guests get their initial floating point
environment set up with finit. At least NetWare actually depends on
this (in particular on all exceptions being masked), so to be
consistent set the same environment also when using xsave. This is
also in line with all SSE exceptions getting masked initially.

To avoid further fragile casts in xstate_alloc_save_area() the patch
also changes xsave_struct's fpu_see member to have actually usable
fields.

The patch was tested in its technically identical, but modified-file-
wise different 4.1.2 version.

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


diff -r f29b5bd6e25f -r 7b5e1cb94bfa xen/arch/x86/i387.c
--- a/xen/arch/x86/i387.c	Fri Nov 18 09:21:24 2011 +0100
+++ b/xen/arch/x86/i387.c	Fri Nov 18 09:22:45 2011 +0100
@@ -17,7 +17,6 @@
 #include <asm/xstate.h>
 #include <asm/asm_defns.h>
 
-#define MXCSR_DEFAULT 0x1f80
 static void fpu_init(void)
 {
     unsigned long val;
diff -r f29b5bd6e25f -r 7b5e1cb94bfa xen/arch/x86/xstate.c
--- a/xen/arch/x86/xstate.c	Fri Nov 18 09:21:24 2011 +0100
+++ b/xen/arch/x86/xstate.c	Fri Nov 18 09:22:45 2011 +0100
@@ -97,7 +97,7 @@
 
 int xstate_alloc_save_area(struct vcpu *v)
 {
-    void *save_area;
+    struct xsave_struct *save_area;
 
     if ( !cpu_has_xsave || is_idle_vcpu(v) )
         return 0;
@@ -109,8 +109,9 @@
     if ( save_area == NULL )
         return -ENOMEM;
 
-    ((u32 *)save_area)[6] = 0x1f80;  /* MXCSR */
-    *(uint64_t *)(save_area + 512) = XSTATE_FP_SSE;  /* XSETBV */
+    save_area->fpu_sse.fcw = FCW_DEFAULT;
+    save_area->fpu_sse.mxcsr = MXCSR_DEFAULT;
+    save_area->xsave_hdr.xstate_bv = XSTATE_FP_SSE;
 
     v->arch.xsave_area = save_area;
     v->arch.xcr0 = XSTATE_FP_SSE;
diff -r f29b5bd6e25f -r 7b5e1cb94bfa xen/include/asm-x86/xstate.h
--- a/xen/include/asm-x86/xstate.h	Fri Nov 18 09:21:24 2011 +0100
+++ b/xen/include/asm-x86/xstate.h	Fri Nov 18 09:22:45 2011 +0100
@@ -11,6 +11,9 @@
 #include <xen/types.h>
 #include <xen/percpu.h>
 
+#define FCW_DEFAULT               0x037f
+#define MXCSR_DEFAULT             0x1f80
+
 #define XSTATE_CPUID              0x0000000d
 #define XSTATE_FEATURE_XSAVEOPT   (1 << 0)    /* sub-leaf 1, eax[bit 0] */
 
@@ -46,7 +49,29 @@
 /* extended state save area */
 struct xsave_struct
 {
-    struct { char x[512]; } fpu_sse;         /* FPU/MMX, SSE */
+    union {                                  /* FPU/MMX, SSE */
+        char x[512];
+        struct {
+            uint16_t fcw;
+            uint16_t fsw;
+            uint8_t ftw;
+            uint8_t rsvd1;
+            uint16_t fop;
+            union {
+#ifdef __x86_64__
+                uint64_t addr;
+#endif
+                struct {
+                    uint32_t offs;
+                    uint16_t sel;
+                    uint16_t rsvd;
+                };
+            } fip, fdp;
+            uint32_t mxcsr;
+            uint32_t mxcsr_mask;
+            /* data registers follow here */
+        };
+    } fpu_sse;
 
     struct {
         u64 xstate_bv;

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 09:44:28 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 09:44:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSmtt-0004ou-92; Tue, 22 Nov 2011 09:44:25 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmts-0004mY-1z
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-182.messagelabs.com!1321955033!4092072!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27823 invoked from network); 22 Nov 2011 09:43:54 -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;
	22 Nov 2011 09:43:54 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmzV-0001NL-Qi
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:50:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmtc-0004lm-MN
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:08 +0000
Message-Id: <E1RSmtc-0004lm-MN@xenbits.xen.org>
Date: Tue, 22 Nov 2011 09:44:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/xsave: provide guests with
	finit-like environment
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1321604565 -3600
# Node ID 7b5e1cb94bfa43a9268479b9a255fb88c07e4ce2
# Parent  f29b5bd6e25fd78409baa5461914c67065f7579f
x86/xsave: provide guests with finit-like environment

Without the use of xsave, guests get their initial floating point
environment set up with finit. At least NetWare actually depends on
this (in particular on all exceptions being masked), so to be
consistent set the same environment also when using xsave. This is
also in line with all SSE exceptions getting masked initially.

To avoid further fragile casts in xstate_alloc_save_area() the patch
also changes xsave_struct's fpu_see member to have actually usable
fields.

The patch was tested in its technically identical, but modified-file-
wise different 4.1.2 version.

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


diff -r f29b5bd6e25f -r 7b5e1cb94bfa xen/arch/x86/i387.c
--- a/xen/arch/x86/i387.c	Fri Nov 18 09:21:24 2011 +0100
+++ b/xen/arch/x86/i387.c	Fri Nov 18 09:22:45 2011 +0100
@@ -17,7 +17,6 @@
 #include <asm/xstate.h>
 #include <asm/asm_defns.h>
 
-#define MXCSR_DEFAULT 0x1f80
 static void fpu_init(void)
 {
     unsigned long val;
diff -r f29b5bd6e25f -r 7b5e1cb94bfa xen/arch/x86/xstate.c
--- a/xen/arch/x86/xstate.c	Fri Nov 18 09:21:24 2011 +0100
+++ b/xen/arch/x86/xstate.c	Fri Nov 18 09:22:45 2011 +0100
@@ -97,7 +97,7 @@
 
 int xstate_alloc_save_area(struct vcpu *v)
 {
-    void *save_area;
+    struct xsave_struct *save_area;
 
     if ( !cpu_has_xsave || is_idle_vcpu(v) )
         return 0;
@@ -109,8 +109,9 @@
     if ( save_area == NULL )
         return -ENOMEM;
 
-    ((u32 *)save_area)[6] = 0x1f80;  /* MXCSR */
-    *(uint64_t *)(save_area + 512) = XSTATE_FP_SSE;  /* XSETBV */
+    save_area->fpu_sse.fcw = FCW_DEFAULT;
+    save_area->fpu_sse.mxcsr = MXCSR_DEFAULT;
+    save_area->xsave_hdr.xstate_bv = XSTATE_FP_SSE;
 
     v->arch.xsave_area = save_area;
     v->arch.xcr0 = XSTATE_FP_SSE;
diff -r f29b5bd6e25f -r 7b5e1cb94bfa xen/include/asm-x86/xstate.h
--- a/xen/include/asm-x86/xstate.h	Fri Nov 18 09:21:24 2011 +0100
+++ b/xen/include/asm-x86/xstate.h	Fri Nov 18 09:22:45 2011 +0100
@@ -11,6 +11,9 @@
 #include <xen/types.h>
 #include <xen/percpu.h>
 
+#define FCW_DEFAULT               0x037f
+#define MXCSR_DEFAULT             0x1f80
+
 #define XSTATE_CPUID              0x0000000d
 #define XSTATE_FEATURE_XSAVEOPT   (1 << 0)    /* sub-leaf 1, eax[bit 0] */
 
@@ -46,7 +49,29 @@
 /* extended state save area */
 struct xsave_struct
 {
-    struct { char x[512]; } fpu_sse;         /* FPU/MMX, SSE */
+    union {                                  /* FPU/MMX, SSE */
+        char x[512];
+        struct {
+            uint16_t fcw;
+            uint16_t fsw;
+            uint8_t ftw;
+            uint8_t rsvd1;
+            uint16_t fop;
+            union {
+#ifdef __x86_64__
+                uint64_t addr;
+#endif
+                struct {
+                    uint32_t offs;
+                    uint16_t sel;
+                    uint16_t rsvd;
+                };
+            } fip, fdp;
+            uint32_t mxcsr;
+            uint32_t mxcsr_mask;
+            /* data registers follow here */
+        };
+    } fpu_sse;
 
     struct {
         u64 xstate_bv;

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 09:44:30 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 09:44:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSmtw-0004s4-Mg; Tue, 22 Nov 2011 09:44:28 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmtv-0004nU-HB
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-21.messagelabs.com!1321955037!5122506!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6496 invoked from network); 22 Nov 2011 09:43:58 -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;
	22 Nov 2011 09:43:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmza-0001Nm-FO
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:50:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmth-0004nx-B7
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:13 +0000
Message-Id: <E1RSmth-0004nx-B7@xenbits.xen.org>
Date: Tue, 22 Nov 2011 09:44:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] iommu: Introduce per cpu flag
	(iommu_dont_flush_iotlb) to avoid unnecessary iotlb flush
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jean Guyader <jean.guyader@eu.citrix.com>
# Date 1321623806 0
# Node ID fe3e9d0c123cc3184b6e29531e326927a0e4938d
# Parent  89a4d97731c58db2790f63dd687edc537e7ce2b8
iommu: Introduce per cpu flag (iommu_dont_flush_iotlb) to avoid unnecessary iotlb flush

Add cpu flag that will be checked by the iommu low level code
to skip iotlb flushes. iommu_iotlb_flush shall be called explicitly.

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 89a4d97731c5 -r fe3e9d0c123c xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Fri Nov 18 13:42:46 2011 +0000
+++ b/xen/arch/x86/mm.c	Fri Nov 18 13:43:26 2011 +0000
@@ -4794,10 +4794,15 @@
 static int xenmem_add_to_physmap(struct domain *d,
                                  struct xen_add_to_physmap *xatp)
 {
+    struct xen_add_to_physmap start_xatp;
     int rc = 0;
 
     if ( xatp->space == XENMAPSPACE_gmfn_range )
     {
+        if ( need_iommu(d) )
+            this_cpu(iommu_dont_flush_iotlb) = 1;
+
+        start_xatp = *xatp;
         while ( xatp->size > 0 )
         {
             rc = xenmem_add_to_physmap_once(d, xatp);
@@ -4816,6 +4821,13 @@
             }
         }
 
+        if ( need_iommu(d) )
+        {
+            this_cpu(iommu_dont_flush_iotlb) = 0;
+            iommu_iotlb_flush(d, start_xatp.idx, start_xatp.size - xatp->size);
+            iommu_iotlb_flush(d, start_xatp.gpfn, start_xatp.size - xatp->size);
+        }
+
         return rc;
     }
 
diff -r 89a4d97731c5 -r fe3e9d0c123c xen/drivers/passthrough/iommu.c
--- a/xen/drivers/passthrough/iommu.c	Fri Nov 18 13:42:46 2011 +0000
+++ b/xen/drivers/passthrough/iommu.c	Fri Nov 18 13:43:26 2011 +0000
@@ -52,6 +52,8 @@
 bool_t __read_mostly iommu_debug;
 bool_t __read_mostly amd_iommu_perdev_intremap;
 
+DEFINE_PER_CPU(bool_t, iommu_dont_flush_iotlb);
+
 static void __init parse_iommu_param(char *s)
 {
     char *ss;
@@ -227,6 +229,7 @@
 
     spin_lock(&d->page_alloc_lock);
 
+    this_cpu(iommu_dont_flush_iotlb) = 1;
     page_list_for_each ( page, &d->page_list )
     {
         if ( is_hvm_domain(d) ||
@@ -244,6 +247,8 @@
             }
         }
     }
+    this_cpu(iommu_dont_flush_iotlb) = 0;
+    iommu_iotlb_flush_all(d);
     spin_unlock(&d->page_alloc_lock);
     return 0;
 }
diff -r 89a4d97731c5 -r fe3e9d0c123c xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c	Fri Nov 18 13:42:46 2011 +0000
+++ b/xen/drivers/passthrough/vtd/iommu.c	Fri Nov 18 13:43:26 2011 +0000
@@ -663,7 +663,8 @@
     spin_unlock(&hd->mapping_lock);
     iommu_flush_cache_entry(pte, sizeof(struct dma_pte));
 
-    __intel_iommu_iotlb_flush(domain, addr >> PAGE_SHIFT_4K , 0, 1);
+    if ( !this_cpu(iommu_dont_flush_iotlb) )
+        __intel_iommu_iotlb_flush(domain, addr >> PAGE_SHIFT_4K , 0, 1);
 
     unmap_vtd_domain_page(page);
 
@@ -1760,7 +1761,8 @@
     spin_unlock(&hd->mapping_lock);
     unmap_vtd_domain_page(page);
 
-    __intel_iommu_iotlb_flush(d, gfn, dma_pte_present(old), 1);
+    if ( !this_cpu(iommu_dont_flush_iotlb) )
+        __intel_iommu_iotlb_flush(d, gfn, dma_pte_present(old), 1);
 
     return 0;
 }
diff -r 89a4d97731c5 -r fe3e9d0c123c xen/include/xen/iommu.h
--- a/xen/include/xen/iommu.h	Fri Nov 18 13:42:46 2011 +0000
+++ b/xen/include/xen/iommu.h	Fri Nov 18 13:43:26 2011 +0000
@@ -164,4 +164,16 @@
 void iommu_iotlb_flush(struct domain *d, unsigned long gfn, unsigned int page_count);
 void iommu_iotlb_flush_all(struct domain *d);
 
+/*
+ * The purpose of the iommu_dont_flush_iotlb optional cpu flag is to
+ * avoid unecessary iotlb_flush in the low level IOMMU code.
+ *
+ * iommu_map_page/iommu_unmap_page must flush the iotlb but somethimes
+ * this operation can be really expensive. This flag will be set by the
+ * caller to notify the low level IOMMU code to avoid the iotlb flushes.
+ * iommu_iotlb_flush/iommu_iotlb_flush_all will be explicitly called by
+ * the caller.
+ */
+DECLARE_PER_CPU(bool_t, iommu_dont_flush_iotlb);
+
 #endif /* _IOMMU_H_ */

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 09:44:30 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 09:44:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSmtw-0004s4-Mg; Tue, 22 Nov 2011 09:44:28 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmtv-0004nU-HB
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-21.messagelabs.com!1321955037!5122506!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6496 invoked from network); 22 Nov 2011 09:43:58 -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;
	22 Nov 2011 09:43:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmza-0001Nm-FO
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:50:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmth-0004nx-B7
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:13 +0000
Message-Id: <E1RSmth-0004nx-B7@xenbits.xen.org>
Date: Tue, 22 Nov 2011 09:44:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] iommu: Introduce per cpu flag
	(iommu_dont_flush_iotlb) to avoid unnecessary iotlb flush
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jean Guyader <jean.guyader@eu.citrix.com>
# Date 1321623806 0
# Node ID fe3e9d0c123cc3184b6e29531e326927a0e4938d
# Parent  89a4d97731c58db2790f63dd687edc537e7ce2b8
iommu: Introduce per cpu flag (iommu_dont_flush_iotlb) to avoid unnecessary iotlb flush

Add cpu flag that will be checked by the iommu low level code
to skip iotlb flushes. iommu_iotlb_flush shall be called explicitly.

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 89a4d97731c5 -r fe3e9d0c123c xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Fri Nov 18 13:42:46 2011 +0000
+++ b/xen/arch/x86/mm.c	Fri Nov 18 13:43:26 2011 +0000
@@ -4794,10 +4794,15 @@
 static int xenmem_add_to_physmap(struct domain *d,
                                  struct xen_add_to_physmap *xatp)
 {
+    struct xen_add_to_physmap start_xatp;
     int rc = 0;
 
     if ( xatp->space == XENMAPSPACE_gmfn_range )
     {
+        if ( need_iommu(d) )
+            this_cpu(iommu_dont_flush_iotlb) = 1;
+
+        start_xatp = *xatp;
         while ( xatp->size > 0 )
         {
             rc = xenmem_add_to_physmap_once(d, xatp);
@@ -4816,6 +4821,13 @@
             }
         }
 
+        if ( need_iommu(d) )
+        {
+            this_cpu(iommu_dont_flush_iotlb) = 0;
+            iommu_iotlb_flush(d, start_xatp.idx, start_xatp.size - xatp->size);
+            iommu_iotlb_flush(d, start_xatp.gpfn, start_xatp.size - xatp->size);
+        }
+
         return rc;
     }
 
diff -r 89a4d97731c5 -r fe3e9d0c123c xen/drivers/passthrough/iommu.c
--- a/xen/drivers/passthrough/iommu.c	Fri Nov 18 13:42:46 2011 +0000
+++ b/xen/drivers/passthrough/iommu.c	Fri Nov 18 13:43:26 2011 +0000
@@ -52,6 +52,8 @@
 bool_t __read_mostly iommu_debug;
 bool_t __read_mostly amd_iommu_perdev_intremap;
 
+DEFINE_PER_CPU(bool_t, iommu_dont_flush_iotlb);
+
 static void __init parse_iommu_param(char *s)
 {
     char *ss;
@@ -227,6 +229,7 @@
 
     spin_lock(&d->page_alloc_lock);
 
+    this_cpu(iommu_dont_flush_iotlb) = 1;
     page_list_for_each ( page, &d->page_list )
     {
         if ( is_hvm_domain(d) ||
@@ -244,6 +247,8 @@
             }
         }
     }
+    this_cpu(iommu_dont_flush_iotlb) = 0;
+    iommu_iotlb_flush_all(d);
     spin_unlock(&d->page_alloc_lock);
     return 0;
 }
diff -r 89a4d97731c5 -r fe3e9d0c123c xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c	Fri Nov 18 13:42:46 2011 +0000
+++ b/xen/drivers/passthrough/vtd/iommu.c	Fri Nov 18 13:43:26 2011 +0000
@@ -663,7 +663,8 @@
     spin_unlock(&hd->mapping_lock);
     iommu_flush_cache_entry(pte, sizeof(struct dma_pte));
 
-    __intel_iommu_iotlb_flush(domain, addr >> PAGE_SHIFT_4K , 0, 1);
+    if ( !this_cpu(iommu_dont_flush_iotlb) )
+        __intel_iommu_iotlb_flush(domain, addr >> PAGE_SHIFT_4K , 0, 1);
 
     unmap_vtd_domain_page(page);
 
@@ -1760,7 +1761,8 @@
     spin_unlock(&hd->mapping_lock);
     unmap_vtd_domain_page(page);
 
-    __intel_iommu_iotlb_flush(d, gfn, dma_pte_present(old), 1);
+    if ( !this_cpu(iommu_dont_flush_iotlb) )
+        __intel_iommu_iotlb_flush(d, gfn, dma_pte_present(old), 1);
 
     return 0;
 }
diff -r 89a4d97731c5 -r fe3e9d0c123c xen/include/xen/iommu.h
--- a/xen/include/xen/iommu.h	Fri Nov 18 13:42:46 2011 +0000
+++ b/xen/include/xen/iommu.h	Fri Nov 18 13:43:26 2011 +0000
@@ -164,4 +164,16 @@
 void iommu_iotlb_flush(struct domain *d, unsigned long gfn, unsigned int page_count);
 void iommu_iotlb_flush_all(struct domain *d);
 
+/*
+ * The purpose of the iommu_dont_flush_iotlb optional cpu flag is to
+ * avoid unecessary iotlb_flush in the low level IOMMU code.
+ *
+ * iommu_map_page/iommu_unmap_page must flush the iotlb but somethimes
+ * this operation can be really expensive. This flag will be set by the
+ * caller to notify the low level IOMMU code to avoid the iotlb flushes.
+ * iommu_iotlb_flush/iommu_iotlb_flush_all will be explicitly called by
+ * the caller.
+ */
+DECLARE_PER_CPU(bool_t, iommu_dont_flush_iotlb);
+
 #endif /* _IOMMU_H_ */

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 09:44:30 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 09:44:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSmtv-0004r6-K0; Tue, 22 Nov 2011 09:44:27 +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 1RSmtt-0004mw-Uv
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:26 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-27.messagelabs.com!1321955003!44876135!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28727 invoked from network); 22 Nov 2011 09:43:24 -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;
	22 Nov 2011 09:43:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmzZ-0001Ng-F2
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:50:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmtg-0004nT-AO
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:12 +0000
Message-Id: <E1RSmtg-0004nT-AO@xenbits.xen.org>
Date: Tue, 22 Nov 2011 09:44:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] mm: New XENMEM space,
	XENMAPSPACE_gmfn_range
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jean Guyader <jean.guyader@eu.citrix.com>
# Date 1321623728 0
# Node ID 707d27fe03e7e3b331d804c4743ae7534a9c3043
# Parent  7a9a1261a6b01b31b68d4d00e35beab09fe6d20b
mm: New XENMEM space, XENMAPSPACE_gmfn_range

XENMAPSPACE_gmfn_range is like XENMAPSPACE_gmfn but it runs on
a range of pages. The size of the range is defined in a new field.

This new field .size is located in the 16 bits padding between .domid
and .space in struct xen_add_to_physmap to stay compatible with older
versions.

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 7a9a1261a6b0 -r 707d27fe03e7 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Fri Nov 18 13:41:33 2011 +0000
+++ b/xen/arch/x86/mm.c	Fri Nov 18 13:42:08 2011 +0000
@@ -4677,8 +4677,8 @@
     return 0;
 }
 
-static int xenmem_add_to_physmap(struct domain *d,
-                                 const struct xen_add_to_physmap *xatp)
+static int xenmem_add_to_physmap_once(struct domain *d,
+                                      const struct xen_add_to_physmap *xatp)
 {
     struct page_info *page = NULL;
     unsigned long gfn = 0; /* gcc ... */
@@ -4717,6 +4717,7 @@
 
             spin_unlock(&d->grant_table->lock);
             break;
+        case XENMAPSPACE_gmfn_range:
         case XENMAPSPACE_gmfn:
         {
             p2m_type_t p2mt;
@@ -4744,7 +4745,8 @@
     {
         if ( page )
             put_page(page);
-        if ( xatp->space == XENMAPSPACE_gmfn )
+        if ( xatp->space == XENMAPSPACE_gmfn ||
+             xatp->space == XENMAPSPACE_gmfn_range )
             put_gfn(d, gfn);
         rcu_unlock_domain(d);
         return -EINVAL;
@@ -4779,7 +4781,8 @@
     rc = guest_physmap_add_page(d, xatp->gpfn, mfn, PAGE_ORDER_4K);
 
     /* In the XENMAPSPACE_gmfn, we took a ref and locked the p2m at the top */
-    if ( xatp->space == XENMAPSPACE_gmfn )
+    if ( xatp->space == XENMAPSPACE_gmfn ||
+         xatp->space == XENMAPSPACE_gmfn_range )
         put_gfn(d, gfn);
     domain_unlock(d);
 
@@ -4788,6 +4791,37 @@
     return rc;
 }
 
+static int xenmem_add_to_physmap(struct domain *d,
+                                 struct xen_add_to_physmap *xatp)
+{
+    int rc = 0;
+
+    if ( xatp->space == XENMAPSPACE_gmfn_range )
+    {
+        while ( xatp->size > 0 )
+        {
+            rc = xenmem_add_to_physmap_once(d, xatp);
+            if ( rc < 0 )
+                return rc;
+
+            xatp->idx++;
+            xatp->gpfn++;
+            xatp->size--;
+
+            /* Check for continuation if it's not the last interation */
+            if ( xatp->size > 0 && hypercall_preempt_check() )
+            {
+                rc = -EAGAIN;
+                break;
+            }
+        }
+
+        return rc;
+    }
+
+    return xenmem_add_to_physmap_once(d, xatp);
+}
+
 long arch_memory_op(int op, XEN_GUEST_HANDLE(void) arg)
 {
     int rc;
@@ -4816,6 +4850,19 @@
 
         rcu_unlock_domain(d);
 
+        if ( xatp.space == XENMAPSPACE_gmfn_range )
+        {
+            if ( rc )
+            {
+                if ( copy_to_guest(arg, &xatp, 1) )
+                    return -EFAULT;
+            }
+
+            if ( rc == -EAGAIN )
+                rc = hypercall_create_continuation(
+                        __HYPERVISOR_memory_op, "ih", op, arg);
+        }
+
         return rc;
     }
 
diff -r 7a9a1261a6b0 -r 707d27fe03e7 xen/arch/x86/x86_64/compat/mm.c
--- a/xen/arch/x86/x86_64/compat/mm.c	Fri Nov 18 13:41:33 2011 +0000
+++ b/xen/arch/x86/x86_64/compat/mm.c	Fri Nov 18 13:42:08 2011 +0000
@@ -64,6 +64,21 @@
         XLAT_add_to_physmap(nat, &cmp);
         rc = arch_memory_op(op, guest_handle_from_ptr(nat, void));
 
+        if ( cmp.space == XENMAPSPACE_gmfn_range )
+        {
+            if ( rc )
+            {
+                XLAT_add_to_physmap(&cmp, nat);
+                if ( copy_to_guest(arg, &cmp, 1) )
+                {
+                    hypercall_cancel_continuation();
+                    return -EFAULT;
+                }
+            }
+            if ( rc == __HYPERVISOR_memory_op )
+                hypercall_xlat_continuation(NULL, 0x2, nat, arg);
+        }
+
         break;
     }
 
diff -r 7a9a1261a6b0 -r 707d27fe03e7 xen/include/public/memory.h
--- a/xen/include/public/memory.h	Fri Nov 18 13:41:33 2011 +0000
+++ b/xen/include/public/memory.h	Fri Nov 18 13:42:08 2011 +0000
@@ -208,10 +208,14 @@
     /* Which domain to change the mapping for. */
     domid_t domid;
 
+    /* Number of pages to go through for gmfn_range */
+    uint16_t    size;
+
     /* Source mapping space. */
 #define XENMAPSPACE_shared_info 0 /* shared info page */
 #define XENMAPSPACE_grant_table 1 /* grant table page */
 #define XENMAPSPACE_gmfn        2 /* GMFN */
+#define XENMAPSPACE_gmfn_range  3 /* GMFN range */
     unsigned int space;
 
 #define XENMAPIDX_grant_table_status 0x80000000

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 09:44:30 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 09:44:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSmtv-0004r6-K0; Tue, 22 Nov 2011 09:44:27 +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 1RSmtt-0004mw-Uv
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:26 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-27.messagelabs.com!1321955003!44876135!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28727 invoked from network); 22 Nov 2011 09:43:24 -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;
	22 Nov 2011 09:43:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmzZ-0001Ng-F2
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:50:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmtg-0004nT-AO
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:12 +0000
Message-Id: <E1RSmtg-0004nT-AO@xenbits.xen.org>
Date: Tue, 22 Nov 2011 09:44:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] mm: New XENMEM space,
	XENMAPSPACE_gmfn_range
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jean Guyader <jean.guyader@eu.citrix.com>
# Date 1321623728 0
# Node ID 707d27fe03e7e3b331d804c4743ae7534a9c3043
# Parent  7a9a1261a6b01b31b68d4d00e35beab09fe6d20b
mm: New XENMEM space, XENMAPSPACE_gmfn_range

XENMAPSPACE_gmfn_range is like XENMAPSPACE_gmfn but it runs on
a range of pages. The size of the range is defined in a new field.

This new field .size is located in the 16 bits padding between .domid
and .space in struct xen_add_to_physmap to stay compatible with older
versions.

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 7a9a1261a6b0 -r 707d27fe03e7 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Fri Nov 18 13:41:33 2011 +0000
+++ b/xen/arch/x86/mm.c	Fri Nov 18 13:42:08 2011 +0000
@@ -4677,8 +4677,8 @@
     return 0;
 }
 
-static int xenmem_add_to_physmap(struct domain *d,
-                                 const struct xen_add_to_physmap *xatp)
+static int xenmem_add_to_physmap_once(struct domain *d,
+                                      const struct xen_add_to_physmap *xatp)
 {
     struct page_info *page = NULL;
     unsigned long gfn = 0; /* gcc ... */
@@ -4717,6 +4717,7 @@
 
             spin_unlock(&d->grant_table->lock);
             break;
+        case XENMAPSPACE_gmfn_range:
         case XENMAPSPACE_gmfn:
         {
             p2m_type_t p2mt;
@@ -4744,7 +4745,8 @@
     {
         if ( page )
             put_page(page);
-        if ( xatp->space == XENMAPSPACE_gmfn )
+        if ( xatp->space == XENMAPSPACE_gmfn ||
+             xatp->space == XENMAPSPACE_gmfn_range )
             put_gfn(d, gfn);
         rcu_unlock_domain(d);
         return -EINVAL;
@@ -4779,7 +4781,8 @@
     rc = guest_physmap_add_page(d, xatp->gpfn, mfn, PAGE_ORDER_4K);
 
     /* In the XENMAPSPACE_gmfn, we took a ref and locked the p2m at the top */
-    if ( xatp->space == XENMAPSPACE_gmfn )
+    if ( xatp->space == XENMAPSPACE_gmfn ||
+         xatp->space == XENMAPSPACE_gmfn_range )
         put_gfn(d, gfn);
     domain_unlock(d);
 
@@ -4788,6 +4791,37 @@
     return rc;
 }
 
+static int xenmem_add_to_physmap(struct domain *d,
+                                 struct xen_add_to_physmap *xatp)
+{
+    int rc = 0;
+
+    if ( xatp->space == XENMAPSPACE_gmfn_range )
+    {
+        while ( xatp->size > 0 )
+        {
+            rc = xenmem_add_to_physmap_once(d, xatp);
+            if ( rc < 0 )
+                return rc;
+
+            xatp->idx++;
+            xatp->gpfn++;
+            xatp->size--;
+
+            /* Check for continuation if it's not the last interation */
+            if ( xatp->size > 0 && hypercall_preempt_check() )
+            {
+                rc = -EAGAIN;
+                break;
+            }
+        }
+
+        return rc;
+    }
+
+    return xenmem_add_to_physmap_once(d, xatp);
+}
+
 long arch_memory_op(int op, XEN_GUEST_HANDLE(void) arg)
 {
     int rc;
@@ -4816,6 +4850,19 @@
 
         rcu_unlock_domain(d);
 
+        if ( xatp.space == XENMAPSPACE_gmfn_range )
+        {
+            if ( rc )
+            {
+                if ( copy_to_guest(arg, &xatp, 1) )
+                    return -EFAULT;
+            }
+
+            if ( rc == -EAGAIN )
+                rc = hypercall_create_continuation(
+                        __HYPERVISOR_memory_op, "ih", op, arg);
+        }
+
         return rc;
     }
 
diff -r 7a9a1261a6b0 -r 707d27fe03e7 xen/arch/x86/x86_64/compat/mm.c
--- a/xen/arch/x86/x86_64/compat/mm.c	Fri Nov 18 13:41:33 2011 +0000
+++ b/xen/arch/x86/x86_64/compat/mm.c	Fri Nov 18 13:42:08 2011 +0000
@@ -64,6 +64,21 @@
         XLAT_add_to_physmap(nat, &cmp);
         rc = arch_memory_op(op, guest_handle_from_ptr(nat, void));
 
+        if ( cmp.space == XENMAPSPACE_gmfn_range )
+        {
+            if ( rc )
+            {
+                XLAT_add_to_physmap(&cmp, nat);
+                if ( copy_to_guest(arg, &cmp, 1) )
+                {
+                    hypercall_cancel_continuation();
+                    return -EFAULT;
+                }
+            }
+            if ( rc == __HYPERVISOR_memory_op )
+                hypercall_xlat_continuation(NULL, 0x2, nat, arg);
+        }
+
         break;
     }
 
diff -r 7a9a1261a6b0 -r 707d27fe03e7 xen/include/public/memory.h
--- a/xen/include/public/memory.h	Fri Nov 18 13:41:33 2011 +0000
+++ b/xen/include/public/memory.h	Fri Nov 18 13:42:08 2011 +0000
@@ -208,10 +208,14 @@
     /* Which domain to change the mapping for. */
     domid_t domid;
 
+    /* Number of pages to go through for gmfn_range */
+    uint16_t    size;
+
     /* Source mapping space. */
 #define XENMAPSPACE_shared_info 0 /* shared info page */
 #define XENMAPSPACE_grant_table 1 /* grant table page */
 #define XENMAPSPACE_gmfn        2 /* GMFN */
+#define XENMAPSPACE_gmfn_range  3 /* GMFN range */
     unsigned int space;
 
 #define XENMAPIDX_grant_table_status 0x80000000

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 09:44:30 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 09:44:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSmtx-0004t1-SN; Tue, 22 Nov 2011 09:44:29 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmtw-0004nj-HQ
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-216.messagelabs.com!1321955039!4495408!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9640 invoked from network); 22 Nov 2011 09:44:00 -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;
	22 Nov 2011 09:44:00 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmzb-0001Nv-V7
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:50:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmti-0004og-Qo
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:14 +0000
Message-Id: <E1RSmti-0004og-Qo@xenbits.xen.org>
Date: Tue, 22 Nov 2011 09:44:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hvmloader: Fix memory relocation
	loop.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1321910914 0
# Node ID 0a0c02a616768bfab16c072788cb76be1893c37f
# Parent  9c350ab8d3ea64866421de756ab2bf3daaf63187
hvmloader: Fix memory relocation loop.

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


diff -r 9c350ab8d3ea -r 0a0c02a61676 tools/firmware/hvmloader/pci.c
--- a/tools/firmware/hvmloader/pci.c	Mon Nov 21 09:29:31 2011 +0100
+++ b/tools/firmware/hvmloader/pci.c	Mon Nov 21 21:28:34 2011 +0000
@@ -50,7 +50,6 @@
         uint32_t devfn, bar_reg, bar_sz;
     } *bars = (struct bars *)scratch_start;
     unsigned int i, nr_bars = 0;
-    unsigned long pci_mem_reloc_pg;
 
     /* Program PCI-ISA bridge with appropriate link routes. */
     isa_irq = 0;
@@ -186,25 +185,26 @@
             ((pci_mem_start << 1) != 0) )
         pci_mem_start <<= 1;
 
-    /* Relocate RAM that overlaps (in 64K chunks) */
-    pci_mem_reloc_pg = (pci_mem_start >> PAGE_SHIFT);
-    while (pci_mem_reloc_pg < hvm_info->low_mem_pgend)
+    /* Relocate RAM that overlaps PCI space (in 64k-page chunks). */
+    while ( (pci_mem_start >> PAGE_SHIFT) < hvm_info->low_mem_pgend )
     {
         struct xen_add_to_physmap xatp;
-        unsigned int size = hvm_info->low_mem_pgend - pci_mem_reloc_pg;
+        unsigned int nr_pages = min_t(
+            unsigned int,
+            hvm_info->low_mem_pgend - (pci_mem_start >> PAGE_SHIFT),
+            (1u << 16) - 1);
+        if ( hvm_info->high_mem_pgend == 0 )
+            hvm_info->high_mem_pgend = 1ull << (32 - PAGE_SHIFT);
+        hvm_info->low_mem_pgend -= nr_pages;
         xatp.domid = DOMID_SELF;
         xatp.space = XENMAPSPACE_gmfn_range;
-        xatp.idx = pci_mem_reloc_pg;
-        xatp.gpfn = hvm_info->high_mem_pgend;
-        size = size > ((1 << 16) - 1) ? ((1 << 16) - 1) : size;
-        xatp.size = size;
-
+        xatp.idx   = hvm_info->low_mem_pgend;
+        xatp.gpfn  = hvm_info->high_mem_pgend;
+        xatp.size  = nr_pages;
         if ( hypercall_memory_op(XENMEM_add_to_physmap, &xatp) != 0 )
             BUG();
-        pci_mem_reloc_pg += size;
-        hvm_info->high_mem_pgend += size;
+        hvm_info->high_mem_pgend += nr_pages;
     }
-    hvm_info->low_mem_pgend = pci_mem_start >> PAGE_SHIFT;
 
     mem_resource.base = pci_mem_start;
     mem_resource.max = pci_mem_end;
diff -r 9c350ab8d3ea -r 0a0c02a61676 tools/firmware/hvmloader/util.h
--- a/tools/firmware/hvmloader/util.h	Mon Nov 21 09:29:31 2011 +0100
+++ b/tools/firmware/hvmloader/util.h	Mon Nov 21 21:28:34 2011 +0000
@@ -31,6 +31,11 @@
 #define BUG_ON(p) do { if (p) BUG(); } while (0)
 #define BUILD_BUG_ON(p) ((void)sizeof(char[1 - 2 * !!(p)]))
 
+#define min_t(type,x,y) \
+        ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; })
+#define max_t(type,x,y) \
+        ({ type __x = (x); type __y = (y); __x > __y ? __x: __y; })
+
 static inline int test_bit(unsigned int b, void *p)
 {
     return !!(((uint8_t *)p)[b>>3] & (1u<<(b&7)));

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 09:44:30 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 09:44:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSmtx-0004t1-SN; Tue, 22 Nov 2011 09:44:29 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmtw-0004nj-HQ
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-216.messagelabs.com!1321955039!4495408!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9640 invoked from network); 22 Nov 2011 09:44:00 -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;
	22 Nov 2011 09:44:00 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmzb-0001Nv-V7
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:50:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmti-0004og-Qo
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:14 +0000
Message-Id: <E1RSmti-0004og-Qo@xenbits.xen.org>
Date: Tue, 22 Nov 2011 09:44:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hvmloader: Fix memory relocation
	loop.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1321910914 0
# Node ID 0a0c02a616768bfab16c072788cb76be1893c37f
# Parent  9c350ab8d3ea64866421de756ab2bf3daaf63187
hvmloader: Fix memory relocation loop.

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


diff -r 9c350ab8d3ea -r 0a0c02a61676 tools/firmware/hvmloader/pci.c
--- a/tools/firmware/hvmloader/pci.c	Mon Nov 21 09:29:31 2011 +0100
+++ b/tools/firmware/hvmloader/pci.c	Mon Nov 21 21:28:34 2011 +0000
@@ -50,7 +50,6 @@
         uint32_t devfn, bar_reg, bar_sz;
     } *bars = (struct bars *)scratch_start;
     unsigned int i, nr_bars = 0;
-    unsigned long pci_mem_reloc_pg;
 
     /* Program PCI-ISA bridge with appropriate link routes. */
     isa_irq = 0;
@@ -186,25 +185,26 @@
             ((pci_mem_start << 1) != 0) )
         pci_mem_start <<= 1;
 
-    /* Relocate RAM that overlaps (in 64K chunks) */
-    pci_mem_reloc_pg = (pci_mem_start >> PAGE_SHIFT);
-    while (pci_mem_reloc_pg < hvm_info->low_mem_pgend)
+    /* Relocate RAM that overlaps PCI space (in 64k-page chunks). */
+    while ( (pci_mem_start >> PAGE_SHIFT) < hvm_info->low_mem_pgend )
     {
         struct xen_add_to_physmap xatp;
-        unsigned int size = hvm_info->low_mem_pgend - pci_mem_reloc_pg;
+        unsigned int nr_pages = min_t(
+            unsigned int,
+            hvm_info->low_mem_pgend - (pci_mem_start >> PAGE_SHIFT),
+            (1u << 16) - 1);
+        if ( hvm_info->high_mem_pgend == 0 )
+            hvm_info->high_mem_pgend = 1ull << (32 - PAGE_SHIFT);
+        hvm_info->low_mem_pgend -= nr_pages;
         xatp.domid = DOMID_SELF;
         xatp.space = XENMAPSPACE_gmfn_range;
-        xatp.idx = pci_mem_reloc_pg;
-        xatp.gpfn = hvm_info->high_mem_pgend;
-        size = size > ((1 << 16) - 1) ? ((1 << 16) - 1) : size;
-        xatp.size = size;
-
+        xatp.idx   = hvm_info->low_mem_pgend;
+        xatp.gpfn  = hvm_info->high_mem_pgend;
+        xatp.size  = nr_pages;
         if ( hypercall_memory_op(XENMEM_add_to_physmap, &xatp) != 0 )
             BUG();
-        pci_mem_reloc_pg += size;
-        hvm_info->high_mem_pgend += size;
+        hvm_info->high_mem_pgend += nr_pages;
     }
-    hvm_info->low_mem_pgend = pci_mem_start >> PAGE_SHIFT;
 
     mem_resource.base = pci_mem_start;
     mem_resource.max = pci_mem_end;
diff -r 9c350ab8d3ea -r 0a0c02a61676 tools/firmware/hvmloader/util.h
--- a/tools/firmware/hvmloader/util.h	Mon Nov 21 09:29:31 2011 +0100
+++ b/tools/firmware/hvmloader/util.h	Mon Nov 21 21:28:34 2011 +0000
@@ -31,6 +31,11 @@
 #define BUG_ON(p) do { if (p) BUG(); } while (0)
 #define BUILD_BUG_ON(p) ((void)sizeof(char[1 - 2 * !!(p)]))
 
+#define min_t(type,x,y) \
+        ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; })
+#define max_t(type,x,y) \
+        ({ type __x = (x); type __y = (y); __x > __y ? __x: __y; })
+
 static inline int test_bit(unsigned int b, void *p)
 {
     return !!(((uint8_t *)p)[b>>3] & (1u<<(b&7)));

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 09:44:30 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 09:44:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSmtx-0004tB-VN; Tue, 22 Nov 2011 09:44:29 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmtw-0004nk-Lk
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-174.messagelabs.com!1321955039!2520531!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29328 invoked from network); 22 Nov 2011 09:44:00 -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;
	22 Nov 2011 09:44:00 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmzb-0001Ns-Fw
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:50:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmti-0004oR-Bf
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:14 +0000
Message-Id: <E1RSmti-0004oR-Bf@xenbits.xen.org>
Date: Tue, 22 Nov 2011 09:44:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/vioapic: clear remote IRR when
	switching RTE to edge triggered mode
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1321864171 -3600
# Node ID 9c350ab8d3ea64866421de756ab2bf3daaf63187
# Parent  335e8273a3f34a5e2972643a028f83684609f1c1
x86/vioapic: clear remote IRR when switching RTE to edge triggered mode

Xen itself (as much as Linux) relies on this behavior, so it should
also emulate it properly. Not doing so reportedly gets in the way of
kexec inside a HVM guest.

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


diff -r 335e8273a3f3 -r 9c350ab8d3ea xen/arch/x86/hvm/vioapic.c
--- a/xen/arch/x86/hvm/vioapic.c	Sat Nov 19 22:13:51 2011 +0000
+++ b/xen/arch/x86/hvm/vioapic.c	Mon Nov 21 09:29:31 2011 +0100
@@ -154,8 +154,9 @@
     {
         vlapic_adjust_i8259_target(d);
     }
-    else if ( (ent.fields.trig_mode == VIOAPIC_LEVEL_TRIG) &&
-              !ent.fields.mask &&
+    else if ( ent.fields.trig_mode == VIOAPIC_EDGE_TRIG )
+        pent->fields.remote_irr = 0;
+    else if ( !ent.fields.mask &&
               !ent.fields.remote_irr &&
               hvm_irq->gsi_assert_count[idx] )
     {

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 09:44:30 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 09:44:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSmtx-0004tB-VN; Tue, 22 Nov 2011 09:44:29 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmtw-0004nk-Lk
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-174.messagelabs.com!1321955039!2520531!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29328 invoked from network); 22 Nov 2011 09:44:00 -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;
	22 Nov 2011 09:44:00 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmzb-0001Ns-Fw
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:50:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmti-0004oR-Bf
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:14 +0000
Message-Id: <E1RSmti-0004oR-Bf@xenbits.xen.org>
Date: Tue, 22 Nov 2011 09:44:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/vioapic: clear remote IRR when
	switching RTE to edge triggered mode
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1321864171 -3600
# Node ID 9c350ab8d3ea64866421de756ab2bf3daaf63187
# Parent  335e8273a3f34a5e2972643a028f83684609f1c1
x86/vioapic: clear remote IRR when switching RTE to edge triggered mode

Xen itself (as much as Linux) relies on this behavior, so it should
also emulate it properly. Not doing so reportedly gets in the way of
kexec inside a HVM guest.

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


diff -r 335e8273a3f3 -r 9c350ab8d3ea xen/arch/x86/hvm/vioapic.c
--- a/xen/arch/x86/hvm/vioapic.c	Sat Nov 19 22:13:51 2011 +0000
+++ b/xen/arch/x86/hvm/vioapic.c	Mon Nov 21 09:29:31 2011 +0100
@@ -154,8 +154,9 @@
     {
         vlapic_adjust_i8259_target(d);
     }
-    else if ( (ent.fields.trig_mode == VIOAPIC_LEVEL_TRIG) &&
-              !ent.fields.mask &&
+    else if ( ent.fields.trig_mode == VIOAPIC_EDGE_TRIG )
+        pent->fields.remote_irr = 0;
+    else if ( !ent.fields.mask &&
               !ent.fields.remote_irr &&
               hvm_irq->gsi_assert_count[idx] )
     {

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 09:44:30 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 09:44:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSmtu-0004qW-Ew; Tue, 22 Nov 2011 09:44:26 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmtt-0004mt-Jc
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-21.messagelabs.com!1321955035!5202700!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17066 invoked from network); 22 Nov 2011 09:43:56 -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;
	22 Nov 2011 09:43:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmzY-0001Na-Dg
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:50:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmtf-0004mz-9L
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:11 +0000
Message-Id: <E1RSmtf-0004mz-9L@xenbits.xen.org>
Date: Tue, 22 Nov 2011 09:44:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] iommu: Introduce iommu_flush and
	iommu_flush_all.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jean Guyader <jean.guyader@eu.citrix.com>
# Date 1321623656 0
# Node ID 9a1a71f7bef2ca58d045d8067b965fcdc7c76cb2
# Parent  aeb628c5af3fa0e21b04ca27508f742ffa2050e4
iommu: Introduce iommu_flush and iommu_flush_all.

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r aeb628c5af3f -r 9a1a71f7bef2 xen/drivers/passthrough/iommu.c
--- a/xen/drivers/passthrough/iommu.c	Fri Nov 18 13:40:19 2011 +0000
+++ b/xen/drivers/passthrough/iommu.c	Fri Nov 18 13:40:56 2011 +0000
@@ -301,6 +301,26 @@
     return hd->platform_ops->unmap_page(d, gfn);
 }
 
+void iommu_iotlb_flush(struct domain *d, unsigned long gfn, unsigned int page_count)
+{
+    struct hvm_iommu *hd = domain_hvm_iommu(d);
+
+    if ( !iommu_enabled || !hd->platform_ops || !hd->platform_ops->iotlb_flush )
+        return;
+
+    hd->platform_ops->iotlb_flush(d, gfn, page_count);
+}
+
+void iommu_iotlb_flush_all(struct domain *d)
+{
+    struct hvm_iommu *hd = domain_hvm_iommu(d);
+
+    if ( !iommu_enabled || !hd->platform_ops || !hd->platform_ops->iotlb_flush_all )
+        return;
+
+    hd->platform_ops->iotlb_flush_all(d);
+}
+
 /* caller should hold the pcidevs_lock */
 int deassign_device(struct domain *d, u16 seg, u8 bus, u8 devfn)
 {
diff -r aeb628c5af3f -r 9a1a71f7bef2 xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c	Fri Nov 18 13:40:19 2011 +0000
+++ b/xen/drivers/passthrough/vtd/iommu.c	Fri Nov 18 13:40:56 2011 +0000
@@ -622,6 +622,16 @@
     }
 }
 
+static void intel_iommu_iotlb_flush(struct domain *d, unsigned long gfn, unsigned int page_count)
+{
+    __intel_iommu_iotlb_flush(d, gfn, 1, page_count);
+}
+
+static void intel_iommu_iotlb_flush_all(struct domain *d)
+{
+    __intel_iommu_iotlb_flush(d, 0, 0, 0);
+}
+
 /* clear one page's page table */
 static void dma_pte_clear_one(struct domain *domain, u64 addr)
 {
@@ -2343,6 +2353,8 @@
     .resume = vtd_resume,
     .share_p2m = iommu_set_pgd,
     .crash_shutdown = vtd_crash_shutdown,
+    .iotlb_flush = intel_iommu_iotlb_flush,
+    .iotlb_flush_all = intel_iommu_iotlb_flush_all,
 };
 
 /*
diff -r aeb628c5af3f -r 9a1a71f7bef2 xen/include/xen/iommu.h
--- a/xen/include/xen/iommu.h	Fri Nov 18 13:40:19 2011 +0000
+++ b/xen/include/xen/iommu.h	Fri Nov 18 13:40:56 2011 +0000
@@ -143,6 +143,8 @@
     void (*resume)(void);
     void (*share_p2m)(struct domain *d);
     void (*crash_shutdown)(void);
+    void (*iotlb_flush)(struct domain *d, unsigned long gfn, unsigned int page_count);
+    void (*iotlb_flush_all)(struct domain *d);
 };
 
 void iommu_update_ire_from_apic(unsigned int apic, unsigned int reg, unsigned int value);
@@ -159,4 +161,7 @@
 
 int iommu_do_domctl(struct xen_domctl *, XEN_GUEST_HANDLE(xen_domctl_t));
 
+void iommu_iotlb_flush(struct domain *d, unsigned long gfn, unsigned int page_count);
+void iommu_iotlb_flush_all(struct domain *d);
+
 #endif /* _IOMMU_H_ */

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 09:44:30 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 09:44:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSmtu-0004qW-Ew; Tue, 22 Nov 2011 09:44:26 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmtt-0004mt-Jc
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-21.messagelabs.com!1321955035!5202700!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17066 invoked from network); 22 Nov 2011 09:43:56 -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;
	22 Nov 2011 09:43:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmzY-0001Na-Dg
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:50:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmtf-0004mz-9L
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:11 +0000
Message-Id: <E1RSmtf-0004mz-9L@xenbits.xen.org>
Date: Tue, 22 Nov 2011 09:44:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] iommu: Introduce iommu_flush and
	iommu_flush_all.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jean Guyader <jean.guyader@eu.citrix.com>
# Date 1321623656 0
# Node ID 9a1a71f7bef2ca58d045d8067b965fcdc7c76cb2
# Parent  aeb628c5af3fa0e21b04ca27508f742ffa2050e4
iommu: Introduce iommu_flush and iommu_flush_all.

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r aeb628c5af3f -r 9a1a71f7bef2 xen/drivers/passthrough/iommu.c
--- a/xen/drivers/passthrough/iommu.c	Fri Nov 18 13:40:19 2011 +0000
+++ b/xen/drivers/passthrough/iommu.c	Fri Nov 18 13:40:56 2011 +0000
@@ -301,6 +301,26 @@
     return hd->platform_ops->unmap_page(d, gfn);
 }
 
+void iommu_iotlb_flush(struct domain *d, unsigned long gfn, unsigned int page_count)
+{
+    struct hvm_iommu *hd = domain_hvm_iommu(d);
+
+    if ( !iommu_enabled || !hd->platform_ops || !hd->platform_ops->iotlb_flush )
+        return;
+
+    hd->platform_ops->iotlb_flush(d, gfn, page_count);
+}
+
+void iommu_iotlb_flush_all(struct domain *d)
+{
+    struct hvm_iommu *hd = domain_hvm_iommu(d);
+
+    if ( !iommu_enabled || !hd->platform_ops || !hd->platform_ops->iotlb_flush_all )
+        return;
+
+    hd->platform_ops->iotlb_flush_all(d);
+}
+
 /* caller should hold the pcidevs_lock */
 int deassign_device(struct domain *d, u16 seg, u8 bus, u8 devfn)
 {
diff -r aeb628c5af3f -r 9a1a71f7bef2 xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c	Fri Nov 18 13:40:19 2011 +0000
+++ b/xen/drivers/passthrough/vtd/iommu.c	Fri Nov 18 13:40:56 2011 +0000
@@ -622,6 +622,16 @@
     }
 }
 
+static void intel_iommu_iotlb_flush(struct domain *d, unsigned long gfn, unsigned int page_count)
+{
+    __intel_iommu_iotlb_flush(d, gfn, 1, page_count);
+}
+
+static void intel_iommu_iotlb_flush_all(struct domain *d)
+{
+    __intel_iommu_iotlb_flush(d, 0, 0, 0);
+}
+
 /* clear one page's page table */
 static void dma_pte_clear_one(struct domain *domain, u64 addr)
 {
@@ -2343,6 +2353,8 @@
     .resume = vtd_resume,
     .share_p2m = iommu_set_pgd,
     .crash_shutdown = vtd_crash_shutdown,
+    .iotlb_flush = intel_iommu_iotlb_flush,
+    .iotlb_flush_all = intel_iommu_iotlb_flush_all,
 };
 
 /*
diff -r aeb628c5af3f -r 9a1a71f7bef2 xen/include/xen/iommu.h
--- a/xen/include/xen/iommu.h	Fri Nov 18 13:40:19 2011 +0000
+++ b/xen/include/xen/iommu.h	Fri Nov 18 13:40:56 2011 +0000
@@ -143,6 +143,8 @@
     void (*resume)(void);
     void (*share_p2m)(struct domain *d);
     void (*crash_shutdown)(void);
+    void (*iotlb_flush)(struct domain *d, unsigned long gfn, unsigned int page_count);
+    void (*iotlb_flush_all)(struct domain *d);
 };
 
 void iommu_update_ire_from_apic(unsigned int apic, unsigned int reg, unsigned int value);
@@ -159,4 +161,7 @@
 
 int iommu_do_domctl(struct xen_domctl *, XEN_GUEST_HANDLE(xen_domctl_t));
 
+void iommu_iotlb_flush(struct domain *d, unsigned long gfn, unsigned int page_count);
+void iommu_iotlb_flush_all(struct domain *d);
+
 #endif /* _IOMMU_H_ */

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 09:44:31 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 09:44:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSmtx-0004su-Pv; Tue, 22 Nov 2011 09:44:29 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmtw-0004nd-0G
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-21.messagelabs.com!1321955038!5202714!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17277 invoked from network); 22 Nov 2011 09:43:59 -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;
	22 Nov 2011 09:43:59 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmzb-0001Np-2Z
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:50:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmth-0004oC-Rc
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:13 +0000
Message-Id: <E1RSmth-0004oC-Rc@xenbits.xen.org>
Date: Tue, 22 Nov 2011 09:44:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: Fix RCU locking in
	XENMEM_add_to_physmap.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1321740831 0
# Node ID 335e8273a3f34a5e2972643a028f83684609f1c1
# Parent  fe3e9d0c123cc3184b6e29531e326927a0e4938d
x86: Fix RCU locking in XENMEM_add_to_physmap.

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


diff -r fe3e9d0c123c -r 335e8273a3f3 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Fri Nov 18 13:43:26 2011 +0000
+++ b/xen/arch/x86/mm.c	Sat Nov 19 22:13:51 2011 +0000
@@ -4677,8 +4677,9 @@
     return 0;
 }
 
-static int xenmem_add_to_physmap_once(struct domain *d,
-                                      const struct xen_add_to_physmap *xatp)
+static int xenmem_add_to_physmap_once(
+    struct domain *d,
+    const struct xen_add_to_physmap *xatp)
 {
     struct page_info *page = NULL;
     unsigned long gfn = 0; /* gcc ... */
@@ -4728,7 +4729,6 @@
             if ( p2m_is_shared(p2mt) )
             {
                 put_gfn(d, gfn);
-                rcu_unlock_domain(d);
                 return -ENOMEM;
             }
             if ( !get_page_from_pagenr(idx, d) )
@@ -4748,7 +4748,6 @@
         if ( xatp->space == XENMAPSPACE_gmfn ||
              xatp->space == XENMAPSPACE_gmfn_range )
             put_gfn(d, gfn);
-        rcu_unlock_domain(d);
         return -EINVAL;
     }
 
@@ -4786,8 +4785,6 @@
         put_gfn(d, gfn);
     domain_unlock(d);
 
-    rcu_unlock_domain(d);
-
     return rc;
 }
 
@@ -4864,11 +4861,8 @@
 
         if ( xatp.space == XENMAPSPACE_gmfn_range )
         {
-            if ( rc )
-            {
-                if ( copy_to_guest(arg, &xatp, 1) )
-                    return -EFAULT;
-            }
+            if ( rc && copy_to_guest(arg, &xatp, 1) )
+                rc = -EFAULT;
 
             if ( rc == -EAGAIN )
                 rc = hypercall_create_continuation(

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 09:44:31 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 09:44:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSmtx-0004su-Pv; Tue, 22 Nov 2011 09:44:29 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmtw-0004nd-0G
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-21.messagelabs.com!1321955038!5202714!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17277 invoked from network); 22 Nov 2011 09:43:59 -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;
	22 Nov 2011 09:43:59 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmzb-0001Np-2Z
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:50:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmth-0004oC-Rc
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:13 +0000
Message-Id: <E1RSmth-0004oC-Rc@xenbits.xen.org>
Date: Tue, 22 Nov 2011 09:44:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: Fix RCU locking in
	XENMEM_add_to_physmap.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1321740831 0
# Node ID 335e8273a3f34a5e2972643a028f83684609f1c1
# Parent  fe3e9d0c123cc3184b6e29531e326927a0e4938d
x86: Fix RCU locking in XENMEM_add_to_physmap.

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


diff -r fe3e9d0c123c -r 335e8273a3f3 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Fri Nov 18 13:43:26 2011 +0000
+++ b/xen/arch/x86/mm.c	Sat Nov 19 22:13:51 2011 +0000
@@ -4677,8 +4677,9 @@
     return 0;
 }
 
-static int xenmem_add_to_physmap_once(struct domain *d,
-                                      const struct xen_add_to_physmap *xatp)
+static int xenmem_add_to_physmap_once(
+    struct domain *d,
+    const struct xen_add_to_physmap *xatp)
 {
     struct page_info *page = NULL;
     unsigned long gfn = 0; /* gcc ... */
@@ -4728,7 +4729,6 @@
             if ( p2m_is_shared(p2mt) )
             {
                 put_gfn(d, gfn);
-                rcu_unlock_domain(d);
                 return -ENOMEM;
             }
             if ( !get_page_from_pagenr(idx, d) )
@@ -4748,7 +4748,6 @@
         if ( xatp->space == XENMAPSPACE_gmfn ||
              xatp->space == XENMAPSPACE_gmfn_range )
             put_gfn(d, gfn);
-        rcu_unlock_domain(d);
         return -EINVAL;
     }
 
@@ -4786,8 +4785,6 @@
         put_gfn(d, gfn);
     domain_unlock(d);
 
-    rcu_unlock_domain(d);
-
     return rc;
 }
 
@@ -4864,11 +4861,8 @@
 
         if ( xatp.space == XENMAPSPACE_gmfn_range )
         {
-            if ( rc )
-            {
-                if ( copy_to_guest(arg, &xatp, 1) )
-                    return -EFAULT;
-            }
+            if ( rc && copy_to_guest(arg, &xatp, 1) )
+                rc = -EFAULT;
 
             if ( rc == -EAGAIN )
                 rc = hypercall_create_continuation(

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 09:45:13 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 09:45:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSmuf-0005BU-3U; Tue, 22 Nov 2011 09:45:13 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmud-00059W-Jy
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:45:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-216.messagelabs.com!1321955037!4452761!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14971 invoked from network); 22 Nov 2011 09:43:58 -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;
	22 Nov 2011 09:43:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmzZ-0001Nj-Ug
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:50:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmtg-0004ni-QS
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:12 +0000
Message-Id: <E1RSmtg-0004ni-QS@xenbits.xen.org>
Date: Tue, 22 Nov 2011 09:44:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hvmloader: Change memory relocation
	loop when overlap with PCI hole
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jean Guyader <jean.guyader@eu.citrix.com>
# Date 1321623766 0
# Node ID 89a4d97731c58db2790f63dd687edc537e7ce2b8
# Parent  707d27fe03e7e3b331d804c4743ae7534a9c3043
hvmloader: Change memory relocation loop when overlap with PCI hole

Change the way we relocate the memory page if they overlap with pci
hole.  Use new map space (XENMAPSPACE_gmfn_range) to move the loop
into xen.

This code usually get triggered when a device is pass through to a
guest and the PCI hole has to be extended to have enough room to map
the device BARs.  The PCI hole will starts lower and it might overlap
with some RAM that has been alocated for the guest. That usually
happen if the guest has more than 4G of RAM.  We have to relocate
those pages in high mem otherwise they won't be accessible.

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 707d27fe03e7 -r 89a4d97731c5 tools/firmware/hvmloader/pci.c
--- a/tools/firmware/hvmloader/pci.c	Fri Nov 18 13:42:08 2011 +0000
+++ b/tools/firmware/hvmloader/pci.c	Fri Nov 18 13:42:46 2011 +0000
@@ -50,6 +50,7 @@
         uint32_t devfn, bar_reg, bar_sz;
     } *bars = (struct bars *)scratch_start;
     unsigned int i, nr_bars = 0;
+    unsigned long pci_mem_reloc_pg;
 
     /* Program PCI-ISA bridge with appropriate link routes. */
     isa_irq = 0;
@@ -185,18 +186,25 @@
             ((pci_mem_start << 1) != 0) )
         pci_mem_start <<= 1;
 
-    while ( (pci_mem_start >> PAGE_SHIFT) < hvm_info->low_mem_pgend )
+    /* Relocate RAM that overlaps (in 64K chunks) */
+    pci_mem_reloc_pg = (pci_mem_start >> PAGE_SHIFT);
+    while (pci_mem_reloc_pg < hvm_info->low_mem_pgend)
     {
         struct xen_add_to_physmap xatp;
-        if ( hvm_info->high_mem_pgend == 0 )
-            hvm_info->high_mem_pgend = 1ull << (32 - PAGE_SHIFT);
+        unsigned int size = hvm_info->low_mem_pgend - pci_mem_reloc_pg;
         xatp.domid = DOMID_SELF;
-        xatp.space = XENMAPSPACE_gmfn;
-        xatp.idx   = --hvm_info->low_mem_pgend;
-        xatp.gpfn  = hvm_info->high_mem_pgend++;
+        xatp.space = XENMAPSPACE_gmfn_range;
+        xatp.idx = pci_mem_reloc_pg;
+        xatp.gpfn = hvm_info->high_mem_pgend;
+        size = size > ((1 << 16) - 1) ? ((1 << 16) - 1) : size;
+        xatp.size = size;
+
         if ( hypercall_memory_op(XENMEM_add_to_physmap, &xatp) != 0 )
             BUG();
+        pci_mem_reloc_pg += size;
+        hvm_info->high_mem_pgend += size;
     }
+    hvm_info->low_mem_pgend = pci_mem_start >> PAGE_SHIFT;
 
     mem_resource.base = pci_mem_start;
     mem_resource.max = pci_mem_end;

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 09:45:13 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 09:45:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSmuf-0005BU-3U; Tue, 22 Nov 2011 09:45:13 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmud-00059W-Jy
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:45:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-216.messagelabs.com!1321955037!4452761!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14971 invoked from network); 22 Nov 2011 09:43:58 -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;
	22 Nov 2011 09:43:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmzZ-0001Nj-Ug
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:50:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSmtg-0004ni-QS
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 09:44:12 +0000
Message-Id: <E1RSmtg-0004ni-QS@xenbits.xen.org>
Date: Tue, 22 Nov 2011 09:44:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hvmloader: Change memory relocation
	loop when overlap with PCI hole
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jean Guyader <jean.guyader@eu.citrix.com>
# Date 1321623766 0
# Node ID 89a4d97731c58db2790f63dd687edc537e7ce2b8
# Parent  707d27fe03e7e3b331d804c4743ae7534a9c3043
hvmloader: Change memory relocation loop when overlap with PCI hole

Change the way we relocate the memory page if they overlap with pci
hole.  Use new map space (XENMAPSPACE_gmfn_range) to move the loop
into xen.

This code usually get triggered when a device is pass through to a
guest and the PCI hole has to be extended to have enough room to map
the device BARs.  The PCI hole will starts lower and it might overlap
with some RAM that has been alocated for the guest. That usually
happen if the guest has more than 4G of RAM.  We have to relocate
those pages in high mem otherwise they won't be accessible.

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 707d27fe03e7 -r 89a4d97731c5 tools/firmware/hvmloader/pci.c
--- a/tools/firmware/hvmloader/pci.c	Fri Nov 18 13:42:08 2011 +0000
+++ b/tools/firmware/hvmloader/pci.c	Fri Nov 18 13:42:46 2011 +0000
@@ -50,6 +50,7 @@
         uint32_t devfn, bar_reg, bar_sz;
     } *bars = (struct bars *)scratch_start;
     unsigned int i, nr_bars = 0;
+    unsigned long pci_mem_reloc_pg;
 
     /* Program PCI-ISA bridge with appropriate link routes. */
     isa_irq = 0;
@@ -185,18 +186,25 @@
             ((pci_mem_start << 1) != 0) )
         pci_mem_start <<= 1;
 
-    while ( (pci_mem_start >> PAGE_SHIFT) < hvm_info->low_mem_pgend )
+    /* Relocate RAM that overlaps (in 64K chunks) */
+    pci_mem_reloc_pg = (pci_mem_start >> PAGE_SHIFT);
+    while (pci_mem_reloc_pg < hvm_info->low_mem_pgend)
     {
         struct xen_add_to_physmap xatp;
-        if ( hvm_info->high_mem_pgend == 0 )
-            hvm_info->high_mem_pgend = 1ull << (32 - PAGE_SHIFT);
+        unsigned int size = hvm_info->low_mem_pgend - pci_mem_reloc_pg;
         xatp.domid = DOMID_SELF;
-        xatp.space = XENMAPSPACE_gmfn;
-        xatp.idx   = --hvm_info->low_mem_pgend;
-        xatp.gpfn  = hvm_info->high_mem_pgend++;
+        xatp.space = XENMAPSPACE_gmfn_range;
+        xatp.idx = pci_mem_reloc_pg;
+        xatp.gpfn = hvm_info->high_mem_pgend;
+        size = size > ((1 << 16) - 1) ? ((1 << 16) - 1) : size;
+        xatp.size = size;
+
         if ( hypercall_memory_op(XENMEM_add_to_physmap, &xatp) != 0 )
             BUG();
+        pci_mem_reloc_pg += size;
+        hvm_info->high_mem_pgend += size;
     }
+    hvm_info->low_mem_pgend = pci_mem_start >> PAGE_SHIFT;
 
     mem_resource.base = pci_mem_start;
     mem_resource.max = pci_mem_end;

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 16:33:21 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 16:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RStHa-0003NO-HQ; Tue, 22 Nov 2011 16:33:18 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1RStHZ-0003NH-LO
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 16:33:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1321979567!3290053!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14663 invoked from network); 22 Nov 2011 16:32:48 -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;
	22 Nov 2011 16:32:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1RStNF-0007KW-Ac
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 16:39:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1RStHL-00005l-Hz
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 16:33:03 +0000
Date: Tue, 22 Nov 2011 16:33:03 +0000
Message-Id: <E1RStHL-00005l-Hz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] qemu-xen: add vkbd support for
	PV on HVM guests
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

commit 9b33a3e5603ecd3ceca482a72c6ff8e951afb6d2
Author: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date:   Tue Nov 22 16:12:40 2011 +0000

    qemu-xen: add vkbd support for PV on HVM guests
    
    Register the vkbd backend even when running as device emulator for HVM
    guests: it is useful because it doesn't need a frequent timer like usb.
    
    Check whether the XenInput DisplayState has been set in the initialise
    state, rather than the input state.
    In case the DisplayState hasn't been set and there is no vfb for this
    domain, then set the XenInput DisplayState to the default one.
    
    An equivalent patch has already been committed in upstream qemu.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/xen_machine_fv.c |    1 +
 hw/xenfb.c          |   19 ++++++++++++-------
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/hw/xen_machine_fv.c b/hw/xen_machine_fv.c
index 603a508..fdad42a 100644
--- a/hw/xen_machine_fv.c
+++ b/hw/xen_machine_fv.c
@@ -368,6 +368,7 @@ static void xen_init_fv(ram_addr_t ram_size, int vga_ram_size,
         exit(1);
     }
     xen_be_register("console", &xen_console_ops);
+    xen_be_register("vkbd", &xen_kbdmouse_ops);
 #ifndef CONFIG_STUBDOM
     xen_be_register("qdisk", &xen_blkdev_ops);
 #endif
diff --git a/hw/xenfb.c b/hw/xenfb.c
index 05c51cc..96c2a6f 100644
--- a/hw/xenfb.c
+++ b/hw/xenfb.c
@@ -350,13 +350,6 @@ static void xenfb_mouse_event(void *opaque,
 
 static int input_init(struct XenDevice *xendev)
 {
-    struct XenInput *in = container_of(xendev, struct XenInput, c.xendev);
-
-    if (!in->c.ds) {
-        xen_be_printf(xendev, 1, "ds not set (yet)\n");
-	return -1;
-    }
-
     xenstore_write_be_int(xendev, "feature-abs-pointer", 1);
     return 0;
 }
@@ -366,6 +359,18 @@ static int input_initialise(struct XenDevice *xendev)
     struct XenInput *in = container_of(xendev, struct XenInput, c.xendev);
     int rc;
 
+    if (!in->c.ds) {
+        char *vfb = xenstore_read_str(NULL, "device/vfb");
+        if (vfb == NULL) {
+            /* there is no vfb, run vkbd on its own */
+            in->c.ds = get_displaystate();
+        } else {
+            free(vfb);
+            xen_be_printf(xendev, 1, "ds not set (yet)\n");
+            return -1;
+        }
+    }
+
     rc = common_bind(&in->c);
     if (rc != 0)
 	return rc;
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 16:33:21 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 16:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RStHa-0003NO-HQ; Tue, 22 Nov 2011 16:33:18 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1RStHZ-0003NH-LO
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 16:33:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1321979567!3290053!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14663 invoked from network); 22 Nov 2011 16:32:48 -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;
	22 Nov 2011 16:32:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1RStNF-0007KW-Ac
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 16:39:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1RStHL-00005l-Hz
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 16:33:03 +0000
Date: Tue, 22 Nov 2011 16:33:03 +0000
Message-Id: <E1RStHL-00005l-Hz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] qemu-xen: add vkbd support for
	PV on HVM guests
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

commit 9b33a3e5603ecd3ceca482a72c6ff8e951afb6d2
Author: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date:   Tue Nov 22 16:12:40 2011 +0000

    qemu-xen: add vkbd support for PV on HVM guests
    
    Register the vkbd backend even when running as device emulator for HVM
    guests: it is useful because it doesn't need a frequent timer like usb.
    
    Check whether the XenInput DisplayState has been set in the initialise
    state, rather than the input state.
    In case the DisplayState hasn't been set and there is no vfb for this
    domain, then set the XenInput DisplayState to the default one.
    
    An equivalent patch has already been committed in upstream qemu.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/xen_machine_fv.c |    1 +
 hw/xenfb.c          |   19 ++++++++++++-------
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/hw/xen_machine_fv.c b/hw/xen_machine_fv.c
index 603a508..fdad42a 100644
--- a/hw/xen_machine_fv.c
+++ b/hw/xen_machine_fv.c
@@ -368,6 +368,7 @@ static void xen_init_fv(ram_addr_t ram_size, int vga_ram_size,
         exit(1);
     }
     xen_be_register("console", &xen_console_ops);
+    xen_be_register("vkbd", &xen_kbdmouse_ops);
 #ifndef CONFIG_STUBDOM
     xen_be_register("qdisk", &xen_blkdev_ops);
 #endif
diff --git a/hw/xenfb.c b/hw/xenfb.c
index 05c51cc..96c2a6f 100644
--- a/hw/xenfb.c
+++ b/hw/xenfb.c
@@ -350,13 +350,6 @@ static void xenfb_mouse_event(void *opaque,
 
 static int input_init(struct XenDevice *xendev)
 {
-    struct XenInput *in = container_of(xendev, struct XenInput, c.xendev);
-
-    if (!in->c.ds) {
-        xen_be_printf(xendev, 1, "ds not set (yet)\n");
-	return -1;
-    }
-
     xenstore_write_be_int(xendev, "feature-abs-pointer", 1);
     return 0;
 }
@@ -366,6 +359,18 @@ static int input_initialise(struct XenDevice *xendev)
     struct XenInput *in = container_of(xendev, struct XenInput, c.xendev);
     int rc;
 
+    if (!in->c.ds) {
+        char *vfb = xenstore_read_str(NULL, "device/vfb");
+        if (vfb == NULL) {
+            /* there is no vfb, run vkbd on its own */
+            in->c.ds = get_displaystate();
+        } else {
+            free(vfb);
+            xen_be_printf(xendev, 1, "ds not set (yet)\n");
+            return -1;
+        }
+    }
+
     rc = common_bind(&in->c);
     if (rc != 0)
 	return rc;
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 19:11:25 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 19:11:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSvkV-0000MV-J0; Tue, 22 Nov 2011 19:11:19 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1RSvkU-0000MN-O5
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 19:11:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-182.messagelabs.com!1321989047!4184799!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18953 invoked from network); 22 Nov 2011 19:10:48 -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;
	22 Nov 2011 19:10:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1RSvq9-0000kY-5p
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 19:17:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1RSvkF-0003ui-C5
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 19:11:03 +0000
Date: Tue, 22 Nov 2011 19:11:03 +0000
Message-Id: <E1RSvkF-0003ui-C5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] qemu-xen: Don't redefine libpci
	(3.1.7) defines.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

commit 174d92a73a5d5e67c49501383a519021b72a2468
Author: Jean Guyader <jean.guyader@eu.citrix.com>
Date:   Tue Nov 22 18:49:15 2011 +0000

    qemu-xen: Don't redefine libpci (3.1.7) defines.
    
    These values are already defined by the libpci heders in the version
    3.1.7.
    
    PCI_STATUS_66MHZ
    PCI_STATUS_RESERVED2
    PCI_STATUS_FAST_BACK
    PCI_MSIX_TABSIZE
    
    Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
---
 hw/pci.h    |    6 ++++++
 hw/pt-msi.h |    2 ++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/hw/pci.h b/hw/pci.h
index e4cc79a..e2c1fd8 100644
--- a/hw/pci.h
+++ b/hw/pci.h
@@ -177,9 +177,15 @@ typedef struct PCIIORegion {
 #define PCI_STATUS_RESERVED1	0x007
 #define PCI_STATUS_INT_STATUS	0x008
 #define PCI_STATUS_CAPABILITIES	0x010
+#ifndef PCI_STATUS_66MHZ
 #define PCI_STATUS_66MHZ	0x020
+#endif
+#ifndef PCI_STATUS_RESERVED2
 #define PCI_STATUS_RESERVED2	0x040
+#endif
+#ifndef PCI_STATUS_FAST_BACK
 #define PCI_STATUS_FAST_BACK	0x080
+#endif
 #define PCI_STATUS_DEVSEL	0x600
 
 #define PCI_STATUS_RESERVED_MASK_LO (PCI_STATUS_RESERVED1 | \
diff --git a/hw/pt-msi.h b/hw/pt-msi.h
index 9664f89..108ac8e 100644
--- a/hw/pt-msi.h
+++ b/hw/pt-msi.h
@@ -26,7 +26,9 @@
 /* MSI-X */
 #define  PCI_MSIX_ENABLE    0x8000
 #define  PCI_MSIX_MASK      0x4000
+#ifndef PCI_MSIX_TABSIZE
 #define  PCI_MSIX_TABSIZE   0x03ff
+#endif
 #define PCI_MSIX_TABLE      4
 #define PCI_MSIX_PBA        8
 #define  PCI_MSIX_BIR       0x7
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 19:11:25 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 19:11:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSvkV-0000MV-J0; Tue, 22 Nov 2011 19:11:19 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1RSvkU-0000MN-O5
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 19:11:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-182.messagelabs.com!1321989047!4184799!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18953 invoked from network); 22 Nov 2011 19:10:48 -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;
	22 Nov 2011 19:10:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1RSvq9-0000kY-5p
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 19:17:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1RSvkF-0003ui-C5
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 19:11:03 +0000
Date: Tue, 22 Nov 2011 19:11:03 +0000
Message-Id: <E1RSvkF-0003ui-C5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] qemu-xen: Don't redefine libpci
	(3.1.7) defines.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

commit 174d92a73a5d5e67c49501383a519021b72a2468
Author: Jean Guyader <jean.guyader@eu.citrix.com>
Date:   Tue Nov 22 18:49:15 2011 +0000

    qemu-xen: Don't redefine libpci (3.1.7) defines.
    
    These values are already defined by the libpci heders in the version
    3.1.7.
    
    PCI_STATUS_66MHZ
    PCI_STATUS_RESERVED2
    PCI_STATUS_FAST_BACK
    PCI_MSIX_TABSIZE
    
    Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
---
 hw/pci.h    |    6 ++++++
 hw/pt-msi.h |    2 ++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/hw/pci.h b/hw/pci.h
index e4cc79a..e2c1fd8 100644
--- a/hw/pci.h
+++ b/hw/pci.h
@@ -177,9 +177,15 @@ typedef struct PCIIORegion {
 #define PCI_STATUS_RESERVED1	0x007
 #define PCI_STATUS_INT_STATUS	0x008
 #define PCI_STATUS_CAPABILITIES	0x010
+#ifndef PCI_STATUS_66MHZ
 #define PCI_STATUS_66MHZ	0x020
+#endif
+#ifndef PCI_STATUS_RESERVED2
 #define PCI_STATUS_RESERVED2	0x040
+#endif
+#ifndef PCI_STATUS_FAST_BACK
 #define PCI_STATUS_FAST_BACK	0x080
+#endif
 #define PCI_STATUS_DEVSEL	0x600
 
 #define PCI_STATUS_RESERVED_MASK_LO (PCI_STATUS_RESERVED1 | \
diff --git a/hw/pt-msi.h b/hw/pt-msi.h
index 9664f89..108ac8e 100644
--- a/hw/pt-msi.h
+++ b/hw/pt-msi.h
@@ -26,7 +26,9 @@
 /* MSI-X */
 #define  PCI_MSIX_ENABLE    0x8000
 #define  PCI_MSIX_MASK      0x4000
+#ifndef PCI_MSIX_TABSIZE
 #define  PCI_MSIX_TABSIZE   0x03ff
+#endif
 #define PCI_MSIX_TABLE      4
 #define PCI_MSIX_PBA        8
 #define  PCI_MSIX_BIR       0x7
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 19:44:23 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 19: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.xensource.com>)
	id 1RSwGS-0000ve-5d; Tue, 22 Nov 2011 19: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 1RSwGQ-0000vG-NR
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 19:44:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-27.messagelabs.com!1321990997!46958724!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6432 invoked from network); 22 Nov 2011 19:43:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Nov 2011 19:43: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 1RSwMB-00017Y-FS
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 19:50:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSwGH-0004eo-Fq
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 19:44:09 +0000
Message-Id: <E1RSwGH-0004eo-Fq@xenbits.xen.org>
Date: Tue, 22 Nov 2011 19:44:09 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] xsm/flask: fix resource list
	range checks
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Daniel De Graaf <dgdegra@tycho.nsa.gov>
# Date 1321969068 0
# Node ID 4f4763690d74ae4fb34aa8914f713812b1b19389
# Parent  db87ad0b5391b4b77643f6b095f445aca95ef705
xsm/flask: fix resource list range checks

The FLASK security checks for resource ranges were not implemented
correctly - only the permissions on the endpoints of a range were
checked, instead of all items contained in the range. This would allow
certain resources (I/O ports, I/O memory) to be used by domains in
contravention to security policy.

This also corrects a bug where adding overlapping resource ranges did
not trigger an error.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24177:d3859e348951
xen-unstable date:        Tue Nov 22 13:29:48 2011 +0000
---


diff -r db87ad0b5391 -r 4f4763690d74 xen/xsm/flask/hooks.c
--- a/xen/xsm/flask/hooks.c	Tue Nov 22 13:37:26 2011 +0000
+++ b/xen/xsm/flask/hooks.c	Tue Nov 22 13:37:48 2011 +0000
@@ -683,14 +683,32 @@
         return rc;
 }
 
-static int iomem_has_perm(struct domain *d, unsigned long mfn, uint8_t access)
+struct iomem_has_perm_data {
+    struct domain_security_struct *ssec, *tsec;
+    u32 perm;
+};
+
+static int _iomem_has_perm(void *v, u32 sid, unsigned long start, unsigned long end)
 {
-    u32 perm;
-    u32 rsid;
+    struct iomem_has_perm_data *data = v;
+    struct avc_audit_data ad;
     int rc = -EPERM;
 
-    struct domain_security_struct *ssec, *tsec;
-    struct avc_audit_data ad;
+    AVC_AUDIT_DATA_INIT(&ad, DEV);
+    ad.device = start;
+
+    rc = avc_has_perm(data->ssec->sid, sid, SECCLASS_RESOURCE, data->perm, &ad);
+
+    if ( rc )
+        return rc;
+
+    return avc_has_perm(data->tsec->sid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
+}
+
+static int iomem_has_perm(struct domain *d, unsigned long start, unsigned long end, uint8_t access)
+{
+    struct iomem_has_perm_data data;
+    int rc;
 
     rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE,
                          resource_to_perm(access));
@@ -698,27 +716,14 @@
         return rc;
 
     if ( access )
-        perm = RESOURCE__ADD_IOMEM;
+        data.perm = RESOURCE__ADD_IOMEM;
     else
-        perm = RESOURCE__REMOVE_IOMEM;
+        data.perm = RESOURCE__REMOVE_IOMEM;
 
-    ssec = current->domain->ssid;
-    tsec = d->ssid;
+    data.ssec = current->domain->ssid;
+    data.tsec = d->ssid;
 
-    rc = security_iomem_sid(mfn, &rsid);
-    if ( rc )
-        return rc;
-
-    AVC_AUDIT_DATA_INIT(&ad, DEV);
-    ad.device = mfn;
-
-    rc = avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, perm, &ad);
-
-    if ( rc )
-        return rc;
-
-    return avc_has_perm(tsec->sid, rsid, SECCLASS_RESOURCE, 
-                        RESOURCE__USE, &ad);
+    return security_iterate_iomem_sids(start, end, _iomem_has_perm, &data);
 }
 
 static int flask_perfcontrol(void)
@@ -755,14 +760,33 @@
     return domain_has_perm(current->domain, d, SECCLASS_SHADOW, perm);
 }
 
-static int ioport_has_perm(struct domain *d, uint32_t ioport, uint8_t access)
+struct ioport_has_perm_data {
+    struct domain_security_struct *ssec, *tsec;
+    u32 perm;
+};
+
+static int _ioport_has_perm(void *v, u32 sid, unsigned long start, unsigned long end)
 {
-    u32 perm;
-    u32 rsid;
-    int rc = -EPERM;
+    struct ioport_has_perm_data *data = v;
+    struct avc_audit_data ad;
+    int rc;
 
-    struct avc_audit_data ad;
-    struct domain_security_struct *ssec, *tsec;
+    AVC_AUDIT_DATA_INIT(&ad, DEV);
+    ad.device = start;
+
+    rc = avc_has_perm(data->ssec->sid, sid, SECCLASS_RESOURCE, data->perm, &ad);
+
+    if ( rc )
+        return rc;
+
+    return avc_has_perm(data->tsec->sid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
+}
+
+
+static int ioport_has_perm(struct domain *d, uint32_t start, uint32_t end, uint8_t access)
+{
+    int rc;
+    struct ioport_has_perm_data data;
 
     rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE,
                          resource_to_perm(access));
@@ -771,29 +795,14 @@
         return rc;
 
     if ( access )
-        perm = RESOURCE__ADD_IOPORT;
+        data.perm = RESOURCE__ADD_IOPORT;
     else
-        perm = RESOURCE__REMOVE_IOPORT;
+        data.perm = RESOURCE__REMOVE_IOPORT;
 
-    ssec = current->domain->ssid;
-    tsec = d->ssid;
+    data.ssec = current->domain->ssid;
+    data.tsec = d->ssid;
 
-    rc = security_ioport_sid(ioport, &rsid);
-    if ( rc )
-        return rc;
-
-    AVC_AUDIT_DATA_INIT(&ad, DEV);
-    ad.device = ioport;
-
-    rc = avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, perm, &ad);
-    if ( rc )
-        return rc;
-
-    if ( access )
-        return avc_has_perm(tsec->sid, rsid, SECCLASS_RESOURCE, 
-                            RESOURCE__USE, &ad);
-    else
-        return rc;
+    return security_iterate_ioport_sids(start, end, _ioport_has_perm, &data);
 }
 
 static int flask_getpageframeinfo(struct page_info *page)
@@ -1208,31 +1217,25 @@
 
     if ( strcmp(name, "I/O Memory") == 0 )
     {
-        rc = iomem_has_perm(d, s, access);
+        rc = iomem_has_perm(d, s, e, access);
         if ( rc )
             return rc;
-
-        if ( s != e )
-            rc = iomem_has_perm(d, e, access);
     }
     else if ( strcmp(name, "Interrupts") == 0 )
     {
-        rc = irq_has_perm(d, s, access);
-        if ( rc )
-            return rc;
-
-        if ( s != e )
-            rc = irq_has_perm(d, e, access);
+        while (s <= e) {
+            rc = irq_has_perm(d, s, access);
+            if ( rc )
+                return rc;
+            s++;
+        }
     }
 #ifdef CONFIG_X86
     else if ( strcmp(name, "I/O Ports") == 0 )
     {
-        rc = ioport_has_perm(d, s, access);
+        rc = ioport_has_perm(d, s, e, access);
         if ( rc )
             return rc;
-
-        if ( s != e )
-            rc = ioport_has_perm(d, e, access);
     }
 #endif
 
diff -r db87ad0b5391 -r 4f4763690d74 xen/xsm/flask/include/security.h
--- a/xen/xsm/flask/include/security.h	Tue Nov 22 13:37:26 2011 +0000
+++ b/xen/xsm/flask/include/security.h	Tue Nov 22 13:37:48 2011 +0000
@@ -82,6 +82,14 @@
 int security_validate_transition(u32 oldsid, u32 newsid, u32 tasksid,
                                                                     u16 tclass);
 
+typedef int (*security_iterate_fn)(void *data, u32 sid, unsigned long start,
+                                                        unsigned long end);
+int security_iterate_iomem_sids(unsigned long start, unsigned long end,
+                                security_iterate_fn fn, void *data);
+
+int security_iterate_ioport_sids(u32 start, u32 end,
+                                security_iterate_fn fn, void *data);
+
 int security_ocontext_add(char *ocontext, unsigned long low,
                            unsigned long high, u32 sid);
 
diff -r db87ad0b5391 -r 4f4763690d74 xen/xsm/flask/ss/services.c
--- a/xen/xsm/flask/ss/services.c	Tue Nov 22 13:37:26 2011 +0000
+++ b/xen/xsm/flask/ss/services.c	Tue Nov 22 13:37:48 2011 +0000
@@ -1594,6 +1594,53 @@
     return rc;
 }
 
+int security_iterate_iomem_sids(unsigned long start, unsigned long end,
+                                security_iterate_fn fn, void *data)
+{
+    struct ocontext *c;
+    int rc = 0;
+
+    POLICY_RDLOCK;
+
+    c = policydb.ocontexts[OCON_IOMEM];
+    while (c && c->u.iomem.high_iomem < start)
+        c = c->next;
+
+    while (c && c->u.iomem.low_iomem <= end) {
+        if (!c->sid[0])
+        {
+            rc = sidtab_context_to_sid(&sidtab, &c->context[0], &c->sid[0]);
+            if ( rc )
+                goto out;
+        }
+        if (start < c->u.iomem.low_iomem) {
+            /* found a gap */
+            rc = fn(data, SECINITSID_IOMEM, start, c->u.iomem.low_iomem - 1);
+            if (rc)
+                goto out;
+            start = c->u.iomem.low_iomem;
+        }
+        if (end <= c->u.iomem.high_iomem) {
+            /* iteration ends in the middle of this range */
+            rc = fn(data, c->sid[0], start, end);
+            goto out;
+        }
+
+        rc = fn(data, c->sid[0], start, c->u.iomem.high_iomem);
+        if (rc)
+            goto out;
+        start = c->u.iomem.high_iomem + 1;
+
+        c = c->next;
+    }
+
+    rc = fn(data, SECINITSID_IOMEM, start, end);
+
+out:
+    POLICY_RDUNLOCK;
+    return rc;
+}
+
 /**
  * security_ioport_sid - Obtain the SID for an ioport.
  * @ioport: ioport
@@ -1635,6 +1682,53 @@
     return rc;
 }
 
+int security_iterate_ioport_sids(u32 start, u32 end,
+                                security_iterate_fn fn, void *data)
+{
+    struct ocontext *c;
+    int rc = 0;
+
+    POLICY_RDLOCK;
+
+    c = policydb.ocontexts[OCON_IOPORT];
+    while (c && c->u.ioport.high_ioport < start)
+        c = c->next;
+
+    while (c && c->u.ioport.low_ioport <= end) {
+        if (!c->sid[0])
+        {
+            rc = sidtab_context_to_sid(&sidtab, &c->context[0], &c->sid[0]);
+            if ( rc )
+                goto out;
+        }
+        if (start < c->u.ioport.low_ioport) {
+            /* found a gap */
+            rc = fn(data, SECINITSID_IOPORT, start, c->u.ioport.low_ioport - 1);
+            if (rc)
+                goto out;
+            start = c->u.ioport.low_ioport;
+        }
+        if (end <= c->u.ioport.high_ioport) {
+            /* iteration ends in the middle of this range */
+            rc = fn(data, c->sid[0], start, end);
+            goto out;
+        }
+
+        rc = fn(data, c->sid[0], start, c->u.ioport.high_ioport);
+        if (rc)
+            goto out;
+        start = c->u.ioport.high_ioport + 1;
+
+        c = c->next;
+    }
+
+    rc = fn(data, SECINITSID_IOPORT, start, end);
+
+out:
+    POLICY_RDUNLOCK;
+    return rc;
+}
+
 /**
  * security_device_sid - Obtain the SID for a PCI device.
  * @ioport: device
@@ -1963,6 +2057,7 @@
     int ret = 0;
     int ocon = 0;
     struct ocontext *c;
+    struct ocontext *prev;
     struct ocontext *add;
 
     if ( (ocon = determine_ocontext(ocontext)) < 0 )
@@ -2006,23 +2101,27 @@
         add->u.ioport.low_ioport = low;
         add->u.ioport.high_ioport = high;
 
+        prev = NULL;
         c = policydb.ocontexts[OCON_IOPORT];
-        while ( c )
-        {
-            if ( c->u.ioport.low_ioport <= add->u.ioport.high_ioport &&
-                 add->u.ioport.low_ioport <= c->u.ioport.high_ioport )
-            {
-                printk("%s: IO Port overlap with entry 0x%x - 0x%x\n",
-                       __FUNCTION__, c->u.ioport.low_ioport,
-                       c->u.ioport.high_ioport);
-                ret = -EINVAL;
-                break;
-            }
+
+        while ( c && c->u.ioport.high_ioport < low ) {
+            prev = c;
             c = c->next;
         }
 
-        if ( ret == 0 )
+        if (c && c->u.ioport.low_ioport <= high)
         {
+            printk("%s: IO Port overlap with entry 0x%x - 0x%x\n",
+                   __FUNCTION__, c->u.ioport.low_ioport,
+                   c->u.ioport.high_ioport);
+            ret = -EINVAL;
+            break;
+        }
+
+        if (prev) {
+            add->next = prev->next;
+            prev->next = add;
+        } else {
             add->next = policydb.ocontexts[OCON_IOPORT];
             policydb.ocontexts[OCON_IOPORT] = add;
         }
@@ -2032,23 +2131,27 @@
         add->u.iomem.low_iomem = low;
         add->u.iomem.high_iomem = high;
 
+        prev = NULL;
         c = policydb.ocontexts[OCON_IOMEM];
-        while ( c )
-        {
-            if ( c->u.iomem.low_iomem <= add->u.iomem.high_iomem &&
-                 add->u.iomem.low_iomem <= c->u.iomem.high_iomem )
-            {
-                printk("%s: IO Memory overlap with entry 0x%x - 0x%x\n",
-                       __FUNCTION__, c->u.iomem.low_iomem,
-                       c->u.iomem.high_iomem);
-                ret = -EINVAL;
-                break;
-            }
+
+        while ( c && c->u.iomem.high_iomem < low ) {
+            prev = c;
             c = c->next;
         }
 
-        if ( ret == 0 )
+        if (c && c->u.iomem.low_iomem <= high)
         {
+            printk("%s: IO Memory overlap with entry 0x%x - 0x%x\n",
+                   __FUNCTION__, c->u.iomem.low_iomem,
+                   c->u.iomem.high_iomem);
+            ret = -EINVAL;
+            break;
+        }
+
+        if (prev) {
+            add->next = prev->next;
+            prev->next = add;
+        } else {
             add->next = policydb.ocontexts[OCON_IOMEM];
             policydb.ocontexts[OCON_IOMEM] = add;
         }

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 19:44:23 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 19: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.xensource.com>)
	id 1RSwGS-0000ve-5d; Tue, 22 Nov 2011 19: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 1RSwGQ-0000vG-NR
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 19:44:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-27.messagelabs.com!1321990997!46958724!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6432 invoked from network); 22 Nov 2011 19:43:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Nov 2011 19:43: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 1RSwMB-00017Y-FS
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 19:50:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSwGH-0004eo-Fq
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 19:44:09 +0000
Message-Id: <E1RSwGH-0004eo-Fq@xenbits.xen.org>
Date: Tue, 22 Nov 2011 19:44:09 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] xsm/flask: fix resource list
	range checks
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Daniel De Graaf <dgdegra@tycho.nsa.gov>
# Date 1321969068 0
# Node ID 4f4763690d74ae4fb34aa8914f713812b1b19389
# Parent  db87ad0b5391b4b77643f6b095f445aca95ef705
xsm/flask: fix resource list range checks

The FLASK security checks for resource ranges were not implemented
correctly - only the permissions on the endpoints of a range were
checked, instead of all items contained in the range. This would allow
certain resources (I/O ports, I/O memory) to be used by domains in
contravention to security policy.

This also corrects a bug where adding overlapping resource ranges did
not trigger an error.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24177:d3859e348951
xen-unstable date:        Tue Nov 22 13:29:48 2011 +0000
---


diff -r db87ad0b5391 -r 4f4763690d74 xen/xsm/flask/hooks.c
--- a/xen/xsm/flask/hooks.c	Tue Nov 22 13:37:26 2011 +0000
+++ b/xen/xsm/flask/hooks.c	Tue Nov 22 13:37:48 2011 +0000
@@ -683,14 +683,32 @@
         return rc;
 }
 
-static int iomem_has_perm(struct domain *d, unsigned long mfn, uint8_t access)
+struct iomem_has_perm_data {
+    struct domain_security_struct *ssec, *tsec;
+    u32 perm;
+};
+
+static int _iomem_has_perm(void *v, u32 sid, unsigned long start, unsigned long end)
 {
-    u32 perm;
-    u32 rsid;
+    struct iomem_has_perm_data *data = v;
+    struct avc_audit_data ad;
     int rc = -EPERM;
 
-    struct domain_security_struct *ssec, *tsec;
-    struct avc_audit_data ad;
+    AVC_AUDIT_DATA_INIT(&ad, DEV);
+    ad.device = start;
+
+    rc = avc_has_perm(data->ssec->sid, sid, SECCLASS_RESOURCE, data->perm, &ad);
+
+    if ( rc )
+        return rc;
+
+    return avc_has_perm(data->tsec->sid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
+}
+
+static int iomem_has_perm(struct domain *d, unsigned long start, unsigned long end, uint8_t access)
+{
+    struct iomem_has_perm_data data;
+    int rc;
 
     rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE,
                          resource_to_perm(access));
@@ -698,27 +716,14 @@
         return rc;
 
     if ( access )
-        perm = RESOURCE__ADD_IOMEM;
+        data.perm = RESOURCE__ADD_IOMEM;
     else
-        perm = RESOURCE__REMOVE_IOMEM;
+        data.perm = RESOURCE__REMOVE_IOMEM;
 
-    ssec = current->domain->ssid;
-    tsec = d->ssid;
+    data.ssec = current->domain->ssid;
+    data.tsec = d->ssid;
 
-    rc = security_iomem_sid(mfn, &rsid);
-    if ( rc )
-        return rc;
-
-    AVC_AUDIT_DATA_INIT(&ad, DEV);
-    ad.device = mfn;
-
-    rc = avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, perm, &ad);
-
-    if ( rc )
-        return rc;
-
-    return avc_has_perm(tsec->sid, rsid, SECCLASS_RESOURCE, 
-                        RESOURCE__USE, &ad);
+    return security_iterate_iomem_sids(start, end, _iomem_has_perm, &data);
 }
 
 static int flask_perfcontrol(void)
@@ -755,14 +760,33 @@
     return domain_has_perm(current->domain, d, SECCLASS_SHADOW, perm);
 }
 
-static int ioport_has_perm(struct domain *d, uint32_t ioport, uint8_t access)
+struct ioport_has_perm_data {
+    struct domain_security_struct *ssec, *tsec;
+    u32 perm;
+};
+
+static int _ioport_has_perm(void *v, u32 sid, unsigned long start, unsigned long end)
 {
-    u32 perm;
-    u32 rsid;
-    int rc = -EPERM;
+    struct ioport_has_perm_data *data = v;
+    struct avc_audit_data ad;
+    int rc;
 
-    struct avc_audit_data ad;
-    struct domain_security_struct *ssec, *tsec;
+    AVC_AUDIT_DATA_INIT(&ad, DEV);
+    ad.device = start;
+
+    rc = avc_has_perm(data->ssec->sid, sid, SECCLASS_RESOURCE, data->perm, &ad);
+
+    if ( rc )
+        return rc;
+
+    return avc_has_perm(data->tsec->sid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
+}
+
+
+static int ioport_has_perm(struct domain *d, uint32_t start, uint32_t end, uint8_t access)
+{
+    int rc;
+    struct ioport_has_perm_data data;
 
     rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE,
                          resource_to_perm(access));
@@ -771,29 +795,14 @@
         return rc;
 
     if ( access )
-        perm = RESOURCE__ADD_IOPORT;
+        data.perm = RESOURCE__ADD_IOPORT;
     else
-        perm = RESOURCE__REMOVE_IOPORT;
+        data.perm = RESOURCE__REMOVE_IOPORT;
 
-    ssec = current->domain->ssid;
-    tsec = d->ssid;
+    data.ssec = current->domain->ssid;
+    data.tsec = d->ssid;
 
-    rc = security_ioport_sid(ioport, &rsid);
-    if ( rc )
-        return rc;
-
-    AVC_AUDIT_DATA_INIT(&ad, DEV);
-    ad.device = ioport;
-
-    rc = avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, perm, &ad);
-    if ( rc )
-        return rc;
-
-    if ( access )
-        return avc_has_perm(tsec->sid, rsid, SECCLASS_RESOURCE, 
-                            RESOURCE__USE, &ad);
-    else
-        return rc;
+    return security_iterate_ioport_sids(start, end, _ioport_has_perm, &data);
 }
 
 static int flask_getpageframeinfo(struct page_info *page)
@@ -1208,31 +1217,25 @@
 
     if ( strcmp(name, "I/O Memory") == 0 )
     {
-        rc = iomem_has_perm(d, s, access);
+        rc = iomem_has_perm(d, s, e, access);
         if ( rc )
             return rc;
-
-        if ( s != e )
-            rc = iomem_has_perm(d, e, access);
     }
     else if ( strcmp(name, "Interrupts") == 0 )
     {
-        rc = irq_has_perm(d, s, access);
-        if ( rc )
-            return rc;
-
-        if ( s != e )
-            rc = irq_has_perm(d, e, access);
+        while (s <= e) {
+            rc = irq_has_perm(d, s, access);
+            if ( rc )
+                return rc;
+            s++;
+        }
     }
 #ifdef CONFIG_X86
     else if ( strcmp(name, "I/O Ports") == 0 )
     {
-        rc = ioport_has_perm(d, s, access);
+        rc = ioport_has_perm(d, s, e, access);
         if ( rc )
             return rc;
-
-        if ( s != e )
-            rc = ioport_has_perm(d, e, access);
     }
 #endif
 
diff -r db87ad0b5391 -r 4f4763690d74 xen/xsm/flask/include/security.h
--- a/xen/xsm/flask/include/security.h	Tue Nov 22 13:37:26 2011 +0000
+++ b/xen/xsm/flask/include/security.h	Tue Nov 22 13:37:48 2011 +0000
@@ -82,6 +82,14 @@
 int security_validate_transition(u32 oldsid, u32 newsid, u32 tasksid,
                                                                     u16 tclass);
 
+typedef int (*security_iterate_fn)(void *data, u32 sid, unsigned long start,
+                                                        unsigned long end);
+int security_iterate_iomem_sids(unsigned long start, unsigned long end,
+                                security_iterate_fn fn, void *data);
+
+int security_iterate_ioport_sids(u32 start, u32 end,
+                                security_iterate_fn fn, void *data);
+
 int security_ocontext_add(char *ocontext, unsigned long low,
                            unsigned long high, u32 sid);
 
diff -r db87ad0b5391 -r 4f4763690d74 xen/xsm/flask/ss/services.c
--- a/xen/xsm/flask/ss/services.c	Tue Nov 22 13:37:26 2011 +0000
+++ b/xen/xsm/flask/ss/services.c	Tue Nov 22 13:37:48 2011 +0000
@@ -1594,6 +1594,53 @@
     return rc;
 }
 
+int security_iterate_iomem_sids(unsigned long start, unsigned long end,
+                                security_iterate_fn fn, void *data)
+{
+    struct ocontext *c;
+    int rc = 0;
+
+    POLICY_RDLOCK;
+
+    c = policydb.ocontexts[OCON_IOMEM];
+    while (c && c->u.iomem.high_iomem < start)
+        c = c->next;
+
+    while (c && c->u.iomem.low_iomem <= end) {
+        if (!c->sid[0])
+        {
+            rc = sidtab_context_to_sid(&sidtab, &c->context[0], &c->sid[0]);
+            if ( rc )
+                goto out;
+        }
+        if (start < c->u.iomem.low_iomem) {
+            /* found a gap */
+            rc = fn(data, SECINITSID_IOMEM, start, c->u.iomem.low_iomem - 1);
+            if (rc)
+                goto out;
+            start = c->u.iomem.low_iomem;
+        }
+        if (end <= c->u.iomem.high_iomem) {
+            /* iteration ends in the middle of this range */
+            rc = fn(data, c->sid[0], start, end);
+            goto out;
+        }
+
+        rc = fn(data, c->sid[0], start, c->u.iomem.high_iomem);
+        if (rc)
+            goto out;
+        start = c->u.iomem.high_iomem + 1;
+
+        c = c->next;
+    }
+
+    rc = fn(data, SECINITSID_IOMEM, start, end);
+
+out:
+    POLICY_RDUNLOCK;
+    return rc;
+}
+
 /**
  * security_ioport_sid - Obtain the SID for an ioport.
  * @ioport: ioport
@@ -1635,6 +1682,53 @@
     return rc;
 }
 
+int security_iterate_ioport_sids(u32 start, u32 end,
+                                security_iterate_fn fn, void *data)
+{
+    struct ocontext *c;
+    int rc = 0;
+
+    POLICY_RDLOCK;
+
+    c = policydb.ocontexts[OCON_IOPORT];
+    while (c && c->u.ioport.high_ioport < start)
+        c = c->next;
+
+    while (c && c->u.ioport.low_ioport <= end) {
+        if (!c->sid[0])
+        {
+            rc = sidtab_context_to_sid(&sidtab, &c->context[0], &c->sid[0]);
+            if ( rc )
+                goto out;
+        }
+        if (start < c->u.ioport.low_ioport) {
+            /* found a gap */
+            rc = fn(data, SECINITSID_IOPORT, start, c->u.ioport.low_ioport - 1);
+            if (rc)
+                goto out;
+            start = c->u.ioport.low_ioport;
+        }
+        if (end <= c->u.ioport.high_ioport) {
+            /* iteration ends in the middle of this range */
+            rc = fn(data, c->sid[0], start, end);
+            goto out;
+        }
+
+        rc = fn(data, c->sid[0], start, c->u.ioport.high_ioport);
+        if (rc)
+            goto out;
+        start = c->u.ioport.high_ioport + 1;
+
+        c = c->next;
+    }
+
+    rc = fn(data, SECINITSID_IOPORT, start, end);
+
+out:
+    POLICY_RDUNLOCK;
+    return rc;
+}
+
 /**
  * security_device_sid - Obtain the SID for a PCI device.
  * @ioport: device
@@ -1963,6 +2057,7 @@
     int ret = 0;
     int ocon = 0;
     struct ocontext *c;
+    struct ocontext *prev;
     struct ocontext *add;
 
     if ( (ocon = determine_ocontext(ocontext)) < 0 )
@@ -2006,23 +2101,27 @@
         add->u.ioport.low_ioport = low;
         add->u.ioport.high_ioport = high;
 
+        prev = NULL;
         c = policydb.ocontexts[OCON_IOPORT];
-        while ( c )
-        {
-            if ( c->u.ioport.low_ioport <= add->u.ioport.high_ioport &&
-                 add->u.ioport.low_ioport <= c->u.ioport.high_ioport )
-            {
-                printk("%s: IO Port overlap with entry 0x%x - 0x%x\n",
-                       __FUNCTION__, c->u.ioport.low_ioport,
-                       c->u.ioport.high_ioport);
-                ret = -EINVAL;
-                break;
-            }
+
+        while ( c && c->u.ioport.high_ioport < low ) {
+            prev = c;
             c = c->next;
         }
 
-        if ( ret == 0 )
+        if (c && c->u.ioport.low_ioport <= high)
         {
+            printk("%s: IO Port overlap with entry 0x%x - 0x%x\n",
+                   __FUNCTION__, c->u.ioport.low_ioport,
+                   c->u.ioport.high_ioport);
+            ret = -EINVAL;
+            break;
+        }
+
+        if (prev) {
+            add->next = prev->next;
+            prev->next = add;
+        } else {
             add->next = policydb.ocontexts[OCON_IOPORT];
             policydb.ocontexts[OCON_IOPORT] = add;
         }
@@ -2032,23 +2131,27 @@
         add->u.iomem.low_iomem = low;
         add->u.iomem.high_iomem = high;
 
+        prev = NULL;
         c = policydb.ocontexts[OCON_IOMEM];
-        while ( c )
-        {
-            if ( c->u.iomem.low_iomem <= add->u.iomem.high_iomem &&
-                 add->u.iomem.low_iomem <= c->u.iomem.high_iomem )
-            {
-                printk("%s: IO Memory overlap with entry 0x%x - 0x%x\n",
-                       __FUNCTION__, c->u.iomem.low_iomem,
-                       c->u.iomem.high_iomem);
-                ret = -EINVAL;
-                break;
-            }
+
+        while ( c && c->u.iomem.high_iomem < low ) {
+            prev = c;
             c = c->next;
         }
 
-        if ( ret == 0 )
+        if (c && c->u.iomem.low_iomem <= high)
         {
+            printk("%s: IO Memory overlap with entry 0x%x - 0x%x\n",
+                   __FUNCTION__, c->u.iomem.low_iomem,
+                   c->u.iomem.high_iomem);
+            ret = -EINVAL;
+            break;
+        }
+
+        if (prev) {
+            add->next = prev->next;
+            prev->next = add;
+        } else {
             add->next = policydb.ocontexts[OCON_IOMEM];
             policydb.ocontexts[OCON_IOMEM] = add;
         }

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 19:44:25 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 19:44:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSwGT-0000vn-8V; Tue, 22 Nov 2011 19:44: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 1RSwGR-0000vD-QW
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 19:44:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-27.messagelabs.com!1321991003!53802292!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22872 invoked from network); 22 Nov 2011 19:43:24 -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;
	22 Nov 2011 19:43:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSwM9-00017O-LU
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 19:50:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSwGF-0004e5-LG
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 19:44:07 +0000
Message-Id: <E1RSwGF-0004e5-LG@xenbits.xen.org>
Date: Tue, 22 Nov 2011 19:44:07 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86/vioapic: clear remote IRR
	when switching RTE to edge triggered mode
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1321968987 0
# Node ID 2ce06e513e0dd8486d358db0e226d8d0bd7da5fe
# Parent  5a00ccfc63915650b8e1a262c2cad8e8d8670612
x86/vioapic: clear remote IRR when switching RTE to edge triggered mode

Xen itself (as much as Linux) relies on this behavior, so it should
also emulate it properly. Not doing so reportedly gets in the way of
kexec inside a HVM guest.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Olaf Hering <olaf@aepfle.de>
xen-unstable changeset:   24168:9c350ab8d3ea
xen-unstable date:        Mon Nov 21 09:29:31 2011 +0100
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 5a00ccfc6391 -r 2ce06e513e0d xen/arch/x86/hvm/vioapic.c
--- a/xen/arch/x86/hvm/vioapic.c	Fri Nov 18 13:38:05 2011 +0000
+++ b/xen/arch/x86/hvm/vioapic.c	Tue Nov 22 13:36:27 2011 +0000
@@ -154,8 +154,9 @@
     {
         vlapic_adjust_i8259_target(d);
     }
-    else if ( (ent.fields.trig_mode == VIOAPIC_LEVEL_TRIG) &&
-              !ent.fields.mask &&
+    else if ( ent.fields.trig_mode == VIOAPIC_EDGE_TRIG )
+        pent->fields.remote_irr = 0;
+    else if ( !ent.fields.mask &&
               !ent.fields.remote_irr &&
               hvm_irq->gsi_assert_count[idx] )
     {

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 19:44:25 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 19:44:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSwGT-0000vn-8V; Tue, 22 Nov 2011 19:44: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 1RSwGR-0000vD-QW
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 19:44:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-27.messagelabs.com!1321991003!53802292!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22872 invoked from network); 22 Nov 2011 19:43:24 -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;
	22 Nov 2011 19:43:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSwM9-00017O-LU
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 19:50:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSwGF-0004e5-LG
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 19:44:07 +0000
Message-Id: <E1RSwGF-0004e5-LG@xenbits.xen.org>
Date: Tue, 22 Nov 2011 19:44:07 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86/vioapic: clear remote IRR
	when switching RTE to edge triggered mode
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1321968987 0
# Node ID 2ce06e513e0dd8486d358db0e226d8d0bd7da5fe
# Parent  5a00ccfc63915650b8e1a262c2cad8e8d8670612
x86/vioapic: clear remote IRR when switching RTE to edge triggered mode

Xen itself (as much as Linux) relies on this behavior, so it should
also emulate it properly. Not doing so reportedly gets in the way of
kexec inside a HVM guest.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Olaf Hering <olaf@aepfle.de>
xen-unstable changeset:   24168:9c350ab8d3ea
xen-unstable date:        Mon Nov 21 09:29:31 2011 +0100
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 5a00ccfc6391 -r 2ce06e513e0d xen/arch/x86/hvm/vioapic.c
--- a/xen/arch/x86/hvm/vioapic.c	Fri Nov 18 13:38:05 2011 +0000
+++ b/xen/arch/x86/hvm/vioapic.c	Tue Nov 22 13:36:27 2011 +0000
@@ -154,8 +154,9 @@
     {
         vlapic_adjust_i8259_target(d);
     }
-    else if ( (ent.fields.trig_mode == VIOAPIC_LEVEL_TRIG) &&
-              !ent.fields.mask &&
+    else if ( ent.fields.trig_mode == VIOAPIC_EDGE_TRIG )
+        pent->fields.remote_irr = 0;
+    else if ( !ent.fields.mask &&
               !ent.fields.remote_irr &&
               hvm_irq->gsi_assert_count[idx] )
     {

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 19:44:26 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 19:44:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSwGW-0000wQ-Ef; Tue, 22 Nov 2011 19:44:24 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSwGU-0000vF-SJ
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 19:44:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-216.messagelabs.com!1321991033!4586809!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27993 invoked from network); 22 Nov 2011 19:43:54 -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;
	22 Nov 2011 19:43:54 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSwMA-00017V-Qc
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 19:50:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSwGG-0004eZ-T6
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 19:44:08 +0000
Message-Id: <E1RSwGG-0004eZ-T6@xenbits.xen.org>
Date: Tue, 22 Nov 2011 19:44:08 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] xsm/flask: Use correct flag to
	detect writable grant mappings
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Daniel De Graaf <dgdegra@tycho.nsa.gov>
# Date 1321969046 0
# Node ID db87ad0b5391b4b77643f6b095f445aca95ef705
# Parent  5e37c6f2e5c8f964d84e6fa3aab7fd6ef602cf63
xsm/flask: Use correct flag to detect writable grant mappings

The flags passed to xsm_grant_mapref are the flags from the map
operation (GNTMAP_*), not status flags (GTF_*).

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24176:0db9c1fc8213
xen-unstable date:        Tue Nov 22 13:29:01 2011 +0000
---


diff -r 5e37c6f2e5c8 -r db87ad0b5391 xen/xsm/flask/hooks.c
--- a/xen/xsm/flask/hooks.c	Tue Nov 22 13:36:52 2011 +0000
+++ b/xen/xsm/flask/hooks.c	Tue Nov 22 13:37:26 2011 +0000
@@ -278,7 +278,7 @@
 {
     u32 perms = GRANT__MAP_READ;
 
-    if ( flags & GTF_writing )
+    if ( !(flags & GNTMAP_readonly) )
         perms |= GRANT__MAP_WRITE;
 
     return domain_has_perm(d1, d2, SECCLASS_GRANT, perms);

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 19:44:26 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 19:44:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSwGW-0000wQ-Ef; Tue, 22 Nov 2011 19:44:24 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSwGU-0000vF-SJ
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 19:44:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-216.messagelabs.com!1321991033!4586809!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27993 invoked from network); 22 Nov 2011 19:43:54 -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;
	22 Nov 2011 19:43:54 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSwMA-00017V-Qc
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 19:50:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSwGG-0004eZ-T6
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 19:44:08 +0000
Message-Id: <E1RSwGG-0004eZ-T6@xenbits.xen.org>
Date: Tue, 22 Nov 2011 19:44:08 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] xsm/flask: Use correct flag to
	detect writable grant mappings
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Daniel De Graaf <dgdegra@tycho.nsa.gov>
# Date 1321969046 0
# Node ID db87ad0b5391b4b77643f6b095f445aca95ef705
# Parent  5e37c6f2e5c8f964d84e6fa3aab7fd6ef602cf63
xsm/flask: Use correct flag to detect writable grant mappings

The flags passed to xsm_grant_mapref are the flags from the map
operation (GNTMAP_*), not status flags (GTF_*).

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24176:0db9c1fc8213
xen-unstable date:        Tue Nov 22 13:29:01 2011 +0000
---


diff -r 5e37c6f2e5c8 -r db87ad0b5391 xen/xsm/flask/hooks.c
--- a/xen/xsm/flask/hooks.c	Tue Nov 22 13:36:52 2011 +0000
+++ b/xen/xsm/flask/hooks.c	Tue Nov 22 13:37:26 2011 +0000
@@ -278,7 +278,7 @@
 {
     u32 perms = GRANT__MAP_READ;
 
-    if ( flags & GTF_writing )
+    if ( !(flags & GNTMAP_readonly) )
         perms |= GRANT__MAP_WRITE;
 
     return domain_has_perm(d1, d2, SECCLASS_GRANT, perms);

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 19:44:26 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 19:44:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSwGV-0000w8-Bg; Tue, 22 Nov 2011 19:44:23 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSwGU-0000vE-DB
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 19:44:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-216.messagelabs.com!1321991032!4578437!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27384 invoked from network); 22 Nov 2011 19:43:53 -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;
	22 Nov 2011 19:43:53 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSwMA-00017R-AS
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 19:50:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSwGG-0004eK-Ca
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 19:44:08 +0000
Message-Id: <E1RSwGG-0004eK-Ca@xenbits.xen.org>
Date: Tue, 22 Nov 2011 19:44:07 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86,
	vmx: Remove broken and unused __vmptrst().
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1321969012 0
# Node ID 5e37c6f2e5c8f964d84e6fa3aab7fd6ef602cf63
# Parent  2ce06e513e0dd8486d358db0e226d8d0bd7da5fe
x86,vmx: Remove broken and unused __vmptrst().

Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24170:334d3ec1130c
xen-unstable date:        Tue Nov 22 12:53:48 2011 +0000
---


diff -r 2ce06e513e0d -r 5e37c6f2e5c8 xen/include/asm-x86/hvm/vmx/vmx.h
--- a/xen/include/asm-x86/hvm/vmx/vmx.h	Tue Nov 22 13:36:27 2011 +0000
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h	Tue Nov 22 13:36:52 2011 +0000
@@ -247,15 +247,6 @@
                    : "memory");
 }
 
-static inline void __vmptrst(u64 addr)
-{
-    asm volatile ( VMPTRST_OPCODE
-                   MODRM_EAX_07
-                   :
-                   : "a" (&addr)
-                   : "memory");
-}
-
 static inline void __vmpclear(u64 addr)
 {
     asm volatile ( VMCLEAR_OPCODE

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

From xen-changelog-bounces@lists.xensource.com Tue Nov 22 19:44:26 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Nov 2011 19:44:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RSwGV-0000w8-Bg; Tue, 22 Nov 2011 19:44:23 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSwGU-0000vE-DB
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 19:44:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-216.messagelabs.com!1321991032!4578437!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27384 invoked from network); 22 Nov 2011 19:43:53 -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;
	22 Nov 2011 19:43:53 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSwMA-00017R-AS
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 19:50:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RSwGG-0004eK-Ca
	for xen-changelog@lists.xensource.com; Tue, 22 Nov 2011 19:44:08 +0000
Message-Id: <E1RSwGG-0004eK-Ca@xenbits.xen.org>
Date: Tue, 22 Nov 2011 19:44:07 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86,
	vmx: Remove broken and unused __vmptrst().
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1321969012 0
# Node ID 5e37c6f2e5c8f964d84e6fa3aab7fd6ef602cf63
# Parent  2ce06e513e0dd8486d358db0e226d8d0bd7da5fe
x86,vmx: Remove broken and unused __vmptrst().

Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24170:334d3ec1130c
xen-unstable date:        Tue Nov 22 12:53:48 2011 +0000
---


diff -r 2ce06e513e0d -r 5e37c6f2e5c8 xen/include/asm-x86/hvm/vmx/vmx.h
--- a/xen/include/asm-x86/hvm/vmx/vmx.h	Tue Nov 22 13:36:27 2011 +0000
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h	Tue Nov 22 13:36:52 2011 +0000
@@ -247,15 +247,6 @@
                    : "memory");
 }
 
-static inline void __vmptrst(u64 addr)
-{
-    asm volatile ( VMPTRST_OPCODE
-                   MODRM_EAX_07
-                   :
-                   : "a" (&addr)
-                   : "memory");
-}
-
 static inline void __vmpclear(u64 addr)
 {
     asm volatile ( VMCLEAR_OPCODE

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 23 14:44:30 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 23 Nov 2011 14:44:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RTE3k-0006s6-Kv; Wed, 23 Nov 2011 14:44:24 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RTE3j-0006rq-69
	for xen-changelog@lists.xensource.com; Wed, 23 Nov 2011 14:44:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-174.messagelabs.com!1322059431!2738737!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19367 invoked from network); 23 Nov 2011 14:43:52 -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;
	23 Nov 2011 14:43:52 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RTE9O-0007Q7-5b
	for xen-changelog@lists.xensource.com; Wed, 23 Nov 2011 14:50:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RTE3T-0003Df-9B
	for xen-changelog@lists.xensource.com; Wed, 23 Nov 2011 14:44:07 +0000
Message-Id: <E1RTE3T-0003Df-9B@xenbits.xen.org>
Date: Wed, 23 Nov 2011 14:44:06 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] Update QEMU_TAG
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1321988584 0
# Node ID c613d436ca09d21ae6aaafaf51e22e8cd65f6758
# Parent  4f4763690d74ae4fb34aa8914f713812b1b19389
Update QEMU_TAG
---


diff -r 4f4763690d74 -r c613d436ca09 Config.mk
--- a/Config.mk	Tue Nov 22 13:37:48 2011 +0000
+++ b/Config.mk	Tue Nov 22 19:03:04 2011 +0000
@@ -179,10 +179,9 @@
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG := xen-4.1.2
-#QEMU_TAG ?= e073e69457b4d99b6da0b6536296e3498f7f6599
-# Fri Feb 11 17:54:51 2011 +0000
-# qemu-xen: fix segfault with empty cdroms
+QEMU_TAG ?= 3981d218912e186cb4205ee6732f446c177a36a2
+# Tue Nov 22 18:49:15 2011 +0000
+# qemu-xen: Don't redefine libpci (3.1.7) defines.
 
 # Optional components
 XENSTAT_XENTOP     ?= y

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 23 14:44:30 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 23 Nov 2011 14:44:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RTE3k-0006s6-Kv; Wed, 23 Nov 2011 14:44:24 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RTE3j-0006rq-69
	for xen-changelog@lists.xensource.com; Wed, 23 Nov 2011 14:44:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-174.messagelabs.com!1322059431!2738737!1
X-Originating-IP: [50.57.168.107]
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19367 invoked from network); 23 Nov 2011 14:43:52 -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;
	23 Nov 2011 14:43:52 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RTE9O-0007Q7-5b
	for xen-changelog@lists.xensource.com; Wed, 23 Nov 2011 14:50:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RTE3T-0003Df-9B
	for xen-changelog@lists.xensource.com; Wed, 23 Nov 2011 14:44:07 +0000
Message-Id: <E1RTE3T-0003Df-9B@xenbits.xen.org>
Date: Wed, 23 Nov 2011 14:44:06 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] Update QEMU_TAG
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1321988584 0
# Node ID c613d436ca09d21ae6aaafaf51e22e8cd65f6758
# Parent  4f4763690d74ae4fb34aa8914f713812b1b19389
Update QEMU_TAG
---


diff -r 4f4763690d74 -r c613d436ca09 Config.mk
--- a/Config.mk	Tue Nov 22 13:37:48 2011 +0000
+++ b/Config.mk	Tue Nov 22 19:03:04 2011 +0000
@@ -179,10 +179,9 @@
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG := xen-4.1.2
-#QEMU_TAG ?= e073e69457b4d99b6da0b6536296e3498f7f6599
-# Fri Feb 11 17:54:51 2011 +0000
-# qemu-xen: fix segfault with empty cdroms
+QEMU_TAG ?= 3981d218912e186cb4205ee6732f446c177a36a2
+# Tue Nov 22 18:49:15 2011 +0000
+# qemu-xen: Don't redefine libpci (3.1.7) defines.
 
 # Optional components
 XENSTAT_XENTOP     ?= y

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 17:33:25 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 17:33:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RV54w-0007Qh-Jn; Mon, 28 Nov 2011 17:33:18 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1RV54u-0007QQ-IK
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 17:33:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1322501558!5016440!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21176 invoked from network); 28 Nov 2011 17:32:39 -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;
	28 Nov 2011 17:32:39 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1RV5Ai-0005wV-D1
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 17:39:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1RV54h-0000B6-9C
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 17:33:03 +0000
Date: Mon, 28 Nov 2011 17:33:03 +0000
Message-Id: <E1RV54h-0000B6-9C@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] qemu-dm: open char devices
	"file:..." with O_APPEND
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

commit 89daacab7035d408f32f2cb1acf68c96d6cbefed
Author: Ian Jackson <ian.jackson@eu.citrix.com>
Date:   Mon Nov 28 17:16:52 2011 +0000

    qemu-dm: open char devices "file:..." with O_APPEND
    
    The "file:..." character open method is used by serial and parallel
    ports, to divert the output to a file (and these devices never produce
    any input).  This is like a logfile, and so should be opened for
    append.
    
    In qemu-xen-unstable, this is used only for the qemu stderr by libxl.
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 qemu-char.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/qemu-char.c b/qemu-char.c
index 35e428d..324ed16 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -588,7 +588,7 @@ static CharDriverState *qemu_chr_open_file_out(const char *file_out)
 {
     int fd_out;
 
-    TFR(fd_out = open(file_out, O_WRONLY | O_TRUNC | O_CREAT | O_BINARY, 0666));
+    TFR(fd_out = open(file_out, O_WRONLY | O_TRUNC | O_CREAT | O_BINARY | O_APPEND, 0666));
     if (fd_out < 0)
         return NULL;
     return qemu_chr_open_fd(-1, fd_out);
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 17:33:25 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 17:33:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RV54w-0007Qh-Jn; Mon, 28 Nov 2011 17:33:18 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1RV54u-0007QQ-IK
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 17:33:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1322501558!5016440!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21176 invoked from network); 28 Nov 2011 17:32:39 -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;
	28 Nov 2011 17:32:39 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1RV5Ai-0005wV-D1
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 17:39:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1RV54h-0000B6-9C
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 17:33:03 +0000
Date: Mon, 28 Nov 2011 17:33:03 +0000
Message-Id: <E1RV54h-0000B6-9C@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] qemu-dm: open char devices
	"file:..." with O_APPEND
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

commit 89daacab7035d408f32f2cb1acf68c96d6cbefed
Author: Ian Jackson <ian.jackson@eu.citrix.com>
Date:   Mon Nov 28 17:16:52 2011 +0000

    qemu-dm: open char devices "file:..." with O_APPEND
    
    The "file:..." character open method is used by serial and parallel
    ports, to divert the output to a file (and these devices never produce
    any input).  This is like a logfile, and so should be opened for
    append.
    
    In qemu-xen-unstable, this is used only for the qemu stderr by libxl.
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 qemu-char.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/qemu-char.c b/qemu-char.c
index 35e428d..324ed16 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -588,7 +588,7 @@ static CharDriverState *qemu_chr_open_file_out(const char *file_out)
 {
     int fd_out;
 
-    TFR(fd_out = open(file_out, O_WRONLY | O_TRUNC | O_CREAT | O_BINARY, 0666));
+    TFR(fd_out = open(file_out, O_WRONLY | O_TRUNC | O_CREAT | O_BINARY | O_APPEND, 0666));
     if (fd_out < 0)
         return NULL;
     return qemu_chr_open_fd(-1, fd_out);
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:22 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhL-0008JI-0J; Mon, 28 Nov 2011 23:33: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 1RVAhK-0008J0-0T
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-27.messagelabs.com!1322523122!55221062!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30817 invoked from network); 28 Nov 2011 23:32:03 -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;
	28 Nov 2011 23:32:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnD-0001iK-Mv
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhC-0000kq-G4
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:10 +0000
Message-Id: <E1RVAhC-0000kq-G4@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xsm/flask: Use correct flag to
	detect writable grant mappings
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Daniel De Graaf <dgdegra@tycho.nsa.gov>
# Date 1321968541 0
# Node ID 0db9c1fc8213013f48110cb19641a286140c0563
# Parent  2bc6c29b14a791e63e396f830e79adf790668d24
xsm/flask: Use correct flag to detect writable grant mappings

The flags passed to xsm_grant_mapref are the flags from the map
operation (GNTMAP_*), not status flags (GTF_*).

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 2bc6c29b14a7 -r 0db9c1fc8213 xen/xsm/flask/hooks.c
--- a/xen/xsm/flask/hooks.c	Tue Nov 22 13:27:19 2011 +0000
+++ b/xen/xsm/flask/hooks.c	Tue Nov 22 13:29:01 2011 +0000
@@ -279,7 +279,7 @@
 {
     u32 perms = GRANT__MAP_READ;
 
-    if ( flags & GTF_writing )
+    if ( !(flags & GNTMAP_readonly) )
         perms |= GRANT__MAP_WRITE;
 
     return domain_has_perm(d1, d2, SECCLASS_GRANT, perms);

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:22 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhL-0008JI-0J; Mon, 28 Nov 2011 23:33: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 1RVAhK-0008J0-0T
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-27.messagelabs.com!1322523122!55221062!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30817 invoked from network); 28 Nov 2011 23:32:03 -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;
	28 Nov 2011 23:32:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnD-0001iK-Mv
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhC-0000kq-G4
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:10 +0000
Message-Id: <E1RVAhC-0000kq-G4@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xsm/flask: Use correct flag to
	detect writable grant mappings
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Daniel De Graaf <dgdegra@tycho.nsa.gov>
# Date 1321968541 0
# Node ID 0db9c1fc8213013f48110cb19641a286140c0563
# Parent  2bc6c29b14a791e63e396f830e79adf790668d24
xsm/flask: Use correct flag to detect writable grant mappings

The flags passed to xsm_grant_mapref are the flags from the map
operation (GNTMAP_*), not status flags (GTF_*).

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 2bc6c29b14a7 -r 0db9c1fc8213 xen/xsm/flask/hooks.c
--- a/xen/xsm/flask/hooks.c	Tue Nov 22 13:27:19 2011 +0000
+++ b/xen/xsm/flask/hooks.c	Tue Nov 22 13:29:01 2011 +0000
@@ -279,7 +279,7 @@
 {
     u32 perms = GRANT__MAP_READ;
 
-    if ( flags & GTF_writing )
+    if ( !(flags & GNTMAP_readonly) )
         perms |= GRANT__MAP_WRITE;
 
     return domain_has_perm(d1, d2, SECCLASS_GRANT, perms);

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:23 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhJ-0008J3-Th; Mon, 28 Nov 2011 23: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 1RVAhI-0008Iq-Si
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1322523134!50332076!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19743 invoked from network); 28 Nov 2011 23:32: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;
	28 Nov 2011 23:32: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 1RVAnC-0001iB-89
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhB-0000k7-0T
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:09 +0000
Message-Id: <E1RVAhB-0000k7-0T@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] amd iommu: Fix incorrect definitions.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1321968371 0
# Node ID 28c295c82ff6d7c022219ca7588f42458360ffb1
# Parent  883f1c35810e9bb2a84e27d0370e007e16fcb7e3
amd iommu: Fix incorrect definitions.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 883f1c35810e -r 28c295c82ff6 xen/include/asm-x86/hvm/svm/amd-iommu-defs.h
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h	Tue Nov 22 13:25:42 2011 +0000
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h	Tue Nov 22 13:26:11 2011 +0000
@@ -293,10 +293,8 @@
 #define IOMMU_CONTROL_EVENT_LOG_INT_SHIFT		3
 #define IOMMU_CONTROL_COMP_WAIT_INT_MASK		0x00000010
 #define IOMMU_CONTROL_COMP_WAIT_INT_SHIFT		4
-#define IOMMU_CONTROL_TRANSLATION_CHECK_DISABLE_MASK	0x00000020
-#define IOMMU_CONTROL_TRANSLATION_CHECK_DISABLE_SHIFT	5
-#define IOMMU_CONTROL_INVALIDATION_TIMEOUT_MASK		0x000000C0
-#define IOMMU_CONTROL_INVALIDATION_TIMEOUT_SHIFT	6
+#define IOMMU_CONTROL_INVALIDATION_TIMEOUT_MASK		0x000000E0
+#define IOMMU_CONTROL_INVALIDATION_TIMEOUT_SHIFT	5
 #define IOMMU_CONTROL_PASS_POSTED_WRITE_MASK		0x00000100
 #define IOMMU_CONTROL_PASS_POSTED_WRITE_SHIFT		8
 #define IOMMU_CONTROL_RESP_PASS_POSTED_WRITE_MASK	0x00000200

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:23 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhJ-0008J3-Th; Mon, 28 Nov 2011 23: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 1RVAhI-0008Iq-Si
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1322523134!50332076!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19743 invoked from network); 28 Nov 2011 23:32: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;
	28 Nov 2011 23:32: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 1RVAnC-0001iB-89
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhB-0000k7-0T
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:09 +0000
Message-Id: <E1RVAhB-0000k7-0T@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] amd iommu: Fix incorrect definitions.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1321968371 0
# Node ID 28c295c82ff6d7c022219ca7588f42458360ffb1
# Parent  883f1c35810e9bb2a84e27d0370e007e16fcb7e3
amd iommu: Fix incorrect definitions.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 883f1c35810e -r 28c295c82ff6 xen/include/asm-x86/hvm/svm/amd-iommu-defs.h
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h	Tue Nov 22 13:25:42 2011 +0000
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h	Tue Nov 22 13:26:11 2011 +0000
@@ -293,10 +293,8 @@
 #define IOMMU_CONTROL_EVENT_LOG_INT_SHIFT		3
 #define IOMMU_CONTROL_COMP_WAIT_INT_MASK		0x00000010
 #define IOMMU_CONTROL_COMP_WAIT_INT_SHIFT		4
-#define IOMMU_CONTROL_TRANSLATION_CHECK_DISABLE_MASK	0x00000020
-#define IOMMU_CONTROL_TRANSLATION_CHECK_DISABLE_SHIFT	5
-#define IOMMU_CONTROL_INVALIDATION_TIMEOUT_MASK		0x000000C0
-#define IOMMU_CONTROL_INVALIDATION_TIMEOUT_SHIFT	6
+#define IOMMU_CONTROL_INVALIDATION_TIMEOUT_MASK		0x000000E0
+#define IOMMU_CONTROL_INVALIDATION_TIMEOUT_SHIFT	5
 #define IOMMU_CONTROL_PASS_POSTED_WRITE_MASK		0x00000100
 #define IOMMU_CONTROL_PASS_POSTED_WRITE_SHIFT		8
 #define IOMMU_CONTROL_RESP_PASS_POSTED_WRITE_MASK	0x00000200

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:24 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhI-0008Ir-Qr; Mon, 28 Nov 2011 23:33:16 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhH-0008Ii-Pz
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-27.messagelabs.com!1322523129!54944090!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.0 required=7.0 tests=BODY_RANDOMQ
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19955 invoked from network); 28 Nov 2011 23:32:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Nov 2011 23:32: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 1RVAnB-0001i5-BN
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhA-0000jd-0K
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:08 +0000
Message-Id: <E1RVAhA-0000jd-0K@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86,
	waitqueue: Allocate whole page for shadow stack.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1321966821 0
# Node ID fe80909663c1b1765d9b3407b8dcea88bc318d53
# Parent  334d3ec1130c3890b848cf304c0ecadf729b4127
x86,waitqueue: Allocate whole page for shadow stack.

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


diff -r 334d3ec1130c -r fe80909663c1 xen/common/wait.c
--- a/xen/common/wait.c	Tue Nov 22 12:53:48 2011 +0000
+++ b/xen/common/wait.c	Tue Nov 22 13:00:21 2011 +0000
@@ -33,7 +33,7 @@
      * hypervisor context before sleeping (descheduling), setjmp/longjmp-style.
      */
     void *esp;
-    char stack[3000];
+    char *stack;
 #endif
 };
 
@@ -45,6 +45,15 @@
     if ( wqv == NULL )
         return -ENOMEM;
 
+#ifdef CONFIG_X86
+    wqv->stack = alloc_xenheap_page();
+    if ( wqv->stack == NULL )
+    {
+        xfree(wqv);
+        return -ENOMEM;
+    }
+#endif
+
     INIT_LIST_HEAD(&wqv->list);
     wqv->vcpu = v;
 
@@ -62,6 +71,9 @@
         return;
 
     BUG_ON(!list_empty(&wqv->list));
+#ifdef CONFIG_X86
+    free_xenheap_page(wqv->stack);
+#endif
     xfree(wqv);
 
     v->waitqueue_vcpu = NULL;
@@ -114,7 +126,7 @@
         : "=S" (wqv->esp)
         : "c" (cpu_info), "D" (wqv->stack)
         : "memory" );
-    BUG_ON((cpu_info - (char *)wqv->esp) > sizeof(wqv->stack));
+    BUG_ON((cpu_info - (char *)wqv->esp) > PAGE_SIZE);
 }
 
 static void __finish_wait(struct waitqueue_vcpu *wqv)

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:24 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhI-0008Ir-Qr; Mon, 28 Nov 2011 23:33:16 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhH-0008Ii-Pz
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-27.messagelabs.com!1322523129!54944090!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.0 required=7.0 tests=BODY_RANDOMQ
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19955 invoked from network); 28 Nov 2011 23:32:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Nov 2011 23:32: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 1RVAnB-0001i5-BN
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhA-0000jd-0K
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:08 +0000
Message-Id: <E1RVAhA-0000jd-0K@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86,
	waitqueue: Allocate whole page for shadow stack.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1321966821 0
# Node ID fe80909663c1b1765d9b3407b8dcea88bc318d53
# Parent  334d3ec1130c3890b848cf304c0ecadf729b4127
x86,waitqueue: Allocate whole page for shadow stack.

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


diff -r 334d3ec1130c -r fe80909663c1 xen/common/wait.c
--- a/xen/common/wait.c	Tue Nov 22 12:53:48 2011 +0000
+++ b/xen/common/wait.c	Tue Nov 22 13:00:21 2011 +0000
@@ -33,7 +33,7 @@
      * hypervisor context before sleeping (descheduling), setjmp/longjmp-style.
      */
     void *esp;
-    char stack[3000];
+    char *stack;
 #endif
 };
 
@@ -45,6 +45,15 @@
     if ( wqv == NULL )
         return -ENOMEM;
 
+#ifdef CONFIG_X86
+    wqv->stack = alloc_xenheap_page();
+    if ( wqv->stack == NULL )
+    {
+        xfree(wqv);
+        return -ENOMEM;
+    }
+#endif
+
     INIT_LIST_HEAD(&wqv->list);
     wqv->vcpu = v;
 
@@ -62,6 +71,9 @@
         return;
 
     BUG_ON(!list_empty(&wqv->list));
+#ifdef CONFIG_X86
+    free_xenheap_page(wqv->stack);
+#endif
     xfree(wqv);
 
     v->waitqueue_vcpu = NULL;
@@ -114,7 +126,7 @@
         : "=S" (wqv->esp)
         : "c" (cpu_info), "D" (wqv->stack)
         : "memory" );
-    BUG_ON((cpu_info - (char *)wqv->esp) > sizeof(wqv->stack));
+    BUG_ON((cpu_info - (char *)wqv->esp) > PAGE_SIZE);
 }
 
 static void __finish_wait(struct waitqueue_vcpu *wqv)

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:26 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhR-0008MQ-Ol; Mon, 28 Nov 2011 23:33:25 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhP-0008JC-TL
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1322523165!5025871!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15851 invoked from network); 28 Nov 2011 23:32:46 -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;
	28 Nov 2011 23:32:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnC-0001iE-Ov
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhB-0000kM-GQ
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:09 +0000
Message-Id: <E1RVAhB-0000kM-GQ@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] amd iommu: Factor out iommu command
	handling functions, 
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1321968406 0
# Node ID 9a5e973305a84e868c6740626b76008c5476bfe9
# Parent  28c295c82ff6d7c022219ca7588f42458360ffb1
amd iommu: Factor out iommu command handling functions,
and move them into a new file.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 28c295c82ff6 -r 9a5e973305a8 xen/drivers/passthrough/amd/Makefile
--- a/xen/drivers/passthrough/amd/Makefile	Tue Nov 22 13:26:11 2011 +0000
+++ b/xen/drivers/passthrough/amd/Makefile	Tue Nov 22 13:26:46 2011 +0000
@@ -4,3 +4,4 @@
 obj-y += pci_amd_iommu.o
 obj-bin-y += iommu_acpi.init.o
 obj-y += iommu_intr.o
+obj-y += iommu_cmd.o
diff -r 28c295c82ff6 -r 9a5e973305a8 xen/drivers/passthrough/amd/iommu_cmd.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/drivers/passthrough/amd/iommu_cmd.c	Tue Nov 22 13:26:46 2011 +0000
@@ -0,0 +1,382 @@
+/*
+ * Copyright (C) 2011 Advanced Micro Devices, Inc.
+ * Author: Leo Duran <leo.duran@amd.com>
+ * Author: Wei Wang <wei.wang2@amd.com> - adapted to xen
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ */
+
+#include <xen/sched.h>
+#include <xen/hvm/iommu.h>
+#include <asm/amd-iommu.h>
+#include <asm/hvm/svm/amd-iommu-proto.h>
+#include "../ats.h"
+
+static int queue_iommu_command(struct amd_iommu *iommu, u32 cmd[])
+{
+    u32 tail, head, *cmd_buffer;
+    int i;
+
+    tail = iommu->cmd_buffer_tail;
+    if ( ++tail == iommu->cmd_buffer.entries )
+        tail = 0;
+
+    head = get_field_from_reg_u32(readl(iommu->mmio_base + 
+                                        IOMMU_CMD_BUFFER_HEAD_OFFSET),
+                                  IOMMU_CMD_BUFFER_HEAD_MASK,
+                                  IOMMU_CMD_BUFFER_HEAD_SHIFT);
+    if ( head != tail )
+    {
+        cmd_buffer = (u32 *)(iommu->cmd_buffer.buffer +
+                             (iommu->cmd_buffer_tail *
+                             IOMMU_CMD_BUFFER_ENTRY_SIZE));
+
+        for ( i = 0; i < IOMMU_CMD_BUFFER_U32_PER_ENTRY; i++ )
+            cmd_buffer[i] = cmd[i];
+
+        iommu->cmd_buffer_tail = tail;
+        return 1;
+    }
+
+    return 0;
+}
+
+static void commit_iommu_command_buffer(struct amd_iommu *iommu)
+{
+    u32 tail;
+
+    set_field_in_reg_u32(iommu->cmd_buffer_tail, 0,
+                         IOMMU_CMD_BUFFER_TAIL_MASK,
+                         IOMMU_CMD_BUFFER_TAIL_SHIFT, &tail);
+    writel(tail, iommu->mmio_base+IOMMU_CMD_BUFFER_TAIL_OFFSET);
+}
+
+int send_iommu_command(struct amd_iommu *iommu, u32 cmd[])
+{
+    if ( queue_iommu_command(iommu, cmd) )
+    {
+        commit_iommu_command_buffer(iommu);
+        return 1;
+    }
+
+    return 0;
+}
+
+static void flush_command_buffer(struct amd_iommu *iommu)
+{
+    u32 cmd[4], status;
+    int loop_count, comp_wait;
+
+    /* clear 'ComWaitInt' in status register (WIC) */
+    set_field_in_reg_u32(IOMMU_CONTROL_ENABLED, 0,
+                         IOMMU_STATUS_COMP_WAIT_INT_MASK,
+                         IOMMU_STATUS_COMP_WAIT_INT_SHIFT, &status);
+    writel(status, iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
+
+    /* send an empty COMPLETION_WAIT command to flush command buffer */
+    cmd[3] = cmd[2] = 0;
+    set_field_in_reg_u32(IOMMU_CMD_COMPLETION_WAIT, 0,
+                         IOMMU_CMD_OPCODE_MASK,
+                         IOMMU_CMD_OPCODE_SHIFT, &cmd[1]);
+    set_field_in_reg_u32(IOMMU_CONTROL_ENABLED, 0,
+                         IOMMU_COMP_WAIT_I_FLAG_MASK,
+                         IOMMU_COMP_WAIT_I_FLAG_SHIFT, &cmd[0]);
+    send_iommu_command(iommu, cmd);
+
+    /* Make loop_count long enough for polling completion wait bit */
+    loop_count = 1000;
+    do {
+        status = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
+        comp_wait = get_field_from_reg_u32(status,
+                                           IOMMU_STATUS_COMP_WAIT_INT_MASK,
+                                           IOMMU_STATUS_COMP_WAIT_INT_SHIFT);
+        --loop_count;
+    } while ( !comp_wait && loop_count );
+
+    if ( comp_wait )
+    {
+        /* clear 'ComWaitInt' in status register (WIC) */
+        status &= IOMMU_STATUS_COMP_WAIT_INT_MASK;
+        writel(status, iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
+        return;
+    }
+    AMD_IOMMU_DEBUG("Warning: ComWaitInt bit did not assert!\n");
+}
+
+/* Build low level iommu command messages */
+static void invalidate_iommu_pages(struct amd_iommu *iommu,
+                                   u64 io_addr, u16 domain_id, u16 order)
+{
+    u64 addr_lo, addr_hi;
+    u32 cmd[4], entry;
+    int sflag = 0, pde = 0;
+
+    ASSERT ( order == 0 || order == 9 || order == 18 );
+
+    /* All pages associated with the domainID are invalidated */
+    if ( order || (io_addr == INV_IOMMU_ALL_PAGES_ADDRESS ) )
+    {
+        sflag = 1;
+        pde = 1;
+    }
+
+    /* If sflag == 1, the size of the invalidate command is determined
+     by the first zero bit in the address starting from Address[12] */
+    if ( order )
+    {
+        u64 mask = 1ULL << (order - 1 + PAGE_SHIFT);
+        io_addr &= ~mask;
+        io_addr |= mask - 1;
+    }
+
+    addr_lo = io_addr & DMA_32BIT_MASK;
+    addr_hi = io_addr >> 32;
+
+    set_field_in_reg_u32(domain_id, 0,
+                         IOMMU_INV_IOMMU_PAGES_DOMAIN_ID_MASK,
+                         IOMMU_INV_IOMMU_PAGES_DOMAIN_ID_SHIFT, &entry);
+    set_field_in_reg_u32(IOMMU_CMD_INVALIDATE_IOMMU_PAGES, entry,
+                         IOMMU_CMD_OPCODE_MASK, IOMMU_CMD_OPCODE_SHIFT,
+                         &entry);
+    cmd[1] = entry;
+
+    set_field_in_reg_u32(sflag, 0,
+                         IOMMU_INV_IOMMU_PAGES_S_FLAG_MASK,
+                         IOMMU_INV_IOMMU_PAGES_S_FLAG_SHIFT, &entry);
+    set_field_in_reg_u32(pde, entry,
+                         IOMMU_INV_IOMMU_PAGES_PDE_FLAG_MASK,
+                         IOMMU_INV_IOMMU_PAGES_PDE_FLAG_SHIFT, &entry);
+    set_field_in_reg_u32((u32)addr_lo >> PAGE_SHIFT, entry,
+                         IOMMU_INV_IOMMU_PAGES_ADDR_LOW_MASK,
+                         IOMMU_INV_IOMMU_PAGES_ADDR_LOW_SHIFT, &entry);
+    cmd[2] = entry;
+
+    set_field_in_reg_u32((u32)addr_hi, 0,
+                         IOMMU_INV_IOMMU_PAGES_ADDR_HIGH_MASK,
+                         IOMMU_INV_IOMMU_PAGES_ADDR_HIGH_SHIFT, &entry);
+    cmd[3] = entry;
+
+    cmd[0] = 0;
+    send_iommu_command(iommu, cmd);
+}
+
+static void invalidate_iotlb_pages(struct amd_iommu *iommu,
+                                   u16 maxpend, u32 pasid, u16 queueid,
+                                   u64 io_addr, u16 dev_id, u16 order)
+{
+    u64 addr_lo, addr_hi;
+    u32 cmd[4], entry;
+    int sflag = 0;
+
+    ASSERT ( order == 0 || order == 9 || order == 18 );
+
+    if ( order || (io_addr == INV_IOMMU_ALL_PAGES_ADDRESS ) )
+        sflag = 1;
+
+    /* If sflag == 1, the size of the invalidate command is determined
+     by the first zero bit in the address starting from Address[12] */
+    if ( order )
+    {
+        u64 mask = 1ULL << (order - 1 + PAGE_SHIFT);
+        io_addr &= ~mask;
+        io_addr |= mask - 1;
+    }
+
+    addr_lo = io_addr & DMA_32BIT_MASK;
+    addr_hi = io_addr >> 32;
+
+    set_field_in_reg_u32(dev_id, 0,
+                         IOMMU_INV_IOTLB_PAGES_DEVICE_ID_MASK,
+                         IOMMU_INV_IOTLB_PAGES_DEVICE_ID_SHIFT, &entry);
+
+    set_field_in_reg_u32(maxpend, entry,
+                         IOMMU_INV_IOTLB_PAGES_MAXPEND_MASK,
+                         IOMMU_INV_IOTLB_PAGES_MAXPEND_SHIFT, &entry);
+
+    set_field_in_reg_u32(pasid & 0xff, entry,
+                         IOMMU_INV_IOTLB_PAGES_PASID1_MASK,
+                         IOMMU_INV_IOTLB_PAGES_PASID1_SHIFT, &entry);
+    cmd[0] = entry;
+
+    set_field_in_reg_u32(IOMMU_CMD_INVALIDATE_IOTLB_PAGES, 0,
+                         IOMMU_CMD_OPCODE_MASK, IOMMU_CMD_OPCODE_SHIFT,
+                         &entry);
+
+    set_field_in_reg_u32(pasid >> 8, entry,
+                         IOMMU_INV_IOTLB_PAGES_PASID2_MASK,
+                         IOMMU_INV_IOTLB_PAGES_PASID2_SHIFT,
+                         &entry);
+
+    set_field_in_reg_u32(queueid, entry,
+                         IOMMU_INV_IOTLB_PAGES_QUEUEID_MASK,
+                         IOMMU_INV_IOTLB_PAGES_QUEUEID_SHIFT,
+                         &entry);
+    cmd[1] = entry;
+
+    set_field_in_reg_u32(sflag, 0,
+                         IOMMU_INV_IOTLB_PAGES_S_FLAG_MASK,
+                         IOMMU_INV_IOTLB_PAGES_S_FLAG_MASK, &entry);
+
+    set_field_in_reg_u32((u32)addr_lo >> PAGE_SHIFT, entry,
+                         IOMMU_INV_IOTLB_PAGES_ADDR_LOW_MASK,
+                         IOMMU_INV_IOTLB_PAGES_ADDR_LOW_SHIFT, &entry);
+    cmd[2] = entry;
+
+    set_field_in_reg_u32((u32)addr_hi, 0,
+                         IOMMU_INV_IOTLB_PAGES_ADDR_HIGH_MASK,
+                         IOMMU_INV_IOTLB_PAGES_ADDR_HIGH_SHIFT, &entry);
+    cmd[3] = entry;
+
+    send_iommu_command(iommu, cmd);
+}
+
+static void invalidate_dev_table_entry(struct amd_iommu *iommu,
+                                       u16 device_id)
+{
+    u32 cmd[4], entry;
+
+    cmd[3] = cmd[2] = 0;
+    set_field_in_reg_u32(device_id, 0,
+                         IOMMU_INV_DEVTAB_ENTRY_DEVICE_ID_MASK,
+                         IOMMU_INV_DEVTAB_ENTRY_DEVICE_ID_SHIFT, &entry);
+    cmd[0] = entry;
+
+    set_field_in_reg_u32(IOMMU_CMD_INVALIDATE_DEVTAB_ENTRY, 0,
+                         IOMMU_CMD_OPCODE_MASK, IOMMU_CMD_OPCODE_SHIFT,
+                         &entry);
+    cmd[1] = entry;
+
+    send_iommu_command(iommu, cmd);
+}
+
+static void invalidate_interrupt_table(struct amd_iommu *iommu, u16 device_id)
+{
+    u32 cmd[4], entry;
+
+    cmd[3] = cmd[2] = 0;
+    set_field_in_reg_u32(device_id, 0,
+                         IOMMU_INV_INT_TABLE_DEVICE_ID_MASK,
+                         IOMMU_INV_INT_TABLE_DEVICE_ID_SHIFT, &entry);
+    cmd[0] = entry;
+    set_field_in_reg_u32(IOMMU_CMD_INVALIDATE_INT_TABLE, 0,
+                         IOMMU_CMD_OPCODE_MASK, IOMMU_CMD_OPCODE_SHIFT,
+                         &entry);
+    cmd[1] = entry;
+    send_iommu_command(iommu, cmd);
+}
+
+void amd_iommu_flush_iotlb(struct pci_dev *pdev,
+                           uint64_t gaddr, unsigned int order)
+{
+    unsigned long flags;
+    struct amd_iommu *iommu;
+    unsigned int bdf, req_id, queueid, maxpend;
+    struct pci_ats_dev *ats_pdev;
+
+    if ( !ats_enabled )
+        return;
+
+    ats_pdev = get_ats_device(pdev->seg, pdev->bus, pdev->devfn);
+    if ( ats_pdev == NULL )
+        return;
+
+    if ( !pci_ats_enabled(ats_pdev->seg, ats_pdev->bus, ats_pdev->devfn) )
+        return;
+
+    bdf = PCI_BDF2(ats_pdev->bus, ats_pdev->devfn);
+    iommu = find_iommu_for_device(ats_pdev->seg, bdf);
+
+    if ( !iommu )
+    {
+        AMD_IOMMU_DEBUG("%s: Can't find iommu for %04x:%02x:%02x.%u\n",
+                        __func__, ats_pdev->seg, ats_pdev->bus,
+                        PCI_SLOT(ats_pdev->devfn), PCI_FUNC(ats_pdev->devfn));
+        return;
+    }
+
+    if ( !iommu_has_cap(iommu, PCI_CAP_IOTLB_SHIFT) )
+        return;
+
+    req_id = get_dma_requestor_id(iommu->seg, bdf);
+    queueid = req_id;
+    maxpend = (ats_pdev->ats_queue_depth + 32) & 0xff;
+
+    /* send INVALIDATE_IOTLB_PAGES command */
+    spin_lock_irqsave(&iommu->lock, flags);
+    invalidate_iotlb_pages(iommu, maxpend, 0, queueid, gaddr, req_id, order);
+    flush_command_buffer(iommu);
+    spin_unlock_irqrestore(&iommu->lock, flags);
+}
+
+static void amd_iommu_flush_all_iotlbs(struct domain *d, uint64_t gaddr,
+                                       unsigned int order)
+{
+    struct pci_dev *pdev;
+
+    if ( !ats_enabled )
+        return;
+
+    for_each_pdev( d, pdev )
+        amd_iommu_flush_iotlb(pdev, gaddr, order);
+}
+
+/* Flush iommu cache after p2m changes. */
+static void _amd_iommu_flush_pages(struct domain *d,
+                                   uint64_t gaddr, unsigned int order)
+{
+    unsigned long flags;
+    struct amd_iommu *iommu;
+    struct hvm_iommu *hd = domain_hvm_iommu(d);
+    unsigned int dom_id = hd->domain_id;
+
+    /* send INVALIDATE_IOMMU_PAGES command */
+    for_each_amd_iommu ( iommu )
+    {
+        spin_lock_irqsave(&iommu->lock, flags);
+        invalidate_iommu_pages(iommu, gaddr, dom_id, order);
+        flush_command_buffer(iommu);
+        spin_unlock_irqrestore(&iommu->lock, flags);
+    }
+
+    if ( ats_enabled )
+        amd_iommu_flush_all_iotlbs(d, gaddr, order);
+}
+
+void amd_iommu_flush_all_pages(struct domain *d)
+{
+    _amd_iommu_flush_pages(d, INV_IOMMU_ALL_PAGES_ADDRESS, 0);
+}
+
+void amd_iommu_flush_pages(struct domain *d,
+                           unsigned long gfn, unsigned int order)
+{
+    _amd_iommu_flush_pages(d, (uint64_t) gfn << PAGE_SHIFT, order);
+}
+
+void amd_iommu_flush_device(struct amd_iommu *iommu, uint16_t bdf)
+{
+    ASSERT( spin_is_locked(&iommu->lock) );
+
+    invalidate_dev_table_entry(iommu, bdf);
+    flush_command_buffer(iommu);
+}
+
+void amd_iommu_flush_intremap(struct amd_iommu *iommu, uint16_t bdf)
+{
+    ASSERT( spin_is_locked(&iommu->lock) );
+
+    invalidate_interrupt_table(iommu, bdf);
+    flush_command_buffer(iommu);
+}
diff -r 28c295c82ff6 -r 9a5e973305a8 xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c	Tue Nov 22 13:26:11 2011 +0000
+++ b/xen/drivers/passthrough/amd/iommu_init.c	Tue Nov 22 13:26:46 2011 +0000
@@ -933,9 +933,8 @@
         if ( iommu )
         {
             spin_lock_irqsave(&iommu->lock, flags);
-            invalidate_dev_table_entry(iommu, req_id);
-            invalidate_interrupt_table(iommu, req_id);
-            flush_command_buffer(iommu);
+            amd_iommu_flush_device(iommu, req_id);
+            amd_iommu_flush_intremap(iommu, req_id);
             spin_unlock_irqrestore(&iommu->lock, flags);
         }
     }
diff -r 28c295c82ff6 -r 9a5e973305a8 xen/drivers/passthrough/amd/iommu_intr.c
--- a/xen/drivers/passthrough/amd/iommu_intr.c	Tue Nov 22 13:26:11 2011 +0000
+++ b/xen/drivers/passthrough/amd/iommu_intr.c	Tue Nov 22 13:26:46 2011 +0000
@@ -96,22 +96,6 @@
                             INT_REMAP_ENTRY_VECTOR_SHIFT, entry);
 }
 
-void invalidate_interrupt_table(struct amd_iommu *iommu, u16 device_id)
-{
-    u32 cmd[4], entry;
-
-    cmd[3] = cmd[2] = 0;
-    set_field_in_reg_u32(device_id, 0,
-                         IOMMU_INV_INT_TABLE_DEVICE_ID_MASK,
-                         IOMMU_INV_INT_TABLE_DEVICE_ID_SHIFT, &entry);
-    cmd[0] = entry;
-    set_field_in_reg_u32(IOMMU_CMD_INVALIDATE_INT_TABLE, 0,
-                         IOMMU_CMD_OPCODE_MASK, IOMMU_CMD_OPCODE_SHIFT,
-                         &entry);
-    cmd[1] = entry;
-    send_iommu_command(iommu, cmd);
-}
-
 static void update_intremap_entry_from_ioapic(
     int bdf,
     struct amd_iommu *iommu,
@@ -144,8 +128,7 @@
     if ( iommu->enabled )
     {
         spin_lock_irqsave(&iommu->lock, flags);
-        invalidate_interrupt_table(iommu, req_id);
-        flush_command_buffer(iommu);
+        amd_iommu_flush_intremap(iommu, req_id);
         spin_unlock_irqrestore(&iommu->lock, flags);
     }
 }
@@ -202,8 +185,7 @@
             if ( iommu->enabled )
             {
                 spin_lock_irqsave(&iommu->lock, flags);
-                invalidate_interrupt_table(iommu, req_id);
-                flush_command_buffer(iommu);
+                amd_iommu_flush_intremap(iommu, req_id);
                 spin_unlock_irqrestore(&iommu->lock, flags);
             }
         }
@@ -347,10 +329,9 @@
     if ( iommu->enabled )
     {
         spin_lock_irqsave(&iommu->lock, flags);
-        invalidate_interrupt_table(iommu, req_id);
+        amd_iommu_flush_intremap(iommu, req_id);
         if ( alias_id != req_id )
-            invalidate_interrupt_table(iommu, alias_id);
-        flush_command_buffer(iommu);
+            amd_iommu_flush_intremap(iommu, alias_id);
         spin_unlock_irqrestore(&iommu->lock, flags);
     }
 }
diff -r 28c295c82ff6 -r 9a5e973305a8 xen/drivers/passthrough/amd/iommu_map.c
--- a/xen/drivers/passthrough/amd/iommu_map.c	Tue Nov 22 13:26:11 2011 +0000
+++ b/xen/drivers/passthrough/amd/iommu_map.c	Tue Nov 22 13:26:46 2011 +0000
@@ -27,220 +27,6 @@
 #include "../ats.h"
 #include <xen/pci.h>
 
-static int queue_iommu_command(struct amd_iommu *iommu, u32 cmd[])
-{
-    u32 tail, head, *cmd_buffer;
-    int i;
-
-    tail = iommu->cmd_buffer_tail;
-    if ( ++tail == iommu->cmd_buffer.entries )
-        tail = 0;
-    head = get_field_from_reg_u32(
-        readl(iommu->mmio_base+IOMMU_CMD_BUFFER_HEAD_OFFSET),
-        IOMMU_CMD_BUFFER_HEAD_MASK,
-        IOMMU_CMD_BUFFER_HEAD_SHIFT);
-    if ( head != tail )
-    {
-        cmd_buffer = (u32 *)(iommu->cmd_buffer.buffer +
-                             (iommu->cmd_buffer_tail *
-                              IOMMU_CMD_BUFFER_ENTRY_SIZE));
-        for ( i = 0; i < IOMMU_CMD_BUFFER_U32_PER_ENTRY; i++ )
-            cmd_buffer[i] = cmd[i];
-
-        iommu->cmd_buffer_tail = tail;
-        return 1;
-    }
-
-    return 0;
-}
-
-static void commit_iommu_command_buffer(struct amd_iommu *iommu)
-{
-    u32 tail;
-
-    set_field_in_reg_u32(iommu->cmd_buffer_tail, 0,
-                         IOMMU_CMD_BUFFER_TAIL_MASK,
-                         IOMMU_CMD_BUFFER_TAIL_SHIFT, &tail);
-    writel(tail, iommu->mmio_base+IOMMU_CMD_BUFFER_TAIL_OFFSET);
-}
-
-int send_iommu_command(struct amd_iommu *iommu, u32 cmd[])
-{
-    if ( queue_iommu_command(iommu, cmd) )
-    {
-        commit_iommu_command_buffer(iommu);
-        return 1;
-    }
-
-    return 0;
-}
-
-static void invalidate_iommu_pages(struct amd_iommu *iommu,
-                                   u64 io_addr, u16 domain_id, u16 order)
-{
-    u64 addr_lo, addr_hi;
-    u32 cmd[4], entry;
-    int sflag = 0, pde = 0;
-
-    ASSERT ( order == 0 || order == 9 || order == 18 );
-
-    /* All pages associated with the domainID are invalidated */
-    if ( order || (io_addr == INV_IOMMU_ALL_PAGES_ADDRESS ) )
-    {
-        sflag = 1;
-        pde = 1;
-    }
-
-    /* If sflag == 1, the size of the invalidate command is determined
-     by the first zero bit in the address starting from Address[12] */
-    if ( order )
-    {
-        u64 mask = 1ULL << (order - 1 + PAGE_SHIFT);
-        io_addr &= ~mask;
-        io_addr |= mask - 1;
-    }
-
-    addr_lo = io_addr & DMA_32BIT_MASK;
-    addr_hi = io_addr >> 32;
-
-    set_field_in_reg_u32(domain_id, 0,
-                         IOMMU_INV_IOMMU_PAGES_DOMAIN_ID_MASK,
-                         IOMMU_INV_IOMMU_PAGES_DOMAIN_ID_SHIFT, &entry);
-    set_field_in_reg_u32(IOMMU_CMD_INVALIDATE_IOMMU_PAGES, entry,
-                         IOMMU_CMD_OPCODE_MASK, IOMMU_CMD_OPCODE_SHIFT,
-                         &entry);
-    cmd[1] = entry;
-
-    set_field_in_reg_u32(sflag, 0,
-                         IOMMU_INV_IOMMU_PAGES_S_FLAG_MASK,
-                         IOMMU_INV_IOMMU_PAGES_S_FLAG_SHIFT, &entry);
-    set_field_in_reg_u32(pde, entry,
-                         IOMMU_INV_IOMMU_PAGES_PDE_FLAG_MASK,
-                         IOMMU_INV_IOMMU_PAGES_PDE_FLAG_SHIFT, &entry);
-    set_field_in_reg_u32((u32)addr_lo >> PAGE_SHIFT, entry,
-                         IOMMU_INV_IOMMU_PAGES_ADDR_LOW_MASK,
-                         IOMMU_INV_IOMMU_PAGES_ADDR_LOW_SHIFT, &entry);
-    cmd[2] = entry;
-
-    set_field_in_reg_u32((u32)addr_hi, 0,
-                         IOMMU_INV_IOMMU_PAGES_ADDR_HIGH_MASK,
-                         IOMMU_INV_IOMMU_PAGES_ADDR_HIGH_SHIFT, &entry);
-    cmd[3] = entry;
-
-    cmd[0] = 0;
-    send_iommu_command(iommu, cmd);
-}
-
-static void invalidate_iotlb_pages(struct amd_iommu *iommu,
-                                   u16 maxpend, u32 pasid, u16 queueid,
-                                   u64 io_addr, u16 dev_id, u16 order)
-{
-    u64 addr_lo, addr_hi;
-    u32 cmd[4], entry;
-    int sflag = 0;
-
-    ASSERT ( order == 0 || order == 9 || order == 18 );
-
-    if ( order || (io_addr == INV_IOMMU_ALL_PAGES_ADDRESS ) )
-        sflag = 1;
-
-    /* If sflag == 1, the size of the invalidate command is determined
-     by the first zero bit in the address starting from Address[12] */
-    if ( order )
-    {
-        u64 mask = 1ULL << (order - 1 + PAGE_SHIFT);
-        io_addr &= ~mask;
-        io_addr |= mask - 1;
-    }
-
-    addr_lo = io_addr & DMA_32BIT_MASK;
-    addr_hi = io_addr >> 32;
-
-    set_field_in_reg_u32(dev_id, 0,
-                         IOMMU_INV_IOTLB_PAGES_DEVICE_ID_MASK,
-                         IOMMU_INV_IOTLB_PAGES_DEVICE_ID_SHIFT, &entry);
-
-    set_field_in_reg_u32(maxpend, entry,
-                         IOMMU_INV_IOTLB_PAGES_MAXPEND_MASK,
-                         IOMMU_INV_IOTLB_PAGES_MAXPEND_SHIFT, &entry);
-
-    set_field_in_reg_u32(pasid & 0xff, entry,
-                         IOMMU_INV_IOTLB_PAGES_PASID1_MASK,
-                         IOMMU_INV_IOTLB_PAGES_PASID1_SHIFT, &entry);
-    cmd[0] = entry;
-
-    set_field_in_reg_u32(IOMMU_CMD_INVALIDATE_IOTLB_PAGES, 0,
-                         IOMMU_CMD_OPCODE_MASK, IOMMU_CMD_OPCODE_SHIFT,
-                         &entry);
-
-    set_field_in_reg_u32(pasid >> 8, entry,
-                         IOMMU_INV_IOTLB_PAGES_PASID2_MASK,
-                         IOMMU_INV_IOTLB_PAGES_PASID2_SHIFT,
-                         &entry);
-
-    set_field_in_reg_u32(queueid, entry,
-                         IOMMU_INV_IOTLB_PAGES_QUEUEID_MASK,
-                         IOMMU_INV_IOTLB_PAGES_QUEUEID_SHIFT,
-                         &entry);
-    cmd[1] = entry;
-
-    set_field_in_reg_u32(sflag, 0,
-                         IOMMU_INV_IOTLB_PAGES_S_FLAG_MASK,
-                         IOMMU_INV_IOTLB_PAGES_S_FLAG_MASK, &entry);
-
-    set_field_in_reg_u32((u32)addr_lo >> PAGE_SHIFT, entry,
-                         IOMMU_INV_IOTLB_PAGES_ADDR_LOW_MASK,
-                         IOMMU_INV_IOTLB_PAGES_ADDR_LOW_SHIFT, &entry);
-    cmd[2] = entry;
-
-    set_field_in_reg_u32((u32)addr_hi, 0,
-                         IOMMU_INV_IOTLB_PAGES_ADDR_HIGH_MASK,
-                         IOMMU_INV_IOTLB_PAGES_ADDR_HIGH_SHIFT, &entry);
-    cmd[3] = entry;
-
-    send_iommu_command(iommu, cmd);
-}
-void flush_command_buffer(struct amd_iommu *iommu)
-{
-    u32 cmd[4], status;
-    int loop_count, comp_wait;
-
-    /* clear 'ComWaitInt' in status register (WIC) */
-    set_field_in_reg_u32(IOMMU_CONTROL_ENABLED, 0,
-                         IOMMU_STATUS_COMP_WAIT_INT_MASK,
-                         IOMMU_STATUS_COMP_WAIT_INT_SHIFT, &status);
-    writel(status, iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
-
-    /* send an empty COMPLETION_WAIT command to flush command buffer */
-    cmd[3] = cmd[2] = 0;
-    set_field_in_reg_u32(IOMMU_CMD_COMPLETION_WAIT, 0,
-                         IOMMU_CMD_OPCODE_MASK,
-                         IOMMU_CMD_OPCODE_SHIFT, &cmd[1]);
-    set_field_in_reg_u32(IOMMU_CONTROL_ENABLED, 0,
-                         IOMMU_COMP_WAIT_I_FLAG_MASK,
-                         IOMMU_COMP_WAIT_I_FLAG_SHIFT, &cmd[0]);
-    send_iommu_command(iommu, cmd);
-
-    /* Make loop_count long enough for polling completion wait bit */
-    loop_count = 1000;
-    do {
-        status = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
-        comp_wait = get_field_from_reg_u32(status,
-            IOMMU_STATUS_COMP_WAIT_INT_MASK,
-            IOMMU_STATUS_COMP_WAIT_INT_SHIFT);
-        --loop_count;
-    } while ( !comp_wait && loop_count );
-
-    if ( comp_wait )
-    {
-        /* clear 'ComWaitInt' in status register (WIC) */
-        status &= IOMMU_STATUS_COMP_WAIT_INT_MASK;
-        writel(status, iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
-        return;
-    }
-    AMD_IOMMU_DEBUG("Warning: ComWaitInt bit did not assert!\n");
-}
-
 /* Given pfn and page table level, return pde index */
 static unsigned int pfn_to_pde_idx(unsigned long pfn, unsigned int level)
 {
@@ -480,25 +266,6 @@
                                   IOMMU_PDE_PRESENT_SHIFT);
 }
 
-void invalidate_dev_table_entry(struct amd_iommu *iommu,
-                                u16 device_id)
-{
-    u32 cmd[4], entry;
-
-    cmd[3] = cmd[2] = 0;
-    set_field_in_reg_u32(device_id, 0,
-                         IOMMU_INV_DEVTAB_ENTRY_DEVICE_ID_MASK,
-                         IOMMU_INV_DEVTAB_ENTRY_DEVICE_ID_SHIFT, &entry);
-    cmd[0] = entry;
-
-    set_field_in_reg_u32(IOMMU_CMD_INVALIDATE_DEVTAB_ENTRY, 0,
-                         IOMMU_CMD_OPCODE_MASK, IOMMU_CMD_OPCODE_SHIFT,
-                         &entry);
-    cmd[1] = entry;
-
-    send_iommu_command(iommu, cmd);
-}
-
 /* 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.
  */
@@ -809,8 +576,7 @@
                                           hd->domain_id,
                                           hd->paging_mode, 1);
 
-            invalidate_dev_table_entry(iommu, req_id);
-            flush_command_buffer(iommu);
+            amd_iommu_flush_device(iommu, req_id);
             spin_unlock_irqrestore(&iommu->lock, flags);
         }
 
@@ -967,94 +733,6 @@
     return 0;
 }
 
-void amd_iommu_flush_iotlb(struct pci_dev *pdev,
-                           uint64_t gaddr, unsigned int order)
-{
-    unsigned long flags;
-    struct amd_iommu *iommu;
-    unsigned int bdf, req_id, queueid, maxpend;
-    struct pci_ats_dev *ats_pdev;
-
-    if ( !ats_enabled )
-        return;
-
-    ats_pdev = get_ats_device(pdev->seg, pdev->bus, pdev->devfn);
-    if ( ats_pdev == NULL )
-        return;
-
-    if ( !pci_ats_enabled(ats_pdev->seg, ats_pdev->bus, ats_pdev->devfn) )
-        return;
-
-    bdf = PCI_BDF2(ats_pdev->bus, ats_pdev->devfn);
-    iommu = find_iommu_for_device(ats_pdev->seg, bdf);
-
-    if ( !iommu )
-    {
-        AMD_IOMMU_DEBUG("%s: Can't find iommu for %04x:%02x:%02x.%u\n",
-                        __func__, ats_pdev->seg, ats_pdev->bus,
-                        PCI_SLOT(ats_pdev->devfn), PCI_FUNC(ats_pdev->devfn));
-        return;
-    }
-
-    if ( !iommu_has_cap(iommu, PCI_CAP_IOTLB_SHIFT) )
-        return;
-
-    req_id = get_dma_requestor_id(iommu->seg, bdf);
-    queueid = req_id;
-    maxpend = (ats_pdev->ats_queue_depth + 32) & 0xff;
-
-    /* send INVALIDATE_IOTLB_PAGES command */
-    spin_lock_irqsave(&iommu->lock, flags);
-    invalidate_iotlb_pages(iommu, maxpend, 0, queueid, gaddr, req_id, order);
-    flush_command_buffer(iommu);
-    spin_unlock_irqrestore(&iommu->lock, flags);
-}
-
-static void amd_iommu_flush_all_iotlbs(struct domain *d, uint64_t gaddr,
-                                       unsigned int order)
-{
-    struct pci_dev *pdev;
-
-    if ( !ats_enabled )
-        return;
-
-    for_each_pdev( d, pdev )
-        amd_iommu_flush_iotlb(pdev, gaddr, order);
-}
-
-/* Flush iommu cache after p2m changes. */
-static void _amd_iommu_flush_pages(struct domain *d,
-                                   uint64_t gaddr, unsigned int order)
-{
-    unsigned long flags;
-    struct amd_iommu *iommu;
-    struct hvm_iommu *hd = domain_hvm_iommu(d);
-    unsigned int dom_id = hd->domain_id;
-
-    /* send INVALIDATE_IOMMU_PAGES command */
-    for_each_amd_iommu ( iommu )
-    {
-        spin_lock_irqsave(&iommu->lock, flags);
-        invalidate_iommu_pages(iommu, gaddr, dom_id, order);
-        flush_command_buffer(iommu);
-        spin_unlock_irqrestore(&iommu->lock, flags);
-    }
-
-    if ( ats_enabled )
-        amd_iommu_flush_all_iotlbs(d, gaddr, order);
-}
-
-void amd_iommu_flush_all_pages(struct domain *d)
-{
-    _amd_iommu_flush_pages(d, INV_IOMMU_ALL_PAGES_ADDRESS, 0);
-}
-
-void amd_iommu_flush_pages(struct domain *d,
-                           unsigned long gfn, unsigned int order)
-{
-    _amd_iommu_flush_pages(d, (uint64_t) gfn << PAGE_SHIFT, order);
-}
-
 /* Share p2m table with iommu. */
 void amd_iommu_share_p2m(struct domain *d)
 {
diff -r 28c295c82ff6 -r 9a5e973305a8 xen/drivers/passthrough/amd/pci_amd_iommu.c
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c	Tue Nov 22 13:26:11 2011 +0000
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c	Tue Nov 22 13:26:46 2011 +0000
@@ -118,8 +118,7 @@
              iommu_has_cap(iommu, PCI_CAP_IOTLB_SHIFT) )
             iommu_dte_set_iotlb((u32 *)dte, dte_i);
 
-        invalidate_dev_table_entry(iommu, req_id);
-        flush_command_buffer(iommu);
+        amd_iommu_flush_device(iommu, req_id);
 
         AMD_IOMMU_DEBUG("Setup I/O page table: device id = 0x%04x, "
                         "root table = 0x%"PRIx64", "
@@ -310,8 +309,8 @@
              iommu_has_cap(iommu, PCI_CAP_IOTLB_SHIFT) )
             iommu_dte_set_iotlb((u32 *)dte, 0);
 
-        invalidate_dev_table_entry(iommu, req_id);
-        flush_command_buffer(iommu);
+        amd_iommu_flush_device(iommu, req_id);
+
         AMD_IOMMU_DEBUG("Disable: device id = 0x%04x, "
                         "domain = %d, paging mode = %d\n",
                         req_id,  domain_hvm_iommu(domain)->domain_id,
diff -r 28c295c82ff6 -r 9a5e973305a8 xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h	Tue Nov 22 13:26:11 2011 +0000
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h	Tue Nov 22 13:26:46 2011 +0000
@@ -53,12 +53,6 @@
 int amd_iommu_map_page(struct domain *d, unsigned long gfn, unsigned long mfn,
                        unsigned int flags);
 int amd_iommu_unmap_page(struct domain *d, unsigned long gfn);
-void amd_iommu_flush_pages(struct domain *d, unsigned long gfn,
-                           unsigned int order);
-void amd_iommu_flush_all_pages(struct domain *d);
-void amd_iommu_flush_iotlb(struct pci_dev *pdev, uint64_t gaddr,
-                           unsigned int order);
-
 u64 amd_iommu_get_next_table_from_pte(u32 *entry);
 int amd_iommu_reserve_domain_unity_map(struct domain *domain,
                                        u64 phys_addr, unsigned long size,
@@ -75,11 +69,15 @@
     u32 *dte, u64 root_ptr, u16 domain_id, u8 paging_mode, u8 valid);
 void iommu_dte_set_iotlb(u32 *dte, u8 i);
 void iommu_dte_add_device_entry(u32 *dte, struct ivrs_mappings *ivrs_dev);
-void invalidate_dev_table_entry(struct amd_iommu *iommu, u16 devic_id);
 
 /* send cmd to iommu */
-int send_iommu_command(struct amd_iommu *iommu, u32 cmd[]);
-void flush_command_buffer(struct amd_iommu *iommu);
+void amd_iommu_flush_all_pages(struct domain *d);
+void amd_iommu_flush_pages(struct domain *d, unsigned long gfn,
+                           unsigned int order);
+void amd_iommu_flush_iotlb(struct pci_dev *pdev, uint64_t gaddr,
+                           unsigned int order);
+void amd_iommu_flush_device(struct amd_iommu *iommu, uint16_t bdf);
+void amd_iommu_flush_intremap(struct amd_iommu *iommu, uint16_t bdf);
 
 /* find iommu for bdf */
 struct amd_iommu *find_iommu_for_device(int seg, int bdf);
@@ -88,7 +86,6 @@
 int amd_iommu_setup_ioapic_remapping(void);
 void *amd_iommu_alloc_intremap_table(void);
 int amd_iommu_free_intremap_table(u16 seg, struct ivrs_mappings *);
-void invalidate_interrupt_table(struct amd_iommu *iommu, u16 device_id);
 void amd_iommu_ioapic_update_ire(
     unsigned int apic, unsigned int reg, unsigned int value);
 void amd_iommu_msi_msg_update_ire(

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:26 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhR-0008MQ-Ol; Mon, 28 Nov 2011 23:33:25 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhP-0008JC-TL
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1322523165!5025871!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15851 invoked from network); 28 Nov 2011 23:32:46 -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;
	28 Nov 2011 23:32:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnC-0001iE-Ov
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhB-0000kM-GQ
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:09 +0000
Message-Id: <E1RVAhB-0000kM-GQ@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] amd iommu: Factor out iommu command
	handling functions, 
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1321968406 0
# Node ID 9a5e973305a84e868c6740626b76008c5476bfe9
# Parent  28c295c82ff6d7c022219ca7588f42458360ffb1
amd iommu: Factor out iommu command handling functions,
and move them into a new file.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 28c295c82ff6 -r 9a5e973305a8 xen/drivers/passthrough/amd/Makefile
--- a/xen/drivers/passthrough/amd/Makefile	Tue Nov 22 13:26:11 2011 +0000
+++ b/xen/drivers/passthrough/amd/Makefile	Tue Nov 22 13:26:46 2011 +0000
@@ -4,3 +4,4 @@
 obj-y += pci_amd_iommu.o
 obj-bin-y += iommu_acpi.init.o
 obj-y += iommu_intr.o
+obj-y += iommu_cmd.o
diff -r 28c295c82ff6 -r 9a5e973305a8 xen/drivers/passthrough/amd/iommu_cmd.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/drivers/passthrough/amd/iommu_cmd.c	Tue Nov 22 13:26:46 2011 +0000
@@ -0,0 +1,382 @@
+/*
+ * Copyright (C) 2011 Advanced Micro Devices, Inc.
+ * Author: Leo Duran <leo.duran@amd.com>
+ * Author: Wei Wang <wei.wang2@amd.com> - adapted to xen
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ */
+
+#include <xen/sched.h>
+#include <xen/hvm/iommu.h>
+#include <asm/amd-iommu.h>
+#include <asm/hvm/svm/amd-iommu-proto.h>
+#include "../ats.h"
+
+static int queue_iommu_command(struct amd_iommu *iommu, u32 cmd[])
+{
+    u32 tail, head, *cmd_buffer;
+    int i;
+
+    tail = iommu->cmd_buffer_tail;
+    if ( ++tail == iommu->cmd_buffer.entries )
+        tail = 0;
+
+    head = get_field_from_reg_u32(readl(iommu->mmio_base + 
+                                        IOMMU_CMD_BUFFER_HEAD_OFFSET),
+                                  IOMMU_CMD_BUFFER_HEAD_MASK,
+                                  IOMMU_CMD_BUFFER_HEAD_SHIFT);
+    if ( head != tail )
+    {
+        cmd_buffer = (u32 *)(iommu->cmd_buffer.buffer +
+                             (iommu->cmd_buffer_tail *
+                             IOMMU_CMD_BUFFER_ENTRY_SIZE));
+
+        for ( i = 0; i < IOMMU_CMD_BUFFER_U32_PER_ENTRY; i++ )
+            cmd_buffer[i] = cmd[i];
+
+        iommu->cmd_buffer_tail = tail;
+        return 1;
+    }
+
+    return 0;
+}
+
+static void commit_iommu_command_buffer(struct amd_iommu *iommu)
+{
+    u32 tail;
+
+    set_field_in_reg_u32(iommu->cmd_buffer_tail, 0,
+                         IOMMU_CMD_BUFFER_TAIL_MASK,
+                         IOMMU_CMD_BUFFER_TAIL_SHIFT, &tail);
+    writel(tail, iommu->mmio_base+IOMMU_CMD_BUFFER_TAIL_OFFSET);
+}
+
+int send_iommu_command(struct amd_iommu *iommu, u32 cmd[])
+{
+    if ( queue_iommu_command(iommu, cmd) )
+    {
+        commit_iommu_command_buffer(iommu);
+        return 1;
+    }
+
+    return 0;
+}
+
+static void flush_command_buffer(struct amd_iommu *iommu)
+{
+    u32 cmd[4], status;
+    int loop_count, comp_wait;
+
+    /* clear 'ComWaitInt' in status register (WIC) */
+    set_field_in_reg_u32(IOMMU_CONTROL_ENABLED, 0,
+                         IOMMU_STATUS_COMP_WAIT_INT_MASK,
+                         IOMMU_STATUS_COMP_WAIT_INT_SHIFT, &status);
+    writel(status, iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
+
+    /* send an empty COMPLETION_WAIT command to flush command buffer */
+    cmd[3] = cmd[2] = 0;
+    set_field_in_reg_u32(IOMMU_CMD_COMPLETION_WAIT, 0,
+                         IOMMU_CMD_OPCODE_MASK,
+                         IOMMU_CMD_OPCODE_SHIFT, &cmd[1]);
+    set_field_in_reg_u32(IOMMU_CONTROL_ENABLED, 0,
+                         IOMMU_COMP_WAIT_I_FLAG_MASK,
+                         IOMMU_COMP_WAIT_I_FLAG_SHIFT, &cmd[0]);
+    send_iommu_command(iommu, cmd);
+
+    /* Make loop_count long enough for polling completion wait bit */
+    loop_count = 1000;
+    do {
+        status = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
+        comp_wait = get_field_from_reg_u32(status,
+                                           IOMMU_STATUS_COMP_WAIT_INT_MASK,
+                                           IOMMU_STATUS_COMP_WAIT_INT_SHIFT);
+        --loop_count;
+    } while ( !comp_wait && loop_count );
+
+    if ( comp_wait )
+    {
+        /* clear 'ComWaitInt' in status register (WIC) */
+        status &= IOMMU_STATUS_COMP_WAIT_INT_MASK;
+        writel(status, iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
+        return;
+    }
+    AMD_IOMMU_DEBUG("Warning: ComWaitInt bit did not assert!\n");
+}
+
+/* Build low level iommu command messages */
+static void invalidate_iommu_pages(struct amd_iommu *iommu,
+                                   u64 io_addr, u16 domain_id, u16 order)
+{
+    u64 addr_lo, addr_hi;
+    u32 cmd[4], entry;
+    int sflag = 0, pde = 0;
+
+    ASSERT ( order == 0 || order == 9 || order == 18 );
+
+    /* All pages associated with the domainID are invalidated */
+    if ( order || (io_addr == INV_IOMMU_ALL_PAGES_ADDRESS ) )
+    {
+        sflag = 1;
+        pde = 1;
+    }
+
+    /* If sflag == 1, the size of the invalidate command is determined
+     by the first zero bit in the address starting from Address[12] */
+    if ( order )
+    {
+        u64 mask = 1ULL << (order - 1 + PAGE_SHIFT);
+        io_addr &= ~mask;
+        io_addr |= mask - 1;
+    }
+
+    addr_lo = io_addr & DMA_32BIT_MASK;
+    addr_hi = io_addr >> 32;
+
+    set_field_in_reg_u32(domain_id, 0,
+                         IOMMU_INV_IOMMU_PAGES_DOMAIN_ID_MASK,
+                         IOMMU_INV_IOMMU_PAGES_DOMAIN_ID_SHIFT, &entry);
+    set_field_in_reg_u32(IOMMU_CMD_INVALIDATE_IOMMU_PAGES, entry,
+                         IOMMU_CMD_OPCODE_MASK, IOMMU_CMD_OPCODE_SHIFT,
+                         &entry);
+    cmd[1] = entry;
+
+    set_field_in_reg_u32(sflag, 0,
+                         IOMMU_INV_IOMMU_PAGES_S_FLAG_MASK,
+                         IOMMU_INV_IOMMU_PAGES_S_FLAG_SHIFT, &entry);
+    set_field_in_reg_u32(pde, entry,
+                         IOMMU_INV_IOMMU_PAGES_PDE_FLAG_MASK,
+                         IOMMU_INV_IOMMU_PAGES_PDE_FLAG_SHIFT, &entry);
+    set_field_in_reg_u32((u32)addr_lo >> PAGE_SHIFT, entry,
+                         IOMMU_INV_IOMMU_PAGES_ADDR_LOW_MASK,
+                         IOMMU_INV_IOMMU_PAGES_ADDR_LOW_SHIFT, &entry);
+    cmd[2] = entry;
+
+    set_field_in_reg_u32((u32)addr_hi, 0,
+                         IOMMU_INV_IOMMU_PAGES_ADDR_HIGH_MASK,
+                         IOMMU_INV_IOMMU_PAGES_ADDR_HIGH_SHIFT, &entry);
+    cmd[3] = entry;
+
+    cmd[0] = 0;
+    send_iommu_command(iommu, cmd);
+}
+
+static void invalidate_iotlb_pages(struct amd_iommu *iommu,
+                                   u16 maxpend, u32 pasid, u16 queueid,
+                                   u64 io_addr, u16 dev_id, u16 order)
+{
+    u64 addr_lo, addr_hi;
+    u32 cmd[4], entry;
+    int sflag = 0;
+
+    ASSERT ( order == 0 || order == 9 || order == 18 );
+
+    if ( order || (io_addr == INV_IOMMU_ALL_PAGES_ADDRESS ) )
+        sflag = 1;
+
+    /* If sflag == 1, the size of the invalidate command is determined
+     by the first zero bit in the address starting from Address[12] */
+    if ( order )
+    {
+        u64 mask = 1ULL << (order - 1 + PAGE_SHIFT);
+        io_addr &= ~mask;
+        io_addr |= mask - 1;
+    }
+
+    addr_lo = io_addr & DMA_32BIT_MASK;
+    addr_hi = io_addr >> 32;
+
+    set_field_in_reg_u32(dev_id, 0,
+                         IOMMU_INV_IOTLB_PAGES_DEVICE_ID_MASK,
+                         IOMMU_INV_IOTLB_PAGES_DEVICE_ID_SHIFT, &entry);
+
+    set_field_in_reg_u32(maxpend, entry,
+                         IOMMU_INV_IOTLB_PAGES_MAXPEND_MASK,
+                         IOMMU_INV_IOTLB_PAGES_MAXPEND_SHIFT, &entry);
+
+    set_field_in_reg_u32(pasid & 0xff, entry,
+                         IOMMU_INV_IOTLB_PAGES_PASID1_MASK,
+                         IOMMU_INV_IOTLB_PAGES_PASID1_SHIFT, &entry);
+    cmd[0] = entry;
+
+    set_field_in_reg_u32(IOMMU_CMD_INVALIDATE_IOTLB_PAGES, 0,
+                         IOMMU_CMD_OPCODE_MASK, IOMMU_CMD_OPCODE_SHIFT,
+                         &entry);
+
+    set_field_in_reg_u32(pasid >> 8, entry,
+                         IOMMU_INV_IOTLB_PAGES_PASID2_MASK,
+                         IOMMU_INV_IOTLB_PAGES_PASID2_SHIFT,
+                         &entry);
+
+    set_field_in_reg_u32(queueid, entry,
+                         IOMMU_INV_IOTLB_PAGES_QUEUEID_MASK,
+                         IOMMU_INV_IOTLB_PAGES_QUEUEID_SHIFT,
+                         &entry);
+    cmd[1] = entry;
+
+    set_field_in_reg_u32(sflag, 0,
+                         IOMMU_INV_IOTLB_PAGES_S_FLAG_MASK,
+                         IOMMU_INV_IOTLB_PAGES_S_FLAG_MASK, &entry);
+
+    set_field_in_reg_u32((u32)addr_lo >> PAGE_SHIFT, entry,
+                         IOMMU_INV_IOTLB_PAGES_ADDR_LOW_MASK,
+                         IOMMU_INV_IOTLB_PAGES_ADDR_LOW_SHIFT, &entry);
+    cmd[2] = entry;
+
+    set_field_in_reg_u32((u32)addr_hi, 0,
+                         IOMMU_INV_IOTLB_PAGES_ADDR_HIGH_MASK,
+                         IOMMU_INV_IOTLB_PAGES_ADDR_HIGH_SHIFT, &entry);
+    cmd[3] = entry;
+
+    send_iommu_command(iommu, cmd);
+}
+
+static void invalidate_dev_table_entry(struct amd_iommu *iommu,
+                                       u16 device_id)
+{
+    u32 cmd[4], entry;
+
+    cmd[3] = cmd[2] = 0;
+    set_field_in_reg_u32(device_id, 0,
+                         IOMMU_INV_DEVTAB_ENTRY_DEVICE_ID_MASK,
+                         IOMMU_INV_DEVTAB_ENTRY_DEVICE_ID_SHIFT, &entry);
+    cmd[0] = entry;
+
+    set_field_in_reg_u32(IOMMU_CMD_INVALIDATE_DEVTAB_ENTRY, 0,
+                         IOMMU_CMD_OPCODE_MASK, IOMMU_CMD_OPCODE_SHIFT,
+                         &entry);
+    cmd[1] = entry;
+
+    send_iommu_command(iommu, cmd);
+}
+
+static void invalidate_interrupt_table(struct amd_iommu *iommu, u16 device_id)
+{
+    u32 cmd[4], entry;
+
+    cmd[3] = cmd[2] = 0;
+    set_field_in_reg_u32(device_id, 0,
+                         IOMMU_INV_INT_TABLE_DEVICE_ID_MASK,
+                         IOMMU_INV_INT_TABLE_DEVICE_ID_SHIFT, &entry);
+    cmd[0] = entry;
+    set_field_in_reg_u32(IOMMU_CMD_INVALIDATE_INT_TABLE, 0,
+                         IOMMU_CMD_OPCODE_MASK, IOMMU_CMD_OPCODE_SHIFT,
+                         &entry);
+    cmd[1] = entry;
+    send_iommu_command(iommu, cmd);
+}
+
+void amd_iommu_flush_iotlb(struct pci_dev *pdev,
+                           uint64_t gaddr, unsigned int order)
+{
+    unsigned long flags;
+    struct amd_iommu *iommu;
+    unsigned int bdf, req_id, queueid, maxpend;
+    struct pci_ats_dev *ats_pdev;
+
+    if ( !ats_enabled )
+        return;
+
+    ats_pdev = get_ats_device(pdev->seg, pdev->bus, pdev->devfn);
+    if ( ats_pdev == NULL )
+        return;
+
+    if ( !pci_ats_enabled(ats_pdev->seg, ats_pdev->bus, ats_pdev->devfn) )
+        return;
+
+    bdf = PCI_BDF2(ats_pdev->bus, ats_pdev->devfn);
+    iommu = find_iommu_for_device(ats_pdev->seg, bdf);
+
+    if ( !iommu )
+    {
+        AMD_IOMMU_DEBUG("%s: Can't find iommu for %04x:%02x:%02x.%u\n",
+                        __func__, ats_pdev->seg, ats_pdev->bus,
+                        PCI_SLOT(ats_pdev->devfn), PCI_FUNC(ats_pdev->devfn));
+        return;
+    }
+
+    if ( !iommu_has_cap(iommu, PCI_CAP_IOTLB_SHIFT) )
+        return;
+
+    req_id = get_dma_requestor_id(iommu->seg, bdf);
+    queueid = req_id;
+    maxpend = (ats_pdev->ats_queue_depth + 32) & 0xff;
+
+    /* send INVALIDATE_IOTLB_PAGES command */
+    spin_lock_irqsave(&iommu->lock, flags);
+    invalidate_iotlb_pages(iommu, maxpend, 0, queueid, gaddr, req_id, order);
+    flush_command_buffer(iommu);
+    spin_unlock_irqrestore(&iommu->lock, flags);
+}
+
+static void amd_iommu_flush_all_iotlbs(struct domain *d, uint64_t gaddr,
+                                       unsigned int order)
+{
+    struct pci_dev *pdev;
+
+    if ( !ats_enabled )
+        return;
+
+    for_each_pdev( d, pdev )
+        amd_iommu_flush_iotlb(pdev, gaddr, order);
+}
+
+/* Flush iommu cache after p2m changes. */
+static void _amd_iommu_flush_pages(struct domain *d,
+                                   uint64_t gaddr, unsigned int order)
+{
+    unsigned long flags;
+    struct amd_iommu *iommu;
+    struct hvm_iommu *hd = domain_hvm_iommu(d);
+    unsigned int dom_id = hd->domain_id;
+
+    /* send INVALIDATE_IOMMU_PAGES command */
+    for_each_amd_iommu ( iommu )
+    {
+        spin_lock_irqsave(&iommu->lock, flags);
+        invalidate_iommu_pages(iommu, gaddr, dom_id, order);
+        flush_command_buffer(iommu);
+        spin_unlock_irqrestore(&iommu->lock, flags);
+    }
+
+    if ( ats_enabled )
+        amd_iommu_flush_all_iotlbs(d, gaddr, order);
+}
+
+void amd_iommu_flush_all_pages(struct domain *d)
+{
+    _amd_iommu_flush_pages(d, INV_IOMMU_ALL_PAGES_ADDRESS, 0);
+}
+
+void amd_iommu_flush_pages(struct domain *d,
+                           unsigned long gfn, unsigned int order)
+{
+    _amd_iommu_flush_pages(d, (uint64_t) gfn << PAGE_SHIFT, order);
+}
+
+void amd_iommu_flush_device(struct amd_iommu *iommu, uint16_t bdf)
+{
+    ASSERT( spin_is_locked(&iommu->lock) );
+
+    invalidate_dev_table_entry(iommu, bdf);
+    flush_command_buffer(iommu);
+}
+
+void amd_iommu_flush_intremap(struct amd_iommu *iommu, uint16_t bdf)
+{
+    ASSERT( spin_is_locked(&iommu->lock) );
+
+    invalidate_interrupt_table(iommu, bdf);
+    flush_command_buffer(iommu);
+}
diff -r 28c295c82ff6 -r 9a5e973305a8 xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c	Tue Nov 22 13:26:11 2011 +0000
+++ b/xen/drivers/passthrough/amd/iommu_init.c	Tue Nov 22 13:26:46 2011 +0000
@@ -933,9 +933,8 @@
         if ( iommu )
         {
             spin_lock_irqsave(&iommu->lock, flags);
-            invalidate_dev_table_entry(iommu, req_id);
-            invalidate_interrupt_table(iommu, req_id);
-            flush_command_buffer(iommu);
+            amd_iommu_flush_device(iommu, req_id);
+            amd_iommu_flush_intremap(iommu, req_id);
             spin_unlock_irqrestore(&iommu->lock, flags);
         }
     }
diff -r 28c295c82ff6 -r 9a5e973305a8 xen/drivers/passthrough/amd/iommu_intr.c
--- a/xen/drivers/passthrough/amd/iommu_intr.c	Tue Nov 22 13:26:11 2011 +0000
+++ b/xen/drivers/passthrough/amd/iommu_intr.c	Tue Nov 22 13:26:46 2011 +0000
@@ -96,22 +96,6 @@
                             INT_REMAP_ENTRY_VECTOR_SHIFT, entry);
 }
 
-void invalidate_interrupt_table(struct amd_iommu *iommu, u16 device_id)
-{
-    u32 cmd[4], entry;
-
-    cmd[3] = cmd[2] = 0;
-    set_field_in_reg_u32(device_id, 0,
-                         IOMMU_INV_INT_TABLE_DEVICE_ID_MASK,
-                         IOMMU_INV_INT_TABLE_DEVICE_ID_SHIFT, &entry);
-    cmd[0] = entry;
-    set_field_in_reg_u32(IOMMU_CMD_INVALIDATE_INT_TABLE, 0,
-                         IOMMU_CMD_OPCODE_MASK, IOMMU_CMD_OPCODE_SHIFT,
-                         &entry);
-    cmd[1] = entry;
-    send_iommu_command(iommu, cmd);
-}
-
 static void update_intremap_entry_from_ioapic(
     int bdf,
     struct amd_iommu *iommu,
@@ -144,8 +128,7 @@
     if ( iommu->enabled )
     {
         spin_lock_irqsave(&iommu->lock, flags);
-        invalidate_interrupt_table(iommu, req_id);
-        flush_command_buffer(iommu);
+        amd_iommu_flush_intremap(iommu, req_id);
         spin_unlock_irqrestore(&iommu->lock, flags);
     }
 }
@@ -202,8 +185,7 @@
             if ( iommu->enabled )
             {
                 spin_lock_irqsave(&iommu->lock, flags);
-                invalidate_interrupt_table(iommu, req_id);
-                flush_command_buffer(iommu);
+                amd_iommu_flush_intremap(iommu, req_id);
                 spin_unlock_irqrestore(&iommu->lock, flags);
             }
         }
@@ -347,10 +329,9 @@
     if ( iommu->enabled )
     {
         spin_lock_irqsave(&iommu->lock, flags);
-        invalidate_interrupt_table(iommu, req_id);
+        amd_iommu_flush_intremap(iommu, req_id);
         if ( alias_id != req_id )
-            invalidate_interrupt_table(iommu, alias_id);
-        flush_command_buffer(iommu);
+            amd_iommu_flush_intremap(iommu, alias_id);
         spin_unlock_irqrestore(&iommu->lock, flags);
     }
 }
diff -r 28c295c82ff6 -r 9a5e973305a8 xen/drivers/passthrough/amd/iommu_map.c
--- a/xen/drivers/passthrough/amd/iommu_map.c	Tue Nov 22 13:26:11 2011 +0000
+++ b/xen/drivers/passthrough/amd/iommu_map.c	Tue Nov 22 13:26:46 2011 +0000
@@ -27,220 +27,6 @@
 #include "../ats.h"
 #include <xen/pci.h>
 
-static int queue_iommu_command(struct amd_iommu *iommu, u32 cmd[])
-{
-    u32 tail, head, *cmd_buffer;
-    int i;
-
-    tail = iommu->cmd_buffer_tail;
-    if ( ++tail == iommu->cmd_buffer.entries )
-        tail = 0;
-    head = get_field_from_reg_u32(
-        readl(iommu->mmio_base+IOMMU_CMD_BUFFER_HEAD_OFFSET),
-        IOMMU_CMD_BUFFER_HEAD_MASK,
-        IOMMU_CMD_BUFFER_HEAD_SHIFT);
-    if ( head != tail )
-    {
-        cmd_buffer = (u32 *)(iommu->cmd_buffer.buffer +
-                             (iommu->cmd_buffer_tail *
-                              IOMMU_CMD_BUFFER_ENTRY_SIZE));
-        for ( i = 0; i < IOMMU_CMD_BUFFER_U32_PER_ENTRY; i++ )
-            cmd_buffer[i] = cmd[i];
-
-        iommu->cmd_buffer_tail = tail;
-        return 1;
-    }
-
-    return 0;
-}
-
-static void commit_iommu_command_buffer(struct amd_iommu *iommu)
-{
-    u32 tail;
-
-    set_field_in_reg_u32(iommu->cmd_buffer_tail, 0,
-                         IOMMU_CMD_BUFFER_TAIL_MASK,
-                         IOMMU_CMD_BUFFER_TAIL_SHIFT, &tail);
-    writel(tail, iommu->mmio_base+IOMMU_CMD_BUFFER_TAIL_OFFSET);
-}
-
-int send_iommu_command(struct amd_iommu *iommu, u32 cmd[])
-{
-    if ( queue_iommu_command(iommu, cmd) )
-    {
-        commit_iommu_command_buffer(iommu);
-        return 1;
-    }
-
-    return 0;
-}
-
-static void invalidate_iommu_pages(struct amd_iommu *iommu,
-                                   u64 io_addr, u16 domain_id, u16 order)
-{
-    u64 addr_lo, addr_hi;
-    u32 cmd[4], entry;
-    int sflag = 0, pde = 0;
-
-    ASSERT ( order == 0 || order == 9 || order == 18 );
-
-    /* All pages associated with the domainID are invalidated */
-    if ( order || (io_addr == INV_IOMMU_ALL_PAGES_ADDRESS ) )
-    {
-        sflag = 1;
-        pde = 1;
-    }
-
-    /* If sflag == 1, the size of the invalidate command is determined
-     by the first zero bit in the address starting from Address[12] */
-    if ( order )
-    {
-        u64 mask = 1ULL << (order - 1 + PAGE_SHIFT);
-        io_addr &= ~mask;
-        io_addr |= mask - 1;
-    }
-
-    addr_lo = io_addr & DMA_32BIT_MASK;
-    addr_hi = io_addr >> 32;
-
-    set_field_in_reg_u32(domain_id, 0,
-                         IOMMU_INV_IOMMU_PAGES_DOMAIN_ID_MASK,
-                         IOMMU_INV_IOMMU_PAGES_DOMAIN_ID_SHIFT, &entry);
-    set_field_in_reg_u32(IOMMU_CMD_INVALIDATE_IOMMU_PAGES, entry,
-                         IOMMU_CMD_OPCODE_MASK, IOMMU_CMD_OPCODE_SHIFT,
-                         &entry);
-    cmd[1] = entry;
-
-    set_field_in_reg_u32(sflag, 0,
-                         IOMMU_INV_IOMMU_PAGES_S_FLAG_MASK,
-                         IOMMU_INV_IOMMU_PAGES_S_FLAG_SHIFT, &entry);
-    set_field_in_reg_u32(pde, entry,
-                         IOMMU_INV_IOMMU_PAGES_PDE_FLAG_MASK,
-                         IOMMU_INV_IOMMU_PAGES_PDE_FLAG_SHIFT, &entry);
-    set_field_in_reg_u32((u32)addr_lo >> PAGE_SHIFT, entry,
-                         IOMMU_INV_IOMMU_PAGES_ADDR_LOW_MASK,
-                         IOMMU_INV_IOMMU_PAGES_ADDR_LOW_SHIFT, &entry);
-    cmd[2] = entry;
-
-    set_field_in_reg_u32((u32)addr_hi, 0,
-                         IOMMU_INV_IOMMU_PAGES_ADDR_HIGH_MASK,
-                         IOMMU_INV_IOMMU_PAGES_ADDR_HIGH_SHIFT, &entry);
-    cmd[3] = entry;
-
-    cmd[0] = 0;
-    send_iommu_command(iommu, cmd);
-}
-
-static void invalidate_iotlb_pages(struct amd_iommu *iommu,
-                                   u16 maxpend, u32 pasid, u16 queueid,
-                                   u64 io_addr, u16 dev_id, u16 order)
-{
-    u64 addr_lo, addr_hi;
-    u32 cmd[4], entry;
-    int sflag = 0;
-
-    ASSERT ( order == 0 || order == 9 || order == 18 );
-
-    if ( order || (io_addr == INV_IOMMU_ALL_PAGES_ADDRESS ) )
-        sflag = 1;
-
-    /* If sflag == 1, the size of the invalidate command is determined
-     by the first zero bit in the address starting from Address[12] */
-    if ( order )
-    {
-        u64 mask = 1ULL << (order - 1 + PAGE_SHIFT);
-        io_addr &= ~mask;
-        io_addr |= mask - 1;
-    }
-
-    addr_lo = io_addr & DMA_32BIT_MASK;
-    addr_hi = io_addr >> 32;
-
-    set_field_in_reg_u32(dev_id, 0,
-                         IOMMU_INV_IOTLB_PAGES_DEVICE_ID_MASK,
-                         IOMMU_INV_IOTLB_PAGES_DEVICE_ID_SHIFT, &entry);
-
-    set_field_in_reg_u32(maxpend, entry,
-                         IOMMU_INV_IOTLB_PAGES_MAXPEND_MASK,
-                         IOMMU_INV_IOTLB_PAGES_MAXPEND_SHIFT, &entry);
-
-    set_field_in_reg_u32(pasid & 0xff, entry,
-                         IOMMU_INV_IOTLB_PAGES_PASID1_MASK,
-                         IOMMU_INV_IOTLB_PAGES_PASID1_SHIFT, &entry);
-    cmd[0] = entry;
-
-    set_field_in_reg_u32(IOMMU_CMD_INVALIDATE_IOTLB_PAGES, 0,
-                         IOMMU_CMD_OPCODE_MASK, IOMMU_CMD_OPCODE_SHIFT,
-                         &entry);
-
-    set_field_in_reg_u32(pasid >> 8, entry,
-                         IOMMU_INV_IOTLB_PAGES_PASID2_MASK,
-                         IOMMU_INV_IOTLB_PAGES_PASID2_SHIFT,
-                         &entry);
-
-    set_field_in_reg_u32(queueid, entry,
-                         IOMMU_INV_IOTLB_PAGES_QUEUEID_MASK,
-                         IOMMU_INV_IOTLB_PAGES_QUEUEID_SHIFT,
-                         &entry);
-    cmd[1] = entry;
-
-    set_field_in_reg_u32(sflag, 0,
-                         IOMMU_INV_IOTLB_PAGES_S_FLAG_MASK,
-                         IOMMU_INV_IOTLB_PAGES_S_FLAG_MASK, &entry);
-
-    set_field_in_reg_u32((u32)addr_lo >> PAGE_SHIFT, entry,
-                         IOMMU_INV_IOTLB_PAGES_ADDR_LOW_MASK,
-                         IOMMU_INV_IOTLB_PAGES_ADDR_LOW_SHIFT, &entry);
-    cmd[2] = entry;
-
-    set_field_in_reg_u32((u32)addr_hi, 0,
-                         IOMMU_INV_IOTLB_PAGES_ADDR_HIGH_MASK,
-                         IOMMU_INV_IOTLB_PAGES_ADDR_HIGH_SHIFT, &entry);
-    cmd[3] = entry;
-
-    send_iommu_command(iommu, cmd);
-}
-void flush_command_buffer(struct amd_iommu *iommu)
-{
-    u32 cmd[4], status;
-    int loop_count, comp_wait;
-
-    /* clear 'ComWaitInt' in status register (WIC) */
-    set_field_in_reg_u32(IOMMU_CONTROL_ENABLED, 0,
-                         IOMMU_STATUS_COMP_WAIT_INT_MASK,
-                         IOMMU_STATUS_COMP_WAIT_INT_SHIFT, &status);
-    writel(status, iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
-
-    /* send an empty COMPLETION_WAIT command to flush command buffer */
-    cmd[3] = cmd[2] = 0;
-    set_field_in_reg_u32(IOMMU_CMD_COMPLETION_WAIT, 0,
-                         IOMMU_CMD_OPCODE_MASK,
-                         IOMMU_CMD_OPCODE_SHIFT, &cmd[1]);
-    set_field_in_reg_u32(IOMMU_CONTROL_ENABLED, 0,
-                         IOMMU_COMP_WAIT_I_FLAG_MASK,
-                         IOMMU_COMP_WAIT_I_FLAG_SHIFT, &cmd[0]);
-    send_iommu_command(iommu, cmd);
-
-    /* Make loop_count long enough for polling completion wait bit */
-    loop_count = 1000;
-    do {
-        status = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
-        comp_wait = get_field_from_reg_u32(status,
-            IOMMU_STATUS_COMP_WAIT_INT_MASK,
-            IOMMU_STATUS_COMP_WAIT_INT_SHIFT);
-        --loop_count;
-    } while ( !comp_wait && loop_count );
-
-    if ( comp_wait )
-    {
-        /* clear 'ComWaitInt' in status register (WIC) */
-        status &= IOMMU_STATUS_COMP_WAIT_INT_MASK;
-        writel(status, iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
-        return;
-    }
-    AMD_IOMMU_DEBUG("Warning: ComWaitInt bit did not assert!\n");
-}
-
 /* Given pfn and page table level, return pde index */
 static unsigned int pfn_to_pde_idx(unsigned long pfn, unsigned int level)
 {
@@ -480,25 +266,6 @@
                                   IOMMU_PDE_PRESENT_SHIFT);
 }
 
-void invalidate_dev_table_entry(struct amd_iommu *iommu,
-                                u16 device_id)
-{
-    u32 cmd[4], entry;
-
-    cmd[3] = cmd[2] = 0;
-    set_field_in_reg_u32(device_id, 0,
-                         IOMMU_INV_DEVTAB_ENTRY_DEVICE_ID_MASK,
-                         IOMMU_INV_DEVTAB_ENTRY_DEVICE_ID_SHIFT, &entry);
-    cmd[0] = entry;
-
-    set_field_in_reg_u32(IOMMU_CMD_INVALIDATE_DEVTAB_ENTRY, 0,
-                         IOMMU_CMD_OPCODE_MASK, IOMMU_CMD_OPCODE_SHIFT,
-                         &entry);
-    cmd[1] = entry;
-
-    send_iommu_command(iommu, cmd);
-}
-
 /* 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.
  */
@@ -809,8 +576,7 @@
                                           hd->domain_id,
                                           hd->paging_mode, 1);
 
-            invalidate_dev_table_entry(iommu, req_id);
-            flush_command_buffer(iommu);
+            amd_iommu_flush_device(iommu, req_id);
             spin_unlock_irqrestore(&iommu->lock, flags);
         }
 
@@ -967,94 +733,6 @@
     return 0;
 }
 
-void amd_iommu_flush_iotlb(struct pci_dev *pdev,
-                           uint64_t gaddr, unsigned int order)
-{
-    unsigned long flags;
-    struct amd_iommu *iommu;
-    unsigned int bdf, req_id, queueid, maxpend;
-    struct pci_ats_dev *ats_pdev;
-
-    if ( !ats_enabled )
-        return;
-
-    ats_pdev = get_ats_device(pdev->seg, pdev->bus, pdev->devfn);
-    if ( ats_pdev == NULL )
-        return;
-
-    if ( !pci_ats_enabled(ats_pdev->seg, ats_pdev->bus, ats_pdev->devfn) )
-        return;
-
-    bdf = PCI_BDF2(ats_pdev->bus, ats_pdev->devfn);
-    iommu = find_iommu_for_device(ats_pdev->seg, bdf);
-
-    if ( !iommu )
-    {
-        AMD_IOMMU_DEBUG("%s: Can't find iommu for %04x:%02x:%02x.%u\n",
-                        __func__, ats_pdev->seg, ats_pdev->bus,
-                        PCI_SLOT(ats_pdev->devfn), PCI_FUNC(ats_pdev->devfn));
-        return;
-    }
-
-    if ( !iommu_has_cap(iommu, PCI_CAP_IOTLB_SHIFT) )
-        return;
-
-    req_id = get_dma_requestor_id(iommu->seg, bdf);
-    queueid = req_id;
-    maxpend = (ats_pdev->ats_queue_depth + 32) & 0xff;
-
-    /* send INVALIDATE_IOTLB_PAGES command */
-    spin_lock_irqsave(&iommu->lock, flags);
-    invalidate_iotlb_pages(iommu, maxpend, 0, queueid, gaddr, req_id, order);
-    flush_command_buffer(iommu);
-    spin_unlock_irqrestore(&iommu->lock, flags);
-}
-
-static void amd_iommu_flush_all_iotlbs(struct domain *d, uint64_t gaddr,
-                                       unsigned int order)
-{
-    struct pci_dev *pdev;
-
-    if ( !ats_enabled )
-        return;
-
-    for_each_pdev( d, pdev )
-        amd_iommu_flush_iotlb(pdev, gaddr, order);
-}
-
-/* Flush iommu cache after p2m changes. */
-static void _amd_iommu_flush_pages(struct domain *d,
-                                   uint64_t gaddr, unsigned int order)
-{
-    unsigned long flags;
-    struct amd_iommu *iommu;
-    struct hvm_iommu *hd = domain_hvm_iommu(d);
-    unsigned int dom_id = hd->domain_id;
-
-    /* send INVALIDATE_IOMMU_PAGES command */
-    for_each_amd_iommu ( iommu )
-    {
-        spin_lock_irqsave(&iommu->lock, flags);
-        invalidate_iommu_pages(iommu, gaddr, dom_id, order);
-        flush_command_buffer(iommu);
-        spin_unlock_irqrestore(&iommu->lock, flags);
-    }
-
-    if ( ats_enabled )
-        amd_iommu_flush_all_iotlbs(d, gaddr, order);
-}
-
-void amd_iommu_flush_all_pages(struct domain *d)
-{
-    _amd_iommu_flush_pages(d, INV_IOMMU_ALL_PAGES_ADDRESS, 0);
-}
-
-void amd_iommu_flush_pages(struct domain *d,
-                           unsigned long gfn, unsigned int order)
-{
-    _amd_iommu_flush_pages(d, (uint64_t) gfn << PAGE_SHIFT, order);
-}
-
 /* Share p2m table with iommu. */
 void amd_iommu_share_p2m(struct domain *d)
 {
diff -r 28c295c82ff6 -r 9a5e973305a8 xen/drivers/passthrough/amd/pci_amd_iommu.c
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c	Tue Nov 22 13:26:11 2011 +0000
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c	Tue Nov 22 13:26:46 2011 +0000
@@ -118,8 +118,7 @@
              iommu_has_cap(iommu, PCI_CAP_IOTLB_SHIFT) )
             iommu_dte_set_iotlb((u32 *)dte, dte_i);
 
-        invalidate_dev_table_entry(iommu, req_id);
-        flush_command_buffer(iommu);
+        amd_iommu_flush_device(iommu, req_id);
 
         AMD_IOMMU_DEBUG("Setup I/O page table: device id = 0x%04x, "
                         "root table = 0x%"PRIx64", "
@@ -310,8 +309,8 @@
              iommu_has_cap(iommu, PCI_CAP_IOTLB_SHIFT) )
             iommu_dte_set_iotlb((u32 *)dte, 0);
 
-        invalidate_dev_table_entry(iommu, req_id);
-        flush_command_buffer(iommu);
+        amd_iommu_flush_device(iommu, req_id);
+
         AMD_IOMMU_DEBUG("Disable: device id = 0x%04x, "
                         "domain = %d, paging mode = %d\n",
                         req_id,  domain_hvm_iommu(domain)->domain_id,
diff -r 28c295c82ff6 -r 9a5e973305a8 xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h	Tue Nov 22 13:26:11 2011 +0000
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h	Tue Nov 22 13:26:46 2011 +0000
@@ -53,12 +53,6 @@
 int amd_iommu_map_page(struct domain *d, unsigned long gfn, unsigned long mfn,
                        unsigned int flags);
 int amd_iommu_unmap_page(struct domain *d, unsigned long gfn);
-void amd_iommu_flush_pages(struct domain *d, unsigned long gfn,
-                           unsigned int order);
-void amd_iommu_flush_all_pages(struct domain *d);
-void amd_iommu_flush_iotlb(struct pci_dev *pdev, uint64_t gaddr,
-                           unsigned int order);
-
 u64 amd_iommu_get_next_table_from_pte(u32 *entry);
 int amd_iommu_reserve_domain_unity_map(struct domain *domain,
                                        u64 phys_addr, unsigned long size,
@@ -75,11 +69,15 @@
     u32 *dte, u64 root_ptr, u16 domain_id, u8 paging_mode, u8 valid);
 void iommu_dte_set_iotlb(u32 *dte, u8 i);
 void iommu_dte_add_device_entry(u32 *dte, struct ivrs_mappings *ivrs_dev);
-void invalidate_dev_table_entry(struct amd_iommu *iommu, u16 devic_id);
 
 /* send cmd to iommu */
-int send_iommu_command(struct amd_iommu *iommu, u32 cmd[]);
-void flush_command_buffer(struct amd_iommu *iommu);
+void amd_iommu_flush_all_pages(struct domain *d);
+void amd_iommu_flush_pages(struct domain *d, unsigned long gfn,
+                           unsigned int order);
+void amd_iommu_flush_iotlb(struct pci_dev *pdev, uint64_t gaddr,
+                           unsigned int order);
+void amd_iommu_flush_device(struct amd_iommu *iommu, uint16_t bdf);
+void amd_iommu_flush_intremap(struct amd_iommu *iommu, uint16_t bdf);
 
 /* find iommu for bdf */
 struct amd_iommu *find_iommu_for_device(int seg, int bdf);
@@ -88,7 +86,6 @@
 int amd_iommu_setup_ioapic_remapping(void);
 void *amd_iommu_alloc_intremap_table(void);
 int amd_iommu_free_intremap_table(u16 seg, struct ivrs_mappings *);
-void invalidate_interrupt_table(struct amd_iommu *iommu, u16 device_id);
 void amd_iommu_ioapic_update_ire(
     unsigned int apic, unsigned int reg, unsigned int value);
 void amd_iommu_msi_msg_update_ire(

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:26 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhO-0008K1-6I; Mon, 28 Nov 2011 23:33:22 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhM-0008Ij-Ni
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-21.messagelabs.com!1322523162!5926009!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30649 invoked from network); 28 Nov 2011 23:32:44 -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;
	28 Nov 2011 23:32: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 1RVAnA-0001i2-S4
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAh9-0000jO-F9
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:07 +0000
Message-Id: <E1RVAh9-0000jO-F9@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:06 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86,
	vmx: Remove broken and unused __vmptrst().
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1321966428 0
# Node ID 334d3ec1130c3890b848cf304c0ecadf729b4127
# Parent  0a0c02a616768bfab16c072788cb76be1893c37f
x86,vmx: Remove broken and unused __vmptrst().

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


diff -r 0a0c02a61676 -r 334d3ec1130c xen/include/asm-x86/hvm/vmx/vmx.h
--- a/xen/include/asm-x86/hvm/vmx/vmx.h	Mon Nov 21 21:28:34 2011 +0000
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h	Tue Nov 22 12:53:48 2011 +0000
@@ -231,15 +231,6 @@
                    : "memory");
 }
 
-static inline void __vmptrst(u64 addr)
-{
-    asm volatile ( VMPTRST_OPCODE
-                   MODRM_EAX_07
-                   :
-                   : "a" (&addr)
-                   : "memory");
-}
-
 static inline void __vmpclear(u64 addr)
 {
     asm volatile ( VMCLEAR_OPCODE

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:26 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhO-0008K1-6I; Mon, 28 Nov 2011 23:33:22 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhM-0008Ij-Ni
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-21.messagelabs.com!1322523162!5926009!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30649 invoked from network); 28 Nov 2011 23:32:44 -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;
	28 Nov 2011 23:32: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 1RVAnA-0001i2-S4
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAh9-0000jO-F9
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:07 +0000
Message-Id: <E1RVAh9-0000jO-F9@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:06 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86,
	vmx: Remove broken and unused __vmptrst().
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1321966428 0
# Node ID 334d3ec1130c3890b848cf304c0ecadf729b4127
# Parent  0a0c02a616768bfab16c072788cb76be1893c37f
x86,vmx: Remove broken and unused __vmptrst().

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


diff -r 0a0c02a61676 -r 334d3ec1130c xen/include/asm-x86/hvm/vmx/vmx.h
--- a/xen/include/asm-x86/hvm/vmx/vmx.h	Mon Nov 21 21:28:34 2011 +0000
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h	Tue Nov 22 12:53:48 2011 +0000
@@ -231,15 +231,6 @@
                    : "memory");
 }
 
-static inline void __vmptrst(u64 addr)
-{
-    asm volatile ( VMPTRST_OPCODE
-                   MODRM_EAX_07
-                   :
-                   : "a" (&addr)
-                   : "memory");
-}
-
 static inline void __vmpclear(u64 addr)
 {
     asm volatile ( VMCLEAR_OPCODE

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:26 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhN-0008Jk-35; Mon, 28 Nov 2011 23: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 1RVAhL-0008Ik-3y
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-27.messagelabs.com!1322523118!58663972!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22179 invoked from network); 28 Nov 2011 23:31:59 -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;
	28 Nov 2011 23:31:59 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnB-0001i8-Ku
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhA-0000js-H2
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:08 +0000
Message-Id: <E1RVAhA-0000js-H2@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] amd iommu: Advertise iommu extended
	feature bits to xen.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1321968342 0
# Node ID 883f1c35810e9bb2a84e27d0370e007e16fcb7e3
# Parent  fe80909663c1b1765d9b3407b8dcea88bc318d53
amd iommu: Advertise iommu extended feature bits to xen.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r fe80909663c1 -r 883f1c35810e xen/drivers/passthrough/amd/iommu_detect.c
--- a/xen/drivers/passthrough/amd/iommu_detect.c	Tue Nov 22 13:00:21 2011 +0000
+++ b/xen/drivers/passthrough/amd/iommu_detect.c	Tue Nov 22 13:25:42 2011 +0000
@@ -62,6 +62,47 @@
     return 0;
 }
 
+void __init get_iommu_features(struct amd_iommu *iommu)
+{
+    u32 low, high;
+    int i = 0 ;
+    char * feature_str[] = {
+        "- Prefetch Pages Command", 
+        "- Peripheral Page Service Request", 
+        "- X2APIC Supported", 
+        "- NX bit Supported", 
+        "- Guest Translation", 
+        "- Reserved bit [5]",
+        "- Invalidate All Command", 
+        "- Guest APIC supported", 
+        "- Hardware Error Registers", 
+        "- Performance Counters", 
+        NULL
+    };
+
+    ASSERT( iommu->mmio_base );
+
+    if ( !iommu_has_cap(iommu, PCI_CAP_EFRSUP_SHIFT) )
+    {
+        iommu->features = 0;
+        return;
+    }
+
+    low = readl(iommu->mmio_base + IOMMU_EXT_FEATURE_MMIO_OFFSET);
+    high = readl(iommu->mmio_base + IOMMU_EXT_FEATURE_MMIO_OFFSET + 4);
+
+    iommu->features = ((u64)high << 32) | low;
+
+    printk("AMD-Vi: IOMMU Extended Features:\n");
+
+    while ( feature_str[i] )
+    {
+        if ( iommu_has_feature(iommu, i) )
+            printk( " %s\n", feature_str[i]);
+        i++;
+    }
+}
+
 int __init amd_iommu_detect_one_acpi(void *ivhd)
 {
     struct amd_iommu *iommu;
diff -r fe80909663c1 -r 883f1c35810e xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c	Tue Nov 22 13:00:21 2011 +0000
+++ b/xen/drivers/passthrough/amd/iommu_init.c	Tue Nov 22 13:25:42 2011 +0000
@@ -684,6 +684,8 @@
     iommu->dev_table.entries = device_table.entries;
     iommu->dev_table.buffer = device_table.buffer;
 
+    get_iommu_features(iommu);
+
     enable_iommu(iommu);
     printk("AMD-Vi: IOMMU %d Enabled.\n", nr_amd_iommus );
     nr_amd_iommus++;
diff -r fe80909663c1 -r 883f1c35810e xen/include/asm-x86/amd-iommu.h
--- a/xen/include/asm-x86/amd-iommu.h	Tue Nov 22 13:00:21 2011 +0000
+++ b/xen/include/asm-x86/amd-iommu.h	Tue Nov 22 13:25:42 2011 +0000
@@ -54,6 +54,7 @@
     iommu_cap_t cap;
 
     u8 ht_flags;
+    u64 features;
 
     void *mmio_base;
     unsigned long mmio_base_phys;
diff -r fe80909663c1 -r 883f1c35810e xen/include/asm-x86/hvm/svm/amd-iommu-defs.h
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h	Tue Nov 22 13:00:21 2011 +0000
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h	Tue Nov 22 13:25:42 2011 +0000
@@ -54,6 +54,7 @@
 #define PCI_CAP_HT_TUNNEL_SHIFT	25
 #define PCI_CAP_NP_CACHE_MASK	0x04000000
 #define PCI_CAP_NP_CACHE_SHIFT	26
+#define PCI_CAP_EFRSUP_SHIFT    27
 #define PCI_CAP_RESET_MASK	0x80000000
 #define PCI_CAP_RESET_SHIFT	31
 
@@ -327,6 +328,26 @@
 #define IOMMU_EXCLUSION_LIMIT_HIGH_MASK		0xFFFFFFFF
 #define IOMMU_EXCLUSION_LIMIT_HIGH_SHIFT	0
 
+/* Extended Feature Register*/
+#define IOMMU_EXT_FEATURE_MMIO_OFFSET                   0x30
+#define IOMMU_EXT_FEATURE_PREFSUP_SHIFT                 0x0
+#define IOMMU_EXT_FEATURE_PPRSUP_SHIFT                  0x1
+#define IOMMU_EXT_FEATURE_XTSUP_SHIFT                   0x2
+#define IOMMU_EXT_FEATURE_NXSUP_SHIFT                   0x3
+#define IOMMU_EXT_FEATURE_GTSUP_SHIFT                   0x4
+#define IOMMU_EXT_FEATURE_IASUP_SHIFT                   0x6
+#define IOMMU_EXT_FEATURE_GASUP_SHIFT                   0x7
+#define IOMMU_EXT_FEATURE_HESUP_SHIFT                   0x8
+#define IOMMU_EXT_FEATURE_PCSUP_SHIFT                   0x9
+#define IOMMU_EXT_FEATURE_HATS_SHIFT                    0x10
+#define IOMMU_EXT_FEATURE_HATS_MASK                     0x00000C00
+#define IOMMU_EXT_FEATURE_GATS_SHIFT                    0x12
+#define IOMMU_EXT_FEATURE_GATS_MASK                     0x00003000
+#define IOMMU_EXT_FEATURE_GLXSUP                        0x14
+
+#define IOMMU_EXT_FEATURE_PASMAX_SHIFT                  0x0
+#define IOMMU_EXT_FEATURE_PASMAX_MASK                   0x0000001F
+
 /* Status Register*/
 #define IOMMU_STATUS_MMIO_OFFSET		0x2020
 #define IOMMU_STATUS_EVENT_OVERFLOW_MASK	0x00000001
diff -r fe80909663c1 -r 883f1c35810e xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h	Tue Nov 22 13:00:21 2011 +0000
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h	Tue Nov 22 13:25:42 2011 +0000
@@ -43,6 +43,7 @@
 int amd_iommu_get_ivrs_dev_entries(void);
 int amd_iommu_detect_one_acpi(void *ivhd);
 int amd_iommu_detect_acpi(void);
+void get_iommu_features(struct amd_iommu *iommu);
 
 /* amd-iommu-init functions */
 int amd_iommu_init(void);
@@ -183,8 +184,14 @@
 
 static inline int iommu_has_cap(struct amd_iommu *iommu, uint32_t bit)
 {
-    u32 mask = 1U << bit;
-    return iommu->cap.header & mask;
+    return !!(iommu->cap.header & (1u << bit));
+}
+
+static inline int iommu_has_feature(struct amd_iommu *iommu, uint32_t bit)
+{
+    if ( !iommu_has_cap(iommu, PCI_CAP_EFRSUP_SHIFT) )
+        return 0;
+    return !!(iommu->features & (1U << bit));
 }
 
 #endif /* _ASM_X86_64_AMD_IOMMU_PROTO_H */

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:26 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhN-0008Jk-35; Mon, 28 Nov 2011 23: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 1RVAhL-0008Ik-3y
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-27.messagelabs.com!1322523118!58663972!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22179 invoked from network); 28 Nov 2011 23:31:59 -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;
	28 Nov 2011 23:31:59 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnB-0001i8-Ku
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhA-0000js-H2
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:08 +0000
Message-Id: <E1RVAhA-0000js-H2@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] amd iommu: Advertise iommu extended
	feature bits to xen.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1321968342 0
# Node ID 883f1c35810e9bb2a84e27d0370e007e16fcb7e3
# Parent  fe80909663c1b1765d9b3407b8dcea88bc318d53
amd iommu: Advertise iommu extended feature bits to xen.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r fe80909663c1 -r 883f1c35810e xen/drivers/passthrough/amd/iommu_detect.c
--- a/xen/drivers/passthrough/amd/iommu_detect.c	Tue Nov 22 13:00:21 2011 +0000
+++ b/xen/drivers/passthrough/amd/iommu_detect.c	Tue Nov 22 13:25:42 2011 +0000
@@ -62,6 +62,47 @@
     return 0;
 }
 
+void __init get_iommu_features(struct amd_iommu *iommu)
+{
+    u32 low, high;
+    int i = 0 ;
+    char * feature_str[] = {
+        "- Prefetch Pages Command", 
+        "- Peripheral Page Service Request", 
+        "- X2APIC Supported", 
+        "- NX bit Supported", 
+        "- Guest Translation", 
+        "- Reserved bit [5]",
+        "- Invalidate All Command", 
+        "- Guest APIC supported", 
+        "- Hardware Error Registers", 
+        "- Performance Counters", 
+        NULL
+    };
+
+    ASSERT( iommu->mmio_base );
+
+    if ( !iommu_has_cap(iommu, PCI_CAP_EFRSUP_SHIFT) )
+    {
+        iommu->features = 0;
+        return;
+    }
+
+    low = readl(iommu->mmio_base + IOMMU_EXT_FEATURE_MMIO_OFFSET);
+    high = readl(iommu->mmio_base + IOMMU_EXT_FEATURE_MMIO_OFFSET + 4);
+
+    iommu->features = ((u64)high << 32) | low;
+
+    printk("AMD-Vi: IOMMU Extended Features:\n");
+
+    while ( feature_str[i] )
+    {
+        if ( iommu_has_feature(iommu, i) )
+            printk( " %s\n", feature_str[i]);
+        i++;
+    }
+}
+
 int __init amd_iommu_detect_one_acpi(void *ivhd)
 {
     struct amd_iommu *iommu;
diff -r fe80909663c1 -r 883f1c35810e xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c	Tue Nov 22 13:00:21 2011 +0000
+++ b/xen/drivers/passthrough/amd/iommu_init.c	Tue Nov 22 13:25:42 2011 +0000
@@ -684,6 +684,8 @@
     iommu->dev_table.entries = device_table.entries;
     iommu->dev_table.buffer = device_table.buffer;
 
+    get_iommu_features(iommu);
+
     enable_iommu(iommu);
     printk("AMD-Vi: IOMMU %d Enabled.\n", nr_amd_iommus );
     nr_amd_iommus++;
diff -r fe80909663c1 -r 883f1c35810e xen/include/asm-x86/amd-iommu.h
--- a/xen/include/asm-x86/amd-iommu.h	Tue Nov 22 13:00:21 2011 +0000
+++ b/xen/include/asm-x86/amd-iommu.h	Tue Nov 22 13:25:42 2011 +0000
@@ -54,6 +54,7 @@
     iommu_cap_t cap;
 
     u8 ht_flags;
+    u64 features;
 
     void *mmio_base;
     unsigned long mmio_base_phys;
diff -r fe80909663c1 -r 883f1c35810e xen/include/asm-x86/hvm/svm/amd-iommu-defs.h
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h	Tue Nov 22 13:00:21 2011 +0000
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h	Tue Nov 22 13:25:42 2011 +0000
@@ -54,6 +54,7 @@
 #define PCI_CAP_HT_TUNNEL_SHIFT	25
 #define PCI_CAP_NP_CACHE_MASK	0x04000000
 #define PCI_CAP_NP_CACHE_SHIFT	26
+#define PCI_CAP_EFRSUP_SHIFT    27
 #define PCI_CAP_RESET_MASK	0x80000000
 #define PCI_CAP_RESET_SHIFT	31
 
@@ -327,6 +328,26 @@
 #define IOMMU_EXCLUSION_LIMIT_HIGH_MASK		0xFFFFFFFF
 #define IOMMU_EXCLUSION_LIMIT_HIGH_SHIFT	0
 
+/* Extended Feature Register*/
+#define IOMMU_EXT_FEATURE_MMIO_OFFSET                   0x30
+#define IOMMU_EXT_FEATURE_PREFSUP_SHIFT                 0x0
+#define IOMMU_EXT_FEATURE_PPRSUP_SHIFT                  0x1
+#define IOMMU_EXT_FEATURE_XTSUP_SHIFT                   0x2
+#define IOMMU_EXT_FEATURE_NXSUP_SHIFT                   0x3
+#define IOMMU_EXT_FEATURE_GTSUP_SHIFT                   0x4
+#define IOMMU_EXT_FEATURE_IASUP_SHIFT                   0x6
+#define IOMMU_EXT_FEATURE_GASUP_SHIFT                   0x7
+#define IOMMU_EXT_FEATURE_HESUP_SHIFT                   0x8
+#define IOMMU_EXT_FEATURE_PCSUP_SHIFT                   0x9
+#define IOMMU_EXT_FEATURE_HATS_SHIFT                    0x10
+#define IOMMU_EXT_FEATURE_HATS_MASK                     0x00000C00
+#define IOMMU_EXT_FEATURE_GATS_SHIFT                    0x12
+#define IOMMU_EXT_FEATURE_GATS_MASK                     0x00003000
+#define IOMMU_EXT_FEATURE_GLXSUP                        0x14
+
+#define IOMMU_EXT_FEATURE_PASMAX_SHIFT                  0x0
+#define IOMMU_EXT_FEATURE_PASMAX_MASK                   0x0000001F
+
 /* Status Register*/
 #define IOMMU_STATUS_MMIO_OFFSET		0x2020
 #define IOMMU_STATUS_EVENT_OVERFLOW_MASK	0x00000001
diff -r fe80909663c1 -r 883f1c35810e xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h	Tue Nov 22 13:00:21 2011 +0000
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h	Tue Nov 22 13:25:42 2011 +0000
@@ -43,6 +43,7 @@
 int amd_iommu_get_ivrs_dev_entries(void);
 int amd_iommu_detect_one_acpi(void *ivhd);
 int amd_iommu_detect_acpi(void);
+void get_iommu_features(struct amd_iommu *iommu);
 
 /* amd-iommu-init functions */
 int amd_iommu_init(void);
@@ -183,8 +184,14 @@
 
 static inline int iommu_has_cap(struct amd_iommu *iommu, uint32_t bit)
 {
-    u32 mask = 1U << bit;
-    return iommu->cap.header & mask;
+    return !!(iommu->cap.header & (1u << bit));
+}
+
+static inline int iommu_has_feature(struct amd_iommu *iommu, uint32_t bit)
+{
+    if ( !iommu_has_cap(iommu, PCI_CAP_EFRSUP_SHIFT) )
+        return 0;
+    return !!(iommu->features & (1U << bit));
 }
 
 #endif /* _ASM_X86_64_AMD_IOMMU_PROTO_H */

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:26 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhP-0008Kh-9T; Mon, 28 Nov 2011 23:33: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 1RVAhN-0008Jp-Se
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-27.messagelabs.com!1322523134!54944097!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20182 invoked from network); 28 Nov 2011 23:32:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Nov 2011 23:32: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 1RVAnH-0001if-33
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhG-0000nH-1u
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:14 +0000
Message-Id: <E1RVAhG-0000nH-1u@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Merge
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1321981752 0
# Node ID 53bec838bb083a56211dd2d184be98578be4c37e
# Parent  8edcd2e3f3f1751d3e85b7612d1fa72c8d071047
# Parent  2b5c6fff0e5b51035656a4af8214c724defce17b
Merge
---


diff -r 8edcd2e3f3f1 -r 53bec838bb08 xen/arch/ia64/xen/pci.c
--- a/xen/arch/ia64/xen/pci.c	Tue Nov 22 17:07:32 2011 +0000
+++ b/xen/arch/ia64/xen/pci.c	Tue Nov 22 17:09:12 2011 +0000
@@ -135,8 +135,3 @@
     BUG_ON((seg > 65535) || (bus > 255) || (dev > 31) || (func > 7) || (reg > 255));
     pci_sal_write(seg, bus, (dev<<3)|func, reg, 4, data);
 }
-
-int pci_find_ext_capability(int seg, int bus, int devfn, int cap)
-{
-    return 0;
-}
diff -r 8edcd2e3f3f1 -r 53bec838bb08 xen/arch/x86/x86_32/pci.c
--- a/xen/arch/x86/x86_32/pci.c	Tue Nov 22 17:07:32 2011 +0000
+++ b/xen/arch/x86/x86_32/pci.c	Tue Nov 22 17:09:12 2011 +0000
@@ -15,9 +15,9 @@
     unsigned int seg, unsigned int bus, unsigned int dev, unsigned int func,
     unsigned int reg)
 {
-    if ( seg )
+    if ( seg || (reg > 255) )
         return ~0;
-    BUG_ON((bus > 255) || (dev > 31) || (func > 7) || (reg > 255));
+    BUG_ON((bus > 255) || (dev > 31) || (func > 7));
     return pci_conf_read(PCI_CONF_ADDRESS(bus, dev, func, reg), reg & 3, 1);
 }
 
@@ -25,9 +25,9 @@
     unsigned int seg, unsigned int bus, unsigned int dev, unsigned int func,
     unsigned int reg)
 {
-    if ( seg )
+    if ( seg || (reg > 255) )
         return ~0;
-    BUG_ON((bus > 255) || (dev > 31) || (func > 7) || (reg > 255));
+    BUG_ON((bus > 255) || (dev > 31) || (func > 7));
     return pci_conf_read(PCI_CONF_ADDRESS(bus, dev, func, reg), reg & 2, 2);
 }
 
@@ -35,9 +35,9 @@
     unsigned int seg, unsigned int bus, unsigned int dev, unsigned int func,
     unsigned int reg)
 {
-    if ( seg )
+    if ( seg || (reg > 255) )
         return ~0;
-    BUG_ON((bus > 255) || (dev > 31) || (func > 7) || (reg > 255));
+    BUG_ON((bus > 255) || (dev > 31) || (func > 7));
     return pci_conf_read(PCI_CONF_ADDRESS(bus, dev, func, reg), 0, 4);
 }
 
@@ -70,8 +70,3 @@
     BUG_ON((bus > 255) || (dev > 31) || (func > 7) || (reg > 255));
     pci_conf_write(PCI_CONF_ADDRESS(bus, dev, func, reg), 0, 4, data);
 }
-
-int pci_find_ext_capability(int seg, int bus, int devfn, int cap)
-{
-    return 0;
-}
diff -r 8edcd2e3f3f1 -r 53bec838bb08 xen/arch/x86/x86_64/mmconfig-shared.c
--- a/xen/arch/x86/x86_64/mmconfig-shared.c	Tue Nov 22 17:07:32 2011 +0000
+++ b/xen/arch/x86/x86_64/mmconfig-shared.c	Tue Nov 22 17:09:12 2011 +0000
@@ -450,43 +450,3 @@
 
     return -ENODEV;
 }
-
-/**
- * pci_find_ext_capability - Find an extended capability
- * @dev: PCI device to query
- * @cap: capability code
- *
- * Returns the address of the requested extended capability structure
- * within the device's PCI configuration space or 0 if the device does
- * not support it.  Possible values for @cap:
- *
- *  %PCI_EXT_CAP_ID_ERR         Advanced Error Reporting
- *  %PCI_EXT_CAP_ID_VC          Virtual Channel
- *  %PCI_EXT_CAP_ID_DSN         Device Serial Number
- *  %PCI_EXT_CAP_ID_PWR         Power Budgeting
- */
-int pci_find_ext_capability(int seg, int bus, int devfn, int cap)
-{
-    u32 header;
-    int ttl = 480; /* 3840 bytes, minimum 8 bytes per capability */
-    int pos = 0x100;
-
-    header = pci_conf_read32(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn), pos);
-
-    /*
-     * If we have no capabilities, this is indicated by cap ID,
-     * cap version and next pointer all being 0.
-     */
-    if ( (header == 0) || (header == -1) )
-        return 0;
-
-    while ( ttl-- > 0 ) {
-        if ( PCI_EXT_CAP_ID(header) == cap )
-            return pos;
-        pos = PCI_EXT_CAP_NEXT(header);
-        if ( pos < 0x100 )
-            break;
-        header = pci_conf_read32(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn), pos);
-    }
-    return 0;
-}
diff -r 8edcd2e3f3f1 -r 53bec838bb08 xen/drivers/pci/pci.c
--- a/xen/drivers/pci/pci.c	Tue Nov 22 17:07:32 2011 +0000
+++ b/xen/drivers/pci/pci.c	Tue Nov 22 17:09:12 2011 +0000
@@ -62,3 +62,43 @@
     }
     return 0;
 }
+
+/**
+ * pci_find_ext_capability - Find an extended capability
+ * @dev: PCI device to query
+ * @cap: capability code
+ *
+ * Returns the address of the requested extended capability structure
+ * within the device's PCI configuration space or 0 if the device does
+ * not support it.  Possible values for @cap:
+ *
+ *  %PCI_EXT_CAP_ID_ERR         Advanced Error Reporting
+ *  %PCI_EXT_CAP_ID_VC          Virtual Channel
+ *  %PCI_EXT_CAP_ID_DSN         Device Serial Number
+ *  %PCI_EXT_CAP_ID_PWR         Power Budgeting
+ */
+int pci_find_ext_capability(int seg, int bus, int devfn, int cap)
+{
+    u32 header;
+    int ttl = 480; /* 3840 bytes, minimum 8 bytes per capability */
+    int pos = 0x100;
+
+    header = pci_conf_read32(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn), pos);
+
+    /*
+     * If we have no capabilities, this is indicated by cap ID,
+     * cap version and next pointer all being 0.
+     */
+    if ( (header == 0) || (header == -1) )
+        return 0;
+
+    while ( ttl-- > 0 ) {
+        if ( PCI_EXT_CAP_ID(header) == cap )
+            return pos;
+        pos = PCI_EXT_CAP_NEXT(header);
+        if ( pos < 0x100 )
+            break;
+        header = pci_conf_read32(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn), pos);
+    }
+    return 0;
+}

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:26 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhP-0008Kh-9T; Mon, 28 Nov 2011 23:33: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 1RVAhN-0008Jp-Se
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-27.messagelabs.com!1322523134!54944097!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20182 invoked from network); 28 Nov 2011 23:32:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Nov 2011 23:32: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 1RVAnH-0001if-33
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhG-0000nH-1u
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:14 +0000
Message-Id: <E1RVAhG-0000nH-1u@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Merge
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1321981752 0
# Node ID 53bec838bb083a56211dd2d184be98578be4c37e
# Parent  8edcd2e3f3f1751d3e85b7612d1fa72c8d071047
# Parent  2b5c6fff0e5b51035656a4af8214c724defce17b
Merge
---


diff -r 8edcd2e3f3f1 -r 53bec838bb08 xen/arch/ia64/xen/pci.c
--- a/xen/arch/ia64/xen/pci.c	Tue Nov 22 17:07:32 2011 +0000
+++ b/xen/arch/ia64/xen/pci.c	Tue Nov 22 17:09:12 2011 +0000
@@ -135,8 +135,3 @@
     BUG_ON((seg > 65535) || (bus > 255) || (dev > 31) || (func > 7) || (reg > 255));
     pci_sal_write(seg, bus, (dev<<3)|func, reg, 4, data);
 }
-
-int pci_find_ext_capability(int seg, int bus, int devfn, int cap)
-{
-    return 0;
-}
diff -r 8edcd2e3f3f1 -r 53bec838bb08 xen/arch/x86/x86_32/pci.c
--- a/xen/arch/x86/x86_32/pci.c	Tue Nov 22 17:07:32 2011 +0000
+++ b/xen/arch/x86/x86_32/pci.c	Tue Nov 22 17:09:12 2011 +0000
@@ -15,9 +15,9 @@
     unsigned int seg, unsigned int bus, unsigned int dev, unsigned int func,
     unsigned int reg)
 {
-    if ( seg )
+    if ( seg || (reg > 255) )
         return ~0;
-    BUG_ON((bus > 255) || (dev > 31) || (func > 7) || (reg > 255));
+    BUG_ON((bus > 255) || (dev > 31) || (func > 7));
     return pci_conf_read(PCI_CONF_ADDRESS(bus, dev, func, reg), reg & 3, 1);
 }
 
@@ -25,9 +25,9 @@
     unsigned int seg, unsigned int bus, unsigned int dev, unsigned int func,
     unsigned int reg)
 {
-    if ( seg )
+    if ( seg || (reg > 255) )
         return ~0;
-    BUG_ON((bus > 255) || (dev > 31) || (func > 7) || (reg > 255));
+    BUG_ON((bus > 255) || (dev > 31) || (func > 7));
     return pci_conf_read(PCI_CONF_ADDRESS(bus, dev, func, reg), reg & 2, 2);
 }
 
@@ -35,9 +35,9 @@
     unsigned int seg, unsigned int bus, unsigned int dev, unsigned int func,
     unsigned int reg)
 {
-    if ( seg )
+    if ( seg || (reg > 255) )
         return ~0;
-    BUG_ON((bus > 255) || (dev > 31) || (func > 7) || (reg > 255));
+    BUG_ON((bus > 255) || (dev > 31) || (func > 7));
     return pci_conf_read(PCI_CONF_ADDRESS(bus, dev, func, reg), 0, 4);
 }
 
@@ -70,8 +70,3 @@
     BUG_ON((bus > 255) || (dev > 31) || (func > 7) || (reg > 255));
     pci_conf_write(PCI_CONF_ADDRESS(bus, dev, func, reg), 0, 4, data);
 }
-
-int pci_find_ext_capability(int seg, int bus, int devfn, int cap)
-{
-    return 0;
-}
diff -r 8edcd2e3f3f1 -r 53bec838bb08 xen/arch/x86/x86_64/mmconfig-shared.c
--- a/xen/arch/x86/x86_64/mmconfig-shared.c	Tue Nov 22 17:07:32 2011 +0000
+++ b/xen/arch/x86/x86_64/mmconfig-shared.c	Tue Nov 22 17:09:12 2011 +0000
@@ -450,43 +450,3 @@
 
     return -ENODEV;
 }
-
-/**
- * pci_find_ext_capability - Find an extended capability
- * @dev: PCI device to query
- * @cap: capability code
- *
- * Returns the address of the requested extended capability structure
- * within the device's PCI configuration space or 0 if the device does
- * not support it.  Possible values for @cap:
- *
- *  %PCI_EXT_CAP_ID_ERR         Advanced Error Reporting
- *  %PCI_EXT_CAP_ID_VC          Virtual Channel
- *  %PCI_EXT_CAP_ID_DSN         Device Serial Number
- *  %PCI_EXT_CAP_ID_PWR         Power Budgeting
- */
-int pci_find_ext_capability(int seg, int bus, int devfn, int cap)
-{
-    u32 header;
-    int ttl = 480; /* 3840 bytes, minimum 8 bytes per capability */
-    int pos = 0x100;
-
-    header = pci_conf_read32(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn), pos);
-
-    /*
-     * If we have no capabilities, this is indicated by cap ID,
-     * cap version and next pointer all being 0.
-     */
-    if ( (header == 0) || (header == -1) )
-        return 0;
-
-    while ( ttl-- > 0 ) {
-        if ( PCI_EXT_CAP_ID(header) == cap )
-            return pos;
-        pos = PCI_EXT_CAP_NEXT(header);
-        if ( pos < 0x100 )
-            break;
-        header = pci_conf_read32(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn), pos);
-    }
-    return 0;
-}
diff -r 8edcd2e3f3f1 -r 53bec838bb08 xen/drivers/pci/pci.c
--- a/xen/drivers/pci/pci.c	Tue Nov 22 17:07:32 2011 +0000
+++ b/xen/drivers/pci/pci.c	Tue Nov 22 17:09:12 2011 +0000
@@ -62,3 +62,43 @@
     }
     return 0;
 }
+
+/**
+ * pci_find_ext_capability - Find an extended capability
+ * @dev: PCI device to query
+ * @cap: capability code
+ *
+ * Returns the address of the requested extended capability structure
+ * within the device's PCI configuration space or 0 if the device does
+ * not support it.  Possible values for @cap:
+ *
+ *  %PCI_EXT_CAP_ID_ERR         Advanced Error Reporting
+ *  %PCI_EXT_CAP_ID_VC          Virtual Channel
+ *  %PCI_EXT_CAP_ID_DSN         Device Serial Number
+ *  %PCI_EXT_CAP_ID_PWR         Power Budgeting
+ */
+int pci_find_ext_capability(int seg, int bus, int devfn, int cap)
+{
+    u32 header;
+    int ttl = 480; /* 3840 bytes, minimum 8 bytes per capability */
+    int pos = 0x100;
+
+    header = pci_conf_read32(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn), pos);
+
+    /*
+     * If we have no capabilities, this is indicated by cap ID,
+     * cap version and next pointer all being 0.
+     */
+    if ( (header == 0) || (header == -1) )
+        return 0;
+
+    while ( ttl-- > 0 ) {
+        if ( PCI_EXT_CAP_ID(header) == cap )
+            return pos;
+        pos = PCI_EXT_CAP_NEXT(header);
+        if ( pos < 0x100 )
+            break;
+        header = pci_conf_read32(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn), pos);
+    }
+    return 0;
+}

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:27 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhR-0008MD-J0; Mon, 28 Nov 2011 23:33:25 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhP-0008Kt-U3
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-27.messagelabs.com!1322523137!59084722!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29884 invoked from network); 28 Nov 2011 23:32:18 -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;
	28 Nov 2011 23:32: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 1RVAnJ-0001iu-Id
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhI-0000oU-Hy
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:16 +0000
Message-Id: <E1RVAhI-0000oU-Hy@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] ia64: build fixes (again)
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1322124294 -3600
# Node ID b082fdc52ad7607d93b59148fb289aafe21f294b
# Parent  84b3e46aa7d24a4605c36940606e7da9679b0e7f
ia64: build fixes (again)

This undoes a single change from c/s 24136:3622d7fae14d
(common/grant_table.c) and several from c/s 24100:be8daf78856a
(common/memory.c). It also completes the former with two previously
missing ia64 specific code adjustments. Authors Cc-ed.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
---


diff -r 84b3e46aa7d2 -r b082fdc52ad7 xen/common/grant_table.c
--- a/xen/common/grant_table.c	Wed Nov 23 12:03:37 2011 +0000
+++ b/xen/common/grant_table.c	Thu Nov 24 09:44:54 2011 +0100
@@ -173,7 +173,7 @@
        rc = GNTST_bad_page;
     }
 #else
-    *frame = readonly ? get_gfn_untyped(rd, gfn) : gfn_to_mfn_private(rd, gfn);
+    *frame = readonly ? gmfn_to_mfn(rd, gfn) : gfn_to_mfn_private(rd, gfn);
 #endif
 
     return rc;
diff -r 84b3e46aa7d2 -r b082fdc52ad7 xen/common/memory.c
--- a/xen/common/memory.c	Wed Nov 23 12:03:37 2011 +0000
+++ b/xen/common/memory.c	Thu Nov 24 09:44:54 2011 +0100
@@ -165,7 +165,7 @@
     mfn = mfn_x(get_gfn(d, gmfn, &p2mt)); 
     if ( unlikely(p2m_is_paging(p2mt)) )
     {
-        guest_physmap_remove_page(d, gmfn, mfn, PAGE_ORDER_4K);
+        guest_physmap_remove_page(d, gmfn, mfn, 0);
         p2m_mem_paging_drop_page(d, gmfn);
         put_gfn(d, gmfn);
         return 1;
@@ -188,7 +188,7 @@
     if(p2m_is_shared(p2mt))
     {
         put_page_and_type(page);
-        guest_physmap_remove_page(d, gmfn, mfn, PAGE_ORDER_4K);
+        guest_physmap_remove_page(d, gmfn, mfn, 0);
         put_gfn(d, gmfn);
         return 1;
     }
@@ -207,7 +207,7 @@
     if ( test_and_clear_bit(_PGC_allocated, &page->count_info) )
         put_page(page);
 
-    guest_physmap_remove_page(d, gmfn, mfn, PAGE_ORDER_4K);
+    guest_physmap_remove_page(d, gmfn, mfn, 0);
 
     put_page(page);
     put_gfn(d, gmfn);
@@ -427,7 +427,7 @@
             gfn = mfn_to_gmfn(d, mfn);
             /* Pages were unshared above */
             BUG_ON(SHARED_M2P(gfn));
-            guest_physmap_remove_page(d, gfn, mfn, PAGE_ORDER_4K);
+            guest_physmap_remove_page(d, gfn, mfn, 0);
             put_page(page);
         }
 
diff -r 84b3e46aa7d2 -r b082fdc52ad7 xen/common/tmem_xen.c
--- a/xen/common/tmem_xen.c	Wed Nov 23 12:03:37 2011 +0000
+++ b/xen/common/tmem_xen.c	Thu Nov 24 09:44:54 2011 +0100
@@ -95,7 +95,7 @@
     return NULL;
 }
 
-static inline void cli_put_page(void *cli_va, pfp_t *cli_pfp,
+static inline void cli_put_page(tmem_cli_mfn_t cmfn, void *cli_va, pfp_t *cli_pfp,
                                 unsigned long cli_mfn, bool_t mark_dirty)
 {
     ASSERT(0);
diff -r 84b3e46aa7d2 -r b082fdc52ad7 xen/include/asm-ia64/mm.h
--- a/xen/include/asm-ia64/mm.h	Wed Nov 23 12:03:37 2011 +0000
+++ b/xen/include/asm-ia64/mm.h	Thu Nov 24 09:44:54 2011 +0100
@@ -532,6 +532,7 @@
 				u64* itir, struct p2m_entry* entry);
 #define machine_to_phys_mapping	mpt_table
 
+#define INVALID_GFN              (~0UL)
 #define INVALID_M2P_ENTRY        (~0UL)
 #define VALID_M2P(_e)            (!((_e) & (1UL<<63)))
 #define SHARED_M2P(_e)           0

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:27 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhS-0008N1-3g; Mon, 28 Nov 2011 23:33:26 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhQ-0008JT-PG
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-216.messagelabs.com!1322523167!5405082!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11221 invoked from network); 28 Nov 2011 23:32:48 -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;
	28 Nov 2011 23:32:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnF-0001iW-IO
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhE-0000mX-HL
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:12 +0000
Message-Id: <E1RVAhE-0000mX-HL@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: Add a vkbd frontend/backend
	pair for HVM guests
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1321978788 0
# Node ID b21b6c91c1f4f44523c0d401100a8cd9498fa514
# Parent  99a567be1978823ba630ba8bd4f5927a857b9599
libxl: Add a vkbd frontend/backend pair for HVM guests

Linux PV on HVM guests can use vkbd, so add a vkbd frontend/backend
pair for HVM guests by default.  It is useful because it doesn't
require frequent qemu wakeups as the usb keyboard/mouse does.

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


diff -r 99a567be1978 -r b21b6c91c1f4 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Tue Nov 22 16:19:11 2011 +0000
+++ b/tools/libxl/libxl_create.c	Tue Nov 22 16:19:48 2011 +0000
@@ -545,6 +545,7 @@
     case LIBXL_DOMAIN_TYPE_HVM:
     {
         libxl_device_console console;
+        libxl_device_vkb vkb;
 
         ret = init_console_info(&console, 0);
         if ( ret )
@@ -552,6 +553,12 @@
         libxl__device_console_add(gc, domid, &console, &state);
         libxl_device_console_dispose(&console);
 
+        ret = libxl_device_vkb_init(ctx, &vkb);
+        if ( ret )
+            goto error_out;
+        libxl_device_vkb_add(ctx, domid, &vkb);
+        libxl_device_vkb_dispose(&vkb);
+
         dm_info->domid = domid;
         ret = libxl__create_device_model(gc, dm_info,
                                         d_config->disks, d_config->num_disks,

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:27 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhS-0008Ms-0k; Mon, 28 Nov 2011 23:33:26 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhQ-0008JN-LE
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-182.messagelabs.com!1322523166!5037866!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11515 invoked from network); 28 Nov 2011 23:32:47 -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;
	28 Nov 2011 23:32:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnF-0001iT-54
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhE-0000mI-1A
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:12 +0000
Message-Id: <E1RVAhE-0000mI-1A@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Update QEMU_TAG
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1321978751 0
# Node ID 99a567be1978823ba630ba8bd4f5927a857b9599
# Parent  1f2a06dbbb69641f898bcc573fc34a353ca6bbc9
Update QEMU_TAG
---


diff -r 1f2a06dbbb69 -r 99a567be1978 Config.mk
--- a/Config.mk	Tue Nov 22 15:35:26 2011 +0000
+++ b/Config.mk	Tue Nov 22 16:19:11 2011 +0000
@@ -208,9 +208,9 @@
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= 52834188eedfbbca5636fd869d4c86b3b3044439
-# Tue Nov 1 18:42:55 2011 +0000
-# qemu-xen: remove i386-dm/README.hvm-pv-magic-ioport-disable
+QEMU_TAG ?= 9b33a3e5603ecd3ceca482a72c6ff8e951afb6d2
+# Tue Nov 22 16:12:40 2011 +0000
+# qemu-xen: add vkbd support for PV on HVM guests
 
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:27 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhR-0008M8-GC; Mon, 28 Nov 2011 23:33:25 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhP-0008K9-91
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-27.messagelabs.com!1322523128!55221069!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31072 invoked from network); 28 Nov 2011 23:32:09 -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;
	28 Nov 2011 23:32: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 1RVAnI-0001io-Il
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhH-0000o0-Hj
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:15 +0000
Message-Id: <E1RVAhH-0000o0-Hj@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools: use system libaio for blktap1
	as well.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322046931 0
# Node ID 7aa5838499d15555a4c2c6bde0c084762abe0195
# Parent  f88c745575bb738e7c217d9dffed37dc894e7a1c
tools: use system libaio for blktap1 as well.

24184:4ecd3615e726 missed this because I was accidentally testing with a
.config containing CONFIG_SYSTEM_LIBAIO=n. Tools tree now fully rebuilt
without this. There were no other issues.

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


diff -r f88c745575bb -r 7aa5838499d1 tools/blktap/drivers/Makefile
--- a/tools/blktap/drivers/Makefile	Tue Nov 22 18:51:13 2011 +0000
+++ b/tools/blktap/drivers/Makefile	Wed Nov 23 11:15:31 2011 +0000
@@ -3,7 +3,6 @@
 
 IBIN         = blktapctrl tapdisk
 QCOW_UTIL    = img2qcow qcow2raw qcow-create
-LIBAIO_DIR   = ../../libaio/src
 MEMSHR_DIR   = ../../memshr
 
 CFLAGS   += -Werror
@@ -11,7 +10,6 @@
 CFLAGS   += -I../lib
 CFLAGS   += $(CFLAGS_libxenctrl)
 CFLAGS   += $(CFLAGS_libxenstore)
-CFLAGS   += -I $(LIBAIO_DIR)
 CFLAGS   += -I $(MEMSHR_DIR)
 CFLAGS   += -D_GNU_SOURCE
 
@@ -29,8 +27,16 @@
 MEMSHRLIBS += $(MEMSHR_DIR)/libmemshr.a
 endif
 
+ifneq ($(CONFIG_SYSTEM_LIBAIO),y)
+LIBAIO_DIR   = ../../libaio/src
+CFLAGS      += -I $(LIBAIO_DIR)
+AIOLIBS     := $(LIBAIO_DIR)/libaio.a
+else
+AIOLIBS     := -laio
+endif
+
 LDLIBS_blktapctrl := $(MEMSHRLIBS) $(LDLIBS_libxenctrl) $(LDLIBS_libxenstore) -L../lib -lblktap -lrt -lm -lpthread
-LDLIBS_img := $(LIBAIO_DIR)/libaio.a $(CRYPT_LIB) -lpthread -lz
+LDLIBS_img := $(AIOLIBS) $(CRYPT_LIB) -lpthread -lz
 
 BLK-OBJS-y  := block-aio.o
 BLK-OBJS-y  += block-sync.o

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:27 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhS-0008Ms-0k; Mon, 28 Nov 2011 23:33:26 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhQ-0008JN-LE
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-182.messagelabs.com!1322523166!5037866!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11515 invoked from network); 28 Nov 2011 23:32:47 -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;
	28 Nov 2011 23:32:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnF-0001iT-54
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhE-0000mI-1A
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:12 +0000
Message-Id: <E1RVAhE-0000mI-1A@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Update QEMU_TAG
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1321978751 0
# Node ID 99a567be1978823ba630ba8bd4f5927a857b9599
# Parent  1f2a06dbbb69641f898bcc573fc34a353ca6bbc9
Update QEMU_TAG
---


diff -r 1f2a06dbbb69 -r 99a567be1978 Config.mk
--- a/Config.mk	Tue Nov 22 15:35:26 2011 +0000
+++ b/Config.mk	Tue Nov 22 16:19:11 2011 +0000
@@ -208,9 +208,9 @@
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= 52834188eedfbbca5636fd869d4c86b3b3044439
-# Tue Nov 1 18:42:55 2011 +0000
-# qemu-xen: remove i386-dm/README.hvm-pv-magic-ioport-disable
+QEMU_TAG ?= 9b33a3e5603ecd3ceca482a72c6ff8e951afb6d2
+# Tue Nov 22 16:12:40 2011 +0000
+# qemu-xen: add vkbd support for PV on HVM guests
 
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:27 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhR-0008MD-J0; Mon, 28 Nov 2011 23:33:25 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhP-0008Kt-U3
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-27.messagelabs.com!1322523137!59084722!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29884 invoked from network); 28 Nov 2011 23:32:18 -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;
	28 Nov 2011 23:32: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 1RVAnJ-0001iu-Id
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhI-0000oU-Hy
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:16 +0000
Message-Id: <E1RVAhI-0000oU-Hy@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] ia64: build fixes (again)
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1322124294 -3600
# Node ID b082fdc52ad7607d93b59148fb289aafe21f294b
# Parent  84b3e46aa7d24a4605c36940606e7da9679b0e7f
ia64: build fixes (again)

This undoes a single change from c/s 24136:3622d7fae14d
(common/grant_table.c) and several from c/s 24100:be8daf78856a
(common/memory.c). It also completes the former with two previously
missing ia64 specific code adjustments. Authors Cc-ed.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
---


diff -r 84b3e46aa7d2 -r b082fdc52ad7 xen/common/grant_table.c
--- a/xen/common/grant_table.c	Wed Nov 23 12:03:37 2011 +0000
+++ b/xen/common/grant_table.c	Thu Nov 24 09:44:54 2011 +0100
@@ -173,7 +173,7 @@
        rc = GNTST_bad_page;
     }
 #else
-    *frame = readonly ? get_gfn_untyped(rd, gfn) : gfn_to_mfn_private(rd, gfn);
+    *frame = readonly ? gmfn_to_mfn(rd, gfn) : gfn_to_mfn_private(rd, gfn);
 #endif
 
     return rc;
diff -r 84b3e46aa7d2 -r b082fdc52ad7 xen/common/memory.c
--- a/xen/common/memory.c	Wed Nov 23 12:03:37 2011 +0000
+++ b/xen/common/memory.c	Thu Nov 24 09:44:54 2011 +0100
@@ -165,7 +165,7 @@
     mfn = mfn_x(get_gfn(d, gmfn, &p2mt)); 
     if ( unlikely(p2m_is_paging(p2mt)) )
     {
-        guest_physmap_remove_page(d, gmfn, mfn, PAGE_ORDER_4K);
+        guest_physmap_remove_page(d, gmfn, mfn, 0);
         p2m_mem_paging_drop_page(d, gmfn);
         put_gfn(d, gmfn);
         return 1;
@@ -188,7 +188,7 @@
     if(p2m_is_shared(p2mt))
     {
         put_page_and_type(page);
-        guest_physmap_remove_page(d, gmfn, mfn, PAGE_ORDER_4K);
+        guest_physmap_remove_page(d, gmfn, mfn, 0);
         put_gfn(d, gmfn);
         return 1;
     }
@@ -207,7 +207,7 @@
     if ( test_and_clear_bit(_PGC_allocated, &page->count_info) )
         put_page(page);
 
-    guest_physmap_remove_page(d, gmfn, mfn, PAGE_ORDER_4K);
+    guest_physmap_remove_page(d, gmfn, mfn, 0);
 
     put_page(page);
     put_gfn(d, gmfn);
@@ -427,7 +427,7 @@
             gfn = mfn_to_gmfn(d, mfn);
             /* Pages were unshared above */
             BUG_ON(SHARED_M2P(gfn));
-            guest_physmap_remove_page(d, gfn, mfn, PAGE_ORDER_4K);
+            guest_physmap_remove_page(d, gfn, mfn, 0);
             put_page(page);
         }
 
diff -r 84b3e46aa7d2 -r b082fdc52ad7 xen/common/tmem_xen.c
--- a/xen/common/tmem_xen.c	Wed Nov 23 12:03:37 2011 +0000
+++ b/xen/common/tmem_xen.c	Thu Nov 24 09:44:54 2011 +0100
@@ -95,7 +95,7 @@
     return NULL;
 }
 
-static inline void cli_put_page(void *cli_va, pfp_t *cli_pfp,
+static inline void cli_put_page(tmem_cli_mfn_t cmfn, void *cli_va, pfp_t *cli_pfp,
                                 unsigned long cli_mfn, bool_t mark_dirty)
 {
     ASSERT(0);
diff -r 84b3e46aa7d2 -r b082fdc52ad7 xen/include/asm-ia64/mm.h
--- a/xen/include/asm-ia64/mm.h	Wed Nov 23 12:03:37 2011 +0000
+++ b/xen/include/asm-ia64/mm.h	Thu Nov 24 09:44:54 2011 +0100
@@ -532,6 +532,7 @@
 				u64* itir, struct p2m_entry* entry);
 #define machine_to_phys_mapping	mpt_table
 
+#define INVALID_GFN              (~0UL)
 #define INVALID_M2P_ENTRY        (~0UL)
 #define VALID_M2P(_e)            (!((_e) & (1UL<<63)))
 #define SHARED_M2P(_e)           0

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:27 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhR-0008M8-GC; Mon, 28 Nov 2011 23:33:25 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhP-0008K9-91
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-27.messagelabs.com!1322523128!55221069!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31072 invoked from network); 28 Nov 2011 23:32:09 -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;
	28 Nov 2011 23:32: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 1RVAnI-0001io-Il
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhH-0000o0-Hj
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:15 +0000
Message-Id: <E1RVAhH-0000o0-Hj@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools: use system libaio for blktap1
	as well.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322046931 0
# Node ID 7aa5838499d15555a4c2c6bde0c084762abe0195
# Parent  f88c745575bb738e7c217d9dffed37dc894e7a1c
tools: use system libaio for blktap1 as well.

24184:4ecd3615e726 missed this because I was accidentally testing with a
.config containing CONFIG_SYSTEM_LIBAIO=n. Tools tree now fully rebuilt
without this. There were no other issues.

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


diff -r f88c745575bb -r 7aa5838499d1 tools/blktap/drivers/Makefile
--- a/tools/blktap/drivers/Makefile	Tue Nov 22 18:51:13 2011 +0000
+++ b/tools/blktap/drivers/Makefile	Wed Nov 23 11:15:31 2011 +0000
@@ -3,7 +3,6 @@
 
 IBIN         = blktapctrl tapdisk
 QCOW_UTIL    = img2qcow qcow2raw qcow-create
-LIBAIO_DIR   = ../../libaio/src
 MEMSHR_DIR   = ../../memshr
 
 CFLAGS   += -Werror
@@ -11,7 +10,6 @@
 CFLAGS   += -I../lib
 CFLAGS   += $(CFLAGS_libxenctrl)
 CFLAGS   += $(CFLAGS_libxenstore)
-CFLAGS   += -I $(LIBAIO_DIR)
 CFLAGS   += -I $(MEMSHR_DIR)
 CFLAGS   += -D_GNU_SOURCE
 
@@ -29,8 +27,16 @@
 MEMSHRLIBS += $(MEMSHR_DIR)/libmemshr.a
 endif
 
+ifneq ($(CONFIG_SYSTEM_LIBAIO),y)
+LIBAIO_DIR   = ../../libaio/src
+CFLAGS      += -I $(LIBAIO_DIR)
+AIOLIBS     := $(LIBAIO_DIR)/libaio.a
+else
+AIOLIBS     := -laio
+endif
+
 LDLIBS_blktapctrl := $(MEMSHRLIBS) $(LDLIBS_libxenctrl) $(LDLIBS_libxenstore) -L../lib -lblktap -lrt -lm -lpthread
-LDLIBS_img := $(LIBAIO_DIR)/libaio.a $(CRYPT_LIB) -lpthread -lz
+LDLIBS_img := $(AIOLIBS) $(CRYPT_LIB) -lpthread -lz
 
 BLK-OBJS-y  := block-aio.o
 BLK-OBJS-y  += block-sync.o

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:27 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhS-0008N1-3g; Mon, 28 Nov 2011 23:33:26 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhQ-0008JT-PG
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-216.messagelabs.com!1322523167!5405082!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11221 invoked from network); 28 Nov 2011 23:32:48 -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;
	28 Nov 2011 23:32:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnF-0001iW-IO
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhE-0000mX-HL
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:12 +0000
Message-Id: <E1RVAhE-0000mX-HL@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: Add a vkbd frontend/backend
	pair for HVM guests
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1321978788 0
# Node ID b21b6c91c1f4f44523c0d401100a8cd9498fa514
# Parent  99a567be1978823ba630ba8bd4f5927a857b9599
libxl: Add a vkbd frontend/backend pair for HVM guests

Linux PV on HVM guests can use vkbd, so add a vkbd frontend/backend
pair for HVM guests by default.  It is useful because it doesn't
require frequent qemu wakeups as the usb keyboard/mouse does.

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


diff -r 99a567be1978 -r b21b6c91c1f4 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Tue Nov 22 16:19:11 2011 +0000
+++ b/tools/libxl/libxl_create.c	Tue Nov 22 16:19:48 2011 +0000
@@ -545,6 +545,7 @@
     case LIBXL_DOMAIN_TYPE_HVM:
     {
         libxl_device_console console;
+        libxl_device_vkb vkb;
 
         ret = init_console_info(&console, 0);
         if ( ret )
@@ -552,6 +553,12 @@
         libxl__device_console_add(gc, domid, &console, &state);
         libxl_device_console_dispose(&console);
 
+        ret = libxl_device_vkb_init(ctx, &vkb);
+        if ( ret )
+            goto error_out;
+        libxl_device_vkb_add(ctx, domid, &vkb);
+        libxl_device_vkb_dispose(&vkb);
+
         dm_info->domid = domid;
         ret = libxl__create_device_model(gc, dm_info,
                                         d_config->disks, d_config->num_disks,

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:27 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhR-0008MI-Lz; Mon, 28 Nov 2011 23:33:25 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhQ-0008JE-0S
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-182.messagelabs.com!1322523166!5061485!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3875 invoked from network); 28 Nov 2011 23:32:47 -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 Nov 2011 23:32:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnE-0001iQ-I4
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhD-0000m3-Gn
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:11 +0000
Message-Id: <E1RVAhD-0000m3-Gn@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] debug: Add domain/vcpu pause_count
	info to 'd' key.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1321976126 0
# Node ID 1f2a06dbbb69641f898bcc573fc34a353ca6bbc9
# Parent  d3859e348951cde6b211c5afb610ac1f12a909ec
debug: Add domain/vcpu pause_count info to 'd' key.

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


diff -r d3859e348951 -r 1f2a06dbbb69 xen/common/keyhandler.c
--- a/xen/common/keyhandler.c	Tue Nov 22 13:29:48 2011 +0000
+++ b/xen/common/keyhandler.c	Tue Nov 22 15:35:26 2011 +0000
@@ -245,9 +245,10 @@
         unsigned int i;
         printk("General information for domain %u:\n", d->domain_id);
         cpuset_print(tmpstr, sizeof(tmpstr), d->domain_dirty_cpumask);
-        printk("    refcnt=%d dying=%d nr_pages=%d xenheap_pages=%d "
-               "dirty_cpus=%s max_pages=%u\n",
+        printk("    refcnt=%d dying=%d pause_count=%d\n",
                atomic_read(&d->refcnt), d->is_dying,
+               atomic_read(&d->pause_count));
+        printk("    nr_pages=%d xenheap_pages=%d dirty_cpus=%s max_pages=%u\n",
                d->tot_pages, d->xenheap_pages, tmpstr, d->max_pages);
         printk("    handle=%02x%02x%02x%02x-%02x%02x-%02x%02x-"
                "%02x%02x-%02x%02x%02x%02x%02x%02x vm_assist=%08lx\n",
@@ -271,17 +272,18 @@
                d->domain_id);
         for_each_vcpu ( d, v )
         {
-            printk("    VCPU%d: CPU%d [has=%c] flags=%lx poll=%d "
+            printk("    VCPU%d: CPU%d [has=%c] poll=%d "
                    "upcall_pend = %02x, upcall_mask = %02x ",
                    v->vcpu_id, v->processor,
-                   v->is_running ? 'T':'F',
-                   v->pause_flags, v->poll_evtchn,
+                   v->is_running ? 'T':'F', v->poll_evtchn,
                    vcpu_info(v, evtchn_upcall_pending),
                    vcpu_info(v, evtchn_upcall_mask));
             cpuset_print(tmpstr, sizeof(tmpstr), v->vcpu_dirty_cpumask);
             printk("dirty_cpus=%s ", tmpstr);
             cpuset_print(tmpstr, sizeof(tmpstr), v->cpu_affinity);
             printk("cpu_affinity=%s\n", tmpstr);
+            printk("    pause_count=%d pause_flags=%lx\n",
+                   atomic_read(&v->pause_count), v->pause_flags);
             arch_dump_vcpu_info(v);
             periodic_timer_print(tmpstr, sizeof(tmpstr), v->periodic_period);
             printk("    %s\n", tmpstr);

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:27 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhR-0008MI-Lz; Mon, 28 Nov 2011 23:33:25 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhQ-0008JE-0S
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-182.messagelabs.com!1322523166!5061485!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3875 invoked from network); 28 Nov 2011 23:32:47 -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 Nov 2011 23:32:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnE-0001iQ-I4
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhD-0000m3-Gn
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:11 +0000
Message-Id: <E1RVAhD-0000m3-Gn@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] debug: Add domain/vcpu pause_count
	info to 'd' key.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1321976126 0
# Node ID 1f2a06dbbb69641f898bcc573fc34a353ca6bbc9
# Parent  d3859e348951cde6b211c5afb610ac1f12a909ec
debug: Add domain/vcpu pause_count info to 'd' key.

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


diff -r d3859e348951 -r 1f2a06dbbb69 xen/common/keyhandler.c
--- a/xen/common/keyhandler.c	Tue Nov 22 13:29:48 2011 +0000
+++ b/xen/common/keyhandler.c	Tue Nov 22 15:35:26 2011 +0000
@@ -245,9 +245,10 @@
         unsigned int i;
         printk("General information for domain %u:\n", d->domain_id);
         cpuset_print(tmpstr, sizeof(tmpstr), d->domain_dirty_cpumask);
-        printk("    refcnt=%d dying=%d nr_pages=%d xenheap_pages=%d "
-               "dirty_cpus=%s max_pages=%u\n",
+        printk("    refcnt=%d dying=%d pause_count=%d\n",
                atomic_read(&d->refcnt), d->is_dying,
+               atomic_read(&d->pause_count));
+        printk("    nr_pages=%d xenheap_pages=%d dirty_cpus=%s max_pages=%u\n",
                d->tot_pages, d->xenheap_pages, tmpstr, d->max_pages);
         printk("    handle=%02x%02x%02x%02x-%02x%02x-%02x%02x-"
                "%02x%02x-%02x%02x%02x%02x%02x%02x vm_assist=%08lx\n",
@@ -271,17 +272,18 @@
                d->domain_id);
         for_each_vcpu ( d, v )
         {
-            printk("    VCPU%d: CPU%d [has=%c] flags=%lx poll=%d "
+            printk("    VCPU%d: CPU%d [has=%c] poll=%d "
                    "upcall_pend = %02x, upcall_mask = %02x ",
                    v->vcpu_id, v->processor,
-                   v->is_running ? 'T':'F',
-                   v->pause_flags, v->poll_evtchn,
+                   v->is_running ? 'T':'F', v->poll_evtchn,
                    vcpu_info(v, evtchn_upcall_pending),
                    vcpu_info(v, evtchn_upcall_mask));
             cpuset_print(tmpstr, sizeof(tmpstr), v->vcpu_dirty_cpumask);
             printk("dirty_cpus=%s ", tmpstr);
             cpuset_print(tmpstr, sizeof(tmpstr), v->cpu_affinity);
             printk("cpu_affinity=%s\n", tmpstr);
+            printk("    pause_count=%d pause_flags=%lx\n",
+                   atomic_read(&v->pause_count), v->pause_flags);
             arch_dump_vcpu_info(v);
             periodic_timer_print(tmpstr, sizeof(tmpstr), v->periodic_period);
             printk("    %s\n", tmpstr);

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:28 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhS-0008ND-75; Mon, 28 Nov 2011 23:33: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 1RVAhQ-0008Jr-W1
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-27.messagelabs.com!1322523135!54944098!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20205 invoked from network); 28 Nov 2011 23:32:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Nov 2011 23:32: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 1RVAnH-0001ii-Iu
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhG-0000nW-IE
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:14 +0000
Message-Id: <E1RVAhG-0000nW-IE@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools: use system installed libaio
	by default.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1321982691 0
# Node ID 4ecd3615e7267c1b1ff760a9b6714d517e76e6a9
# Parent  53bec838bb083a56211dd2d184be98578be4c37e
tools: use system installed libaio by default.

I could have sworn I did this years ago.

IIRC the need for our own copy was due to the use of io_set_eventfd which is
not present in version 0.3.106. However it is in 0.3.107 the first version of
which was uploaded to Debian in June 2008 (I can't find a better reference for
the release date).

The necessary version is available in Debian Lenny onwards and is in at least
RHEL 6, Fedora 13 and OpenSuSE 11.3. The necessary version appears to not be
available in RHEL 5 or SLES 11 which is why I haven't simply nuked the in tree
version.

This is based on tools-system-libaio.diff from the Debian packaging although I
have made it optional (but default on).

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


diff -r 53bec838bb08 -r 4ecd3615e726 Config.mk
--- a/Config.mk	Tue Nov 22 17:09:12 2011 +0000
+++ b/Config.mk	Tue Nov 22 17:24:51 2011 +0000
@@ -232,6 +232,7 @@
 OCAML_TOOLS        ?= y
 CONFIG_MINITERM    ?= n
 CONFIG_LOMOUNT     ?= n
+CONFIG_SYSTEM_LIBAIO ?= y
 
 ifeq ($(OCAML_TOOLS),y)
 OCAML_TOOLS := $(shell ocamlopt -v > /dev/null 2>&1 && echo "y" || echo "n")
diff -r 53bec838bb08 -r 4ecd3615e726 README
--- a/README	Tue Nov 22 17:09:12 2011 +0000
+++ b/README	Tue Nov 22 17:24:51 2011 +0000
@@ -48,6 +48,8 @@
     * Development install of x11 (e.g. xorg-x11-dev)
     * Development install of uuid (e.g. uuid-dev)
     * Development install of yajl (e.g. libyajl-dev)
+    * Development install of libaio (e.g. libaio-dev) version 0.3.107 or
+      greater. Set CONFIG_SYSTEM_LIBAIO in .config if this is not available.
     * bridge-utils package (/sbin/brctl)
     * iproute package (/sbin/ip)
     * hotplug or udev
diff -r 53bec838bb08 -r 4ecd3615e726 tools/Makefile
--- a/tools/Makefile	Tue Nov 22 17:09:12 2011 +0000
+++ b/tools/Makefile	Tue Nov 22 17:24:51 2011 +0000
@@ -1,6 +1,10 @@
 XEN_ROOT = $(CURDIR)/..
 include $(XEN_ROOT)/tools/Rules.mk
 
+ifneq ($(CONFIG_SYSTEM_LIBAIO),y)
+SUBDIRS-libaio := libaio
+endif
+
 SUBDIRS-y :=
 SUBDIRS-y += check
 SUBDIRS-y += include
@@ -18,11 +22,11 @@
 SUBDIRS-$(VTPM_TOOLS) += vtpm_manager
 SUBDIRS-$(VTPM_TOOLS) += vtpm
 SUBDIRS-y += xenstat
-SUBDIRS-$(CONFIG_Linux) += libaio
+SUBDIRS-$(CONFIG_Linux) += $(SUBDIRS-libaio)
 SUBDIRS-$(CONFIG_Linux) += memshr 
 SUBDIRS-$(CONFIG_Linux) += blktap
 SUBDIRS-$(CONFIG_Linux) += blktap2
-SUBDIRS-$(CONFIG_NetBSD) += libaio
+SUBDIRS-$(CONFIG_NetBSD) += $(SUBDIRS-libaio)
 SUBDIRS-$(CONFIG_NetBSD) += blktap2
 SUBDIRS-$(CONFIG_NetBSD) += xenbackendd
 SUBDIRS-y += libfsimage
diff -r 53bec838bb08 -r 4ecd3615e726 tools/blktap2/drivers/Makefile
--- a/tools/blktap2/drivers/Makefile	Tue Nov 22 17:09:12 2011 +0000
+++ b/tools/blktap2/drivers/Makefile	Tue Nov 22 17:24:51 2011 +0000
@@ -14,7 +14,6 @@
 CFLAGS    += -fno-strict-aliasing
 CFLAGS    += -I$(BLKTAP_ROOT)/include -I$(BLKTAP_ROOT)/drivers
 CFLAGS    += $(CFLAGS_libxenctrl)
-CFLAGS    += -I $(LIBAIO_DIR)
 CFLAGS    += -I $(MEMSHR_DIR)
 CFLAGS    += -D_GNU_SOURCE
 CFLAGS    += -DUSE_NFS_LOCKS
@@ -30,7 +29,15 @@
 REMUS-OBJS  += hashtable_itr.o
 REMUS-OBJS  += hashtable_utility.o
 
+ifneq ($(CONFIG_SYSTEM_LIBAIO),y)
+CFLAGS    += -I $(LIBAIO_DIR)
 LIBAIO_DIR = $(XEN_ROOT)/tools/libaio/src
+tapdisk2 tapdisk-stream tapdisk-diff $(QCOW_UTIL): AIOLIBS := $(LIBAIO_DIR)/libaio.a 
+tapdisk-client tapdisk-stream tapdisk-diff $(QCOW_UTIL): CFLAGS  += -I$(LIBAIO_DIR)
+else
+tapdisk2 tapdisk-stream tapdisk-diff $(QCOW_UTIL): AIOLIBS := -laio
+endif
+
 MEMSHR_DIR = $(XEN_ROOT)/tools/memshr
 
 MEMSHRLIBS :=
@@ -39,9 +46,6 @@
 MEMSHRLIBS += $(MEMSHR_DIR)/libmemshr.a
 endif
 
-tapdisk2 tapdisk-stream tapdisk-diff $(QCOW_UTIL): AIOLIBS := $(LIBAIO_DIR)/libaio.a 
-tapdisk-client tapdisk-stream tapdisk-diff $(QCOW_UTIL): CFLAGS  += -I$(LIBAIO_DIR)
-
 ifeq ($(VHD_STATIC),y)
 td-util: CFLAGS += -static
 endif

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:28 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhS-0008ND-75; Mon, 28 Nov 2011 23:33: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 1RVAhQ-0008Jr-W1
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-27.messagelabs.com!1322523135!54944098!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20205 invoked from network); 28 Nov 2011 23:32:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Nov 2011 23:32: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 1RVAnH-0001ii-Iu
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhG-0000nW-IE
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:14 +0000
Message-Id: <E1RVAhG-0000nW-IE@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools: use system installed libaio
	by default.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1321982691 0
# Node ID 4ecd3615e7267c1b1ff760a9b6714d517e76e6a9
# Parent  53bec838bb083a56211dd2d184be98578be4c37e
tools: use system installed libaio by default.

I could have sworn I did this years ago.

IIRC the need for our own copy was due to the use of io_set_eventfd which is
not present in version 0.3.106. However it is in 0.3.107 the first version of
which was uploaded to Debian in June 2008 (I can't find a better reference for
the release date).

The necessary version is available in Debian Lenny onwards and is in at least
RHEL 6, Fedora 13 and OpenSuSE 11.3. The necessary version appears to not be
available in RHEL 5 or SLES 11 which is why I haven't simply nuked the in tree
version.

This is based on tools-system-libaio.diff from the Debian packaging although I
have made it optional (but default on).

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


diff -r 53bec838bb08 -r 4ecd3615e726 Config.mk
--- a/Config.mk	Tue Nov 22 17:09:12 2011 +0000
+++ b/Config.mk	Tue Nov 22 17:24:51 2011 +0000
@@ -232,6 +232,7 @@
 OCAML_TOOLS        ?= y
 CONFIG_MINITERM    ?= n
 CONFIG_LOMOUNT     ?= n
+CONFIG_SYSTEM_LIBAIO ?= y
 
 ifeq ($(OCAML_TOOLS),y)
 OCAML_TOOLS := $(shell ocamlopt -v > /dev/null 2>&1 && echo "y" || echo "n")
diff -r 53bec838bb08 -r 4ecd3615e726 README
--- a/README	Tue Nov 22 17:09:12 2011 +0000
+++ b/README	Tue Nov 22 17:24:51 2011 +0000
@@ -48,6 +48,8 @@
     * Development install of x11 (e.g. xorg-x11-dev)
     * Development install of uuid (e.g. uuid-dev)
     * Development install of yajl (e.g. libyajl-dev)
+    * Development install of libaio (e.g. libaio-dev) version 0.3.107 or
+      greater. Set CONFIG_SYSTEM_LIBAIO in .config if this is not available.
     * bridge-utils package (/sbin/brctl)
     * iproute package (/sbin/ip)
     * hotplug or udev
diff -r 53bec838bb08 -r 4ecd3615e726 tools/Makefile
--- a/tools/Makefile	Tue Nov 22 17:09:12 2011 +0000
+++ b/tools/Makefile	Tue Nov 22 17:24:51 2011 +0000
@@ -1,6 +1,10 @@
 XEN_ROOT = $(CURDIR)/..
 include $(XEN_ROOT)/tools/Rules.mk
 
+ifneq ($(CONFIG_SYSTEM_LIBAIO),y)
+SUBDIRS-libaio := libaio
+endif
+
 SUBDIRS-y :=
 SUBDIRS-y += check
 SUBDIRS-y += include
@@ -18,11 +22,11 @@
 SUBDIRS-$(VTPM_TOOLS) += vtpm_manager
 SUBDIRS-$(VTPM_TOOLS) += vtpm
 SUBDIRS-y += xenstat
-SUBDIRS-$(CONFIG_Linux) += libaio
+SUBDIRS-$(CONFIG_Linux) += $(SUBDIRS-libaio)
 SUBDIRS-$(CONFIG_Linux) += memshr 
 SUBDIRS-$(CONFIG_Linux) += blktap
 SUBDIRS-$(CONFIG_Linux) += blktap2
-SUBDIRS-$(CONFIG_NetBSD) += libaio
+SUBDIRS-$(CONFIG_NetBSD) += $(SUBDIRS-libaio)
 SUBDIRS-$(CONFIG_NetBSD) += blktap2
 SUBDIRS-$(CONFIG_NetBSD) += xenbackendd
 SUBDIRS-y += libfsimage
diff -r 53bec838bb08 -r 4ecd3615e726 tools/blktap2/drivers/Makefile
--- a/tools/blktap2/drivers/Makefile	Tue Nov 22 17:09:12 2011 +0000
+++ b/tools/blktap2/drivers/Makefile	Tue Nov 22 17:24:51 2011 +0000
@@ -14,7 +14,6 @@
 CFLAGS    += -fno-strict-aliasing
 CFLAGS    += -I$(BLKTAP_ROOT)/include -I$(BLKTAP_ROOT)/drivers
 CFLAGS    += $(CFLAGS_libxenctrl)
-CFLAGS    += -I $(LIBAIO_DIR)
 CFLAGS    += -I $(MEMSHR_DIR)
 CFLAGS    += -D_GNU_SOURCE
 CFLAGS    += -DUSE_NFS_LOCKS
@@ -30,7 +29,15 @@
 REMUS-OBJS  += hashtable_itr.o
 REMUS-OBJS  += hashtable_utility.o
 
+ifneq ($(CONFIG_SYSTEM_LIBAIO),y)
+CFLAGS    += -I $(LIBAIO_DIR)
 LIBAIO_DIR = $(XEN_ROOT)/tools/libaio/src
+tapdisk2 tapdisk-stream tapdisk-diff $(QCOW_UTIL): AIOLIBS := $(LIBAIO_DIR)/libaio.a 
+tapdisk-client tapdisk-stream tapdisk-diff $(QCOW_UTIL): CFLAGS  += -I$(LIBAIO_DIR)
+else
+tapdisk2 tapdisk-stream tapdisk-diff $(QCOW_UTIL): AIOLIBS := -laio
+endif
+
 MEMSHR_DIR = $(XEN_ROOT)/tools/memshr
 
 MEMSHRLIBS :=
@@ -39,9 +46,6 @@
 MEMSHRLIBS += $(MEMSHR_DIR)/libmemshr.a
 endif
 
-tapdisk2 tapdisk-stream tapdisk-diff $(QCOW_UTIL): AIOLIBS := $(LIBAIO_DIR)/libaio.a 
-tapdisk-client tapdisk-stream tapdisk-diff $(QCOW_UTIL): CFLAGS  += -I$(LIBAIO_DIR)
-
 ifeq ($(VHD_STATIC),y)
 td-util: CFLAGS += -static
 endif

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:28 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhT-0008Pg-EY; Mon, 28 Nov 2011 23:33:27 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhR-0008JZ-MT
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-216.messagelabs.com!1322523167!5405083!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11237 invoked from network); 28 Nov 2011 23:32:48 -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;
	28 Nov 2011 23:32:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnG-0001iZ-5J
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhF-0000mn-1Y
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:13 +0000
Message-Id: <E1RVAhF-0000mn-1Y@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] move pci_find_ext_capability() into
	common PCI code
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1321978951 -3600
# Node ID 2b5c6fff0e5b51035656a4af8214c724defce17b
# Parent  b21b6c91c1f4f44523c0d401100a8cd9498fa514
move pci_find_ext_capability() into common PCI code

There's nothing architecture specific about it. It requires, however,
that x86-32's pci_conf_read32() tolerates register accesses above 255
(for consistency the adjustment is done to all pci_conf_readNN()
functions).

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


diff -r b21b6c91c1f4 -r 2b5c6fff0e5b xen/arch/ia64/xen/pci.c
--- a/xen/arch/ia64/xen/pci.c	Tue Nov 22 16:19:48 2011 +0000
+++ b/xen/arch/ia64/xen/pci.c	Tue Nov 22 17:22:31 2011 +0100
@@ -135,8 +135,3 @@
     BUG_ON((seg > 65535) || (bus > 255) || (dev > 31) || (func > 7) || (reg > 255));
     pci_sal_write(seg, bus, (dev<<3)|func, reg, 4, data);
 }
-
-int pci_find_ext_capability(int seg, int bus, int devfn, int cap)
-{
-    return 0;
-}
diff -r b21b6c91c1f4 -r 2b5c6fff0e5b xen/arch/x86/x86_32/pci.c
--- a/xen/arch/x86/x86_32/pci.c	Tue Nov 22 16:19:48 2011 +0000
+++ b/xen/arch/x86/x86_32/pci.c	Tue Nov 22 17:22:31 2011 +0100
@@ -15,9 +15,9 @@
     unsigned int seg, unsigned int bus, unsigned int dev, unsigned int func,
     unsigned int reg)
 {
-    if ( seg )
+    if ( seg || (reg > 255) )
         return ~0;
-    BUG_ON((bus > 255) || (dev > 31) || (func > 7) || (reg > 255));
+    BUG_ON((bus > 255) || (dev > 31) || (func > 7));
     return pci_conf_read(PCI_CONF_ADDRESS(bus, dev, func, reg), reg & 3, 1);
 }
 
@@ -25,9 +25,9 @@
     unsigned int seg, unsigned int bus, unsigned int dev, unsigned int func,
     unsigned int reg)
 {
-    if ( seg )
+    if ( seg || (reg > 255) )
         return ~0;
-    BUG_ON((bus > 255) || (dev > 31) || (func > 7) || (reg > 255));
+    BUG_ON((bus > 255) || (dev > 31) || (func > 7));
     return pci_conf_read(PCI_CONF_ADDRESS(bus, dev, func, reg), reg & 2, 2);
 }
 
@@ -35,9 +35,9 @@
     unsigned int seg, unsigned int bus, unsigned int dev, unsigned int func,
     unsigned int reg)
 {
-    if ( seg )
+    if ( seg || (reg > 255) )
         return ~0;
-    BUG_ON((bus > 255) || (dev > 31) || (func > 7) || (reg > 255));
+    BUG_ON((bus > 255) || (dev > 31) || (func > 7));
     return pci_conf_read(PCI_CONF_ADDRESS(bus, dev, func, reg), 0, 4);
 }
 
@@ -70,8 +70,3 @@
     BUG_ON((bus > 255) || (dev > 31) || (func > 7) || (reg > 255));
     pci_conf_write(PCI_CONF_ADDRESS(bus, dev, func, reg), 0, 4, data);
 }
-
-int pci_find_ext_capability(int seg, int bus, int devfn, int cap)
-{
-    return 0;
-}
diff -r b21b6c91c1f4 -r 2b5c6fff0e5b xen/arch/x86/x86_64/mmconfig-shared.c
--- a/xen/arch/x86/x86_64/mmconfig-shared.c	Tue Nov 22 16:19:48 2011 +0000
+++ b/xen/arch/x86/x86_64/mmconfig-shared.c	Tue Nov 22 17:22:31 2011 +0100
@@ -450,43 +450,3 @@
 
     return -ENODEV;
 }
-
-/**
- * pci_find_ext_capability - Find an extended capability
- * @dev: PCI device to query
- * @cap: capability code
- *
- * Returns the address of the requested extended capability structure
- * within the device's PCI configuration space or 0 if the device does
- * not support it.  Possible values for @cap:
- *
- *  %PCI_EXT_CAP_ID_ERR         Advanced Error Reporting
- *  %PCI_EXT_CAP_ID_VC          Virtual Channel
- *  %PCI_EXT_CAP_ID_DSN         Device Serial Number
- *  %PCI_EXT_CAP_ID_PWR         Power Budgeting
- */
-int pci_find_ext_capability(int seg, int bus, int devfn, int cap)
-{
-    u32 header;
-    int ttl = 480; /* 3840 bytes, minimum 8 bytes per capability */
-    int pos = 0x100;
-
-    header = pci_conf_read32(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn), pos);
-
-    /*
-     * If we have no capabilities, this is indicated by cap ID,
-     * cap version and next pointer all being 0.
-     */
-    if ( (header == 0) || (header == -1) )
-        return 0;
-
-    while ( ttl-- > 0 ) {
-        if ( PCI_EXT_CAP_ID(header) == cap )
-            return pos;
-        pos = PCI_EXT_CAP_NEXT(header);
-        if ( pos < 0x100 )
-            break;
-        header = pci_conf_read32(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn), pos);
-    }
-    return 0;
-}
diff -r b21b6c91c1f4 -r 2b5c6fff0e5b xen/drivers/pci/pci.c
--- a/xen/drivers/pci/pci.c	Tue Nov 22 16:19:48 2011 +0000
+++ b/xen/drivers/pci/pci.c	Tue Nov 22 17:22:31 2011 +0100
@@ -62,3 +62,43 @@
     }
     return 0;
 }
+
+/**
+ * pci_find_ext_capability - Find an extended capability
+ * @dev: PCI device to query
+ * @cap: capability code
+ *
+ * Returns the address of the requested extended capability structure
+ * within the device's PCI configuration space or 0 if the device does
+ * not support it.  Possible values for @cap:
+ *
+ *  %PCI_EXT_CAP_ID_ERR         Advanced Error Reporting
+ *  %PCI_EXT_CAP_ID_VC          Virtual Channel
+ *  %PCI_EXT_CAP_ID_DSN         Device Serial Number
+ *  %PCI_EXT_CAP_ID_PWR         Power Budgeting
+ */
+int pci_find_ext_capability(int seg, int bus, int devfn, int cap)
+{
+    u32 header;
+    int ttl = 480; /* 3840 bytes, minimum 8 bytes per capability */
+    int pos = 0x100;
+
+    header = pci_conf_read32(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn), pos);
+
+    /*
+     * If we have no capabilities, this is indicated by cap ID,
+     * cap version and next pointer all being 0.
+     */
+    if ( (header == 0) || (header == -1) )
+        return 0;
+
+    while ( ttl-- > 0 ) {
+        if ( PCI_EXT_CAP_ID(header) == cap )
+            return pos;
+        pos = PCI_EXT_CAP_NEXT(header);
+        if ( pos < 0x100 )
+            break;
+        header = pci_conf_read32(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn), pos);
+    }
+    return 0;
+}

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:28 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhT-0008Pg-EY; Mon, 28 Nov 2011 23:33:27 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhR-0008JZ-MT
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-216.messagelabs.com!1322523167!5405083!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11237 invoked from network); 28 Nov 2011 23:32:48 -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;
	28 Nov 2011 23:32:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnG-0001iZ-5J
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhF-0000mn-1Y
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:13 +0000
Message-Id: <E1RVAhF-0000mn-1Y@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] move pci_find_ext_capability() into
	common PCI code
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1321978951 -3600
# Node ID 2b5c6fff0e5b51035656a4af8214c724defce17b
# Parent  b21b6c91c1f4f44523c0d401100a8cd9498fa514
move pci_find_ext_capability() into common PCI code

There's nothing architecture specific about it. It requires, however,
that x86-32's pci_conf_read32() tolerates register accesses above 255
(for consistency the adjustment is done to all pci_conf_readNN()
functions).

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


diff -r b21b6c91c1f4 -r 2b5c6fff0e5b xen/arch/ia64/xen/pci.c
--- a/xen/arch/ia64/xen/pci.c	Tue Nov 22 16:19:48 2011 +0000
+++ b/xen/arch/ia64/xen/pci.c	Tue Nov 22 17:22:31 2011 +0100
@@ -135,8 +135,3 @@
     BUG_ON((seg > 65535) || (bus > 255) || (dev > 31) || (func > 7) || (reg > 255));
     pci_sal_write(seg, bus, (dev<<3)|func, reg, 4, data);
 }
-
-int pci_find_ext_capability(int seg, int bus, int devfn, int cap)
-{
-    return 0;
-}
diff -r b21b6c91c1f4 -r 2b5c6fff0e5b xen/arch/x86/x86_32/pci.c
--- a/xen/arch/x86/x86_32/pci.c	Tue Nov 22 16:19:48 2011 +0000
+++ b/xen/arch/x86/x86_32/pci.c	Tue Nov 22 17:22:31 2011 +0100
@@ -15,9 +15,9 @@
     unsigned int seg, unsigned int bus, unsigned int dev, unsigned int func,
     unsigned int reg)
 {
-    if ( seg )
+    if ( seg || (reg > 255) )
         return ~0;
-    BUG_ON((bus > 255) || (dev > 31) || (func > 7) || (reg > 255));
+    BUG_ON((bus > 255) || (dev > 31) || (func > 7));
     return pci_conf_read(PCI_CONF_ADDRESS(bus, dev, func, reg), reg & 3, 1);
 }
 
@@ -25,9 +25,9 @@
     unsigned int seg, unsigned int bus, unsigned int dev, unsigned int func,
     unsigned int reg)
 {
-    if ( seg )
+    if ( seg || (reg > 255) )
         return ~0;
-    BUG_ON((bus > 255) || (dev > 31) || (func > 7) || (reg > 255));
+    BUG_ON((bus > 255) || (dev > 31) || (func > 7));
     return pci_conf_read(PCI_CONF_ADDRESS(bus, dev, func, reg), reg & 2, 2);
 }
 
@@ -35,9 +35,9 @@
     unsigned int seg, unsigned int bus, unsigned int dev, unsigned int func,
     unsigned int reg)
 {
-    if ( seg )
+    if ( seg || (reg > 255) )
         return ~0;
-    BUG_ON((bus > 255) || (dev > 31) || (func > 7) || (reg > 255));
+    BUG_ON((bus > 255) || (dev > 31) || (func > 7));
     return pci_conf_read(PCI_CONF_ADDRESS(bus, dev, func, reg), 0, 4);
 }
 
@@ -70,8 +70,3 @@
     BUG_ON((bus > 255) || (dev > 31) || (func > 7) || (reg > 255));
     pci_conf_write(PCI_CONF_ADDRESS(bus, dev, func, reg), 0, 4, data);
 }
-
-int pci_find_ext_capability(int seg, int bus, int devfn, int cap)
-{
-    return 0;
-}
diff -r b21b6c91c1f4 -r 2b5c6fff0e5b xen/arch/x86/x86_64/mmconfig-shared.c
--- a/xen/arch/x86/x86_64/mmconfig-shared.c	Tue Nov 22 16:19:48 2011 +0000
+++ b/xen/arch/x86/x86_64/mmconfig-shared.c	Tue Nov 22 17:22:31 2011 +0100
@@ -450,43 +450,3 @@
 
     return -ENODEV;
 }
-
-/**
- * pci_find_ext_capability - Find an extended capability
- * @dev: PCI device to query
- * @cap: capability code
- *
- * Returns the address of the requested extended capability structure
- * within the device's PCI configuration space or 0 if the device does
- * not support it.  Possible values for @cap:
- *
- *  %PCI_EXT_CAP_ID_ERR         Advanced Error Reporting
- *  %PCI_EXT_CAP_ID_VC          Virtual Channel
- *  %PCI_EXT_CAP_ID_DSN         Device Serial Number
- *  %PCI_EXT_CAP_ID_PWR         Power Budgeting
- */
-int pci_find_ext_capability(int seg, int bus, int devfn, int cap)
-{
-    u32 header;
-    int ttl = 480; /* 3840 bytes, minimum 8 bytes per capability */
-    int pos = 0x100;
-
-    header = pci_conf_read32(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn), pos);
-
-    /*
-     * If we have no capabilities, this is indicated by cap ID,
-     * cap version and next pointer all being 0.
-     */
-    if ( (header == 0) || (header == -1) )
-        return 0;
-
-    while ( ttl-- > 0 ) {
-        if ( PCI_EXT_CAP_ID(header) == cap )
-            return pos;
-        pos = PCI_EXT_CAP_NEXT(header);
-        if ( pos < 0x100 )
-            break;
-        header = pci_conf_read32(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn), pos);
-    }
-    return 0;
-}
diff -r b21b6c91c1f4 -r 2b5c6fff0e5b xen/drivers/pci/pci.c
--- a/xen/drivers/pci/pci.c	Tue Nov 22 16:19:48 2011 +0000
+++ b/xen/drivers/pci/pci.c	Tue Nov 22 17:22:31 2011 +0100
@@ -62,3 +62,43 @@
     }
     return 0;
 }
+
+/**
+ * pci_find_ext_capability - Find an extended capability
+ * @dev: PCI device to query
+ * @cap: capability code
+ *
+ * Returns the address of the requested extended capability structure
+ * within the device's PCI configuration space or 0 if the device does
+ * not support it.  Possible values for @cap:
+ *
+ *  %PCI_EXT_CAP_ID_ERR         Advanced Error Reporting
+ *  %PCI_EXT_CAP_ID_VC          Virtual Channel
+ *  %PCI_EXT_CAP_ID_DSN         Device Serial Number
+ *  %PCI_EXT_CAP_ID_PWR         Power Budgeting
+ */
+int pci_find_ext_capability(int seg, int bus, int devfn, int cap)
+{
+    u32 header;
+    int ttl = 480; /* 3840 bytes, minimum 8 bytes per capability */
+    int pos = 0x100;
+
+    header = pci_conf_read32(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn), pos);
+
+    /*
+     * If we have no capabilities, this is indicated by cap ID,
+     * cap version and next pointer all being 0.
+     */
+    if ( (header == 0) || (header == -1) )
+        return 0;
+
+    while ( ttl-- > 0 ) {
+        if ( PCI_EXT_CAP_ID(header) == cap )
+            return pos;
+        pos = PCI_EXT_CAP_NEXT(header);
+        if ( pos < 0x100 )
+            break;
+        header = pci_conf_read32(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn), pos);
+    }
+    return 0;
+}

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:28 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhT-0008Q3-Ni; Mon, 28 Nov 2011 23:33:27 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhR-0008Ja-TP
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:26 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-174.messagelabs.com!1322523167!3409948!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27683 invoked from network); 28 Nov 2011 23:32:49 -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;
	28 Nov 2011 23:32:49 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnD-0001iH-12
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhC-0000kb-0U
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:10 +0000
Message-Id: <E1RVAhC-0000kb-0U@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] amd iommu: Support
	INVALIDATE_IOMMU_ALL command.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1321968439 0
# Node ID 2bc6c29b14a791e63e396f830e79adf790668d24
# Parent  9a5e973305a84e868c6740626b76008c5476bfe9
amd iommu: Support INVALIDATE_IOMMU_ALL command.

It is one of the new architectural commands supported by iommu v2.
It instructs iommu to clear all address translation and interrupt
remapping caches for all devices and all domains.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 9a5e973305a8 -r 2bc6c29b14a7 xen/drivers/passthrough/amd/iommu_cmd.c
--- a/xen/drivers/passthrough/amd/iommu_cmd.c	Tue Nov 22 13:26:46 2011 +0000
+++ b/xen/drivers/passthrough/amd/iommu_cmd.c	Tue Nov 22 13:27:19 2011 +0000
@@ -277,6 +277,20 @@
     send_iommu_command(iommu, cmd);
 }
 
+void invalidate_iommu_all(struct amd_iommu *iommu)
+{
+    u32 cmd[4], entry;
+
+    cmd[3] = cmd[2] = cmd[0] = 0;
+
+    set_field_in_reg_u32(IOMMU_CMD_INVALIDATE_IOMMU_ALL, 0,
+                         IOMMU_CMD_OPCODE_MASK, IOMMU_CMD_OPCODE_SHIFT,
+                         &entry);
+    cmd[1] = entry;
+
+    send_iommu_command(iommu, cmd);
+}
+
 void amd_iommu_flush_iotlb(struct pci_dev *pdev,
                            uint64_t gaddr, unsigned int order)
 {
@@ -380,3 +394,11 @@
     invalidate_interrupt_table(iommu, bdf);
     flush_command_buffer(iommu);
 }
+
+void amd_iommu_flush_all_caches(struct amd_iommu *iommu)
+{
+    ASSERT( spin_is_locked(&iommu->lock) );
+
+    invalidate_iommu_all(iommu);
+    flush_command_buffer(iommu);
+}
diff -r 9a5e973305a8 -r 2bc6c29b14a7 xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c	Tue Nov 22 13:26:46 2011 +0000
+++ b/xen/drivers/passthrough/amd/iommu_init.c	Tue Nov 22 13:27:19 2011 +0000
@@ -598,6 +598,9 @@
     set_iommu_event_log_control(iommu, IOMMU_CONTROL_ENABLED);
     set_iommu_translation_control(iommu, IOMMU_CONTROL_ENABLED);
 
+    if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_IASUP_SHIFT) )
+        amd_iommu_flush_all_caches(iommu);
+
     iommu->enabled = 1;
     spin_unlock_irqrestore(&iommu->lock, flags);
 
@@ -970,6 +973,9 @@
     }
 
     /* flush all cache entries after iommu re-enabled */
-    invalidate_all_devices();
-    invalidate_all_domain_pages();
+    if ( !iommu_has_feature(iommu, IOMMU_EXT_FEATURE_IASUP_SHIFT) )
+    {
+        invalidate_all_devices();
+        invalidate_all_domain_pages();
+    }
 }
diff -r 9a5e973305a8 -r 2bc6c29b14a7 xen/include/asm-x86/hvm/svm/amd-iommu-defs.h
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h	Tue Nov 22 13:26:46 2011 +0000
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h	Tue Nov 22 13:27:19 2011 +0000
@@ -192,6 +192,7 @@
 #define IOMMU_CMD_INVALIDATE_IOMMU_PAGES	0x3
 #define IOMMU_CMD_INVALIDATE_IOTLB_PAGES	0x4
 #define IOMMU_CMD_INVALIDATE_INT_TABLE		0x5
+#define IOMMU_CMD_INVALIDATE_IOMMU_ALL      0x8
 
 /* COMPLETION_WAIT command */
 #define IOMMU_COMP_WAIT_DATA_BUFFER_SIZE	8
diff -r 9a5e973305a8 -r 2bc6c29b14a7 xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h	Tue Nov 22 13:26:46 2011 +0000
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h	Tue Nov 22 13:27:19 2011 +0000
@@ -78,6 +78,7 @@
                            unsigned int order);
 void amd_iommu_flush_device(struct amd_iommu *iommu, uint16_t bdf);
 void amd_iommu_flush_intremap(struct amd_iommu *iommu, uint16_t bdf);
+void amd_iommu_flush_all_caches(struct amd_iommu *iommu);
 
 /* find iommu for bdf */
 struct amd_iommu *find_iommu_for_device(int seg, int bdf);

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:28 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhU-0008Qc-3Y; Mon, 28 Nov 2011 23:33: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 1RVAhS-0008MJ-5i
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:26 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-27.messagelabs.com!1322523052!46196787!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10860 invoked from network); 28 Nov 2011 23:30:53 -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;
	28 Nov 2011 23:30:53 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnL-0001j6-Kx
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhK-0000pS-HJ
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:18 +0000
Message-Id: <E1RVAhK-0000pS-HJ@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hvmloader: Intel GPU passthrough,
	reverse OpRegion
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jean Guyader <jean.guyader@eu.citrix.com>
# Date 1322149439 0
# Node ID 3c864e04c2ad060ca1cac6579994777993fef6e6
# Parent  f71ff2f7b604ff299c418854677880cac9d31f4f
hvmloader: Intel GPU passthrough, reverse OpRegion

The Intel GPU uses a two pages NVS region called OpRegion.
In order to get full support for the driver in the guest
we need to map this region.

This patch reserves 2 pages on the top of the memory in the
reserved area and mark this region as NVS in the e820. Then
we write the address to the config space (offset 0xfc) so the
device model can map the OpRegion at this address in the guest.

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r f71ff2f7b604 -r 3c864e04c2ad tools/firmware/hvmloader/config.h
--- a/tools/firmware/hvmloader/config.h	Thu Nov 24 15:20:57 2011 +0000
+++ b/tools/firmware/hvmloader/config.h	Thu Nov 24 15:43:59 2011 +0000
@@ -5,6 +5,7 @@
 
 enum virtual_vga { VGA_none, VGA_std, VGA_cirrus, VGA_pt };
 extern enum virtual_vga virtual_vga;
+extern unsigned long igd_opregion_pgbase;
 
 struct bios_config {
     const char *name;
diff -r f71ff2f7b604 -r 3c864e04c2ad tools/firmware/hvmloader/e820.c
--- a/tools/firmware/hvmloader/e820.c	Thu Nov 24 15:20:57 2011 +0000
+++ b/tools/firmware/hvmloader/e820.c	Thu Nov 24 15:43:59 2011 +0000
@@ -128,11 +128,37 @@
      * Explicitly reserve space for special pages.
      * This space starts at RESERVED_MEMBASE an extends to cover various
      * fixed hardware mappings (e.g., LAPIC, IOAPIC, default SVGA framebuffer).
+     *
+     * If igd_opregion_pgbase we need to split the RESERVED region in two.
      */
-    e820[nr].addr = RESERVED_MEMBASE;
-    e820[nr].size = (uint32_t)-e820[nr].addr;
-    e820[nr].type = E820_RESERVED;
-    nr++;
+
+    if ( igd_opregion_pgbase )
+    {
+        uint32_t igd_opregion_base = igd_opregion_pgbase << PAGE_SHIFT;
+
+        e820[nr].addr = RESERVED_MEMBASE;
+        e820[nr].size = (uint32_t) igd_opregion_base - RESERVED_MEMBASE;
+        e820[nr].type = E820_RESERVED;
+        nr++;
+
+        e820[nr].addr = igd_opregion_base;
+        e820[nr].size = 2 * PAGE_SIZE;
+        e820[nr].type = E820_NVS;
+        nr++;
+
+        e820[nr].addr = igd_opregion_base + 2 * PAGE_SIZE;
+        e820[nr].size = (uint32_t)-e820[nr].addr;
+        e820[nr].type = E820_RESERVED;
+        nr++;
+    }
+    else
+    {
+        e820[nr].addr = RESERVED_MEMBASE;
+        e820[nr].size = (uint32_t)-e820[nr].addr;
+        e820[nr].type = E820_RESERVED;
+        nr++;
+    }
+
 
     if ( hvm_info->high_mem_pgend )
     {
diff -r f71ff2f7b604 -r 3c864e04c2ad tools/firmware/hvmloader/pci.c
--- a/tools/firmware/hvmloader/pci.c	Thu Nov 24 15:20:57 2011 +0000
+++ b/tools/firmware/hvmloader/pci.c	Thu Nov 24 15:43:59 2011 +0000
@@ -32,6 +32,7 @@
 unsigned long pci_mem_end = PCI_MEM_END;
 
 enum virtual_vga virtual_vga = VGA_none;
+unsigned long igd_opregion_pgbase = 0;
 
 void pci_setup(void)
 {
@@ -95,6 +96,17 @@
             {
                 vga_devfn = devfn;
                 virtual_vga = VGA_pt;
+                if ( vendor_id == 0x8086 )
+                {
+                    igd_opregion_pgbase = mem_hole_alloc(2);
+                    /*
+                     * Write the the OpRegion offset to give the opregion
+                     * address to the device model. The device model will trap 
+                     * and map the OpRegion at the give address.
+                     */
+                    pci_writel(vga_devfn, PCI_INTEL_OPREGION,
+                               igd_opregion_pgbase << PAGE_SHIFT);
+                }
             }
             break;
         case 0x0680:
diff -r f71ff2f7b604 -r 3c864e04c2ad tools/firmware/hvmloader/pci_regs.h
--- a/tools/firmware/hvmloader/pci_regs.h	Thu Nov 24 15:20:57 2011 +0000
+++ b/tools/firmware/hvmloader/pci_regs.h	Thu Nov 24 15:43:59 2011 +0000
@@ -105,6 +105,8 @@
 #define PCI_MIN_GNT  0x3e /* 8 bits */
 #define PCI_MAX_LAT  0x3f /* 8 bits */
 
+#define PCI_INTEL_OPREGION 0xfc /* 4 bits */
+
 #endif /* __HVMLOADER_PCI_REGS_H__ */
 
 /*

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:28 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhT-0008QK-TW; Mon, 28 Nov 2011 23:33:27 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhS-0008Jb-0N
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:26 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-182.messagelabs.com!1322523168!5037869!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11550 invoked from network); 28 Nov 2011 23:32:49 -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;
	28 Nov 2011 23:32:49 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnG-0001ic-IK
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhF-0000n2-Gy
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:13 +0000
Message-Id: <E1RVAhF-0000n2-Gy@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenstore: xenbus cannot be opened
	read-only
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Daniel De Graaf <dgdegra@tycho.nsa.gov>
# Date 1321981652 0
# Node ID 8edcd2e3f3f1751d3e85b7612d1fa72c8d071047
# Parent  b21b6c91c1f4f44523c0d401100a8cd9498fa514
xenstore: xenbus cannot be opened read-only

In order to read keys from xenstore, the xenstore libraries need to
write the request to the xenbus socket. This means that the socket
cannot be opened read-only.

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


diff -r b21b6c91c1f4 -r 8edcd2e3f3f1 tools/xenstore/xs.c
--- a/tools/xenstore/xs.c	Tue Nov 22 16:19:48 2011 +0000
+++ b/tools/xenstore/xs.c	Tue Nov 22 17:07:32 2011 +0000
@@ -182,15 +182,13 @@
 	return -1;
 }
 
-static int get_dev(const char *connect_to, unsigned long flags)
+static int get_dev(const char *connect_to)
 {
-	if (flags & XS_OPEN_READONLY)
-		return open(connect_to, O_RDONLY);
-	else
-		return open(connect_to, O_RDWR);
+	/* We cannot open read-only because requests are writes */
+	return open(connect_to, O_RDWR);
 }
 
-static struct xs_handle *get_handle(const char *connect_to, unsigned long flags)
+static struct xs_handle *get_handle(const char *connect_to)
 {
 	struct stat buf;
 	struct xs_handle *h = NULL;
@@ -202,7 +200,7 @@
 	if (S_ISSOCK(buf.st_mode))
 		fd = get_socket(connect_to);
 	else
-		fd = get_dev(connect_to, flags);
+		fd = get_dev(connect_to);
 
 	if (fd == -1)
 		return NULL;
@@ -258,12 +256,12 @@
 	struct xs_handle *xsh = NULL;
 
 	if (flags & XS_OPEN_READONLY)
-		xsh = get_handle(xs_daemon_socket_ro(), flags);
+		xsh = get_handle(xs_daemon_socket_ro());
 	else
-		xsh = get_handle(xs_daemon_socket(), flags);
+		xsh = get_handle(xs_daemon_socket());
 
 	if (!xsh && !(flags & XS_OPEN_SOCKETONLY))
-		xsh = get_handle(xs_domain_dev(), flags);
+		xsh = get_handle(xs_domain_dev());
 
 	return xsh;
 }

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:28 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhT-0008Q3-Ni; Mon, 28 Nov 2011 23:33:27 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhR-0008Ja-TP
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:26 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-174.messagelabs.com!1322523167!3409948!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27683 invoked from network); 28 Nov 2011 23:32:49 -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;
	28 Nov 2011 23:32:49 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnD-0001iH-12
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhC-0000kb-0U
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:10 +0000
Message-Id: <E1RVAhC-0000kb-0U@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] amd iommu: Support
	INVALIDATE_IOMMU_ALL command.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1321968439 0
# Node ID 2bc6c29b14a791e63e396f830e79adf790668d24
# Parent  9a5e973305a84e868c6740626b76008c5476bfe9
amd iommu: Support INVALIDATE_IOMMU_ALL command.

It is one of the new architectural commands supported by iommu v2.
It instructs iommu to clear all address translation and interrupt
remapping caches for all devices and all domains.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 9a5e973305a8 -r 2bc6c29b14a7 xen/drivers/passthrough/amd/iommu_cmd.c
--- a/xen/drivers/passthrough/amd/iommu_cmd.c	Tue Nov 22 13:26:46 2011 +0000
+++ b/xen/drivers/passthrough/amd/iommu_cmd.c	Tue Nov 22 13:27:19 2011 +0000
@@ -277,6 +277,20 @@
     send_iommu_command(iommu, cmd);
 }
 
+void invalidate_iommu_all(struct amd_iommu *iommu)
+{
+    u32 cmd[4], entry;
+
+    cmd[3] = cmd[2] = cmd[0] = 0;
+
+    set_field_in_reg_u32(IOMMU_CMD_INVALIDATE_IOMMU_ALL, 0,
+                         IOMMU_CMD_OPCODE_MASK, IOMMU_CMD_OPCODE_SHIFT,
+                         &entry);
+    cmd[1] = entry;
+
+    send_iommu_command(iommu, cmd);
+}
+
 void amd_iommu_flush_iotlb(struct pci_dev *pdev,
                            uint64_t gaddr, unsigned int order)
 {
@@ -380,3 +394,11 @@
     invalidate_interrupt_table(iommu, bdf);
     flush_command_buffer(iommu);
 }
+
+void amd_iommu_flush_all_caches(struct amd_iommu *iommu)
+{
+    ASSERT( spin_is_locked(&iommu->lock) );
+
+    invalidate_iommu_all(iommu);
+    flush_command_buffer(iommu);
+}
diff -r 9a5e973305a8 -r 2bc6c29b14a7 xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c	Tue Nov 22 13:26:46 2011 +0000
+++ b/xen/drivers/passthrough/amd/iommu_init.c	Tue Nov 22 13:27:19 2011 +0000
@@ -598,6 +598,9 @@
     set_iommu_event_log_control(iommu, IOMMU_CONTROL_ENABLED);
     set_iommu_translation_control(iommu, IOMMU_CONTROL_ENABLED);
 
+    if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_IASUP_SHIFT) )
+        amd_iommu_flush_all_caches(iommu);
+
     iommu->enabled = 1;
     spin_unlock_irqrestore(&iommu->lock, flags);
 
@@ -970,6 +973,9 @@
     }
 
     /* flush all cache entries after iommu re-enabled */
-    invalidate_all_devices();
-    invalidate_all_domain_pages();
+    if ( !iommu_has_feature(iommu, IOMMU_EXT_FEATURE_IASUP_SHIFT) )
+    {
+        invalidate_all_devices();
+        invalidate_all_domain_pages();
+    }
 }
diff -r 9a5e973305a8 -r 2bc6c29b14a7 xen/include/asm-x86/hvm/svm/amd-iommu-defs.h
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h	Tue Nov 22 13:26:46 2011 +0000
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h	Tue Nov 22 13:27:19 2011 +0000
@@ -192,6 +192,7 @@
 #define IOMMU_CMD_INVALIDATE_IOMMU_PAGES	0x3
 #define IOMMU_CMD_INVALIDATE_IOTLB_PAGES	0x4
 #define IOMMU_CMD_INVALIDATE_INT_TABLE		0x5
+#define IOMMU_CMD_INVALIDATE_IOMMU_ALL      0x8
 
 /* COMPLETION_WAIT command */
 #define IOMMU_COMP_WAIT_DATA_BUFFER_SIZE	8
diff -r 9a5e973305a8 -r 2bc6c29b14a7 xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h	Tue Nov 22 13:26:46 2011 +0000
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h	Tue Nov 22 13:27:19 2011 +0000
@@ -78,6 +78,7 @@
                            unsigned int order);
 void amd_iommu_flush_device(struct amd_iommu *iommu, uint16_t bdf);
 void amd_iommu_flush_intremap(struct amd_iommu *iommu, uint16_t bdf);
+void amd_iommu_flush_all_caches(struct amd_iommu *iommu);
 
 /* find iommu for bdf */
 struct amd_iommu *find_iommu_for_device(int seg, int bdf);

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:28 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhU-0008Qc-3Y; Mon, 28 Nov 2011 23:33: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 1RVAhS-0008MJ-5i
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:26 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-27.messagelabs.com!1322523052!46196787!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10860 invoked from network); 28 Nov 2011 23:30:53 -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;
	28 Nov 2011 23:30:53 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnL-0001j6-Kx
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhK-0000pS-HJ
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:18 +0000
Message-Id: <E1RVAhK-0000pS-HJ@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hvmloader: Intel GPU passthrough,
	reverse OpRegion
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jean Guyader <jean.guyader@eu.citrix.com>
# Date 1322149439 0
# Node ID 3c864e04c2ad060ca1cac6579994777993fef6e6
# Parent  f71ff2f7b604ff299c418854677880cac9d31f4f
hvmloader: Intel GPU passthrough, reverse OpRegion

The Intel GPU uses a two pages NVS region called OpRegion.
In order to get full support for the driver in the guest
we need to map this region.

This patch reserves 2 pages on the top of the memory in the
reserved area and mark this region as NVS in the e820. Then
we write the address to the config space (offset 0xfc) so the
device model can map the OpRegion at this address in the guest.

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r f71ff2f7b604 -r 3c864e04c2ad tools/firmware/hvmloader/config.h
--- a/tools/firmware/hvmloader/config.h	Thu Nov 24 15:20:57 2011 +0000
+++ b/tools/firmware/hvmloader/config.h	Thu Nov 24 15:43:59 2011 +0000
@@ -5,6 +5,7 @@
 
 enum virtual_vga { VGA_none, VGA_std, VGA_cirrus, VGA_pt };
 extern enum virtual_vga virtual_vga;
+extern unsigned long igd_opregion_pgbase;
 
 struct bios_config {
     const char *name;
diff -r f71ff2f7b604 -r 3c864e04c2ad tools/firmware/hvmloader/e820.c
--- a/tools/firmware/hvmloader/e820.c	Thu Nov 24 15:20:57 2011 +0000
+++ b/tools/firmware/hvmloader/e820.c	Thu Nov 24 15:43:59 2011 +0000
@@ -128,11 +128,37 @@
      * Explicitly reserve space for special pages.
      * This space starts at RESERVED_MEMBASE an extends to cover various
      * fixed hardware mappings (e.g., LAPIC, IOAPIC, default SVGA framebuffer).
+     *
+     * If igd_opregion_pgbase we need to split the RESERVED region in two.
      */
-    e820[nr].addr = RESERVED_MEMBASE;
-    e820[nr].size = (uint32_t)-e820[nr].addr;
-    e820[nr].type = E820_RESERVED;
-    nr++;
+
+    if ( igd_opregion_pgbase )
+    {
+        uint32_t igd_opregion_base = igd_opregion_pgbase << PAGE_SHIFT;
+
+        e820[nr].addr = RESERVED_MEMBASE;
+        e820[nr].size = (uint32_t) igd_opregion_base - RESERVED_MEMBASE;
+        e820[nr].type = E820_RESERVED;
+        nr++;
+
+        e820[nr].addr = igd_opregion_base;
+        e820[nr].size = 2 * PAGE_SIZE;
+        e820[nr].type = E820_NVS;
+        nr++;
+
+        e820[nr].addr = igd_opregion_base + 2 * PAGE_SIZE;
+        e820[nr].size = (uint32_t)-e820[nr].addr;
+        e820[nr].type = E820_RESERVED;
+        nr++;
+    }
+    else
+    {
+        e820[nr].addr = RESERVED_MEMBASE;
+        e820[nr].size = (uint32_t)-e820[nr].addr;
+        e820[nr].type = E820_RESERVED;
+        nr++;
+    }
+
 
     if ( hvm_info->high_mem_pgend )
     {
diff -r f71ff2f7b604 -r 3c864e04c2ad tools/firmware/hvmloader/pci.c
--- a/tools/firmware/hvmloader/pci.c	Thu Nov 24 15:20:57 2011 +0000
+++ b/tools/firmware/hvmloader/pci.c	Thu Nov 24 15:43:59 2011 +0000
@@ -32,6 +32,7 @@
 unsigned long pci_mem_end = PCI_MEM_END;
 
 enum virtual_vga virtual_vga = VGA_none;
+unsigned long igd_opregion_pgbase = 0;
 
 void pci_setup(void)
 {
@@ -95,6 +96,17 @@
             {
                 vga_devfn = devfn;
                 virtual_vga = VGA_pt;
+                if ( vendor_id == 0x8086 )
+                {
+                    igd_opregion_pgbase = mem_hole_alloc(2);
+                    /*
+                     * Write the the OpRegion offset to give the opregion
+                     * address to the device model. The device model will trap 
+                     * and map the OpRegion at the give address.
+                     */
+                    pci_writel(vga_devfn, PCI_INTEL_OPREGION,
+                               igd_opregion_pgbase << PAGE_SHIFT);
+                }
             }
             break;
         case 0x0680:
diff -r f71ff2f7b604 -r 3c864e04c2ad tools/firmware/hvmloader/pci_regs.h
--- a/tools/firmware/hvmloader/pci_regs.h	Thu Nov 24 15:20:57 2011 +0000
+++ b/tools/firmware/hvmloader/pci_regs.h	Thu Nov 24 15:43:59 2011 +0000
@@ -105,6 +105,8 @@
 #define PCI_MIN_GNT  0x3e /* 8 bits */
 #define PCI_MAX_LAT  0x3f /* 8 bits */
 
+#define PCI_INTEL_OPREGION 0xfc /* 4 bits */
+
 #endif /* __HVMLOADER_PCI_REGS_H__ */
 
 /*

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:28 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhT-0008QK-TW; Mon, 28 Nov 2011 23:33:27 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhS-0008Jb-0N
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:26 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-182.messagelabs.com!1322523168!5037869!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11550 invoked from network); 28 Nov 2011 23:32:49 -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;
	28 Nov 2011 23:32:49 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnG-0001ic-IK
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhF-0000n2-Gy
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:13 +0000
Message-Id: <E1RVAhF-0000n2-Gy@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenstore: xenbus cannot be opened
	read-only
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Daniel De Graaf <dgdegra@tycho.nsa.gov>
# Date 1321981652 0
# Node ID 8edcd2e3f3f1751d3e85b7612d1fa72c8d071047
# Parent  b21b6c91c1f4f44523c0d401100a8cd9498fa514
xenstore: xenbus cannot be opened read-only

In order to read keys from xenstore, the xenstore libraries need to
write the request to the xenbus socket. This means that the socket
cannot be opened read-only.

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


diff -r b21b6c91c1f4 -r 8edcd2e3f3f1 tools/xenstore/xs.c
--- a/tools/xenstore/xs.c	Tue Nov 22 16:19:48 2011 +0000
+++ b/tools/xenstore/xs.c	Tue Nov 22 17:07:32 2011 +0000
@@ -182,15 +182,13 @@
 	return -1;
 }
 
-static int get_dev(const char *connect_to, unsigned long flags)
+static int get_dev(const char *connect_to)
 {
-	if (flags & XS_OPEN_READONLY)
-		return open(connect_to, O_RDONLY);
-	else
-		return open(connect_to, O_RDWR);
+	/* We cannot open read-only because requests are writes */
+	return open(connect_to, O_RDWR);
 }
 
-static struct xs_handle *get_handle(const char *connect_to, unsigned long flags)
+static struct xs_handle *get_handle(const char *connect_to)
 {
 	struct stat buf;
 	struct xs_handle *h = NULL;
@@ -202,7 +200,7 @@
 	if (S_ISSOCK(buf.st_mode))
 		fd = get_socket(connect_to);
 	else
-		fd = get_dev(connect_to, flags);
+		fd = get_dev(connect_to);
 
 	if (fd == -1)
 		return NULL;
@@ -258,12 +256,12 @@
 	struct xs_handle *xsh = NULL;
 
 	if (flags & XS_OPEN_READONLY)
-		xsh = get_handle(xs_daemon_socket_ro(), flags);
+		xsh = get_handle(xs_daemon_socket_ro());
 	else
-		xsh = get_handle(xs_daemon_socket(), flags);
+		xsh = get_handle(xs_daemon_socket());
 
 	if (!xsh && !(flags & XS_OPEN_SOCKETONLY))
-		xsh = get_handle(xs_domain_dev(), flags);
+		xsh = get_handle(xs_domain_dev());
 
 	return xsh;
 }

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:28 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhR-0008Mf-U1; Mon, 28 Nov 2011 23:33:25 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhQ-0008JF-4V
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1322523165!4976562!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20529 invoked from network); 28 Nov 2011 23:32:46 -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;
	28 Nov 2011 23:32:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnE-0001iN-4V
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhD-0000lo-0T
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:11 +0000
Message-Id: <E1RVAhD-0000lo-0T@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xsm/flask: fix resource list range
	checks
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Daniel De Graaf <dgdegra@tycho.nsa.gov>
# Date 1321968588 0
# Node ID d3859e348951cde6b211c5afb610ac1f12a909ec
# Parent  0db9c1fc8213013f48110cb19641a286140c0563
xsm/flask: fix resource list range checks

The FLASK security checks for resource ranges were not implemented
correctly - only the permissions on the endpoints of a range were
checked, instead of all items contained in the range. This would allow
certain resources (I/O ports, I/O memory) to be used by domains in
contravention to security policy.

This also corrects a bug where adding overlapping resource ranges did
not trigger an error.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 0db9c1fc8213 -r d3859e348951 xen/xsm/flask/hooks.c
--- a/xen/xsm/flask/hooks.c	Tue Nov 22 13:29:01 2011 +0000
+++ b/xen/xsm/flask/hooks.c	Tue Nov 22 13:29:48 2011 +0000
@@ -664,14 +664,32 @@
         return rc;
 }
 
-static int iomem_has_perm(struct domain *d, unsigned long mfn, uint8_t access)
+struct iomem_has_perm_data {
+    struct domain_security_struct *ssec, *tsec;
+    u32 perm;
+};
+
+static int _iomem_has_perm(void *v, u32 sid, unsigned long start, unsigned long end)
 {
-    u32 perm;
-    u32 rsid;
+    struct iomem_has_perm_data *data = v;
+    struct avc_audit_data ad;
     int rc = -EPERM;
 
-    struct domain_security_struct *ssec, *tsec;
-    struct avc_audit_data ad;
+    AVC_AUDIT_DATA_INIT(&ad, DEV);
+    ad.device = start;
+
+    rc = avc_has_perm(data->ssec->sid, sid, SECCLASS_RESOURCE, data->perm, &ad);
+
+    if ( rc )
+        return rc;
+
+    return avc_has_perm(data->tsec->sid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
+}
+
+static int iomem_has_perm(struct domain *d, unsigned long start, unsigned long end, uint8_t access)
+{
+    struct iomem_has_perm_data data;
+    int rc;
 
     rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE,
                          resource_to_perm(access));
@@ -679,27 +697,14 @@
         return rc;
 
     if ( access )
-        perm = RESOURCE__ADD_IOMEM;
+        data.perm = RESOURCE__ADD_IOMEM;
     else
-        perm = RESOURCE__REMOVE_IOMEM;
+        data.perm = RESOURCE__REMOVE_IOMEM;
 
-    ssec = current->domain->ssid;
-    tsec = d->ssid;
+    data.ssec = current->domain->ssid;
+    data.tsec = d->ssid;
 
-    rc = security_iomem_sid(mfn, &rsid);
-    if ( rc )
-        return rc;
-
-    AVC_AUDIT_DATA_INIT(&ad, DEV);
-    ad.device = mfn;
-
-    rc = avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, perm, &ad);
-
-    if ( rc )
-        return rc;
-
-    return avc_has_perm(tsec->sid, rsid, SECCLASS_RESOURCE, 
-                        RESOURCE__USE, &ad);
+    return security_iterate_iomem_sids(start, end, _iomem_has_perm, &data);
 }
 
 static int flask_perfcontrol(void)
@@ -736,14 +741,33 @@
     return domain_has_perm(current->domain, d, SECCLASS_SHADOW, perm);
 }
 
-static int ioport_has_perm(struct domain *d, uint32_t ioport, uint8_t access)
+struct ioport_has_perm_data {
+    struct domain_security_struct *ssec, *tsec;
+    u32 perm;
+};
+
+static int _ioport_has_perm(void *v, u32 sid, unsigned long start, unsigned long end)
 {
-    u32 perm;
-    u32 rsid;
-    int rc = -EPERM;
+    struct ioport_has_perm_data *data = v;
+    struct avc_audit_data ad;
+    int rc;
 
-    struct avc_audit_data ad;
-    struct domain_security_struct *ssec, *tsec;
+    AVC_AUDIT_DATA_INIT(&ad, DEV);
+    ad.device = start;
+
+    rc = avc_has_perm(data->ssec->sid, sid, SECCLASS_RESOURCE, data->perm, &ad);
+
+    if ( rc )
+        return rc;
+
+    return avc_has_perm(data->tsec->sid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
+}
+
+
+static int ioport_has_perm(struct domain *d, uint32_t start, uint32_t end, uint8_t access)
+{
+    int rc;
+    struct ioport_has_perm_data data;
 
     rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE,
                          resource_to_perm(access));
@@ -752,29 +776,14 @@
         return rc;
 
     if ( access )
-        perm = RESOURCE__ADD_IOPORT;
+        data.perm = RESOURCE__ADD_IOPORT;
     else
-        perm = RESOURCE__REMOVE_IOPORT;
+        data.perm = RESOURCE__REMOVE_IOPORT;
 
-    ssec = current->domain->ssid;
-    tsec = d->ssid;
+    data.ssec = current->domain->ssid;
+    data.tsec = d->ssid;
 
-    rc = security_ioport_sid(ioport, &rsid);
-    if ( rc )
-        return rc;
-
-    AVC_AUDIT_DATA_INIT(&ad, DEV);
-    ad.device = ioport;
-
-    rc = avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, perm, &ad);
-    if ( rc )
-        return rc;
-
-    if ( access )
-        return avc_has_perm(tsec->sid, rsid, SECCLASS_RESOURCE, 
-                            RESOURCE__USE, &ad);
-    else
-        return rc;
+    return security_iterate_ioport_sids(start, end, _ioport_has_perm, &data);
 }
 
 static int flask_getpageframeinfo(struct page_info *page)
@@ -1184,31 +1193,25 @@
 
     if ( strcmp(name, "I/O Memory") == 0 )
     {
-        rc = iomem_has_perm(d, s, access);
+        rc = iomem_has_perm(d, s, e, access);
         if ( rc )
             return rc;
-
-        if ( s != e )
-            rc = iomem_has_perm(d, e, access);
     }
     else if ( strcmp(name, "Interrupts") == 0 )
     {
-        rc = irq_has_perm(d, s, access);
-        if ( rc )
-            return rc;
-
-        if ( s != e )
-            rc = irq_has_perm(d, e, access);
+        while (s <= e) {
+            rc = irq_has_perm(d, s, access);
+            if ( rc )
+                return rc;
+            s++;
+        }
     }
 #ifdef CONFIG_X86
     else if ( strcmp(name, "I/O Ports") == 0 )
     {
-        rc = ioport_has_perm(d, s, access);
+        rc = ioport_has_perm(d, s, e, access);
         if ( rc )
             return rc;
-
-        if ( s != e )
-            rc = ioport_has_perm(d, e, access);
     }
 #endif
 
diff -r 0db9c1fc8213 -r d3859e348951 xen/xsm/flask/include/security.h
--- a/xen/xsm/flask/include/security.h	Tue Nov 22 13:29:01 2011 +0000
+++ b/xen/xsm/flask/include/security.h	Tue Nov 22 13:29:48 2011 +0000
@@ -82,6 +82,14 @@
 int security_validate_transition(u32 oldsid, u32 newsid, u32 tasksid,
                                                                     u16 tclass);
 
+typedef int (*security_iterate_fn)(void *data, u32 sid, unsigned long start,
+                                                        unsigned long end);
+int security_iterate_iomem_sids(unsigned long start, unsigned long end,
+                                security_iterate_fn fn, void *data);
+
+int security_iterate_ioport_sids(u32 start, u32 end,
+                                security_iterate_fn fn, void *data);
+
 int security_ocontext_add(char *ocontext, unsigned long low,
                            unsigned long high, u32 sid);
 
diff -r 0db9c1fc8213 -r d3859e348951 xen/xsm/flask/ss/services.c
--- a/xen/xsm/flask/ss/services.c	Tue Nov 22 13:29:01 2011 +0000
+++ b/xen/xsm/flask/ss/services.c	Tue Nov 22 13:29:48 2011 +0000
@@ -1594,6 +1594,53 @@
     return rc;
 }
 
+int security_iterate_iomem_sids(unsigned long start, unsigned long end,
+                                security_iterate_fn fn, void *data)
+{
+    struct ocontext *c;
+    int rc = 0;
+
+    POLICY_RDLOCK;
+
+    c = policydb.ocontexts[OCON_IOMEM];
+    while (c && c->u.iomem.high_iomem < start)
+        c = c->next;
+
+    while (c && c->u.iomem.low_iomem <= end) {
+        if (!c->sid[0])
+        {
+            rc = sidtab_context_to_sid(&sidtab, &c->context[0], &c->sid[0]);
+            if ( rc )
+                goto out;
+        }
+        if (start < c->u.iomem.low_iomem) {
+            /* found a gap */
+            rc = fn(data, SECINITSID_IOMEM, start, c->u.iomem.low_iomem - 1);
+            if (rc)
+                goto out;
+            start = c->u.iomem.low_iomem;
+        }
+        if (end <= c->u.iomem.high_iomem) {
+            /* iteration ends in the middle of this range */
+            rc = fn(data, c->sid[0], start, end);
+            goto out;
+        }
+
+        rc = fn(data, c->sid[0], start, c->u.iomem.high_iomem);
+        if (rc)
+            goto out;
+        start = c->u.iomem.high_iomem + 1;
+
+        c = c->next;
+    }
+
+    rc = fn(data, SECINITSID_IOMEM, start, end);
+
+out:
+    POLICY_RDUNLOCK;
+    return rc;
+}
+
 /**
  * security_ioport_sid - Obtain the SID for an ioport.
  * @ioport: ioport
@@ -1635,6 +1682,53 @@
     return rc;
 }
 
+int security_iterate_ioport_sids(u32 start, u32 end,
+                                security_iterate_fn fn, void *data)
+{
+    struct ocontext *c;
+    int rc = 0;
+
+    POLICY_RDLOCK;
+
+    c = policydb.ocontexts[OCON_IOPORT];
+    while (c && c->u.ioport.high_ioport < start)
+        c = c->next;
+
+    while (c && c->u.ioport.low_ioport <= end) {
+        if (!c->sid[0])
+        {
+            rc = sidtab_context_to_sid(&sidtab, &c->context[0], &c->sid[0]);
+            if ( rc )
+                goto out;
+        }
+        if (start < c->u.ioport.low_ioport) {
+            /* found a gap */
+            rc = fn(data, SECINITSID_IOPORT, start, c->u.ioport.low_ioport - 1);
+            if (rc)
+                goto out;
+            start = c->u.ioport.low_ioport;
+        }
+        if (end <= c->u.ioport.high_ioport) {
+            /* iteration ends in the middle of this range */
+            rc = fn(data, c->sid[0], start, end);
+            goto out;
+        }
+
+        rc = fn(data, c->sid[0], start, c->u.ioport.high_ioport);
+        if (rc)
+            goto out;
+        start = c->u.ioport.high_ioport + 1;
+
+        c = c->next;
+    }
+
+    rc = fn(data, SECINITSID_IOPORT, start, end);
+
+out:
+    POLICY_RDUNLOCK;
+    return rc;
+}
+
 /**
  * security_device_sid - Obtain the SID for a PCI device.
  * @ioport: device
@@ -1963,6 +2057,7 @@
     int ret = 0;
     int ocon = 0;
     struct ocontext *c;
+    struct ocontext *prev;
     struct ocontext *add;
 
     if ( (ocon = determine_ocontext(ocontext)) < 0 )
@@ -2006,23 +2101,27 @@
         add->u.ioport.low_ioport = low;
         add->u.ioport.high_ioport = high;
 
+        prev = NULL;
         c = policydb.ocontexts[OCON_IOPORT];
-        while ( c )
-        {
-            if ( c->u.ioport.low_ioport <= add->u.ioport.high_ioport &&
-                 add->u.ioport.low_ioport <= c->u.ioport.high_ioport )
-            {
-                printk("%s: IO Port overlap with entry 0x%x - 0x%x\n",
-                       __FUNCTION__, c->u.ioport.low_ioport,
-                       c->u.ioport.high_ioport);
-                ret = -EINVAL;
-                break;
-            }
+
+        while ( c && c->u.ioport.high_ioport < low ) {
+            prev = c;
             c = c->next;
         }
 
-        if ( ret == 0 )
+        if (c && c->u.ioport.low_ioport <= high)
         {
+            printk("%s: IO Port overlap with entry 0x%x - 0x%x\n",
+                   __FUNCTION__, c->u.ioport.low_ioport,
+                   c->u.ioport.high_ioport);
+            ret = -EINVAL;
+            break;
+        }
+
+        if (prev) {
+            add->next = prev->next;
+            prev->next = add;
+        } else {
             add->next = policydb.ocontexts[OCON_IOPORT];
             policydb.ocontexts[OCON_IOPORT] = add;
         }
@@ -2032,23 +2131,27 @@
         add->u.iomem.low_iomem = low;
         add->u.iomem.high_iomem = high;
 
+        prev = NULL;
         c = policydb.ocontexts[OCON_IOMEM];
-        while ( c )
-        {
-            if ( c->u.iomem.low_iomem <= add->u.iomem.high_iomem &&
-                 add->u.iomem.low_iomem <= c->u.iomem.high_iomem )
-            {
-                printk("%s: IO Memory overlap with entry 0x%x - 0x%x\n",
-                       __FUNCTION__, c->u.iomem.low_iomem,
-                       c->u.iomem.high_iomem);
-                ret = -EINVAL;
-                break;
-            }
+
+        while ( c && c->u.iomem.high_iomem < low ) {
+            prev = c;
             c = c->next;
         }
 
-        if ( ret == 0 )
+        if (c && c->u.iomem.low_iomem <= high)
         {
+            printk("%s: IO Memory overlap with entry 0x%x - 0x%x\n",
+                   __FUNCTION__, c->u.iomem.low_iomem,
+                   c->u.iomem.high_iomem);
+            ret = -EINVAL;
+            break;
+        }
+
+        if (prev) {
+            add->next = prev->next;
+            prev->next = add;
+        } else {
             add->next = policydb.ocontexts[OCON_IOMEM];
             policydb.ocontexts[OCON_IOMEM] = add;
         }

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:28 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhR-0008Mf-U1; Mon, 28 Nov 2011 23:33:25 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhQ-0008JF-4V
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1322523165!4976562!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20529 invoked from network); 28 Nov 2011 23:32:46 -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;
	28 Nov 2011 23:32:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnE-0001iN-4V
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhD-0000lo-0T
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:11 +0000
Message-Id: <E1RVAhD-0000lo-0T@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xsm/flask: fix resource list range
	checks
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Daniel De Graaf <dgdegra@tycho.nsa.gov>
# Date 1321968588 0
# Node ID d3859e348951cde6b211c5afb610ac1f12a909ec
# Parent  0db9c1fc8213013f48110cb19641a286140c0563
xsm/flask: fix resource list range checks

The FLASK security checks for resource ranges were not implemented
correctly - only the permissions on the endpoints of a range were
checked, instead of all items contained in the range. This would allow
certain resources (I/O ports, I/O memory) to be used by domains in
contravention to security policy.

This also corrects a bug where adding overlapping resource ranges did
not trigger an error.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 0db9c1fc8213 -r d3859e348951 xen/xsm/flask/hooks.c
--- a/xen/xsm/flask/hooks.c	Tue Nov 22 13:29:01 2011 +0000
+++ b/xen/xsm/flask/hooks.c	Tue Nov 22 13:29:48 2011 +0000
@@ -664,14 +664,32 @@
         return rc;
 }
 
-static int iomem_has_perm(struct domain *d, unsigned long mfn, uint8_t access)
+struct iomem_has_perm_data {
+    struct domain_security_struct *ssec, *tsec;
+    u32 perm;
+};
+
+static int _iomem_has_perm(void *v, u32 sid, unsigned long start, unsigned long end)
 {
-    u32 perm;
-    u32 rsid;
+    struct iomem_has_perm_data *data = v;
+    struct avc_audit_data ad;
     int rc = -EPERM;
 
-    struct domain_security_struct *ssec, *tsec;
-    struct avc_audit_data ad;
+    AVC_AUDIT_DATA_INIT(&ad, DEV);
+    ad.device = start;
+
+    rc = avc_has_perm(data->ssec->sid, sid, SECCLASS_RESOURCE, data->perm, &ad);
+
+    if ( rc )
+        return rc;
+
+    return avc_has_perm(data->tsec->sid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
+}
+
+static int iomem_has_perm(struct domain *d, unsigned long start, unsigned long end, uint8_t access)
+{
+    struct iomem_has_perm_data data;
+    int rc;
 
     rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE,
                          resource_to_perm(access));
@@ -679,27 +697,14 @@
         return rc;
 
     if ( access )
-        perm = RESOURCE__ADD_IOMEM;
+        data.perm = RESOURCE__ADD_IOMEM;
     else
-        perm = RESOURCE__REMOVE_IOMEM;
+        data.perm = RESOURCE__REMOVE_IOMEM;
 
-    ssec = current->domain->ssid;
-    tsec = d->ssid;
+    data.ssec = current->domain->ssid;
+    data.tsec = d->ssid;
 
-    rc = security_iomem_sid(mfn, &rsid);
-    if ( rc )
-        return rc;
-
-    AVC_AUDIT_DATA_INIT(&ad, DEV);
-    ad.device = mfn;
-
-    rc = avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, perm, &ad);
-
-    if ( rc )
-        return rc;
-
-    return avc_has_perm(tsec->sid, rsid, SECCLASS_RESOURCE, 
-                        RESOURCE__USE, &ad);
+    return security_iterate_iomem_sids(start, end, _iomem_has_perm, &data);
 }
 
 static int flask_perfcontrol(void)
@@ -736,14 +741,33 @@
     return domain_has_perm(current->domain, d, SECCLASS_SHADOW, perm);
 }
 
-static int ioport_has_perm(struct domain *d, uint32_t ioport, uint8_t access)
+struct ioport_has_perm_data {
+    struct domain_security_struct *ssec, *tsec;
+    u32 perm;
+};
+
+static int _ioport_has_perm(void *v, u32 sid, unsigned long start, unsigned long end)
 {
-    u32 perm;
-    u32 rsid;
-    int rc = -EPERM;
+    struct ioport_has_perm_data *data = v;
+    struct avc_audit_data ad;
+    int rc;
 
-    struct avc_audit_data ad;
-    struct domain_security_struct *ssec, *tsec;
+    AVC_AUDIT_DATA_INIT(&ad, DEV);
+    ad.device = start;
+
+    rc = avc_has_perm(data->ssec->sid, sid, SECCLASS_RESOURCE, data->perm, &ad);
+
+    if ( rc )
+        return rc;
+
+    return avc_has_perm(data->tsec->sid, sid, SECCLASS_RESOURCE, RESOURCE__USE, &ad);
+}
+
+
+static int ioport_has_perm(struct domain *d, uint32_t start, uint32_t end, uint8_t access)
+{
+    int rc;
+    struct ioport_has_perm_data data;
 
     rc = domain_has_perm(current->domain, d, SECCLASS_RESOURCE,
                          resource_to_perm(access));
@@ -752,29 +776,14 @@
         return rc;
 
     if ( access )
-        perm = RESOURCE__ADD_IOPORT;
+        data.perm = RESOURCE__ADD_IOPORT;
     else
-        perm = RESOURCE__REMOVE_IOPORT;
+        data.perm = RESOURCE__REMOVE_IOPORT;
 
-    ssec = current->domain->ssid;
-    tsec = d->ssid;
+    data.ssec = current->domain->ssid;
+    data.tsec = d->ssid;
 
-    rc = security_ioport_sid(ioport, &rsid);
-    if ( rc )
-        return rc;
-
-    AVC_AUDIT_DATA_INIT(&ad, DEV);
-    ad.device = ioport;
-
-    rc = avc_has_perm(ssec->sid, rsid, SECCLASS_RESOURCE, perm, &ad);
-    if ( rc )
-        return rc;
-
-    if ( access )
-        return avc_has_perm(tsec->sid, rsid, SECCLASS_RESOURCE, 
-                            RESOURCE__USE, &ad);
-    else
-        return rc;
+    return security_iterate_ioport_sids(start, end, _ioport_has_perm, &data);
 }
 
 static int flask_getpageframeinfo(struct page_info *page)
@@ -1184,31 +1193,25 @@
 
     if ( strcmp(name, "I/O Memory") == 0 )
     {
-        rc = iomem_has_perm(d, s, access);
+        rc = iomem_has_perm(d, s, e, access);
         if ( rc )
             return rc;
-
-        if ( s != e )
-            rc = iomem_has_perm(d, e, access);
     }
     else if ( strcmp(name, "Interrupts") == 0 )
     {
-        rc = irq_has_perm(d, s, access);
-        if ( rc )
-            return rc;
-
-        if ( s != e )
-            rc = irq_has_perm(d, e, access);
+        while (s <= e) {
+            rc = irq_has_perm(d, s, access);
+            if ( rc )
+                return rc;
+            s++;
+        }
     }
 #ifdef CONFIG_X86
     else if ( strcmp(name, "I/O Ports") == 0 )
     {
-        rc = ioport_has_perm(d, s, access);
+        rc = ioport_has_perm(d, s, e, access);
         if ( rc )
             return rc;
-
-        if ( s != e )
-            rc = ioport_has_perm(d, e, access);
     }
 #endif
 
diff -r 0db9c1fc8213 -r d3859e348951 xen/xsm/flask/include/security.h
--- a/xen/xsm/flask/include/security.h	Tue Nov 22 13:29:01 2011 +0000
+++ b/xen/xsm/flask/include/security.h	Tue Nov 22 13:29:48 2011 +0000
@@ -82,6 +82,14 @@
 int security_validate_transition(u32 oldsid, u32 newsid, u32 tasksid,
                                                                     u16 tclass);
 
+typedef int (*security_iterate_fn)(void *data, u32 sid, unsigned long start,
+                                                        unsigned long end);
+int security_iterate_iomem_sids(unsigned long start, unsigned long end,
+                                security_iterate_fn fn, void *data);
+
+int security_iterate_ioport_sids(u32 start, u32 end,
+                                security_iterate_fn fn, void *data);
+
 int security_ocontext_add(char *ocontext, unsigned long low,
                            unsigned long high, u32 sid);
 
diff -r 0db9c1fc8213 -r d3859e348951 xen/xsm/flask/ss/services.c
--- a/xen/xsm/flask/ss/services.c	Tue Nov 22 13:29:01 2011 +0000
+++ b/xen/xsm/flask/ss/services.c	Tue Nov 22 13:29:48 2011 +0000
@@ -1594,6 +1594,53 @@
     return rc;
 }
 
+int security_iterate_iomem_sids(unsigned long start, unsigned long end,
+                                security_iterate_fn fn, void *data)
+{
+    struct ocontext *c;
+    int rc = 0;
+
+    POLICY_RDLOCK;
+
+    c = policydb.ocontexts[OCON_IOMEM];
+    while (c && c->u.iomem.high_iomem < start)
+        c = c->next;
+
+    while (c && c->u.iomem.low_iomem <= end) {
+        if (!c->sid[0])
+        {
+            rc = sidtab_context_to_sid(&sidtab, &c->context[0], &c->sid[0]);
+            if ( rc )
+                goto out;
+        }
+        if (start < c->u.iomem.low_iomem) {
+            /* found a gap */
+            rc = fn(data, SECINITSID_IOMEM, start, c->u.iomem.low_iomem - 1);
+            if (rc)
+                goto out;
+            start = c->u.iomem.low_iomem;
+        }
+        if (end <= c->u.iomem.high_iomem) {
+            /* iteration ends in the middle of this range */
+            rc = fn(data, c->sid[0], start, end);
+            goto out;
+        }
+
+        rc = fn(data, c->sid[0], start, c->u.iomem.high_iomem);
+        if (rc)
+            goto out;
+        start = c->u.iomem.high_iomem + 1;
+
+        c = c->next;
+    }
+
+    rc = fn(data, SECINITSID_IOMEM, start, end);
+
+out:
+    POLICY_RDUNLOCK;
+    return rc;
+}
+
 /**
  * security_ioport_sid - Obtain the SID for an ioport.
  * @ioport: ioport
@@ -1635,6 +1682,53 @@
     return rc;
 }
 
+int security_iterate_ioport_sids(u32 start, u32 end,
+                                security_iterate_fn fn, void *data)
+{
+    struct ocontext *c;
+    int rc = 0;
+
+    POLICY_RDLOCK;
+
+    c = policydb.ocontexts[OCON_IOPORT];
+    while (c && c->u.ioport.high_ioport < start)
+        c = c->next;
+
+    while (c && c->u.ioport.low_ioport <= end) {
+        if (!c->sid[0])
+        {
+            rc = sidtab_context_to_sid(&sidtab, &c->context[0], &c->sid[0]);
+            if ( rc )
+                goto out;
+        }
+        if (start < c->u.ioport.low_ioport) {
+            /* found a gap */
+            rc = fn(data, SECINITSID_IOPORT, start, c->u.ioport.low_ioport - 1);
+            if (rc)
+                goto out;
+            start = c->u.ioport.low_ioport;
+        }
+        if (end <= c->u.ioport.high_ioport) {
+            /* iteration ends in the middle of this range */
+            rc = fn(data, c->sid[0], start, end);
+            goto out;
+        }
+
+        rc = fn(data, c->sid[0], start, c->u.ioport.high_ioport);
+        if (rc)
+            goto out;
+        start = c->u.ioport.high_ioport + 1;
+
+        c = c->next;
+    }
+
+    rc = fn(data, SECINITSID_IOPORT, start, end);
+
+out:
+    POLICY_RDUNLOCK;
+    return rc;
+}
+
 /**
  * security_device_sid - Obtain the SID for a PCI device.
  * @ioport: device
@@ -1963,6 +2057,7 @@
     int ret = 0;
     int ocon = 0;
     struct ocontext *c;
+    struct ocontext *prev;
     struct ocontext *add;
 
     if ( (ocon = determine_ocontext(ocontext)) < 0 )
@@ -2006,23 +2101,27 @@
         add->u.ioport.low_ioport = low;
         add->u.ioport.high_ioport = high;
 
+        prev = NULL;
         c = policydb.ocontexts[OCON_IOPORT];
-        while ( c )
-        {
-            if ( c->u.ioport.low_ioport <= add->u.ioport.high_ioport &&
-                 add->u.ioport.low_ioport <= c->u.ioport.high_ioport )
-            {
-                printk("%s: IO Port overlap with entry 0x%x - 0x%x\n",
-                       __FUNCTION__, c->u.ioport.low_ioport,
-                       c->u.ioport.high_ioport);
-                ret = -EINVAL;
-                break;
-            }
+
+        while ( c && c->u.ioport.high_ioport < low ) {
+            prev = c;
             c = c->next;
         }
 
-        if ( ret == 0 )
+        if (c && c->u.ioport.low_ioport <= high)
         {
+            printk("%s: IO Port overlap with entry 0x%x - 0x%x\n",
+                   __FUNCTION__, c->u.ioport.low_ioport,
+                   c->u.ioport.high_ioport);
+            ret = -EINVAL;
+            break;
+        }
+
+        if (prev) {
+            add->next = prev->next;
+            prev->next = add;
+        } else {
             add->next = policydb.ocontexts[OCON_IOPORT];
             policydb.ocontexts[OCON_IOPORT] = add;
         }
@@ -2032,23 +2131,27 @@
         add->u.iomem.low_iomem = low;
         add->u.iomem.high_iomem = high;
 
+        prev = NULL;
         c = policydb.ocontexts[OCON_IOMEM];
-        while ( c )
-        {
-            if ( c->u.iomem.low_iomem <= add->u.iomem.high_iomem &&
-                 add->u.iomem.low_iomem <= c->u.iomem.high_iomem )
-            {
-                printk("%s: IO Memory overlap with entry 0x%x - 0x%x\n",
-                       __FUNCTION__, c->u.iomem.low_iomem,
-                       c->u.iomem.high_iomem);
-                ret = -EINVAL;
-                break;
-            }
+
+        while ( c && c->u.iomem.high_iomem < low ) {
+            prev = c;
             c = c->next;
         }
 
-        if ( ret == 0 )
+        if (c && c->u.iomem.low_iomem <= high)
         {
+            printk("%s: IO Memory overlap with entry 0x%x - 0x%x\n",
+                   __FUNCTION__, c->u.iomem.low_iomem,
+                   c->u.iomem.high_iomem);
+            ret = -EINVAL;
+            break;
+        }
+
+        if (prev) {
+            add->next = prev->next;
+            prev->next = add;
+        } else {
             add->next = policydb.ocontexts[OCON_IOMEM];
             policydb.ocontexts[OCON_IOMEM] = add;
         }

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:29 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhU-0008RC-BC; Mon, 28 Nov 2011 23:33: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 1RVAhS-0008NP-Nj
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:26 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1322523144!50332090!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19912 invoked from network); 28 Nov 2011 23:32:25 -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;
	28 Nov 2011 23:32: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 1RVAnM-0001jC-Gs
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhL-0000pw-GJ
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:19 +0000
Message-Id: <E1RVAhL-0000pw-GJ@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Properly compare "pci" token when
	groking serial port config
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1322149519 0
# Node ID 8e05b21ee6448ce56e4e56201472e87074344fa6
# Parent  67d2ac426defedad9c10eb339019f9dc9f02d2ae
Properly compare "pci" token when groking serial port config

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 67d2ac426def -r 8e05b21ee644 xen/drivers/char/ns16550.c
--- a/xen/drivers/char/ns16550.c	Thu Nov 24 15:44:51 2011 +0000
+++ b/xen/drivers/char/ns16550.c	Thu Nov 24 15:45:19 2011 +0000
@@ -554,7 +554,7 @@
     if ( *conf == ',' )
     {
         conf++;
-        if ( strncmp(conf, "pci", 5) == 0 )
+        if ( strncmp(conf, "pci", 3) == 0 )
         {
             if ( pci_uart_config(uart, 1/* skip AMT */, uart - ns16550_com) )
                 return;

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:29 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhU-0008RC-BC; Mon, 28 Nov 2011 23:33: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 1RVAhS-0008NP-Nj
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:26 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1322523144!50332090!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19912 invoked from network); 28 Nov 2011 23:32:25 -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;
	28 Nov 2011 23:32: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 1RVAnM-0001jC-Gs
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhL-0000pw-GJ
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:19 +0000
Message-Id: <E1RVAhL-0000pw-GJ@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Properly compare "pci" token when
	groking serial port config
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1322149519 0
# Node ID 8e05b21ee6448ce56e4e56201472e87074344fa6
# Parent  67d2ac426defedad9c10eb339019f9dc9f02d2ae
Properly compare "pci" token when groking serial port config

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 67d2ac426def -r 8e05b21ee644 xen/drivers/char/ns16550.c
--- a/xen/drivers/char/ns16550.c	Thu Nov 24 15:44:51 2011 +0000
+++ b/xen/drivers/char/ns16550.c	Thu Nov 24 15:45:19 2011 +0000
@@ -554,7 +554,7 @@
     if ( *conf == ',' )
     {
         conf++;
-        if ( strncmp(conf, "pci", 5) == 0 )
+        if ( strncmp(conf, "pci", 3) == 0 )
         {
             if ( pci_uart_config(uart, 1/* skip AMT */, uart - ns16550_com) )
                 return;

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:31 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhW-0008VK-N4; Mon, 28 Nov 2011 23:33: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 1RVAhV-0008Sg-HQ
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-27.messagelabs.com!1322523142!59084728!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29972 invoked from network); 28 Nov 2011 23:32:23 -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;
	28 Nov 2011 23:32: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 1RVAnP-0001jU-3H
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhN-0000r9-Vt
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:21 +0000
Message-Id: <E1RVAhN-0000r9-Vt@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: handle HVMOP_modified_memory
	on shared pages
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1322152474 0
# Node ID a94fc613ab8c88815e3bfc1335493301ace1b38a
# Parent  e6100a0832cebe6a66005c2fa2c994a0784e8e93
x86/mm: handle HVMOP_modified_memory on shared pages

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Adin Scannell <adin@scannell.ca>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r e6100a0832ce -r a94fc613ab8c xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Thu Nov 24 16:34:34 2011 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Thu Nov 24 16:34:34 2011 +0000
@@ -3755,7 +3755,7 @@
         for ( pfn = a.first_pfn; pfn < a.first_pfn + a.nr; pfn++ )
         {
             p2m_type_t t;
-            mfn_t mfn = get_gfn(d, pfn, &t);
+            mfn_t mfn = get_gfn_unshare(d, pfn, &t);
             if ( p2m_is_paging(t) )
             {
                 p2m_mem_paging_populate(d, pfn);
@@ -3764,8 +3764,16 @@
                 goto param_fail3;
             }
             if( p2m_is_shared(t) )
+            {
+                /* If it insists on not unsharing itself, crash the domain 
+                 * rather than crashing the host down in mark dirty */
                 gdprintk(XENLOG_WARNING,
                          "shared pfn 0x%lx modified?\n", pfn);
+                domain_crash(d);
+                put_gfn(d, pfn);
+                rc = -EINVAL;
+                goto param_fail3;
+            }
             
             if ( mfn_x(mfn) != INVALID_MFN )
             {

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:31 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhW-0008VK-N4; Mon, 28 Nov 2011 23:33: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 1RVAhV-0008Sg-HQ
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-27.messagelabs.com!1322523142!59084728!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29972 invoked from network); 28 Nov 2011 23:32:23 -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;
	28 Nov 2011 23:32: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 1RVAnP-0001jU-3H
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhN-0000r9-Vt
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:21 +0000
Message-Id: <E1RVAhN-0000r9-Vt@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: handle HVMOP_modified_memory
	on shared pages
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1322152474 0
# Node ID a94fc613ab8c88815e3bfc1335493301ace1b38a
# Parent  e6100a0832cebe6a66005c2fa2c994a0784e8e93
x86/mm: handle HVMOP_modified_memory on shared pages

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Adin Scannell <adin@scannell.ca>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r e6100a0832ce -r a94fc613ab8c xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Thu Nov 24 16:34:34 2011 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Thu Nov 24 16:34:34 2011 +0000
@@ -3755,7 +3755,7 @@
         for ( pfn = a.first_pfn; pfn < a.first_pfn + a.nr; pfn++ )
         {
             p2m_type_t t;
-            mfn_t mfn = get_gfn(d, pfn, &t);
+            mfn_t mfn = get_gfn_unshare(d, pfn, &t);
             if ( p2m_is_paging(t) )
             {
                 p2m_mem_paging_populate(d, pfn);
@@ -3764,8 +3764,16 @@
                 goto param_fail3;
             }
             if( p2m_is_shared(t) )
+            {
+                /* If it insists on not unsharing itself, crash the domain 
+                 * rather than crashing the host down in mark dirty */
                 gdprintk(XENLOG_WARNING,
                          "shared pfn 0x%lx modified?\n", pfn);
+                domain_crash(d);
+                put_gfn(d, pfn);
+                rc = -EINVAL;
+                goto param_fail3;
+            }
             
             if ( mfn_x(mfn) != INVALID_MFN )
             {

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:31 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhW-0008V2-KN; Mon, 28 Nov 2011 23:33:30 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhV-0008L5-B0
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-216.messagelabs.com!1322523171!5398869!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23647 invoked from network); 28 Nov 2011 23:32:52 -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;
	28 Nov 2011 23:32:52 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnK-0001ix-2P
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhJ-0000oj-1p
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:17 +0000
Message-Id: <E1RVAhJ-0000oj-1p@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm/p2m: fix pod locking
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1322148057 0
# Node ID 7da681c490e0a8a2b3f1fb311d254dc7ce618a43
# Parent  b082fdc52ad7607d93b59148fb289aafe21f294b
x86/mm/p2m: fix pod locking

The path p2m-lookup -> p2m-pt->get_entry -> 1GB PoD superpage ->
pod_demand_populate ends in the pod code performing a p2m_set_entry with
no locks held (in order to split the 1GB superpage into 512 2MB ones)

Further, it calls p2m_unlock after that, which will break the spinlock.

This patch attempts to fix that.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r b082fdc52ad7 -r 7da681c490e0 xen/arch/x86/mm/p2m-pod.c
--- a/xen/arch/x86/mm/p2m-pod.c	Thu Nov 24 09:44:54 2011 +0100
+++ b/xen/arch/x86/mm/p2m-pod.c	Thu Nov 24 15:20:57 2011 +0000
@@ -987,7 +987,6 @@
         set_p2m_entry(p2m, gfn_aligned, _mfn(0), PAGE_ORDER_2M,
                       p2m_populate_on_demand, p2m->default_access);
         audit_p2m(p2m, 1);
-        p2m_unlock(p2m);
         return 0;
     }
 
diff -r b082fdc52ad7 -r 7da681c490e0 xen/arch/x86/mm/p2m-pt.c
--- a/xen/arch/x86/mm/p2m-pt.c	Thu Nov 24 09:44:54 2011 +0100
+++ b/xen/arch/x86/mm/p2m-pt.c	Thu Nov 24 15:20:57 2011 +0000
@@ -542,10 +542,11 @@
             /* The read has succeeded, so we know that mapping exists */
             if ( q != p2m_query )
             {
-                if ( !p2m_pod_demand_populate(p2m, gfn, PAGE_ORDER_1G, q) )
+                if ( !p2m_pod_check_and_populate(p2m, gfn,
+                                      (l1_pgentry_t *) &l3e, PAGE_ORDER_1G, q) )
                     goto pod_retry_l3;
                 p2mt = p2m_invalid;
-                printk("%s: Allocate 1GB failed!\n", __func__);
+                gdprintk(XENLOG_ERR, "%s: Allocate 1GB failed!\n", __func__);
                 goto out;
             }
             else
@@ -743,8 +744,10 @@
             {
                 if ( q != p2m_query )
                 {
-                    if ( !p2m_pod_demand_populate(p2m, gfn, PAGE_ORDER_1G, q) )
+                    if ( !p2m_pod_check_and_populate(p2m, gfn,
+                                      (l1_pgentry_t *) l3e, PAGE_ORDER_1G, q) )
                         goto pod_retry_l3;
+                    gdprintk(XENLOG_ERR, "%s: Allocate 1GB failed!\n", __func__);
                 }
                 else
                     *t = p2m_populate_on_demand;

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:31 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhW-0008V2-KN; Mon, 28 Nov 2011 23:33:30 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhV-0008L5-B0
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-216.messagelabs.com!1322523171!5398869!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23647 invoked from network); 28 Nov 2011 23:32:52 -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;
	28 Nov 2011 23:32:52 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnK-0001ix-2P
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhJ-0000oj-1p
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:17 +0000
Message-Id: <E1RVAhJ-0000oj-1p@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm/p2m: fix pod locking
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1322148057 0
# Node ID 7da681c490e0a8a2b3f1fb311d254dc7ce618a43
# Parent  b082fdc52ad7607d93b59148fb289aafe21f294b
x86/mm/p2m: fix pod locking

The path p2m-lookup -> p2m-pt->get_entry -> 1GB PoD superpage ->
pod_demand_populate ends in the pod code performing a p2m_set_entry with
no locks held (in order to split the 1GB superpage into 512 2MB ones)

Further, it calls p2m_unlock after that, which will break the spinlock.

This patch attempts to fix that.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r b082fdc52ad7 -r 7da681c490e0 xen/arch/x86/mm/p2m-pod.c
--- a/xen/arch/x86/mm/p2m-pod.c	Thu Nov 24 09:44:54 2011 +0100
+++ b/xen/arch/x86/mm/p2m-pod.c	Thu Nov 24 15:20:57 2011 +0000
@@ -987,7 +987,6 @@
         set_p2m_entry(p2m, gfn_aligned, _mfn(0), PAGE_ORDER_2M,
                       p2m_populate_on_demand, p2m->default_access);
         audit_p2m(p2m, 1);
-        p2m_unlock(p2m);
         return 0;
     }
 
diff -r b082fdc52ad7 -r 7da681c490e0 xen/arch/x86/mm/p2m-pt.c
--- a/xen/arch/x86/mm/p2m-pt.c	Thu Nov 24 09:44:54 2011 +0100
+++ b/xen/arch/x86/mm/p2m-pt.c	Thu Nov 24 15:20:57 2011 +0000
@@ -542,10 +542,11 @@
             /* The read has succeeded, so we know that mapping exists */
             if ( q != p2m_query )
             {
-                if ( !p2m_pod_demand_populate(p2m, gfn, PAGE_ORDER_1G, q) )
+                if ( !p2m_pod_check_and_populate(p2m, gfn,
+                                      (l1_pgentry_t *) &l3e, PAGE_ORDER_1G, q) )
                     goto pod_retry_l3;
                 p2mt = p2m_invalid;
-                printk("%s: Allocate 1GB failed!\n", __func__);
+                gdprintk(XENLOG_ERR, "%s: Allocate 1GB failed!\n", __func__);
                 goto out;
             }
             else
@@ -743,8 +744,10 @@
             {
                 if ( q != p2m_query )
                 {
-                    if ( !p2m_pod_demand_populate(p2m, gfn, PAGE_ORDER_1G, q) )
+                    if ( !p2m_pod_check_and_populate(p2m, gfn,
+                                      (l1_pgentry_t *) l3e, PAGE_ORDER_1G, q) )
                         goto pod_retry_l3;
+                    gdprintk(XENLOG_ERR, "%s: Allocate 1GB failed!\n", __func__);
                 }
                 else
                     *t = p2m_populate_on_demand;

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:32 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhY-00006j-BI; Mon, 28 Nov 2011 23:33:32 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhW-0008Lv-Fm
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:30 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-182.messagelabs.com!1322523172!476833!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31137 invoked from network); 28 Nov 2011 23:32:53 -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;
	28 Nov 2011 23:32:53 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnL-0001j3-2D
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhK-0000pD-1d
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:18 +0000
Message-Id: <E1RVAhK-0000pD-1d@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm/p2m: don't overwrite m2p
	entry of still-shared pages
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1322148057 0
# Node ID f71ff2f7b604ff299c418854677880cac9d31f4f
# Parent  6b3d8250ee2c63d90680c142549123a4b1559f55
x86/mm/p2m: don't overwrite m2p entry of still-shared pages

When updating a p2m mapping to shared, previous code
unconditionally set the m2p entry for the old mfn to invalid.
We now check that the old mfn does not remain shared.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 6b3d8250ee2c -r f71ff2f7b604 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Thu Nov 24 15:20:57 2011 +0000
+++ b/xen/arch/x86/mm/p2m.c	Thu Nov 24 15:20:57 2011 +0000
@@ -714,8 +714,9 @@
      * sharable first */
     ASSERT(p2m_is_shared(ot));
     ASSERT(mfn_valid(omfn));
-    /* XXX: M2P translations have to be handled properly for shared pages */
-    set_gpfn_from_mfn(mfn_x(omfn), INVALID_M2P_ENTRY);
+    if ( ((mfn_to_page(omfn)->u.inuse.type_info & PGT_type_mask) 
+                    != PGT_shared_page) )
+        set_gpfn_from_mfn(mfn_x(omfn), INVALID_M2P_ENTRY);
 
     P2M_DEBUG("set shared %lx %lx\n", gfn, mfn_x(mfn));
     rc = set_p2m_entry(p2m, gfn, mfn, PAGE_ORDER_4K, p2m_ram_shared, p2m->default_access);

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:32 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhY-00006j-BI; Mon, 28 Nov 2011 23:33:32 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhW-0008Lv-Fm
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:30 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-182.messagelabs.com!1322523172!476833!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31137 invoked from network); 28 Nov 2011 23:32:53 -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;
	28 Nov 2011 23:32:53 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnL-0001j3-2D
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhK-0000pD-1d
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:18 +0000
Message-Id: <E1RVAhK-0000pD-1d@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm/p2m: don't overwrite m2p
	entry of still-shared pages
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1322148057 0
# Node ID f71ff2f7b604ff299c418854677880cac9d31f4f
# Parent  6b3d8250ee2c63d90680c142549123a4b1559f55
x86/mm/p2m: don't overwrite m2p entry of still-shared pages

When updating a p2m mapping to shared, previous code
unconditionally set the m2p entry for the old mfn to invalid.
We now check that the old mfn does not remain shared.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 6b3d8250ee2c -r f71ff2f7b604 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Thu Nov 24 15:20:57 2011 +0000
+++ b/xen/arch/x86/mm/p2m.c	Thu Nov 24 15:20:57 2011 +0000
@@ -714,8 +714,9 @@
      * sharable first */
     ASSERT(p2m_is_shared(ot));
     ASSERT(mfn_valid(omfn));
-    /* XXX: M2P translations have to be handled properly for shared pages */
-    set_gpfn_from_mfn(mfn_x(omfn), INVALID_M2P_ENTRY);
+    if ( ((mfn_to_page(omfn)->u.inuse.type_info & PGT_type_mask) 
+                    != PGT_shared_page) )
+        set_gpfn_from_mfn(mfn_x(omfn), INVALID_M2P_ENTRY);
 
     P2M_DEBUG("set shared %lx %lx\n", gfn, mfn_x(mfn));
     rc = set_p2m_entry(p2m, gfn, mfn, PAGE_ORDER_4K, p2m_ram_shared, p2m->default_access);

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:32 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhY-00006C-6N; Mon, 28 Nov 2011 23:33:32 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhV-0008LD-Je
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:30 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-216.messagelabs.com!1322523169!5375515!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
	MAILTO_TO_SPAM_ADDR
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20328 invoked from network); 28 Nov 2011 23:32:50 -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;
	28 Nov 2011 23:32:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnI-0001il-2M
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhH-0000nl-1i
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:15 +0000
Message-Id: <E1RVAhH-0000nl-1i@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: remove some fatally out of
	date documentation
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1321987873 0
# Node ID f88c745575bb738e7c217d9dffed37dc894e7a1c
# Parent  4ecd3615e7267c1b1ff760a9b6714d517e76e6a9
docs: remove some fatally out of date documentation

I think these are better off deleted than remaining to confuse people.

docs/misc/blkif-drivers-explained.txt:

 - Talks about Xen 2.0 beta, talks about the old pre-xenstored IPC mechanism.

docs/misc/cpuid-config-for-guest.txt:

 - Doesn't really say anything, in particular doesn't actually describe how to
   configure CPUID.

docs/misc/hg-cheatsheet.txt:

 - Not out of date per-se wrt mercural but talk about Xen 2.0 and gives URLs
   under www.cl.cam.ac.uk. Talks a lot about bitkeeper. Given that mercurial is
   hardly unusual anymore I think there must be better guides out there so this
   one is not worth resurecting.

docs/misc/network_setup.txt:

 - This is more comprehensively documented on the wiki these days.

docs/misc/VMX_changes.txt:

 - Is basically a changelog from the initial implementation of VMX in 2004.

I'm not sure about some of the other docs, but these ones seemed fairly
obvious.

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


diff -r 4ecd3615e726 -r f88c745575bb docs/misc/VMX_changes.txt
--- a/docs/misc/VMX_changes.txt	Tue Nov 22 17:24:51 2011 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-Changes to Xen in support of Intel(R) Vanderpool Technology
--------------------------------------------------------------
-
-Our VT extensions to the Xen hypervisor provide full platform
-virtualization, including CPU(s), memory, and I/O infrastructure. The
-generic code in Xen handles and schedules those virtual machines as it
-does for the existing para-virtualized domains.
-
-Full virtualization required by the OS guests requires full device
-virtualization as well. The device models in BOCHS
-(http://bochs.sourceforge.net/) were decoupled from the CPU
-virtualization, and are used to virtualize the legacy devices (such as
-keyboard, mouse, VGA, IDE) in the PC platform. At this point, the
-device models run in user mode on domain 0, not in the Xen hypervisor.
-
-We would like to thank Ian Pratt and Keir Fraser for reviewing our
-design and code intensively, and for providing numerous useful
-suggestions to improve the architecture and code. 
-
-We have a list of Intel team members who take credit for making this
-release happen: Yunhong Jiang, Nitin Kamble, Chengyuan Li, Xin Li,
-Xiaofeng Ling, Benjamin Liu, Asit Mallick, Jun Nakajima, Sunil Saxena,
-Arun Sharma, Edwin Zhai, Jeff Zheng, and Louis Zhuang. We'll continue
-to add more features to complete full virtualization in Xen using VT.
-
-The notes document the changes to the Xen hypervisor in order to add
-VT support. The changes to other areas, such as Control Panel will be
-added as we deliver the code.
-
-Summary of changes for the first release
-----------------------------------------
-December 15, 2004
-
-    * VT specific event handling and domain management were added. 
-
-    * Shadow mode was extended to support full 32-bit guests
-    
-    * Domain switching code was extended to support VT domain
-    
-    * I/O request handling was added to communicate with the device model
-
-    * Domain builder was extended to provide the environment when the
-      guest enters the protected mode, including E820 memory and VGA
-      info, typically obtained by BIOS calls.
-
-New code:
----------
-    VT (Vanderpool Technology) is based on the new VMX (Virtual
-    Machine Extensions) architecture. The current release of the
-    software supports 32-bit only.
-
-    * arch/x86/vmx.[ch] and arch/x86/vmx_*.[ch]: created to handle
-      VMX-specific events in order to provide virtual machine.
-
-    * arch/x86/x86_32/entry.S: new code path was added to have the
-      first-level handler from VM exits. The first-level handler calls
-      the second-level handler in arch/x86/vmx.c.
-
-    * arch/x86/setup.c: new function start_vmx() to init_intel() to
-      enable VMX mode.
-
-    * include/asm-x86/config.h: #ifdef CONFIG_VMX was added.
-
-    * arch/x86/domain.c: new code patch was added to create a VMX
-      domain given the flag from the control panel.
-
-    * include/public/io/ioreq.h: A new data structure was added to
-      define the I/O requests between the Xen hypervisor and the
-      device models.
-
-Changes to the existing code:
------------------------------
-
-    * arch/x86/shadow.[ch]: new mode SHM_full_32 was added to support
-      full virtualization. The current Xen code assumes that the guest
-      page directory and tables have _machine_ (or host) physical page
-      frame numbers, and the new code allows to support _guest_
-      physical page frame numbers
-
-    * include/asm-x86/processor.h: struct arch_vmx_struct arch_vmx has
-      been added to the thread_struct data structure. The arch_vmx has
-      the additional VMX-related CPU context.
-
-    * arch/x86/io_apic.c: reverse mapping between vector and irq has
-      been added. We will revisit this code when considering MSI
-      support.
-
---- Jun
-
-
diff -r 4ecd3615e726 -r f88c745575bb docs/misc/blkif-drivers-explained.txt
--- a/docs/misc/blkif-drivers-explained.txt	Tue Nov 22 17:24:51 2011 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,485 +0,0 @@
-=== How the Blkif Drivers Work ===
-Andrew Warfield
-andrew.warfield@cl.cam.ac.uk
-
-The intent of this is to explain at a fairly detailed level how the
-split device drivers work in Xen 1.3 (aka 2.0beta).  The intended
-audience for this, I suppose, is anyone who intends to work with the
-existing blkif interfaces and wants something to help them get up to
-speed with the code in a hurry.  Secondly though, I hope to break out
-the general mechanisms that are used in the drivers that are likely to
-be necessary to implement other drivers interfaces.
-
-As a point of warning before starting, it is worth mentioning that I
-anticipate much of the specifics described here changing in the near
-future.  There has been talk about making the blkif protocol
-a bit more efficient than it currently is.  Keir's addition of grant
-tables will change the current remapping code that is used when shared
-pages are initially set up.
-
-Also, writing other control interface types will likely need support
-from Xend, which at the moment has a steep learning curve... this
-should be addressed in the future.
-
-For more information on the driver model as a whole, read the
-"Reconstructing I/O" technical report
-(http://www.cl.cam.ac.uk/Research/SRG/netos/papers/2004-xenngio.pdf).
-
-==== High-level structure of a split-driver interface ====
-
-Why would you want to write a split driver in the first place?  As Xen
-is a virtual machine manager and focuses on isolation as an initial
-design principle, it is generally considered unwise to share physical
-access to devices across domains.  The reasons for this are obvious:
-when device resources are shared, misbehaving code or hardware can
-result in the failure of all of the client applications.  Moreover, as
-virtual machines in Xen are entire OSs, standard device drives that
-they might use cannot have multiple instantiations for a single piece
-of hardware.  In light of all this, the general approach in Xen is to
-give a single virtual machine hardware access to a device, and where
-other VMs want to share the device, export a higher-level interface to
-facilitate that sharing.  If you don't want to share, that's fine.
-There are currently Xen users actively exploring running two
-completely isolated X-Servers on a Xen host, each with it's own video
-card, keyboard, and mouse.  In these situations, the guests need only
-be given physical access to the necessary devices and left to go on
-their own.  However, for devices such as disks and network interfaces,
-where sharing is required, the split driver approach is a good
-solution.
-
-The structure is like this:
-
-   +--------------------------+  +--------------------------+
-   | Domain 0 (privileged)    |  | Domain 1 (unprivileged)  |
-   |                          |  |                          |
-   | Xend ( Application )     |  |                          |
-   | Blkif Backend Driver     |  | Blkif Frontend Driver    |
-   | Physical Device Driver   |  |                          |
-   +--------------------------+  +--------------------------+
-   +--------------------------------------------------------+
-   |                X       E       N                       |
-   +--------------------------------------------------------+
-
-
-The Blkif driver is in two parts, which we refer to as frontend (FE)
-and a backend (BE).  Together, they serve to proxy device requests
-between the guest operating system in an unprivileged domain, and the
-physical device driver in the physical domain.  An additional benefit
-to this approach is that the FE driver can provide a single interface
-for a whole class of physical devices.  The blkif interface mounts
-IDE, SCSI, and our own VBD-structured disks, independent of the
-physical driver underneath.  Moreover, supporting additional OSs only
-requires that a new FE driver be written to connect to the existing
-backend.
-
-==== Inter-Domain Communication Mechanisms ====
-
-===== Event Channels =====
-
-Before getting into the specifics of the block interface driver, it is
-worth discussing the mechanisms that are used to communicate between
-domains.  Two mechanisms are used to allow the construction of
-high-performance drivers: event channels and shared-memory rings.
-
-Event channels are an asynchronous interdomain notification
-mechanism.  Xen allows channels to be instantiated between two
-domains, and domains can request that a virtual irq be attached to
-notifications on a given channel.  The result of this is that the
-frontend domain can send a notification on an event channel, resulting
-in an interrupt entry into the backend at a later time.
-
-The event channel between two domains is instantiated in the Xend code
-during driver startup (described later).  Xend's channel.py
-(tools/python/xen/xend/server/channel.py) defines the function
-
-
-def eventChannel(dom1, dom2):
-    return xc.evtchn_bind_interdomain(dom1=dom1, dom2=dom2)
-
-
-which maps to xc_evtchn_bind_interdomain() in tools/libxc/xc_evtchn.c,
-which in turn generates a hypercall to Xen to patch the event channel
-between the domains.  Only a privileged domain can request the
-creation of an event channel.
-
-Once the event channel is created in Xend, its ends are passed to both the
-front and backend domains over the control channel.  The end that is
-passed to a domain is just an integer "port" uniquely identifying the
-event channel's local connection to that domain.  An example of this
-setup code is in linux-2.6.x/drivers/xen/blkfront/blkfront.c in
-blkif_connect(), which receives several status change events as
-the driver starts up.  It is passed an event channel end in a
-BLKIF_INTERFACE_STATUS_CONNECTED message, and patches it in like this:
-
-
-   blkif_evtchn = status->evtchn;
-   blkif_irq    = bind_evtchn_to_irq(blkif_evtchn);
-   if ( (rc = request_irq(blkif_irq, blkif_int, 
-                          SA_SAMPLE_RANDOM, "blkif", NULL)) )
-       printk(KERN_ALERT"blkfront request_irq failed (%ld)\n",rc);
-
-
-This code associates a virtual irq with the event channel, and
-attaches the function blkif_int() as an interrupt handler for that
-irq.  blkif_int() simply handles the notification and returns, it does
-not need to interact with the channel at all.
-
-An example of generating a notification can also be seen in blkfront.c:
-
-
-static inline void flush_requests(void)
-{
-    DISABLE_SCATTERGATHER();
-    wmb(); /* Ensure that the frontend can see the requests. */
-    blk_ring->req_prod = req_prod;
-    notify_via_evtchn(blkif_evtchn);
-}
-}}}
-
-notify_via_evtchn() issues a hypercall to set the event waiting flag on
-the other domain's end of the channel.
-
-===== Communication Rings =====
-
-Event channels are strictly a notification mechanism between domains.
-To move large chunks of data back and forth, Xen allows domains to
-share pages of memory.  We use communication rings as a means of
-managing access to a shared memory page for message passing between
-domains.  These rings are not explicitly a mechanism of Xen, which is
-only concerned with the actual sharing of the page and not how it is
-used, they are however worth discussing as they are used in many
-places in the current code and are a useful model for communicating
-across a shared page.
-
-A shared page is set up by a front end guest first allocating and passing 
-the address of a page in its own address space to the backend driver.  
-
-Consider the following code, also from blkfront.c.  Note:  this code
-is in blkif_disconnect().  The driver transitions from STATE_CLOSED
-to STATE_DISCONNECTED before becoming CONNECTED.  The state automata
-is in blkif_status().
-
-   blk_ring = (blkif_ring_t *)__get_free_page(GFP_KERNEL);
-   blk_ring->req_prod = blk_ring->resp_prod = resp_cons = req_prod = 0;
-   ...
-   /* Construct an interface-CONNECT message for the domain controller. */
-   cmsg.type      = CMSG_BLKIF_FE;
-   cmsg.subtype   = CMSG_BLKIF_FE_INTERFACE_CONNECT;
-   cmsg.length    = sizeof(blkif_fe_interface_connect_t);
-   up.handle      = 0;
-   up.shmem_frame = virt_to_machine(blk_ring) >> PAGE_SHIFT;
-   memcpy(cmsg.msg, &up, sizeof(up));  
-
-
-blk_ring will be the shared page.  The producer and consumer pointers
-are then initialised (these will be discussed soon), and then the
-machine address of the page is send to the backend via a control
-channel to Xend.  This control channel itself uses the notification
-and shared memory mechanisms described here, but is set up for each
-domain automatically at startup.
-
-The backend, which is a privileged domain then takes the page address
-and maps it into its own address space (in
-linux26/drivers/xen/blkback/interface.c:blkif_connect()):
-
-
-void blkif_connect(blkif_be_connect_t *connect)
-
-   ...
-   unsigned long shmem_frame = connect->shmem_frame;
-   ...
-
-   if ( (vma = get_vm_area(PAGE_SIZE, VM_IOREMAP)) == NULL )
-   {
-      connect->status = BLKIF_BE_STATUS_OUT_OF_MEMORY;
-      return;
-   }
-
-   prot = __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED);
-   error = direct_remap_area_pages(&init_mm, VMALLOC_VMADDR(vma->addr),
-                                   shmem_frame<<PAGE_SHIFT, PAGE_SIZE,
-                                   prot, domid);
-
-   ...
-
-   blkif->blk_ring_base = (blkif_ring_t *)vma->addr
-}}}
-
-The machine address of the page is passed in the shmem_frame field of
-the connect message.  This is then mapped into the virtual address
-space of the backend domain, and saved in the blkif structure
-representing this particular backend connection.
-
-NOTE:  New mechanisms will be added very shortly to allow domains to
-explicitly grant access to their pages to other domains.  This "grant
-table" support is in the process of being added to the tree, and will
-change the way a shared page is set up.  In particular, it will remove
-the need of the remapping domain to be privileged.
-
-Sending data across shared rings:
-
-Shared rings avoid the potential for write interference between
-domains in a very cunning way.  A ring is partitioned into a request
-and a response region, and domains only work within their own space.
-This can be thought of as a double producer-consumer ring -- the ring
-is described by four pointers into a circular buffer of fixed-size
-records.  Pointers may only advance, and may not pass one another.
-
-
-                         resp_cons----+
-                                      V
-           +----+----+----+----+----+----+----+
-           |    |    |  free(A)     |RSP1|RSP2|
-           +----+----+----+----+----+----+----+
- req_prod->|    |       -------->        |RSP3|
-           +----+                        +----+
-           |REQ8|                        |    |<-resp_prod
-           +----+                        +----+
-           |REQ7|                        |    |
-           +----+                        +----+
-           |REQ6|       <--------        |    |
-           +----+----+----+----+----+----+----+
-           |REQ5|REQ4|    free(B)   |    |    |
-           +----+----+----+----+----+----+----+
-  req_cons---------^
-
-
-
-By adopting the convention that every request will receive a response,
-not all four pointers need be shared and flow control on the ring
-becomes very easy to manage.  Each domain manages its own
-consumer pointer, and the two producer pointers are visible to both
-(xen/include/public/io/blkif.h):
-
-
-/* NB. Ring size must be small enough for sizeof(blkif_ring_t) <=PAGE_SIZE.*/
-  #define BLKIF_RING_SIZE        64
-
-  ...
-
-/*
- * We use a special capitalised type name because it is _essential_ that all
- * arithmetic on indexes is done on an integer type of the correct size.
- */
-typedef u32 BLKIF_RING_IDX;
-
-/*
- * Ring indexes are 'free running'. That is, they are not stored modulo the
- * size of the ring buffer. The following macro converts a free-running counter
- * into a value that can directly index a ring-buffer array.
- */
-#define MASK_BLKIF_IDX(_i) ((_i)&(BLKIF_RING_SIZE-1))
-
-typedef struct {
-    BLKIF_RING_IDX req_prod;  /*  0: Request producer. Updated by front-end. */
-    BLKIF_RING_IDX resp_prod; /*  4: Response producer. Updated by back-end. */
-    union {                   /*  8 */
-        blkif_request_t  req;
-        blkif_response_t resp;
-    } PACKED ring[BLKIF_RING_SIZE];
-} PACKED blkif_ring_t;
-
-
-
-As shown in the diagram above, the rules for using a shared memory
-ring are simple.  
-
- 1. A ring is full when a domain's producer and consumer pointers are
-    equal (e.g. req_prod == resp_cons).  In this situation, the
-    consumer pointer must be advanced.  Furthermore, if the consumer
-    pointer is equal to the other domain's producer pointer,
-    (e.g. resp_cons = resp_prod), then the other domain has all the
-    buffers.
-
-2. Producer pointers point to the next buffer that will be written to.
-   (So blk_ring[MASK_BLKIF_IDX(req_prod)] should not be consumed.)
-
-3. Consumer pointers point to a valid message, so long as they are not
-   equal to the associated producer pointer.
-
-4. A domain should only ever write to the message pointed
-   to by its producer index, and read from the message at it's
-   consumer.  More generally, the domain may be thought of to have
-   exclusive access to the messages between its consumer and producer,
-   and should absolutely not read or write outside this region.
-
-   Thus the front end has exclusive access to the free(A) region 
-   in the figure above, and the back end driver has exclusive
-   access to the free(B) region.
-
-In general, drivers keep a private copy of their producer pointer and
-then set the shared version when they are ready for the other end to
-process a set of messages.  Additionally, it is worth paying attention
-to the use of memory barriers (rmb/wmb) in the code, to ensure that
-rings that are shared across processors behave as expected.
-
-==== Structure of the Blkif Drivers ====
-
-Now that the communications primitives have been discussed, I'll
-quickly cover the general structure of the blkif driver.  This is
-intended to give a high-level idea of what is going on, in an effort
-to make reading the code a more approachable task.
-
-There are three key software components that are involved in the blkif
-drivers (not counting Xen itself).  The frontend and backend driver,
-and Xend, which coordinates their initial connection.  Xend may also
-be involved in control-channel signalling in some cases after startup,
-for instance to manage reconnection if the backend is restarted.
-
-===== Frontend Driver Structure =====
-
-The frontend domain uses a single event channel and a shared memory
-ring to trade control messages with the backend.  These are both setup
-during domain startup, which will be discussed shortly.  The shared
-memory ring is called blkif_ring, and the private ring indexes are
-resp_cons, and req_prod.  The ring is protected by blkif_io_lock.
-Additionally, the frontend keeps a list of outstanding requests in
-rec_ring[].  These are uniquely identified by a guest-local id number,
-which is associated with each request sent to the backend, and
-returned with the matching responses.  Information about the actual
-disks are stored in major_info[], of which only the first nr_vbds
-entries are valid.  Finally, the global 'recovery' indicates that the
-connection between the backend and frontend drivers has been broken
-(possibly due to a backend driver crash) and that the frontend is in
-recovery mode, in which case it will attempt to reconnect and reissue
-outstanding requests.
-
-The frontend driver is single-threaded and after setup is entered only
-through three points:  (1) read/write requests from the XenLinux guest
-that it is a part of, (2) interrupts from the backend driver on its
-event channel (blkif_int()), and (3) control messages from Xend
-(blkif_ctrlif_rx).
-
-===== Backend Driver Structure =====
-
-The backend driver is slightly more complex as it must manage any
-number of concurrent frontend connections.  For each domain it
-manages, the backend driver maintains a blkif structure, which
-describes all the connection and disk information associated with that
-particular domain.  This structure is associated with the interrupt
-registration, and allows the backend driver to have immediate context
-when it takes a notification from some domain.
-
-All of the blkif structures are stored in a hash table (blkif_hash),
-which is indexed by a hash of the domain id, and a "handle", really a
-per-domain blkif identifier, in case it wants to have multiple connections.
-
-The per-connection blkif structure is of type blkif_t.  It contains
-all of the communication details (event channel, irq, shared memory
-ring and indexes), and blk_ring_lock, which is the backend mutex on
-the shared ring.  The structure also contains vbd_rb, which is a
-red-black tree, containing an entry for each device/partition that is
-assigned to that domain.  This structure is filled by xend passing
-disk information to the backend at startup, and is protected by
-vbd_lock.  Finally, the blkif struct contains a status field, which
-describes the state of the connection.
-
-The backend driver spawns a kernel thread at startup
-(blkio_schedule()), which handles requests to and from the actual disk
-device drivers.  This scheduler thread maintains a list of blkif
-structures that have pending requests, and services them round-robin
-with a maximum per-round request limit.  blkifs are added to the list
-in the interrupt handler (blkif_be_int()) using
-add_to_blkdev_list_tail(), and removed in the scheduler loop after
-calling do_block_io_op(), which processes a batch of requests.  The
-scheduler thread is explicitly activated at several points in the code
-using maybe_trigger_blkio_schedule().
-
-Pending requests between the backend driver and the physical device
-drivers use another ring, pending_ring.  Requests are placed in this
-ring in the scheduler thread and issued to the device.  A completion
-callback, end_block_io_op, indicates that requests have been serviced
-and generates a response on the appropriate blkif ring.  pending
-reqs[] stores a list of outstanding requests with the physical drivers.
-
-So, control entries to the backend are (1) the blkio scheduler thread,
-which sends requests to the real device drivers, (2) end_block_io_op,
-which is called as serviced requests complete, (3) blkif_be_int()
-handles notifications from the frontend drivers in other domains, and
-(4) blkif_ctrlif_rx() handles control messages from xend.
-
-==== Driver Startup ====
-
-Prior to starting a new guest using the frontend driver, the backend
-will have been started in a privileged domain.  The backend
-initialisation code initialises all of its data structures, such as
-the blkif hash table, and starts the scheduler thread as a kernel
-thread. It then sends a driver status up message to let xend know it
-is ready to take frontend connections.
-
-When a new domain that uses the blkif frontend driver is started,
-there are a series of interactions between it, xend, and the specified
-backend driver.  These interactions are as follows:
-
-The domain configuration given to xend will specify the backend domain
-and disks that the new guest is to use.  Prior to actually running the
-domain, xend and the backend driver interact to setup the initial
-blkif record in the backend.
-
-(1) Xend sends a BLKIF_BE_CREATE message to backend.
-
-  Backend does blkif_create(), having been passed FE domid and handle.
-  It creates and initialises a new blkif struct, and puts it in the
-  hash table.
-  It then returns a STATUS_OK response to xend.
-
-(2) Xend sends a BLKIF_BE_VBD_CREATE message to the backend.
- 
-  Backend adds a vbd entry in the red-black tree for the
-  specified (dom, handle) blkif entry.
-  Sends a STATUS_OK response.
-
-(3) Xend sends a BLKIF_BE_VBD_GROW message to the backend.
-
-  Backend takes the physical device information passed in the 
-  message and assigns them to the newly created vbd struct.
-
-(2) and (3) repeat as any additional devices are added to the domain.
-
-At this point, the backend has enough state to allow the frontend
-domain to start.  The domain is run, and eventually gets to the
-frontend driver initialisation code.  After setting up the frontend
-data structures, this code continues the communications with xend and
-the backend to negotiate a connection:
-
-(4) Frontend sends Xend a BLKIF_FE_DRIVER_STATUS_CHANGED message.
-
-  This message tells xend that the driver is up.  The init function
-  now spin-waits until driver setup is complete in order to prevent
-  Linux from attempting to boot before the disks are connected.
-
-(5) Xend sends the frontend an INTERFACE_STATUS_CHANGED message
-
-  This message specifies that the interface is now disconnected
-  (instead of closed).
-  The domain updates it's state, and allocates the shared blk_ring
-  page.  Next, 
-
-(6) Frontend sends Xend a BLKIF_INTERFACE_CONNECT message
-
-  This message specifies the domain and handle, and includes the
-  address of the newly created page.
-
-(7) Xend sends the backend a BLKIF_BE_CONNECT message
-
-  The backend fills in the blkif connection information, maps the
-  shared page, and binds an irq to the event channel.
-  
-(8) Xend sends the frontend an INTERFACE_STATUS_CHANGED message
-
-  This message takes the frontend driver to a CONNECTED state, at
-  which point it binds an irq to the event channel and calls
-  xlvbd_init to initialise the individual block devices.
-
-The frontend Linux is stall spin waiting at this point, until all of
-the disks have been probed.  Messaging now is directly between the
-front and backend domain using the new shared ring and event channel.
-
-(9) The frontend sends a BLKIF_OP_PROBE directly to the backend.
-
-  This message includes a reference to an additional page, that the
-  backend can use for it's reply.  The backend responds with an array
-  of the domains disks (as vdisk_t structs) on the provided page.
-
-The frontend now initialises each disk, calling xlvbd_init_device()
-for each one.
diff -r 4ecd3615e726 -r f88c745575bb docs/misc/cpuid-config-for-guest.txt
--- a/docs/misc/cpuid-config-for-guest.txt	Tue Nov 22 17:24:51 2011 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-CPUID emulation for guest
--------------------------
-
-When HVM guest tries to execute CPUID, or PV guest tries to execute XEN_CPUID,
-the xen hypervior traps and emultes them.
-
-For HVM guest and PV DomU guest, xen's CPUID emulation can be adjusted using
-the guest configation file if necessary (e.g., to supply better support for
-guest live migration). The CPUID syntax in guest configration file is
-described in detail in the examples like /etc/xen/xmexample.hvm,
-/etc/xen/xmexample.hvm-stubdom.
-
-However, a user (or an administrator) must be aware that the CPUID in guest
-configuration file can NOT be configured casually. The default CPUID
-configuration should be safe, but illegal configuration can cause unexpected
-behaviors of guest -- even can crash guest.
-
-For example, we should not expose the MONITOR CPUID feature flag (ECX bit 3;
-CPUID executed EAX = 1) to HVM guest, otherwise, on guest's attempt of
-executing MWAIT, the VMExit handler in Xen would inject #UD (Invalid Opcode
-Exception) into the HVM guest, and guest kernel would panic.
-
-/* We can add more unsafe CPUID configuration here in future. */
diff -r 4ecd3615e726 -r f88c745575bb docs/misc/hg-cheatsheet.txt
--- a/docs/misc/hg-cheatsheet.txt	Tue Nov 22 17:24:51 2011 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,438 +0,0 @@
-
-Mercurial(hg) Cheatsheet for Xen
-================================
-
-Written by Andrew Warfield, extended by Michael Fetterman and Ian Pratt
-June 29, 2005, extended by Grzegorz Milos 04 July 2005.
-
-Overview
---------
-The Xen project has moved from BitKeeper to Mercurial for source
-control.  This note aims to provide a quick guide to getting up and
-running with the new tools as quickly as possible, and is written from
-the perspective of someone who has been using BK.
-
-For a more detailed exposition, see the mercurial tutorial:
- http://www.serpentine.com/mercurial/index.cgi?Tutorial
-
-The Hg manpage is available at:
- http://www.selenic.com/mercurial/hg.1.html
-
-There's also a very useful FAQ that explains the terminology:
- http://www.selenic.com/mercurial/FAQ.html
-
-There's also a good README:
- http://www.selenic.com/mercurial/README
-
-Necessary software
-------------------
-Mercurial is available at:
-  http://www.selenic.com/mercurial/ 
-
-You will also need a Python version >= 2.3
-
-How Mercurial is different from BK
-----------------------------------
-There are several pertinent differences between hg and bk.  This
-section aims to give an overview of the conceptual differences between
-the two SCMs -- if you just want examples to get going, skip ahead to
-"Getting Xen". The key differences are:
-
-  - No explicit per-file locking.  You do not need to explicitly 
-    check a file out before editing it.
-  - No notion (currently) of file renames.
-  - A repository can have multiple active heads.
-  - Automatic merge support is currently inferior to BK's.
-  - No graphical tools.
-  - No per-file revision history, only per-changeset (we never really used this anyhow)
-  - Hg repositories tend to be rather bigger than Bk ones, but Hg does seem faster.
-
-Mercurial is based on the notion of changesets as complete, immutable,
-versions of the repository.  You make changes to a working version of
-the repository that is based on a particular changeset.  When you
-commit, you will generate a new child changeset with whatever changes
-you choose to apply.
-
-A major difference between Hg and BK is that you aren't forced to
-resolve conflicts immediately: BK forced you to resolve conflicts
-immediately on any merge, and it then immediately created a changeset
-with those conflicts' resolutions.  Frequently, you then had to add
-yet another changeset to fixup the things for which the automatic
-merge yielded bad results. Hg puts the results of the merge into your
-work directory, and remembers what you merged with (so that it can
-later record both of the merge parents, if you decide to make a
-changeset), but it doesn't immediately create a changeset.
-
-A further feature of Hg is that it allows a repository to have
-multiple heads. This means that you can have changesets with no common
-descendent in one repository -- something BK won't allow. This is
-actually pretty neat. For example, it would in principle enable you to
-have both the 2.0-testing and unstable trees in a single
-repository. We shyed away from doing this as we thought the risk of
-committing to the wrong head was too great.
-
-One slightly confusing aspect of Hg is that many of the commands have
-aliases, and hence when looking things up in the man page its not
-always obvious what the underlying command is. For example 'co' is
-actually an alias for the 'update' command, but 'co' seems to make
-more sense, at least to RCS refugees like me.
-
-
-Getting Xen
------------
-
-The URL for the mainline Xen mercurial repository is:
-
-   http://xenbits.xensource.com/xen-unstable.hg
-   (similarly for xen-2.0 and xen-2.0-testing)
-
-You can point a browser and this and use Hg's web interface to view
-revision history, or use it as the nominated source when issuing
-"hg init" or "hg pull" commands. 
-
-However, to avoid taxing the Mercurial server with a complete pull of
-the Xen repository, it is best to download a tarball of a seed
-repository from:
- 
-  http://www.cl.cam.ac.uk/Research/SRG/netos/xen/downloads/xen-unstable.hg.tar.gz
-
-  (or copy from /usr/groups/netos/html/xen/downloads/xen-unstable.hg.tar.gz)
-
-Untar the repository on your disk, cd into it, and then pull the most
-recent changes:
-
-  hg pull -u
-
-By default hg does not automatically checkout ('update') files from
-the repository as used to happen with bk. The above is equivalent to
-"hg pull; hg co"
-
-The repository parent is stored in a repository configuration file, 
-.hg/hgrc, from the repository root.  If you look at this file, you 
-will see:
-
-  |  [paths]
-  |  default = http://xenbits.xensource.com/xen-unstable.hg
-
-"default" specifies the appropriate parent repository for hg to pull 
-from.  Hg allows you to pull additional repositories, for instance if 
-you want to work between unstable and testing concurrently.
-
-The command "hg pull" simply adds changesets to your repository,
-without any merging of any kind.  "hg pull -u" implies merging with
-the current state of your working directory.  If you weren't already
-"updated" to your local repository's tip, you might be surprised to
-find yourself merging the results of the pull with a non-tip node in
-your local repository. 
-
-
-Revision History
-----------------
-
-You can view the repository revision history with:
-
-   hg history
-
-In practice, you'll probably want to use pipe the output through
-'head' or 'more' as it prints the entire history.
-
-Looking at the first few lines of output, you can see the changeset at
-the head of the current branch, known as the 'tip' (the tip is
-automatically given a special tag to make it easy to refer to):
-
-   | changeset:   5599:6cbf9ec05cd9e05c0c46a85df7fc00262633cd3d
-   | tag:         tip
-   | user:        kaf24@firebug.cl.cam.ac.uk
-   | date:        Tue Jun 28 18:47:14 2005
-   | summary:     bitkeeper revision 1.1768 (42c18d2259NPELcGV7ohyZNh72ufSw)
-
-By default, Hg just shows the first line of the changset comments. You
-can find further information with "hg -v history".
-
-The changeset identifier has two parts, a _local_ monotonically
-increasing changeset id, 5599 above, and a _global_ hash, which
-follows the colon on the changeset line.  The hash uniquely identifies
-the changeset and its lineage back to the root of the changeset tree
--- it is useful for distributed management and so on.  However, as it
-is a bit unruly, the local id will allow you to work easily with the
-local repo. Hg commands will take either identifier. Additionally, a
-tags mechanism lets you give common names to specific changesets.
-
-You should always use the global hash when referring to versions of
-the mainline Xen respoitory. With Bk you could often get away with
-using the shortform version, but with Hg the local ids are pretty much
-guaranteed to be different.
-
-
-Creating a child repository from an existing repository
--------------------------------------------------------
-If you wanted to create additional local child repositories,
-
-   hg init [path or url]
-
-is effectively equivalent to bk clone.  The major difference is that 
-it should be run from the root of your new repository.  So:
-
-   bk clone /foo/bar
-
-would be replaced with:
-
-   mkdir bar
-   cd bar
-   hg init /foo/bar
-
-NB: newer version of Hg support a 'clone' command that works in the
-same manner as bk.
-
-Editing files
--------------
-
-Normal edits may be made in place.  File creation needs explicit
-marking, though deletes should be picked up automatically
-
-creation:
-
-   touch a.txt (or otherwise created a file)
-   hg add a.txt
-
-You can see what has changed using:
-
-   hg status
-
-   | C foo/foo.c
-   | R foo/bar.c
-   | ? a.txt
-
-This shows that in the current repo, foo.c has been changed, bar.c has
-been deleted, and a.txt is new, but has not been added.  '?' changes
-to 'A' after "hg add a.txt". There is a .hgignore file which contains
-regexps of files that should be ignored when scanning for new
-files. We try to ensure that all the generated files in a build are
-covered by the regexps.
-
-You can add all the new files in a repository with "hg addremove". If
-you discover that you've added a file you didn't want, you can remove
-it from the list of files to be included in the next commit using
-"hg forget".
-
-Committing changes
------------------
-
-After you've checked that hg knows about any new files you've created,
-you probably want to see a diff of what you're about to commit. You
-can do this with:
-   
-   hg diff
-
-Once you're happy with what you have, invoke:
-
-   hg commit
-
-This will pop up an editor with a list of files to be committed to the
-repository.  It will look vaguely like this:
-
-   | 
-   | HG: manifest hash 6397b04bd5c2a992482d973b685a7e5e498788e7
-   | HG: changed doc/thesis/new.tex
-   | HG: removed doc/2005-hotdep-protection/paper.tex
-
-Your comments can go anywhere in this file.  The first line is the 
-most important, as it will show as the changeset description in 
-non-verbose-mode history listings.
-
-You can do commits without the editor and of partial sets of files 
-using command-line switches. See:
-
-   hg help commit
-
-You can use the -A (--addremove) flag to commit e.g. "hg -A commit" to
-ask mercurial to scan the tree looking for newly created files to add
-in to the changeset. This avoids having to explicitly use "hg add",
-but you probably want to be careful of adding any new generated files
-too.
-
-
-Generating a patch
-------------------
-Generating a patch is easy,
-
-   hg export [changeset]
-
-will generate a patch describing the diff between that changeset and 
-its parent.
-    
-To generate a patch between two specified revisions use:
-   hg diff -r A -r B [files]
-NB: BK syntax -rA..B isn't supported by Hg.   
-
-
-Pushing changesets to a parent repository
------------------------------------------
-
-   hg push
-
-Pushes changes up to a parent. You can't push if you pulled the
-repository off the web interface. In fact, you can currently only push
-to an ssh target -- filesystem directory targets don't work, but this
-will be fixed soon.
-For now it is possible to set up asymmetric pull/push paths. Pulls can
-be done via web interface while pushes via ssh. Example of .hg/hgrc config
-file:
-  | [paths]
-  | default = http://your.server/repository_name
-  | default-push = ssh://[username@]your.server//repository_location
-
-
-Repository history
-------------------
-
-Here are a collection of common commands to get you started:
-
-   hg history | less
-
-shows the history of changesets, starting from the most recent.  You 
-want to pipe it to some sort of pager.  For more complete details,
- 
-   hg -v history | less
-
-will include files modified and full (not just first-line) comments.
-
-Additionally, you can see just the tip (head of the current
-branch) of the repository by typing:
-
-   hg [-v] tip
-
-
-Moving to a specific changeset
-------------------------------
-
-The co command lets you change the working version of the repository
-to a different changeset. 
-
-   hg co [changeset]
-
-NB: 'co' is an alias for 'update'
-
-This command enables you to rewind the working repository to previous
-changesets, for example to isolate the changeset in which a bug is
-introduced.
-
-If you try and do a 'co' but have modified files in your repository Hg
-won't let you unless you ask it explicitly to merge the checked out
-version into the current tree using the "-m" option. The "-C"
-(--clean) option will force overwrite any locally modified files.
-
-Any commits that are made to non-head changesets will obviously fork
-the tree, creating a new head. You can see all the heads in a tree with
-"hg heads".
-
-In general, "hg co" does the right thing, although it doesn't
-currently seem to clean up unused directories that have been created
-by other checked-out versions. This can confuse the Xen build
-system. Hg will probably get fixed soon, but in the meantime you can
-cleanup with "find -depth -type d -print | xargs -r rmdir".
-
-You can return to the tip by omitting an explicit changeset id.
-   
-The manifest command lets you see the contents of the repository for 
-the current changeset.
-
-   hg manifest
-
-This will print a bunch of records of the form: 
-
-   | 98856c45c35a504bc6da06a62b7787ddfdfd1c8b 644 COPYING
-   | f28971eedc5b54e7a9b26dd18d52992955354981 644 Config.mk
-   | a3575cc4db59e50bbac8a039a0c74f081a8dfc4f 644 Makefile
-   | 7fc869aae2945a9f4626fad96552db3103e61cb9 644 README
-   | ...
-
-This lists the hash of each file, its 1-bit 'executable' attribute
-(either file permission mode 644 or 755), and the file name.  So, to
-determine the files that change across two changesets, you would dump
-the respective manifests to files, and use diff.
-
-
-Managing changeset tags
------------------------
-To create a tag to the current changeset:
-
-   hg tag tagname
-
-This will _immediately_ generate a changeset with a change to the file
-.hgtags in the repository root.   The new tag in this file will look
-something like:
-
-   | 35159ed4b30538e7a52c60ad0a63f7e9af156e4c tagname
-
-and may be used to identify that changeset throughout the repo.
-Storing tags in this file and generating changesets immediately 
-forces people to merge and keep tags up to date across the repository.
-
-Note that tags are resolved by searching .hgtags in each of the 
-repository heads, sequentially, and using the first match.  "hg heads"
-lists the current heads.
-
-The "hg tags" command, will lists all the currently valid tags.
-
-
-Hg server and source browser
-----------------------------
-
-   hg serve -p port
-
-Launches a web server on the specified port, serving a source browser 
-for the repository.  This browser may be used to examine the 
-changeset history, view annotated source files, generate diffs.  
-Additionally "hg pull" may be run against it.
-
-Additional useful commands
-(that probably only need one-line descriptions)
------------------------------------------------
-
-(Slightly) more detail on all of these is available with
-
-  hg help [command]
-
-Shows the differences between whatever changeset you most recently
-checked out, and your current working directory:
-
-   hg diff 
-
-View an annotated version of a source file:
-
-   hg annotate
-
-Get a historical version of a file:
-
-   hg cat
-
- NB: Most commands accepting a version number want the changeset's
- version number.  "hg cat" is different in that it wants the
- *file*'s version number.
-
-Unadd a file to the current commit:
-
-   hg forget
-
-List all heads in the current repository:
-
-   hg heads
-
-Undo exactly one (and ONLY one) changeset:
-
-   hg undo
-
-Show the parents of a changeset:
-
-   hg parents
-
- NB: Changesets have either one or two parent changesets. If your
- working directory contains the uncommitted results of a merge, then
- you have two parents.  Otherwise, the single parent is the changeset
- which you most recently checked out.
-
-Show the revision history for a single file
-
-   hg [-v] log <filename>
-
diff -r 4ecd3615e726 -r f88c745575bb docs/misc/network_setup.txt
--- a/docs/misc/network_setup.txt	Tue Nov 22 17:24:51 2011 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,196 +0,0 @@
-Native OS bridge configuration
-==============================
-
-The traditional "network-bridge" script attempts to modify existing active
-network interfaces to enable bridging. For non-trivial network configurations
-though this can be error prone, and the temporary disruption to network
-connectivity can upset some applications.  This document outlines how to
-configure bridging using an OS' native network configuration files.
-
-Disabling Xen's network scripts
--------------------------------
-
-The first step is to check XenD's network bridge is disabled by
-editing /etc/xen/xend-config.sxp and changing the line
-
- (network-script network-bridge)
-
-To be
-
- (network-script /bin/true)
-
-
-Fedora/RHEL Bridging
-====================
-
-This outlines how to setup bridging using standard network initscripts
-present in Fedora or RHEL distros and their derivatives
-
-
-Disabling NetworkManager
-------------------------
-
-As of time of writing (Fedora 14) NetworkManager does not support bridging,
-so it is neccessary to disable NetworkManager, and revert to "classic"
-network initscripts
-
- # chkconfig NetworkManager off
- # chkconfig network on
- # service NetworkManager stop
- # service network start
-
-NB, as an alternative to turning off NetworkManager, you can also add a line
-"NM_CONTROLLED=no" to the ifcfg-XXX scripts below
-
-Creating network initscripts
-----------------------------
-
-In the /etc/sysconfig/network-scripts directory it is necccessary to create
-2 config files. The first (ifcfg-eth0) defines your physical network interface,
-and says that it will be part of a bridge:
-
-# cat > ifcfg-eth0 <<EOF
-DEVICE=eth0
-HWADDR=00:16:76:D6:C9:45
-ONBOOT=yes
-BRIDGE=br0
-EOF
-
-Obviously change the HWADDR to match your actual NIC's address. You may also
-wish to configure the device's MTU here using e.g. MTU=9000.
-
-The second config file (ifcfg-br0) defines the bridge device:
-
-# cat > ifcfg-br0 <<EOF
-DEVICE=br0
-TYPE=Bridge
-BOOTPROTO=dhcp
-ONBOOT=yes
-DELAY=0
-EOF
-
-WARNING: The line TYPE=Bridge is case-sensitive - it must have uppercase
-'B' and lower case 'ridge'
-
-After changing this restart networking (or better still reboot)
-
- # service network restart
-
-
-The final step is to configure iptables to allow all traffic to be
-forwarded across the bridge
-
-# echo "-I FORWARD -m physdev --physdev-is-bridged -j ACCEPT" > /etc/sysconfig/iptables-forward-bridged
-# lokkit --custom-rules=ipv4:filter:/etc/sysconfig/iptables-forward-bridged
-# service libvirtd reload
-
-Alternatively, you can prevent bridged traffic getting pushed through
-the host's iptables rules completely. In /etc/sysctl.conf add
-
- # cat >> /etc/sysctl.conf <<EOF
- net.bridge.bridge-nf-call-ip6tables = 0
- net.bridge.bridge-nf-call-iptables = 0
- net.bridge.bridge-nf-call-arptables = 0
- EOF
- # sysctl -p /etc/sysctl.conf
-
-You should now have a "shared physical device", to which guests can be
-attached and have full LAN access
-
- # brctl show
- bridge name     bridge id               STP enabled     interfaces
- br0             8000.000e0cb30550       no              eth0
-
-
-
-Debian/Ubuntu Bridging
-=======================
-
-This outlines how to setup bridging using standard network interface config files
-on Debian / Ubuntu distributions and their derivatives
-
-Disabling NetworkManager
-------------------------
-
-Stop network manager
-
- sudo /etc/dbus-1/event.d/26NetworkManagerDispatcher stop
- sudo /etc/dbus-1/event.d/25NetworkManager stop
-
-Create two files with only the word 'exit' in them. These files are:
-
- /etc/default/NetworkManager
- /etc/default/NetworkManagerDispatcher
-
-
-Altering the interface config
------------------------------
-
-First take down the interface you wish to bridge
-
- ifdown eth0
-
-Edit /etc/network/interfaces and find the config for the physical
-interface, which looks something like
-
- allow-hotplug eth0
- iface eth0 inet static
-        address 192.168.2.4
-        netmask 255.255.255.0
-        network 192.168.2.0
-        broadcast 192.168.2.255
-        gateway 192.168.2.2
-
-Remove the 'allow-hotplug eth0' line, replacing it with 'auto br0',
-and change the next line with iface name to 'br0', so it now starts
-with
-
- auto br0
- iface br0 inet static
-
-And then define the interface as being a bridge and specify its ports
-
-       bridge_ports eth0
-       bridge_stp off
-       bridge_maxwait 5
-
-The complete config should now look like
-
- auto br0
- iface br0 inet static
-         address 192.168.2.4
-         netmask 255.255.255.0
-         network 192.168.2.0
-         broadcast 192.168.2.255
-         gateway 192.168.2.2
-         bridge_ports eth0
-         bridge_stp off
-         bridge_maxwait 5
-
-The interface can now be started with
-
- ifup br0
-
-Finally add the '/etc/sysctl.conf' settings
-
-net.bridge.bridge-nf-call-ip6tables = 0
-net.bridge.bridge-nf-call-iptables = 0
-net.bridge.bridge-nf-call-arptables = 0
-
-And then load the settings with
-
- sysctl -p /etc/sysctl.conf
-
-
-You should now have a "shared physical device", to which guests
-can be attached and have full LAN access
-
- # brctl show
- bridge name     bridge id               STP enabled     interfaces
- br0             8000.000e0cb30550       no              eth0
-
-
-Other operating systems / distributions
-=======================================
-
-[...send patches to this file with instructions....]

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:32 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhY-00006C-6N; Mon, 28 Nov 2011 23:33:32 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhV-0008LD-Je
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:30 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-216.messagelabs.com!1322523169!5375515!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
	MAILTO_TO_SPAM_ADDR
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20328 invoked from network); 28 Nov 2011 23:32:50 -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;
	28 Nov 2011 23:32:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnI-0001il-2M
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhH-0000nl-1i
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:15 +0000
Message-Id: <E1RVAhH-0000nl-1i@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: remove some fatally out of
	date documentation
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1321987873 0
# Node ID f88c745575bb738e7c217d9dffed37dc894e7a1c
# Parent  4ecd3615e7267c1b1ff760a9b6714d517e76e6a9
docs: remove some fatally out of date documentation

I think these are better off deleted than remaining to confuse people.

docs/misc/blkif-drivers-explained.txt:

 - Talks about Xen 2.0 beta, talks about the old pre-xenstored IPC mechanism.

docs/misc/cpuid-config-for-guest.txt:

 - Doesn't really say anything, in particular doesn't actually describe how to
   configure CPUID.

docs/misc/hg-cheatsheet.txt:

 - Not out of date per-se wrt mercural but talk about Xen 2.0 and gives URLs
   under www.cl.cam.ac.uk. Talks a lot about bitkeeper. Given that mercurial is
   hardly unusual anymore I think there must be better guides out there so this
   one is not worth resurecting.

docs/misc/network_setup.txt:

 - This is more comprehensively documented on the wiki these days.

docs/misc/VMX_changes.txt:

 - Is basically a changelog from the initial implementation of VMX in 2004.

I'm not sure about some of the other docs, but these ones seemed fairly
obvious.

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


diff -r 4ecd3615e726 -r f88c745575bb docs/misc/VMX_changes.txt
--- a/docs/misc/VMX_changes.txt	Tue Nov 22 17:24:51 2011 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-Changes to Xen in support of Intel(R) Vanderpool Technology
--------------------------------------------------------------
-
-Our VT extensions to the Xen hypervisor provide full platform
-virtualization, including CPU(s), memory, and I/O infrastructure. The
-generic code in Xen handles and schedules those virtual machines as it
-does for the existing para-virtualized domains.
-
-Full virtualization required by the OS guests requires full device
-virtualization as well. The device models in BOCHS
-(http://bochs.sourceforge.net/) were decoupled from the CPU
-virtualization, and are used to virtualize the legacy devices (such as
-keyboard, mouse, VGA, IDE) in the PC platform. At this point, the
-device models run in user mode on domain 0, not in the Xen hypervisor.
-
-We would like to thank Ian Pratt and Keir Fraser for reviewing our
-design and code intensively, and for providing numerous useful
-suggestions to improve the architecture and code. 
-
-We have a list of Intel team members who take credit for making this
-release happen: Yunhong Jiang, Nitin Kamble, Chengyuan Li, Xin Li,
-Xiaofeng Ling, Benjamin Liu, Asit Mallick, Jun Nakajima, Sunil Saxena,
-Arun Sharma, Edwin Zhai, Jeff Zheng, and Louis Zhuang. We'll continue
-to add more features to complete full virtualization in Xen using VT.
-
-The notes document the changes to the Xen hypervisor in order to add
-VT support. The changes to other areas, such as Control Panel will be
-added as we deliver the code.
-
-Summary of changes for the first release
-----------------------------------------
-December 15, 2004
-
-    * VT specific event handling and domain management were added. 
-
-    * Shadow mode was extended to support full 32-bit guests
-    
-    * Domain switching code was extended to support VT domain
-    
-    * I/O request handling was added to communicate with the device model
-
-    * Domain builder was extended to provide the environment when the
-      guest enters the protected mode, including E820 memory and VGA
-      info, typically obtained by BIOS calls.
-
-New code:
----------
-    VT (Vanderpool Technology) is based on the new VMX (Virtual
-    Machine Extensions) architecture. The current release of the
-    software supports 32-bit only.
-
-    * arch/x86/vmx.[ch] and arch/x86/vmx_*.[ch]: created to handle
-      VMX-specific events in order to provide virtual machine.
-
-    * arch/x86/x86_32/entry.S: new code path was added to have the
-      first-level handler from VM exits. The first-level handler calls
-      the second-level handler in arch/x86/vmx.c.
-
-    * arch/x86/setup.c: new function start_vmx() to init_intel() to
-      enable VMX mode.
-
-    * include/asm-x86/config.h: #ifdef CONFIG_VMX was added.
-
-    * arch/x86/domain.c: new code patch was added to create a VMX
-      domain given the flag from the control panel.
-
-    * include/public/io/ioreq.h: A new data structure was added to
-      define the I/O requests between the Xen hypervisor and the
-      device models.
-
-Changes to the existing code:
------------------------------
-
-    * arch/x86/shadow.[ch]: new mode SHM_full_32 was added to support
-      full virtualization. The current Xen code assumes that the guest
-      page directory and tables have _machine_ (or host) physical page
-      frame numbers, and the new code allows to support _guest_
-      physical page frame numbers
-
-    * include/asm-x86/processor.h: struct arch_vmx_struct arch_vmx has
-      been added to the thread_struct data structure. The arch_vmx has
-      the additional VMX-related CPU context.
-
-    * arch/x86/io_apic.c: reverse mapping between vector and irq has
-      been added. We will revisit this code when considering MSI
-      support.
-
---- Jun
-
-
diff -r 4ecd3615e726 -r f88c745575bb docs/misc/blkif-drivers-explained.txt
--- a/docs/misc/blkif-drivers-explained.txt	Tue Nov 22 17:24:51 2011 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,485 +0,0 @@
-=== How the Blkif Drivers Work ===
-Andrew Warfield
-andrew.warfield@cl.cam.ac.uk
-
-The intent of this is to explain at a fairly detailed level how the
-split device drivers work in Xen 1.3 (aka 2.0beta).  The intended
-audience for this, I suppose, is anyone who intends to work with the
-existing blkif interfaces and wants something to help them get up to
-speed with the code in a hurry.  Secondly though, I hope to break out
-the general mechanisms that are used in the drivers that are likely to
-be necessary to implement other drivers interfaces.
-
-As a point of warning before starting, it is worth mentioning that I
-anticipate much of the specifics described here changing in the near
-future.  There has been talk about making the blkif protocol
-a bit more efficient than it currently is.  Keir's addition of grant
-tables will change the current remapping code that is used when shared
-pages are initially set up.
-
-Also, writing other control interface types will likely need support
-from Xend, which at the moment has a steep learning curve... this
-should be addressed in the future.
-
-For more information on the driver model as a whole, read the
-"Reconstructing I/O" technical report
-(http://www.cl.cam.ac.uk/Research/SRG/netos/papers/2004-xenngio.pdf).
-
-==== High-level structure of a split-driver interface ====
-
-Why would you want to write a split driver in the first place?  As Xen
-is a virtual machine manager and focuses on isolation as an initial
-design principle, it is generally considered unwise to share physical
-access to devices across domains.  The reasons for this are obvious:
-when device resources are shared, misbehaving code or hardware can
-result in the failure of all of the client applications.  Moreover, as
-virtual machines in Xen are entire OSs, standard device drives that
-they might use cannot have multiple instantiations for a single piece
-of hardware.  In light of all this, the general approach in Xen is to
-give a single virtual machine hardware access to a device, and where
-other VMs want to share the device, export a higher-level interface to
-facilitate that sharing.  If you don't want to share, that's fine.
-There are currently Xen users actively exploring running two
-completely isolated X-Servers on a Xen host, each with it's own video
-card, keyboard, and mouse.  In these situations, the guests need only
-be given physical access to the necessary devices and left to go on
-their own.  However, for devices such as disks and network interfaces,
-where sharing is required, the split driver approach is a good
-solution.
-
-The structure is like this:
-
-   +--------------------------+  +--------------------------+
-   | Domain 0 (privileged)    |  | Domain 1 (unprivileged)  |
-   |                          |  |                          |
-   | Xend ( Application )     |  |                          |
-   | Blkif Backend Driver     |  | Blkif Frontend Driver    |
-   | Physical Device Driver   |  |                          |
-   +--------------------------+  +--------------------------+
-   +--------------------------------------------------------+
-   |                X       E       N                       |
-   +--------------------------------------------------------+
-
-
-The Blkif driver is in two parts, which we refer to as frontend (FE)
-and a backend (BE).  Together, they serve to proxy device requests
-between the guest operating system in an unprivileged domain, and the
-physical device driver in the physical domain.  An additional benefit
-to this approach is that the FE driver can provide a single interface
-for a whole class of physical devices.  The blkif interface mounts
-IDE, SCSI, and our own VBD-structured disks, independent of the
-physical driver underneath.  Moreover, supporting additional OSs only
-requires that a new FE driver be written to connect to the existing
-backend.
-
-==== Inter-Domain Communication Mechanisms ====
-
-===== Event Channels =====
-
-Before getting into the specifics of the block interface driver, it is
-worth discussing the mechanisms that are used to communicate between
-domains.  Two mechanisms are used to allow the construction of
-high-performance drivers: event channels and shared-memory rings.
-
-Event channels are an asynchronous interdomain notification
-mechanism.  Xen allows channels to be instantiated between two
-domains, and domains can request that a virtual irq be attached to
-notifications on a given channel.  The result of this is that the
-frontend domain can send a notification on an event channel, resulting
-in an interrupt entry into the backend at a later time.
-
-The event channel between two domains is instantiated in the Xend code
-during driver startup (described later).  Xend's channel.py
-(tools/python/xen/xend/server/channel.py) defines the function
-
-
-def eventChannel(dom1, dom2):
-    return xc.evtchn_bind_interdomain(dom1=dom1, dom2=dom2)
-
-
-which maps to xc_evtchn_bind_interdomain() in tools/libxc/xc_evtchn.c,
-which in turn generates a hypercall to Xen to patch the event channel
-between the domains.  Only a privileged domain can request the
-creation of an event channel.
-
-Once the event channel is created in Xend, its ends are passed to both the
-front and backend domains over the control channel.  The end that is
-passed to a domain is just an integer "port" uniquely identifying the
-event channel's local connection to that domain.  An example of this
-setup code is in linux-2.6.x/drivers/xen/blkfront/blkfront.c in
-blkif_connect(), which receives several status change events as
-the driver starts up.  It is passed an event channel end in a
-BLKIF_INTERFACE_STATUS_CONNECTED message, and patches it in like this:
-
-
-   blkif_evtchn = status->evtchn;
-   blkif_irq    = bind_evtchn_to_irq(blkif_evtchn);
-   if ( (rc = request_irq(blkif_irq, blkif_int, 
-                          SA_SAMPLE_RANDOM, "blkif", NULL)) )
-       printk(KERN_ALERT"blkfront request_irq failed (%ld)\n",rc);
-
-
-This code associates a virtual irq with the event channel, and
-attaches the function blkif_int() as an interrupt handler for that
-irq.  blkif_int() simply handles the notification and returns, it does
-not need to interact with the channel at all.
-
-An example of generating a notification can also be seen in blkfront.c:
-
-
-static inline void flush_requests(void)
-{
-    DISABLE_SCATTERGATHER();
-    wmb(); /* Ensure that the frontend can see the requests. */
-    blk_ring->req_prod = req_prod;
-    notify_via_evtchn(blkif_evtchn);
-}
-}}}
-
-notify_via_evtchn() issues a hypercall to set the event waiting flag on
-the other domain's end of the channel.
-
-===== Communication Rings =====
-
-Event channels are strictly a notification mechanism between domains.
-To move large chunks of data back and forth, Xen allows domains to
-share pages of memory.  We use communication rings as a means of
-managing access to a shared memory page for message passing between
-domains.  These rings are not explicitly a mechanism of Xen, which is
-only concerned with the actual sharing of the page and not how it is
-used, they are however worth discussing as they are used in many
-places in the current code and are a useful model for communicating
-across a shared page.
-
-A shared page is set up by a front end guest first allocating and passing 
-the address of a page in its own address space to the backend driver.  
-
-Consider the following code, also from blkfront.c.  Note:  this code
-is in blkif_disconnect().  The driver transitions from STATE_CLOSED
-to STATE_DISCONNECTED before becoming CONNECTED.  The state automata
-is in blkif_status().
-
-   blk_ring = (blkif_ring_t *)__get_free_page(GFP_KERNEL);
-   blk_ring->req_prod = blk_ring->resp_prod = resp_cons = req_prod = 0;
-   ...
-   /* Construct an interface-CONNECT message for the domain controller. */
-   cmsg.type      = CMSG_BLKIF_FE;
-   cmsg.subtype   = CMSG_BLKIF_FE_INTERFACE_CONNECT;
-   cmsg.length    = sizeof(blkif_fe_interface_connect_t);
-   up.handle      = 0;
-   up.shmem_frame = virt_to_machine(blk_ring) >> PAGE_SHIFT;
-   memcpy(cmsg.msg, &up, sizeof(up));  
-
-
-blk_ring will be the shared page.  The producer and consumer pointers
-are then initialised (these will be discussed soon), and then the
-machine address of the page is send to the backend via a control
-channel to Xend.  This control channel itself uses the notification
-and shared memory mechanisms described here, but is set up for each
-domain automatically at startup.
-
-The backend, which is a privileged domain then takes the page address
-and maps it into its own address space (in
-linux26/drivers/xen/blkback/interface.c:blkif_connect()):
-
-
-void blkif_connect(blkif_be_connect_t *connect)
-
-   ...
-   unsigned long shmem_frame = connect->shmem_frame;
-   ...
-
-   if ( (vma = get_vm_area(PAGE_SIZE, VM_IOREMAP)) == NULL )
-   {
-      connect->status = BLKIF_BE_STATUS_OUT_OF_MEMORY;
-      return;
-   }
-
-   prot = __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED);
-   error = direct_remap_area_pages(&init_mm, VMALLOC_VMADDR(vma->addr),
-                                   shmem_frame<<PAGE_SHIFT, PAGE_SIZE,
-                                   prot, domid);
-
-   ...
-
-   blkif->blk_ring_base = (blkif_ring_t *)vma->addr
-}}}
-
-The machine address of the page is passed in the shmem_frame field of
-the connect message.  This is then mapped into the virtual address
-space of the backend domain, and saved in the blkif structure
-representing this particular backend connection.
-
-NOTE:  New mechanisms will be added very shortly to allow domains to
-explicitly grant access to their pages to other domains.  This "grant
-table" support is in the process of being added to the tree, and will
-change the way a shared page is set up.  In particular, it will remove
-the need of the remapping domain to be privileged.
-
-Sending data across shared rings:
-
-Shared rings avoid the potential for write interference between
-domains in a very cunning way.  A ring is partitioned into a request
-and a response region, and domains only work within their own space.
-This can be thought of as a double producer-consumer ring -- the ring
-is described by four pointers into a circular buffer of fixed-size
-records.  Pointers may only advance, and may not pass one another.
-
-
-                         resp_cons----+
-                                      V
-           +----+----+----+----+----+----+----+
-           |    |    |  free(A)     |RSP1|RSP2|
-           +----+----+----+----+----+----+----+
- req_prod->|    |       -------->        |RSP3|
-           +----+                        +----+
-           |REQ8|                        |    |<-resp_prod
-           +----+                        +----+
-           |REQ7|                        |    |
-           +----+                        +----+
-           |REQ6|       <--------        |    |
-           +----+----+----+----+----+----+----+
-           |REQ5|REQ4|    free(B)   |    |    |
-           +----+----+----+----+----+----+----+
-  req_cons---------^
-
-
-
-By adopting the convention that every request will receive a response,
-not all four pointers need be shared and flow control on the ring
-becomes very easy to manage.  Each domain manages its own
-consumer pointer, and the two producer pointers are visible to both
-(xen/include/public/io/blkif.h):
-
-
-/* NB. Ring size must be small enough for sizeof(blkif_ring_t) <=PAGE_SIZE.*/
-  #define BLKIF_RING_SIZE        64
-
-  ...
-
-/*
- * We use a special capitalised type name because it is _essential_ that all
- * arithmetic on indexes is done on an integer type of the correct size.
- */
-typedef u32 BLKIF_RING_IDX;
-
-/*
- * Ring indexes are 'free running'. That is, they are not stored modulo the
- * size of the ring buffer. The following macro converts a free-running counter
- * into a value that can directly index a ring-buffer array.
- */
-#define MASK_BLKIF_IDX(_i) ((_i)&(BLKIF_RING_SIZE-1))
-
-typedef struct {
-    BLKIF_RING_IDX req_prod;  /*  0: Request producer. Updated by front-end. */
-    BLKIF_RING_IDX resp_prod; /*  4: Response producer. Updated by back-end. */
-    union {                   /*  8 */
-        blkif_request_t  req;
-        blkif_response_t resp;
-    } PACKED ring[BLKIF_RING_SIZE];
-} PACKED blkif_ring_t;
-
-
-
-As shown in the diagram above, the rules for using a shared memory
-ring are simple.  
-
- 1. A ring is full when a domain's producer and consumer pointers are
-    equal (e.g. req_prod == resp_cons).  In this situation, the
-    consumer pointer must be advanced.  Furthermore, if the consumer
-    pointer is equal to the other domain's producer pointer,
-    (e.g. resp_cons = resp_prod), then the other domain has all the
-    buffers.
-
-2. Producer pointers point to the next buffer that will be written to.
-   (So blk_ring[MASK_BLKIF_IDX(req_prod)] should not be consumed.)
-
-3. Consumer pointers point to a valid message, so long as they are not
-   equal to the associated producer pointer.
-
-4. A domain should only ever write to the message pointed
-   to by its producer index, and read from the message at it's
-   consumer.  More generally, the domain may be thought of to have
-   exclusive access to the messages between its consumer and producer,
-   and should absolutely not read or write outside this region.
-
-   Thus the front end has exclusive access to the free(A) region 
-   in the figure above, and the back end driver has exclusive
-   access to the free(B) region.
-
-In general, drivers keep a private copy of their producer pointer and
-then set the shared version when they are ready for the other end to
-process a set of messages.  Additionally, it is worth paying attention
-to the use of memory barriers (rmb/wmb) in the code, to ensure that
-rings that are shared across processors behave as expected.
-
-==== Structure of the Blkif Drivers ====
-
-Now that the communications primitives have been discussed, I'll
-quickly cover the general structure of the blkif driver.  This is
-intended to give a high-level idea of what is going on, in an effort
-to make reading the code a more approachable task.
-
-There are three key software components that are involved in the blkif
-drivers (not counting Xen itself).  The frontend and backend driver,
-and Xend, which coordinates their initial connection.  Xend may also
-be involved in control-channel signalling in some cases after startup,
-for instance to manage reconnection if the backend is restarted.
-
-===== Frontend Driver Structure =====
-
-The frontend domain uses a single event channel and a shared memory
-ring to trade control messages with the backend.  These are both setup
-during domain startup, which will be discussed shortly.  The shared
-memory ring is called blkif_ring, and the private ring indexes are
-resp_cons, and req_prod.  The ring is protected by blkif_io_lock.
-Additionally, the frontend keeps a list of outstanding requests in
-rec_ring[].  These are uniquely identified by a guest-local id number,
-which is associated with each request sent to the backend, and
-returned with the matching responses.  Information about the actual
-disks are stored in major_info[], of which only the first nr_vbds
-entries are valid.  Finally, the global 'recovery' indicates that the
-connection between the backend and frontend drivers has been broken
-(possibly due to a backend driver crash) and that the frontend is in
-recovery mode, in which case it will attempt to reconnect and reissue
-outstanding requests.
-
-The frontend driver is single-threaded and after setup is entered only
-through three points:  (1) read/write requests from the XenLinux guest
-that it is a part of, (2) interrupts from the backend driver on its
-event channel (blkif_int()), and (3) control messages from Xend
-(blkif_ctrlif_rx).
-
-===== Backend Driver Structure =====
-
-The backend driver is slightly more complex as it must manage any
-number of concurrent frontend connections.  For each domain it
-manages, the backend driver maintains a blkif structure, which
-describes all the connection and disk information associated with that
-particular domain.  This structure is associated with the interrupt
-registration, and allows the backend driver to have immediate context
-when it takes a notification from some domain.
-
-All of the blkif structures are stored in a hash table (blkif_hash),
-which is indexed by a hash of the domain id, and a "handle", really a
-per-domain blkif identifier, in case it wants to have multiple connections.
-
-The per-connection blkif structure is of type blkif_t.  It contains
-all of the communication details (event channel, irq, shared memory
-ring and indexes), and blk_ring_lock, which is the backend mutex on
-the shared ring.  The structure also contains vbd_rb, which is a
-red-black tree, containing an entry for each device/partition that is
-assigned to that domain.  This structure is filled by xend passing
-disk information to the backend at startup, and is protected by
-vbd_lock.  Finally, the blkif struct contains a status field, which
-describes the state of the connection.
-
-The backend driver spawns a kernel thread at startup
-(blkio_schedule()), which handles requests to and from the actual disk
-device drivers.  This scheduler thread maintains a list of blkif
-structures that have pending requests, and services them round-robin
-with a maximum per-round request limit.  blkifs are added to the list
-in the interrupt handler (blkif_be_int()) using
-add_to_blkdev_list_tail(), and removed in the scheduler loop after
-calling do_block_io_op(), which processes a batch of requests.  The
-scheduler thread is explicitly activated at several points in the code
-using maybe_trigger_blkio_schedule().
-
-Pending requests between the backend driver and the physical device
-drivers use another ring, pending_ring.  Requests are placed in this
-ring in the scheduler thread and issued to the device.  A completion
-callback, end_block_io_op, indicates that requests have been serviced
-and generates a response on the appropriate blkif ring.  pending
-reqs[] stores a list of outstanding requests with the physical drivers.
-
-So, control entries to the backend are (1) the blkio scheduler thread,
-which sends requests to the real device drivers, (2) end_block_io_op,
-which is called as serviced requests complete, (3) blkif_be_int()
-handles notifications from the frontend drivers in other domains, and
-(4) blkif_ctrlif_rx() handles control messages from xend.
-
-==== Driver Startup ====
-
-Prior to starting a new guest using the frontend driver, the backend
-will have been started in a privileged domain.  The backend
-initialisation code initialises all of its data structures, such as
-the blkif hash table, and starts the scheduler thread as a kernel
-thread. It then sends a driver status up message to let xend know it
-is ready to take frontend connections.
-
-When a new domain that uses the blkif frontend driver is started,
-there are a series of interactions between it, xend, and the specified
-backend driver.  These interactions are as follows:
-
-The domain configuration given to xend will specify the backend domain
-and disks that the new guest is to use.  Prior to actually running the
-domain, xend and the backend driver interact to setup the initial
-blkif record in the backend.
-
-(1) Xend sends a BLKIF_BE_CREATE message to backend.
-
-  Backend does blkif_create(), having been passed FE domid and handle.
-  It creates and initialises a new blkif struct, and puts it in the
-  hash table.
-  It then returns a STATUS_OK response to xend.
-
-(2) Xend sends a BLKIF_BE_VBD_CREATE message to the backend.
- 
-  Backend adds a vbd entry in the red-black tree for the
-  specified (dom, handle) blkif entry.
-  Sends a STATUS_OK response.
-
-(3) Xend sends a BLKIF_BE_VBD_GROW message to the backend.
-
-  Backend takes the physical device information passed in the 
-  message and assigns them to the newly created vbd struct.
-
-(2) and (3) repeat as any additional devices are added to the domain.
-
-At this point, the backend has enough state to allow the frontend
-domain to start.  The domain is run, and eventually gets to the
-frontend driver initialisation code.  After setting up the frontend
-data structures, this code continues the communications with xend and
-the backend to negotiate a connection:
-
-(4) Frontend sends Xend a BLKIF_FE_DRIVER_STATUS_CHANGED message.
-
-  This message tells xend that the driver is up.  The init function
-  now spin-waits until driver setup is complete in order to prevent
-  Linux from attempting to boot before the disks are connected.
-
-(5) Xend sends the frontend an INTERFACE_STATUS_CHANGED message
-
-  This message specifies that the interface is now disconnected
-  (instead of closed).
-  The domain updates it's state, and allocates the shared blk_ring
-  page.  Next, 
-
-(6) Frontend sends Xend a BLKIF_INTERFACE_CONNECT message
-
-  This message specifies the domain and handle, and includes the
-  address of the newly created page.
-
-(7) Xend sends the backend a BLKIF_BE_CONNECT message
-
-  The backend fills in the blkif connection information, maps the
-  shared page, and binds an irq to the event channel.
-  
-(8) Xend sends the frontend an INTERFACE_STATUS_CHANGED message
-
-  This message takes the frontend driver to a CONNECTED state, at
-  which point it binds an irq to the event channel and calls
-  xlvbd_init to initialise the individual block devices.
-
-The frontend Linux is stall spin waiting at this point, until all of
-the disks have been probed.  Messaging now is directly between the
-front and backend domain using the new shared ring and event channel.
-
-(9) The frontend sends a BLKIF_OP_PROBE directly to the backend.
-
-  This message includes a reference to an additional page, that the
-  backend can use for it's reply.  The backend responds with an array
-  of the domains disks (as vdisk_t structs) on the provided page.
-
-The frontend now initialises each disk, calling xlvbd_init_device()
-for each one.
diff -r 4ecd3615e726 -r f88c745575bb docs/misc/cpuid-config-for-guest.txt
--- a/docs/misc/cpuid-config-for-guest.txt	Tue Nov 22 17:24:51 2011 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-CPUID emulation for guest
--------------------------
-
-When HVM guest tries to execute CPUID, or PV guest tries to execute XEN_CPUID,
-the xen hypervior traps and emultes them.
-
-For HVM guest and PV DomU guest, xen's CPUID emulation can be adjusted using
-the guest configation file if necessary (e.g., to supply better support for
-guest live migration). The CPUID syntax in guest configration file is
-described in detail in the examples like /etc/xen/xmexample.hvm,
-/etc/xen/xmexample.hvm-stubdom.
-
-However, a user (or an administrator) must be aware that the CPUID in guest
-configuration file can NOT be configured casually. The default CPUID
-configuration should be safe, but illegal configuration can cause unexpected
-behaviors of guest -- even can crash guest.
-
-For example, we should not expose the MONITOR CPUID feature flag (ECX bit 3;
-CPUID executed EAX = 1) to HVM guest, otherwise, on guest's attempt of
-executing MWAIT, the VMExit handler in Xen would inject #UD (Invalid Opcode
-Exception) into the HVM guest, and guest kernel would panic.
-
-/* We can add more unsafe CPUID configuration here in future. */
diff -r 4ecd3615e726 -r f88c745575bb docs/misc/hg-cheatsheet.txt
--- a/docs/misc/hg-cheatsheet.txt	Tue Nov 22 17:24:51 2011 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,438 +0,0 @@
-
-Mercurial(hg) Cheatsheet for Xen
-================================
-
-Written by Andrew Warfield, extended by Michael Fetterman and Ian Pratt
-June 29, 2005, extended by Grzegorz Milos 04 July 2005.
-
-Overview
---------
-The Xen project has moved from BitKeeper to Mercurial for source
-control.  This note aims to provide a quick guide to getting up and
-running with the new tools as quickly as possible, and is written from
-the perspective of someone who has been using BK.
-
-For a more detailed exposition, see the mercurial tutorial:
- http://www.serpentine.com/mercurial/index.cgi?Tutorial
-
-The Hg manpage is available at:
- http://www.selenic.com/mercurial/hg.1.html
-
-There's also a very useful FAQ that explains the terminology:
- http://www.selenic.com/mercurial/FAQ.html
-
-There's also a good README:
- http://www.selenic.com/mercurial/README
-
-Necessary software
-------------------
-Mercurial is available at:
-  http://www.selenic.com/mercurial/ 
-
-You will also need a Python version >= 2.3
-
-How Mercurial is different from BK
-----------------------------------
-There are several pertinent differences between hg and bk.  This
-section aims to give an overview of the conceptual differences between
-the two SCMs -- if you just want examples to get going, skip ahead to
-"Getting Xen". The key differences are:
-
-  - No explicit per-file locking.  You do not need to explicitly 
-    check a file out before editing it.
-  - No notion (currently) of file renames.
-  - A repository can have multiple active heads.
-  - Automatic merge support is currently inferior to BK's.
-  - No graphical tools.
-  - No per-file revision history, only per-changeset (we never really used this anyhow)
-  - Hg repositories tend to be rather bigger than Bk ones, but Hg does seem faster.
-
-Mercurial is based on the notion of changesets as complete, immutable,
-versions of the repository.  You make changes to a working version of
-the repository that is based on a particular changeset.  When you
-commit, you will generate a new child changeset with whatever changes
-you choose to apply.
-
-A major difference between Hg and BK is that you aren't forced to
-resolve conflicts immediately: BK forced you to resolve conflicts
-immediately on any merge, and it then immediately created a changeset
-with those conflicts' resolutions.  Frequently, you then had to add
-yet another changeset to fixup the things for which the automatic
-merge yielded bad results. Hg puts the results of the merge into your
-work directory, and remembers what you merged with (so that it can
-later record both of the merge parents, if you decide to make a
-changeset), but it doesn't immediately create a changeset.
-
-A further feature of Hg is that it allows a repository to have
-multiple heads. This means that you can have changesets with no common
-descendent in one repository -- something BK won't allow. This is
-actually pretty neat. For example, it would in principle enable you to
-have both the 2.0-testing and unstable trees in a single
-repository. We shyed away from doing this as we thought the risk of
-committing to the wrong head was too great.
-
-One slightly confusing aspect of Hg is that many of the commands have
-aliases, and hence when looking things up in the man page its not
-always obvious what the underlying command is. For example 'co' is
-actually an alias for the 'update' command, but 'co' seems to make
-more sense, at least to RCS refugees like me.
-
-
-Getting Xen
------------
-
-The URL for the mainline Xen mercurial repository is:
-
-   http://xenbits.xensource.com/xen-unstable.hg
-   (similarly for xen-2.0 and xen-2.0-testing)
-
-You can point a browser and this and use Hg's web interface to view
-revision history, or use it as the nominated source when issuing
-"hg init" or "hg pull" commands. 
-
-However, to avoid taxing the Mercurial server with a complete pull of
-the Xen repository, it is best to download a tarball of a seed
-repository from:
- 
-  http://www.cl.cam.ac.uk/Research/SRG/netos/xen/downloads/xen-unstable.hg.tar.gz
-
-  (or copy from /usr/groups/netos/html/xen/downloads/xen-unstable.hg.tar.gz)
-
-Untar the repository on your disk, cd into it, and then pull the most
-recent changes:
-
-  hg pull -u
-
-By default hg does not automatically checkout ('update') files from
-the repository as used to happen with bk. The above is equivalent to
-"hg pull; hg co"
-
-The repository parent is stored in a repository configuration file, 
-.hg/hgrc, from the repository root.  If you look at this file, you 
-will see:
-
-  |  [paths]
-  |  default = http://xenbits.xensource.com/xen-unstable.hg
-
-"default" specifies the appropriate parent repository for hg to pull 
-from.  Hg allows you to pull additional repositories, for instance if 
-you want to work between unstable and testing concurrently.
-
-The command "hg pull" simply adds changesets to your repository,
-without any merging of any kind.  "hg pull -u" implies merging with
-the current state of your working directory.  If you weren't already
-"updated" to your local repository's tip, you might be surprised to
-find yourself merging the results of the pull with a non-tip node in
-your local repository. 
-
-
-Revision History
-----------------
-
-You can view the repository revision history with:
-
-   hg history
-
-In practice, you'll probably want to use pipe the output through
-'head' or 'more' as it prints the entire history.
-
-Looking at the first few lines of output, you can see the changeset at
-the head of the current branch, known as the 'tip' (the tip is
-automatically given a special tag to make it easy to refer to):
-
-   | changeset:   5599:6cbf9ec05cd9e05c0c46a85df7fc00262633cd3d
-   | tag:         tip
-   | user:        kaf24@firebug.cl.cam.ac.uk
-   | date:        Tue Jun 28 18:47:14 2005
-   | summary:     bitkeeper revision 1.1768 (42c18d2259NPELcGV7ohyZNh72ufSw)
-
-By default, Hg just shows the first line of the changset comments. You
-can find further information with "hg -v history".
-
-The changeset identifier has two parts, a _local_ monotonically
-increasing changeset id, 5599 above, and a _global_ hash, which
-follows the colon on the changeset line.  The hash uniquely identifies
-the changeset and its lineage back to the root of the changeset tree
--- it is useful for distributed management and so on.  However, as it
-is a bit unruly, the local id will allow you to work easily with the
-local repo. Hg commands will take either identifier. Additionally, a
-tags mechanism lets you give common names to specific changesets.
-
-You should always use the global hash when referring to versions of
-the mainline Xen respoitory. With Bk you could often get away with
-using the shortform version, but with Hg the local ids are pretty much
-guaranteed to be different.
-
-
-Creating a child repository from an existing repository
--------------------------------------------------------
-If you wanted to create additional local child repositories,
-
-   hg init [path or url]
-
-is effectively equivalent to bk clone.  The major difference is that 
-it should be run from the root of your new repository.  So:
-
-   bk clone /foo/bar
-
-would be replaced with:
-
-   mkdir bar
-   cd bar
-   hg init /foo/bar
-
-NB: newer version of Hg support a 'clone' command that works in the
-same manner as bk.
-
-Editing files
--------------
-
-Normal edits may be made in place.  File creation needs explicit
-marking, though deletes should be picked up automatically
-
-creation:
-
-   touch a.txt (or otherwise created a file)
-   hg add a.txt
-
-You can see what has changed using:
-
-   hg status
-
-   | C foo/foo.c
-   | R foo/bar.c
-   | ? a.txt
-
-This shows that in the current repo, foo.c has been changed, bar.c has
-been deleted, and a.txt is new, but has not been added.  '?' changes
-to 'A' after "hg add a.txt". There is a .hgignore file which contains
-regexps of files that should be ignored when scanning for new
-files. We try to ensure that all the generated files in a build are
-covered by the regexps.
-
-You can add all the new files in a repository with "hg addremove". If
-you discover that you've added a file you didn't want, you can remove
-it from the list of files to be included in the next commit using
-"hg forget".
-
-Committing changes
------------------
-
-After you've checked that hg knows about any new files you've created,
-you probably want to see a diff of what you're about to commit. You
-can do this with:
-   
-   hg diff
-
-Once you're happy with what you have, invoke:
-
-   hg commit
-
-This will pop up an editor with a list of files to be committed to the
-repository.  It will look vaguely like this:
-
-   | 
-   | HG: manifest hash 6397b04bd5c2a992482d973b685a7e5e498788e7
-   | HG: changed doc/thesis/new.tex
-   | HG: removed doc/2005-hotdep-protection/paper.tex
-
-Your comments can go anywhere in this file.  The first line is the 
-most important, as it will show as the changeset description in 
-non-verbose-mode history listings.
-
-You can do commits without the editor and of partial sets of files 
-using command-line switches. See:
-
-   hg help commit
-
-You can use the -A (--addremove) flag to commit e.g. "hg -A commit" to
-ask mercurial to scan the tree looking for newly created files to add
-in to the changeset. This avoids having to explicitly use "hg add",
-but you probably want to be careful of adding any new generated files
-too.
-
-
-Generating a patch
-------------------
-Generating a patch is easy,
-
-   hg export [changeset]
-
-will generate a patch describing the diff between that changeset and 
-its parent.
-    
-To generate a patch between two specified revisions use:
-   hg diff -r A -r B [files]
-NB: BK syntax -rA..B isn't supported by Hg.   
-
-
-Pushing changesets to a parent repository
------------------------------------------
-
-   hg push
-
-Pushes changes up to a parent. You can't push if you pulled the
-repository off the web interface. In fact, you can currently only push
-to an ssh target -- filesystem directory targets don't work, but this
-will be fixed soon.
-For now it is possible to set up asymmetric pull/push paths. Pulls can
-be done via web interface while pushes via ssh. Example of .hg/hgrc config
-file:
-  | [paths]
-  | default = http://your.server/repository_name
-  | default-push = ssh://[username@]your.server//repository_location
-
-
-Repository history
-------------------
-
-Here are a collection of common commands to get you started:
-
-   hg history | less
-
-shows the history of changesets, starting from the most recent.  You 
-want to pipe it to some sort of pager.  For more complete details,
- 
-   hg -v history | less
-
-will include files modified and full (not just first-line) comments.
-
-Additionally, you can see just the tip (head of the current
-branch) of the repository by typing:
-
-   hg [-v] tip
-
-
-Moving to a specific changeset
-------------------------------
-
-The co command lets you change the working version of the repository
-to a different changeset. 
-
-   hg co [changeset]
-
-NB: 'co' is an alias for 'update'
-
-This command enables you to rewind the working repository to previous
-changesets, for example to isolate the changeset in which a bug is
-introduced.
-
-If you try and do a 'co' but have modified files in your repository Hg
-won't let you unless you ask it explicitly to merge the checked out
-version into the current tree using the "-m" option. The "-C"
-(--clean) option will force overwrite any locally modified files.
-
-Any commits that are made to non-head changesets will obviously fork
-the tree, creating a new head. You can see all the heads in a tree with
-"hg heads".
-
-In general, "hg co" does the right thing, although it doesn't
-currently seem to clean up unused directories that have been created
-by other checked-out versions. This can confuse the Xen build
-system. Hg will probably get fixed soon, but in the meantime you can
-cleanup with "find -depth -type d -print | xargs -r rmdir".
-
-You can return to the tip by omitting an explicit changeset id.
-   
-The manifest command lets you see the contents of the repository for 
-the current changeset.
-
-   hg manifest
-
-This will print a bunch of records of the form: 
-
-   | 98856c45c35a504bc6da06a62b7787ddfdfd1c8b 644 COPYING
-   | f28971eedc5b54e7a9b26dd18d52992955354981 644 Config.mk
-   | a3575cc4db59e50bbac8a039a0c74f081a8dfc4f 644 Makefile
-   | 7fc869aae2945a9f4626fad96552db3103e61cb9 644 README
-   | ...
-
-This lists the hash of each file, its 1-bit 'executable' attribute
-(either file permission mode 644 or 755), and the file name.  So, to
-determine the files that change across two changesets, you would dump
-the respective manifests to files, and use diff.
-
-
-Managing changeset tags
------------------------
-To create a tag to the current changeset:
-
-   hg tag tagname
-
-This will _immediately_ generate a changeset with a change to the file
-.hgtags in the repository root.   The new tag in this file will look
-something like:
-
-   | 35159ed4b30538e7a52c60ad0a63f7e9af156e4c tagname
-
-and may be used to identify that changeset throughout the repo.
-Storing tags in this file and generating changesets immediately 
-forces people to merge and keep tags up to date across the repository.
-
-Note that tags are resolved by searching .hgtags in each of the 
-repository heads, sequentially, and using the first match.  "hg heads"
-lists the current heads.
-
-The "hg tags" command, will lists all the currently valid tags.
-
-
-Hg server and source browser
-----------------------------
-
-   hg serve -p port
-
-Launches a web server on the specified port, serving a source browser 
-for the repository.  This browser may be used to examine the 
-changeset history, view annotated source files, generate diffs.  
-Additionally "hg pull" may be run against it.
-
-Additional useful commands
-(that probably only need one-line descriptions)
------------------------------------------------
-
-(Slightly) more detail on all of these is available with
-
-  hg help [command]
-
-Shows the differences between whatever changeset you most recently
-checked out, and your current working directory:
-
-   hg diff 
-
-View an annotated version of a source file:
-
-   hg annotate
-
-Get a historical version of a file:
-
-   hg cat
-
- NB: Most commands accepting a version number want the changeset's
- version number.  "hg cat" is different in that it wants the
- *file*'s version number.
-
-Unadd a file to the current commit:
-
-   hg forget
-
-List all heads in the current repository:
-
-   hg heads
-
-Undo exactly one (and ONLY one) changeset:
-
-   hg undo
-
-Show the parents of a changeset:
-
-   hg parents
-
- NB: Changesets have either one or two parent changesets. If your
- working directory contains the uncommitted results of a merge, then
- you have two parents.  Otherwise, the single parent is the changeset
- which you most recently checked out.
-
-Show the revision history for a single file
-
-   hg [-v] log <filename>
-
diff -r 4ecd3615e726 -r f88c745575bb docs/misc/network_setup.txt
--- a/docs/misc/network_setup.txt	Tue Nov 22 17:24:51 2011 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,196 +0,0 @@
-Native OS bridge configuration
-==============================
-
-The traditional "network-bridge" script attempts to modify existing active
-network interfaces to enable bridging. For non-trivial network configurations
-though this can be error prone, and the temporary disruption to network
-connectivity can upset some applications.  This document outlines how to
-configure bridging using an OS' native network configuration files.
-
-Disabling Xen's network scripts
--------------------------------
-
-The first step is to check XenD's network bridge is disabled by
-editing /etc/xen/xend-config.sxp and changing the line
-
- (network-script network-bridge)
-
-To be
-
- (network-script /bin/true)
-
-
-Fedora/RHEL Bridging
-====================
-
-This outlines how to setup bridging using standard network initscripts
-present in Fedora or RHEL distros and their derivatives
-
-
-Disabling NetworkManager
-------------------------
-
-As of time of writing (Fedora 14) NetworkManager does not support bridging,
-so it is neccessary to disable NetworkManager, and revert to "classic"
-network initscripts
-
- # chkconfig NetworkManager off
- # chkconfig network on
- # service NetworkManager stop
- # service network start
-
-NB, as an alternative to turning off NetworkManager, you can also add a line
-"NM_CONTROLLED=no" to the ifcfg-XXX scripts below
-
-Creating network initscripts
-----------------------------
-
-In the /etc/sysconfig/network-scripts directory it is necccessary to create
-2 config files. The first (ifcfg-eth0) defines your physical network interface,
-and says that it will be part of a bridge:
-
-# cat > ifcfg-eth0 <<EOF
-DEVICE=eth0
-HWADDR=00:16:76:D6:C9:45
-ONBOOT=yes
-BRIDGE=br0
-EOF
-
-Obviously change the HWADDR to match your actual NIC's address. You may also
-wish to configure the device's MTU here using e.g. MTU=9000.
-
-The second config file (ifcfg-br0) defines the bridge device:
-
-# cat > ifcfg-br0 <<EOF
-DEVICE=br0
-TYPE=Bridge
-BOOTPROTO=dhcp
-ONBOOT=yes
-DELAY=0
-EOF
-
-WARNING: The line TYPE=Bridge is case-sensitive - it must have uppercase
-'B' and lower case 'ridge'
-
-After changing this restart networking (or better still reboot)
-
- # service network restart
-
-
-The final step is to configure iptables to allow all traffic to be
-forwarded across the bridge
-
-# echo "-I FORWARD -m physdev --physdev-is-bridged -j ACCEPT" > /etc/sysconfig/iptables-forward-bridged
-# lokkit --custom-rules=ipv4:filter:/etc/sysconfig/iptables-forward-bridged
-# service libvirtd reload
-
-Alternatively, you can prevent bridged traffic getting pushed through
-the host's iptables rules completely. In /etc/sysctl.conf add
-
- # cat >> /etc/sysctl.conf <<EOF
- net.bridge.bridge-nf-call-ip6tables = 0
- net.bridge.bridge-nf-call-iptables = 0
- net.bridge.bridge-nf-call-arptables = 0
- EOF
- # sysctl -p /etc/sysctl.conf
-
-You should now have a "shared physical device", to which guests can be
-attached and have full LAN access
-
- # brctl show
- bridge name     bridge id               STP enabled     interfaces
- br0             8000.000e0cb30550       no              eth0
-
-
-
-Debian/Ubuntu Bridging
-=======================
-
-This outlines how to setup bridging using standard network interface config files
-on Debian / Ubuntu distributions and their derivatives
-
-Disabling NetworkManager
-------------------------
-
-Stop network manager
-
- sudo /etc/dbus-1/event.d/26NetworkManagerDispatcher stop
- sudo /etc/dbus-1/event.d/25NetworkManager stop
-
-Create two files with only the word 'exit' in them. These files are:
-
- /etc/default/NetworkManager
- /etc/default/NetworkManagerDispatcher
-
-
-Altering the interface config
------------------------------
-
-First take down the interface you wish to bridge
-
- ifdown eth0
-
-Edit /etc/network/interfaces and find the config for the physical
-interface, which looks something like
-
- allow-hotplug eth0
- iface eth0 inet static
-        address 192.168.2.4
-        netmask 255.255.255.0
-        network 192.168.2.0
-        broadcast 192.168.2.255
-        gateway 192.168.2.2
-
-Remove the 'allow-hotplug eth0' line, replacing it with 'auto br0',
-and change the next line with iface name to 'br0', so it now starts
-with
-
- auto br0
- iface br0 inet static
-
-And then define the interface as being a bridge and specify its ports
-
-       bridge_ports eth0
-       bridge_stp off
-       bridge_maxwait 5
-
-The complete config should now look like
-
- auto br0
- iface br0 inet static
-         address 192.168.2.4
-         netmask 255.255.255.0
-         network 192.168.2.0
-         broadcast 192.168.2.255
-         gateway 192.168.2.2
-         bridge_ports eth0
-         bridge_stp off
-         bridge_maxwait 5
-
-The interface can now be started with
-
- ifup br0
-
-Finally add the '/etc/sysctl.conf' settings
-
-net.bridge.bridge-nf-call-ip6tables = 0
-net.bridge.bridge-nf-call-iptables = 0
-net.bridge.bridge-nf-call-arptables = 0
-
-And then load the settings with
-
- sysctl -p /etc/sysctl.conf
-
-
-You should now have a "shared physical device", to which guests
-can be attached and have full LAN access
-
- # brctl show
- bridge name     bridge id               STP enabled     interfaces
- br0             8000.000e0cb30550       no              eth0
-
-
-Other operating systems / distributions
-=======================================
-
-[...send patches to this file with instructions....]

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:33 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23: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.xensource.com>)
	id 1RVAhY-00007V-Ku; Mon, 28 Nov 2011 23:33:32 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhX-0008MS-5X
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:31 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1322523173!4976573!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20663 invoked from network); 28 Nov 2011 23:32:54 -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;
	28 Nov 2011 23:32:54 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnM-0001j9-13
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhL-0000ph-0L
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:19 +0000
Message-Id: <E1RVAhL-0000ph-0L@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Trivial fix for rc val in hap track
	dirty vram
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1322149491 0
# Node ID 67d2ac426defedad9c10eb339019f9dc9f02d2ae
# Parent  3c864e04c2ad060ca1cac6579994777993fef6e6
Trivial fix for rc val in hap track dirty vram

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 3c864e04c2ad -r 67d2ac426def xen/arch/x86/mm/hap/hap.c
--- a/xen/arch/x86/mm/hap/hap.c	Thu Nov 24 15:43:59 2011 +0000
+++ b/xen/arch/x86/mm/hap/hap.c	Thu Nov 24 15:44:51 2011 +0000
@@ -141,7 +141,7 @@
         }
         else if ( !paging_mode_log_dirty(d) && !dirty_vram )
         {
-            rc -ENOMEM;
+            rc = -ENOMEM;
             if ( (dirty_vram = xmalloc(struct sh_dirty_vram)) == NULL )
                 goto param_fail;
 

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:33 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23: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.xensource.com>)
	id 1RVAhY-00008N-RG; Mon, 28 Nov 2011 23:33:32 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhX-0008QD-AW
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:31 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-27.messagelabs.com!1322523133!55221074!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31272 invoked from network); 28 Nov 2011 23:32:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Nov 2011 23:32:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnN-0001jN-W5
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhM-0000qf-VZ
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:20 +0000
Message-Id: <E1RVAhM-0000qf-VZ@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/waitqueue: Because we have
	per-cpu stacks, we must wake up on teh
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1322149808 0
# Node ID ca92c4a8b31f2af73b18e4c7dae193d7ecb598b8
# Parent  de4fe05fe887d8c8ae71022ccd40cc9991def1bf
x86/waitqueue: Because we have per-cpu stacks, we must wake up on teh
same cpu that we slept on. Otherwise stack references are bogus on
wakeup.

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


diff -r de4fe05fe887 -r ca92c4a8b31f xen/common/wait.c
--- a/xen/common/wait.c	Thu Nov 24 15:49:25 2011 +0000
+++ b/xen/common/wait.c	Thu Nov 24 15:50:08 2011 +0000
@@ -34,6 +34,8 @@
      */
     void *esp;
     char *stack;
+    cpumask_t saved_affinity;
+    unsigned int wakeup_cpu;
 #endif
 };
 
@@ -106,9 +108,19 @@
 static void __prepare_to_wait(struct waitqueue_vcpu *wqv)
 {
     char *cpu_info = (char *)get_cpu_info();
+    struct vcpu *curr = current;
 
     ASSERT(wqv->esp == 0);
 
+    /* Save current VCPU affinity; force wakeup on *this* CPU only. */
+    wqv->wakeup_cpu = smp_processor_id();
+    cpumask_copy(&wqv->saved_affinity, curr->cpu_affinity);
+    if ( vcpu_set_affinity(curr, cpumask_of(wqv->wakeup_cpu)) )
+    {
+        gdprintk(XENLOG_ERR, "Unable to set vcpu affinity\n");
+        domain_crash_synchronous();
+    }
+
     asm volatile (
 #ifdef CONFIG_X86_64
         "push %%rax; push %%rbx; push %%rcx; push %%rdx; push %%rdi; "
@@ -144,6 +156,7 @@
 static void __finish_wait(struct waitqueue_vcpu *wqv)
 {
     wqv->esp = NULL;
+    (void)vcpu_set_affinity(current, &wqv->saved_affinity);
 }
 
 void check_wakeup_from_wait(void)
@@ -155,6 +168,20 @@
     if ( likely(wqv->esp == NULL) )
         return;
 
+    /* Check if we woke up on the wrong CPU. */
+    if ( unlikely(smp_processor_id() != wqv->wakeup_cpu) )
+    {
+        /* Re-set VCPU affinity and re-enter the scheduler. */
+        struct vcpu *curr = current;
+        cpumask_copy(&wqv->saved_affinity, curr->cpu_affinity);
+        if ( vcpu_set_affinity(curr, cpumask_of(wqv->wakeup_cpu)) )
+        {
+            gdprintk(XENLOG_ERR, "Unable to set vcpu affinity\n");
+            domain_crash_synchronous();
+        }
+        wait(); /* takes us back into the scheduler */
+    }
+
     asm volatile (
         "mov %1,%%"__OP"sp; rep movsb; jmp *(%%"__OP"sp)"
         : : "S" (wqv->stack), "D" (wqv->esp),

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:33 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23: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.xensource.com>)
	id 1RVAhY-00008N-RG; Mon, 28 Nov 2011 23:33:32 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhX-0008QD-AW
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:31 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-27.messagelabs.com!1322523133!55221074!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31272 invoked from network); 28 Nov 2011 23:32:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Nov 2011 23:32:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnN-0001jN-W5
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhM-0000qf-VZ
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:20 +0000
Message-Id: <E1RVAhM-0000qf-VZ@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/waitqueue: Because we have
	per-cpu stacks, we must wake up on teh
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1322149808 0
# Node ID ca92c4a8b31f2af73b18e4c7dae193d7ecb598b8
# Parent  de4fe05fe887d8c8ae71022ccd40cc9991def1bf
x86/waitqueue: Because we have per-cpu stacks, we must wake up on teh
same cpu that we slept on. Otherwise stack references are bogus on
wakeup.

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


diff -r de4fe05fe887 -r ca92c4a8b31f xen/common/wait.c
--- a/xen/common/wait.c	Thu Nov 24 15:49:25 2011 +0000
+++ b/xen/common/wait.c	Thu Nov 24 15:50:08 2011 +0000
@@ -34,6 +34,8 @@
      */
     void *esp;
     char *stack;
+    cpumask_t saved_affinity;
+    unsigned int wakeup_cpu;
 #endif
 };
 
@@ -106,9 +108,19 @@
 static void __prepare_to_wait(struct waitqueue_vcpu *wqv)
 {
     char *cpu_info = (char *)get_cpu_info();
+    struct vcpu *curr = current;
 
     ASSERT(wqv->esp == 0);
 
+    /* Save current VCPU affinity; force wakeup on *this* CPU only. */
+    wqv->wakeup_cpu = smp_processor_id();
+    cpumask_copy(&wqv->saved_affinity, curr->cpu_affinity);
+    if ( vcpu_set_affinity(curr, cpumask_of(wqv->wakeup_cpu)) )
+    {
+        gdprintk(XENLOG_ERR, "Unable to set vcpu affinity\n");
+        domain_crash_synchronous();
+    }
+
     asm volatile (
 #ifdef CONFIG_X86_64
         "push %%rax; push %%rbx; push %%rcx; push %%rdx; push %%rdi; "
@@ -144,6 +156,7 @@
 static void __finish_wait(struct waitqueue_vcpu *wqv)
 {
     wqv->esp = NULL;
+    (void)vcpu_set_affinity(current, &wqv->saved_affinity);
 }
 
 void check_wakeup_from_wait(void)
@@ -155,6 +168,20 @@
     if ( likely(wqv->esp == NULL) )
         return;
 
+    /* Check if we woke up on the wrong CPU. */
+    if ( unlikely(smp_processor_id() != wqv->wakeup_cpu) )
+    {
+        /* Re-set VCPU affinity and re-enter the scheduler. */
+        struct vcpu *curr = current;
+        cpumask_copy(&wqv->saved_affinity, curr->cpu_affinity);
+        if ( vcpu_set_affinity(curr, cpumask_of(wqv->wakeup_cpu)) )
+        {
+            gdprintk(XENLOG_ERR, "Unable to set vcpu affinity\n");
+            domain_crash_synchronous();
+        }
+        wait(); /* takes us back into the scheduler */
+    }
+
     asm volatile (
         "mov %1,%%"__OP"sp; rep movsb; jmp *(%%"__OP"sp)"
         : : "S" (wqv->stack), "D" (wqv->esp),

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:33 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23: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.xensource.com>)
	id 1RVAhY-00007V-Ku; Mon, 28 Nov 2011 23:33:32 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhX-0008MS-5X
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:31 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1322523173!4976573!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20663 invoked from network); 28 Nov 2011 23:32:54 -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;
	28 Nov 2011 23:32:54 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnM-0001j9-13
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhL-0000ph-0L
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:19 +0000
Message-Id: <E1RVAhL-0000ph-0L@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Trivial fix for rc val in hap track
	dirty vram
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1322149491 0
# Node ID 67d2ac426defedad9c10eb339019f9dc9f02d2ae
# Parent  3c864e04c2ad060ca1cac6579994777993fef6e6
Trivial fix for rc val in hap track dirty vram

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 3c864e04c2ad -r 67d2ac426def xen/arch/x86/mm/hap/hap.c
--- a/xen/arch/x86/mm/hap/hap.c	Thu Nov 24 15:43:59 2011 +0000
+++ b/xen/arch/x86/mm/hap/hap.c	Thu Nov 24 15:44:51 2011 +0000
@@ -141,7 +141,7 @@
         }
         else if ( !paging_mode_log_dirty(d) && !dirty_vram )
         {
-            rc -ENOMEM;
+            rc = -ENOMEM;
             if ( (dirty_vram = xmalloc(struct sh_dirty_vram)) == NULL )
                 goto param_fail;
 

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:33 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23: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.xensource.com>)
	id 1RVAhW-0008Ur-HM; Mon, 28 Nov 2011 23:33:30 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhU-0008KN-E6
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-182.messagelabs.com!1322523170!476831!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31108 invoked from network); 28 Nov 2011 23:32:51 -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;
	28 Nov 2011 23:32:51 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnJ-0001ir-26
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhI-0000oF-1c
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:16 +0000
Message-Id: <E1RVAhI-0000oF-1c@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: Prevent xl save from
	segfaulting when control/shutdown key is removed
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Paul Durrant <paul.durrant@citrix.com>
# Date 1322049817 0
# Node ID 84b3e46aa7d24a4605c36940606e7da9679b0e7f
# Parent  7aa5838499d15555a4c2c6bde0c084762abe0195
libxl: Prevent xl save from segfaulting when control/shutdown key is removed

To acknowledge the tools' setting of control/shutdown it is normal for
PV drivers to rm the key. This leads to libxl__xs_read() returning
NULL and thus a subsequent strcmp on the return value will cause a
segfault.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 7aa5838499d1 -r 84b3e46aa7d2 tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c	Wed Nov 23 11:15:31 2011 +0000
+++ b/tools/libxl/libxl_dom.c	Wed Nov 23 12:03:37 2011 +0000
@@ -444,6 +444,7 @@
             usleep(100000);
 
             state = libxl__xs_read(si->gc, XBT_NULL, path);
+            if (!state) state = "";
 
             watchdog--;
         }
@@ -463,6 +464,7 @@
             t = xs_transaction_start(ctx->xsh);
 
             state = libxl__xs_read(si->gc, t, path);
+            if (!state) state = "";
 
             if (!strcmp(state, "suspend"))
                 libxl__xs_write(si->gc, t, path, "");

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:33 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23: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.xensource.com>)
	id 1RVAhW-0008Ur-HM; Mon, 28 Nov 2011 23:33:30 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhU-0008KN-E6
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-182.messagelabs.com!1322523170!476831!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31108 invoked from network); 28 Nov 2011 23:32:51 -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;
	28 Nov 2011 23:32:51 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnJ-0001ir-26
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhI-0000oF-1c
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:16 +0000
Message-Id: <E1RVAhI-0000oF-1c@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: Prevent xl save from
	segfaulting when control/shutdown key is removed
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Paul Durrant <paul.durrant@citrix.com>
# Date 1322049817 0
# Node ID 84b3e46aa7d24a4605c36940606e7da9679b0e7f
# Parent  7aa5838499d15555a4c2c6bde0c084762abe0195
libxl: Prevent xl save from segfaulting when control/shutdown key is removed

To acknowledge the tools' setting of control/shutdown it is normal for
PV drivers to rm the key. This leads to libxl__xs_read() returning
NULL and thus a subsequent strcmp on the return value will cause a
segfault.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 7aa5838499d1 -r 84b3e46aa7d2 tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c	Wed Nov 23 11:15:31 2011 +0000
+++ b/tools/libxl/libxl_dom.c	Wed Nov 23 12:03:37 2011 +0000
@@ -444,6 +444,7 @@
             usleep(100000);
 
             state = libxl__xs_read(si->gc, XBT_NULL, path);
+            if (!state) state = "";
 
             watchdog--;
         }
@@ -463,6 +464,7 @@
             t = xs_transaction_start(ctx->xsh);
 
             state = libxl__xs_read(si->gc, t, path);
+            if (!state) state = "";
 
             if (!strcmp(state, "suspend"))
                 libxl__xs_write(si->gc, t, path, "");

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:33 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23: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.xensource.com>)
	id 1RVAhX-000060-QT; Mon, 28 Nov 2011 23:33:31 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhV-0008LY-Pk
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:30 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1322523172!5048348!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24076 invoked from network); 28 Nov 2011 23:32:53 -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;
	28 Nov 2011 23:32:53 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnK-0001j0-IN
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhJ-0000oy-Hn
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:17 +0000
Message-Id: <E1RVAhJ-0000oy-Hn@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: change return code for
	log-dirty disabling
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1322148057 0
# Node ID 6b3d8250ee2c63d90680c142549123a4b1559f55
# Parent  7da681c490e0a8a2b3f1fb311d254dc7ce618a43
x86/mm: change return code for log-dirty disabling

Disabling log dirty mode in HAP always returns -EINVAL. Make it
return the correct rc on success.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 7da681c490e0 -r 6b3d8250ee2c xen/arch/x86/mm/hap/hap.c
--- a/xen/arch/x86/mm/hap/hap.c	Thu Nov 24 15:20:57 2011 +0000
+++ b/xen/arch/x86/mm/hap/hap.c	Thu Nov 24 15:20:57 2011 +0000
@@ -709,6 +709,8 @@
         return rc;
     case XEN_DOMCTL_SHADOW_OP_GET_ALLOCATION:
         sc->mb = hap_get_allocation(d);
+        /* Fall through... */
+    case XEN_DOMCTL_SHADOW_OP_OFF:
         return 0;
     default:
         HAP_ERROR("Bad hap domctl op %u\n", sc->op);

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:33 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23: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.xensource.com>)
	id 1RVAhX-000060-QT; Mon, 28 Nov 2011 23:33:31 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhV-0008LY-Pk
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:30 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1322523172!5048348!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24076 invoked from network); 28 Nov 2011 23:32:53 -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;
	28 Nov 2011 23:32:53 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnK-0001j0-IN
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhJ-0000oy-Hn
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:17 +0000
Message-Id: <E1RVAhJ-0000oy-Hn@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: change return code for
	log-dirty disabling
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1322148057 0
# Node ID 6b3d8250ee2c63d90680c142549123a4b1559f55
# Parent  7da681c490e0a8a2b3f1fb311d254dc7ce618a43
x86/mm: change return code for log-dirty disabling

Disabling log dirty mode in HAP always returns -EINVAL. Make it
return the correct rc on success.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 7da681c490e0 -r 6b3d8250ee2c xen/arch/x86/mm/hap/hap.c
--- a/xen/arch/x86/mm/hap/hap.c	Thu Nov 24 15:20:57 2011 +0000
+++ b/xen/arch/x86/mm/hap/hap.c	Thu Nov 24 15:20:57 2011 +0000
@@ -709,6 +709,8 @@
         return rc;
     case XEN_DOMCTL_SHADOW_OP_GET_ALLOCATION:
         sc->mb = hap_get_allocation(d);
+        /* Fall through... */
+    case XEN_DOMCTL_SHADOW_OP_OFF:
         return 0;
     default:
         HAP_ERROR("Bad hap domctl op %u\n", sc->op);

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:34 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAha-0000BG-22; Mon, 28 Nov 2011 23:33:34 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhY-0008OG-DX
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:32 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-216.messagelabs.com!1322523174!5388009!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22589 invoked from network); 28 Nov 2011 23:32:55 -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;
	28 Nov 2011 23:32:55 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnN-0001jG-3h
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhL-0000qB-WD
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:20 +0000
Message-Id: <E1RVAhL-0000qB-WD@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] waitqueue: Detect saved-stack
	overflow and crash the guest.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1322149690 0
# Node ID 9b65336f688f3b6b15ae11d74cebf88cd41ad19d
# Parent  8e05b21ee6448ce56e4e56201472e87074344fa6
waitqueue: Detect saved-stack overflow and crash the guest.

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


diff -r 8e05b21ee644 -r 9b65336f688f xen/common/wait.c
--- a/xen/common/wait.c	Thu Nov 24 15:45:19 2011 +0000
+++ b/xen/common/wait.c	Thu Nov 24 15:48:10 2011 +0000
@@ -106,13 +106,16 @@
 static void __prepare_to_wait(struct waitqueue_vcpu *wqv)
 {
     char *cpu_info = (char *)get_cpu_info();
+
     asm volatile (
 #ifdef CONFIG_X86_64
         "push %%rax; push %%rbx; push %%rcx; push %%rdx; push %%rdi; "
         "push %%rbp; push %%r8; push %%r9; push %%r10; push %%r11; "
         "push %%r12; push %%r13; push %%r14; push %%r15; call 1f; "
         "1: mov 80(%%rsp),%%rdi; mov 96(%%rsp),%%rcx; mov %%rsp,%%rsi; "
-        "sub %%rsi,%%rcx; rep movsb; mov %%rsp,%%rsi; pop %%rax; "
+        "sub %%rsi,%%rcx; cmp %3,%%rcx; jbe 2f; "
+        "xor %%esi,%%esi; jmp 3f; "
+        "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 %%rdi; pop %%rdx; pop %%rcx; pop %%rbx; pop %%rax"
@@ -120,13 +123,20 @@
         "push %%eax; push %%ebx; push %%ecx; push %%edx; push %%edi; "
         "push %%ebp; call 1f; "
         "1: mov 8(%%esp),%%edi; mov 16(%%esp),%%ecx; mov %%esp,%%esi; "
-        "sub %%esi,%%ecx; rep movsb; mov %%esp,%%esi; pop %%eax; "
+        "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 %%edi; pop %%edx; pop %%ecx; pop %%ebx; pop %%eax"
 #endif
         : "=S" (wqv->esp)
-        : "c" (cpu_info), "D" (wqv->stack)
+        : "c" (cpu_info), "D" (wqv->stack), "i" (PAGE_SIZE)
         : "memory" );
-    BUG_ON((cpu_info - (char *)wqv->esp) > PAGE_SIZE);
+
+    if ( unlikely(wqv->esp == 0) )
+    {
+        gdprintk(XENLOG_ERR, "Stack too large in %s\n", __FUNCTION__);
+        domain_crash_synchronous();
+    }
 }
 
 static void __finish_wait(struct waitqueue_vcpu *wqv)
@@ -162,6 +172,7 @@
     struct vcpu *curr = current;
     struct waitqueue_vcpu *wqv = curr->waitqueue_vcpu;
 
+    ASSERT(!in_atomic());
     ASSERT(list_empty(&wqv->list));
 
     spin_lock(&wq->lock);

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:34 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAha-0000BG-22; Mon, 28 Nov 2011 23:33:34 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhY-0008OG-DX
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:32 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-216.messagelabs.com!1322523174!5388009!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22589 invoked from network); 28 Nov 2011 23:32:55 -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;
	28 Nov 2011 23:32:55 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnN-0001jG-3h
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhL-0000qB-WD
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:20 +0000
Message-Id: <E1RVAhL-0000qB-WD@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] waitqueue: Detect saved-stack
	overflow and crash the guest.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1322149690 0
# Node ID 9b65336f688f3b6b15ae11d74cebf88cd41ad19d
# Parent  8e05b21ee6448ce56e4e56201472e87074344fa6
waitqueue: Detect saved-stack overflow and crash the guest.

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


diff -r 8e05b21ee644 -r 9b65336f688f xen/common/wait.c
--- a/xen/common/wait.c	Thu Nov 24 15:45:19 2011 +0000
+++ b/xen/common/wait.c	Thu Nov 24 15:48:10 2011 +0000
@@ -106,13 +106,16 @@
 static void __prepare_to_wait(struct waitqueue_vcpu *wqv)
 {
     char *cpu_info = (char *)get_cpu_info();
+
     asm volatile (
 #ifdef CONFIG_X86_64
         "push %%rax; push %%rbx; push %%rcx; push %%rdx; push %%rdi; "
         "push %%rbp; push %%r8; push %%r9; push %%r10; push %%r11; "
         "push %%r12; push %%r13; push %%r14; push %%r15; call 1f; "
         "1: mov 80(%%rsp),%%rdi; mov 96(%%rsp),%%rcx; mov %%rsp,%%rsi; "
-        "sub %%rsi,%%rcx; rep movsb; mov %%rsp,%%rsi; pop %%rax; "
+        "sub %%rsi,%%rcx; cmp %3,%%rcx; jbe 2f; "
+        "xor %%esi,%%esi; jmp 3f; "
+        "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 %%rdi; pop %%rdx; pop %%rcx; pop %%rbx; pop %%rax"
@@ -120,13 +123,20 @@
         "push %%eax; push %%ebx; push %%ecx; push %%edx; push %%edi; "
         "push %%ebp; call 1f; "
         "1: mov 8(%%esp),%%edi; mov 16(%%esp),%%ecx; mov %%esp,%%esi; "
-        "sub %%esi,%%ecx; rep movsb; mov %%esp,%%esi; pop %%eax; "
+        "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 %%edi; pop %%edx; pop %%ecx; pop %%ebx; pop %%eax"
 #endif
         : "=S" (wqv->esp)
-        : "c" (cpu_info), "D" (wqv->stack)
+        : "c" (cpu_info), "D" (wqv->stack), "i" (PAGE_SIZE)
         : "memory" );
-    BUG_ON((cpu_info - (char *)wqv->esp) > PAGE_SIZE);
+
+    if ( unlikely(wqv->esp == 0) )
+    {
+        gdprintk(XENLOG_ERR, "Stack too large in %s\n", __FUNCTION__);
+        domain_crash_synchronous();
+    }
 }
 
 static void __finish_wait(struct waitqueue_vcpu *wqv)
@@ -162,6 +172,7 @@
     struct vcpu *curr = current;
     struct waitqueue_vcpu *wqv = curr->waitqueue_vcpu;
 
+    ASSERT(!in_atomic());
     ASSERT(list_empty(&wqv->list));
 
     spin_lock(&wq->lock);

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:35 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhb-0000Dn-BD; Mon, 28 Nov 2011 23:33:35 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhY-0008TR-Oq
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:32 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1322523147!50332093!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19965 invoked from network); 28 Nov 2011 23:32:28 -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;
	28 Nov 2011 23:32: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 1RVAnP-0001jX-HA
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhO-0000rO-Gh
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:22 +0000
Message-Id: <E1RVAhO-0000rO-Gh@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: ASSERT we are putting the
	right gfn in the XENMAPSPACE_gmfn* cases
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1322152474 0
# Node ID 480531cab3f4468b1ec9b549bc84d66e420ce685
# Parent  a94fc613ab8c88815e3bfc1335493301ace1b38a
x86/mm: ASSERT we are putting the right gfn in the XENMAPSPACE_gmfn* cases

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r a94fc613ab8c -r 480531cab3f4 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Thu Nov 24 16:34:34 2011 +0000
+++ b/xen/arch/x86/mm.c	Thu Nov 24 16:34:34 2011 +0000
@@ -4773,13 +4773,16 @@
     /* Unmap from old location, if any. */
     gpfn = get_gpfn_from_mfn(mfn);
     ASSERT( gpfn != SHARED_M2P_ENTRY );
+    if ( xatp->space == XENMAPSPACE_gmfn ||
+         xatp->space == XENMAPSPACE_gmfn_range )
+        ASSERT( gpfn == gfn );
     if ( gpfn != INVALID_M2P_ENTRY )
         guest_physmap_remove_page(d, gpfn, mfn, PAGE_ORDER_4K);
 
     /* Map at new location. */
     rc = guest_physmap_add_page(d, xatp->gpfn, mfn, PAGE_ORDER_4K);
 
-    /* In the XENMAPSPACE_gmfn, we took a ref and locked the p2m at the top */
+    /* In the XENMAPSPACE_gmfn, we took a ref of the gfn at the top */
     if ( xatp->space == XENMAPSPACE_gmfn ||
          xatp->space == XENMAPSPACE_gmfn_range )
         put_gfn(d, gfn);

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:35 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhb-0000Da-8V; Mon, 28 Nov 2011 23:33:35 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhY-0008PO-KF
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:32 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-216.messagelabs.com!1322523175!5405095!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11344 invoked from network); 28 Nov 2011 23:32:56 -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;
	28 Nov 2011 23:32:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnN-0001jK-GG
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhM-0000qQ-Fj
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:20 +0000
Message-Id: <E1RVAhM-0000qQ-Fj@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] waitqueue: Reorder prepare_to_wait()
	so that vcpu is definitely on the
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1322149765 0
# Node ID de4fe05fe887d8c8ae71022ccd40cc9991def1bf
# Parent  9b65336f688f3b6b15ae11d74cebf88cd41ad19d
waitqueue: Reorder prepare_to_wait() so that vcpu is definitely on the
queue on exit, even after a wakeup.

Otherwise, when we go round the loop in wait_event(), we may not
actually sleep after the first iteration, as we do not put ourselves
back on the queue on wakeup.

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


diff -r 9b65336f688f -r de4fe05fe887 xen/common/wait.c
--- a/xen/common/wait.c	Thu Nov 24 15:48:10 2011 +0000
+++ b/xen/common/wait.c	Thu Nov 24 15:49:25 2011 +0000
@@ -107,6 +107,8 @@
 {
     char *cpu_info = (char *)get_cpu_info();
 
+    ASSERT(wqv->esp == 0);
+
     asm volatile (
 #ifdef CONFIG_X86_64
         "push %%rax; push %%rbx; push %%rcx; push %%rdx; push %%rdi; "
@@ -173,14 +175,13 @@
     struct waitqueue_vcpu *wqv = curr->waitqueue_vcpu;
 
     ASSERT(!in_atomic());
+    __prepare_to_wait(wqv);
+
     ASSERT(list_empty(&wqv->list));
-
     spin_lock(&wq->lock);
     list_add_tail(&wqv->list, &wq->list);
     vcpu_pause_nosync(curr);
     spin_unlock(&wq->lock);
-
-    __prepare_to_wait(wqv);
 }
 
 void finish_wait(struct waitqueue_head *wq)

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:35 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhb-0000Da-8V; Mon, 28 Nov 2011 23:33:35 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhY-0008PO-KF
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:32 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-216.messagelabs.com!1322523175!5405095!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11344 invoked from network); 28 Nov 2011 23:32:56 -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;
	28 Nov 2011 23:32:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnN-0001jK-GG
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhM-0000qQ-Fj
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:20 +0000
Message-Id: <E1RVAhM-0000qQ-Fj@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] waitqueue: Reorder prepare_to_wait()
	so that vcpu is definitely on the
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1322149765 0
# Node ID de4fe05fe887d8c8ae71022ccd40cc9991def1bf
# Parent  9b65336f688f3b6b15ae11d74cebf88cd41ad19d
waitqueue: Reorder prepare_to_wait() so that vcpu is definitely on the
queue on exit, even after a wakeup.

Otherwise, when we go round the loop in wait_event(), we may not
actually sleep after the first iteration, as we do not put ourselves
back on the queue on wakeup.

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


diff -r 9b65336f688f -r de4fe05fe887 xen/common/wait.c
--- a/xen/common/wait.c	Thu Nov 24 15:48:10 2011 +0000
+++ b/xen/common/wait.c	Thu Nov 24 15:49:25 2011 +0000
@@ -107,6 +107,8 @@
 {
     char *cpu_info = (char *)get_cpu_info();
 
+    ASSERT(wqv->esp == 0);
+
     asm volatile (
 #ifdef CONFIG_X86_64
         "push %%rax; push %%rbx; push %%rcx; push %%rdx; push %%rdi; "
@@ -173,14 +175,13 @@
     struct waitqueue_vcpu *wqv = curr->waitqueue_vcpu;
 
     ASSERT(!in_atomic());
+    __prepare_to_wait(wqv);
+
     ASSERT(list_empty(&wqv->list));
-
     spin_lock(&wq->lock);
     list_add_tail(&wqv->list, &wq->list);
     vcpu_pause_nosync(curr);
     spin_unlock(&wq->lock);
-
-    __prepare_to_wait(wqv);
 }
 
 void finish_wait(struct waitqueue_head *wq)

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:35 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhb-0000Dn-BD; Mon, 28 Nov 2011 23:33:35 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhY-0008TR-Oq
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:32 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1322523147!50332093!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19965 invoked from network); 28 Nov 2011 23:32:28 -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;
	28 Nov 2011 23:32: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 1RVAnP-0001jX-HA
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhO-0000rO-Gh
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:22 +0000
Message-Id: <E1RVAhO-0000rO-Gh@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: ASSERT we are putting the
	right gfn in the XENMAPSPACE_gmfn* cases
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1322152474 0
# Node ID 480531cab3f4468b1ec9b549bc84d66e420ce685
# Parent  a94fc613ab8c88815e3bfc1335493301ace1b38a
x86/mm: ASSERT we are putting the right gfn in the XENMAPSPACE_gmfn* cases

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r a94fc613ab8c -r 480531cab3f4 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Thu Nov 24 16:34:34 2011 +0000
+++ b/xen/arch/x86/mm.c	Thu Nov 24 16:34:34 2011 +0000
@@ -4773,13 +4773,16 @@
     /* Unmap from old location, if any. */
     gpfn = get_gpfn_from_mfn(mfn);
     ASSERT( gpfn != SHARED_M2P_ENTRY );
+    if ( xatp->space == XENMAPSPACE_gmfn ||
+         xatp->space == XENMAPSPACE_gmfn_range )
+        ASSERT( gpfn == gfn );
     if ( gpfn != INVALID_M2P_ENTRY )
         guest_physmap_remove_page(d, gpfn, mfn, PAGE_ORDER_4K);
 
     /* Map at new location. */
     rc = guest_physmap_add_page(d, xatp->gpfn, mfn, PAGE_ORDER_4K);
 
-    /* In the XENMAPSPACE_gmfn, we took a ref and locked the p2m at the top */
+    /* In the XENMAPSPACE_gmfn, we took a ref of the gfn at the top */
     if ( xatp->space == XENMAPSPACE_gmfn ||
          xatp->space == XENMAPSPACE_gmfn_range )
         put_gfn(d, gfn);

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:35 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhb-0000E0-FA; Mon, 28 Nov 2011 23:33:35 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhZ-0008RB-OG
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:33 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-182.messagelabs.com!1322523176!5044920!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5982 invoked from network); 28 Nov 2011 23:32:57 -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;
	28 Nov 2011 23:32:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnO-0001jR-Fv
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhN-0000qu-FQ
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:21 +0000
Message-Id: <E1RVAhN-0000qu-FQ@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: fix domain-paging's
	interaction with log-dirty
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1322152474 0
# Node ID e6100a0832cebe6a66005c2fa2c994a0784e8e93
# Parent  ca92c4a8b31f2af73b18e4c7dae193d7ecb598b8
x86/mm: fix domain-paging's interaction with log-dirty

Allow pages typed log dirty to be paged out, and the proper type to
restored when paging pages back in.

Signed-off-by: Andres lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Adin Scannell <adin@scannell.ca>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r ca92c4a8b31f -r e6100a0832ce xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Thu Nov 24 15:50:08 2011 +0000
+++ b/xen/arch/x86/mm/p2m.c	Thu Nov 24 16:34:34 2011 +0000
@@ -1061,7 +1061,9 @@
         if ( mfn_valid(mfn) && 
              (p2mt == p2m_ram_paging_in || p2mt == p2m_ram_paging_in_start) )
         {
-            set_p2m_entry(p2m, rsp.gfn, mfn, PAGE_ORDER_4K, p2m_ram_rw, a);
+            set_p2m_entry(p2m, rsp.gfn, mfn, PAGE_ORDER_4K, 
+                            paging_mode_log_dirty(d) ? p2m_ram_logdirty : p2m_ram_rw, 
+                            a);
             set_gpfn_from_mfn(mfn_x(mfn), rsp.gfn);
             audit_p2m(p2m, 1);
         }
diff -r ca92c4a8b31f -r e6100a0832ce xen/include/asm-x86/p2m.h
--- a/xen/include/asm-x86/p2m.h	Thu Nov 24 15:50:08 2011 +0000
+++ b/xen/include/asm-x86/p2m.h	Thu Nov 24 16:34:34 2011 +0000
@@ -150,7 +150,8 @@
 #define P2M_MAGIC_TYPES (p2m_to_mask(p2m_populate_on_demand))
 
 /* Pageable types */
-#define P2M_PAGEABLE_TYPES (p2m_to_mask(p2m_ram_rw))
+#define P2M_PAGEABLE_TYPES (p2m_to_mask(p2m_ram_rw) \
+                            | p2m_to_mask(p2m_ram_logdirty) )
 
 #define P2M_PAGING_TYPES (p2m_to_mask(p2m_ram_paging_out)        \
                           | p2m_to_mask(p2m_ram_paged)           \

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:35 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhb-0000E0-FA; Mon, 28 Nov 2011 23:33:35 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhZ-0008RB-OG
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:33 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-182.messagelabs.com!1322523176!5044920!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5982 invoked from network); 28 Nov 2011 23:32:57 -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;
	28 Nov 2011 23:32:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnO-0001jR-Fv
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhN-0000qu-FQ
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:21 +0000
Message-Id: <E1RVAhN-0000qu-FQ@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: fix domain-paging's
	interaction with log-dirty
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1322152474 0
# Node ID e6100a0832cebe6a66005c2fa2c994a0784e8e93
# Parent  ca92c4a8b31f2af73b18e4c7dae193d7ecb598b8
x86/mm: fix domain-paging's interaction with log-dirty

Allow pages typed log dirty to be paged out, and the proper type to
restored when paging pages back in.

Signed-off-by: Andres lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Adin Scannell <adin@scannell.ca>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r ca92c4a8b31f -r e6100a0832ce xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Thu Nov 24 15:50:08 2011 +0000
+++ b/xen/arch/x86/mm/p2m.c	Thu Nov 24 16:34:34 2011 +0000
@@ -1061,7 +1061,9 @@
         if ( mfn_valid(mfn) && 
              (p2mt == p2m_ram_paging_in || p2mt == p2m_ram_paging_in_start) )
         {
-            set_p2m_entry(p2m, rsp.gfn, mfn, PAGE_ORDER_4K, p2m_ram_rw, a);
+            set_p2m_entry(p2m, rsp.gfn, mfn, PAGE_ORDER_4K, 
+                            paging_mode_log_dirty(d) ? p2m_ram_logdirty : p2m_ram_rw, 
+                            a);
             set_gpfn_from_mfn(mfn_x(mfn), rsp.gfn);
             audit_p2m(p2m, 1);
         }
diff -r ca92c4a8b31f -r e6100a0832ce xen/include/asm-x86/p2m.h
--- a/xen/include/asm-x86/p2m.h	Thu Nov 24 15:50:08 2011 +0000
+++ b/xen/include/asm-x86/p2m.h	Thu Nov 24 16:34:34 2011 +0000
@@ -150,7 +150,8 @@
 #define P2M_MAGIC_TYPES (p2m_to_mask(p2m_populate_on_demand))
 
 /* Pageable types */
-#define P2M_PAGEABLE_TYPES (p2m_to_mask(p2m_ram_rw))
+#define P2M_PAGEABLE_TYPES (p2m_to_mask(p2m_ram_rw) \
+                            | p2m_to_mask(p2m_ram_logdirty) )
 
 #define P2M_PAGING_TYPES (p2m_to_mask(p2m_ram_paging_out)        \
                           | p2m_to_mask(p2m_ram_paged)           \

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:37 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhc-0000H2-Jv; Mon, 28 Nov 2011 23:33:36 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhb-0008U8-7T
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:35 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-216.messagelabs.com!1322523177!6727471!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19185 invoked from network); 28 Nov 2011 23:32:58 -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;
	28 Nov 2011 23:32:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnQ-0001ja-0k
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhP-0000rd-0I
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:23 +0000
Message-Id: <E1RVAhP-0000rd-0I@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: small fixes to pcpu platform op
	handling
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1322153786 -3600
# Node ID 9c6bea25f71233787a36893deaf0e811f2dcb8d8
# Parent  480531cab3f4468b1ec9b549bc84d66e420ce685
x86: small fixes to pcpu platform op handling

XENPF_get_cpuinfo should init the flags output field rather than only
modify it.

XENPF_cpu_online must check for the input CPU number to be in range.

XENPF_cpu_offline must also do that, and should also reject attempts to
offline CPU 0 (this fails in cpu_down() too, but preventing this here
appears more correct given that the code here calls
continue_hypercall_on_cpu(0, ...), which would be flawed if cpu_down()
would ever allow bringing down CPU 0 (and a distinct error code is
easier to deal with when debugging issues).

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


diff -r 480531cab3f4 -r 9c6bea25f712 xen/arch/x86/platform_hypercall.c
--- a/xen/arch/x86/platform_hypercall.c	Thu Nov 24 16:34:34 2011 +0000
+++ b/xen/arch/x86/platform_hypercall.c	Thu Nov 24 17:56:26 2011 +0100
@@ -449,13 +449,14 @@
         if ( (g_info->xen_cpuid >= nr_cpu_ids) ||
              !cpu_present(g_info->xen_cpuid) )
         {
-            g_info->flags |= XEN_PCPU_FLAGS_INVALID;
+            g_info->flags = XEN_PCPU_FLAGS_INVALID;
         }
         else
         {
             g_info->apic_id = x86_cpu_to_apicid[g_info->xen_cpuid];
             g_info->acpi_id = acpi_get_processor_id(g_info->xen_cpuid);
             ASSERT(g_info->apic_id != BAD_APICID);
+            g_info->flags = 0;
             if (cpu_online(g_info->xen_cpuid))
                 g_info->flags |= XEN_PCPU_FLAGS_ONLINE;
         }
@@ -472,7 +473,7 @@
     {
         int cpu = op->u.cpu_ol.cpuid;
 
-        if ( !cpu_present(cpu) )
+        if ( cpu >= nr_cpu_ids || !cpu_present(cpu) )
         {
             ret = -EINVAL;
             break;
@@ -493,7 +494,13 @@
     {
         int cpu = op->u.cpu_ol.cpuid;
 
-        if ( !cpu_present(cpu) )
+        if ( cpu == 0 )
+        {
+            ret = -EOPNOTSUPP;
+            break;
+        }
+
+        if ( cpu >= nr_cpu_ids || !cpu_present(cpu) )
         {
             ret = -EINVAL;
             break;

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:37 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhc-0000H2-Jv; Mon, 28 Nov 2011 23:33:36 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhb-0008U8-7T
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:35 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-216.messagelabs.com!1322523177!6727471!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19185 invoked from network); 28 Nov 2011 23:32:58 -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;
	28 Nov 2011 23:32:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnQ-0001ja-0k
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhP-0000rd-0I
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:23 +0000
Message-Id: <E1RVAhP-0000rd-0I@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: small fixes to pcpu platform op
	handling
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1322153786 -3600
# Node ID 9c6bea25f71233787a36893deaf0e811f2dcb8d8
# Parent  480531cab3f4468b1ec9b549bc84d66e420ce685
x86: small fixes to pcpu platform op handling

XENPF_get_cpuinfo should init the flags output field rather than only
modify it.

XENPF_cpu_online must check for the input CPU number to be in range.

XENPF_cpu_offline must also do that, and should also reject attempts to
offline CPU 0 (this fails in cpu_down() too, but preventing this here
appears more correct given that the code here calls
continue_hypercall_on_cpu(0, ...), which would be flawed if cpu_down()
would ever allow bringing down CPU 0 (and a distinct error code is
easier to deal with when debugging issues).

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


diff -r 480531cab3f4 -r 9c6bea25f712 xen/arch/x86/platform_hypercall.c
--- a/xen/arch/x86/platform_hypercall.c	Thu Nov 24 16:34:34 2011 +0000
+++ b/xen/arch/x86/platform_hypercall.c	Thu Nov 24 17:56:26 2011 +0100
@@ -449,13 +449,14 @@
         if ( (g_info->xen_cpuid >= nr_cpu_ids) ||
              !cpu_present(g_info->xen_cpuid) )
         {
-            g_info->flags |= XEN_PCPU_FLAGS_INVALID;
+            g_info->flags = XEN_PCPU_FLAGS_INVALID;
         }
         else
         {
             g_info->apic_id = x86_cpu_to_apicid[g_info->xen_cpuid];
             g_info->acpi_id = acpi_get_processor_id(g_info->xen_cpuid);
             ASSERT(g_info->apic_id != BAD_APICID);
+            g_info->flags = 0;
             if (cpu_online(g_info->xen_cpuid))
                 g_info->flags |= XEN_PCPU_FLAGS_ONLINE;
         }
@@ -472,7 +473,7 @@
     {
         int cpu = op->u.cpu_ol.cpuid;
 
-        if ( !cpu_present(cpu) )
+        if ( cpu >= nr_cpu_ids || !cpu_present(cpu) )
         {
             ret = -EINVAL;
             break;
@@ -493,7 +494,13 @@
     {
         int cpu = op->u.cpu_ol.cpuid;
 
-        if ( !cpu_present(cpu) )
+        if ( cpu == 0 )
+        {
+            ret = -EOPNOTSUPP;
+            break;
+        }
+
+        if ( cpu >= nr_cpu_ids || !cpu_present(cpu) )
         {
             ret = -EINVAL;
             break;

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:38 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhe-0000KE-1D; Mon, 28 Nov 2011 23:33:38 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhb-0008Uh-NT
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:35 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-182.messagelabs.com!1322523178!5030761!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9032 invoked from network); 28 Nov 2011 23:32:59 -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;
	28 Nov 2011 23:32:59 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnQ-0001je-GS
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhP-0000rs-Fx
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:23 +0000
Message-Id: <E1RVAhP-0000rs-Fx@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:23 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libvchan: clean *.opic
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322154033 0
# Node ID 573b1acedcc0953cfb103a54990396dcf7ac2339
# Parent  9c6bea25f71233787a36893deaf0e811f2dcb8d8
libvchan: clean *.opic

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


diff -r 9c6bea25f712 -r 573b1acedcc0 tools/libvchan/Makefile
--- a/tools/libvchan/Makefile	Thu Nov 24 17:56:26 2011 +0100
+++ b/tools/libvchan/Makefile	Thu Nov 24 17:00:33 2011 +0000
@@ -52,7 +52,7 @@
 
 .PHONY: clean
 clean:
-	$(RM) -f *.o *.so* *.a vchan-node1 vchan-node2 $(DEPS)
+	$(RM) -f *.o *.opic *.so* *.a vchan-node1 vchan-node2 $(DEPS)
 
 distclean: clean
 

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:38 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhd-0000Jo-SR; Mon, 28 Nov 2011 23:33: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 1RVAhb-00005s-6P
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:35 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-27.messagelabs.com!1322523073!54065369!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26193 invoked from network); 28 Nov 2011 23:31:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Nov 2011 23:31: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 1RVAnR-0001jq-Ft
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhQ-0000sM-FL
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:24 +0000
Message-Id: <E1RVAhQ-0000sM-FL@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:24 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Fix liveness of pages in
	grant copy operations
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1322154325 0
# Node ID 8fb3fa6218c600393c946ab85c7635299208a66d
# Parent  f011ebdce88bf95c5021777d4377bb016a2f0275
x86/mm: Fix liveness of pages in grant copy operations

We were immediately putting the p2m entry translation for grant
copy operations. This allowed for an unnecessary race by which the
page could have been swapped out between the p2m lookup and the actual
use. Hold on to the p2m entries until the grant operation finishes.

Also fixes a small bug: for the source page of the copy, get_page
was assuming the page was owned by the source domain. It may be a
shared page, since we don't perform an unsharing p2m lookup.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r f011ebdce88b -r 8fb3fa6218c6 xen/common/grant_table.c
--- a/xen/common/grant_table.c	Thu Nov 24 17:05:25 2011 +0000
+++ b/xen/common/grant_table.c	Thu Nov 24 17:05:25 2011 +0000
@@ -1723,11 +1723,12 @@
 /* Grab a frame number from a grant entry and update the flags and pin
    count as appropriate.  Note that this does *not* update the page
    type or reference counts, and does not check that the mfn is
-   actually valid. */
+   actually valid. If *gfn != INVALID_GFN, and rc == GNTST_okay, then
+   we leave this function holding the p2m entry for *gfn in *owning_domain */
 static int
 __acquire_grant_for_copy(
     struct domain *rd, unsigned long gref, struct domain *ld, int readonly,
-    unsigned long *frame, unsigned *page_off, unsigned *length,
+    unsigned long *frame, unsigned long *gfn, unsigned *page_off, unsigned *length,
     unsigned allow_transitive, struct domain **owning_domain)
 {
     grant_entry_v1_t *sha1;
@@ -1739,7 +1740,6 @@
     domid_t trans_domid;
     grant_ref_t trans_gref;
     struct domain *td;
-    unsigned long gfn;
     unsigned long grant_frame;
     unsigned trans_page_off;
     unsigned trans_length;
@@ -1748,6 +1748,7 @@
     s16 rc = GNTST_okay;
 
     *owning_domain = NULL;
+    *gfn = INVALID_GFN;
 
     spin_lock(&rd->grant_table->lock);
 
@@ -1824,7 +1825,7 @@
             spin_unlock(&rd->grant_table->lock);
 
             rc = __acquire_grant_for_copy(td, trans_gref, rd,
-                                          readonly, &grant_frame,
+                                          readonly, &grant_frame, gfn,
                                           &trans_page_off, &trans_length,
                                           0, &ignore);
 
@@ -1846,7 +1847,7 @@
 	        rcu_unlock_domain(td);
                 spin_unlock(&rd->grant_table->lock);
                 return __acquire_grant_for_copy(rd, gref, ld, readonly,
-                                                frame, page_off, length,
+                                                frame, gfn, page_off, length,
                                                 allow_transitive,
                                                 owning_domain);
             }
@@ -1860,13 +1861,11 @@
         }
         else if ( sha1 )
         {
-            gfn = sha1->frame;
-            rc = __get_paged_frame(gfn, &grant_frame, readonly, rd);
-            /* We drop this immediately per the comments at the top */
-            put_gfn(rd, gfn);
+            *gfn = sha1->frame;
+            rc = __get_paged_frame(*gfn, &grant_frame, readonly, rd);
             if ( rc != GNTST_okay )
                 goto unlock_out;
-            act->gfn = gfn;
+            act->gfn = *gfn;
             is_sub_page = 0;
             trans_page_off = 0;
             trans_length = PAGE_SIZE;
@@ -1874,12 +1873,11 @@
         }
         else if ( !(sha2->hdr.flags & GTF_sub_page) )
         {
-            gfn = sha2->full_page.frame;
-            rc = __get_paged_frame(gfn, &grant_frame, readonly, rd);
-            put_gfn(rd, gfn);
+            *gfn = sha2->full_page.frame;
+            rc = __get_paged_frame(*gfn, &grant_frame, readonly, rd);
             if ( rc != GNTST_okay )
                 goto unlock_out;
-            act->gfn = gfn;
+            act->gfn = *gfn;
             is_sub_page = 0;
             trans_page_off = 0;
             trans_length = PAGE_SIZE;
@@ -1887,12 +1885,11 @@
         }
         else
         {
-            gfn = sha2->sub_page.frame;
-            rc = __get_paged_frame(gfn, &grant_frame, readonly, rd);
-            put_gfn(rd, gfn);
+            *gfn = sha2->sub_page.frame;
+            rc = __get_paged_frame(*gfn, &grant_frame, readonly, rd);
             if ( rc != GNTST_okay )
                 goto unlock_out;
-            act->gfn = gfn;
+            act->gfn = *gfn;
             is_sub_page = 1;
             trans_page_off = sha2->sub_page.page_off;
             trans_length = sha2->sub_page.length;
@@ -1932,7 +1929,7 @@
 {
     struct domain *sd = NULL, *dd = NULL;
     struct domain *source_domain = NULL, *dest_domain = NULL;
-    unsigned long s_frame, d_frame;
+    unsigned long s_frame, d_frame, s_gfn = INVALID_GFN, d_gfn = INVALID_GFN;
     char *sp, *dp;
     s16 rc = GNTST_okay;
     int have_d_grant = 0, have_s_grant = 0, have_s_ref = 0;
@@ -1973,14 +1970,14 @@
     {
         unsigned source_off, source_len;
         rc = __acquire_grant_for_copy(sd, op->source.u.ref, current->domain, 1,
-                                      &s_frame, &source_off, &source_len, 1,
+                                      &s_frame, &s_gfn, &source_off, &source_len, 1,
                                       &source_domain);
         if ( rc != GNTST_okay )
             goto error_out;
         have_s_grant = 1;
         if ( op->source.offset < source_off ||
              op->len > source_len )
-            PIN_FAIL(error_out, GNTST_general_error,
+            PIN_FAIL(error_put_s_gfn, GNTST_general_error,
                      "copy source out of bounds: %d < %d || %d > %d\n",
                      op->source.offset, source_off,
                      op->len, source_len);
@@ -1988,8 +1985,8 @@
     else
     {
 #ifdef CONFIG_X86
+        s_gfn = op->source.u.gmfn;
         rc = __get_paged_frame(op->source.u.gmfn, &s_frame, 1, sd);
-        put_gfn(sd, op->source.u.gmfn);
         if ( rc != GNTST_okay )
             goto error_out;
 #else
@@ -1998,14 +1995,16 @@
         source_domain = sd;
     }
     if ( unlikely(!mfn_valid(s_frame)) )
-        PIN_FAIL(error_out, GNTST_general_error,
+        PIN_FAIL(error_put_s_gfn, GNTST_general_error,
                  "source frame %lx invalid.\n", s_frame);
-    if ( !get_page(mfn_to_page(s_frame), source_domain) )
+    /* For the source frame, the page could still be shared, so
+     * don't assume ownership by source_domain */
+    if ( !page_get_owner_and_reference(mfn_to_page(s_frame)) )
     {
         if ( !sd->is_dying )
             gdprintk(XENLOG_WARNING, "Could not get src frame %lx\n", s_frame);
         rc = GNTST_general_error;
-        goto error_out;
+        goto error_put_s_gfn;
     }
     have_s_ref = 1;
 
@@ -2013,14 +2012,14 @@
     {
         unsigned dest_off, dest_len;
         rc = __acquire_grant_for_copy(dd, op->dest.u.ref, current->domain, 0,
-                                      &d_frame, &dest_off, &dest_len, 1,
+                                      &d_frame, &d_gfn, &dest_off, &dest_len, 1,
                                       &dest_domain);
         if ( rc != GNTST_okay )
-            goto error_out;
+            goto error_put_s_gfn;
         have_d_grant = 1;
         if ( op->dest.offset < dest_off ||
              op->len > dest_len )
-            PIN_FAIL(error_out, GNTST_general_error,
+            PIN_FAIL(error_put_d_gfn, GNTST_general_error,
                      "copy dest out of bounds: %d < %d || %d > %d\n",
                      op->dest.offset, dest_off,
                      op->len, dest_len);
@@ -2028,17 +2027,17 @@
     else
     {
 #ifdef CONFIG_X86
+        d_gfn = op->dest.u.gmfn;
         rc = __get_paged_frame(op->dest.u.gmfn, &d_frame, 0, dd);
-        put_gfn(dd, op->dest.u.gmfn);
         if ( rc != GNTST_okay )
-            goto error_out;
+            goto error_put_s_gfn;
 #else
         d_frame = gmfn_to_mfn(dd, op->dest.u.gmfn);
 #endif
         dest_domain = dd;
     }
     if ( unlikely(!mfn_valid(d_frame)) )
-        PIN_FAIL(error_out, GNTST_general_error,
+        PIN_FAIL(error_put_d_gfn, GNTST_general_error,
                  "destination frame %lx invalid.\n", d_frame);
     if ( !get_page_and_type(mfn_to_page(d_frame), dest_domain,
                             PGT_writable_page) )
@@ -2046,7 +2045,7 @@
         if ( !dd->is_dying )
             gdprintk(XENLOG_WARNING, "Could not get dst frame %lx\n", d_frame);
         rc = GNTST_general_error;
-        goto error_out;
+        goto error_put_d_gfn;
     }
 
     sp = map_domain_page(s_frame);
@@ -2060,6 +2059,12 @@
     gnttab_mark_dirty(dd, d_frame);
 
     put_page_and_type(mfn_to_page(d_frame));
+ error_put_d_gfn:
+    if ( (d_gfn != INVALID_GFN) && (dest_domain) )
+        put_gfn(dest_domain, d_gfn);
+ error_put_s_gfn:
+    if ( (s_gfn != INVALID_GFN) && (source_domain) )
+        put_gfn(source_domain, s_gfn);
  error_out:
     if ( have_s_ref )
         put_page(mfn_to_page(s_frame));

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:38 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhe-0000KE-1D; Mon, 28 Nov 2011 23:33:38 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhb-0008Uh-NT
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:35 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-182.messagelabs.com!1322523178!5030761!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9032 invoked from network); 28 Nov 2011 23:32:59 -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;
	28 Nov 2011 23:32:59 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnQ-0001je-GS
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhP-0000rs-Fx
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:23 +0000
Message-Id: <E1RVAhP-0000rs-Fx@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:23 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libvchan: clean *.opic
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322154033 0
# Node ID 573b1acedcc0953cfb103a54990396dcf7ac2339
# Parent  9c6bea25f71233787a36893deaf0e811f2dcb8d8
libvchan: clean *.opic

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


diff -r 9c6bea25f712 -r 573b1acedcc0 tools/libvchan/Makefile
--- a/tools/libvchan/Makefile	Thu Nov 24 17:56:26 2011 +0100
+++ b/tools/libvchan/Makefile	Thu Nov 24 17:00:33 2011 +0000
@@ -52,7 +52,7 @@
 
 .PHONY: clean
 clean:
-	$(RM) -f *.o *.so* *.a vchan-node1 vchan-node2 $(DEPS)
+	$(RM) -f *.o *.opic *.so* *.a vchan-node1 vchan-node2 $(DEPS)
 
 distclean: clean
 

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:38 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhd-0000Jo-SR; Mon, 28 Nov 2011 23:33: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 1RVAhb-00005s-6P
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:35 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-27.messagelabs.com!1322523073!54065369!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26193 invoked from network); 28 Nov 2011 23:31:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Nov 2011 23:31: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 1RVAnR-0001jq-Ft
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhQ-0000sM-FL
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:24 +0000
Message-Id: <E1RVAhQ-0000sM-FL@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:24 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Fix liveness of pages in
	grant copy operations
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1322154325 0
# Node ID 8fb3fa6218c600393c946ab85c7635299208a66d
# Parent  f011ebdce88bf95c5021777d4377bb016a2f0275
x86/mm: Fix liveness of pages in grant copy operations

We were immediately putting the p2m entry translation for grant
copy operations. This allowed for an unnecessary race by which the
page could have been swapped out between the p2m lookup and the actual
use. Hold on to the p2m entries until the grant operation finishes.

Also fixes a small bug: for the source page of the copy, get_page
was assuming the page was owned by the source domain. It may be a
shared page, since we don't perform an unsharing p2m lookup.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r f011ebdce88b -r 8fb3fa6218c6 xen/common/grant_table.c
--- a/xen/common/grant_table.c	Thu Nov 24 17:05:25 2011 +0000
+++ b/xen/common/grant_table.c	Thu Nov 24 17:05:25 2011 +0000
@@ -1723,11 +1723,12 @@
 /* Grab a frame number from a grant entry and update the flags and pin
    count as appropriate.  Note that this does *not* update the page
    type or reference counts, and does not check that the mfn is
-   actually valid. */
+   actually valid. If *gfn != INVALID_GFN, and rc == GNTST_okay, then
+   we leave this function holding the p2m entry for *gfn in *owning_domain */
 static int
 __acquire_grant_for_copy(
     struct domain *rd, unsigned long gref, struct domain *ld, int readonly,
-    unsigned long *frame, unsigned *page_off, unsigned *length,
+    unsigned long *frame, unsigned long *gfn, unsigned *page_off, unsigned *length,
     unsigned allow_transitive, struct domain **owning_domain)
 {
     grant_entry_v1_t *sha1;
@@ -1739,7 +1740,6 @@
     domid_t trans_domid;
     grant_ref_t trans_gref;
     struct domain *td;
-    unsigned long gfn;
     unsigned long grant_frame;
     unsigned trans_page_off;
     unsigned trans_length;
@@ -1748,6 +1748,7 @@
     s16 rc = GNTST_okay;
 
     *owning_domain = NULL;
+    *gfn = INVALID_GFN;
 
     spin_lock(&rd->grant_table->lock);
 
@@ -1824,7 +1825,7 @@
             spin_unlock(&rd->grant_table->lock);
 
             rc = __acquire_grant_for_copy(td, trans_gref, rd,
-                                          readonly, &grant_frame,
+                                          readonly, &grant_frame, gfn,
                                           &trans_page_off, &trans_length,
                                           0, &ignore);
 
@@ -1846,7 +1847,7 @@
 	        rcu_unlock_domain(td);
                 spin_unlock(&rd->grant_table->lock);
                 return __acquire_grant_for_copy(rd, gref, ld, readonly,
-                                                frame, page_off, length,
+                                                frame, gfn, page_off, length,
                                                 allow_transitive,
                                                 owning_domain);
             }
@@ -1860,13 +1861,11 @@
         }
         else if ( sha1 )
         {
-            gfn = sha1->frame;
-            rc = __get_paged_frame(gfn, &grant_frame, readonly, rd);
-            /* We drop this immediately per the comments at the top */
-            put_gfn(rd, gfn);
+            *gfn = sha1->frame;
+            rc = __get_paged_frame(*gfn, &grant_frame, readonly, rd);
             if ( rc != GNTST_okay )
                 goto unlock_out;
-            act->gfn = gfn;
+            act->gfn = *gfn;
             is_sub_page = 0;
             trans_page_off = 0;
             trans_length = PAGE_SIZE;
@@ -1874,12 +1873,11 @@
         }
         else if ( !(sha2->hdr.flags & GTF_sub_page) )
         {
-            gfn = sha2->full_page.frame;
-            rc = __get_paged_frame(gfn, &grant_frame, readonly, rd);
-            put_gfn(rd, gfn);
+            *gfn = sha2->full_page.frame;
+            rc = __get_paged_frame(*gfn, &grant_frame, readonly, rd);
             if ( rc != GNTST_okay )
                 goto unlock_out;
-            act->gfn = gfn;
+            act->gfn = *gfn;
             is_sub_page = 0;
             trans_page_off = 0;
             trans_length = PAGE_SIZE;
@@ -1887,12 +1885,11 @@
         }
         else
         {
-            gfn = sha2->sub_page.frame;
-            rc = __get_paged_frame(gfn, &grant_frame, readonly, rd);
-            put_gfn(rd, gfn);
+            *gfn = sha2->sub_page.frame;
+            rc = __get_paged_frame(*gfn, &grant_frame, readonly, rd);
             if ( rc != GNTST_okay )
                 goto unlock_out;
-            act->gfn = gfn;
+            act->gfn = *gfn;
             is_sub_page = 1;
             trans_page_off = sha2->sub_page.page_off;
             trans_length = sha2->sub_page.length;
@@ -1932,7 +1929,7 @@
 {
     struct domain *sd = NULL, *dd = NULL;
     struct domain *source_domain = NULL, *dest_domain = NULL;
-    unsigned long s_frame, d_frame;
+    unsigned long s_frame, d_frame, s_gfn = INVALID_GFN, d_gfn = INVALID_GFN;
     char *sp, *dp;
     s16 rc = GNTST_okay;
     int have_d_grant = 0, have_s_grant = 0, have_s_ref = 0;
@@ -1973,14 +1970,14 @@
     {
         unsigned source_off, source_len;
         rc = __acquire_grant_for_copy(sd, op->source.u.ref, current->domain, 1,
-                                      &s_frame, &source_off, &source_len, 1,
+                                      &s_frame, &s_gfn, &source_off, &source_len, 1,
                                       &source_domain);
         if ( rc != GNTST_okay )
             goto error_out;
         have_s_grant = 1;
         if ( op->source.offset < source_off ||
              op->len > source_len )
-            PIN_FAIL(error_out, GNTST_general_error,
+            PIN_FAIL(error_put_s_gfn, GNTST_general_error,
                      "copy source out of bounds: %d < %d || %d > %d\n",
                      op->source.offset, source_off,
                      op->len, source_len);
@@ -1988,8 +1985,8 @@
     else
     {
 #ifdef CONFIG_X86
+        s_gfn = op->source.u.gmfn;
         rc = __get_paged_frame(op->source.u.gmfn, &s_frame, 1, sd);
-        put_gfn(sd, op->source.u.gmfn);
         if ( rc != GNTST_okay )
             goto error_out;
 #else
@@ -1998,14 +1995,16 @@
         source_domain = sd;
     }
     if ( unlikely(!mfn_valid(s_frame)) )
-        PIN_FAIL(error_out, GNTST_general_error,
+        PIN_FAIL(error_put_s_gfn, GNTST_general_error,
                  "source frame %lx invalid.\n", s_frame);
-    if ( !get_page(mfn_to_page(s_frame), source_domain) )
+    /* For the source frame, the page could still be shared, so
+     * don't assume ownership by source_domain */
+    if ( !page_get_owner_and_reference(mfn_to_page(s_frame)) )
     {
         if ( !sd->is_dying )
             gdprintk(XENLOG_WARNING, "Could not get src frame %lx\n", s_frame);
         rc = GNTST_general_error;
-        goto error_out;
+        goto error_put_s_gfn;
     }
     have_s_ref = 1;
 
@@ -2013,14 +2012,14 @@
     {
         unsigned dest_off, dest_len;
         rc = __acquire_grant_for_copy(dd, op->dest.u.ref, current->domain, 0,
-                                      &d_frame, &dest_off, &dest_len, 1,
+                                      &d_frame, &d_gfn, &dest_off, &dest_len, 1,
                                       &dest_domain);
         if ( rc != GNTST_okay )
-            goto error_out;
+            goto error_put_s_gfn;
         have_d_grant = 1;
         if ( op->dest.offset < dest_off ||
              op->len > dest_len )
-            PIN_FAIL(error_out, GNTST_general_error,
+            PIN_FAIL(error_put_d_gfn, GNTST_general_error,
                      "copy dest out of bounds: %d < %d || %d > %d\n",
                      op->dest.offset, dest_off,
                      op->len, dest_len);
@@ -2028,17 +2027,17 @@
     else
     {
 #ifdef CONFIG_X86
+        d_gfn = op->dest.u.gmfn;
         rc = __get_paged_frame(op->dest.u.gmfn, &d_frame, 0, dd);
-        put_gfn(dd, op->dest.u.gmfn);
         if ( rc != GNTST_okay )
-            goto error_out;
+            goto error_put_s_gfn;
 #else
         d_frame = gmfn_to_mfn(dd, op->dest.u.gmfn);
 #endif
         dest_domain = dd;
     }
     if ( unlikely(!mfn_valid(d_frame)) )
-        PIN_FAIL(error_out, GNTST_general_error,
+        PIN_FAIL(error_put_d_gfn, GNTST_general_error,
                  "destination frame %lx invalid.\n", d_frame);
     if ( !get_page_and_type(mfn_to_page(d_frame), dest_domain,
                             PGT_writable_page) )
@@ -2046,7 +2045,7 @@
         if ( !dd->is_dying )
             gdprintk(XENLOG_WARNING, "Could not get dst frame %lx\n", d_frame);
         rc = GNTST_general_error;
-        goto error_out;
+        goto error_put_d_gfn;
     }
 
     sp = map_domain_page(s_frame);
@@ -2060,6 +2059,12 @@
     gnttab_mark_dirty(dd, d_frame);
 
     put_page_and_type(mfn_to_page(d_frame));
+ error_put_d_gfn:
+    if ( (d_gfn != INVALID_GFN) && (dest_domain) )
+        put_gfn(dest_domain, d_gfn);
+ error_put_s_gfn:
+    if ( (s_gfn != INVALID_GFN) && (source_domain) )
+        put_gfn(source_domain, s_gfn);
  error_out:
     if ( have_s_ref )
         put_page(mfn_to_page(s_frame));

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:38 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhe-0000LN-EN; Mon, 28 Nov 2011 23:33:38 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhc-0008VX-6Z
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:36 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-216.messagelabs.com!1322523178!5362558!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20255 invoked from network); 28 Nov 2011 23:32:59 -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;
	28 Nov 2011 23:32:59 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnR-0001jh-0H
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhP-0000s7-W3
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:23 +0000
Message-Id: <E1RVAhP-0000s7-W3@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:23 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Ensure liveness of pages
	involved in a guest page table walk
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1322154325 0
# Node ID f011ebdce88bf95c5021777d4377bb016a2f0275
# Parent  573b1acedcc0953cfb103a54990396dcf7ac2339
x86/mm: Ensure liveness of pages involved in a guest page table walk

Instead of risking deadlock by holding onto the gfn's acquired during
a guest page table walk, acquire an extra reference within the get_gfn/
put_gfn critical section, and drop the extra reference when done with
the map. This ensures liveness of the map, i.e. the underlying page
won't be paged out.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 573b1acedcc0 -r f011ebdce88b xen/arch/x86/mm/guest_walk.c
--- a/xen/arch/x86/mm/guest_walk.c	Thu Nov 24 17:00:33 2011 +0000
+++ b/xen/arch/x86/mm/guest_walk.c	Thu Nov 24 17:05:25 2011 +0000
@@ -87,7 +87,7 @@
 }
 
 /* If the map is non-NULL, we leave this function having 
- * called get_gfn, you need to call put_gfn. */
+ * acquired an extra ref on mfn_to_page(*mfn) */
 static inline void *map_domain_gfn(struct p2m_domain *p2m,
                                    gfn_t gfn, 
                                    mfn_t *mfn,
@@ -95,6 +95,7 @@
                                    uint32_t *rc) 
 {
     p2m_access_t p2ma;
+    void *map;
 
     /* Translate the gfn, unsharing if shared */
     *mfn = get_gfn_type_access(p2m, gfn_x(gfn), p2mt, &p2ma, p2m_unshare, NULL);
@@ -120,7 +121,12 @@
     }
     ASSERT(mfn_valid(mfn_x(*mfn)));
     
-    return map_domain_page(mfn_x(*mfn));
+    /* Get an extra ref to the page to ensure liveness of the map.
+     * Then we can safely put gfn */
+    page_get_owner_and_reference(mfn_to_page(mfn_x(*mfn)));
+    map = map_domain_page(mfn_x(*mfn));
+    __put_gfn(p2m, gfn_x(gfn));
+    return map;
 }
 
 
@@ -357,20 +363,20 @@
     if ( l3p ) 
     {
         unmap_domain_page(l3p);
-        __put_gfn(p2m, gfn_x(guest_l4e_get_gfn(gw->l4e)));
+        put_page(mfn_to_page(mfn_x(gw->l3mfn)));
     }
 #endif
 #if GUEST_PAGING_LEVELS >= 3
     if ( l2p ) 
     {
         unmap_domain_page(l2p);
-        __put_gfn(p2m, gfn_x(guest_l3e_get_gfn(gw->l3e))); 
+        put_page(mfn_to_page(mfn_x(gw->l2mfn)));
     }
 #endif
     if ( l1p ) 
     {
         unmap_domain_page(l1p);
-        __put_gfn(p2m, gfn_x(guest_l2e_get_gfn(gw->l2e)));
+        put_page(mfn_to_page(mfn_x(gw->l1mfn)));
     }
 
     return rc;

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:38 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhe-0000Kf-8d; Mon, 28 Nov 2011 23:33:38 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhc-0000EY-5f
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:36 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1322523153!50332104!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20093 invoked from network); 28 Nov 2011 23:32:34 -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;
	28 Nov 2011 23:32: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 1RVAnV-0001kg-Ed
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhU-0000uI-E6
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:28 +0000
Message-Id: <E1RVAhU-0000uI-E6@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:27 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: print gfn in failure case
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1321804901 -3600
# Node ID fbc31627addee315a551dfd33846d5a8a37e8565
# Parent  8ddac056a89e0ba4c3180bf8983c00cf2b85ecb4
xenpaging: print gfn in failure case

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 8ddac056a89e -r fbc31627adde tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Sun Nov 20 17:01:39 2011 +0100
+++ b/tools/xenpaging/xenpaging.c	Sun Nov 20 17:01:41 2011 +0100
@@ -444,7 +444,7 @@
                                 PROT_READ | PROT_WRITE, &gfn, 1);
     if ( page == NULL )
     {
-        PERROR("Error mapping page");
+        PERROR("Error mapping page %lx", victim->gfn);
         goto out;
     }
 
@@ -452,7 +452,7 @@
     ret = write_page(fd, page, i);
     if ( ret != 0 )
     {
-        PERROR("Error copying page");
+        PERROR("Error copying page %lx", victim->gfn);
         munmap(page, PAGE_SIZE);
         goto out;
     }
@@ -464,7 +464,7 @@
                               victim->gfn);
     if ( ret != 0 )
     {
-        PERROR("Error evicting page");
+        PERROR("Error evicting page %lx", victim->gfn);
         goto out;
     }
 
@@ -520,7 +520,7 @@
                 sleep(1);
                 continue;
             }
-            PERROR("Error preparing for page in");
+            PERROR("Error preparing %"PRI_xen_pfn" for page-in", gfn);
             goto out_map;
         }
     }
@@ -532,7 +532,7 @@
                                 PROT_READ | PROT_WRITE, &gfn, 1);
     if ( page == NULL )
     {
-        PERROR("Error mapping page: page is null");
+        PERROR("Error mapping page %"PRI_xen_pfn": page is null", gfn);
         goto out_map;
     }
 
@@ -540,7 +540,7 @@
     ret = read_page(fd, page, i);
     if ( ret != 0 )
     {
-        PERROR("Error reading page");
+        PERROR("Error reading page %"PRI_xen_pfn"", gfn);
         goto out;
     }
 
@@ -710,7 +710,7 @@
                     rc = xenpaging_populate_page(paging, req.gfn, fd, i);
                     if ( rc != 0 )
                     {
-                        PERROR("Error populating page");
+                        PERROR("Error populating page %"PRIx64"", req.gfn);
                         goto out;
                     }
                 }
@@ -723,7 +723,7 @@
                 rc = xenpaging_resume_page(paging, &rsp, 1);
                 if ( rc != 0 )
                 {
-                    PERROR("Error resuming page");
+                    PERROR("Error resuming page %"PRIx64"", req.gfn);
                     goto out;
                 }
 
@@ -754,7 +754,7 @@
                     rc = xenpaging_resume_page(paging, &rsp, 0);
                     if ( rc != 0 )
                     {
-                        PERROR("Error resuming");
+                        PERROR("Error resuming page %"PRIx64"", req.gfn);
                         goto out;
                     }
                 }

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:38 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhe-0000LN-EN; Mon, 28 Nov 2011 23:33:38 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhc-0008VX-6Z
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:36 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-216.messagelabs.com!1322523178!5362558!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20255 invoked from network); 28 Nov 2011 23:32:59 -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;
	28 Nov 2011 23:32:59 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnR-0001jh-0H
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhP-0000s7-W3
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:23 +0000
Message-Id: <E1RVAhP-0000s7-W3@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:23 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Ensure liveness of pages
	involved in a guest page table walk
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1322154325 0
# Node ID f011ebdce88bf95c5021777d4377bb016a2f0275
# Parent  573b1acedcc0953cfb103a54990396dcf7ac2339
x86/mm: Ensure liveness of pages involved in a guest page table walk

Instead of risking deadlock by holding onto the gfn's acquired during
a guest page table walk, acquire an extra reference within the get_gfn/
put_gfn critical section, and drop the extra reference when done with
the map. This ensures liveness of the map, i.e. the underlying page
won't be paged out.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 573b1acedcc0 -r f011ebdce88b xen/arch/x86/mm/guest_walk.c
--- a/xen/arch/x86/mm/guest_walk.c	Thu Nov 24 17:00:33 2011 +0000
+++ b/xen/arch/x86/mm/guest_walk.c	Thu Nov 24 17:05:25 2011 +0000
@@ -87,7 +87,7 @@
 }
 
 /* If the map is non-NULL, we leave this function having 
- * called get_gfn, you need to call put_gfn. */
+ * acquired an extra ref on mfn_to_page(*mfn) */
 static inline void *map_domain_gfn(struct p2m_domain *p2m,
                                    gfn_t gfn, 
                                    mfn_t *mfn,
@@ -95,6 +95,7 @@
                                    uint32_t *rc) 
 {
     p2m_access_t p2ma;
+    void *map;
 
     /* Translate the gfn, unsharing if shared */
     *mfn = get_gfn_type_access(p2m, gfn_x(gfn), p2mt, &p2ma, p2m_unshare, NULL);
@@ -120,7 +121,12 @@
     }
     ASSERT(mfn_valid(mfn_x(*mfn)));
     
-    return map_domain_page(mfn_x(*mfn));
+    /* Get an extra ref to the page to ensure liveness of the map.
+     * Then we can safely put gfn */
+    page_get_owner_and_reference(mfn_to_page(mfn_x(*mfn)));
+    map = map_domain_page(mfn_x(*mfn));
+    __put_gfn(p2m, gfn_x(gfn));
+    return map;
 }
 
 
@@ -357,20 +363,20 @@
     if ( l3p ) 
     {
         unmap_domain_page(l3p);
-        __put_gfn(p2m, gfn_x(guest_l4e_get_gfn(gw->l4e)));
+        put_page(mfn_to_page(mfn_x(gw->l3mfn)));
     }
 #endif
 #if GUEST_PAGING_LEVELS >= 3
     if ( l2p ) 
     {
         unmap_domain_page(l2p);
-        __put_gfn(p2m, gfn_x(guest_l3e_get_gfn(gw->l3e))); 
+        put_page(mfn_to_page(mfn_x(gw->l2mfn)));
     }
 #endif
     if ( l1p ) 
     {
         unmap_domain_page(l1p);
-        __put_gfn(p2m, gfn_x(guest_l2e_get_gfn(gw->l2e)));
+        put_page(mfn_to_page(mfn_x(gw->l1mfn)));
     }
 
     return rc;

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:38 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhe-0000Kf-8d; Mon, 28 Nov 2011 23:33:38 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhc-0000EY-5f
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:36 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1322523153!50332104!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20093 invoked from network); 28 Nov 2011 23:32:34 -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;
	28 Nov 2011 23:32: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 1RVAnV-0001kg-Ed
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhU-0000uI-E6
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:28 +0000
Message-Id: <E1RVAhU-0000uI-E6@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:27 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: print gfn in failure case
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1321804901 -3600
# Node ID fbc31627addee315a551dfd33846d5a8a37e8565
# Parent  8ddac056a89e0ba4c3180bf8983c00cf2b85ecb4
xenpaging: print gfn in failure case

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 8ddac056a89e -r fbc31627adde tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Sun Nov 20 17:01:39 2011 +0100
+++ b/tools/xenpaging/xenpaging.c	Sun Nov 20 17:01:41 2011 +0100
@@ -444,7 +444,7 @@
                                 PROT_READ | PROT_WRITE, &gfn, 1);
     if ( page == NULL )
     {
-        PERROR("Error mapping page");
+        PERROR("Error mapping page %lx", victim->gfn);
         goto out;
     }
 
@@ -452,7 +452,7 @@
     ret = write_page(fd, page, i);
     if ( ret != 0 )
     {
-        PERROR("Error copying page");
+        PERROR("Error copying page %lx", victim->gfn);
         munmap(page, PAGE_SIZE);
         goto out;
     }
@@ -464,7 +464,7 @@
                               victim->gfn);
     if ( ret != 0 )
     {
-        PERROR("Error evicting page");
+        PERROR("Error evicting page %lx", victim->gfn);
         goto out;
     }
 
@@ -520,7 +520,7 @@
                 sleep(1);
                 continue;
             }
-            PERROR("Error preparing for page in");
+            PERROR("Error preparing %"PRI_xen_pfn" for page-in", gfn);
             goto out_map;
         }
     }
@@ -532,7 +532,7 @@
                                 PROT_READ | PROT_WRITE, &gfn, 1);
     if ( page == NULL )
     {
-        PERROR("Error mapping page: page is null");
+        PERROR("Error mapping page %"PRI_xen_pfn": page is null", gfn);
         goto out_map;
     }
 
@@ -540,7 +540,7 @@
     ret = read_page(fd, page, i);
     if ( ret != 0 )
     {
-        PERROR("Error reading page");
+        PERROR("Error reading page %"PRI_xen_pfn"", gfn);
         goto out;
     }
 
@@ -710,7 +710,7 @@
                     rc = xenpaging_populate_page(paging, req.gfn, fd, i);
                     if ( rc != 0 )
                     {
-                        PERROR("Error populating page");
+                        PERROR("Error populating page %"PRIx64"", req.gfn);
                         goto out;
                     }
                 }
@@ -723,7 +723,7 @@
                 rc = xenpaging_resume_page(paging, &rsp, 1);
                 if ( rc != 0 )
                 {
-                    PERROR("Error resuming page");
+                    PERROR("Error resuming page %"PRIx64"", req.gfn);
                     goto out;
                 }
 
@@ -754,7 +754,7 @@
                     rc = xenpaging_resume_page(paging, &rsp, 0);
                     if ( rc != 0 )
                     {
-                        PERROR("Error resuming");
+                        PERROR("Error resuming page %"PRIx64"", req.gfn);
                         goto out;
                     }
                 }

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:39 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhe-0000MJ-PO; Mon, 28 Nov 2011 23:33:38 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhd-00005t-3Y
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:37 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1322523179!5291103!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15082 invoked from network); 28 Nov 2011 23:33:00 -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;
	28 Nov 2011 23:33:00 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnR-0001jx-Vl
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhQ-0000sb-VE
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:24 +0000
Message-Id: <E1RVAhQ-0000sb-VE@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:24 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools: check for libaio unless user
	has configured CONFIG_SYSTEM_LIBAIO=n
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322156616 0
# Node ID 5c88358164cceac7bfc1662604bff60560bccde0
# Parent  8fb3fa6218c600393c946ab85c7635299208a66d
tools: check for libaio unless user has configured CONFIG_SYSTEM_LIBAIO=n

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


diff -r 8fb3fa6218c6 -r 5c88358164cc tools/check/Makefile
--- a/tools/check/Makefile	Thu Nov 24 17:05:25 2011 +0000
+++ b/tools/check/Makefile	Thu Nov 24 17:43:36 2011 +0000
@@ -6,6 +6,7 @@
 export LIBXENAPI_BINDINGS
 export CHECK_INCLUDES
 export CHECK_LIB
+export CONFIG_SYSTEM_LIBAIO
 
 .PHONY: all install
 all install: check-build

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:39 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhe-0000MJ-PO; Mon, 28 Nov 2011 23:33:38 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhd-00005t-3Y
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:37 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1322523179!5291103!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15082 invoked from network); 28 Nov 2011 23:33:00 -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;
	28 Nov 2011 23:33:00 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnR-0001jx-Vl
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhQ-0000sb-VE
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:24 +0000
Message-Id: <E1RVAhQ-0000sb-VE@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:24 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools: check for libaio unless user
	has configured CONFIG_SYSTEM_LIBAIO=n
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322156616 0
# Node ID 5c88358164cceac7bfc1662604bff60560bccde0
# Parent  8fb3fa6218c600393c946ab85c7635299208a66d
tools: check for libaio unless user has configured CONFIG_SYSTEM_LIBAIO=n

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


diff -r 8fb3fa6218c6 -r 5c88358164cc tools/check/Makefile
--- a/tools/check/Makefile	Thu Nov 24 17:05:25 2011 +0000
+++ b/tools/check/Makefile	Thu Nov 24 17:43:36 2011 +0000
@@ -6,6 +6,7 @@
 export LIBXENAPI_BINDINGS
 export CHECK_INCLUDES
 export CHECK_LIB
+export CONFIG_SYSTEM_LIBAIO
 
 .PHONY: all install
 all install: check-build

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:40 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhg-0000PV-81; Mon, 28 Nov 2011 23:33:40 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhe-00008H-5W
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:38 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1322523150!50332099!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20047 invoked from network); 28 Nov 2011 23:32:31 -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;
	28 Nov 2011 23:32: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 1RVAnS-0001kF-V8
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhR-0000t5-UX
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:25 +0000
Message-Id: <E1RVAhR-0000t5-UX@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:25 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libvchan: fix segfault in client
	error path
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Anil Madhavapeddy <anil@recoil.org>
# Date 1322161795 0
# Node ID 1d78b89475ecf4867875e191ba92425bab1f4670
# Parent  05dd94652d8dbe1d7d0232328bea50fefaad57a9
libvchan: fix segfault in client error path

In libvchan_client_init, go to the error path if the gntdev device is
not available.  Otherwise, a segfault happens later as the vchan
context is invalid.

Signed-off-by: Anil Madhavapeddy <anil@recoil.org>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 05dd94652d8d -r 1d78b89475ec tools/libvchan/init.c
--- a/tools/libvchan/init.c	Thu Nov 24 19:00:25 2011 +0000
+++ b/tools/libvchan/init.c	Thu Nov 24 19:09:55 2011 +0000
@@ -385,7 +385,7 @@
 
 	ctrl->gnttab = xc_gnttab_open(logger, 0);
 	if (!ctrl->gnttab)
-		goto out;
+		goto fail;
 
 // set up event channel
 	if (init_evt_cli(ctrl, domain, logger))

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:40 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhg-0000PV-81; Mon, 28 Nov 2011 23:33:40 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhe-00008H-5W
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:38 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1322523150!50332099!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20047 invoked from network); 28 Nov 2011 23:32:31 -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;
	28 Nov 2011 23:32: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 1RVAnS-0001kF-V8
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhR-0000t5-UX
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:25 +0000
Message-Id: <E1RVAhR-0000t5-UX@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:25 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libvchan: fix segfault in client
	error path
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Anil Madhavapeddy <anil@recoil.org>
# Date 1322161795 0
# Node ID 1d78b89475ecf4867875e191ba92425bab1f4670
# Parent  05dd94652d8dbe1d7d0232328bea50fefaad57a9
libvchan: fix segfault in client error path

In libvchan_client_init, go to the error path if the gntdev device is
not available.  Otherwise, a segfault happens later as the vchan
context is invalid.

Signed-off-by: Anil Madhavapeddy <anil@recoil.org>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 05dd94652d8d -r 1d78b89475ec tools/libvchan/init.c
--- a/tools/libvchan/init.c	Thu Nov 24 19:00:25 2011 +0000
+++ b/tools/libvchan/init.c	Thu Nov 24 19:09:55 2011 +0000
@@ -385,7 +385,7 @@
 
 	ctrl->gnttab = xc_gnttab_open(logger, 0);
 	if (!ctrl->gnttab)
-		goto out;
+		goto fail;
 
 // set up event channel
 	if (init_evt_cli(ctrl, domain, logger))

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:41 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhh-0000SK-Bc; Mon, 28 Nov 2011 23:33:41 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhe-0000A3-Ro
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:39 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-216.messagelabs.com!1322523181!5390756!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24077 invoked from network); 28 Nov 2011 23:33:02 -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 Nov 2011 23:33:02 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnT-0001kL-El
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhS-0000tK-EG
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:26 +0000
Message-Id: <E1RVAhS-0000tK-EG@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:25 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: remove filename from
	comment
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1321804875 -3600
# Node ID 31fce41fc2b2cc8b35a109a40d54c9aab34dc8b5
# Parent  1d78b89475ecf4867875e191ba92425bab1f4670
xenpaging: remove filename from comment

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 1d78b89475ec -r 31fce41fc2b2 tools/xenpaging/file_ops.c
--- a/tools/xenpaging/file_ops.c	Thu Nov 24 19:09:55 2011 +0000
+++ b/tools/xenpaging/file_ops.c	Sun Nov 20 17:01:15 2011 +0100
@@ -1,5 +1,4 @@
 /******************************************************************************
- * tools/xenpaging/file_ops.c
  *
  * Common file operations.
  *
diff -r 1d78b89475ec -r 31fce41fc2b2 tools/xenpaging/policy_default.c
--- a/tools/xenpaging/policy_default.c	Thu Nov 24 19:09:55 2011 +0000
+++ b/tools/xenpaging/policy_default.c	Sun Nov 20 17:01:15 2011 +0100
@@ -1,5 +1,4 @@
 /******************************************************************************
- * tools/xenpaging/policy.c
  *
  * Xen domain paging default policy.
  *
diff -r 1d78b89475ec -r 31fce41fc2b2 tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Thu Nov 24 19:09:55 2011 +0000
+++ b/tools/xenpaging/xenpaging.c	Sun Nov 20 17:01:15 2011 +0100
@@ -1,5 +1,4 @@
 /******************************************************************************
- * tools/xenpaging/xenpaging.c
  *
  * Domain paging. 
  * Copyright (c) 2009 by Citrix Systems, Inc. (Patrick Colp)

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:41 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhh-0000SK-Bc; Mon, 28 Nov 2011 23:33:41 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhe-0000A3-Ro
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:39 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-216.messagelabs.com!1322523181!5390756!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24077 invoked from network); 28 Nov 2011 23:33:02 -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 Nov 2011 23:33:02 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnT-0001kL-El
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhS-0000tK-EG
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:26 +0000
Message-Id: <E1RVAhS-0000tK-EG@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:25 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: remove filename from
	comment
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1321804875 -3600
# Node ID 31fce41fc2b2cc8b35a109a40d54c9aab34dc8b5
# Parent  1d78b89475ecf4867875e191ba92425bab1f4670
xenpaging: remove filename from comment

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 1d78b89475ec -r 31fce41fc2b2 tools/xenpaging/file_ops.c
--- a/tools/xenpaging/file_ops.c	Thu Nov 24 19:09:55 2011 +0000
+++ b/tools/xenpaging/file_ops.c	Sun Nov 20 17:01:15 2011 +0100
@@ -1,5 +1,4 @@
 /******************************************************************************
- * tools/xenpaging/file_ops.c
  *
  * Common file operations.
  *
diff -r 1d78b89475ec -r 31fce41fc2b2 tools/xenpaging/policy_default.c
--- a/tools/xenpaging/policy_default.c	Thu Nov 24 19:09:55 2011 +0000
+++ b/tools/xenpaging/policy_default.c	Sun Nov 20 17:01:15 2011 +0100
@@ -1,5 +1,4 @@
 /******************************************************************************
- * tools/xenpaging/policy.c
  *
  * Xen domain paging default policy.
  *
diff -r 1d78b89475ec -r 31fce41fc2b2 tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Thu Nov 24 19:09:55 2011 +0000
+++ b/tools/xenpaging/xenpaging.c	Sun Nov 20 17:01:15 2011 +0100
@@ -1,5 +1,4 @@
 /******************************************************************************
- * tools/xenpaging/xenpaging.c
  *
  * Domain paging. 
  * Copyright (c) 2009 by Citrix Systems, Inc. (Patrick Colp)

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:41 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhh-0000Se-JC; Mon, 28 Nov 2011 23:33:41 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhf-0000Aj-7V
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:39 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-216.messagelabs.com!1322523181!5349224!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7156 invoked from network); 28 Nov 2011 23:33:02 -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;
	28 Nov 2011 23:33:02 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnT-0001kT-VA
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhS-0000tZ-UN
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:26 +0000
Message-Id: <E1RVAhS-0000tZ-UN@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:26 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: remove obsolete comment
	in resume path
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1321804880 -3600
# Node ID fe8946916512eca9708719097f8c8549a41e78f1
# Parent  31fce41fc2b2cc8b35a109a40d54c9aab34dc8b5
xenpaging: remove obsolete comment in resume path

Remove stale comment.
If a page was populated several times the vcpu is paused and
xenpaging has to unpause it again.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 31fce41fc2b2 -r fe8946916512 tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Sun Nov 20 17:01:15 2011 +0100
+++ b/tools/xenpaging/xenpaging.c	Sun Nov 20 17:01:20 2011 +0100
@@ -744,7 +744,6 @@
                         !!(req.flags & MEM_EVENT_FLAG_EVICT_FAIL) );
 
                 /* Tell Xen to resume the vcpu */
-                /* XXX: Maybe just check if the vcpu was paused? */
                 if ( req.flags & MEM_EVENT_FLAG_VCPU_PAUSED )
                 {
                     /* Prepare the response */

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:41 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhh-0000Se-JC; Mon, 28 Nov 2011 23:33:41 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhf-0000Aj-7V
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:39 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-216.messagelabs.com!1322523181!5349224!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7156 invoked from network); 28 Nov 2011 23:33:02 -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;
	28 Nov 2011 23:33:02 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnT-0001kT-VA
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhS-0000tZ-UN
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:26 +0000
Message-Id: <E1RVAhS-0000tZ-UN@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:26 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: remove obsolete comment
	in resume path
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1321804880 -3600
# Node ID fe8946916512eca9708719097f8c8549a41e78f1
# Parent  31fce41fc2b2cc8b35a109a40d54c9aab34dc8b5
xenpaging: remove obsolete comment in resume path

Remove stale comment.
If a page was populated several times the vcpu is paused and
xenpaging has to unpause it again.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 31fce41fc2b2 -r fe8946916512 tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Sun Nov 20 17:01:15 2011 +0100
+++ b/tools/xenpaging/xenpaging.c	Sun Nov 20 17:01:20 2011 +0100
@@ -744,7 +744,6 @@
                         !!(req.flags & MEM_EVENT_FLAG_EVICT_FAIL) );
 
                 /* Tell Xen to resume the vcpu */
-                /* XXX: Maybe just check if the vcpu was paused? */
                 if ( req.flags & MEM_EVENT_FLAG_VCPU_PAUSED )
                 {
                     /* Prepare the response */

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:42 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhh-0000TO-PK; Mon, 28 Nov 2011 23:33: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 1RVAhg-0000PB-I1
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:40 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-27.messagelabs.com!1322523171!47446224!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG, UPPERCASE_25_50
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10069 invoked from network); 28 Nov 2011 23:32:52 -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;
	28 Nov 2011 23:32:52 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnZ-0001lg-Vo
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhY-0000wT-S6
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:32 +0000
Message-Id: <E1RVAhY-0000wT-S6@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:32 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: add XEN_PAGING_DIR /
	libxl_xenpaging_dir_path()
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1321804963 -3600
# Node ID cd5948592b107c068c6d7bae2cbe6a5765431a94
# Parent  2087f21befc202b2ae1c0f8318d51ddd500e1173
xenpaging: add XEN_PAGING_DIR / libxl_xenpaging_dir_path()

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 2087f21befc2 -r cd5948592b10 Config.mk
--- a/Config.mk	Sun Nov 20 17:02:42 2011 +0100
+++ b/Config.mk	Sun Nov 20 17:02:43 2011 +0100
@@ -142,7 +142,7 @@
 	$(foreach var,                                                      \
 	          SBINDIR BINDIR LIBEXEC LIBDIR SHAREDIR PRIVATE_BINDIR     \
 	          XENFIRMWAREDIR XEN_CONFIG_DIR XEN_SCRIPT_DIR XEN_LOCK_DIR \
-	          XEN_RUN_DIR,                                              \
+	          XEN_RUN_DIR XEN_PAGING_DIR,                               \
 	          echo "$(var)=\"$($(var))\"" >>$(1).tmp;)        \
 	$(call move-if-changed,$(1).tmp,$(1))
 endef
diff -r 2087f21befc2 -r cd5948592b10 config/StdGNU.mk
--- a/config/StdGNU.mk	Sun Nov 20 17:02:42 2011 +0100
+++ b/config/StdGNU.mk	Sun Nov 20 17:02:43 2011 +0100
@@ -53,10 +53,12 @@
 CONFIG_DIR = /etc
 XEN_LOCK_DIR = /var/lock
 XEN_RUN_DIR = /var/run/xen
+XEN_PAGING_DIR = /var/lib/xen/xenpaging
 else
 CONFIG_DIR = $(PREFIX)/etc
 XEN_LOCK_DIR = $(PREFIX)/var/lock
 XEN_RUN_DIR = $(PREFIX)/var/run/xen
+XEN_PAGING_DIR = $(PREFIX)/var/lib/xen/xenpaging
 endif
 
 SYSCONFIG_DIR = $(CONFIG_DIR)/$(CONFIG_LEAF_DIR)
diff -r 2087f21befc2 -r cd5948592b10 tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Sun Nov 20 17:02:42 2011 +0100
+++ b/tools/libxl/libxl.h	Sun Nov 20 17:02:43 2011 +0100
@@ -633,6 +633,7 @@
 const char *libxl_xen_script_dir_path(void);
 const char *libxl_lock_dir_path(void);
 const char *libxl_run_dir_path(void);
+const char *libxl_xenpaging_dir_path(void);
 
 #endif /* LIBXL_H */
 
diff -r 2087f21befc2 -r cd5948592b10 tools/libxl/libxl_paths.c
--- a/tools/libxl/libxl_paths.c	Sun Nov 20 17:02:42 2011 +0100
+++ b/tools/libxl/libxl_paths.c	Sun Nov 20 17:02:43 2011 +0100
@@ -70,6 +70,11 @@
     return XEN_RUN_DIR;
 }
 
+const char *libxl_xenpaging_dir_path(void)
+{
+    return XEN_PAGING_DIR;
+}
+
 /*
  * Local variables:
  * mode: C
diff -r 2087f21befc2 -r cd5948592b10 tools/xenpaging/Makefile
--- a/tools/xenpaging/Makefile	Sun Nov 20 17:02:42 2011 +0100
+++ b/tools/xenpaging/Makefile	Sun Nov 20 17:02:43 2011 +0100
@@ -23,7 +23,7 @@
 	$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS) $(APPEND_LDFLAGS)
 
 install: all
-	$(INSTALL_DIR) $(DESTDIR)/var/lib/xen/xenpaging
+	$(INSTALL_DIR) $(DESTDIR)$(XEN_PAGING_DIR)
 	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC)
 	$(INSTALL_PROG) $(IBINS) $(DESTDIR)$(LIBEXEC)
 

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:42 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhh-0000TO-PK; Mon, 28 Nov 2011 23:33: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 1RVAhg-0000PB-I1
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:40 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-27.messagelabs.com!1322523171!47446224!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG, UPPERCASE_25_50
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10069 invoked from network); 28 Nov 2011 23:32:52 -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;
	28 Nov 2011 23:32:52 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnZ-0001lg-Vo
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhY-0000wT-S6
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:32 +0000
Message-Id: <E1RVAhY-0000wT-S6@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:32 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: add XEN_PAGING_DIR /
	libxl_xenpaging_dir_path()
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1321804963 -3600
# Node ID cd5948592b107c068c6d7bae2cbe6a5765431a94
# Parent  2087f21befc202b2ae1c0f8318d51ddd500e1173
xenpaging: add XEN_PAGING_DIR / libxl_xenpaging_dir_path()

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 2087f21befc2 -r cd5948592b10 Config.mk
--- a/Config.mk	Sun Nov 20 17:02:42 2011 +0100
+++ b/Config.mk	Sun Nov 20 17:02:43 2011 +0100
@@ -142,7 +142,7 @@
 	$(foreach var,                                                      \
 	          SBINDIR BINDIR LIBEXEC LIBDIR SHAREDIR PRIVATE_BINDIR     \
 	          XENFIRMWAREDIR XEN_CONFIG_DIR XEN_SCRIPT_DIR XEN_LOCK_DIR \
-	          XEN_RUN_DIR,                                              \
+	          XEN_RUN_DIR XEN_PAGING_DIR,                               \
 	          echo "$(var)=\"$($(var))\"" >>$(1).tmp;)        \
 	$(call move-if-changed,$(1).tmp,$(1))
 endef
diff -r 2087f21befc2 -r cd5948592b10 config/StdGNU.mk
--- a/config/StdGNU.mk	Sun Nov 20 17:02:42 2011 +0100
+++ b/config/StdGNU.mk	Sun Nov 20 17:02:43 2011 +0100
@@ -53,10 +53,12 @@
 CONFIG_DIR = /etc
 XEN_LOCK_DIR = /var/lock
 XEN_RUN_DIR = /var/run/xen
+XEN_PAGING_DIR = /var/lib/xen/xenpaging
 else
 CONFIG_DIR = $(PREFIX)/etc
 XEN_LOCK_DIR = $(PREFIX)/var/lock
 XEN_RUN_DIR = $(PREFIX)/var/run/xen
+XEN_PAGING_DIR = $(PREFIX)/var/lib/xen/xenpaging
 endif
 
 SYSCONFIG_DIR = $(CONFIG_DIR)/$(CONFIG_LEAF_DIR)
diff -r 2087f21befc2 -r cd5948592b10 tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Sun Nov 20 17:02:42 2011 +0100
+++ b/tools/libxl/libxl.h	Sun Nov 20 17:02:43 2011 +0100
@@ -633,6 +633,7 @@
 const char *libxl_xen_script_dir_path(void);
 const char *libxl_lock_dir_path(void);
 const char *libxl_run_dir_path(void);
+const char *libxl_xenpaging_dir_path(void);
 
 #endif /* LIBXL_H */
 
diff -r 2087f21befc2 -r cd5948592b10 tools/libxl/libxl_paths.c
--- a/tools/libxl/libxl_paths.c	Sun Nov 20 17:02:42 2011 +0100
+++ b/tools/libxl/libxl_paths.c	Sun Nov 20 17:02:43 2011 +0100
@@ -70,6 +70,11 @@
     return XEN_RUN_DIR;
 }
 
+const char *libxl_xenpaging_dir_path(void)
+{
+    return XEN_PAGING_DIR;
+}
+
 /*
  * Local variables:
  * mode: C
diff -r 2087f21befc2 -r cd5948592b10 tools/xenpaging/Makefile
--- a/tools/xenpaging/Makefile	Sun Nov 20 17:02:42 2011 +0100
+++ b/tools/xenpaging/Makefile	Sun Nov 20 17:02:43 2011 +0100
@@ -23,7 +23,7 @@
 	$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS) $(APPEND_LDFLAGS)
 
 install: all
-	$(INSTALL_DIR) $(DESTDIR)/var/lib/xen/xenpaging
+	$(INSTALL_DIR) $(DESTDIR)$(XEN_PAGING_DIR)
 	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC)
 	$(INSTALL_PROG) $(IBINS) $(DESTDIR)$(LIBEXEC)
 

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:42 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhi-0000U4-3H; Mon, 28 Nov 2011 23:33:42 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhg-0000DW-Ih
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:40 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-182.messagelabs.com!1322523182!5039706!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24389 invoked from network); 28 Nov 2011 23:33:03 -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;
	28 Nov 2011 23:33:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnU-0001kW-Ei
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhT-0000to-EA
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:27 +0000
Message-Id: <E1RVAhT-0000to-EA@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:26 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: use PERROR to print errno
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1321804892 -3600
# Node ID d1d54cdc4a7baef1d0670c99e8639baf9dc285d3
# Parent  fe8946916512eca9708719097f8c8549a41e78f1
xenpaging: use PERROR to print errno

v3:
 - adjust arguments for xc_mem_paging_enable() failures
v2:
 - move changes to file_op() to different patch

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r fe8946916512 -r d1d54cdc4a7b tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Sun Nov 20 17:01:20 2011 +0100
+++ b/tools/xenpaging/xenpaging.c	Sun Nov 20 17:01:32 2011 +0100
@@ -90,7 +90,7 @@
         if (errno == EINTR)
             return 0;
 
-        ERROR("Poll exited with an error");
+        PERROR("Poll exited with an error");
         return -errno;
     }
 
@@ -121,7 +121,7 @@
         port = xc_evtchn_pending(xce);
         if ( port == -1 )
         {
-            ERROR("Failed to read port from event channel");
+            PERROR("Failed to read port from event channel");
             rc = -1;
             goto err;
         }
@@ -129,7 +129,7 @@
         rc = xc_evtchn_unmask(xce, port);
         if ( rc < 0 )
         {
-            ERROR("Failed to unmask event channel port");
+            PERROR("Failed to unmask event channel port");
         }
     }
 err:
@@ -185,7 +185,7 @@
     paging->xs_handle = xs_open(0);
     if ( paging->xs_handle == NULL )
     {
-        ERROR("Error initialising xenstore connection");
+        PERROR("Error initialising xenstore connection");
         goto err;
     }
 
@@ -193,7 +193,7 @@
     snprintf(watch_token, sizeof(watch_token), "%u", domain_id);
     if ( xs_watch(paging->xs_handle, "@releaseDomain", watch_token) == false )
     {
-        ERROR("Could not bind to shutdown watch\n");
+        PERROR("Could not bind to shutdown watch\n");
         goto err;
     }
 
@@ -214,7 +214,7 @@
     paging->mem_event.shared_page = init_page();
     if ( paging->mem_event.shared_page == NULL )
     {
-        ERROR("Error initialising shared page");
+        PERROR("Error initialising shared page");
         goto err;
     }
 
@@ -222,7 +222,7 @@
     paging->mem_event.ring_page = init_page();
     if ( paging->mem_event.ring_page == NULL )
     {
-        ERROR("Error initialising ring page");
+        PERROR("Error initialising ring page");
         goto err;
     }
 
@@ -249,7 +249,7 @@
                 ERROR("xenpaging not supported in a PoD guest");
                 break;
             default:
-                ERROR("Error initialising shared page: %s", strerror(errno));
+                PERROR("Error initialising shared page");
                 break;
         }
         goto err;
@@ -259,7 +259,7 @@
     paging->mem_event.xce_handle = xc_evtchn_open(NULL, 0);
     if ( paging->mem_event.xce_handle == NULL )
     {
-        ERROR("Failed to open event channel");
+        PERROR("Failed to open event channel");
         goto err;
     }
 
@@ -269,7 +269,7 @@
                                     paging->mem_event.shared_page->port);
     if ( rc < 0 )
     {
-        ERROR("Failed to bind event channel");
+        PERROR("Failed to bind event channel");
         goto err;
     }
 
@@ -279,7 +279,7 @@
     paging->domain_info = malloc(sizeof(xc_domaininfo_t));
     if ( paging->domain_info == NULL )
     {
-        ERROR("Error allocating memory for domain info");
+        PERROR("Error allocating memory for domain info");
         goto err;
     }
 
@@ -287,7 +287,7 @@
                                paging->domain_info);
     if ( rc != 1 )
     {
-        ERROR("Error getting domain info");
+        PERROR("Error getting domain info");
         goto err;
     }
 
@@ -295,7 +295,7 @@
     paging->bitmap = bitmap_alloc(paging->domain_info->max_pages);
     if ( !paging->bitmap )
     {
-        ERROR("Error allocating bitmap");
+        PERROR("Error allocating bitmap");
         goto err;
     }
     DPRINTF("max_pages = %"PRIx64"\n", paging->domain_info->max_pages);
@@ -311,7 +311,7 @@
     rc = policy_init(paging);
     if ( rc != 0 )
     {
-        ERROR("Error initialising policy");
+        PERROR("Error initialising policy");
         goto err;
     }
 
@@ -358,14 +358,14 @@
     rc = xc_mem_paging_disable(xch, paging->mem_event.domain_id);
     if ( rc != 0 )
     {
-        ERROR("Error tearing down domain paging in xen");
+        PERROR("Error tearing down domain paging in xen");
     }
 
     /* Unbind VIRQ */
     rc = xc_evtchn_unbind(paging->mem_event.xce_handle, paging->mem_event.port);
     if ( rc != 0 )
     {
-        ERROR("Error unbinding event port");
+        PERROR("Error unbinding event port");
     }
     paging->mem_event.port = -1;
 
@@ -373,7 +373,7 @@
     rc = xc_evtchn_close(paging->mem_event.xce_handle);
     if ( rc != 0 )
     {
-        ERROR("Error closing event channel");
+        PERROR("Error closing event channel");
     }
     paging->mem_event.xce_handle = NULL;
     
@@ -384,7 +384,7 @@
     rc = xc_interface_close(xch);
     if ( rc != 0 )
     {
-        ERROR("Error closing connection to xen");
+        PERROR("Error closing connection to xen");
     }
 
     return 0;
@@ -444,7 +444,7 @@
                                 PROT_READ | PROT_WRITE, &gfn, 1);
     if ( page == NULL )
     {
-        ERROR("Error mapping page");
+        PERROR("Error mapping page");
         goto out;
     }
 
@@ -452,8 +452,8 @@
     ret = write_page(fd, page, i);
     if ( ret != 0 )
     {
+        PERROR("Error copying page");
         munmap(page, PAGE_SIZE);
-        ERROR("Error copying page");
         goto out;
     }
 
@@ -464,7 +464,7 @@
                               victim->gfn);
     if ( ret != 0 )
     {
-        ERROR("Error evicting page");
+        PERROR("Error evicting page");
         goto out;
     }
 
@@ -520,7 +520,7 @@
                 sleep(1);
                 continue;
             }
-            ERROR("Error preparing for page in");
+            PERROR("Error preparing for page in");
             goto out_map;
         }
     }
@@ -532,7 +532,7 @@
                                 PROT_READ | PROT_WRITE, &gfn, 1);
     if ( page == NULL )
     {
-        ERROR("Error mapping page: page is null");
+        PERROR("Error mapping page: page is null");
         goto out_map;
     }
 
@@ -540,7 +540,7 @@
     ret = read_page(fd, page, i);
     if ( ret != 0 )
     {
-        ERROR("Error reading page");
+        PERROR("Error reading page");
         goto out;
     }
 
@@ -579,7 +579,7 @@
         {
             if ( j++ % 1000 == 0 )
                 if ( xenpaging_mem_paging_flush_ioemu_cache(paging) )
-                    ERROR("Error flushing ioemu cache");
+                    PERROR("Error flushing ioemu cache");
         }
     }
     while ( ret );
@@ -670,7 +670,7 @@
         rc = xenpaging_wait_for_event_or_timeout(paging);
         if ( rc < 0 )
         {
-            ERROR("Error getting event");
+            PERROR("Error getting event");
             goto out;
         }
         else if ( rc != 0 )
@@ -710,7 +710,7 @@
                     rc = xenpaging_populate_page(paging, req.gfn, fd, i);
                     if ( rc != 0 )
                     {
-                        ERROR("Error populating page");
+                        PERROR("Error populating page");
                         goto out;
                     }
                 }
@@ -723,7 +723,7 @@
                 rc = xenpaging_resume_page(paging, &rsp, 1);
                 if ( rc != 0 )
                 {
-                    ERROR("Error resuming page");
+                    PERROR("Error resuming page");
                     goto out;
                 }
 
@@ -754,7 +754,7 @@
                     rc = xenpaging_resume_page(paging, &rsp, 0);
                     if ( rc != 0 )
                     {
-                        ERROR("Error resuming");
+                        PERROR("Error resuming");
                         goto out;
                     }
                 }

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:42 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhi-0000U4-3H; Mon, 28 Nov 2011 23:33:42 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhg-0000DW-Ih
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:40 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-182.messagelabs.com!1322523182!5039706!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24389 invoked from network); 28 Nov 2011 23:33:03 -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;
	28 Nov 2011 23:33:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnU-0001kW-Ei
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhT-0000to-EA
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:27 +0000
Message-Id: <E1RVAhT-0000to-EA@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:26 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: use PERROR to print errno
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1321804892 -3600
# Node ID d1d54cdc4a7baef1d0670c99e8639baf9dc285d3
# Parent  fe8946916512eca9708719097f8c8549a41e78f1
xenpaging: use PERROR to print errno

v3:
 - adjust arguments for xc_mem_paging_enable() failures
v2:
 - move changes to file_op() to different patch

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r fe8946916512 -r d1d54cdc4a7b tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Sun Nov 20 17:01:20 2011 +0100
+++ b/tools/xenpaging/xenpaging.c	Sun Nov 20 17:01:32 2011 +0100
@@ -90,7 +90,7 @@
         if (errno == EINTR)
             return 0;
 
-        ERROR("Poll exited with an error");
+        PERROR("Poll exited with an error");
         return -errno;
     }
 
@@ -121,7 +121,7 @@
         port = xc_evtchn_pending(xce);
         if ( port == -1 )
         {
-            ERROR("Failed to read port from event channel");
+            PERROR("Failed to read port from event channel");
             rc = -1;
             goto err;
         }
@@ -129,7 +129,7 @@
         rc = xc_evtchn_unmask(xce, port);
         if ( rc < 0 )
         {
-            ERROR("Failed to unmask event channel port");
+            PERROR("Failed to unmask event channel port");
         }
     }
 err:
@@ -185,7 +185,7 @@
     paging->xs_handle = xs_open(0);
     if ( paging->xs_handle == NULL )
     {
-        ERROR("Error initialising xenstore connection");
+        PERROR("Error initialising xenstore connection");
         goto err;
     }
 
@@ -193,7 +193,7 @@
     snprintf(watch_token, sizeof(watch_token), "%u", domain_id);
     if ( xs_watch(paging->xs_handle, "@releaseDomain", watch_token) == false )
     {
-        ERROR("Could not bind to shutdown watch\n");
+        PERROR("Could not bind to shutdown watch\n");
         goto err;
     }
 
@@ -214,7 +214,7 @@
     paging->mem_event.shared_page = init_page();
     if ( paging->mem_event.shared_page == NULL )
     {
-        ERROR("Error initialising shared page");
+        PERROR("Error initialising shared page");
         goto err;
     }
 
@@ -222,7 +222,7 @@
     paging->mem_event.ring_page = init_page();
     if ( paging->mem_event.ring_page == NULL )
     {
-        ERROR("Error initialising ring page");
+        PERROR("Error initialising ring page");
         goto err;
     }
 
@@ -249,7 +249,7 @@
                 ERROR("xenpaging not supported in a PoD guest");
                 break;
             default:
-                ERROR("Error initialising shared page: %s", strerror(errno));
+                PERROR("Error initialising shared page");
                 break;
         }
         goto err;
@@ -259,7 +259,7 @@
     paging->mem_event.xce_handle = xc_evtchn_open(NULL, 0);
     if ( paging->mem_event.xce_handle == NULL )
     {
-        ERROR("Failed to open event channel");
+        PERROR("Failed to open event channel");
         goto err;
     }
 
@@ -269,7 +269,7 @@
                                     paging->mem_event.shared_page->port);
     if ( rc < 0 )
     {
-        ERROR("Failed to bind event channel");
+        PERROR("Failed to bind event channel");
         goto err;
     }
 
@@ -279,7 +279,7 @@
     paging->domain_info = malloc(sizeof(xc_domaininfo_t));
     if ( paging->domain_info == NULL )
     {
-        ERROR("Error allocating memory for domain info");
+        PERROR("Error allocating memory for domain info");
         goto err;
     }
 
@@ -287,7 +287,7 @@
                                paging->domain_info);
     if ( rc != 1 )
     {
-        ERROR("Error getting domain info");
+        PERROR("Error getting domain info");
         goto err;
     }
 
@@ -295,7 +295,7 @@
     paging->bitmap = bitmap_alloc(paging->domain_info->max_pages);
     if ( !paging->bitmap )
     {
-        ERROR("Error allocating bitmap");
+        PERROR("Error allocating bitmap");
         goto err;
     }
     DPRINTF("max_pages = %"PRIx64"\n", paging->domain_info->max_pages);
@@ -311,7 +311,7 @@
     rc = policy_init(paging);
     if ( rc != 0 )
     {
-        ERROR("Error initialising policy");
+        PERROR("Error initialising policy");
         goto err;
     }
 
@@ -358,14 +358,14 @@
     rc = xc_mem_paging_disable(xch, paging->mem_event.domain_id);
     if ( rc != 0 )
     {
-        ERROR("Error tearing down domain paging in xen");
+        PERROR("Error tearing down domain paging in xen");
     }
 
     /* Unbind VIRQ */
     rc = xc_evtchn_unbind(paging->mem_event.xce_handle, paging->mem_event.port);
     if ( rc != 0 )
     {
-        ERROR("Error unbinding event port");
+        PERROR("Error unbinding event port");
     }
     paging->mem_event.port = -1;
 
@@ -373,7 +373,7 @@
     rc = xc_evtchn_close(paging->mem_event.xce_handle);
     if ( rc != 0 )
     {
-        ERROR("Error closing event channel");
+        PERROR("Error closing event channel");
     }
     paging->mem_event.xce_handle = NULL;
     
@@ -384,7 +384,7 @@
     rc = xc_interface_close(xch);
     if ( rc != 0 )
     {
-        ERROR("Error closing connection to xen");
+        PERROR("Error closing connection to xen");
     }
 
     return 0;
@@ -444,7 +444,7 @@
                                 PROT_READ | PROT_WRITE, &gfn, 1);
     if ( page == NULL )
     {
-        ERROR("Error mapping page");
+        PERROR("Error mapping page");
         goto out;
     }
 
@@ -452,8 +452,8 @@
     ret = write_page(fd, page, i);
     if ( ret != 0 )
     {
+        PERROR("Error copying page");
         munmap(page, PAGE_SIZE);
-        ERROR("Error copying page");
         goto out;
     }
 
@@ -464,7 +464,7 @@
                               victim->gfn);
     if ( ret != 0 )
     {
-        ERROR("Error evicting page");
+        PERROR("Error evicting page");
         goto out;
     }
 
@@ -520,7 +520,7 @@
                 sleep(1);
                 continue;
             }
-            ERROR("Error preparing for page in");
+            PERROR("Error preparing for page in");
             goto out_map;
         }
     }
@@ -532,7 +532,7 @@
                                 PROT_READ | PROT_WRITE, &gfn, 1);
     if ( page == NULL )
     {
-        ERROR("Error mapping page: page is null");
+        PERROR("Error mapping page: page is null");
         goto out_map;
     }
 
@@ -540,7 +540,7 @@
     ret = read_page(fd, page, i);
     if ( ret != 0 )
     {
-        ERROR("Error reading page");
+        PERROR("Error reading page");
         goto out;
     }
 
@@ -579,7 +579,7 @@
         {
             if ( j++ % 1000 == 0 )
                 if ( xenpaging_mem_paging_flush_ioemu_cache(paging) )
-                    ERROR("Error flushing ioemu cache");
+                    PERROR("Error flushing ioemu cache");
         }
     }
     while ( ret );
@@ -670,7 +670,7 @@
         rc = xenpaging_wait_for_event_or_timeout(paging);
         if ( rc < 0 )
         {
-            ERROR("Error getting event");
+            PERROR("Error getting event");
             goto out;
         }
         else if ( rc != 0 )
@@ -710,7 +710,7 @@
                     rc = xenpaging_populate_page(paging, req.gfn, fd, i);
                     if ( rc != 0 )
                     {
-                        ERROR("Error populating page");
+                        PERROR("Error populating page");
                         goto out;
                     }
                 }
@@ -723,7 +723,7 @@
                 rc = xenpaging_resume_page(paging, &rsp, 1);
                 if ( rc != 0 )
                 {
-                    ERROR("Error resuming page");
+                    PERROR("Error resuming page");
                     goto out;
                 }
 
@@ -754,7 +754,7 @@
                     rc = xenpaging_resume_page(paging, &rsp, 0);
                     if ( rc != 0 )
                     {
-                        ERROR("Error resuming");
+                        PERROR("Error resuming");
                         goto out;
                     }
                 }

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:42 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhi-0000VC-Fb; Mon, 28 Nov 2011 23:33:42 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhg-0000EA-TK
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:41 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-182.messagelabs.com!1322523182!5040045!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29647 invoked from network); 28 Nov 2011 23:33:03 -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;
	28 Nov 2011 23:33:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnU-0001kZ-V0
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhT-0000u3-UR
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:27 +0000
Message-Id: <E1RVAhT-0000u3-UR@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:27 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: simplify file_op
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1321804899 -3600
# Node ID 8ddac056a89e0ba4c3180bf8983c00cf2b85ecb4
# Parent  d1d54cdc4a7baef1d0670c99e8639baf9dc285d3
xenpaging: simplify file_op

Catch lseek() errors.
Use -1 as return value and let caller read errno.
Remove const casts from buffer pointers, the page is writeable.
Use wrapper for write() which matches the read() prototype.
Remove unused stdarg.h inclusion.
Remove unused macro.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r d1d54cdc4a7b -r 8ddac056a89e tools/xenpaging/file_ops.c
--- a/tools/xenpaging/file_ops.c	Sun Nov 20 17:01:32 2011 +0100
+++ b/tools/xenpaging/file_ops.c	Sun Nov 20 17:01:39 2011 +0100
@@ -21,55 +21,44 @@
 
 
 #include <unistd.h>
-#include <stdarg.h>
 #include <xc_private.h>
 
-
-#define page_offset(_pfn)     (((off_t)(_pfn)) << PAGE_SHIFT)
-
-
 static int file_op(int fd, void *page, int i,
-                   ssize_t (*fn)(int, const void *, size_t))
+                   ssize_t (*fn)(int, void *, size_t))
 {
     off_t seek_ret;
-    int total;
+    int total = 0;
     int bytes;
-    int ret;
 
     seek_ret = lseek(fd, i << PAGE_SHIFT, SEEK_SET);
+    if ( seek_ret == (off_t)-1 )
+        return -1;
 
-    total = 0;
     while ( total < PAGE_SIZE )
     {
         bytes = fn(fd, page + total, PAGE_SIZE - total);
         if ( bytes <= 0 )
-        {
-            ret = -errno;
-            goto err;
-        }
+            return -1;
 
         total += bytes;
     }
 
     return 0;
-
- err:
-    return ret;
 }
 
-static ssize_t my_read(int fd, const void *buf, size_t count)
+static ssize_t my_write(int fd, void *buf, size_t count)
 {
-    return read(fd, (void *)buf, count);
+    return write(fd, buf, count);
 }
 
 int read_page(int fd, void *page, int i)
 {
-    return file_op(fd, page, i, &my_read);
+    return file_op(fd, page, i, &read);
 }
 
 int write_page(int fd, void *page, int i)
 {
-    return file_op(fd, page, i, &write);
+    return file_op(fd, page, i, &my_write);
 }
 
 

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:42 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhi-0000VC-Fb; Mon, 28 Nov 2011 23:33:42 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhg-0000EA-TK
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:41 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-182.messagelabs.com!1322523182!5040045!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29647 invoked from network); 28 Nov 2011 23:33:03 -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;
	28 Nov 2011 23:33:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnU-0001kZ-V0
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhT-0000u3-UR
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:27 +0000
Message-Id: <E1RVAhT-0000u3-UR@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:27 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: simplify file_op
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1321804899 -3600
# Node ID 8ddac056a89e0ba4c3180bf8983c00cf2b85ecb4
# Parent  d1d54cdc4a7baef1d0670c99e8639baf9dc285d3
xenpaging: simplify file_op

Catch lseek() errors.
Use -1 as return value and let caller read errno.
Remove const casts from buffer pointers, the page is writeable.
Use wrapper for write() which matches the read() prototype.
Remove unused stdarg.h inclusion.
Remove unused macro.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r d1d54cdc4a7b -r 8ddac056a89e tools/xenpaging/file_ops.c
--- a/tools/xenpaging/file_ops.c	Sun Nov 20 17:01:32 2011 +0100
+++ b/tools/xenpaging/file_ops.c	Sun Nov 20 17:01:39 2011 +0100
@@ -21,55 +21,44 @@
 
 
 #include <unistd.h>
-#include <stdarg.h>
 #include <xc_private.h>
 
-
-#define page_offset(_pfn)     (((off_t)(_pfn)) << PAGE_SHIFT)
-
-
 static int file_op(int fd, void *page, int i,
-                   ssize_t (*fn)(int, const void *, size_t))
+                   ssize_t (*fn)(int, void *, size_t))
 {
     off_t seek_ret;
-    int total;
+    int total = 0;
     int bytes;
-    int ret;
 
     seek_ret = lseek(fd, i << PAGE_SHIFT, SEEK_SET);
+    if ( seek_ret == (off_t)-1 )
+        return -1;
 
-    total = 0;
     while ( total < PAGE_SIZE )
     {
         bytes = fn(fd, page + total, PAGE_SIZE - total);
         if ( bytes <= 0 )
-        {
-            ret = -errno;
-            goto err;
-        }
+            return -1;
 
         total += bytes;
     }
 
     return 0;
-
- err:
-    return ret;
 }
 
-static ssize_t my_read(int fd, const void *buf, size_t count)
+static ssize_t my_write(int fd, void *buf, size_t count)
 {
-    return read(fd, (void *)buf, count);
+    return write(fd, buf, count);
 }
 
 int read_page(int fd, void *page, int i)
 {
-    return file_op(fd, page, i, &my_read);
+    return file_op(fd, page, i, &read);
 }
 
 int write_page(int fd, void *page, int i)
 {
-    return file_op(fd, page, i, &write);
+    return file_op(fd, page, i, &my_write);
 }
 
 

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:44 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhk-0000Ze-68; Mon, 28 Nov 2011 23:33:44 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhh-0000Gj-T3
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:42 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-182.messagelabs.com!1322523183!5039707!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24409 invoked from network); 28 Nov 2011 23:33:04 -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;
	28 Nov 2011 23: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 1RVAnV-0001kj-UY
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhU-0000uX-U5
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:28 +0000
Message-Id: <E1RVAhU-0000uX-U5@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:28 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: update xenpaging_init
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1321804942 -3600
# Node ID e3cbbad7238220282eb84d69f30ebb1559f713a9
# Parent  fbc31627addee315a551dfd33846d5a8a37e8565
xenpaging: update xenpaging_init

Move comment about xc_handle to the right place.
Allocate paging early and use calloc.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r fbc31627adde -r e3cbbad72382 tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Sun Nov 20 17:01:41 2011 +0100
+++ b/tools/xenpaging/xenpaging.c	Sun Nov 20 17:02:22 2011 +0100
@@ -169,18 +169,21 @@
     char *p;
     int rc;
 
+    /* Allocate memory */
+    paging = calloc(1, sizeof(xenpaging_t));
+    if ( !paging )
+        goto err;
+
     if ( getenv("XENPAGING_DEBUG") )
         dbg = (xentoollog_logger *)xtl_createlogger_stdiostream(stderr, XTL_DEBUG, 0);
-    xch = xc_interface_open(dbg, NULL, 0);
+
+    /* Open connection to xen */
+    paging->xc_handle = xch = xc_interface_open(dbg, NULL, 0);
     if ( !xch )
-        goto err_iface;
+        goto err;
 
     DPRINTF("xenpaging init\n");
 
-    /* Allocate memory */
-    paging = malloc(sizeof(xenpaging_t));
-    memset(paging, 0, sizeof(xenpaging_t));
-
     /* Open connection to xenstore */
     paging->xs_handle = xs_open(0);
     if ( paging->xs_handle == NULL )
@@ -204,9 +207,6 @@
          DPRINTF("Setting policy mru_size to %d\n", paging->policy_mru_size);
     }
 
-    /* Open connection to xen */
-    paging->xc_handle = xch;
-
     /* Set domain id */
     paging->mem_event.domain_id = domain_id;
 
@@ -322,7 +322,8 @@
     {
         if ( paging->xs_handle )
             xs_close(paging->xs_handle);
-        xc_interface_close(xch);
+        if ( xch )
+            xc_interface_close(xch);
         if ( paging->mem_event.shared_page )
         {
             munlock(paging->mem_event.shared_page, PAGE_SIZE);
@@ -340,7 +341,6 @@
         free(paging);
     }
 
- err_iface: 
     return NULL;
 }
 

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:44 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhk-0000Ze-68; Mon, 28 Nov 2011 23:33:44 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhh-0000Gj-T3
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:42 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-182.messagelabs.com!1322523183!5039707!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24409 invoked from network); 28 Nov 2011 23:33:04 -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;
	28 Nov 2011 23: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 1RVAnV-0001kj-UY
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhU-0000uX-U5
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:28 +0000
Message-Id: <E1RVAhU-0000uX-U5@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:28 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: update xenpaging_init
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1321804942 -3600
# Node ID e3cbbad7238220282eb84d69f30ebb1559f713a9
# Parent  fbc31627addee315a551dfd33846d5a8a37e8565
xenpaging: update xenpaging_init

Move comment about xc_handle to the right place.
Allocate paging early and use calloc.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r fbc31627adde -r e3cbbad72382 tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Sun Nov 20 17:01:41 2011 +0100
+++ b/tools/xenpaging/xenpaging.c	Sun Nov 20 17:02:22 2011 +0100
@@ -169,18 +169,21 @@
     char *p;
     int rc;
 
+    /* Allocate memory */
+    paging = calloc(1, sizeof(xenpaging_t));
+    if ( !paging )
+        goto err;
+
     if ( getenv("XENPAGING_DEBUG") )
         dbg = (xentoollog_logger *)xtl_createlogger_stdiostream(stderr, XTL_DEBUG, 0);
-    xch = xc_interface_open(dbg, NULL, 0);
+
+    /* Open connection to xen */
+    paging->xc_handle = xch = xc_interface_open(dbg, NULL, 0);
     if ( !xch )
-        goto err_iface;
+        goto err;
 
     DPRINTF("xenpaging init\n");
 
-    /* Allocate memory */
-    paging = malloc(sizeof(xenpaging_t));
-    memset(paging, 0, sizeof(xenpaging_t));
-
     /* Open connection to xenstore */
     paging->xs_handle = xs_open(0);
     if ( paging->xs_handle == NULL )
@@ -204,9 +207,6 @@
          DPRINTF("Setting policy mru_size to %d\n", paging->policy_mru_size);
     }
 
-    /* Open connection to xen */
-    paging->xc_handle = xch;
-
     /* Set domain id */
     paging->mem_event.domain_id = domain_id;
 
@@ -322,7 +322,8 @@
     {
         if ( paging->xs_handle )
             xs_close(paging->xs_handle);
-        xc_interface_close(xch);
+        if ( xch )
+            xc_interface_close(xch);
         if ( paging->mem_event.shared_page )
         {
             munlock(paging->mem_event.shared_page, PAGE_SIZE);
@@ -340,7 +341,6 @@
         free(paging);
     }
 
- err_iface: 
     return NULL;
 }
 

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:44 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhk-0000ZS-38; Mon, 28 Nov 2011 23:33:44 +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 1RVAhh-0000RU-Df
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:41 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-27.messagelabs.com!1322523154!54944120!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21087 invoked from network); 28 Nov 2011 23:32:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Nov 2011 23:32:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAna-0001ls-S4
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhZ-0000wx-RZ
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:33 +0000
Message-Id: <E1RVAhZ-0000wx-RZ@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:33 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: watch the guests
	memory/target-tot_pages xenstore value
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1321804967 -3600
# Node ID 9e3c2ef70c8a6b9c259231581105a4587a73a83a
# Parent  286a741b4d86f85013f956f944e22f208e400904
xenpaging: watch the guests memory/target-tot_pages xenstore value

Subsequent patches will use xenstored to store the numbers of pages
xenpaging is suppose to page-out.
Remove num_pages and use target_pages instead.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 286a741b4d86 -r 9e3c2ef70c8a tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Sun Nov 20 17:02:45 2011 +0100
+++ b/tools/xenpaging/xenpaging.c	Sun Nov 20 17:02:47 2011 +0100
@@ -19,8 +19,10 @@
  */
 
 #define _XOPEN_SOURCE	600
+#define _GNU_SOURCE
 
 #include <inttypes.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <stdarg.h>
 #include <time.h>
@@ -35,6 +37,10 @@
 #include "policy.h"
 #include "xenpaging.h"
 
+/* Defines number of mfns a guest should use at a time, in KiB */
+#define WATCH_TARGETPAGES "memory/target-tot_pages"
+static char *watch_target_tot_pages;
+static char *dom_path;
 static char watch_token[16];
 static char filename[80];
 static int interrupted;
@@ -72,7 +78,7 @@
 {
     xc_interface *xch = paging->xc_handle;
     xc_evtchn *xce = paging->mem_event.xce_handle;
-    char **vec;
+    char **vec, *val;
     unsigned int num;
     struct pollfd fd[2];
     int port;
@@ -111,6 +117,25 @@
                     rc = 0;
                 }
             }
+            else if ( strcmp(vec[XS_WATCH_PATH], watch_target_tot_pages) == 0 )
+            {
+                int ret, target_tot_pages;
+                val = xs_read(paging->xs_handle, XBT_NULL, vec[XS_WATCH_PATH], NULL);
+                if ( val )
+                {
+                    ret = sscanf(val, "%d", &target_tot_pages);
+                    if ( ret > 0 )
+                    {
+                        /* KiB to pages */
+                        target_tot_pages >>= 2;
+                        if ( target_tot_pages < 0 || target_tot_pages > paging->max_pages )
+                            target_tot_pages = paging->max_pages;
+                        paging->target_tot_pages = target_tot_pages;
+                        DPRINTF("new target_tot_pages %d\n", target_tot_pages);
+                    }
+                    free(val);
+                }
+            }
             free(vec);
         }
     }
@@ -216,6 +241,25 @@
         goto err;
     }
 
+    /* Watch xenpagings working target */
+    dom_path = xs_get_domain_path(paging->xs_handle, domain_id);
+    if ( !dom_path )
+    {
+        PERROR("Could not find domain path\n");
+        goto err;
+    }
+    if ( asprintf(&watch_target_tot_pages, "%s/%s", dom_path, WATCH_TARGETPAGES) < 0 )
+    {
+        PERROR("Could not alloc watch path\n");
+        goto err;
+    }
+    DPRINTF("watching '%s'\n", watch_target_tot_pages);
+    if ( xs_watch(paging->xs_handle, watch_target_tot_pages, "") == false )
+    {
+        PERROR("Could not bind to xenpaging watch\n");
+        goto err;
+    }
+
     p = getenv("XENPAGING_POLICY_MRU_SIZE");
     if ( p && *p )
     {
@@ -342,6 +386,8 @@
             free(paging->mem_event.ring_page);
         }
 
+        free(dom_path);
+        free(watch_target_tot_pages);
         free(paging->bitmap);
         free(paging);
     }
@@ -357,6 +403,9 @@
     if ( paging == NULL )
         return 0;
 
+    xs_unwatch(paging->xs_handle, watch_target_tot_pages, "");
+    xs_unwatch(paging->xs_handle, "@releaseDomain", watch_token);
+
     xch = paging->xc_handle;
     paging->xc_handle = NULL;
     /* Tear down domain paging in Xen */

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:44 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhk-0000ZS-38; Mon, 28 Nov 2011 23:33:44 +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 1RVAhh-0000RU-Df
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:41 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-27.messagelabs.com!1322523154!54944120!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21087 invoked from network); 28 Nov 2011 23:32:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Nov 2011 23:32:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAna-0001ls-S4
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhZ-0000wx-RZ
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:33 +0000
Message-Id: <E1RVAhZ-0000wx-RZ@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:33 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: watch the guests
	memory/target-tot_pages xenstore value
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1321804967 -3600
# Node ID 9e3c2ef70c8a6b9c259231581105a4587a73a83a
# Parent  286a741b4d86f85013f956f944e22f208e400904
xenpaging: watch the guests memory/target-tot_pages xenstore value

Subsequent patches will use xenstored to store the numbers of pages
xenpaging is suppose to page-out.
Remove num_pages and use target_pages instead.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 286a741b4d86 -r 9e3c2ef70c8a tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Sun Nov 20 17:02:45 2011 +0100
+++ b/tools/xenpaging/xenpaging.c	Sun Nov 20 17:02:47 2011 +0100
@@ -19,8 +19,10 @@
  */
 
 #define _XOPEN_SOURCE	600
+#define _GNU_SOURCE
 
 #include <inttypes.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <stdarg.h>
 #include <time.h>
@@ -35,6 +37,10 @@
 #include "policy.h"
 #include "xenpaging.h"
 
+/* Defines number of mfns a guest should use at a time, in KiB */
+#define WATCH_TARGETPAGES "memory/target-tot_pages"
+static char *watch_target_tot_pages;
+static char *dom_path;
 static char watch_token[16];
 static char filename[80];
 static int interrupted;
@@ -72,7 +78,7 @@
 {
     xc_interface *xch = paging->xc_handle;
     xc_evtchn *xce = paging->mem_event.xce_handle;
-    char **vec;
+    char **vec, *val;
     unsigned int num;
     struct pollfd fd[2];
     int port;
@@ -111,6 +117,25 @@
                     rc = 0;
                 }
             }
+            else if ( strcmp(vec[XS_WATCH_PATH], watch_target_tot_pages) == 0 )
+            {
+                int ret, target_tot_pages;
+                val = xs_read(paging->xs_handle, XBT_NULL, vec[XS_WATCH_PATH], NULL);
+                if ( val )
+                {
+                    ret = sscanf(val, "%d", &target_tot_pages);
+                    if ( ret > 0 )
+                    {
+                        /* KiB to pages */
+                        target_tot_pages >>= 2;
+                        if ( target_tot_pages < 0 || target_tot_pages > paging->max_pages )
+                            target_tot_pages = paging->max_pages;
+                        paging->target_tot_pages = target_tot_pages;
+                        DPRINTF("new target_tot_pages %d\n", target_tot_pages);
+                    }
+                    free(val);
+                }
+            }
             free(vec);
         }
     }
@@ -216,6 +241,25 @@
         goto err;
     }
 
+    /* Watch xenpagings working target */
+    dom_path = xs_get_domain_path(paging->xs_handle, domain_id);
+    if ( !dom_path )
+    {
+        PERROR("Could not find domain path\n");
+        goto err;
+    }
+    if ( asprintf(&watch_target_tot_pages, "%s/%s", dom_path, WATCH_TARGETPAGES) < 0 )
+    {
+        PERROR("Could not alloc watch path\n");
+        goto err;
+    }
+    DPRINTF("watching '%s'\n", watch_target_tot_pages);
+    if ( xs_watch(paging->xs_handle, watch_target_tot_pages, "") == false )
+    {
+        PERROR("Could not bind to xenpaging watch\n");
+        goto err;
+    }
+
     p = getenv("XENPAGING_POLICY_MRU_SIZE");
     if ( p && *p )
     {
@@ -342,6 +386,8 @@
             free(paging->mem_event.ring_page);
         }
 
+        free(dom_path);
+        free(watch_target_tot_pages);
         free(paging->bitmap);
         free(paging);
     }
@@ -357,6 +403,9 @@
     if ( paging == NULL )
         return 0;
 
+    xs_unwatch(paging->xs_handle, watch_target_tot_pages, "");
+    xs_unwatch(paging->xs_handle, "@releaseDomain", watch_token);
+
     xch = paging->xc_handle;
     paging->xc_handle = NULL;
     /* Tear down domain paging in Xen */

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:45 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhg-0000PF-4U; Mon, 28 Nov 2011 23:33:40 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhd-00006H-LN
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:37 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-216.messagelabs.com!1322523180!5405103!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11485 invoked from network); 28 Nov 2011 23:33:01 -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;
	28 Nov 2011 23:33:01 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnS-0001k6-FT
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhR-0000sq-Ex
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:25 +0000
Message-Id: <E1RVAhR-0000sq-Ex@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:24 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools/check: Add files missing from
	24205:5c88358164cc
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1322161225 0
# Node ID 05dd94652d8dbe1d7d0232328bea50fefaad57a9
# Parent  5c88358164cceac7bfc1662604bff60560bccde0
tools/check: Add files missing from 24205:5c88358164cc

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


diff -r 5c88358164cc -r 05dd94652d8d tools/check/check_libaio_devel
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/check/check_libaio_devel	Thu Nov 24 19:00:25 2011 +0000
@@ -0,0 +1,11 @@
+#!/bin/sh
+# CHECK-BUILD
+
+. ./funcs.sh
+
+if [ X${CONFIG_SYSTEM_LIBAIO} != X"y" ] ; then
+    exit 0
+fi
+if ! has_header libaio.h ; then
+    fail "can't find libaio headers, install libaio devel package or set CONFIG_SYSTEM_LIBAIO=n"
+fi
diff -r 5c88358164cc -r 05dd94652d8d tools/check/check_libaio_lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/check/check_libaio_lib	Thu Nov 24 19:00:25 2011 +0000
@@ -0,0 +1,9 @@
+#!/bin/sh
+# CHECK-BUILD CHECK-INSTALL
+
+. ./funcs.sh
+
+if [ X${CONFIG_SYSTEM_LIBAIO} != X"y" ] ; then
+    exit 0
+fi
+has_lib libaio.so || fail "can't find libaio"

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:45 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhg-0000PF-4U; Mon, 28 Nov 2011 23:33:40 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhd-00006H-LN
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:37 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-216.messagelabs.com!1322523180!5405103!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11485 invoked from network); 28 Nov 2011 23:33:01 -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;
	28 Nov 2011 23:33:01 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnS-0001k6-FT
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhR-0000sq-Ex
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:25 +0000
Message-Id: <E1RVAhR-0000sq-Ex@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:24 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools/check: Add files missing from
	24205:5c88358164cc
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1322161225 0
# Node ID 05dd94652d8dbe1d7d0232328bea50fefaad57a9
# Parent  5c88358164cceac7bfc1662604bff60560bccde0
tools/check: Add files missing from 24205:5c88358164cc

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


diff -r 5c88358164cc -r 05dd94652d8d tools/check/check_libaio_devel
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/check/check_libaio_devel	Thu Nov 24 19:00:25 2011 +0000
@@ -0,0 +1,11 @@
+#!/bin/sh
+# CHECK-BUILD
+
+. ./funcs.sh
+
+if [ X${CONFIG_SYSTEM_LIBAIO} != X"y" ] ; then
+    exit 0
+fi
+if ! has_header libaio.h ; then
+    fail "can't find libaio headers, install libaio devel package or set CONFIG_SYSTEM_LIBAIO=n"
+fi
diff -r 5c88358164cc -r 05dd94652d8d tools/check/check_libaio_lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/check/check_libaio_lib	Thu Nov 24 19:00:25 2011 +0000
@@ -0,0 +1,9 @@
+#!/bin/sh
+# CHECK-BUILD CHECK-INSTALL
+
+. ./funcs.sh
+
+if [ X${CONFIG_SYSTEM_LIBAIO} != X"y" ] ; then
+    exit 0
+fi
+has_lib libaio.so || fail "can't find libaio"

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:45 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhl-0000cX-BY; Mon, 28 Nov 2011 23:33:45 +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 1RVAhi-0000UA-GW
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:42 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1322523163!42773188!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17185 invoked from network); 28 Nov 2011 23:32:44 -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;
	28 Nov 2011 23:32: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 1RVAnb-0001m3-S6
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAha-0000xR-RV
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:34 +0000
Message-Id: <E1RVAha-0000xR-RV@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:34 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: improve policy mru list
	handling
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1321804970 -3600
# Node ID d47d1ad5636631cd955594da70f54e5b0550276e
# Parent  7243fd87410e32502ec407a0abca89fa293a03bc
xenpaging: improve policy mru list handling

Without this change it is not possible to page-out all guest pages, then
trigger a page-in for all pages, and then page-out everything once
again. All pages in the mru list can not be paged out because they
remain active in the internal bitmap of paged pages.

Use the mru list only if the number of paged-out pages is larger than
the mru list. If the number is smaller, start to clear the mru list. In
case the number of paged-out pages drops to zero the mru list and the
internal bitmap will be empty as well.

Also add a new interface for dropped pages. If a gfn was dropped there
is no need to adjust the mru list because dropping a page is not usage
of a page.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 7243fd87410e -r d47d1ad56366 tools/xenpaging/policy.h
--- a/tools/xenpaging/policy.h	Sun Nov 20 17:02:48 2011 +0100
+++ b/tools/xenpaging/policy.h	Sun Nov 20 17:02:50 2011 +0100
@@ -32,6 +32,8 @@
 int policy_choose_victim(xenpaging_t *paging, xenpaging_victim_t *victim);
 void policy_notify_paged_out(unsigned long gfn);
 void policy_notify_paged_in(unsigned long gfn);
+void policy_notify_paged_in_nomru(unsigned long gfn);
+void policy_notify_dropped(unsigned long gfn);
 
 #endif // __XEN_PAGING_POLICY_H__
 
diff -r 7243fd87410e -r d47d1ad56366 tools/xenpaging/policy_default.c
--- a/tools/xenpaging/policy_default.c	Sun Nov 20 17:02:48 2011 +0100
+++ b/tools/xenpaging/policy_default.c	Sun Nov 20 17:02:50 2011 +0100
@@ -57,7 +57,7 @@
     if ( paging->policy_mru_size > 0 )
         mru_size = paging->policy_mru_size;
     else
-        mru_size = DEFAULT_MRU_SIZE;
+        mru_size = paging->policy_mru_size = DEFAULT_MRU_SIZE;
 
     mru = malloc(sizeof(*mru) * mru_size);
     if ( mru == NULL )
@@ -120,17 +120,38 @@
     clear_bit(gfn, unconsumed);
 }
 
-void policy_notify_paged_in(unsigned long gfn)
+static void policy_handle_paged_in(unsigned long gfn, int do_mru)
 {
     unsigned long old_gfn = mru[i_mru & (mru_size - 1)];
 
     if ( old_gfn != INVALID_MFN )
         clear_bit(old_gfn, bitmap);
     
-    mru[i_mru & (mru_size - 1)] = gfn;
+    if (do_mru) {
+        mru[i_mru & (mru_size - 1)] = gfn;
+    } else {
+        clear_bit(gfn, bitmap);
+        mru[i_mru & (mru_size - 1)] = INVALID_MFN;
+    }
+
     i_mru++;
 }
 
+void policy_notify_paged_in(unsigned long gfn)
+{
+    policy_handle_paged_in(gfn, 1);
+}
+
+void policy_notify_paged_in_nomru(unsigned long gfn)
+{
+    policy_handle_paged_in(gfn, 0);
+}
+
+void policy_notify_dropped(unsigned long gfn)
+{
+    clear_bit(gfn, bitmap);
+}
+
 
 /*
  * Local variables:
diff -r 7243fd87410e -r d47d1ad56366 tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Sun Nov 20 17:02:48 2011 +0100
+++ b/tools/xenpaging/xenpaging.c	Sun Nov 20 17:02:50 2011 +0100
@@ -615,7 +615,14 @@
     /* Notify policy of page being paged in */
     if ( notify_policy )
     {
-        policy_notify_paged_in(rsp->gfn);
+        /*
+         * Do not add gfn to mru list if the target is lower than mru size.
+         * This allows page-out of these gfns if the target grows again.
+         */
+        if (paging->num_paged_out > paging->policy_mru_size)
+            policy_notify_paged_in(rsp->gfn);
+        else
+            policy_notify_paged_in_nomru(rsp->gfn);
 
        /* Record number of resumed pages */
        paging->num_paged_out--;
@@ -869,7 +876,7 @@
                 {
                     DPRINTF("drop_page ^ gfn %"PRIx64" pageslot %d\n", req.gfn, i);
                     /* Notify policy of page being dropped */
-                    policy_notify_paged_in(req.gfn);
+                    policy_notify_dropped(req.gfn);
                 }
                 else
                 {

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:45 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhl-0000cX-BY; Mon, 28 Nov 2011 23:33:45 +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 1RVAhi-0000UA-GW
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:42 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1322523163!42773188!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17185 invoked from network); 28 Nov 2011 23:32:44 -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;
	28 Nov 2011 23:32: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 1RVAnb-0001m3-S6
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAha-0000xR-RV
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:34 +0000
Message-Id: <E1RVAha-0000xR-RV@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:34 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: improve policy mru list
	handling
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1321804970 -3600
# Node ID d47d1ad5636631cd955594da70f54e5b0550276e
# Parent  7243fd87410e32502ec407a0abca89fa293a03bc
xenpaging: improve policy mru list handling

Without this change it is not possible to page-out all guest pages, then
trigger a page-in for all pages, and then page-out everything once
again. All pages in the mru list can not be paged out because they
remain active in the internal bitmap of paged pages.

Use the mru list only if the number of paged-out pages is larger than
the mru list. If the number is smaller, start to clear the mru list. In
case the number of paged-out pages drops to zero the mru list and the
internal bitmap will be empty as well.

Also add a new interface for dropped pages. If a gfn was dropped there
is no need to adjust the mru list because dropping a page is not usage
of a page.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 7243fd87410e -r d47d1ad56366 tools/xenpaging/policy.h
--- a/tools/xenpaging/policy.h	Sun Nov 20 17:02:48 2011 +0100
+++ b/tools/xenpaging/policy.h	Sun Nov 20 17:02:50 2011 +0100
@@ -32,6 +32,8 @@
 int policy_choose_victim(xenpaging_t *paging, xenpaging_victim_t *victim);
 void policy_notify_paged_out(unsigned long gfn);
 void policy_notify_paged_in(unsigned long gfn);
+void policy_notify_paged_in_nomru(unsigned long gfn);
+void policy_notify_dropped(unsigned long gfn);
 
 #endif // __XEN_PAGING_POLICY_H__
 
diff -r 7243fd87410e -r d47d1ad56366 tools/xenpaging/policy_default.c
--- a/tools/xenpaging/policy_default.c	Sun Nov 20 17:02:48 2011 +0100
+++ b/tools/xenpaging/policy_default.c	Sun Nov 20 17:02:50 2011 +0100
@@ -57,7 +57,7 @@
     if ( paging->policy_mru_size > 0 )
         mru_size = paging->policy_mru_size;
     else
-        mru_size = DEFAULT_MRU_SIZE;
+        mru_size = paging->policy_mru_size = DEFAULT_MRU_SIZE;
 
     mru = malloc(sizeof(*mru) * mru_size);
     if ( mru == NULL )
@@ -120,17 +120,38 @@
     clear_bit(gfn, unconsumed);
 }
 
-void policy_notify_paged_in(unsigned long gfn)
+static void policy_handle_paged_in(unsigned long gfn, int do_mru)
 {
     unsigned long old_gfn = mru[i_mru & (mru_size - 1)];
 
     if ( old_gfn != INVALID_MFN )
         clear_bit(old_gfn, bitmap);
     
-    mru[i_mru & (mru_size - 1)] = gfn;
+    if (do_mru) {
+        mru[i_mru & (mru_size - 1)] = gfn;
+    } else {
+        clear_bit(gfn, bitmap);
+        mru[i_mru & (mru_size - 1)] = INVALID_MFN;
+    }
+
     i_mru++;
 }
 
+void policy_notify_paged_in(unsigned long gfn)
+{
+    policy_handle_paged_in(gfn, 1);
+}
+
+void policy_notify_paged_in_nomru(unsigned long gfn)
+{
+    policy_handle_paged_in(gfn, 0);
+}
+
+void policy_notify_dropped(unsigned long gfn)
+{
+    clear_bit(gfn, bitmap);
+}
+
 
 /*
  * Local variables:
diff -r 7243fd87410e -r d47d1ad56366 tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Sun Nov 20 17:02:48 2011 +0100
+++ b/tools/xenpaging/xenpaging.c	Sun Nov 20 17:02:50 2011 +0100
@@ -615,7 +615,14 @@
     /* Notify policy of page being paged in */
     if ( notify_policy )
     {
-        policy_notify_paged_in(rsp->gfn);
+        /*
+         * Do not add gfn to mru list if the target is lower than mru size.
+         * This allows page-out of these gfns if the target grows again.
+         */
+        if (paging->num_paged_out > paging->policy_mru_size)
+            policy_notify_paged_in(rsp->gfn);
+        else
+            policy_notify_paged_in_nomru(rsp->gfn);
 
        /* Record number of resumed pages */
        paging->num_paged_out--;
@@ -869,7 +876,7 @@
                 {
                     DPRINTF("drop_page ^ gfn %"PRIx64" pageslot %d\n", req.gfn, i);
                     /* Notify policy of page being dropped */
-                    policy_notify_paged_in(req.gfn);
+                    policy_notify_dropped(req.gfn);
                 }
                 else
                 {

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:45 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhl-0000cz-Hn; Mon, 28 Nov 2011 23:33:45 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhi-0000JL-W5
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:43 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1322523185!5291111!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15533 invoked from network); 28 Nov 2011 23:33:06 -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;
	28 Nov 2011 23:33: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 1RVAnX-0001l9-Dg
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhW-0000vG-D9
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:30 +0000
Message-Id: <E1RVAhW-0000vG-D9@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:29 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: move page add/resume
	loops into its own function.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1321804959 -3600
# Node ID 4fe585c2a3e591e031d4ebb9210fd0bfee7a92ca
# Parent  dc7dabe2fe99d29ccdc8c9e64458c09ecf6a48b5
xenpaging: move page add/resume loops into its own function.

Move page resume loop into its own function.
Move page eviction loop into its own function.
Allocate all possible slots in a paging file to allow growing and
shrinking of the number of paged-out pages. Adjust other places to
iterate over all slots.

This change is required by subsequent patches.

v2:
 - check if victims allocation succeeded

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r dc7dabe2fe99 -r 4fe585c2a3e5 tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Sun Nov 20 17:02:38 2011 +0100
+++ b/tools/xenpaging/xenpaging.c	Sun Nov 20 17:02:39 2011 +0100
@@ -553,6 +553,27 @@
     return ret;
 }
 
+/* Trigger a page-in for a batch of pages */
+static void resume_pages(xenpaging_t *paging, int num_pages)
+{
+    xc_interface *xch = paging->xc_handle;
+    int i, num = 0;
+
+    for ( i = 0; i < paging->max_pages && num < num_pages; i++ )
+    {
+        if ( test_bit(i, paging->bitmap) )
+        {
+            paging->pagein_queue[num] = i;
+            num++;
+            if ( num == XENPAGING_PAGEIN_QUEUE_SIZE )
+                break;
+        }
+    }
+    /* num may be less than num_pages, caller has to try again */
+    if ( num )
+        page_in_trigger();
+}
+
 static int evict_victim(xenpaging_t *paging,
                         xenpaging_victim_t *victim, int fd, int i)
 {
@@ -596,6 +617,30 @@
     return ret;
 }
 
+/* Evict a batch of pages and write them to a free slot in the paging file */
+static int evict_pages(xenpaging_t *paging, int fd, xenpaging_victim_t *victims, int num_pages)
+{
+    xc_interface *xch = paging->xc_handle;
+    int rc, slot, num = 0;
+
+    for ( slot = 0; slot < paging->max_pages && num < num_pages; slot++ )
+    {
+        /* Slot is allocated */
+        if ( victims[slot].gfn != INVALID_MFN )
+            continue;
+
+        rc = evict_victim(paging, &victims[slot], fd, slot);
+        if ( rc == -ENOSPC )
+            break;
+        if ( rc == -EINTR )
+            break;
+        if ( num && num % 100 == 0 )
+            DPRINTF("%d pages evicted\n", num);
+        num++;
+    }
+    return num;
+}
+
 int main(int argc, char *argv[])
 {
     struct sigaction act;
@@ -638,7 +683,14 @@
         return 2;
     }
 
-    victims = calloc(paging->num_pages, sizeof(xenpaging_victim_t));
+    /* Allocate upper limit of pages to allow growing and shrinking */
+    victims = calloc(paging->max_pages, sizeof(xenpaging_victim_t));
+    if ( !victims )
+        goto out;
+
+    /* Mark all slots as unallocated */
+    for ( i = 0; i < paging->max_pages; i++ )
+        victims[i].gfn = INVALID_MFN;
 
     /* ensure that if we get a signal, we'll do cleanup, then exit */
     act.sa_handler = close_handler;
@@ -652,18 +704,7 @@
     /* listen for page-in events to stop pager */
     create_page_in_thread(paging);
 
-    /* Evict pages */
-    for ( i = 0; i < paging->num_pages; i++ )
-    {
-        rc = evict_victim(paging, &victims[i], fd, i);
-        if ( rc == -ENOSPC )
-            break;
-        if ( rc == -EINTR )
-            break;
-        if ( i % 100 == 0 )
-            DPRINTF("%d pages evicted\n", i);
-    }
-
+    i = evict_pages(paging, fd, victims, paging->num_pages);
     DPRINTF("%d pages evicted. Done.\n", i);
 
     /* Swap pages in and out */
@@ -689,13 +730,13 @@
             if ( test_and_clear_bit(req.gfn, paging->bitmap) )
             {
                 /* Find where in the paging file to read from */
-                for ( i = 0; i < paging->num_pages; i++ )
+                for ( i = 0; i < paging->max_pages; i++ )
                 {
                     if ( victims[i].gfn == req.gfn )
                         break;
                 }
     
-                if ( i >= paging->num_pages )
+                if ( i >= paging->max_pages )
                 {
                     DPRINTF("Couldn't find page %"PRIx64"\n", req.gfn);
                     goto out;
@@ -767,25 +808,12 @@
         /* Write all pages back into the guest */
         if ( interrupted == SIGTERM || interrupted == SIGINT )
         {
-            int num = 0;
-            for ( i = 0; i < paging->max_pages; i++ )
-            {
-                if ( test_bit(i, paging->bitmap) )
-                {
-                    paging->pagein_queue[num] = i;
-                    num++;
-                    if ( num == XENPAGING_PAGEIN_QUEUE_SIZE )
-                        break;
-                }
-            }
-            /*
-             * One more round if there are still pages to process.
-             * If no more pages to process, exit loop.
-             */
-            if ( num )
-                page_in_trigger();
-            else if ( i == paging->max_pages )
+            /* If no more pages to process, exit loop. */
+            if ( !paging->num_paged_out )
                 break;
+            
+            /* One more round if there are still pages to process. */
+            resume_pages(paging, paging->num_paged_out);
         }
         else
         {

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:45 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhl-0000cz-Hn; Mon, 28 Nov 2011 23:33:45 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhi-0000JL-W5
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:43 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1322523185!5291111!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15533 invoked from network); 28 Nov 2011 23:33:06 -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;
	28 Nov 2011 23:33: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 1RVAnX-0001l9-Dg
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhW-0000vG-D9
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:30 +0000
Message-Id: <E1RVAhW-0000vG-D9@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:29 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: move page add/resume
	loops into its own function.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1321804959 -3600
# Node ID 4fe585c2a3e591e031d4ebb9210fd0bfee7a92ca
# Parent  dc7dabe2fe99d29ccdc8c9e64458c09ecf6a48b5
xenpaging: move page add/resume loops into its own function.

Move page resume loop into its own function.
Move page eviction loop into its own function.
Allocate all possible slots in a paging file to allow growing and
shrinking of the number of paged-out pages. Adjust other places to
iterate over all slots.

This change is required by subsequent patches.

v2:
 - check if victims allocation succeeded

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r dc7dabe2fe99 -r 4fe585c2a3e5 tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Sun Nov 20 17:02:38 2011 +0100
+++ b/tools/xenpaging/xenpaging.c	Sun Nov 20 17:02:39 2011 +0100
@@ -553,6 +553,27 @@
     return ret;
 }
 
+/* Trigger a page-in for a batch of pages */
+static void resume_pages(xenpaging_t *paging, int num_pages)
+{
+    xc_interface *xch = paging->xc_handle;
+    int i, num = 0;
+
+    for ( i = 0; i < paging->max_pages && num < num_pages; i++ )
+    {
+        if ( test_bit(i, paging->bitmap) )
+        {
+            paging->pagein_queue[num] = i;
+            num++;
+            if ( num == XENPAGING_PAGEIN_QUEUE_SIZE )
+                break;
+        }
+    }
+    /* num may be less than num_pages, caller has to try again */
+    if ( num )
+        page_in_trigger();
+}
+
 static int evict_victim(xenpaging_t *paging,
                         xenpaging_victim_t *victim, int fd, int i)
 {
@@ -596,6 +617,30 @@
     return ret;
 }
 
+/* Evict a batch of pages and write them to a free slot in the paging file */
+static int evict_pages(xenpaging_t *paging, int fd, xenpaging_victim_t *victims, int num_pages)
+{
+    xc_interface *xch = paging->xc_handle;
+    int rc, slot, num = 0;
+
+    for ( slot = 0; slot < paging->max_pages && num < num_pages; slot++ )
+    {
+        /* Slot is allocated */
+        if ( victims[slot].gfn != INVALID_MFN )
+            continue;
+
+        rc = evict_victim(paging, &victims[slot], fd, slot);
+        if ( rc == -ENOSPC )
+            break;
+        if ( rc == -EINTR )
+            break;
+        if ( num && num % 100 == 0 )
+            DPRINTF("%d pages evicted\n", num);
+        num++;
+    }
+    return num;
+}
+
 int main(int argc, char *argv[])
 {
     struct sigaction act;
@@ -638,7 +683,14 @@
         return 2;
     }
 
-    victims = calloc(paging->num_pages, sizeof(xenpaging_victim_t));
+    /* Allocate upper limit of pages to allow growing and shrinking */
+    victims = calloc(paging->max_pages, sizeof(xenpaging_victim_t));
+    if ( !victims )
+        goto out;
+
+    /* Mark all slots as unallocated */
+    for ( i = 0; i < paging->max_pages; i++ )
+        victims[i].gfn = INVALID_MFN;
 
     /* ensure that if we get a signal, we'll do cleanup, then exit */
     act.sa_handler = close_handler;
@@ -652,18 +704,7 @@
     /* listen for page-in events to stop pager */
     create_page_in_thread(paging);
 
-    /* Evict pages */
-    for ( i = 0; i < paging->num_pages; i++ )
-    {
-        rc = evict_victim(paging, &victims[i], fd, i);
-        if ( rc == -ENOSPC )
-            break;
-        if ( rc == -EINTR )
-            break;
-        if ( i % 100 == 0 )
-            DPRINTF("%d pages evicted\n", i);
-    }
-
+    i = evict_pages(paging, fd, victims, paging->num_pages);
     DPRINTF("%d pages evicted. Done.\n", i);
 
     /* Swap pages in and out */
@@ -689,13 +730,13 @@
             if ( test_and_clear_bit(req.gfn, paging->bitmap) )
             {
                 /* Find where in the paging file to read from */
-                for ( i = 0; i < paging->num_pages; i++ )
+                for ( i = 0; i < paging->max_pages; i++ )
                 {
                     if ( victims[i].gfn == req.gfn )
                         break;
                 }
     
-                if ( i >= paging->num_pages )
+                if ( i >= paging->max_pages )
                 {
                     DPRINTF("Couldn't find page %"PRIx64"\n", req.gfn);
                     goto out;
@@ -767,25 +808,12 @@
         /* Write all pages back into the guest */
         if ( interrupted == SIGTERM || interrupted == SIGINT )
         {
-            int num = 0;
-            for ( i = 0; i < paging->max_pages; i++ )
-            {
-                if ( test_bit(i, paging->bitmap) )
-                {
-                    paging->pagein_queue[num] = i;
-                    num++;
-                    if ( num == XENPAGING_PAGEIN_QUEUE_SIZE )
-                        break;
-                }
-            }
-            /*
-             * One more round if there are still pages to process.
-             * If no more pages to process, exit loop.
-             */
-            if ( num )
-                page_in_trigger();
-            else if ( i == paging->max_pages )
+            /* If no more pages to process, exit loop. */
+            if ( !paging->num_paged_out )
                 break;
+            
+            /* One more round if there are still pages to process. */
+            resume_pages(paging, paging->num_paged_out);
         }
         else
         {

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:46 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33: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.xensource.com>)
	id 1RVAhl-0000db-T1; Mon, 28 Nov 2011 23:33:45 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhi-0000Iw-RA
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:43 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1322523184!4976583!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21069 invoked from network); 28 Nov 2011 23:33:05 -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;
	28 Nov 2011 23: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 1RVAnW-0001kw-Tv
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhV-0000v1-TS
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:29 +0000
Message-Id: <E1RVAhV-0000v1-TS@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:29 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: track the number of
	paged-out pages
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1321804958 -3600
# Node ID dc7dabe2fe99d29ccdc8c9e64458c09ecf6a48b5
# Parent  f06595abfa8874edb60371f4b5392bb75b3df2d0
xenpaging: track the number of paged-out pages

This change is required by subsequent changes.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r f06595abfa88 -r dc7dabe2fe99 tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Sun Nov 20 17:02:36 2011 +0100
+++ b/tools/xenpaging/xenpaging.c	Sun Nov 20 17:02:38 2011 +0100
@@ -467,6 +467,9 @@
     /* Notify policy of page being paged out */
     policy_notify_paged_out(victim->gfn);
 
+    /* Record number of evicted pages */
+    paging->num_paged_out++;
+
  out:
     return ret;
 }
@@ -480,8 +483,13 @@
 
     /* Notify policy of page being paged in */
     if ( notify_policy )
+    {
         policy_notify_paged_in(rsp->gfn);
 
+       /* Record number of resumed pages */
+       paging->num_paged_out--;
+    }
+
     /* Tell Xen page is ready */
     ret = xc_mem_paging_resume(paging->xc_handle, paging->mem_event.domain_id,
                                rsp->gfn);
diff -r f06595abfa88 -r dc7dabe2fe99 tools/xenpaging/xenpaging.h
--- a/tools/xenpaging/xenpaging.h	Sun Nov 20 17:02:36 2011 +0100
+++ b/tools/xenpaging/xenpaging.h	Sun Nov 20 17:02:38 2011 +0100
@@ -49,6 +49,7 @@
     mem_event_t mem_event;
     /* number of pages for which data structures were allocated */
     int max_pages;
+    int num_paged_out;
     int num_pages;
     int policy_mru_size;
     unsigned long pagein_queue[XENPAGING_PAGEIN_QUEUE_SIZE];

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:46 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33: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.xensource.com>)
	id 1RVAhl-0000db-T1; Mon, 28 Nov 2011 23:33:45 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhi-0000Iw-RA
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:43 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1322523184!4976583!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21069 invoked from network); 28 Nov 2011 23:33:05 -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;
	28 Nov 2011 23: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 1RVAnW-0001kw-Tv
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhV-0000v1-TS
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:29 +0000
Message-Id: <E1RVAhV-0000v1-TS@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:29 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: track the number of
	paged-out pages
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1321804958 -3600
# Node ID dc7dabe2fe99d29ccdc8c9e64458c09ecf6a48b5
# Parent  f06595abfa8874edb60371f4b5392bb75b3df2d0
xenpaging: track the number of paged-out pages

This change is required by subsequent changes.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r f06595abfa88 -r dc7dabe2fe99 tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Sun Nov 20 17:02:36 2011 +0100
+++ b/tools/xenpaging/xenpaging.c	Sun Nov 20 17:02:38 2011 +0100
@@ -467,6 +467,9 @@
     /* Notify policy of page being paged out */
     policy_notify_paged_out(victim->gfn);
 
+    /* Record number of evicted pages */
+    paging->num_paged_out++;
+
  out:
     return ret;
 }
@@ -480,8 +483,13 @@
 
     /* Notify policy of page being paged in */
     if ( notify_policy )
+    {
         policy_notify_paged_in(rsp->gfn);
 
+       /* Record number of resumed pages */
+       paging->num_paged_out--;
+    }
+
     /* Tell Xen page is ready */
     ret = xc_mem_paging_resume(paging->xc_handle, paging->mem_event.domain_id,
                                rsp->gfn);
diff -r f06595abfa88 -r dc7dabe2fe99 tools/xenpaging/xenpaging.h
--- a/tools/xenpaging/xenpaging.h	Sun Nov 20 17:02:36 2011 +0100
+++ b/tools/xenpaging/xenpaging.h	Sun Nov 20 17:02:38 2011 +0100
@@ -49,6 +49,7 @@
     mem_event_t mem_event;
     /* number of pages for which data structures were allocated */
     int max_pages;
+    int num_paged_out;
     int num_pages;
     int policy_mru_size;
     unsigned long pagein_queue[XENPAGING_PAGEIN_QUEUE_SIZE];

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:47 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhm-0000fO-NC; Mon, 28 Nov 2011 23:33:46 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhj-0000Jk-7A
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:43 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-216.messagelabs.com!1322523185!5375538!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21024 invoked from network); 28 Nov 2011 23:33:06 -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;
	28 Nov 2011 23:33: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 1RVAnX-0001lH-Tu
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhW-0000vV-TK
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:30 +0000
Message-Id: <E1RVAhW-0000vV-TK@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:30 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: improve mainloop exit
	handling
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1321804959 -3600
# Node ID b531f5ceddf0fb291ffb23ccbaaa433207f45f80
# Parent  4fe585c2a3e591e031d4ebb9210fd0bfee7a92ca
xenpaging: improve mainloop exit handling

Remove the if/else logic to exit from the in case a signal arrives.
Update comments.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 4fe585c2a3e5 -r b531f5ceddf0 tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Sun Nov 20 17:02:39 2011 +0100
+++ b/tools/xenpaging/xenpaging.c	Sun Nov 20 17:02:39 2011 +0100
@@ -805,7 +805,7 @@
             }
         }
 
-        /* Write all pages back into the guest */
+        /* If interrupted, write all pages back into the guest */
         if ( interrupted == SIGTERM || interrupted == SIGINT )
         {
             /* If no more pages to process, exit loop. */
@@ -814,13 +814,15 @@
             
             /* One more round if there are still pages to process. */
             resume_pages(paging, paging->num_paged_out);
+
+            /* Resume main loop */
+            continue;
         }
-        else
-        {
-            /* Exit on any other signal */
-            if ( interrupted )
-                break;
-        }
+
+        /* Exit main loop on any other signal */
+        if ( interrupted )
+            break;
+
     }
     DPRINTF("xenpaging got signal %d\n", interrupted);
 

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:47 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhm-0000fO-NC; Mon, 28 Nov 2011 23:33:46 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhj-0000Jk-7A
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:43 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-216.messagelabs.com!1322523185!5375538!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21024 invoked from network); 28 Nov 2011 23:33:06 -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;
	28 Nov 2011 23:33: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 1RVAnX-0001lH-Tu
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhW-0000vV-TK
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:30 +0000
Message-Id: <E1RVAhW-0000vV-TK@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:30 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: improve mainloop exit
	handling
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1321804959 -3600
# Node ID b531f5ceddf0fb291ffb23ccbaaa433207f45f80
# Parent  4fe585c2a3e591e031d4ebb9210fd0bfee7a92ca
xenpaging: improve mainloop exit handling

Remove the if/else logic to exit from the in case a signal arrives.
Update comments.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 4fe585c2a3e5 -r b531f5ceddf0 tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Sun Nov 20 17:02:39 2011 +0100
+++ b/tools/xenpaging/xenpaging.c	Sun Nov 20 17:02:39 2011 +0100
@@ -805,7 +805,7 @@
             }
         }
 
-        /* Write all pages back into the guest */
+        /* If interrupted, write all pages back into the guest */
         if ( interrupted == SIGTERM || interrupted == SIGINT )
         {
             /* If no more pages to process, exit loop. */
@@ -814,13 +814,15 @@
             
             /* One more round if there are still pages to process. */
             resume_pages(paging, paging->num_paged_out);
+
+            /* Resume main loop */
+            continue;
         }
-        else
-        {
-            /* Exit on any other signal */
-            if ( interrupted )
-                break;
-        }
+
+        /* Exit main loop on any other signal */
+        if ( interrupted )
+            break;
+
     }
     DPRINTF("xenpaging got signal %d\n", interrupted);
 

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:47 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhn-0000gx-Fp; Mon, 28 Nov 2011 23:33:47 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhi-0000Hz-Fp
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:42 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-182.messagelabs.com!1322523184!5038379!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9654 invoked from network); 28 Nov 2011 23:33:05 -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;
	28 Nov 2011 23: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 1RVAnW-0001ko-EG
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhV-0000um-Dj
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:29 +0000
Message-Id: <E1RVAhV-0000um-Dj@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:28 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: remove xc_dominfo_t from
	paging_t
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1321804956 -3600
# Node ID f06595abfa8874edb60371f4b5392bb75b3df2d0
# Parent  e3cbbad7238220282eb84d69f30ebb1559f713a9
xenpaging: remove xc_dominfo_t from paging_t

Remove xc_dominfo_t from paging_t, record only max_pages.
This value is used to setup internal data structures.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r e3cbbad72382 -r f06595abfa88 tools/xenpaging/policy_default.c
--- a/tools/xenpaging/policy_default.c	Sun Nov 20 17:02:22 2011 +0100
+++ b/tools/xenpaging/policy_default.c	Sun Nov 20 17:02:36 2011 +0100
@@ -41,17 +41,17 @@
     int i;
     int rc = -ENOMEM;
 
+    max_pages = paging->max_pages;
+
     /* Allocate bitmap for pages not to page out */
-    bitmap = bitmap_alloc(paging->domain_info->max_pages);
+    bitmap = bitmap_alloc(max_pages);
     if ( !bitmap )
         goto out;
     /* Allocate bitmap to track unusable pages */
-    unconsumed = bitmap_alloc(paging->domain_info->max_pages);
+    unconsumed = bitmap_alloc(max_pages);
     if ( !unconsumed )
         goto out;
 
-    max_pages = paging->domain_info->max_pages;
-
     /* Initialise MRU list of paged in pages */
     if ( paging->policy_mru_size > 0 )
         mru_size = paging->policy_mru_size;
diff -r e3cbbad72382 -r f06595abfa88 tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Sun Nov 20 17:02:22 2011 +0100
+++ b/tools/xenpaging/xenpaging.c	Sun Nov 20 17:02:36 2011 +0100
@@ -164,6 +164,7 @@
 static xenpaging_t *xenpaging_init(domid_t domain_id, int num_pages)
 {
     xenpaging_t *paging;
+    xc_domaininfo_t domain_info;
     xc_interface *xch;
     xentoollog_logger *dbg = NULL;
     char *p;
@@ -275,34 +276,29 @@
 
     paging->mem_event.port = rc;
 
-    /* Get domaininfo */
-    paging->domain_info = malloc(sizeof(xc_domaininfo_t));
-    if ( paging->domain_info == NULL )
-    {
-        PERROR("Error allocating memory for domain info");
-        goto err;
-    }
-
     rc = xc_domain_getinfolist(xch, paging->mem_event.domain_id, 1,
-                               paging->domain_info);
+                               &domain_info);
     if ( rc != 1 )
     {
         PERROR("Error getting domain info");
         goto err;
     }
 
+    /* Record number of max_pages */
+    paging->max_pages = domain_info.max_pages;
+
     /* Allocate bitmap for tracking pages that have been paged out */
-    paging->bitmap = bitmap_alloc(paging->domain_info->max_pages);
+    paging->bitmap = bitmap_alloc(paging->max_pages);
     if ( !paging->bitmap )
     {
         PERROR("Error allocating bitmap");
         goto err;
     }
-    DPRINTF("max_pages = %"PRIx64"\n", paging->domain_info->max_pages);
+    DPRINTF("max_pages = %d\n", paging->max_pages);
 
-    if ( num_pages < 0 || num_pages > paging->domain_info->max_pages )
+    if ( num_pages < 0 || num_pages > paging->max_pages )
     {
-        num_pages = paging->domain_info->max_pages;
+        num_pages = paging->max_pages;
         DPRINTF("setting num_pages to %d\n", num_pages);
     }
     paging->num_pages = num_pages;
@@ -337,7 +333,6 @@
         }
 
         free(paging->bitmap);
-        free(paging->domain_info);
         free(paging);
     }
 
@@ -765,7 +760,7 @@
         if ( interrupted == SIGTERM || interrupted == SIGINT )
         {
             int num = 0;
-            for ( i = 0; i < paging->domain_info->max_pages; i++ )
+            for ( i = 0; i < paging->max_pages; i++ )
             {
                 if ( test_bit(i, paging->bitmap) )
                 {
@@ -781,7 +776,7 @@
              */
             if ( num )
                 page_in_trigger();
-            else if ( i == paging->domain_info->max_pages )
+            else if ( i == paging->max_pages )
                 break;
         }
         else
diff -r e3cbbad72382 -r f06595abfa88 tools/xenpaging/xenpaging.h
--- a/tools/xenpaging/xenpaging.h	Sun Nov 20 17:02:22 2011 +0100
+++ b/tools/xenpaging/xenpaging.h	Sun Nov 20 17:02:36 2011 +0100
@@ -44,11 +44,11 @@
     xc_interface *xc_handle;
     struct xs_handle *xs_handle;
 
-    xc_domaininfo_t    *domain_info;
-
     unsigned long *bitmap;
 
     mem_event_t mem_event;
+    /* number of pages for which data structures were allocated */
+    int max_pages;
     int num_pages;
     int policy_mru_size;
     unsigned long pagein_queue[XENPAGING_PAGEIN_QUEUE_SIZE];

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:47 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhn-0000gx-Fp; Mon, 28 Nov 2011 23:33:47 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhi-0000Hz-Fp
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:42 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-182.messagelabs.com!1322523184!5038379!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9654 invoked from network); 28 Nov 2011 23:33:05 -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;
	28 Nov 2011 23: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 1RVAnW-0001ko-EG
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhV-0000um-Dj
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:29 +0000
Message-Id: <E1RVAhV-0000um-Dj@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:28 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: remove xc_dominfo_t from
	paging_t
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1321804956 -3600
# Node ID f06595abfa8874edb60371f4b5392bb75b3df2d0
# Parent  e3cbbad7238220282eb84d69f30ebb1559f713a9
xenpaging: remove xc_dominfo_t from paging_t

Remove xc_dominfo_t from paging_t, record only max_pages.
This value is used to setup internal data structures.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r e3cbbad72382 -r f06595abfa88 tools/xenpaging/policy_default.c
--- a/tools/xenpaging/policy_default.c	Sun Nov 20 17:02:22 2011 +0100
+++ b/tools/xenpaging/policy_default.c	Sun Nov 20 17:02:36 2011 +0100
@@ -41,17 +41,17 @@
     int i;
     int rc = -ENOMEM;
 
+    max_pages = paging->max_pages;
+
     /* Allocate bitmap for pages not to page out */
-    bitmap = bitmap_alloc(paging->domain_info->max_pages);
+    bitmap = bitmap_alloc(max_pages);
     if ( !bitmap )
         goto out;
     /* Allocate bitmap to track unusable pages */
-    unconsumed = bitmap_alloc(paging->domain_info->max_pages);
+    unconsumed = bitmap_alloc(max_pages);
     if ( !unconsumed )
         goto out;
 
-    max_pages = paging->domain_info->max_pages;
-
     /* Initialise MRU list of paged in pages */
     if ( paging->policy_mru_size > 0 )
         mru_size = paging->policy_mru_size;
diff -r e3cbbad72382 -r f06595abfa88 tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Sun Nov 20 17:02:22 2011 +0100
+++ b/tools/xenpaging/xenpaging.c	Sun Nov 20 17:02:36 2011 +0100
@@ -164,6 +164,7 @@
 static xenpaging_t *xenpaging_init(domid_t domain_id, int num_pages)
 {
     xenpaging_t *paging;
+    xc_domaininfo_t domain_info;
     xc_interface *xch;
     xentoollog_logger *dbg = NULL;
     char *p;
@@ -275,34 +276,29 @@
 
     paging->mem_event.port = rc;
 
-    /* Get domaininfo */
-    paging->domain_info = malloc(sizeof(xc_domaininfo_t));
-    if ( paging->domain_info == NULL )
-    {
-        PERROR("Error allocating memory for domain info");
-        goto err;
-    }
-
     rc = xc_domain_getinfolist(xch, paging->mem_event.domain_id, 1,
-                               paging->domain_info);
+                               &domain_info);
     if ( rc != 1 )
     {
         PERROR("Error getting domain info");
         goto err;
     }
 
+    /* Record number of max_pages */
+    paging->max_pages = domain_info.max_pages;
+
     /* Allocate bitmap for tracking pages that have been paged out */
-    paging->bitmap = bitmap_alloc(paging->domain_info->max_pages);
+    paging->bitmap = bitmap_alloc(paging->max_pages);
     if ( !paging->bitmap )
     {
         PERROR("Error allocating bitmap");
         goto err;
     }
-    DPRINTF("max_pages = %"PRIx64"\n", paging->domain_info->max_pages);
+    DPRINTF("max_pages = %d\n", paging->max_pages);
 
-    if ( num_pages < 0 || num_pages > paging->domain_info->max_pages )
+    if ( num_pages < 0 || num_pages > paging->max_pages )
     {
-        num_pages = paging->domain_info->max_pages;
+        num_pages = paging->max_pages;
         DPRINTF("setting num_pages to %d\n", num_pages);
     }
     paging->num_pages = num_pages;
@@ -337,7 +333,6 @@
         }
 
         free(paging->bitmap);
-        free(paging->domain_info);
         free(paging);
     }
 
@@ -765,7 +760,7 @@
         if ( interrupted == SIGTERM || interrupted == SIGINT )
         {
             int num = 0;
-            for ( i = 0; i < paging->domain_info->max_pages; i++ )
+            for ( i = 0; i < paging->max_pages; i++ )
             {
                 if ( test_bit(i, paging->bitmap) )
                 {
@@ -781,7 +776,7 @@
              */
             if ( num )
                 page_in_trigger();
-            else if ( i == paging->domain_info->max_pages )
+            else if ( i == paging->max_pages )
                 break;
         }
         else
diff -r e3cbbad72382 -r f06595abfa88 tools/xenpaging/xenpaging.h
--- a/tools/xenpaging/xenpaging.h	Sun Nov 20 17:02:22 2011 +0100
+++ b/tools/xenpaging/xenpaging.h	Sun Nov 20 17:02:36 2011 +0100
@@ -44,11 +44,11 @@
     xc_interface *xc_handle;
     struct xs_handle *xs_handle;
 
-    xc_domaininfo_t    *domain_info;
-
     unsigned long *bitmap;
 
     mem_event_t mem_event;
+    /* number of pages for which data structures were allocated */
+    int max_pages;
     int num_pages;
     int policy_mru_size;
     unsigned long pagein_queue[XENPAGING_PAGEIN_QUEUE_SIZE];

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:48 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAho-0000iQ-2S; Mon, 28 Nov 2011 23:33: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 1RVAhj-0000XC-JF
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:43 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-27.messagelabs.com!1322523174!47446226!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10195 invoked from network); 28 Nov 2011 23:32:55 -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;
	28 Nov 2011 23:32:55 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnc-0001m9-SK
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhb-0000xv-Rc
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:35 +0000
Message-Id: <E1RVAhb-0000xv-Rc@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:35 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: restrict pagefile
	permissions
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1321809976 -3600
# Node ID 1027e7d13d02143048c7d48d7960967c5b1657a8
# Parent  c9b75ccd3ebfb3b78f0e2064373802a5d4b24da9
xenpaging: restrict pagefile permissions

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r c9b75ccd3ebf -r 1027e7d13d02 tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Sun Nov 20 18:26:15 2011 +0100
+++ b/tools/xenpaging/xenpaging.c	Sun Nov 20 18:26:16 2011 +0100
@@ -795,7 +795,7 @@
     xc_interface *xch;
 
     int open_flags = O_CREAT | O_TRUNC | O_RDWR;
-    mode_t open_mode = S_IRUSR | S_IRGRP | S_IROTH | S_IWUSR | S_IWGRP | S_IWOTH;
+    mode_t open_mode = S_IRUSR | S_IWUSR;
     int fd;
 
     /* Initialise domain paging */

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:48 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAho-0000iQ-2S; Mon, 28 Nov 2011 23:33: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 1RVAhj-0000XC-JF
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:43 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-27.messagelabs.com!1322523174!47446226!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10195 invoked from network); 28 Nov 2011 23:32:55 -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;
	28 Nov 2011 23:32:55 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnc-0001m9-SK
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhb-0000xv-Rc
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:35 +0000
Message-Id: <E1RVAhb-0000xv-Rc@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:35 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: restrict pagefile
	permissions
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1321809976 -3600
# Node ID 1027e7d13d02143048c7d48d7960967c5b1657a8
# Parent  c9b75ccd3ebfb3b78f0e2064373802a5d4b24da9
xenpaging: restrict pagefile permissions

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r c9b75ccd3ebf -r 1027e7d13d02 tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Sun Nov 20 18:26:15 2011 +0100
+++ b/tools/xenpaging/xenpaging.c	Sun Nov 20 18:26:16 2011 +0100
@@ -795,7 +795,7 @@
     xc_interface *xch;
 
     int open_flags = O_CREAT | O_TRUNC | O_RDWR;
-    mode_t open_mode = S_IRUSR | S_IRGRP | S_IROTH | S_IWUSR | S_IWGRP | S_IWOTH;
+    mode_t open_mode = S_IRUSR | S_IWUSR;
     int fd;
 
     /* Initialise domain paging */

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:49 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhp-0000kx-ET; Mon, 28 Nov 2011 23:33:49 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhk-0000NL-GL
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:44 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-182.messagelabs.com!1322523186!5037893!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11886 invoked from network); 28 Nov 2011 23:33:07 -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;
	28 Nov 2011 23:33: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 1RVAnY-0001lN-Dj
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhX-0000vk-D8
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:31 +0000
Message-Id: <E1RVAhX-0000vk-D8@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:30 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxc: add bitmap_clear function
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1321804960 -3600
# Node ID a2b4ae2becdf71c8d75cc34fcd56558632f757b4
# Parent  b531f5ceddf0fb291ffb23ccbaaa433207f45f80
libxc: add bitmap_clear function

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r b531f5ceddf0 -r a2b4ae2becdf tools/libxc/xc_bitops.h
--- a/tools/libxc/xc_bitops.h	Sun Nov 20 17:02:39 2011 +0100
+++ b/tools/libxc/xc_bitops.h	Sun Nov 20 17:02:40 2011 +0100
@@ -4,6 +4,7 @@
 /* bitmap operations for single threaded access */
 
 #include <stdlib.h>
+#include <string.h>
 
 #define BITS_PER_LONG (sizeof(unsigned long) * 8)
 #define ORDER_LONG (sizeof(unsigned long) == 4 ? 5 : 6)
@@ -25,6 +26,11 @@
     return calloc(1, bitmap_size(nr_bits));
 }
 
+static inline void bitmap_clear(unsigned long *addr, int nr_bits)
+{
+    memset(addr, 0, bitmap_size(nr_bits));
+}
+
 static inline int test_bit(int nr, volatile unsigned long *addr)
 {
     return (BITMAP_ENTRY(nr, addr) >> BITMAP_SHIFT(nr)) & 1;

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:49 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhp-0000lO-MW; Mon, 28 Nov 2011 23:33: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 1RVAhk-0000Nz-OP
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:45 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-27.messagelabs.com!1322523171!47446223!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10043 invoked from network); 28 Nov 2011 23:32:52 -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;
	28 Nov 2011 23:32:52 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnZ-0001lZ-Cr
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhY-0000wE-CH
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:32 +0000
Message-Id: <E1RVAhY-0000wE-CH@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:31 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: install into LIBEXEC dir
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1321804962 -3600
# Node ID 2087f21befc202b2ae1c0f8318d51ddd500e1173
# Parent  8eba32b9598cdc60bdc4b446cbc8446078e37c04
xenpaging: install into LIBEXEC dir

In preparation of upcoming libxl integration,
move xenpaging binary from /usr/sbin/ to /usr/lib/xen/bin/

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 8eba32b9598c -r 2087f21befc2 tools/xenpaging/Makefile
--- a/tools/xenpaging/Makefile	Sun Nov 20 17:02:41 2011 +0100
+++ b/tools/xenpaging/Makefile	Sun Nov 20 17:02:42 2011 +0100
@@ -24,8 +24,8 @@
 
 install: all
 	$(INSTALL_DIR) $(DESTDIR)/var/lib/xen/xenpaging
-	$(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
-	$(INSTALL_PROG) $(IBINS) $(DESTDIR)$(SBINDIR)
+	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC)
+	$(INSTALL_PROG) $(IBINS) $(DESTDIR)$(LIBEXEC)
 
 clean:
 	rm -f *.o *~ $(DEPS) xen TAGS $(IBINS) $(LIB)

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:49 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhp-0000kx-ET; Mon, 28 Nov 2011 23:33:49 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhk-0000NL-GL
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:44 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-182.messagelabs.com!1322523186!5037893!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11886 invoked from network); 28 Nov 2011 23:33:07 -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;
	28 Nov 2011 23:33: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 1RVAnY-0001lN-Dj
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhX-0000vk-D8
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:31 +0000
Message-Id: <E1RVAhX-0000vk-D8@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:30 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxc: add bitmap_clear function
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1321804960 -3600
# Node ID a2b4ae2becdf71c8d75cc34fcd56558632f757b4
# Parent  b531f5ceddf0fb291ffb23ccbaaa433207f45f80
libxc: add bitmap_clear function

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r b531f5ceddf0 -r a2b4ae2becdf tools/libxc/xc_bitops.h
--- a/tools/libxc/xc_bitops.h	Sun Nov 20 17:02:39 2011 +0100
+++ b/tools/libxc/xc_bitops.h	Sun Nov 20 17:02:40 2011 +0100
@@ -4,6 +4,7 @@
 /* bitmap operations for single threaded access */
 
 #include <stdlib.h>
+#include <string.h>
 
 #define BITS_PER_LONG (sizeof(unsigned long) * 8)
 #define ORDER_LONG (sizeof(unsigned long) == 4 ? 5 : 6)
@@ -25,6 +26,11 @@
     return calloc(1, bitmap_size(nr_bits));
 }
 
+static inline void bitmap_clear(unsigned long *addr, int nr_bits)
+{
+    memset(addr, 0, bitmap_size(nr_bits));
+}
+
 static inline int test_bit(int nr, volatile unsigned long *addr)
 {
     return (BITMAP_ENTRY(nr, addr) >> BITMAP_SHIFT(nr)) & 1;

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:49 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhp-0000lO-MW; Mon, 28 Nov 2011 23:33: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 1RVAhk-0000Nz-OP
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:45 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-27.messagelabs.com!1322523171!47446223!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10043 invoked from network); 28 Nov 2011 23:32:52 -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;
	28 Nov 2011 23:32:52 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnZ-0001lZ-Cr
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhY-0000wE-CH
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:32 +0000
Message-Id: <E1RVAhY-0000wE-CH@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:31 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: install into LIBEXEC dir
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1321804962 -3600
# Node ID 2087f21befc202b2ae1c0f8318d51ddd500e1173
# Parent  8eba32b9598cdc60bdc4b446cbc8446078e37c04
xenpaging: install into LIBEXEC dir

In preparation of upcoming libxl integration,
move xenpaging binary from /usr/sbin/ to /usr/lib/xen/bin/

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 8eba32b9598c -r 2087f21befc2 tools/xenpaging/Makefile
--- a/tools/xenpaging/Makefile	Sun Nov 20 17:02:41 2011 +0100
+++ b/tools/xenpaging/Makefile	Sun Nov 20 17:02:42 2011 +0100
@@ -24,8 +24,8 @@
 
 install: all
 	$(INSTALL_DIR) $(DESTDIR)/var/lib/xen/xenpaging
-	$(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
-	$(INSTALL_PROG) $(IBINS) $(DESTDIR)$(SBINDIR)
+	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC)
+	$(INSTALL_PROG) $(IBINS) $(DESTDIR)$(LIBEXEC)
 
 clean:
 	rm -f *.o *~ $(DEPS) xen TAGS $(IBINS) $(LIB)

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:50 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhq-0000mP-5W; Mon, 28 Nov 2011 23:33:50 +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 1RVAhk-0000Z0-Ax
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:44 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1322523165!42773191!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17381 invoked from network); 28 Nov 2011 23:32:46 -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;
	28 Nov 2011 23:32:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnd-0001mR-T9
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhc-0000yP-Sa
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:36 +0000
Message-Id: <E1RVAhc-0000yP-Sa@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:36 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Fix save/restore for HVM domains
	with viridian=1
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Paul Durrant <paul.durrant@citrix.com>
# Date 1322235041 0
# Node ID 373bd877cac3a42482074a2d3393d0c78bef7e59
# Parent  67f70841e05853aba35bd97792f34a0569020639
Fix save/restore for HVM domains with viridian=1

xc_domain_save/restore currently pay no attention to
HVM_PARAM_VIRIDIAN which results in an HVM domain running a recent
version on Windows (post-Vista) locking up on a domain restore due to
EOIs (done via a viridian MSR write) being silently dropped.  This
patch adds an extra save entry for the viridian parameter and also
adds code in the viridian kernel module to catch attempted use of
viridian functionality when the HVM parameter has not been set.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 67f70841e058 -r 373bd877cac3 tools/libxc/xc_domain_restore.c
--- a/tools/libxc/xc_domain_restore.c	Fri Nov 25 13:31:58 2011 +0000
+++ b/tools/libxc/xc_domain_restore.c	Fri Nov 25 15:30:41 2011 +0000
@@ -675,6 +675,7 @@
     uint64_t vm86_tss;
     uint64_t console_pfn;
     uint64_t acpi_ioport_location;
+    uint64_t viridian;
 } pagebuf_t;
 
 static int pagebuf_init(pagebuf_t* buf)
@@ -809,6 +810,16 @@
         }
         return pagebuf_get_one(xch, ctx, buf, fd, dom);
 
+    case XC_SAVE_ID_HVM_VIRIDIAN:
+        /* Skip padding 4 bytes then read the acpi ioport location. */
+        if ( RDEXACT(fd, &buf->viridian, sizeof(uint32_t)) ||
+             RDEXACT(fd, &buf->viridian, sizeof(uint64_t)) )
+        {
+            PERROR("error read the viridian flag");
+            return -1;
+        }
+        return pagebuf_get_one(xch, ctx, buf, fd, dom);
+
     default:
         if ( (count > MAX_BATCH_SIZE) || (count < 0) ) {
             ERROR("Max batch size exceeded (%d). Giving up.", count);
@@ -1440,6 +1451,9 @@
             fcntl(io_fd, F_SETFL, orig_io_fd_flags | O_NONBLOCK);
     }
 
+    if (pagebuf.viridian != 0)
+        xc_set_hvm_param(xch, dom, HVM_PARAM_VIRIDIAN, 1);
+
     if (pagebuf.acpi_ioport_location == 1) {
         DBGPRINTF("Use new firmware ioport from the checkpoint\n");
         xc_set_hvm_param(xch, dom, HVM_PARAM_ACPI_IOPORTS_LOCATION, 1);
diff -r 67f70841e058 -r 373bd877cac3 tools/libxc/xc_domain_save.c
--- a/tools/libxc/xc_domain_save.c	Fri Nov 25 13:31:58 2011 +0000
+++ b/tools/libxc/xc_domain_save.c	Fri Nov 25 15:30:41 2011 +0000
@@ -1506,6 +1506,18 @@
             PERROR("Error when writing the firmware ioport version");
             goto out;
         }
+
+        chunk.id = XC_SAVE_ID_HVM_VIRIDIAN;
+        chunk.data = 0;
+        xc_get_hvm_param(xch, dom, HVM_PARAM_VIRIDIAN,
+                         (unsigned long *)&chunk.data);
+
+        if ( (chunk.data != 0) &&
+             wrexact(io_fd, &chunk, sizeof(chunk)) )
+        {
+            PERROR("Error when writing the viridian flag");
+            goto out;
+        }
     }
 
     if ( !callbacks->checkpoint )
diff -r 67f70841e058 -r 373bd877cac3 tools/libxc/xg_save_restore.h
--- a/tools/libxc/xg_save_restore.h	Fri Nov 25 13:31:58 2011 +0000
+++ b/tools/libxc/xg_save_restore.h	Fri Nov 25 15:30:41 2011 +0000
@@ -134,6 +134,7 @@
 #define XC_SAVE_ID_HVM_CONSOLE_PFN    -8 /* (HVM-only) */
 #define XC_SAVE_ID_LAST_CHECKPOINT    -9 /* Commit to restoring after completion of current iteration. */
 #define XC_SAVE_ID_HVM_ACPI_IOPORTS_LOCATION -10
+#define XC_SAVE_ID_HVM_VIRIDIAN       -11
 
 /*
 ** We process save/restore/migrate in batches of pages; the below
diff -r 67f70841e058 -r 373bd877cac3 xen/arch/x86/hvm/viridian.c
--- a/xen/arch/x86/hvm/viridian.c	Fri Nov 25 13:31:58 2011 +0000
+++ b/xen/arch/x86/hvm/viridian.c	Fri Nov 25 15:30:41 2011 +0000
@@ -206,8 +206,11 @@
     struct vcpu *v = current;
     struct domain *d = v->domain;
 
-    if ( !is_viridian_domain(d) )
+    if ( !is_viridian_domain(d) ) {
+        gdprintk(XENLOG_WARNING, "%s: %d not a viridian domain\n", __func__,
+                 d->domain_id);
         return 0;
+    }
 
     switch ( idx )
     {
@@ -271,8 +274,11 @@
     struct vcpu *v = current;
     struct domain *d = v->domain;
     
-    if ( !is_viridian_domain(d) )
+    if ( !is_viridian_domain(d) ) {
+        gdprintk(XENLOG_WARNING, "%s: %d not a viridian domain\n", __func__,
+                 d->domain_id);
         return 0;
+    }
 
     switch ( idx )
     {
@@ -411,6 +417,8 @@
     if ( hvm_load_entry(VIRIDIAN_DOMAIN, h, &ctxt) != 0 )
         return -EINVAL;
 
+    ASSERT(is_viridian_domain(d));
+
     d->arch.hvm_domain.viridian.hypercall_gpa.raw = ctxt.hypercall_gpa;
     d->arch.hvm_domain.viridian.guest_os_id.raw   = ctxt.guest_os_id;
 
@@ -455,6 +463,8 @@
     if ( hvm_load_entry(VIRIDIAN_VCPU, h, &ctxt) != 0 )
         return -EINVAL;
 
+    ASSERT(is_viridian_domain(d));
+
     v->arch.hvm_vcpu.viridian.apic_assist.raw = ctxt.apic_assist;
 
     return 0;

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:50 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhq-0000mP-5W; Mon, 28 Nov 2011 23:33:50 +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 1RVAhk-0000Z0-Ax
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:44 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1322523165!42773191!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17381 invoked from network); 28 Nov 2011 23:32:46 -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;
	28 Nov 2011 23:32:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAnd-0001mR-T9
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhc-0000yP-Sa
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:36 +0000
Message-Id: <E1RVAhc-0000yP-Sa@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:36 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Fix save/restore for HVM domains
	with viridian=1
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Paul Durrant <paul.durrant@citrix.com>
# Date 1322235041 0
# Node ID 373bd877cac3a42482074a2d3393d0c78bef7e59
# Parent  67f70841e05853aba35bd97792f34a0569020639
Fix save/restore for HVM domains with viridian=1

xc_domain_save/restore currently pay no attention to
HVM_PARAM_VIRIDIAN which results in an HVM domain running a recent
version on Windows (post-Vista) locking up on a domain restore due to
EOIs (done via a viridian MSR write) being silently dropped.  This
patch adds an extra save entry for the viridian parameter and also
adds code in the viridian kernel module to catch attempted use of
viridian functionality when the HVM parameter has not been set.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 67f70841e058 -r 373bd877cac3 tools/libxc/xc_domain_restore.c
--- a/tools/libxc/xc_domain_restore.c	Fri Nov 25 13:31:58 2011 +0000
+++ b/tools/libxc/xc_domain_restore.c	Fri Nov 25 15:30:41 2011 +0000
@@ -675,6 +675,7 @@
     uint64_t vm86_tss;
     uint64_t console_pfn;
     uint64_t acpi_ioport_location;
+    uint64_t viridian;
 } pagebuf_t;
 
 static int pagebuf_init(pagebuf_t* buf)
@@ -809,6 +810,16 @@
         }
         return pagebuf_get_one(xch, ctx, buf, fd, dom);
 
+    case XC_SAVE_ID_HVM_VIRIDIAN:
+        /* Skip padding 4 bytes then read the acpi ioport location. */
+        if ( RDEXACT(fd, &buf->viridian, sizeof(uint32_t)) ||
+             RDEXACT(fd, &buf->viridian, sizeof(uint64_t)) )
+        {
+            PERROR("error read the viridian flag");
+            return -1;
+        }
+        return pagebuf_get_one(xch, ctx, buf, fd, dom);
+
     default:
         if ( (count > MAX_BATCH_SIZE) || (count < 0) ) {
             ERROR("Max batch size exceeded (%d). Giving up.", count);
@@ -1440,6 +1451,9 @@
             fcntl(io_fd, F_SETFL, orig_io_fd_flags | O_NONBLOCK);
     }
 
+    if (pagebuf.viridian != 0)
+        xc_set_hvm_param(xch, dom, HVM_PARAM_VIRIDIAN, 1);
+
     if (pagebuf.acpi_ioport_location == 1) {
         DBGPRINTF("Use new firmware ioport from the checkpoint\n");
         xc_set_hvm_param(xch, dom, HVM_PARAM_ACPI_IOPORTS_LOCATION, 1);
diff -r 67f70841e058 -r 373bd877cac3 tools/libxc/xc_domain_save.c
--- a/tools/libxc/xc_domain_save.c	Fri Nov 25 13:31:58 2011 +0000
+++ b/tools/libxc/xc_domain_save.c	Fri Nov 25 15:30:41 2011 +0000
@@ -1506,6 +1506,18 @@
             PERROR("Error when writing the firmware ioport version");
             goto out;
         }
+
+        chunk.id = XC_SAVE_ID_HVM_VIRIDIAN;
+        chunk.data = 0;
+        xc_get_hvm_param(xch, dom, HVM_PARAM_VIRIDIAN,
+                         (unsigned long *)&chunk.data);
+
+        if ( (chunk.data != 0) &&
+             wrexact(io_fd, &chunk, sizeof(chunk)) )
+        {
+            PERROR("Error when writing the viridian flag");
+            goto out;
+        }
     }
 
     if ( !callbacks->checkpoint )
diff -r 67f70841e058 -r 373bd877cac3 tools/libxc/xg_save_restore.h
--- a/tools/libxc/xg_save_restore.h	Fri Nov 25 13:31:58 2011 +0000
+++ b/tools/libxc/xg_save_restore.h	Fri Nov 25 15:30:41 2011 +0000
@@ -134,6 +134,7 @@
 #define XC_SAVE_ID_HVM_CONSOLE_PFN    -8 /* (HVM-only) */
 #define XC_SAVE_ID_LAST_CHECKPOINT    -9 /* Commit to restoring after completion of current iteration. */
 #define XC_SAVE_ID_HVM_ACPI_IOPORTS_LOCATION -10
+#define XC_SAVE_ID_HVM_VIRIDIAN       -11
 
 /*
 ** We process save/restore/migrate in batches of pages; the below
diff -r 67f70841e058 -r 373bd877cac3 xen/arch/x86/hvm/viridian.c
--- a/xen/arch/x86/hvm/viridian.c	Fri Nov 25 13:31:58 2011 +0000
+++ b/xen/arch/x86/hvm/viridian.c	Fri Nov 25 15:30:41 2011 +0000
@@ -206,8 +206,11 @@
     struct vcpu *v = current;
     struct domain *d = v->domain;
 
-    if ( !is_viridian_domain(d) )
+    if ( !is_viridian_domain(d) ) {
+        gdprintk(XENLOG_WARNING, "%s: %d not a viridian domain\n", __func__,
+                 d->domain_id);
         return 0;
+    }
 
     switch ( idx )
     {
@@ -271,8 +274,11 @@
     struct vcpu *v = current;
     struct domain *d = v->domain;
     
-    if ( !is_viridian_domain(d) )
+    if ( !is_viridian_domain(d) ) {
+        gdprintk(XENLOG_WARNING, "%s: %d not a viridian domain\n", __func__,
+                 d->domain_id);
         return 0;
+    }
 
     switch ( idx )
     {
@@ -411,6 +417,8 @@
     if ( hvm_load_entry(VIRIDIAN_DOMAIN, h, &ctxt) != 0 )
         return -EINVAL;
 
+    ASSERT(is_viridian_domain(d));
+
     d->arch.hvm_domain.viridian.hypercall_gpa.raw = ctxt.hypercall_gpa;
     d->arch.hvm_domain.viridian.guest_os_id.raw   = ctxt.guest_os_id;
 
@@ -455,6 +463,8 @@
     if ( hvm_load_entry(VIRIDIAN_VCPU, h, &ctxt) != 0 )
         return -EINVAL;
 
+    ASSERT(is_viridian_domain(d));
+
     v->arch.hvm_vcpu.viridian.apic_assist.raw = ctxt.apic_assist;
 
     return 0;

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:51 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33: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.xensource.com>)
	id 1RVAhq-0000nF-NR; Mon, 28 Nov 2011 23:33:50 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhk-0000OC-Sp
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:45 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1322523186!5048364!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24691 invoked from network); 28 Nov 2011 23:33:07 -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;
	28 Nov 2011 23:33: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 1RVAnY-0001lV-T8
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhX-0000vz-Sb
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:31 +0000
Message-Id: <E1RVAhX-0000vz-Sb@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:31 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: retry unpageable gfns
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1321804961 -3600
# Node ID 8eba32b9598cdc60bdc4b446cbc8446078e37c04
# Parent  a2b4ae2becdf71c8d75cc34fcd56558632f757b4
xenpaging: retry unpageable gfns

Nomination of gfns can fail, but may succeed later.
Thats the case for a guest that starts ballooned.

v2:
 - print debug when clearing uncosumed happens

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r a2b4ae2becdf -r 8eba32b9598c tools/xenpaging/policy_default.c
--- a/tools/xenpaging/policy_default.c	Sun Nov 20 17:02:40 2011 +0100
+++ b/tools/xenpaging/policy_default.c	Sun Nov 20 17:02:41 2011 +0100
@@ -32,6 +32,7 @@
 static unsigned int mru_size;
 static unsigned long *bitmap;
 static unsigned long *unconsumed;
+static unsigned int unconsumed_cleared;
 static unsigned long current_gfn;
 static unsigned long max_pages;
 
@@ -87,8 +88,21 @@
         current_gfn++;
         if ( current_gfn >= max_pages )
             current_gfn = 0;
+        /* Could not nominate any gfn */
         if ( wrap == current_gfn )
         {
+            /* Count wrap arounds */
+            unconsumed_cleared++;
+            /* Force retry every few seconds (depends on poll() timeout) */
+            if ( unconsumed_cleared > 123)
+            {
+                /* Force retry of unconsumed gfns */
+                bitmap_clear(unconsumed, max_pages);
+                unconsumed_cleared = 0;
+                DPRINTF("clearing unconsumed, wrap %lx", wrap);
+                /* One more round before returning ENOSPC */
+                continue;
+            }
             victim->gfn = INVALID_MFN;
             return -ENOSPC;
         }

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:51 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33: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.xensource.com>)
	id 1RVAhq-0000nF-NR; Mon, 28 Nov 2011 23:33:50 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhk-0000OC-Sp
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:45 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1322523186!5048364!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24691 invoked from network); 28 Nov 2011 23:33:07 -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;
	28 Nov 2011 23:33: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 1RVAnY-0001lV-T8
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhX-0000vz-Sb
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:31 +0000
Message-Id: <E1RVAhX-0000vz-Sb@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:31 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: retry unpageable gfns
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1321804961 -3600
# Node ID 8eba32b9598cdc60bdc4b446cbc8446078e37c04
# Parent  a2b4ae2becdf71c8d75cc34fcd56558632f757b4
xenpaging: retry unpageable gfns

Nomination of gfns can fail, but may succeed later.
Thats the case for a guest that starts ballooned.

v2:
 - print debug when clearing uncosumed happens

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r a2b4ae2becdf -r 8eba32b9598c tools/xenpaging/policy_default.c
--- a/tools/xenpaging/policy_default.c	Sun Nov 20 17:02:40 2011 +0100
+++ b/tools/xenpaging/policy_default.c	Sun Nov 20 17:02:41 2011 +0100
@@ -32,6 +32,7 @@
 static unsigned int mru_size;
 static unsigned long *bitmap;
 static unsigned long *unconsumed;
+static unsigned int unconsumed_cleared;
 static unsigned long current_gfn;
 static unsigned long max_pages;
 
@@ -87,8 +88,21 @@
         current_gfn++;
         if ( current_gfn >= max_pages )
             current_gfn = 0;
+        /* Could not nominate any gfn */
         if ( wrap == current_gfn )
         {
+            /* Count wrap arounds */
+            unconsumed_cleared++;
+            /* Force retry every few seconds (depends on poll() timeout) */
+            if ( unconsumed_cleared > 123)
+            {
+                /* Force retry of unconsumed gfns */
+                bitmap_clear(unconsumed, max_pages);
+                unconsumed_cleared = 0;
+                DPRINTF("clearing unconsumed, wrap %lx", wrap);
+                /* One more round before returning ENOSPC */
+                continue;
+            }
             victim->gfn = INVALID_MFN;
             return -ENOSPC;
         }

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:52 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhr-0000oX-NM; Mon, 28 Nov 2011 23:33:51 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhl-0000Qg-Vf
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:46 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1322523188!5291115!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15560 invoked from network); 28 Nov 2011 23:33:08 -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;
	28 Nov 2011 23:33:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAna-0001lm-CO
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhZ-0000wi-Bo
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:33 +0000
Message-Id: <E1RVAhZ-0000wi-Bo@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:32 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: use guests tot_pages as
	working target
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1321804965 -3600
# Node ID 286a741b4d86f85013f956f944e22f208e400904
# Parent  cd5948592b107c068c6d7bae2cbe6a5765431a94
xenpaging: use guests tot_pages as working target

This change reverses the task of xenpaging. Before this change a fixed number
of pages was paged out. With this change the guest will not have access to
more than the given number of pages at the same time.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r cd5948592b10 -r 286a741b4d86 tools/xenpaging/policy_default.c
--- a/tools/xenpaging/policy_default.c	Sun Nov 20 17:02:43 2011 +0100
+++ b/tools/xenpaging/policy_default.c	Sun Nov 20 17:02:45 2011 +0100
@@ -71,7 +71,6 @@
 
     /* Start in the middle to avoid paging during BIOS startup */
     current_gfn = max_pages / 2;
-    current_gfn -= paging->num_pages / 2;
 
     rc = 0;
  out:
diff -r cd5948592b10 -r 286a741b4d86 tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Sun Nov 20 17:02:43 2011 +0100
+++ b/tools/xenpaging/xenpaging.c	Sun Nov 20 17:02:45 2011 +0100
@@ -136,6 +136,21 @@
     return rc;
 }
 
+static int xenpaging_get_tot_pages(xenpaging_t *paging)
+{
+    xc_interface *xch = paging->xc_handle;
+    xc_domaininfo_t domain_info;
+    int rc;
+
+    rc = xc_domain_getinfolist(xch, paging->mem_event.domain_id, 1, &domain_info);
+    if ( rc != 1 )
+    {
+        PERROR("Error getting domain info");
+        return -1;
+    }
+    return domain_info.tot_pages;
+}
+
 static void *init_page(void)
 {
     void *buffer;
@@ -161,7 +176,7 @@
     return NULL;
 }
 
-static xenpaging_t *xenpaging_init(domid_t domain_id, int num_pages)
+static xenpaging_t *xenpaging_init(domid_t domain_id, int target_tot_pages)
 {
     xenpaging_t *paging;
     xc_domaininfo_t domain_info;
@@ -296,12 +311,7 @@
     }
     DPRINTF("max_pages = %d\n", paging->max_pages);
 
-    if ( num_pages < 0 || num_pages > paging->max_pages )
-    {
-        num_pages = paging->max_pages;
-        DPRINTF("setting num_pages to %d\n", num_pages);
-    }
-    paging->num_pages = num_pages;
+    paging->target_tot_pages = target_tot_pages;
 
     /* Initialise policy */
     rc = policy_init(paging);
@@ -648,7 +658,9 @@
     xenpaging_victim_t *victims;
     mem_event_request_t req;
     mem_event_response_t rsp;
+    int num, prev_num = 0;
     int i;
+    int tot_pages;
     int rc = -1;
     int rc1;
     xc_interface *xch;
@@ -659,7 +671,7 @@
 
     if ( argc != 3 )
     {
-        fprintf(stderr, "Usage: %s <domain_id> <num_pages>\n", argv[0]);
+        fprintf(stderr, "Usage: %s <domain_id> <tot_pages>\n", argv[0]);
         return -1;
     }
 
@@ -672,7 +684,7 @@
     }
     xch = paging->xc_handle;
 
-    DPRINTF("starting %s %u %d\n", argv[0], paging->mem_event.domain_id, paging->num_pages);
+    DPRINTF("starting %s %u %d\n", argv[0], paging->mem_event.domain_id, paging->target_tot_pages);
 
     /* Open file */
     sprintf(filename, "page_cache_%u", paging->mem_event.domain_id);
@@ -704,9 +716,6 @@
     /* listen for page-in events to stop pager */
     create_page_in_thread(paging);
 
-    i = evict_pages(paging, fd, victims, paging->num_pages);
-    DPRINTF("%d pages evicted. Done.\n", i);
-
     /* Swap pages in and out */
     while ( 1 )
     {
@@ -771,12 +780,8 @@
                     goto out;
                 }
 
-                /* Evict a new page to replace the one we just paged in,
-                 * or clear this pagefile slot on exit */
-                if ( interrupted )
-                    victims[i].gfn = INVALID_MFN;
-                else
-                    evict_victim(paging, &victims[i], fd, i);
+                /* Clear this pagefile slot */
+                victims[i].gfn = INVALID_MFN;
             }
             else
             {
@@ -823,6 +828,43 @@
         if ( interrupted )
             break;
 
+        /* Check if the target has been reached already */
+        tot_pages = xenpaging_get_tot_pages(paging);
+        if ( tot_pages < 0 )
+            goto out;
+
+        /* Resume all pages if paging is disabled or no target was set */
+        if ( paging->target_tot_pages == 0 )
+        {
+            if ( paging->num_paged_out )
+                resume_pages(paging, paging->num_paged_out);
+        }
+        /* Evict more pages if target not reached */
+        else if ( tot_pages > paging->target_tot_pages )
+        {
+            num = tot_pages - paging->target_tot_pages;
+            if ( num != prev_num )
+            {
+                DPRINTF("Need to evict %d pages to reach %d target_tot_pages\n", num, paging->target_tot_pages);
+                prev_num = num;
+            }
+            /* Limit the number of evicts to be able to process page-in requests */
+            if ( num > 42 )
+                num = 42;
+            evict_pages(paging, fd, victims, num);
+        }
+        /* Resume some pages if target not reached */
+        else if ( tot_pages < paging->target_tot_pages && paging->num_paged_out )
+        {
+            num = paging->target_tot_pages - tot_pages;
+            if ( num != prev_num )
+            {
+                DPRINTF("Need to resume %d pages to reach %d target_tot_pages\n", num, paging->target_tot_pages);
+                prev_num = num;
+            }
+            resume_pages(paging, num);
+        }
+
     }
     DPRINTF("xenpaging got signal %d\n", interrupted);
 
diff -r cd5948592b10 -r 286a741b4d86 tools/xenpaging/xenpaging.h
--- a/tools/xenpaging/xenpaging.h	Sun Nov 20 17:02:43 2011 +0100
+++ b/tools/xenpaging/xenpaging.h	Sun Nov 20 17:02:45 2011 +0100
@@ -50,7 +50,7 @@
     /* number of pages for which data structures were allocated */
     int max_pages;
     int num_paged_out;
-    int num_pages;
+    int target_tot_pages;
     int policy_mru_size;
     unsigned long pagein_queue[XENPAGING_PAGEIN_QUEUE_SIZE];
 } xenpaging_t;

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:52 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhr-0000oX-NM; Mon, 28 Nov 2011 23:33:51 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhl-0000Qg-Vf
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:46 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1322523188!5291115!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15560 invoked from network); 28 Nov 2011 23:33:08 -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;
	28 Nov 2011 23:33:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAna-0001lm-CO
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhZ-0000wi-Bo
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:33 +0000
Message-Id: <E1RVAhZ-0000wi-Bo@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:32 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: use guests tot_pages as
	working target
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1321804965 -3600
# Node ID 286a741b4d86f85013f956f944e22f208e400904
# Parent  cd5948592b107c068c6d7bae2cbe6a5765431a94
xenpaging: use guests tot_pages as working target

This change reverses the task of xenpaging. Before this change a fixed number
of pages was paged out. With this change the guest will not have access to
more than the given number of pages at the same time.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r cd5948592b10 -r 286a741b4d86 tools/xenpaging/policy_default.c
--- a/tools/xenpaging/policy_default.c	Sun Nov 20 17:02:43 2011 +0100
+++ b/tools/xenpaging/policy_default.c	Sun Nov 20 17:02:45 2011 +0100
@@ -71,7 +71,6 @@
 
     /* Start in the middle to avoid paging during BIOS startup */
     current_gfn = max_pages / 2;
-    current_gfn -= paging->num_pages / 2;
 
     rc = 0;
  out:
diff -r cd5948592b10 -r 286a741b4d86 tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Sun Nov 20 17:02:43 2011 +0100
+++ b/tools/xenpaging/xenpaging.c	Sun Nov 20 17:02:45 2011 +0100
@@ -136,6 +136,21 @@
     return rc;
 }
 
+static int xenpaging_get_tot_pages(xenpaging_t *paging)
+{
+    xc_interface *xch = paging->xc_handle;
+    xc_domaininfo_t domain_info;
+    int rc;
+
+    rc = xc_domain_getinfolist(xch, paging->mem_event.domain_id, 1, &domain_info);
+    if ( rc != 1 )
+    {
+        PERROR("Error getting domain info");
+        return -1;
+    }
+    return domain_info.tot_pages;
+}
+
 static void *init_page(void)
 {
     void *buffer;
@@ -161,7 +176,7 @@
     return NULL;
 }
 
-static xenpaging_t *xenpaging_init(domid_t domain_id, int num_pages)
+static xenpaging_t *xenpaging_init(domid_t domain_id, int target_tot_pages)
 {
     xenpaging_t *paging;
     xc_domaininfo_t domain_info;
@@ -296,12 +311,7 @@
     }
     DPRINTF("max_pages = %d\n", paging->max_pages);
 
-    if ( num_pages < 0 || num_pages > paging->max_pages )
-    {
-        num_pages = paging->max_pages;
-        DPRINTF("setting num_pages to %d\n", num_pages);
-    }
-    paging->num_pages = num_pages;
+    paging->target_tot_pages = target_tot_pages;
 
     /* Initialise policy */
     rc = policy_init(paging);
@@ -648,7 +658,9 @@
     xenpaging_victim_t *victims;
     mem_event_request_t req;
     mem_event_response_t rsp;
+    int num, prev_num = 0;
     int i;
+    int tot_pages;
     int rc = -1;
     int rc1;
     xc_interface *xch;
@@ -659,7 +671,7 @@
 
     if ( argc != 3 )
     {
-        fprintf(stderr, "Usage: %s <domain_id> <num_pages>\n", argv[0]);
+        fprintf(stderr, "Usage: %s <domain_id> <tot_pages>\n", argv[0]);
         return -1;
     }
 
@@ -672,7 +684,7 @@
     }
     xch = paging->xc_handle;
 
-    DPRINTF("starting %s %u %d\n", argv[0], paging->mem_event.domain_id, paging->num_pages);
+    DPRINTF("starting %s %u %d\n", argv[0], paging->mem_event.domain_id, paging->target_tot_pages);
 
     /* Open file */
     sprintf(filename, "page_cache_%u", paging->mem_event.domain_id);
@@ -704,9 +716,6 @@
     /* listen for page-in events to stop pager */
     create_page_in_thread(paging);
 
-    i = evict_pages(paging, fd, victims, paging->num_pages);
-    DPRINTF("%d pages evicted. Done.\n", i);
-
     /* Swap pages in and out */
     while ( 1 )
     {
@@ -771,12 +780,8 @@
                     goto out;
                 }
 
-                /* Evict a new page to replace the one we just paged in,
-                 * or clear this pagefile slot on exit */
-                if ( interrupted )
-                    victims[i].gfn = INVALID_MFN;
-                else
-                    evict_victim(paging, &victims[i], fd, i);
+                /* Clear this pagefile slot */
+                victims[i].gfn = INVALID_MFN;
             }
             else
             {
@@ -823,6 +828,43 @@
         if ( interrupted )
             break;
 
+        /* Check if the target has been reached already */
+        tot_pages = xenpaging_get_tot_pages(paging);
+        if ( tot_pages < 0 )
+            goto out;
+
+        /* Resume all pages if paging is disabled or no target was set */
+        if ( paging->target_tot_pages == 0 )
+        {
+            if ( paging->num_paged_out )
+                resume_pages(paging, paging->num_paged_out);
+        }
+        /* Evict more pages if target not reached */
+        else if ( tot_pages > paging->target_tot_pages )
+        {
+            num = tot_pages - paging->target_tot_pages;
+            if ( num != prev_num )
+            {
+                DPRINTF("Need to evict %d pages to reach %d target_tot_pages\n", num, paging->target_tot_pages);
+                prev_num = num;
+            }
+            /* Limit the number of evicts to be able to process page-in requests */
+            if ( num > 42 )
+                num = 42;
+            evict_pages(paging, fd, victims, num);
+        }
+        /* Resume some pages if target not reached */
+        else if ( tot_pages < paging->target_tot_pages && paging->num_paged_out )
+        {
+            num = paging->target_tot_pages - tot_pages;
+            if ( num != prev_num )
+            {
+                DPRINTF("Need to resume %d pages to reach %d target_tot_pages\n", num, paging->target_tot_pages);
+                prev_num = num;
+            }
+            resume_pages(paging, num);
+        }
+
     }
     DPRINTF("xenpaging got signal %d\n", interrupted);
 
diff -r cd5948592b10 -r 286a741b4d86 tools/xenpaging/xenpaging.h
--- a/tools/xenpaging/xenpaging.h	Sun Nov 20 17:02:43 2011 +0100
+++ b/tools/xenpaging/xenpaging.h	Sun Nov 20 17:02:45 2011 +0100
@@ -50,7 +50,7 @@
     /* number of pages for which data structures were allocated */
     int max_pages;
     int num_paged_out;
-    int num_pages;
+    int target_tot_pages;
     int policy_mru_size;
     unsigned long pagein_queue[XENPAGING_PAGEIN_QUEUE_SIZE];
 } xenpaging_t;

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:52 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhs-0000pi-Cg; Mon, 28 Nov 2011 23:33: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 1RVAhl-0000VN-UO
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:46 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-27.messagelabs.com!1322523147!55221093!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32432 invoked from network); 28 Nov 2011 23:32:28 -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;
	28 Nov 2011 23:32: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 1RVAnc-0001m6-C8
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhb-0000xg-Bb
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:35 +0000
Message-Id: <E1RVAhb-0000xg-Bb@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:34 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: add debug to show
	received watch event.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1321809975 -3600
# Node ID c9b75ccd3ebfb3b78f0e2064373802a5d4b24da9
# Parent  d47d1ad5636631cd955594da70f54e5b0550276e
xenpaging: add debug to show received watch event.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r d47d1ad56366 -r c9b75ccd3ebf tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Sun Nov 20 17:02:50 2011 +0100
+++ b/tools/xenpaging/xenpaging.c	Sun Nov 20 18:26:15 2011 +0100
@@ -108,6 +108,7 @@
         vec = xs_read_watch(paging->xs_handle, &num);
         if ( vec )
         {
+            DPRINTF("path '%s' token '%s'\n", vec[XS_WATCH_PATH], vec[XS_WATCH_TOKEN]);
             if ( strcmp(vec[XS_WATCH_TOKEN], watch_token) == 0 )
             {
                 /* If our guest disappeared, set interrupt flag and fall through */

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:52 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhs-0000pi-Cg; Mon, 28 Nov 2011 23:33: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 1RVAhl-0000VN-UO
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:46 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-27.messagelabs.com!1322523147!55221093!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32432 invoked from network); 28 Nov 2011 23:32:28 -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;
	28 Nov 2011 23:32: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 1RVAnc-0001m6-C8
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhb-0000xg-Bb
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:35 +0000
Message-Id: <E1RVAhb-0000xg-Bb@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:34 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: add debug to show
	received watch event.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1321809975 -3600
# Node ID c9b75ccd3ebfb3b78f0e2064373802a5d4b24da9
# Parent  d47d1ad5636631cd955594da70f54e5b0550276e
xenpaging: add debug to show received watch event.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r d47d1ad56366 -r c9b75ccd3ebf tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Sun Nov 20 17:02:50 2011 +0100
+++ b/tools/xenpaging/xenpaging.c	Sun Nov 20 18:26:15 2011 +0100
@@ -108,6 +108,7 @@
         vec = xs_read_watch(paging->xs_handle, &num);
         if ( vec )
         {
+            DPRINTF("path '%s' token '%s'\n", vec[XS_WATCH_PATH], vec[XS_WATCH_TOKEN]);
             if ( strcmp(vec[XS_WATCH_TOKEN], watch_token) == 0 )
             {
                 /* If our guest disappeared, set interrupt flag and fall through */

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:53 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAht-0000rm-AG; Mon, 28 Nov 2011 23:33:53 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhn-0000V8-OP
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:48 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-182.messagelabs.com!1322523189!4503506!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18794 invoked from network); 28 Nov 2011 23:33:10 -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;
	28 Nov 2011 23: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 1RVAnb-0001m0-F2
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAha-0000xC-BM
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:34 +0000
Message-Id: <E1RVAha-0000xC-BM@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:33 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: add cmdline interface for
	pager
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1321804968 -3600
# Node ID 7243fd87410e32502ec407a0abca89fa293a03bc
# Parent  9e3c2ef70c8a6b9c259231581105a4587a73a83a
xenpaging: add cmdline interface for pager

Introduce a cmdline handling for the pager. This simplifies libxl support,
debug and mru_size are not passed via the environment anymore.
The new interface looks like this:

xenpaging [options] -f <pagefile> -d <domain_id>
options:
 -d <domid>     --domain=<domid>         numerical domain_id of guest. This option is required.
 -f <file>      --pagefile=<file>        pagefile to use. This option is required.
 -m <max_memkb> --max_memkb=<max_memkb>  maximum amount of memory to handle.
 -r <num>       --mru_size=<num>         number of paged-in pages to keep in memory.
 -d             --debug                  enable debug output.
 -h             --help                   this output.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 9e3c2ef70c8a -r 7243fd87410e tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Sun Nov 20 17:02:47 2011 +0100
+++ b/tools/xenpaging/xenpaging.c	Sun Nov 20 17:02:48 2011 +0100
@@ -31,6 +31,7 @@
 #include <poll.h>
 #include <xc_private.h>
 #include <xs.h>
+#include <getopt.h>
 
 #include "xc_bitops.h"
 #include "file_ops.h"
@@ -42,12 +43,12 @@
 static char *watch_target_tot_pages;
 static char *dom_path;
 static char watch_token[16];
-static char filename[80];
+static char *filename;
 static int interrupted;
 
 static void unlink_pagefile(void)
 {
-    if ( filename[0] )
+    if ( filename && filename[0] )
     {
         unlink(filename);
         filename[0] = '\0';
@@ -201,11 +202,85 @@
     return NULL;
 }
 
-static xenpaging_t *xenpaging_init(domid_t domain_id, int target_tot_pages)
+static void usage(void)
+{
+    printf("usage:\n\n");
+
+    printf("  xenpaging [options] -f <pagefile> -d <domain_id>\n\n");
+
+    printf("options:\n");
+    printf(" -d <domid>     --domain=<domid>         numerical domain_id of guest. This option is required.\n");
+    printf(" -f <file>      --pagefile=<file>        pagefile to use. This option is required.\n");
+    printf(" -m <max_memkb> --max_memkb=<max_memkb>  maximum amount of memory to handle.\n");
+    printf(" -r <num>       --mru_size=<num>         number of paged-in pages to keep in memory.\n");
+    printf(" -v             --verbose                enable debug output.\n");
+    printf(" -h             --help                   this output.\n");
+}
+
+static int xenpaging_getopts(xenpaging_t *paging, int argc, char *argv[])
+{
+    int ch;
+    static const char sopts[] = "hvd:f:m:r:";
+    static const struct option lopts[] = {
+        {"help", 0, NULL, 'h'},
+        {"verbose", 0, NULL, 'v'},
+        {"domain", 1, NULL, 'd'},
+        {"pagefile", 1, NULL, 'f'},
+        {"mru_size", 1, NULL, 'm'},
+        { }
+    };
+
+    while ((ch = getopt_long(argc, argv, sopts, lopts, NULL)) != -1)
+    {
+        switch(ch) {
+        case 'd':
+            paging->mem_event.domain_id = atoi(optarg);
+            break;
+        case 'f':
+            filename = strdup(optarg);
+            break;
+        case 'm':
+            /* KiB to pages */
+            paging->max_pages = atoi(optarg) >> 2;
+            break;
+        case 'r':
+            paging->policy_mru_size = atoi(optarg);
+            break;
+        case 'v':
+            paging->debug = 1;
+            break;
+        case 'h':
+        case '?':
+            usage();
+            return 1;
+        }
+    }
+
+    argv += optind; argc -= optind;
+    
+    /* Path to pagefile is required */
+    if ( !filename )
+    {
+        printf("Filename for pagefile missing!\n");
+        usage();
+        return 1;
+    }
+
+    /* Set domain id */
+    if ( !paging->mem_event.domain_id )
+    {
+        printf("Numerical <domain_id> missing!\n");
+        return 1;
+    }
+
+    return 0;
+}
+
+static xenpaging_t *xenpaging_init(int argc, char *argv[])
 {
     xenpaging_t *paging;
     xc_domaininfo_t domain_info;
-    xc_interface *xch;
+    xc_interface *xch = NULL;
     xentoollog_logger *dbg = NULL;
     char *p;
     int rc;
@@ -215,7 +290,12 @@
     if ( !paging )
         goto err;
 
-    if ( getenv("XENPAGING_DEBUG") )
+    /* Get cmdline options and domain_id */
+    if ( xenpaging_getopts(paging, argc, argv) )
+        goto err;
+
+    /* Enable debug output */
+    if ( paging->debug )
         dbg = (xentoollog_logger *)xtl_createlogger_stdiostream(stderr, XTL_DEBUG, 0);
 
     /* Open connection to xen */
@@ -234,7 +314,7 @@
     }
 
     /* write domain ID to watch so we can ignore other domain shutdowns */
-    snprintf(watch_token, sizeof(watch_token), "%u", domain_id);
+    snprintf(watch_token, sizeof(watch_token), "%u", paging->mem_event.domain_id);
     if ( xs_watch(paging->xs_handle, "@releaseDomain", watch_token) == false )
     {
         PERROR("Could not bind to shutdown watch\n");
@@ -242,7 +322,7 @@
     }
 
     /* Watch xenpagings working target */
-    dom_path = xs_get_domain_path(paging->xs_handle, domain_id);
+    dom_path = xs_get_domain_path(paging->xs_handle, paging->mem_event.domain_id);
     if ( !dom_path )
     {
         PERROR("Could not find domain path\n");
@@ -260,16 +340,6 @@
         goto err;
     }
 
-    p = getenv("XENPAGING_POLICY_MRU_SIZE");
-    if ( p && *p )
-    {
-         paging->policy_mru_size = atoi(p);
-         DPRINTF("Setting policy mru_size to %d\n", paging->policy_mru_size);
-    }
-
-    /* Set domain id */
-    paging->mem_event.domain_id = domain_id;
-
     /* Initialise shared page */
     paging->mem_event.shared_page = init_page();
     if ( paging->mem_event.shared_page == NULL )
@@ -335,17 +405,21 @@
 
     paging->mem_event.port = rc;
 
-    rc = xc_domain_getinfolist(xch, paging->mem_event.domain_id, 1,
-                               &domain_info);
-    if ( rc != 1 )
+    /* Get max_pages from guest if not provided via cmdline */
+    if ( !paging->max_pages )
     {
-        PERROR("Error getting domain info");
-        goto err;
+        rc = xc_domain_getinfolist(xch, paging->mem_event.domain_id, 1,
+                                   &domain_info);
+        if ( rc != 1 )
+        {
+            PERROR("Error getting domain info");
+            goto err;
+        }
+
+        /* Record number of max_pages */
+        paging->max_pages = domain_info.max_pages;
     }
 
-    /* Record number of max_pages */
-    paging->max_pages = domain_info.max_pages;
-
     /* Allocate bitmap for tracking pages that have been paged out */
     paging->bitmap = bitmap_alloc(paging->max_pages);
     if ( !paging->bitmap )
@@ -355,8 +429,6 @@
     }
     DPRINTF("max_pages = %d\n", paging->max_pages);
 
-    paging->target_tot_pages = target_tot_pages;
-
     /* Initialise policy */
     rc = policy_init(paging);
     if ( rc != 0 )
@@ -718,25 +790,18 @@
     mode_t open_mode = S_IRUSR | S_IRGRP | S_IROTH | S_IWUSR | S_IWGRP | S_IWOTH;
     int fd;
 
-    if ( argc != 3 )
-    {
-        fprintf(stderr, "Usage: %s <domain_id> <tot_pages>\n", argv[0]);
-        return -1;
-    }
-
     /* Initialise domain paging */
-    paging = xenpaging_init(atoi(argv[1]), atoi(argv[2]));
+    paging = xenpaging_init(argc, argv);
     if ( paging == NULL )
     {
-        fprintf(stderr, "Error initialising paging");
+        fprintf(stderr, "Error initialising paging\n");
         return 1;
     }
     xch = paging->xc_handle;
 
-    DPRINTF("starting %s %u %d\n", argv[0], paging->mem_event.domain_id, paging->target_tot_pages);
+    DPRINTF("starting %s for domain_id %u with pagefile %s\n", argv[0], paging->mem_event.domain_id, filename);
 
     /* Open file */
-    sprintf(filename, "page_cache_%u", paging->mem_event.domain_id);
     fd = open(filename, open_flags, open_mode);
     if ( fd < 0 )
     {
diff -r 9e3c2ef70c8a -r 7243fd87410e tools/xenpaging/xenpaging.h
--- a/tools/xenpaging/xenpaging.h	Sun Nov 20 17:02:47 2011 +0100
+++ b/tools/xenpaging/xenpaging.h	Sun Nov 20 17:02:48 2011 +0100
@@ -52,6 +52,7 @@
     int num_paged_out;
     int target_tot_pages;
     int policy_mru_size;
+    int debug;
     unsigned long pagein_queue[XENPAGING_PAGEIN_QUEUE_SIZE];
 } xenpaging_t;
 

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:53 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAht-0000rm-AG; Mon, 28 Nov 2011 23:33:53 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhn-0000V8-OP
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:48 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-182.messagelabs.com!1322523189!4503506!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18794 invoked from network); 28 Nov 2011 23:33:10 -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;
	28 Nov 2011 23: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 1RVAnb-0001m0-F2
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAha-0000xC-BM
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:34 +0000
Message-Id: <E1RVAha-0000xC-BM@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:33 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: add cmdline interface for
	pager
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1321804968 -3600
# Node ID 7243fd87410e32502ec407a0abca89fa293a03bc
# Parent  9e3c2ef70c8a6b9c259231581105a4587a73a83a
xenpaging: add cmdline interface for pager

Introduce a cmdline handling for the pager. This simplifies libxl support,
debug and mru_size are not passed via the environment anymore.
The new interface looks like this:

xenpaging [options] -f <pagefile> -d <domain_id>
options:
 -d <domid>     --domain=<domid>         numerical domain_id of guest. This option is required.
 -f <file>      --pagefile=<file>        pagefile to use. This option is required.
 -m <max_memkb> --max_memkb=<max_memkb>  maximum amount of memory to handle.
 -r <num>       --mru_size=<num>         number of paged-in pages to keep in memory.
 -d             --debug                  enable debug output.
 -h             --help                   this output.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 9e3c2ef70c8a -r 7243fd87410e tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Sun Nov 20 17:02:47 2011 +0100
+++ b/tools/xenpaging/xenpaging.c	Sun Nov 20 17:02:48 2011 +0100
@@ -31,6 +31,7 @@
 #include <poll.h>
 #include <xc_private.h>
 #include <xs.h>
+#include <getopt.h>
 
 #include "xc_bitops.h"
 #include "file_ops.h"
@@ -42,12 +43,12 @@
 static char *watch_target_tot_pages;
 static char *dom_path;
 static char watch_token[16];
-static char filename[80];
+static char *filename;
 static int interrupted;
 
 static void unlink_pagefile(void)
 {
-    if ( filename[0] )
+    if ( filename && filename[0] )
     {
         unlink(filename);
         filename[0] = '\0';
@@ -201,11 +202,85 @@
     return NULL;
 }
 
-static xenpaging_t *xenpaging_init(domid_t domain_id, int target_tot_pages)
+static void usage(void)
+{
+    printf("usage:\n\n");
+
+    printf("  xenpaging [options] -f <pagefile> -d <domain_id>\n\n");
+
+    printf("options:\n");
+    printf(" -d <domid>     --domain=<domid>         numerical domain_id of guest. This option is required.\n");
+    printf(" -f <file>      --pagefile=<file>        pagefile to use. This option is required.\n");
+    printf(" -m <max_memkb> --max_memkb=<max_memkb>  maximum amount of memory to handle.\n");
+    printf(" -r <num>       --mru_size=<num>         number of paged-in pages to keep in memory.\n");
+    printf(" -v             --verbose                enable debug output.\n");
+    printf(" -h             --help                   this output.\n");
+}
+
+static int xenpaging_getopts(xenpaging_t *paging, int argc, char *argv[])
+{
+    int ch;
+    static const char sopts[] = "hvd:f:m:r:";
+    static const struct option lopts[] = {
+        {"help", 0, NULL, 'h'},
+        {"verbose", 0, NULL, 'v'},
+        {"domain", 1, NULL, 'd'},
+        {"pagefile", 1, NULL, 'f'},
+        {"mru_size", 1, NULL, 'm'},
+        { }
+    };
+
+    while ((ch = getopt_long(argc, argv, sopts, lopts, NULL)) != -1)
+    {
+        switch(ch) {
+        case 'd':
+            paging->mem_event.domain_id = atoi(optarg);
+            break;
+        case 'f':
+            filename = strdup(optarg);
+            break;
+        case 'm':
+            /* KiB to pages */
+            paging->max_pages = atoi(optarg) >> 2;
+            break;
+        case 'r':
+            paging->policy_mru_size = atoi(optarg);
+            break;
+        case 'v':
+            paging->debug = 1;
+            break;
+        case 'h':
+        case '?':
+            usage();
+            return 1;
+        }
+    }
+
+    argv += optind; argc -= optind;
+    
+    /* Path to pagefile is required */
+    if ( !filename )
+    {
+        printf("Filename for pagefile missing!\n");
+        usage();
+        return 1;
+    }
+
+    /* Set domain id */
+    if ( !paging->mem_event.domain_id )
+    {
+        printf("Numerical <domain_id> missing!\n");
+        return 1;
+    }
+
+    return 0;
+}
+
+static xenpaging_t *xenpaging_init(int argc, char *argv[])
 {
     xenpaging_t *paging;
     xc_domaininfo_t domain_info;
-    xc_interface *xch;
+    xc_interface *xch = NULL;
     xentoollog_logger *dbg = NULL;
     char *p;
     int rc;
@@ -215,7 +290,12 @@
     if ( !paging )
         goto err;
 
-    if ( getenv("XENPAGING_DEBUG") )
+    /* Get cmdline options and domain_id */
+    if ( xenpaging_getopts(paging, argc, argv) )
+        goto err;
+
+    /* Enable debug output */
+    if ( paging->debug )
         dbg = (xentoollog_logger *)xtl_createlogger_stdiostream(stderr, XTL_DEBUG, 0);
 
     /* Open connection to xen */
@@ -234,7 +314,7 @@
     }
 
     /* write domain ID to watch so we can ignore other domain shutdowns */
-    snprintf(watch_token, sizeof(watch_token), "%u", domain_id);
+    snprintf(watch_token, sizeof(watch_token), "%u", paging->mem_event.domain_id);
     if ( xs_watch(paging->xs_handle, "@releaseDomain", watch_token) == false )
     {
         PERROR("Could not bind to shutdown watch\n");
@@ -242,7 +322,7 @@
     }
 
     /* Watch xenpagings working target */
-    dom_path = xs_get_domain_path(paging->xs_handle, domain_id);
+    dom_path = xs_get_domain_path(paging->xs_handle, paging->mem_event.domain_id);
     if ( !dom_path )
     {
         PERROR("Could not find domain path\n");
@@ -260,16 +340,6 @@
         goto err;
     }
 
-    p = getenv("XENPAGING_POLICY_MRU_SIZE");
-    if ( p && *p )
-    {
-         paging->policy_mru_size = atoi(p);
-         DPRINTF("Setting policy mru_size to %d\n", paging->policy_mru_size);
-    }
-
-    /* Set domain id */
-    paging->mem_event.domain_id = domain_id;
-
     /* Initialise shared page */
     paging->mem_event.shared_page = init_page();
     if ( paging->mem_event.shared_page == NULL )
@@ -335,17 +405,21 @@
 
     paging->mem_event.port = rc;
 
-    rc = xc_domain_getinfolist(xch, paging->mem_event.domain_id, 1,
-                               &domain_info);
-    if ( rc != 1 )
+    /* Get max_pages from guest if not provided via cmdline */
+    if ( !paging->max_pages )
     {
-        PERROR("Error getting domain info");
-        goto err;
+        rc = xc_domain_getinfolist(xch, paging->mem_event.domain_id, 1,
+                                   &domain_info);
+        if ( rc != 1 )
+        {
+            PERROR("Error getting domain info");
+            goto err;
+        }
+
+        /* Record number of max_pages */
+        paging->max_pages = domain_info.max_pages;
     }
 
-    /* Record number of max_pages */
-    paging->max_pages = domain_info.max_pages;
-
     /* Allocate bitmap for tracking pages that have been paged out */
     paging->bitmap = bitmap_alloc(paging->max_pages);
     if ( !paging->bitmap )
@@ -355,8 +429,6 @@
     }
     DPRINTF("max_pages = %d\n", paging->max_pages);
 
-    paging->target_tot_pages = target_tot_pages;
-
     /* Initialise policy */
     rc = policy_init(paging);
     if ( rc != 0 )
@@ -718,25 +790,18 @@
     mode_t open_mode = S_IRUSR | S_IRGRP | S_IROTH | S_IWUSR | S_IWGRP | S_IWOTH;
     int fd;
 
-    if ( argc != 3 )
-    {
-        fprintf(stderr, "Usage: %s <domain_id> <tot_pages>\n", argv[0]);
-        return -1;
-    }
-
     /* Initialise domain paging */
-    paging = xenpaging_init(atoi(argv[1]), atoi(argv[2]));
+    paging = xenpaging_init(argc, argv);
     if ( paging == NULL )
     {
-        fprintf(stderr, "Error initialising paging");
+        fprintf(stderr, "Error initialising paging\n");
         return 1;
     }
     xch = paging->xc_handle;
 
-    DPRINTF("starting %s %u %d\n", argv[0], paging->mem_event.domain_id, paging->target_tot_pages);
+    DPRINTF("starting %s for domain_id %u with pagefile %s\n", argv[0], paging->mem_event.domain_id, filename);
 
     /* Open file */
-    sprintf(filename, "page_cache_%u", paging->mem_event.domain_id);
     fd = open(filename, open_flags, open_mode);
     if ( fd < 0 )
     {
diff -r 9e3c2ef70c8a -r 7243fd87410e tools/xenpaging/xenpaging.h
--- a/tools/xenpaging/xenpaging.h	Sun Nov 20 17:02:47 2011 +0100
+++ b/tools/xenpaging/xenpaging.h	Sun Nov 20 17:02:48 2011 +0100
@@ -52,6 +52,7 @@
     int num_paged_out;
     int target_tot_pages;
     int policy_mru_size;
+    int debug;
     unsigned long pagein_queue[XENPAGING_PAGEIN_QUEUE_SIZE];
 } xenpaging_t;
 

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:53 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAht-0000sF-H2; Mon, 28 Nov 2011 23:33:53 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhp-0000a6-Mn
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:50 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1322523191!5048369!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24757 invoked from network); 28 Nov 2011 23:33: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;
	28 Nov 2011 23: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 1RVAnd-0001mG-Cy
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhc-0000yA-CT
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:36 +0000
Message-Id: <E1RVAhc-0000yA-CT@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:35 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] atomic: Define {read,
	write}_atomic() for reading/writing memory atomically.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1322227918 0
# Node ID 67f70841e05853aba35bd97792f34a0569020639
# Parent  1027e7d13d02143048c7d48d7960967c5b1657a8
atomic: Define {read,write}_atomic() for reading/writing memory atomically.

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


diff -r 1027e7d13d02 -r 67f70841e058 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Sun Nov 20 18:26:16 2011 +0100
+++ b/xen/arch/x86/mm.c	Fri Nov 25 13:31:58 2011 +0000
@@ -4629,7 +4629,7 @@
 
     /* All is good so make the update. */
     gdt_pent = map_domain_page(mfn);
-    atomic_write64((uint64_t *)&gdt_pent[offset], *(uint64_t *)&d);
+    write_atomic((uint64_t *)&gdt_pent[offset], *(uint64_t *)&d);
     unmap_domain_page(gdt_pent);
 
     put_page_type(page);
diff -r 1027e7d13d02 -r 67f70841e058 xen/arch/x86/mm/p2m-ept.c
--- a/xen/arch/x86/mm/p2m-ept.c	Sun Nov 20 18:26:16 2011 +0100
+++ b/xen/arch/x86/mm/p2m-ept.c	Fri Nov 25 13:31:58 2011 +0000
@@ -35,9 +35,9 @@
 #include "mm-locks.h"
 
 #define atomic_read_ept_entry(__pepte)                              \
-    ( (ept_entry_t) { .epte = atomic_read64(&(__pepte)->epte) } )
+    ( (ept_entry_t) { .epte = read_atomic(&(__pepte)->epte) } )
 #define atomic_write_ept_entry(__pepte, __epte)                     \
-    atomic_write64(&(__pepte)->epte, (__epte).epte)
+    write_atomic(&(__pepte)->epte, (__epte).epte)
 
 #define is_epte_present(ept_entry)      ((ept_entry)->epte & 0x7)
 #define is_epte_superpage(ept_entry)    ((ept_entry)->sp)
diff -r 1027e7d13d02 -r 67f70841e058 xen/arch/x86/x86_32/seg_fixup.c
--- a/xen/arch/x86/x86_32/seg_fixup.c	Sun Nov 20 18:26:16 2011 +0100
+++ b/xen/arch/x86/x86_32/seg_fixup.c	Fri Nov 25 13:31:58 2011 +0000
@@ -314,7 +314,7 @@
     b &= ~0xf0000; b |= limit & 0xf0000;
     b ^= _SEGMENT_EC; /* grows-up <-> grows-down */
     /* NB. This can't fault. Checked readable above; must also be writable. */
-    atomic_write64((uint64_t *)&table[2*idx], ((uint64_t)b<<32) | a);
+    write_atomic((uint64_t *)&table[2*idx], ((uint64_t)b<<32) | a);
     return 1;
 }
 
diff -r 1027e7d13d02 -r 67f70841e058 xen/common/timer.c
--- a/xen/common/timer.c	Sun Nov 20 18:26:16 2011 +0100
+++ b/xen/common/timer.c	Fri Nov 25 13:31:58 2011 +0000
@@ -239,7 +239,7 @@
 
     for ( ; ; )
     {
-        cpu = atomic_read16(&timer->cpu);
+        cpu = read_atomic(&timer->cpu);
         if ( unlikely(cpu == TIMER_CPU_status_killed) )
         {
             rcu_read_unlock(&timer_cpu_read_lock);
@@ -292,7 +292,7 @@
     memset(timer, 0, sizeof(*timer));
     timer->function = function;
     timer->data = data;
-    atomic_write16(&timer->cpu, cpu);
+    write_atomic(&timer->cpu, cpu);
     timer->status = TIMER_STATUS_inactive;
     if ( !timer_lock_irqsave(timer, flags) )
         BUG();
@@ -343,7 +343,7 @@
 
     for ( ; ; )
     {
-        old_cpu = atomic_read16(&timer->cpu);
+        old_cpu = read_atomic(&timer->cpu);
         if ( (old_cpu == new_cpu) || (old_cpu == TIMER_CPU_status_killed) )
         {
             rcu_read_unlock(&timer_cpu_read_lock);
@@ -375,7 +375,7 @@
         deactivate_timer(timer);
 
     list_del(&timer->inactive);
-    atomic_write16(&timer->cpu, new_cpu);
+    write_atomic(&timer->cpu, new_cpu);
     list_add(&timer->inactive, &per_cpu(timers, new_cpu).inactive);
 
     if ( active )
@@ -402,7 +402,7 @@
     list_del(&timer->inactive);
     timer->status = TIMER_STATUS_killed;
     old_cpu = timer->cpu;
-    atomic_write16(&timer->cpu, TIMER_CPU_status_killed);
+    write_atomic(&timer->cpu, TIMER_CPU_status_killed);
 
     spin_unlock_irqrestore(&per_cpu(timers, old_cpu).lock, flags);
 
@@ -573,7 +573,7 @@
              ? old_ts->heap[1] : old_ts->list) != NULL )
     {
         remove_entry(t);
-        atomic_write16(&t->cpu, new_cpu);
+        write_atomic(&t->cpu, new_cpu);
         notify |= add_entry(t);
     }
 
@@ -581,7 +581,7 @@
     {
         t = list_entry(old_ts->inactive.next, struct timer, inactive);
         list_del(&t->inactive);
-        atomic_write16(&t->cpu, new_cpu);
+        write_atomic(&t->cpu, new_cpu);
         list_add(&t->inactive, &new_ts->inactive);
     }
 
diff -r 1027e7d13d02 -r 67f70841e058 xen/include/asm-ia64/linux-xen/asm/atomic.h
--- a/xen/include/asm-ia64/linux-xen/asm/atomic.h	Sun Nov 20 18:26:16 2011 +0100
+++ b/xen/include/asm-ia64/linux-xen/asm/atomic.h	Fri Nov 25 13:31:58 2011 +0000
@@ -39,8 +39,8 @@
 #define ATOMIC_INIT(i)		{ (i) }
 #define ATOMIC64_INIT(i)	{ (i) }
 
-#define build_atomic_read(tag, type) \
-static inline type atomic_read##tag(const volatile type *addr) \
+#define build_read_atomic(tag, type) \
+static inline type read_##tag##_atomic(const volatile type *addr) \
 { \
 	type ret; \
 	asm volatile("ld%2.acq %0 = %1" \
@@ -49,37 +49,62 @@
 	return ret; \
 }
 
-#define build_atomic_write(tag, type) \
-static inline void atomic_write##tag(volatile type *addr, type val) \
+#define build_write_atomic(tag, type) \
+static inline void write_##tag##_atomic(volatile type *addr, type val) \
 { \
 	asm volatile("st%2.rel %0 = %1" \
 		     : "=m" (*addr) \
 		     : "r" (val), "i" (sizeof(type))); \
 }
 
-build_atomic_read(8, uint8_t)
-build_atomic_read(16, uint16_t)
-build_atomic_read(32, uint32_t)
-build_atomic_read(64, uint64_t)
-build_atomic_read(_int, int)
-build_atomic_read(_long, long)
+build_read_atomic(u8, uint8_t)
+build_read_atomic(u16, uint16_t)
+build_read_atomic(u32, uint32_t)
+build_read_atomic(u64, uint64_t)
 
-build_atomic_write(8, uint8_t)
-build_atomic_write(16, uint16_t)
-build_atomic_write(32, uint32_t)
-build_atomic_write(64, uint64_t)
-build_atomic_write(_int, int)
-build_atomic_write(_long, long)
+build_write_atomic(u8, uint8_t)
+build_write_atomic(u16, uint16_t)
+build_write_atomic(u32, uint32_t)
+build_write_atomic(u64, uint64_t)
+
+#undef build_read_atomic
+#undef build_write_atomic
+
+void __bad_atomic_size(void);
+
+#define read_atomic(p) ({                                               \
+    typeof(*p) __x;                                                     \
+    switch ( sizeof(*p) ) {                                             \
+    case 1: __x = (typeof(*p))read_u8_atomic((uint8_t *)p); break;      \
+    case 2: __x = (typeof(*p))read_u16_atomic((uint16_t *)p); break;    \
+    case 4: __x = (typeof(*p))read_u32_atomic((uint32_t *)p); break;    \
+    case 8: __x = (typeof(*p))read_u64_atomic((uint64_t *)p); break;    \
+    default: __x = 0; __bad_atomic_size(); break;                       \
+    }                                                                   \
+    __x;                                                                \
+})
+
+#define write_atomic(p, x) ({                                           \
+    typeof(*p) __x = (x);                                               \
+    switch ( sizeof(*p) ) {                                             \
+    case 1: write_u8_atomic((uint8_t *)p, (uint8_t)__x); break;         \
+    case 2: write_u16_atomic((uint16_t *)p, (uint16_t)__x); break;      \
+    case 4: write_u32_atomic((uint32_t *)p, (uint32_t)__x); break;      \
+    case 8: write_u64_atomic((uint64_t *)p, (uint64_t)__x); break;      \
+    default: __bad_atomic_size(); break;                                \
+    }                                                                   \
+    __x;                                                                \
+})
 
 #define _atomic_read(v)		((v).counter)
 #define _atomic64_read(v)	((v).counter)
-#define atomic_read(v)		atomic_read_int(&((v)->counter))
-#define atomic64_read(v)	atomic_read_long(&((v)->counter))
+#define atomic_read(v)		read_atomic(&((v)->counter))
+#define atomic64_read(v)	read_atomic(&((v)->counter))
 
 #define _atomic_set(v,i)	(((v).counter) = (i))
 #define _atomic64_set(v,i)	(((v).counter) = (i))
-#define atomic_set(v,i)		atomic_write_int(&((v)->counter), i)
-#define atomic64_set(v,l)	atomic_write_long(&((v)->counter), l)
+#define atomic_set(v,i)		write_atomic(&((v)->counter), i)
+#define atomic64_set(v,l)	write_atomic(&((v)->counter), l)
 
 #endif
 
diff -r 1027e7d13d02 -r 67f70841e058 xen/include/asm-x86/atomic.h
--- a/xen/include/asm-x86/atomic.h	Sun Nov 20 18:26:16 2011 +0100
+++ b/xen/include/asm-x86/atomic.h	Fri Nov 25 13:31:58 2011 +0000
@@ -4,36 +4,34 @@
 #include <xen/config.h>
 #include <asm/system.h>
 
-#define build_atomic_read(name, size, type, reg, barrier) \
+#define build_read_atomic(name, size, type, reg, barrier) \
 static inline type name(const volatile type *addr) \
 { type ret; asm volatile("mov" size " %1,%0":reg (ret) \
 :"m" (*(volatile type *)addr) barrier); return ret; }
 
-#define build_atomic_write(name, size, type, reg, barrier) \
+#define build_write_atomic(name, size, type, reg, barrier) \
 static inline void name(volatile type *addr, type val) \
 { asm volatile("mov" size " %1,%0": "=m" (*(volatile type *)addr) \
 :reg (val) barrier); }
 
-build_atomic_read(atomic_read8, "b", uint8_t, "=q", )
-build_atomic_read(atomic_read16, "w", uint16_t, "=r", )
-build_atomic_read(atomic_read32, "l", uint32_t, "=r", )
-build_atomic_read(atomic_read_int, "l", int, "=r", )
+build_read_atomic(read_u8_atomic, "b", uint8_t, "=q", )
+build_read_atomic(read_u16_atomic, "w", uint16_t, "=r", )
+build_read_atomic(read_u32_atomic, "l", uint32_t, "=r", )
 
-build_atomic_write(atomic_write8, "b", uint8_t, "q", )
-build_atomic_write(atomic_write16, "w", uint16_t, "r", )
-build_atomic_write(atomic_write32, "l", uint32_t, "r", )
-build_atomic_write(atomic_write_int, "l", int, "r", )
+build_write_atomic(write_u8_atomic, "b", uint8_t, "q", )
+build_write_atomic(write_u16_atomic, "w", uint16_t, "r", )
+build_write_atomic(write_u32_atomic, "l", uint32_t, "r", )
 
 #ifdef __x86_64__
-build_atomic_read(atomic_read64, "q", uint64_t, "=r", )
-build_atomic_write(atomic_write64, "q", uint64_t, "r", )
+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 atomic_read64(const volatile uint64_t *addr)
+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 atomic_write64(volatile uint64_t *addr, uint64_t val)
+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 )
@@ -41,8 +39,34 @@
 }
 #endif
 
-#undef build_atomic_read
-#undef build_atomic_write
+#undef build_read_atomic
+#undef build_write_atomic
+
+void __bad_atomic_size(void);
+
+#define read_atomic(p) ({                                               \
+    typeof(*p) __x;                                                     \
+    switch ( sizeof(*p) ) {                                             \
+    case 1: __x = (typeof(*p))read_u8_atomic((uint8_t *)p); break;      \
+    case 2: __x = (typeof(*p))read_u16_atomic((uint16_t *)p); break;    \
+    case 4: __x = (typeof(*p))read_u32_atomic((uint32_t *)p); break;    \
+    case 8: __x = (typeof(*p))read_u64_atomic((uint64_t *)p); break;    \
+    default: __x = 0; __bad_atomic_size(); break;                       \
+    }                                                                   \
+    __x;                                                                \
+})
+
+#define write_atomic(p, x) ({                                           \
+    typeof(*p) __x = (x);                                               \
+    switch ( sizeof(*p) ) {                                             \
+    case 1: write_u8_atomic((uint8_t *)p, (uint8_t)__x); break;         \
+    case 2: write_u16_atomic((uint16_t *)p, (uint16_t)__x); break;      \
+    case 4: write_u32_atomic((uint32_t *)p, (uint32_t)__x); break;      \
+    case 8: write_u64_atomic((uint64_t *)p, (uint64_t)__x); break;      \
+    default: __bad_atomic_size(); break;                                \
+    }                                                                   \
+    __x;                                                                \
+})
 
 /*
  * NB. I've pushed the volatile qualifier into the operations. This allows
@@ -60,7 +84,7 @@
  * Atomically reads the value of @v.
  */
 #define _atomic_read(v)  ((v).counter)
-#define atomic_read(v)   atomic_read_int(&((v)->counter))
+#define atomic_read(v)   read_atomic(&((v)->counter))
 
 /**
  * atomic_set - set atomic variable
@@ -70,7 +94,7 @@
  * Atomically sets the value of @v to @i.
  */ 
 #define _atomic_set(v,i) (((v).counter) = (i))
-#define atomic_set(v,i)  atomic_write_int(&((v)->counter), (i))
+#define atomic_set(v,i)  write_atomic(&((v)->counter), (i))
 
 /**
  * atomic_add - add integer to atomic variable
diff -r 1027e7d13d02 -r 67f70841e058 xen/include/asm-x86/x86_32/page.h
--- a/xen/include/asm-x86/x86_32/page.h	Sun Nov 20 18:26:16 2011 +0100
+++ b/xen/include/asm-x86/x86_32/page.h	Fri Nov 25 13:31:58 2011 +0000
@@ -85,15 +85,15 @@
 
 #endif
 
-#define pte_read_atomic(ptep)       atomic_read64(ptep)
-#define pte_write_atomic(ptep, pte) atomic_write64(ptep, pte)
-#define pte_write(ptep, pte) do {                             \
-    u32 *__ptep_words = (u32 *)(ptep);                        \
-    atomic_write32(&__ptep_words[0], 0);                      \
-    wmb();                                                    \
-    atomic_write32(&__ptep_words[1], (pte) >> 32);            \
-    wmb();                                                    \
-    atomic_write32(&__ptep_words[0], (pte) >>  0);            \
+#define pte_read_atomic(ptep)       read_atomic(ptep)
+#define pte_write_atomic(ptep, pte) write_atomic(ptep, pte)
+#define pte_write(ptep, pte) do {                   \
+    u32 *__ptep_words = (u32 *)(ptep);              \
+    write_atomic(&__ptep_words[0], 0);              \
+    wmb();                                          \
+    write_atomic(&__ptep_words[1], (pte) >> 32);    \
+    wmb();                                          \
+    write_atomic(&__ptep_words[0], (pte) >>  0);    \
 } while ( 0 )
 
 /* root table */
diff -r 1027e7d13d02 -r 67f70841e058 xen/include/asm-x86/x86_64/page.h
--- a/xen/include/asm-x86/x86_64/page.h	Sun Nov 20 18:26:16 2011 +0100
+++ b/xen/include/asm-x86/x86_64/page.h	Fri Nov 25 13:31:58 2011 +0000
@@ -116,9 +116,9 @@
 
 #endif /* !__ASSEMBLY__ */
 
-#define pte_read_atomic(ptep)       atomic_read64(ptep)
-#define pte_write_atomic(ptep, pte) atomic_write64(ptep, pte)
-#define pte_write(ptep, pte)        atomic_write64(ptep, pte)
+#define pte_read_atomic(ptep)       read_atomic(ptep)
+#define pte_write_atomic(ptep, pte) write_atomic(ptep, pte)
+#define pte_write(ptep, pte)        write_atomic(ptep, pte)
 
 /* Given a virtual address, get an entry offset into a linear page table. */
 #define l1_linear_offset(_a) (((_a) & VADDR_MASK) >> L1_PAGETABLE_SHIFT)

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:53 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAht-0000sF-H2; Mon, 28 Nov 2011 23:33:53 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhp-0000a6-Mn
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:50 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1322523191!5048369!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24757 invoked from network); 28 Nov 2011 23:33: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;
	28 Nov 2011 23: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 1RVAnd-0001mG-Cy
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhc-0000yA-CT
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:36 +0000
Message-Id: <E1RVAhc-0000yA-CT@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:35 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] atomic: Define {read,
	write}_atomic() for reading/writing memory atomically.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1322227918 0
# Node ID 67f70841e05853aba35bd97792f34a0569020639
# Parent  1027e7d13d02143048c7d48d7960967c5b1657a8
atomic: Define {read,write}_atomic() for reading/writing memory atomically.

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


diff -r 1027e7d13d02 -r 67f70841e058 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Sun Nov 20 18:26:16 2011 +0100
+++ b/xen/arch/x86/mm.c	Fri Nov 25 13:31:58 2011 +0000
@@ -4629,7 +4629,7 @@
 
     /* All is good so make the update. */
     gdt_pent = map_domain_page(mfn);
-    atomic_write64((uint64_t *)&gdt_pent[offset], *(uint64_t *)&d);
+    write_atomic((uint64_t *)&gdt_pent[offset], *(uint64_t *)&d);
     unmap_domain_page(gdt_pent);
 
     put_page_type(page);
diff -r 1027e7d13d02 -r 67f70841e058 xen/arch/x86/mm/p2m-ept.c
--- a/xen/arch/x86/mm/p2m-ept.c	Sun Nov 20 18:26:16 2011 +0100
+++ b/xen/arch/x86/mm/p2m-ept.c	Fri Nov 25 13:31:58 2011 +0000
@@ -35,9 +35,9 @@
 #include "mm-locks.h"
 
 #define atomic_read_ept_entry(__pepte)                              \
-    ( (ept_entry_t) { .epte = atomic_read64(&(__pepte)->epte) } )
+    ( (ept_entry_t) { .epte = read_atomic(&(__pepte)->epte) } )
 #define atomic_write_ept_entry(__pepte, __epte)                     \
-    atomic_write64(&(__pepte)->epte, (__epte).epte)
+    write_atomic(&(__pepte)->epte, (__epte).epte)
 
 #define is_epte_present(ept_entry)      ((ept_entry)->epte & 0x7)
 #define is_epte_superpage(ept_entry)    ((ept_entry)->sp)
diff -r 1027e7d13d02 -r 67f70841e058 xen/arch/x86/x86_32/seg_fixup.c
--- a/xen/arch/x86/x86_32/seg_fixup.c	Sun Nov 20 18:26:16 2011 +0100
+++ b/xen/arch/x86/x86_32/seg_fixup.c	Fri Nov 25 13:31:58 2011 +0000
@@ -314,7 +314,7 @@
     b &= ~0xf0000; b |= limit & 0xf0000;
     b ^= _SEGMENT_EC; /* grows-up <-> grows-down */
     /* NB. This can't fault. Checked readable above; must also be writable. */
-    atomic_write64((uint64_t *)&table[2*idx], ((uint64_t)b<<32) | a);
+    write_atomic((uint64_t *)&table[2*idx], ((uint64_t)b<<32) | a);
     return 1;
 }
 
diff -r 1027e7d13d02 -r 67f70841e058 xen/common/timer.c
--- a/xen/common/timer.c	Sun Nov 20 18:26:16 2011 +0100
+++ b/xen/common/timer.c	Fri Nov 25 13:31:58 2011 +0000
@@ -239,7 +239,7 @@
 
     for ( ; ; )
     {
-        cpu = atomic_read16(&timer->cpu);
+        cpu = read_atomic(&timer->cpu);
         if ( unlikely(cpu == TIMER_CPU_status_killed) )
         {
             rcu_read_unlock(&timer_cpu_read_lock);
@@ -292,7 +292,7 @@
     memset(timer, 0, sizeof(*timer));
     timer->function = function;
     timer->data = data;
-    atomic_write16(&timer->cpu, cpu);
+    write_atomic(&timer->cpu, cpu);
     timer->status = TIMER_STATUS_inactive;
     if ( !timer_lock_irqsave(timer, flags) )
         BUG();
@@ -343,7 +343,7 @@
 
     for ( ; ; )
     {
-        old_cpu = atomic_read16(&timer->cpu);
+        old_cpu = read_atomic(&timer->cpu);
         if ( (old_cpu == new_cpu) || (old_cpu == TIMER_CPU_status_killed) )
         {
             rcu_read_unlock(&timer_cpu_read_lock);
@@ -375,7 +375,7 @@
         deactivate_timer(timer);
 
     list_del(&timer->inactive);
-    atomic_write16(&timer->cpu, new_cpu);
+    write_atomic(&timer->cpu, new_cpu);
     list_add(&timer->inactive, &per_cpu(timers, new_cpu).inactive);
 
     if ( active )
@@ -402,7 +402,7 @@
     list_del(&timer->inactive);
     timer->status = TIMER_STATUS_killed;
     old_cpu = timer->cpu;
-    atomic_write16(&timer->cpu, TIMER_CPU_status_killed);
+    write_atomic(&timer->cpu, TIMER_CPU_status_killed);
 
     spin_unlock_irqrestore(&per_cpu(timers, old_cpu).lock, flags);
 
@@ -573,7 +573,7 @@
              ? old_ts->heap[1] : old_ts->list) != NULL )
     {
         remove_entry(t);
-        atomic_write16(&t->cpu, new_cpu);
+        write_atomic(&t->cpu, new_cpu);
         notify |= add_entry(t);
     }
 
@@ -581,7 +581,7 @@
     {
         t = list_entry(old_ts->inactive.next, struct timer, inactive);
         list_del(&t->inactive);
-        atomic_write16(&t->cpu, new_cpu);
+        write_atomic(&t->cpu, new_cpu);
         list_add(&t->inactive, &new_ts->inactive);
     }
 
diff -r 1027e7d13d02 -r 67f70841e058 xen/include/asm-ia64/linux-xen/asm/atomic.h
--- a/xen/include/asm-ia64/linux-xen/asm/atomic.h	Sun Nov 20 18:26:16 2011 +0100
+++ b/xen/include/asm-ia64/linux-xen/asm/atomic.h	Fri Nov 25 13:31:58 2011 +0000
@@ -39,8 +39,8 @@
 #define ATOMIC_INIT(i)		{ (i) }
 #define ATOMIC64_INIT(i)	{ (i) }
 
-#define build_atomic_read(tag, type) \
-static inline type atomic_read##tag(const volatile type *addr) \
+#define build_read_atomic(tag, type) \
+static inline type read_##tag##_atomic(const volatile type *addr) \
 { \
 	type ret; \
 	asm volatile("ld%2.acq %0 = %1" \
@@ -49,37 +49,62 @@
 	return ret; \
 }
 
-#define build_atomic_write(tag, type) \
-static inline void atomic_write##tag(volatile type *addr, type val) \
+#define build_write_atomic(tag, type) \
+static inline void write_##tag##_atomic(volatile type *addr, type val) \
 { \
 	asm volatile("st%2.rel %0 = %1" \
 		     : "=m" (*addr) \
 		     : "r" (val), "i" (sizeof(type))); \
 }
 
-build_atomic_read(8, uint8_t)
-build_atomic_read(16, uint16_t)
-build_atomic_read(32, uint32_t)
-build_atomic_read(64, uint64_t)
-build_atomic_read(_int, int)
-build_atomic_read(_long, long)
+build_read_atomic(u8, uint8_t)
+build_read_atomic(u16, uint16_t)
+build_read_atomic(u32, uint32_t)
+build_read_atomic(u64, uint64_t)
 
-build_atomic_write(8, uint8_t)
-build_atomic_write(16, uint16_t)
-build_atomic_write(32, uint32_t)
-build_atomic_write(64, uint64_t)
-build_atomic_write(_int, int)
-build_atomic_write(_long, long)
+build_write_atomic(u8, uint8_t)
+build_write_atomic(u16, uint16_t)
+build_write_atomic(u32, uint32_t)
+build_write_atomic(u64, uint64_t)
+
+#undef build_read_atomic
+#undef build_write_atomic
+
+void __bad_atomic_size(void);
+
+#define read_atomic(p) ({                                               \
+    typeof(*p) __x;                                                     \
+    switch ( sizeof(*p) ) {                                             \
+    case 1: __x = (typeof(*p))read_u8_atomic((uint8_t *)p); break;      \
+    case 2: __x = (typeof(*p))read_u16_atomic((uint16_t *)p); break;    \
+    case 4: __x = (typeof(*p))read_u32_atomic((uint32_t *)p); break;    \
+    case 8: __x = (typeof(*p))read_u64_atomic((uint64_t *)p); break;    \
+    default: __x = 0; __bad_atomic_size(); break;                       \
+    }                                                                   \
+    __x;                                                                \
+})
+
+#define write_atomic(p, x) ({                                           \
+    typeof(*p) __x = (x);                                               \
+    switch ( sizeof(*p) ) {                                             \
+    case 1: write_u8_atomic((uint8_t *)p, (uint8_t)__x); break;         \
+    case 2: write_u16_atomic((uint16_t *)p, (uint16_t)__x); break;      \
+    case 4: write_u32_atomic((uint32_t *)p, (uint32_t)__x); break;      \
+    case 8: write_u64_atomic((uint64_t *)p, (uint64_t)__x); break;      \
+    default: __bad_atomic_size(); break;                                \
+    }                                                                   \
+    __x;                                                                \
+})
 
 #define _atomic_read(v)		((v).counter)
 #define _atomic64_read(v)	((v).counter)
-#define atomic_read(v)		atomic_read_int(&((v)->counter))
-#define atomic64_read(v)	atomic_read_long(&((v)->counter))
+#define atomic_read(v)		read_atomic(&((v)->counter))
+#define atomic64_read(v)	read_atomic(&((v)->counter))
 
 #define _atomic_set(v,i)	(((v).counter) = (i))
 #define _atomic64_set(v,i)	(((v).counter) = (i))
-#define atomic_set(v,i)		atomic_write_int(&((v)->counter), i)
-#define atomic64_set(v,l)	atomic_write_long(&((v)->counter), l)
+#define atomic_set(v,i)		write_atomic(&((v)->counter), i)
+#define atomic64_set(v,l)	write_atomic(&((v)->counter), l)
 
 #endif
 
diff -r 1027e7d13d02 -r 67f70841e058 xen/include/asm-x86/atomic.h
--- a/xen/include/asm-x86/atomic.h	Sun Nov 20 18:26:16 2011 +0100
+++ b/xen/include/asm-x86/atomic.h	Fri Nov 25 13:31:58 2011 +0000
@@ -4,36 +4,34 @@
 #include <xen/config.h>
 #include <asm/system.h>
 
-#define build_atomic_read(name, size, type, reg, barrier) \
+#define build_read_atomic(name, size, type, reg, barrier) \
 static inline type name(const volatile type *addr) \
 { type ret; asm volatile("mov" size " %1,%0":reg (ret) \
 :"m" (*(volatile type *)addr) barrier); return ret; }
 
-#define build_atomic_write(name, size, type, reg, barrier) \
+#define build_write_atomic(name, size, type, reg, barrier) \
 static inline void name(volatile type *addr, type val) \
 { asm volatile("mov" size " %1,%0": "=m" (*(volatile type *)addr) \
 :reg (val) barrier); }
 
-build_atomic_read(atomic_read8, "b", uint8_t, "=q", )
-build_atomic_read(atomic_read16, "w", uint16_t, "=r", )
-build_atomic_read(atomic_read32, "l", uint32_t, "=r", )
-build_atomic_read(atomic_read_int, "l", int, "=r", )
+build_read_atomic(read_u8_atomic, "b", uint8_t, "=q", )
+build_read_atomic(read_u16_atomic, "w", uint16_t, "=r", )
+build_read_atomic(read_u32_atomic, "l", uint32_t, "=r", )
 
-build_atomic_write(atomic_write8, "b", uint8_t, "q", )
-build_atomic_write(atomic_write16, "w", uint16_t, "r", )
-build_atomic_write(atomic_write32, "l", uint32_t, "r", )
-build_atomic_write(atomic_write_int, "l", int, "r", )
+build_write_atomic(write_u8_atomic, "b", uint8_t, "q", )
+build_write_atomic(write_u16_atomic, "w", uint16_t, "r", )
+build_write_atomic(write_u32_atomic, "l", uint32_t, "r", )
 
 #ifdef __x86_64__
-build_atomic_read(atomic_read64, "q", uint64_t, "=r", )
-build_atomic_write(atomic_write64, "q", uint64_t, "r", )
+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 atomic_read64(const volatile uint64_t *addr)
+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 atomic_write64(volatile uint64_t *addr, uint64_t val)
+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 )
@@ -41,8 +39,34 @@
 }
 #endif
 
-#undef build_atomic_read
-#undef build_atomic_write
+#undef build_read_atomic
+#undef build_write_atomic
+
+void __bad_atomic_size(void);
+
+#define read_atomic(p) ({                                               \
+    typeof(*p) __x;                                                     \
+    switch ( sizeof(*p) ) {                                             \
+    case 1: __x = (typeof(*p))read_u8_atomic((uint8_t *)p); break;      \
+    case 2: __x = (typeof(*p))read_u16_atomic((uint16_t *)p); break;    \
+    case 4: __x = (typeof(*p))read_u32_atomic((uint32_t *)p); break;    \
+    case 8: __x = (typeof(*p))read_u64_atomic((uint64_t *)p); break;    \
+    default: __x = 0; __bad_atomic_size(); break;                       \
+    }                                                                   \
+    __x;                                                                \
+})
+
+#define write_atomic(p, x) ({                                           \
+    typeof(*p) __x = (x);                                               \
+    switch ( sizeof(*p) ) {                                             \
+    case 1: write_u8_atomic((uint8_t *)p, (uint8_t)__x); break;         \
+    case 2: write_u16_atomic((uint16_t *)p, (uint16_t)__x); break;      \
+    case 4: write_u32_atomic((uint32_t *)p, (uint32_t)__x); break;      \
+    case 8: write_u64_atomic((uint64_t *)p, (uint64_t)__x); break;      \
+    default: __bad_atomic_size(); break;                                \
+    }                                                                   \
+    __x;                                                                \
+})
 
 /*
  * NB. I've pushed the volatile qualifier into the operations. This allows
@@ -60,7 +84,7 @@
  * Atomically reads the value of @v.
  */
 #define _atomic_read(v)  ((v).counter)
-#define atomic_read(v)   atomic_read_int(&((v)->counter))
+#define atomic_read(v)   read_atomic(&((v)->counter))
 
 /**
  * atomic_set - set atomic variable
@@ -70,7 +94,7 @@
  * Atomically sets the value of @v to @i.
  */ 
 #define _atomic_set(v,i) (((v).counter) = (i))
-#define atomic_set(v,i)  atomic_write_int(&((v)->counter), (i))
+#define atomic_set(v,i)  write_atomic(&((v)->counter), (i))
 
 /**
  * atomic_add - add integer to atomic variable
diff -r 1027e7d13d02 -r 67f70841e058 xen/include/asm-x86/x86_32/page.h
--- a/xen/include/asm-x86/x86_32/page.h	Sun Nov 20 18:26:16 2011 +0100
+++ b/xen/include/asm-x86/x86_32/page.h	Fri Nov 25 13:31:58 2011 +0000
@@ -85,15 +85,15 @@
 
 #endif
 
-#define pte_read_atomic(ptep)       atomic_read64(ptep)
-#define pte_write_atomic(ptep, pte) atomic_write64(ptep, pte)
-#define pte_write(ptep, pte) do {                             \
-    u32 *__ptep_words = (u32 *)(ptep);                        \
-    atomic_write32(&__ptep_words[0], 0);                      \
-    wmb();                                                    \
-    atomic_write32(&__ptep_words[1], (pte) >> 32);            \
-    wmb();                                                    \
-    atomic_write32(&__ptep_words[0], (pte) >>  0);            \
+#define pte_read_atomic(ptep)       read_atomic(ptep)
+#define pte_write_atomic(ptep, pte) write_atomic(ptep, pte)
+#define pte_write(ptep, pte) do {                   \
+    u32 *__ptep_words = (u32 *)(ptep);              \
+    write_atomic(&__ptep_words[0], 0);              \
+    wmb();                                          \
+    write_atomic(&__ptep_words[1], (pte) >> 32);    \
+    wmb();                                          \
+    write_atomic(&__ptep_words[0], (pte) >>  0);    \
 } while ( 0 )
 
 /* root table */
diff -r 1027e7d13d02 -r 67f70841e058 xen/include/asm-x86/x86_64/page.h
--- a/xen/include/asm-x86/x86_64/page.h	Sun Nov 20 18:26:16 2011 +0100
+++ b/xen/include/asm-x86/x86_64/page.h	Fri Nov 25 13:31:58 2011 +0000
@@ -116,9 +116,9 @@
 
 #endif /* !__ASSEMBLY__ */
 
-#define pte_read_atomic(ptep)       atomic_read64(ptep)
-#define pte_write_atomic(ptep, pte) atomic_write64(ptep, pte)
-#define pte_write(ptep, pte)        atomic_write64(ptep, pte)
+#define pte_read_atomic(ptep)       read_atomic(ptep)
+#define pte_write_atomic(ptep, pte) write_atomic(ptep, pte)
+#define pte_write(ptep, pte)        write_atomic(ptep, pte)
 
 /* Given a virtual address, get an entry offset into a linear page table. */
 #define l1_linear_offset(_a) (((_a) & VADDR_MASK) >> L1_PAGETABLE_SHIFT)

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:54 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33: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.xensource.com>)
	id 1RVAht-0000t0-UH; Mon, 28 Nov 2011 23:33:53 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhq-0000bz-EV
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:50 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-182.messagelabs.com!1322523192!5039719!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.0 required=7.0 tests=BODY_RANDOMQ
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24539 invoked from network); 28 Nov 2011 23:33:13 -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;
	28 Nov 2011 23: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 1RVAne-0001md-SI
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhd-0000yu-Rl
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:37 +0000
Message-Id: <E1RVAhd-0000yu-Rl@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:37 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] waitqueue: Implement wake_up_{nr, one,
	all}.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1322252831 0
# Node ID 2a81ce2b2b9374adc051768fcf940d161ecc34dd
# Parent  96bbdc894224821fbc14a33e93b55688920c7fd2
waitqueue: Implement wake_up_{nr,one,all}.

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


diff -r 96bbdc894224 -r 2a81ce2b2b93 xen/common/wait.c
--- a/xen/common/wait.c	Fri Nov 25 15:48:03 2011 +0000
+++ b/xen/common/wait.c	Fri Nov 25 20:27:11 2011 +0000
@@ -87,13 +87,13 @@
     INIT_LIST_HEAD(&wq->list);
 }
 
-void wake_up(struct waitqueue_head *wq)
+void wake_up_nr(struct waitqueue_head *wq, unsigned int nr)
 {
     struct waitqueue_vcpu *wqv;
 
     spin_lock(&wq->lock);
 
-    while ( !list_empty(&wq->list) )
+    while ( !list_empty(&wq->list) && nr-- )
     {
         wqv = list_entry(wq->list.next, struct waitqueue_vcpu, list);
         list_del_init(&wqv->list);
@@ -103,6 +103,16 @@
     spin_unlock(&wq->lock);
 }
 
+void wake_up_one(struct waitqueue_head *wq)
+{
+    wake_up_nr(wq, 1);
+}
+
+void wake_up_all(struct waitqueue_head *wq)
+{
+    wake_up_nr(wq, UINT_MAX);
+}
+
 #ifdef CONFIG_X86
 
 static void __prepare_to_wait(struct waitqueue_vcpu *wqv)
diff -r 96bbdc894224 -r 2a81ce2b2b93 xen/include/xen/wait.h
--- a/xen/include/xen/wait.h	Fri Nov 25 15:48:03 2011 +0000
+++ b/xen/include/xen/wait.h	Fri Nov 25 20:27:11 2011 +0000
@@ -28,8 +28,10 @@
 /* Dynamically initialise a waitqueue. */
 void init_waitqueue_head(struct waitqueue_head *wq);
 
-/* Wake all VCPUs waiting on specified waitqueue. */
-void wake_up(struct waitqueue_head *wq);
+/* Wake VCPU(s) waiting on specified waitqueue. */
+void wake_up_nr(struct waitqueue_head *wq, unsigned int nr);
+void wake_up_one(struct waitqueue_head *wq);
+void wake_up_all(struct waitqueue_head *wq);
 
 /* Wait on specified waitqueue until @condition is true. */
 #define wait_event(wq, condition)               \

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:54 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33: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.xensource.com>)
	id 1RVAht-0000t0-UH; Mon, 28 Nov 2011 23:33:53 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhq-0000bz-EV
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:50 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-182.messagelabs.com!1322523192!5039719!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.0 required=7.0 tests=BODY_RANDOMQ
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24539 invoked from network); 28 Nov 2011 23:33:13 -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;
	28 Nov 2011 23: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 1RVAne-0001md-SI
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhd-0000yu-Rl
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:37 +0000
Message-Id: <E1RVAhd-0000yu-Rl@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:37 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] waitqueue: Implement wake_up_{nr, one,
	all}.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1322252831 0
# Node ID 2a81ce2b2b9374adc051768fcf940d161ecc34dd
# Parent  96bbdc894224821fbc14a33e93b55688920c7fd2
waitqueue: Implement wake_up_{nr,one,all}.

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


diff -r 96bbdc894224 -r 2a81ce2b2b93 xen/common/wait.c
--- a/xen/common/wait.c	Fri Nov 25 15:48:03 2011 +0000
+++ b/xen/common/wait.c	Fri Nov 25 20:27:11 2011 +0000
@@ -87,13 +87,13 @@
     INIT_LIST_HEAD(&wq->list);
 }
 
-void wake_up(struct waitqueue_head *wq)
+void wake_up_nr(struct waitqueue_head *wq, unsigned int nr)
 {
     struct waitqueue_vcpu *wqv;
 
     spin_lock(&wq->lock);
 
-    while ( !list_empty(&wq->list) )
+    while ( !list_empty(&wq->list) && nr-- )
     {
         wqv = list_entry(wq->list.next, struct waitqueue_vcpu, list);
         list_del_init(&wqv->list);
@@ -103,6 +103,16 @@
     spin_unlock(&wq->lock);
 }
 
+void wake_up_one(struct waitqueue_head *wq)
+{
+    wake_up_nr(wq, 1);
+}
+
+void wake_up_all(struct waitqueue_head *wq)
+{
+    wake_up_nr(wq, UINT_MAX);
+}
+
 #ifdef CONFIG_X86
 
 static void __prepare_to_wait(struct waitqueue_vcpu *wqv)
diff -r 96bbdc894224 -r 2a81ce2b2b93 xen/include/xen/wait.h
--- a/xen/include/xen/wait.h	Fri Nov 25 15:48:03 2011 +0000
+++ b/xen/include/xen/wait.h	Fri Nov 25 20:27:11 2011 +0000
@@ -28,8 +28,10 @@
 /* Dynamically initialise a waitqueue. */
 void init_waitqueue_head(struct waitqueue_head *wq);
 
-/* Wake all VCPUs waiting on specified waitqueue. */
-void wake_up(struct waitqueue_head *wq);
+/* Wake VCPU(s) waiting on specified waitqueue. */
+void wake_up_nr(struct waitqueue_head *wq, unsigned int nr);
+void wake_up_one(struct waitqueue_head *wq);
+void wake_up_all(struct waitqueue_head *wq);
 
 /* Wait on specified waitqueue until @condition is true. */
 #define wait_event(wq, condition)               \

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:54 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33: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.xensource.com>)
	id 1RVAhu-0000u0-CH; Mon, 28 Nov 2011 23:33:54 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhq-0000ay-10
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:50 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1322523192!5025903!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16540 invoked from network); 28 Nov 2011 23:33: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;
	28 Nov 2011 23: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 1RVAne-0001mV-Cc
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhd-0000ye-C7
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:37 +0000
Message-Id: <E1RVAhd-0000ye-C7@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:36 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hvm/viridian: Ditch the extra
	assertions/warnings for non-viridian guests.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Paul Durrant <paul.durrant@citrix.com>
# Date 1322236083 0
# Node ID 96bbdc894224821fbc14a33e93b55688920c7fd2
# Parent  373bd877cac3a42482074a2d3393d0c78bef7e59
hvm/viridian: Ditch the extra assertions/warnings for non-viridian guests.

Consensus is they are over-aggressive.

Signed-off-by: Keir Fraser <keir@xen.org>
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---


diff -r 373bd877cac3 -r 96bbdc894224 xen/arch/x86/hvm/viridian.c
--- a/xen/arch/x86/hvm/viridian.c	Fri Nov 25 15:30:41 2011 +0000
+++ b/xen/arch/x86/hvm/viridian.c	Fri Nov 25 15:48:03 2011 +0000
@@ -206,11 +206,8 @@
     struct vcpu *v = current;
     struct domain *d = v->domain;
 
-    if ( !is_viridian_domain(d) ) {
-        gdprintk(XENLOG_WARNING, "%s: %d not a viridian domain\n", __func__,
-                 d->domain_id);
+    if ( !is_viridian_domain(d) )
         return 0;
-    }
 
     switch ( idx )
     {
@@ -274,11 +271,8 @@
     struct vcpu *v = current;
     struct domain *d = v->domain;
     
-    if ( !is_viridian_domain(d) ) {
-        gdprintk(XENLOG_WARNING, "%s: %d not a viridian domain\n", __func__,
-                 d->domain_id);
+    if ( !is_viridian_domain(d) )
         return 0;
-    }
 
     switch ( idx )
     {
@@ -417,8 +411,6 @@
     if ( hvm_load_entry(VIRIDIAN_DOMAIN, h, &ctxt) != 0 )
         return -EINVAL;
 
-    ASSERT(is_viridian_domain(d));
-
     d->arch.hvm_domain.viridian.hypercall_gpa.raw = ctxt.hypercall_gpa;
     d->arch.hvm_domain.viridian.guest_os_id.raw   = ctxt.guest_os_id;
 
@@ -463,8 +455,6 @@
     if ( hvm_load_entry(VIRIDIAN_VCPU, h, &ctxt) != 0 )
         return -EINVAL;
 
-    ASSERT(is_viridian_domain(d));
-
     v->arch.hvm_vcpu.viridian.apic_assist.raw = ctxt.apic_assist;
 
     return 0;

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:54 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33: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.xensource.com>)
	id 1RVAhu-0000u0-CH; Mon, 28 Nov 2011 23:33:54 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhq-0000ay-10
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:50 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1322523192!5025903!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16540 invoked from network); 28 Nov 2011 23:33: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;
	28 Nov 2011 23: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 1RVAne-0001mV-Cc
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhd-0000ye-C7
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:37 +0000
Message-Id: <E1RVAhd-0000ye-C7@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:36 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hvm/viridian: Ditch the extra
	assertions/warnings for non-viridian guests.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Paul Durrant <paul.durrant@citrix.com>
# Date 1322236083 0
# Node ID 96bbdc894224821fbc14a33e93b55688920c7fd2
# Parent  373bd877cac3a42482074a2d3393d0c78bef7e59
hvm/viridian: Ditch the extra assertions/warnings for non-viridian guests.

Consensus is they are over-aggressive.

Signed-off-by: Keir Fraser <keir@xen.org>
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---


diff -r 373bd877cac3 -r 96bbdc894224 xen/arch/x86/hvm/viridian.c
--- a/xen/arch/x86/hvm/viridian.c	Fri Nov 25 15:30:41 2011 +0000
+++ b/xen/arch/x86/hvm/viridian.c	Fri Nov 25 15:48:03 2011 +0000
@@ -206,11 +206,8 @@
     struct vcpu *v = current;
     struct domain *d = v->domain;
 
-    if ( !is_viridian_domain(d) ) {
-        gdprintk(XENLOG_WARNING, "%s: %d not a viridian domain\n", __func__,
-                 d->domain_id);
+    if ( !is_viridian_domain(d) )
         return 0;
-    }
 
     switch ( idx )
     {
@@ -274,11 +271,8 @@
     struct vcpu *v = current;
     struct domain *d = v->domain;
     
-    if ( !is_viridian_domain(d) ) {
-        gdprintk(XENLOG_WARNING, "%s: %d not a viridian domain\n", __func__,
-                 d->domain_id);
+    if ( !is_viridian_domain(d) )
         return 0;
-    }
 
     switch ( idx )
     {
@@ -417,8 +411,6 @@
     if ( hvm_load_entry(VIRIDIAN_DOMAIN, h, &ctxt) != 0 )
         return -EINVAL;
 
-    ASSERT(is_viridian_domain(d));
-
     d->arch.hvm_domain.viridian.hypercall_gpa.raw = ctxt.hypercall_gpa;
     d->arch.hvm_domain.viridian.guest_os_id.raw   = ctxt.guest_os_id;
 
@@ -463,8 +455,6 @@
     if ( hvm_load_entry(VIRIDIAN_VCPU, h, &ctxt) != 0 )
         return -EINVAL;
 
-    ASSERT(is_viridian_domain(d));
-
     v->arch.hvm_vcpu.viridian.apic_assist.raw = ctxt.apic_assist;
 
     return 0;

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:55 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhv-0000v3-2q; Mon, 28 Nov 2011 23:33:55 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhr-0000eV-Hw
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:51 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-182.messagelabs.com!1322523193!5038392!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10064 invoked from network); 28 Nov 2011 23:33:14 -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;
	28 Nov 2011 23: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 1RVAnf-0001mq-VU
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhe-0000zO-Rd
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:38 +0000
Message-Id: <E1RVAhe-0000zO-Rd@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:38 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools: Revert to our built-in aio
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1322481443 0
# Node ID a9c67c2daf4b0181ef2581471ea920eecb495616
# Parent  95d4e2e0bed374602b5a78ee004b057ad8715d65
tools: Revert to our built-in aio

These two changesets:
   24184:4ecd3615e726  tools: use system installed libaio by default.
   24186:7aa5838499d1  tools: use system libaio for blktap1 as well.
cause HVM guest installs (both Windows and Redhat) to fail on Debian
squeeze with xl.  So change the default for now.

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


diff -r 95d4e2e0bed3 -r a9c67c2daf4b Config.mk
--- a/Config.mk	Fri Nov 25 20:32:05 2011 +0000
+++ b/Config.mk	Mon Nov 28 11:57:23 2011 +0000
@@ -232,7 +232,7 @@
 OCAML_TOOLS        ?= y
 CONFIG_MINITERM    ?= n
 CONFIG_LOMOUNT     ?= n
-CONFIG_SYSTEM_LIBAIO ?= y
+CONFIG_SYSTEM_LIBAIO ?= n
 
 ifeq ($(OCAML_TOOLS),y)
 OCAML_TOOLS := $(shell ocamlopt -v > /dev/null 2>&1 && echo "y" || echo "n")

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:55 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhv-0000v3-2q; Mon, 28 Nov 2011 23:33:55 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhr-0000eV-Hw
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:51 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-182.messagelabs.com!1322523193!5038392!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10064 invoked from network); 28 Nov 2011 23:33:14 -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;
	28 Nov 2011 23: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 1RVAnf-0001mq-VU
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhe-0000zO-Rd
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:38 +0000
Message-Id: <E1RVAhe-0000zO-Rd@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:38 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools: Revert to our built-in aio
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1322481443 0
# Node ID a9c67c2daf4b0181ef2581471ea920eecb495616
# Parent  95d4e2e0bed374602b5a78ee004b057ad8715d65
tools: Revert to our built-in aio

These two changesets:
   24184:4ecd3615e726  tools: use system installed libaio by default.
   24186:7aa5838499d1  tools: use system libaio for blktap1 as well.
cause HVM guest installs (both Windows and Redhat) to fail on Debian
squeeze with xl.  So change the default for now.

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


diff -r 95d4e2e0bed3 -r a9c67c2daf4b Config.mk
--- a/Config.mk	Fri Nov 25 20:32:05 2011 +0000
+++ b/Config.mk	Mon Nov 28 11:57:23 2011 +0000
@@ -232,7 +232,7 @@
 OCAML_TOOLS        ?= y
 CONFIG_MINITERM    ?= n
 CONFIG_LOMOUNT     ?= n
-CONFIG_SYSTEM_LIBAIO ?= y
+CONFIG_SYSTEM_LIBAIO ?= n
 
 ifeq ($(OCAML_TOOLS),y)
 OCAML_TOOLS := $(shell ocamlopt -v > /dev/null 2>&1 && echo "y" || echo "n")

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:55 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhv-0000vN-Aj; Mon, 28 Nov 2011 23:33:55 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhr-0000ek-KY
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:51 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-216.messagelabs.com!1322523194!5405118!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11910 invoked from network); 28 Nov 2011 23:33:15 -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;
	28 Nov 2011 23: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 1RVAng-0001mt-FW
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhf-0000zd-Bp
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:39 +0000
Message-Id: <E1RVAhf-0000zd-Bp@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:38 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: open logs with O_APPEND
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1322500768 0
# Node ID 5bac57e7ea47580eb5c07dac17fbd70f1c808ded
# Parent  a9c67c2daf4b0181ef2581471ea920eecb495616
libxl: open logs with O_APPEND

Logfiles should always be opened for append.

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 a9c67c2daf4b -r 5bac57e7ea47 tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c	Mon Nov 28 11:57:23 2011 +0000
+++ b/tools/libxl/libxl_dm.c	Mon Nov 28 17:19:28 2011 +0000
@@ -830,7 +830,7 @@
     libxl__xs_write(gc, XBT_NULL, libxl__sprintf(gc, "%s/disable_pf", path), "%d", !info->xen_platform_pci);
 
     libxl_create_logfile(ctx, libxl__sprintf(gc, "qemu-dm-%s", info->dom_name), &logfile);
-    logfile_w = open(logfile, O_WRONLY|O_CREAT, 0644);
+    logfile_w = open(logfile, O_WRONLY|O_CREAT|O_APPEND, 0644);
     free(logfile);
     null = open("/dev/null", O_RDONLY);
 
diff -r a9c67c2daf4b -r 5bac57e7ea47 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Mon Nov 28 11:57:23 2011 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Mon Nov 28 17:19:28 2011 +0000
@@ -1597,7 +1597,8 @@
             exit(-1);
         }
 
-        CHK_ERRNO(( logfile = open(fullname, O_WRONLY|O_CREAT, 0644) )<0);
+        CHK_ERRNO(( logfile = open(fullname, O_WRONLY|O_CREAT|O_APPEND,
+                                   0644) )<0);
         free(fullname);
         free(name);
 

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:55 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhv-0000vN-Aj; Mon, 28 Nov 2011 23:33:55 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhr-0000ek-KY
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:51 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-216.messagelabs.com!1322523194!5405118!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11910 invoked from network); 28 Nov 2011 23:33:15 -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;
	28 Nov 2011 23: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 1RVAng-0001mt-FW
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhf-0000zd-Bp
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:39 +0000
Message-Id: <E1RVAhf-0000zd-Bp@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:38 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: open logs with O_APPEND
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1322500768 0
# Node ID 5bac57e7ea47580eb5c07dac17fbd70f1c808ded
# Parent  a9c67c2daf4b0181ef2581471ea920eecb495616
libxl: open logs with O_APPEND

Logfiles should always be opened for append.

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 a9c67c2daf4b -r 5bac57e7ea47 tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c	Mon Nov 28 11:57:23 2011 +0000
+++ b/tools/libxl/libxl_dm.c	Mon Nov 28 17:19:28 2011 +0000
@@ -830,7 +830,7 @@
     libxl__xs_write(gc, XBT_NULL, libxl__sprintf(gc, "%s/disable_pf", path), "%d", !info->xen_platform_pci);
 
     libxl_create_logfile(ctx, libxl__sprintf(gc, "qemu-dm-%s", info->dom_name), &logfile);
-    logfile_w = open(logfile, O_WRONLY|O_CREAT, 0644);
+    logfile_w = open(logfile, O_WRONLY|O_CREAT|O_APPEND, 0644);
     free(logfile);
     null = open("/dev/null", O_RDONLY);
 
diff -r a9c67c2daf4b -r 5bac57e7ea47 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Mon Nov 28 11:57:23 2011 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Mon Nov 28 17:19:28 2011 +0000
@@ -1597,7 +1597,8 @@
             exit(-1);
         }
 
-        CHK_ERRNO(( logfile = open(fullname, O_WRONLY|O_CREAT, 0644) )<0);
+        CHK_ERRNO(( logfile = open(fullname, O_WRONLY|O_CREAT|O_APPEND,
+                                   0644) )<0);
         free(fullname);
         free(name);
 

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:57 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhw-0000x4-PC; Mon, 28 Nov 2011 23:33:56 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhs-0000ge-JK
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:52 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1322523194!5048373!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24793 invoked from network); 28 Nov 2011 23:33: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;
	28 Nov 2011 23: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 1RVAng-0001n0-SP
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhf-0000zs-Rr
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:39 +0000
Message-Id: <E1RVAhf-0000zs-Rr@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:39 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Update QEMU_TAG
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1322502126 0
# Node ID 52b6b80e847f893aa1e8dbb00b16941b57ff1f6b
# Parent  5bac57e7ea47580eb5c07dac17fbd70f1c808ded
Update QEMU_TAG
---


diff -r 5bac57e7ea47 -r 52b6b80e847f Config.mk
--- a/Config.mk	Mon Nov 28 17:19:28 2011 +0000
+++ b/Config.mk	Mon Nov 28 17:42:06 2011 +0000
@@ -208,9 +208,9 @@
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= 9b33a3e5603ecd3ceca482a72c6ff8e951afb6d2
-# Tue Nov 22 16:12:40 2011 +0000
-# qemu-xen: add vkbd support for PV on HVM guests
+QEMU_TAG ?= 89daacab7035d408f32f2cb1acf68c96d6cbefed
+# Mon Nov 28 17:16:52 2011 +0000
+# qemu-dm: open char devices "file:..." with O_APPEND
 
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:57 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhw-0000xB-SP; Mon, 28 Nov 2011 23:33:56 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhs-0000gi-KG
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:52 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-216.messagelabs.com!1322523193!5319848!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.0 required=7.0 tests=BODY_RANDOMQ
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8889 invoked from network); 28 Nov 2011 23:33:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Nov 2011 23: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 1RVAnf-0001mi-C9
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhe-0000z9-Be
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:38 +0000
Message-Id: <E1RVAhe-0000z9-Be@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:37 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] waitqueue: Hold a reference to a
	domain on a waitqueue.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1322253125 0
# Node ID 95d4e2e0bed374602b5a78ee004b057ad8715d65
# Parent  2a81ce2b2b9374adc051768fcf940d161ecc34dd
waitqueue: Hold a reference to a domain on a waitqueue.

Also allow waitqueues to be dynamically destroyed.

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


diff -r 2a81ce2b2b93 -r 95d4e2e0bed3 xen/common/wait.c
--- a/xen/common/wait.c	Fri Nov 25 20:27:11 2011 +0000
+++ b/xen/common/wait.c	Fri Nov 25 20:32:05 2011 +0000
@@ -87,6 +87,11 @@
     INIT_LIST_HEAD(&wq->list);
 }
 
+void destroy_waitqueue_head(struct waitqueue_head *wq)
+{
+    wake_up_all(wq);
+}
+
 void wake_up_nr(struct waitqueue_head *wq, unsigned int nr)
 {
     struct waitqueue_vcpu *wqv;
@@ -98,6 +103,7 @@
         wqv = list_entry(wq->list.next, struct waitqueue_vcpu, list);
         list_del_init(&wqv->list);
         vcpu_unpause(wqv->vcpu);
+        put_domain(wqv->vcpu->domain);
     }
 
     spin_unlock(&wq->lock);
@@ -218,6 +224,7 @@
     spin_lock(&wq->lock);
     list_add_tail(&wqv->list, &wq->list);
     vcpu_pause_nosync(curr);
+    get_knownalive_domain(curr->domain);
     spin_unlock(&wq->lock);
 }
 
@@ -236,6 +243,7 @@
     {
         list_del_init(&wqv->list);
         vcpu_unpause(curr);
+        put_domain(curr->domain);
     }
     spin_unlock(&wq->lock);
 }
diff -r 2a81ce2b2b93 -r 95d4e2e0bed3 xen/include/xen/wait.h
--- a/xen/include/xen/wait.h	Fri Nov 25 20:27:11 2011 +0000
+++ b/xen/include/xen/wait.h	Fri Nov 25 20:32:05 2011 +0000
@@ -25,8 +25,9 @@
         .list = LIST_HEAD_INIT((name).list)     \
     }
 
-/* Dynamically initialise a waitqueue. */
+/* Dynamically initialise/destroy a waitqueue. */
 void init_waitqueue_head(struct waitqueue_head *wq);
+void destroy_waitqueue_head(struct waitqueue_head *wq);
 
 /* Wake VCPU(s) waiting on specified waitqueue. */
 void wake_up_nr(struct waitqueue_head *wq, unsigned int nr);

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:57 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhw-0000x4-PC; Mon, 28 Nov 2011 23:33:56 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhs-0000ge-JK
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:52 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1322523194!5048373!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24793 invoked from network); 28 Nov 2011 23:33: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;
	28 Nov 2011 23: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 1RVAng-0001n0-SP
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhf-0000zs-Rr
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:39 +0000
Message-Id: <E1RVAhf-0000zs-Rr@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:39 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Update QEMU_TAG
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1322502126 0
# Node ID 52b6b80e847f893aa1e8dbb00b16941b57ff1f6b
# Parent  5bac57e7ea47580eb5c07dac17fbd70f1c808ded
Update QEMU_TAG
---


diff -r 5bac57e7ea47 -r 52b6b80e847f Config.mk
--- a/Config.mk	Mon Nov 28 17:19:28 2011 +0000
+++ b/Config.mk	Mon Nov 28 17:42:06 2011 +0000
@@ -208,9 +208,9 @@
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= 9b33a3e5603ecd3ceca482a72c6ff8e951afb6d2
-# Tue Nov 22 16:12:40 2011 +0000
-# qemu-xen: add vkbd support for PV on HVM guests
+QEMU_TAG ?= 89daacab7035d408f32f2cb1acf68c96d6cbefed
+# Mon Nov 28 17:16:52 2011 +0000
+# qemu-dm: open char devices "file:..." with O_APPEND
 
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:57 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhw-0000xB-SP; Mon, 28 Nov 2011 23:33:56 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhs-0000gi-KG
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:52 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-216.messagelabs.com!1322523193!5319848!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.0 required=7.0 tests=BODY_RANDOMQ
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8889 invoked from network); 28 Nov 2011 23:33:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Nov 2011 23: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 1RVAnf-0001mi-C9
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhe-0000z9-Be
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:38 +0000
Message-Id: <E1RVAhe-0000z9-Be@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:37 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] waitqueue: Hold a reference to a
	domain on a waitqueue.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1322253125 0
# Node ID 95d4e2e0bed374602b5a78ee004b057ad8715d65
# Parent  2a81ce2b2b9374adc051768fcf940d161ecc34dd
waitqueue: Hold a reference to a domain on a waitqueue.

Also allow waitqueues to be dynamically destroyed.

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


diff -r 2a81ce2b2b93 -r 95d4e2e0bed3 xen/common/wait.c
--- a/xen/common/wait.c	Fri Nov 25 20:27:11 2011 +0000
+++ b/xen/common/wait.c	Fri Nov 25 20:32:05 2011 +0000
@@ -87,6 +87,11 @@
     INIT_LIST_HEAD(&wq->list);
 }
 
+void destroy_waitqueue_head(struct waitqueue_head *wq)
+{
+    wake_up_all(wq);
+}
+
 void wake_up_nr(struct waitqueue_head *wq, unsigned int nr)
 {
     struct waitqueue_vcpu *wqv;
@@ -98,6 +103,7 @@
         wqv = list_entry(wq->list.next, struct waitqueue_vcpu, list);
         list_del_init(&wqv->list);
         vcpu_unpause(wqv->vcpu);
+        put_domain(wqv->vcpu->domain);
     }
 
     spin_unlock(&wq->lock);
@@ -218,6 +224,7 @@
     spin_lock(&wq->lock);
     list_add_tail(&wqv->list, &wq->list);
     vcpu_pause_nosync(curr);
+    get_knownalive_domain(curr->domain);
     spin_unlock(&wq->lock);
 }
 
@@ -236,6 +243,7 @@
     {
         list_del_init(&wqv->list);
         vcpu_unpause(curr);
+        put_domain(curr->domain);
     }
     spin_unlock(&wq->lock);
 }
diff -r 2a81ce2b2b93 -r 95d4e2e0bed3 xen/include/xen/wait.h
--- a/xen/include/xen/wait.h	Fri Nov 25 20:27:11 2011 +0000
+++ b/xen/include/xen/wait.h	Fri Nov 25 20:32:05 2011 +0000
@@ -25,8 +25,9 @@
         .list = LIST_HEAD_INIT((name).list)     \
     }
 
-/* Dynamically initialise a waitqueue. */
+/* Dynamically initialise/destroy a waitqueue. */
 void init_waitqueue_head(struct waitqueue_head *wq);
+void destroy_waitqueue_head(struct waitqueue_head *wq);
 
 /* Wake VCPU(s) waiting on specified waitqueue. */
 void wake_up_nr(struct waitqueue_head *wq, unsigned int nr);

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:57 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhx-0000xS-33; Mon, 28 Nov 2011 23:33:57 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhs-0000hP-SF
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:53 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-182.messagelabs.com!1322523195!5039723!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24587 invoked from network); 28 Nov 2011 23:33:16 -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;
	28 Nov 2011 23: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 1RVAnh-0001n6-Bn
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:53 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhg-000108-BM
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:40 +0000
Message-Id: <E1RVAhg-000108-BM@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:39 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: propagate error from
	tap_ctl_spawn.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322502160 0
# Node ID a2cb7ed6d0a2ee5aecb3a988750ce9c8d8b718ee
# Parent  52b6b80e847f893aa1e8dbb00b16941b57ff1f6b
libxl: propagate error from tap_ctl_spawn.

Failure here means that a disk will not be correctly setup. I briefly
scanned tools/blktap2/control.c for other goto constructs which did not
set their err variable but didn't see any others.

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


diff -r 52b6b80e847f -r a2cb7ed6d0a2 tools/blktap2/control/tap-ctl-create.c
--- a/tools/blktap2/control/tap-ctl-create.c	Mon Nov 28 17:42:06 2011 +0000
+++ b/tools/blktap2/control/tap-ctl-create.c	Mon Nov 28 17:42:40 2011 +0000
@@ -44,8 +44,10 @@
 		return err;
 
 	id = tap_ctl_spawn();
-	if (id < 0)
+	if (id < 0) {
+		err = id;
 		goto destroy;
+	}
 
 	err = tap_ctl_attach(id, minor);
 	if (err)

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

From xen-changelog-bounces@lists.xensource.com Mon Nov 28 23:33:57 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Nov 2011 23:33:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVAhx-0000xS-33; Mon, 28 Nov 2011 23:33:57 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhs-0000hP-SF
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:53 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-182.messagelabs.com!1322523195!5039723!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24587 invoked from network); 28 Nov 2011 23:33:16 -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;
	28 Nov 2011 23: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 1RVAnh-0001n6-Bn
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:39:53 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVAhg-000108-BM
	for xen-changelog@lists.xensource.com; Mon, 28 Nov 2011 23:33:40 +0000
Message-Id: <E1RVAhg-000108-BM@xenbits.xen.org>
Date: Mon, 28 Nov 2011 23:33:39 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: propagate error from
	tap_ctl_spawn.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322502160 0
# Node ID a2cb7ed6d0a2ee5aecb3a988750ce9c8d8b718ee
# Parent  52b6b80e847f893aa1e8dbb00b16941b57ff1f6b
libxl: propagate error from tap_ctl_spawn.

Failure here means that a disk will not be correctly setup. I briefly
scanned tools/blktap2/control.c for other goto constructs which did not
set their err variable but didn't see any others.

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


diff -r 52b6b80e847f -r a2cb7ed6d0a2 tools/blktap2/control/tap-ctl-create.c
--- a/tools/blktap2/control/tap-ctl-create.c	Mon Nov 28 17:42:06 2011 +0000
+++ b/tools/blktap2/control/tap-ctl-create.c	Mon Nov 28 17:42:40 2011 +0000
@@ -44,8 +44,10 @@
 		return err;
 
 	id = tap_ctl_spawn();
-	if (id < 0)
+	if (id < 0) {
+		err = id;
 		goto destroy;
+	}
 
 	err = tap_ctl_attach(id, minor);
 	if (err)

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:25 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY6w-0006QQ-S6; Wed, 30 Nov 2011 00:33:18 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6v-0006QB-An
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-27.messagelabs.com!1322613146!47612135!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15121 invoked from network); 30 Nov 2011 00:32:27 -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;
	30 Nov 2011 00:32: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 1RVYCp-0003uW-Jw
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6n-0003jE-8D
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:09 +0000
Message-Id: <E1RVY6n-0003jE-8D@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: install html and txt versions
	of manpages
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322576247 0
# Node ID bca64f372e4f76a85a9f0fa9f2a59ded1b6bb206
# Parent  0cfdb398d2f646a4a61d435bc1fdd6ecb28600b0
docs: install html and txt versions of manpages

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


diff -r 0cfdb398d2f6 -r bca64f372e4f docs/Docs.mk
--- a/docs/Docs.mk	Tue Nov 29 14:17:27 2011 +0000
+++ b/docs/Docs.mk	Tue Nov 29 14:17:27 2011 +0000
@@ -5,6 +5,8 @@
 LATEX2HTML	:= latex2html
 DOXYGEN		:= doxygen
 POD2MAN		:= pod2man
+POD2HTML	:= pod2html
+POD2TEXT	:= pod2text
 DOT		:= dot
 NEATO		:= neato
 MARKDOWN	:= markdown
diff -r 0cfdb398d2f6 -r bca64f372e4f docs/Makefile
--- a/docs/Makefile	Tue Nov 29 14:17:27 2011 +0000
+++ b/docs/Makefile	Tue Nov 29 14:17:27 2011 +0000
@@ -15,9 +15,13 @@
 DOC_PS		:= $(patsubst src/%.tex,ps/%.ps,$(DOC_TEX))
 DOC_PDF		:= $(patsubst src/%.tex,pdf/%.pdf,$(DOC_TEX))
 DOC_HTML	:= $(patsubst src/%.tex,html/%/index.html,$(DOC_TEX)) \
-		   $(patsubst %.markdown,html/%.html,$(DOC_MARKDOWN))
+		   $(patsubst %.markdown,html/%.html,$(DOC_MARKDOWN)) \
+		   $(patsubst man/%.pod.1,html/man/%.1.html,$(DOC_MAN1SRC)) \
+		   $(patsubst man/%.pod.5,html/man/%.5.html,$(DOC_MAN5SRC))
 DOC_TXT         := $(patsubst %.txt,txt/%.txt,$(wildcard misc/*.txt)) \
-		   $(patsubst %.markdown,txt/%.txt,$(DOC_MARKDOWN))
+		   $(patsubst %.markdown,txt/%.txt,$(DOC_MARKDOWN)) \
+		   $(patsubst man/%.pod.1,txt/man/%.1.txt,$(DOC_MAN1SRC)) \
+		   $(patsubst man/%.pod.5,txt/man/%.5.txt,$(DOC_MAN5SRC))
 
 GFX = $(patsubst %.fig, %.eps, $(wildcard figs/*.fig))
 
@@ -76,7 +80,7 @@
 	$(MAKE) -C xen-api clean
 	rm -rf .word_count *.aux *.dvi *.bbl *.blg *.glo *.idx *~ 
 	rm -rf *.ilg *.log *.ind *.toc *.bak core
-	rm -rf $(GFX) ps pdf html
+	rm -rf $(GFX) ps pdf html txt
 	rm -rf api
 	rm -rf man5
 	rm -rf man1
@@ -132,6 +136,16 @@
 	$(call move-if-changed,$@.tmp,$@) ; else \
 	echo "markdown not installed; skipping $*.html."; fi
 
+html/man/%.1.html: man/%.pod.1 Makefile
+	$(INSTALL_DIR) $(@D)
+	$(POD2HTML) --infile=$< --outfile=$@.tmp
+	$(call move-if-changed,$@.tmp,$@)
+
+html/man/%.5.html: man/%.pod.5 Makefile
+	$(INSTALL_DIR) $(@D)
+	$(POD2HTML) --infile=$< --outfile=$@.tmp
+	$(call move-if-changed,$@.tmp,$@)
+
 txt/%.txt: %.txt
 	$(INSTALL_DIR) $(@D)
 	cp $< $@.tmp
@@ -141,3 +155,14 @@
 	$(INSTALL_DIR) $(@D)
 	cp $< $@.tmp
 	$(call move-if-changed,$@.tmp,$@)
+
+txt/man/%.1.txt: man/%.pod.1 Makefile
+	$(INSTALL_DIR) $(@D)
+	$(POD2TEXT) $< $@.tmp
+	$(call move-if-changed,$@.tmp,$@)
+
+txt/man/%.5.txt: man/%.pod.5 Makefile
+	$(INSTALL_DIR) $(@D)
+	$(POD2TEXT) $< $@.tmp
+	$(call move-if-changed,$@.tmp,$@)
+

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:25 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY6w-0006QQ-S6; Wed, 30 Nov 2011 00:33:18 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6v-0006QB-An
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-27.messagelabs.com!1322613146!47612135!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15121 invoked from network); 30 Nov 2011 00:32:27 -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;
	30 Nov 2011 00:32: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 1RVYCp-0003uW-Jw
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6n-0003jE-8D
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:09 +0000
Message-Id: <E1RVY6n-0003jE-8D@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: install html and txt versions
	of manpages
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322576247 0
# Node ID bca64f372e4f76a85a9f0fa9f2a59ded1b6bb206
# Parent  0cfdb398d2f646a4a61d435bc1fdd6ecb28600b0
docs: install html and txt versions of manpages

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


diff -r 0cfdb398d2f6 -r bca64f372e4f docs/Docs.mk
--- a/docs/Docs.mk	Tue Nov 29 14:17:27 2011 +0000
+++ b/docs/Docs.mk	Tue Nov 29 14:17:27 2011 +0000
@@ -5,6 +5,8 @@
 LATEX2HTML	:= latex2html
 DOXYGEN		:= doxygen
 POD2MAN		:= pod2man
+POD2HTML	:= pod2html
+POD2TEXT	:= pod2text
 DOT		:= dot
 NEATO		:= neato
 MARKDOWN	:= markdown
diff -r 0cfdb398d2f6 -r bca64f372e4f docs/Makefile
--- a/docs/Makefile	Tue Nov 29 14:17:27 2011 +0000
+++ b/docs/Makefile	Tue Nov 29 14:17:27 2011 +0000
@@ -15,9 +15,13 @@
 DOC_PS		:= $(patsubst src/%.tex,ps/%.ps,$(DOC_TEX))
 DOC_PDF		:= $(patsubst src/%.tex,pdf/%.pdf,$(DOC_TEX))
 DOC_HTML	:= $(patsubst src/%.tex,html/%/index.html,$(DOC_TEX)) \
-		   $(patsubst %.markdown,html/%.html,$(DOC_MARKDOWN))
+		   $(patsubst %.markdown,html/%.html,$(DOC_MARKDOWN)) \
+		   $(patsubst man/%.pod.1,html/man/%.1.html,$(DOC_MAN1SRC)) \
+		   $(patsubst man/%.pod.5,html/man/%.5.html,$(DOC_MAN5SRC))
 DOC_TXT         := $(patsubst %.txt,txt/%.txt,$(wildcard misc/*.txt)) \
-		   $(patsubst %.markdown,txt/%.txt,$(DOC_MARKDOWN))
+		   $(patsubst %.markdown,txt/%.txt,$(DOC_MARKDOWN)) \
+		   $(patsubst man/%.pod.1,txt/man/%.1.txt,$(DOC_MAN1SRC)) \
+		   $(patsubst man/%.pod.5,txt/man/%.5.txt,$(DOC_MAN5SRC))
 
 GFX = $(patsubst %.fig, %.eps, $(wildcard figs/*.fig))
 
@@ -76,7 +80,7 @@
 	$(MAKE) -C xen-api clean
 	rm -rf .word_count *.aux *.dvi *.bbl *.blg *.glo *.idx *~ 
 	rm -rf *.ilg *.log *.ind *.toc *.bak core
-	rm -rf $(GFX) ps pdf html
+	rm -rf $(GFX) ps pdf html txt
 	rm -rf api
 	rm -rf man5
 	rm -rf man1
@@ -132,6 +136,16 @@
 	$(call move-if-changed,$@.tmp,$@) ; else \
 	echo "markdown not installed; skipping $*.html."; fi
 
+html/man/%.1.html: man/%.pod.1 Makefile
+	$(INSTALL_DIR) $(@D)
+	$(POD2HTML) --infile=$< --outfile=$@.tmp
+	$(call move-if-changed,$@.tmp,$@)
+
+html/man/%.5.html: man/%.pod.5 Makefile
+	$(INSTALL_DIR) $(@D)
+	$(POD2HTML) --infile=$< --outfile=$@.tmp
+	$(call move-if-changed,$@.tmp,$@)
+
 txt/%.txt: %.txt
 	$(INSTALL_DIR) $(@D)
 	cp $< $@.tmp
@@ -141,3 +155,14 @@
 	$(INSTALL_DIR) $(@D)
 	cp $< $@.tmp
 	$(call move-if-changed,$@.tmp,$@)
+
+txt/man/%.1.txt: man/%.pod.1 Makefile
+	$(INSTALL_DIR) $(@D)
+	$(POD2TEXT) $< $@.tmp
+	$(call move-if-changed,$@.tmp,$@)
+
+txt/man/%.5.txt: man/%.pod.5 Makefile
+	$(INSTALL_DIR) $(@D)
+	$(POD2TEXT) $< $@.tmp
+	$(call move-if-changed,$@.tmp,$@)
+

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:28 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY71-0006RN-4J; Wed, 30 Nov 2011 00:33:23 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6z-0006Q9-Pl
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-174.messagelabs.com!1322613161!3426852!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30008 invoked from network); 30 Nov 2011 00:32:43 -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;
	30 Nov 2011 00:32: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 1RVYCo-0003uN-G5
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6l-0003iV-Oh
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:07 +0000
Message-Id: <E1RVY6l-0003iV-Oh@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Replace references to old wiki with
	ones to new.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322574811 0
# Node ID 2d18642355d4ac7b6662dc86d47006ca9b1c73b7
# Parent  a2cb7ed6d0a2ee5aecb3a988750ce9c8d8b718ee
Replace references to old wiki with ones to new.

I have confirmed that the relevant pages have been transitioned.

What remains is pages which have not yet been moved over:

$ rgrep xenwiki *
tools/libxen/README:http://wiki.xensource.com/xenwiki/XenApi
tools/xenballoon/xenballoond.README:http://wiki.xensource.com/xenwiki/Open_Topics_For_Discussion?action=AttachFile&do=get&target=Memory+Overcommit.pdf

Note that "PythonInXlConfig" never existed in the old wiki and does not exist
in the new. This reference was introduced by 22735:cb94dbe20f97 and was
supposed to have been written prior to the 4.1 release. I have transitioned it
anyway but it's not clear how valuable the message actually is. Perhaps we
should just remove that aspect of it?

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


diff -r a2cb7ed6d0a2 -r 2d18642355d4 README
--- a/README	Mon Nov 28 17:42:40 2011 +0000
+++ b/README	Tue Nov 29 13:53:31 2011 +0000
@@ -61,10 +61,10 @@
 Second, you need to acquire a suitable kernel for use in domain 0. If
 possible you should use a kernel provided by your OS distributor. If
 no suitable kernel is available from your OS distributor then refer to
-http://wiki.xen.org/xenwiki/XenDom0Kernels for suggestions for
+http://wiki.xen.org/wiki/XenDom0Kernels for suggestions for
 suitable kernels to use.
 If you are looking to compile a Dom0 kernel from source, please refer to
-http://wiki.xensource.com/xenwiki/XenParavirtOps.
+http://wiki.xen.org/wiki/XenParavirtOps.
 
 [NB. Unless noted otherwise, all the following steps should be
 performed with root privileges.]
diff -r a2cb7ed6d0a2 -r 2d18642355d4 docs/misc/vtd.txt
--- a/docs/misc/vtd.txt	Mon Nov 28 17:42:40 2011 +0000
+++ b/docs/misc/vtd.txt	Tue Nov 29 13:53:31 2011 +0000
@@ -184,7 +184,7 @@
 - HP Compaq:  DC7800
 http://h10010.www1.hp.com/wwpc/us/en/en/WF04a/12454-12454-64287-321860-3328898.html
 
-For more information, pls refer to http://wiki.xensource.com/xenwiki/VTdHowTo.
+For more information, pls refer to http://wiki.xen.org/wiki/VTdHowTo.
 
 
 Assigning devices to HVM domains
diff -r a2cb7ed6d0a2 -r 2d18642355d4 docs/misc/xenstore.txt
--- a/docs/misc/xenstore.txt	Mon Nov 28 17:42:40 2011 +0000
+++ b/docs/misc/xenstore.txt	Tue Nov 29 13:53:31 2011 +0000
@@ -159,7 +159,7 @@
 		r<domid>	read only
 		b<domid>	both read and write
 		n<domid>	no access
-	See http://wiki.xensource.com/xenwiki/XenBus section
+	See http://wiki.xen.org/wiki/XenBus section
 	`Permissions' for details of the permissions system.
 
 ---------- Watches ----------
diff -r a2cb7ed6d0a2 -r 2d18642355d4 docs/misc/xl-network-configuration.markdown
--- a/docs/misc/xl-network-configuration.markdown	Mon Nov 28 17:42:40 2011 +0000
+++ b/docs/misc/xl-network-configuration.markdown	Tue Nov 29 13:53:31 2011 +0000
@@ -123,4 +123,4 @@
 driver domain which is outside the scope of this document.
 
 [oui]: http://en.wikipedia.org/wiki/Organizationally_Unique_Identifier
-[net]: http://wiki.xen.org/xenwiki/HostConfiguration/Networking
+[net]: http://wiki.xen.org/wiki/HostConfiguration/Networking
diff -r a2cb7ed6d0a2 -r 2d18642355d4 docs/src/interface.tex
--- a/docs/src/interface.tex	Mon Nov 28 17:42:40 2011 +0000
+++ b/docs/src/interface.tex	Tue Nov 29 13:53:31 2011 +0000
@@ -1579,7 +1579,7 @@
 documentation, including the latest version of the FAQ.
 
 Information regarding Xen is also available at the Xen Wiki at
-\begin{quote} {\tt http://wiki.xensource.com/xenwiki/}\end{quote}
+\begin{quote} {\tt http://wiki.xen.org/wiki/}\end{quote}
 The Xen project uses Bugzilla as its bug tracking system. You'll find
 the Xen Bugzilla at http://bugzilla.xensource.com/bugzilla/.
 
diff -r a2cb7ed6d0a2 -r 2d18642355d4 docs/src/user.tex
--- a/docs/src/user.tex	Mon Nov 28 17:42:40 2011 +0000
+++ b/docs/src/user.tex	Tue Nov 29 13:53:31 2011 +0000
@@ -2349,7 +2349,7 @@
 documentation, including the latest version of the FAQ.
 
 Information regarding Xen is also available at the Xen Wiki at
-\begin{quote} {\tt http://wiki.xensource.com/xenwiki/}\end{quote}
+\begin{quote} {\tt http://wiki.xen.org/wiki/}\end{quote}
 The Xen project uses Bugzilla as its bug tracking system. You'll find
 the Xen Bugzilla at http://bugzilla.xensource.com/bugzilla/.
 
diff -r a2cb7ed6d0a2 -r 2d18642355d4 tools/libxl/libxlu_cfg.c
--- a/tools/libxl/libxlu_cfg.c	Mon Nov 28 17:42:40 2011 +0000
+++ b/tools/libxl/libxlu_cfg.c	Tue Nov 29 13:53:31 2011 +0000
@@ -72,7 +72,7 @@
         fputs(
  "warning: Config file looks like it contains Python code.\n"
  "warning:  Arbitrary Python is no longer supported.\n"
- "warning:  See http://wiki.xen.org/xenwiki/PythonInXlConfig\n",
+ "warning:  See http://wiki.xen.org/wiki/PythonInXlConfig\n",
               ctx->cfg->report);
     }
 }
diff -r a2cb7ed6d0a2 -r 2d18642355d4 xen/common/sched_credit2.c
--- a/xen/common/sched_credit2.c	Mon Nov 28 17:42:40 2011 +0000
+++ b/xen/common/sched_credit2.c	Tue Nov 29 13:53:31 2011 +0000
@@ -51,7 +51,7 @@
 /*
  * WARNING: This is still in an experimental phase.  Status and work can be found at the
  * credit2 wiki page:
- *  http://wiki.xensource.com/xenwiki/Credit2_Scheduler_Development
+ *  http://wiki.xen.org/wiki/Credit2_Scheduler_Development
  * TODO:
  * + Immediate bug-fixes
  *  - Do per-runqueue, grab proper lock for dump debugkey

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:28 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY71-0006RN-4J; Wed, 30 Nov 2011 00:33:23 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6z-0006Q9-Pl
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-174.messagelabs.com!1322613161!3426852!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30008 invoked from network); 30 Nov 2011 00:32:43 -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;
	30 Nov 2011 00:32: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 1RVYCo-0003uN-G5
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6l-0003iV-Oh
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:07 +0000
Message-Id: <E1RVY6l-0003iV-Oh@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Replace references to old wiki with
	ones to new.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322574811 0
# Node ID 2d18642355d4ac7b6662dc86d47006ca9b1c73b7
# Parent  a2cb7ed6d0a2ee5aecb3a988750ce9c8d8b718ee
Replace references to old wiki with ones to new.

I have confirmed that the relevant pages have been transitioned.

What remains is pages which have not yet been moved over:

$ rgrep xenwiki *
tools/libxen/README:http://wiki.xensource.com/xenwiki/XenApi
tools/xenballoon/xenballoond.README:http://wiki.xensource.com/xenwiki/Open_Topics_For_Discussion?action=AttachFile&do=get&target=Memory+Overcommit.pdf

Note that "PythonInXlConfig" never existed in the old wiki and does not exist
in the new. This reference was introduced by 22735:cb94dbe20f97 and was
supposed to have been written prior to the 4.1 release. I have transitioned it
anyway but it's not clear how valuable the message actually is. Perhaps we
should just remove that aspect of it?

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


diff -r a2cb7ed6d0a2 -r 2d18642355d4 README
--- a/README	Mon Nov 28 17:42:40 2011 +0000
+++ b/README	Tue Nov 29 13:53:31 2011 +0000
@@ -61,10 +61,10 @@
 Second, you need to acquire a suitable kernel for use in domain 0. If
 possible you should use a kernel provided by your OS distributor. If
 no suitable kernel is available from your OS distributor then refer to
-http://wiki.xen.org/xenwiki/XenDom0Kernels for suggestions for
+http://wiki.xen.org/wiki/XenDom0Kernels for suggestions for
 suitable kernels to use.
 If you are looking to compile a Dom0 kernel from source, please refer to
-http://wiki.xensource.com/xenwiki/XenParavirtOps.
+http://wiki.xen.org/wiki/XenParavirtOps.
 
 [NB. Unless noted otherwise, all the following steps should be
 performed with root privileges.]
diff -r a2cb7ed6d0a2 -r 2d18642355d4 docs/misc/vtd.txt
--- a/docs/misc/vtd.txt	Mon Nov 28 17:42:40 2011 +0000
+++ b/docs/misc/vtd.txt	Tue Nov 29 13:53:31 2011 +0000
@@ -184,7 +184,7 @@
 - HP Compaq:  DC7800
 http://h10010.www1.hp.com/wwpc/us/en/en/WF04a/12454-12454-64287-321860-3328898.html
 
-For more information, pls refer to http://wiki.xensource.com/xenwiki/VTdHowTo.
+For more information, pls refer to http://wiki.xen.org/wiki/VTdHowTo.
 
 
 Assigning devices to HVM domains
diff -r a2cb7ed6d0a2 -r 2d18642355d4 docs/misc/xenstore.txt
--- a/docs/misc/xenstore.txt	Mon Nov 28 17:42:40 2011 +0000
+++ b/docs/misc/xenstore.txt	Tue Nov 29 13:53:31 2011 +0000
@@ -159,7 +159,7 @@
 		r<domid>	read only
 		b<domid>	both read and write
 		n<domid>	no access
-	See http://wiki.xensource.com/xenwiki/XenBus section
+	See http://wiki.xen.org/wiki/XenBus section
 	`Permissions' for details of the permissions system.
 
 ---------- Watches ----------
diff -r a2cb7ed6d0a2 -r 2d18642355d4 docs/misc/xl-network-configuration.markdown
--- a/docs/misc/xl-network-configuration.markdown	Mon Nov 28 17:42:40 2011 +0000
+++ b/docs/misc/xl-network-configuration.markdown	Tue Nov 29 13:53:31 2011 +0000
@@ -123,4 +123,4 @@
 driver domain which is outside the scope of this document.
 
 [oui]: http://en.wikipedia.org/wiki/Organizationally_Unique_Identifier
-[net]: http://wiki.xen.org/xenwiki/HostConfiguration/Networking
+[net]: http://wiki.xen.org/wiki/HostConfiguration/Networking
diff -r a2cb7ed6d0a2 -r 2d18642355d4 docs/src/interface.tex
--- a/docs/src/interface.tex	Mon Nov 28 17:42:40 2011 +0000
+++ b/docs/src/interface.tex	Tue Nov 29 13:53:31 2011 +0000
@@ -1579,7 +1579,7 @@
 documentation, including the latest version of the FAQ.
 
 Information regarding Xen is also available at the Xen Wiki at
-\begin{quote} {\tt http://wiki.xensource.com/xenwiki/}\end{quote}
+\begin{quote} {\tt http://wiki.xen.org/wiki/}\end{quote}
 The Xen project uses Bugzilla as its bug tracking system. You'll find
 the Xen Bugzilla at http://bugzilla.xensource.com/bugzilla/.
 
diff -r a2cb7ed6d0a2 -r 2d18642355d4 docs/src/user.tex
--- a/docs/src/user.tex	Mon Nov 28 17:42:40 2011 +0000
+++ b/docs/src/user.tex	Tue Nov 29 13:53:31 2011 +0000
@@ -2349,7 +2349,7 @@
 documentation, including the latest version of the FAQ.
 
 Information regarding Xen is also available at the Xen Wiki at
-\begin{quote} {\tt http://wiki.xensource.com/xenwiki/}\end{quote}
+\begin{quote} {\tt http://wiki.xen.org/wiki/}\end{quote}
 The Xen project uses Bugzilla as its bug tracking system. You'll find
 the Xen Bugzilla at http://bugzilla.xensource.com/bugzilla/.
 
diff -r a2cb7ed6d0a2 -r 2d18642355d4 tools/libxl/libxlu_cfg.c
--- a/tools/libxl/libxlu_cfg.c	Mon Nov 28 17:42:40 2011 +0000
+++ b/tools/libxl/libxlu_cfg.c	Tue Nov 29 13:53:31 2011 +0000
@@ -72,7 +72,7 @@
         fputs(
  "warning: Config file looks like it contains Python code.\n"
  "warning:  Arbitrary Python is no longer supported.\n"
- "warning:  See http://wiki.xen.org/xenwiki/PythonInXlConfig\n",
+ "warning:  See http://wiki.xen.org/wiki/PythonInXlConfig\n",
               ctx->cfg->report);
     }
 }
diff -r a2cb7ed6d0a2 -r 2d18642355d4 xen/common/sched_credit2.c
--- a/xen/common/sched_credit2.c	Mon Nov 28 17:42:40 2011 +0000
+++ b/xen/common/sched_credit2.c	Tue Nov 29 13:53:31 2011 +0000
@@ -51,7 +51,7 @@
 /*
  * WARNING: This is still in an experimental phase.  Status and work can be found at the
  * credit2 wiki page:
- *  http://wiki.xensource.com/xenwiki/Credit2_Scheduler_Development
+ *  http://wiki.xen.org/wiki/Credit2_Scheduler_Development
  * TODO:
  * + Immediate bug-fixes
  *  - Do per-runqueue, grab proper lock for dump debugkey

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:28 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY73-0006SL-BQ; Wed, 30 Nov 2011 00:33:25 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY71-0006QN-Pe
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-27.messagelabs.com!1322613117!58828953!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8077 invoked from network); 30 Nov 2011 00:31:58 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Nov 2011 00:31:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVYCq-0003uc-Jq
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6o-0003ji-8L
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:10 +0000
Message-Id: <E1RVY6o-0003ji-8L@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl: the name field in a guest config
	file is mandatory
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322576247 0
# Node ID bc1c875585f580e0a5c1483f8597141bbdb74b4f
# Parent  545cd3210f245305c77b143e27d48d93d0efc7c3
xl: the name field in a guest config file is mandatory

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


diff -r 545cd3210f24 -r bc1c875585f5 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Tue Nov 29 14:17:27 2011 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Tue Nov 29 14:17:27 2011 +0000
@@ -575,8 +575,10 @@
     if (!xlu_cfg_get_long (config, "hap", &l))
         c_info->hap = l;
 
-    if (xlu_cfg_replace_string (config, "name", &c_info->name))
-        c_info->name = strdup("test");
+    if (xlu_cfg_replace_string (config, "name", &c_info->name)) {
+        fprintf(stderr, "Domain name must be specified.");
+        exit(1);
+    }
 
     if (!xlu_cfg_get_string (config, "uuid", &buf) ) {
         if ( libxl_uuid_from_string(&c_info->uuid, buf) ) {

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:28 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY73-0006SQ-Dz; Wed, 30 Nov 2011 00:33:25 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY72-0006QP-0d
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-21.messagelabs.com!1322613165!17511!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.6 required=7.0 tests=DIET_1
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7902 invoked from network); 30 Nov 2011 00:32:46 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Nov 2011 00:32:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVYCs-0003ul-1s
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6p-0003kR-PP
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:11 +0000
Message-Id: <E1RVY6p-0003kR-PP@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: remove non-breaking spaces
	from sedf_scheduler_mini-HOWTO.txt
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============5551159077598973004=="
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

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

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322579898 0
# Node ID e203d31a7236d60f4e0545d0efd500d38a37dbe7
# Parent  83484bd28cb2c3d82ac640dc267ed0c5a001dafa
docs: remove non-breaking spaces from sedf_scheduler_mini-HOWTO.txt

This document contains several 0xa0 characters (non-breaking spaces). These do
not display correctly in (some) terminals or when the document is rendered by (some)
browsers. Re-encode them as spaces.

I'm not confident that this change will make it through being encoded as a patch
and sent through email. Its effect can be replicated with:

	perl -i -p -e 's/\xa0/ /g' docs/misc/sedf_scheduler_mini-HOWTO.txt

[ I ran the rune rather than trying to apply the patch -iwj ]

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


diff -r 83484bd28cb2 -r e203d31a7236 docs/misc/sedf_scheduler_mini-HOWTO.txt
--- a/docs/misc/sedf_scheduler_mini-HOWTO.txt	Tue Nov 29 14:17:27 2011 +0000
+++ b/docs/misc/sedf_scheduler_mini-HOWTO.txt	Tue Nov 29 15:18:18 2011 +0000
@@ -8,37 +8,37 @@
   uses realtime-algorithms to ensure time guarantees.
 
 Usage:
-   -add "sched=sedf" on Xen's boot command-line
-   -create domains as usual
-   -use "xm sched-sedf <dom-id> <period> <slice> <latency-hint> <extra> <weight>"
-    Where:
-      -period/slice are the normal EDF scheduling parameters in nanosecs
-      -latency-hint is the scaled period in case the domain is doing heavy I/O
+   -add "sched=sedf" on Xen's boot command-line
+   -create domains as usual
+   -use "xm sched-sedf <dom-id> <period> <slice> <latency-hint> <extra> <weight>"
+    Where:
+      -period/slice are the normal EDF scheduling parameters in nanosecs
+      -latency-hint is the scaled period in case the domain is doing heavy I/O
          (unused by the currently compiled version)
-      -extra is a flag (0/1), which controls whether the domain can run in
+      -extra is a flag (0/1), which controls whether the domain can run in
        extra-time
-      -weight is mutually exclusive with period/slice and specifies another
+      -weight is mutually exclusive with period/slice and specifies another
        way of setting a domains cpu slice
 
 Examples:
- normal EDF (20ms/5ms):
-  xm sched-sedf <dom-id> 20000000 5000000 0 0 0
+ normal EDF (20ms/5ms):
+  xm sched-sedf <dom-id> 20000000 5000000 0 0 0
   
- best-effort domains (i.e. non-realtime):
-  xm sched-sedf <dom-id> 20000000 0 0 1 0
- 
+ best-effort domains (i.e. non-realtime):
+  xm sched-sedf <dom-id> 20000000 0 0 1 0
+ 
  normal EDF (20ms/5ms) + share of extra-time:
-  xm sched-sedf <dom-id> 20000000 5000000 0 1 0
+  xm sched-sedf <dom-id> 20000000 5000000 0 1 0
   
- 4 domains with weights 2:3:4:2
-  xm sched-sedf <d1> 0 0 0 0 2
-  xm sched-sedf <d2> 0 0 0 0 3
-  xm sched-sedf <d3> 0 0 0 0 4
-  xm sched-sedf <d4> 0 0 0 0 2
+ 4 domains with weights 2:3:4:2
+  xm sched-sedf <d1> 0 0 0 0 2
+  xm sched-sedf <d2> 0 0 0 0 3
+  xm sched-sedf <d3> 0 0 0 0 4
+  xm sched-sedf <d4> 0 0 0 0 2
   
- 1 fully-specified (10ms/3ms) domain, 3 other domains share
- available rest in 2:7:3 ratio:
-  xm sched-sedf <d1> 10000000 3000000 0 0 0
-  xm sched-sedf <d2> 0 0 0 0 2
-  xm sched-sedf <d3> 0 0 0 0 7
-  xm sched-sedf <d4> 0 0 0 0 3
+ 1 fully-specified (10ms/3ms) domain, 3 other domains share
+ available rest in 2:7:3 ratio:
+  xm sched-sedf <d1> 10000000 3000000 0 0 0
+  xm sched-sedf <d2> 0 0 0 0 2
+  xm sched-sedf <d3> 0 0 0 0 7
+  xm sched-sedf <d4> 0 0 0 0 3


--===============5551159077598973004==
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.xensource.com
http://lists.xensource.com/xen-changelog
--===============5551159077598973004==--

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:28 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY73-0006SQ-Dz; Wed, 30 Nov 2011 00:33:25 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY72-0006QP-0d
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-21.messagelabs.com!1322613165!17511!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.6 required=7.0 tests=DIET_1
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7902 invoked from network); 30 Nov 2011 00:32:46 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Nov 2011 00:32:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVYCs-0003ul-1s
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6p-0003kR-PP
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:11 +0000
Message-Id: <E1RVY6p-0003kR-PP@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: remove non-breaking spaces
	from sedf_scheduler_mini-HOWTO.txt
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============5551159077598973004=="
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

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

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322579898 0
# Node ID e203d31a7236d60f4e0545d0efd500d38a37dbe7
# Parent  83484bd28cb2c3d82ac640dc267ed0c5a001dafa
docs: remove non-breaking spaces from sedf_scheduler_mini-HOWTO.txt

This document contains several 0xa0 characters (non-breaking spaces). These do
not display correctly in (some) terminals or when the document is rendered by (some)
browsers. Re-encode them as spaces.

I'm not confident that this change will make it through being encoded as a patch
and sent through email. Its effect can be replicated with:

	perl -i -p -e 's/\xa0/ /g' docs/misc/sedf_scheduler_mini-HOWTO.txt

[ I ran the rune rather than trying to apply the patch -iwj ]

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


diff -r 83484bd28cb2 -r e203d31a7236 docs/misc/sedf_scheduler_mini-HOWTO.txt
--- a/docs/misc/sedf_scheduler_mini-HOWTO.txt	Tue Nov 29 14:17:27 2011 +0000
+++ b/docs/misc/sedf_scheduler_mini-HOWTO.txt	Tue Nov 29 15:18:18 2011 +0000
@@ -8,37 +8,37 @@
   uses realtime-algorithms to ensure time guarantees.
 
 Usage:
-   -add "sched=sedf" on Xen's boot command-line
-   -create domains as usual
-   -use "xm sched-sedf <dom-id> <period> <slice> <latency-hint> <extra> <weight>"
-    Where:
-      -period/slice are the normal EDF scheduling parameters in nanosecs
-      -latency-hint is the scaled period in case the domain is doing heavy I/O
+   -add "sched=sedf" on Xen's boot command-line
+   -create domains as usual
+   -use "xm sched-sedf <dom-id> <period> <slice> <latency-hint> <extra> <weight>"
+    Where:
+      -period/slice are the normal EDF scheduling parameters in nanosecs
+      -latency-hint is the scaled period in case the domain is doing heavy I/O
          (unused by the currently compiled version)
-      -extra is a flag (0/1), which controls whether the domain can run in
+      -extra is a flag (0/1), which controls whether the domain can run in
        extra-time
-      -weight is mutually exclusive with period/slice and specifies another
+      -weight is mutually exclusive with period/slice and specifies another
        way of setting a domains cpu slice
 
 Examples:
- normal EDF (20ms/5ms):
-  xm sched-sedf <dom-id> 20000000 5000000 0 0 0
+ normal EDF (20ms/5ms):
+  xm sched-sedf <dom-id> 20000000 5000000 0 0 0
   
- best-effort domains (i.e. non-realtime):
-  xm sched-sedf <dom-id> 20000000 0 0 1 0
- 
+ best-effort domains (i.e. non-realtime):
+  xm sched-sedf <dom-id> 20000000 0 0 1 0
+ 
  normal EDF (20ms/5ms) + share of extra-time:
-  xm sched-sedf <dom-id> 20000000 5000000 0 1 0
+  xm sched-sedf <dom-id> 20000000 5000000 0 1 0
   
- 4 domains with weights 2:3:4:2
-  xm sched-sedf <d1> 0 0 0 0 2
-  xm sched-sedf <d2> 0 0 0 0 3
-  xm sched-sedf <d3> 0 0 0 0 4
-  xm sched-sedf <d4> 0 0 0 0 2
+ 4 domains with weights 2:3:4:2
+  xm sched-sedf <d1> 0 0 0 0 2
+  xm sched-sedf <d2> 0 0 0 0 3
+  xm sched-sedf <d3> 0 0 0 0 4
+  xm sched-sedf <d4> 0 0 0 0 2
   
- 1 fully-specified (10ms/3ms) domain, 3 other domains share
- available rest in 2:7:3 ratio:
-  xm sched-sedf <d1> 10000000 3000000 0 0 0
-  xm sched-sedf <d2> 0 0 0 0 2
-  xm sched-sedf <d3> 0 0 0 0 7
-  xm sched-sedf <d4> 0 0 0 0 3
+ 1 fully-specified (10ms/3ms) domain, 3 other domains share
+ available rest in 2:7:3 ratio:
+  xm sched-sedf <d1> 10000000 3000000 0 0 0
+  xm sched-sedf <d2> 0 0 0 0 2
+  xm sched-sedf <d3> 0 0 0 0 7
+  xm sched-sedf <d4> 0 0 0 0 3


--===============5551159077598973004==
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.xensource.com
http://lists.xensource.com/xen-changelog
--===============5551159077598973004==--

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:28 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY73-0006SL-BQ; Wed, 30 Nov 2011 00:33:25 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY71-0006QN-Pe
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-27.messagelabs.com!1322613117!58828953!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8077 invoked from network); 30 Nov 2011 00:31:58 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Nov 2011 00:31:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVYCq-0003uc-Jq
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6o-0003ji-8L
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:10 +0000
Message-Id: <E1RVY6o-0003ji-8L@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl: the name field in a guest config
	file is mandatory
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322576247 0
# Node ID bc1c875585f580e0a5c1483f8597141bbdb74b4f
# Parent  545cd3210f245305c77b143e27d48d93d0efc7c3
xl: the name field in a guest config file is mandatory

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


diff -r 545cd3210f24 -r bc1c875585f5 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Tue Nov 29 14:17:27 2011 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Tue Nov 29 14:17:27 2011 +0000
@@ -575,8 +575,10 @@
     if (!xlu_cfg_get_long (config, "hap", &l))
         c_info->hap = l;
 
-    if (xlu_cfg_replace_string (config, "name", &c_info->name))
-        c_info->name = strdup("test");
+    if (xlu_cfg_replace_string (config, "name", &c_info->name)) {
+        fprintf(stderr, "Domain name must be specified.");
+        exit(1);
+    }
 
     if (!xlu_cfg_get_string (config, "uuid", &buf) ) {
         if ( libxl_uuid_from_string(&c_info->uuid, buf) ) {

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:29 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY6y-0006Qs-V5; Wed, 30 Nov 2011 00:33: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 1RVY6x-0006QW-JO
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-27.messagelabs.com!1322613121!55384480!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3789 invoked from network); 30 Nov 2011 00:32:02 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Nov 2011 00:32:02 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVYCr-0003ui-OT
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6p-0003kC-9R
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:11 +0000
Message-Id: <E1RVY6p-0003kC-9R@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: use named options for
	tsc_mode.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322576247 0
# Node ID 83484bd28cb2c3d82ac640dc267ed0c5a001dafa
# Parent  311982097842a03340556838f43e24db9a402dca
libxl: use named options for tsc_mode.

Add an enum at the libxl level with a hopefully descriptive set of names.
Deprecate the use of an integer in xl cfg files.

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


diff -r 311982097842 -r 83484bd28cb2 docs/man/xl.cfg.pod.5
--- a/docs/man/xl.cfg.pod.5	Tue Nov 29 14:17:27 2011 +0000
+++ b/docs/man/xl.cfg.pod.5	Tue Nov 29 14:17:27 2011 +0000
@@ -491,11 +491,45 @@
 
 =item B<tsc_mode="MODE">
 
+
 Specifies how the TSC (Time Stamp Counter) should be provided to the
-guest.  XXX ???
+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.
+
 =head3 Support for Paravirtualisation of HVM Guests
 
 The following options allow Paravirtualised features (such as devices)
diff -r 311982097842 -r 83484bd28cb2 tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c	Tue Nov 29 14:17:27 2011 +0000
+++ b/tools/libxl/libxl_dom.c	Tue Nov 29 14:17:27 2011 +0000
@@ -73,12 +73,29 @@
               libxl_domain_build_info *info, libxl__domain_build_state *state)
 {
     libxl_ctx *ctx = libxl__gc_owner(gc);
+    int tsc_mode;
     xc_domain_max_vcpus(ctx->xch, domid, info->max_vcpus);
     xc_domain_setmaxmem(ctx->xch, domid, info->target_memkb + LIBXL_MAXMEM_CONSTANT);
     if (info->type == LIBXL_DOMAIN_TYPE_PV)
         xc_domain_set_memmap_limit(ctx->xch, domid,
                 (info->max_memkb + info->u.pv.slack_memkb));
-    xc_domain_set_tsc_info(ctx->xch, domid, info->tsc_mode, 0, 0, 0);
+    switch (info->tsc_mode) {
+    case LIBXL_TSC_MODE_DEFAULT:
+        tsc_mode = 0;
+        break;
+    case LIBXL_TSC_MODE_ALWAYS_EMULATE:
+        tsc_mode = 1;
+        break;
+    case LIBXL_TSC_MODE_NATIVE:
+        tsc_mode = 2;
+        break;
+    case LIBXL_TSC_MODE_NATIVE_PARAVIRT:
+        tsc_mode = 3;
+        break;
+    default:
+        abort();
+    }
+    xc_domain_set_tsc_info(ctx->xch, domid, tsc_mode, 0, 0, 0);
     if ( info->disable_migrate )
         xc_domain_disable_migrate(ctx->xch, domid);
 
diff -r 311982097842 -r 83484bd28cb2 tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Tue Nov 29 14:17:27 2011 +0000
+++ b/tools/libxl/libxl_types.idl	Tue Nov 29 14:17:27 2011 +0000
@@ -85,6 +85,13 @@
     (2, "SLEEP"),
     ])
 
+libxl_tsc_mode = Enumeration("tsc_mode", [
+    (0, "default"),
+    (1, "always_emulate"),
+    (2, "native"),
+    (3, "native_paravirt"),
+    ])
+
 #
 # Complex libxl types
 #
@@ -154,7 +161,7 @@
 libxl_domain_build_info = Struct("domain_build_info",[
     ("max_vcpus",       integer),
     ("cur_vcpus",       integer),
-    ("tsc_mode",        integer),
+    ("tsc_mode",        libxl_tsc_mode),
     ("max_memkb",       uint32),
     ("target_memkb",    uint32),
     ("video_memkb",     uint32),
diff -r 311982097842 -r 83484bd28cb2 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Tue Nov 29 14:17:27 2011 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Tue Nov 29 14:17:27 2011 +0000
@@ -328,7 +328,7 @@
 
     printf("\t(build_info)\n");
     printf("\t(max_vcpus %d)\n", b_info->max_vcpus);
-    printf("\t(tsc_mode %d)\n", b_info->tsc_mode);
+    printf("\t(tsc_mode %s)\n", libxl_tsc_mode_to_string(b_info->tsc_mode));
     printf("\t(max_memkb %d)\n", b_info->max_memkb);
     printf("\t(target_memkb %d)\n", b_info->target_memkb);
     printf("\t(nomigrate %d)\n", b_info->disable_migrate);
@@ -662,8 +662,28 @@
     if (!xlu_cfg_get_long (config, "nomigrate", &l, 0))
         b_info->disable_migrate = l;
 
-    if (!xlu_cfg_get_long(config, "tsc_mode", &l, 0))
+    if (!xlu_cfg_get_long(config, "tsc_mode", &l, 1)) {
+        const char *s = libxl_tsc_mode_to_string(l);
+        fprintf(stderr, "WARNING: specifying \"tsc_mode\" as an integer is deprecated. "
+                "Please use the named parameter variant. %s%s%s\n",
+                s ? "e.g. tsc_mode=\"" : "",
+                s ? s : "",
+                s ? "\"" : "");
+
+        if (l < LIBXL_TSC_MODE_DEFAULT ||
+            l > LIBXL_TSC_MODE_NATIVE_PARAVIRT) {
+            fprintf(stderr, "ERROR: invalid value %ld for \"tsc_mode\"\n", l);
+            exit (1);
+        }
         b_info->tsc_mode = l;
+    } else if (!xlu_cfg_get_string(config, "tsc_mode", &buf, 0)) {
+        fprintf(stderr, "got a tsc mode string: \"%s\"\n", buf);
+        if (libxl_tsc_mode_from_string(buf, &b_info->tsc_mode)) {
+            fprintf(stderr, "ERROR: invalid value \"%s\" for \"tsc_mode\"\n",
+                    buf);
+            exit (1);
+        }
+    }
 
     if (!xlu_cfg_get_long (config, "videoram", &l, 0))
         b_info->video_memkb = l * 1024;

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:29 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY6y-0006Qs-V5; Wed, 30 Nov 2011 00:33: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 1RVY6x-0006QW-JO
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-27.messagelabs.com!1322613121!55384480!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3789 invoked from network); 30 Nov 2011 00:32:02 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Nov 2011 00:32:02 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVYCr-0003ui-OT
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6p-0003kC-9R
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:11 +0000
Message-Id: <E1RVY6p-0003kC-9R@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: use named options for
	tsc_mode.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322576247 0
# Node ID 83484bd28cb2c3d82ac640dc267ed0c5a001dafa
# Parent  311982097842a03340556838f43e24db9a402dca
libxl: use named options for tsc_mode.

Add an enum at the libxl level with a hopefully descriptive set of names.
Deprecate the use of an integer in xl cfg files.

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


diff -r 311982097842 -r 83484bd28cb2 docs/man/xl.cfg.pod.5
--- a/docs/man/xl.cfg.pod.5	Tue Nov 29 14:17:27 2011 +0000
+++ b/docs/man/xl.cfg.pod.5	Tue Nov 29 14:17:27 2011 +0000
@@ -491,11 +491,45 @@
 
 =item B<tsc_mode="MODE">
 
+
 Specifies how the TSC (Time Stamp Counter) should be provided to the
-guest.  XXX ???
+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.
+
 =head3 Support for Paravirtualisation of HVM Guests
 
 The following options allow Paravirtualised features (such as devices)
diff -r 311982097842 -r 83484bd28cb2 tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c	Tue Nov 29 14:17:27 2011 +0000
+++ b/tools/libxl/libxl_dom.c	Tue Nov 29 14:17:27 2011 +0000
@@ -73,12 +73,29 @@
               libxl_domain_build_info *info, libxl__domain_build_state *state)
 {
     libxl_ctx *ctx = libxl__gc_owner(gc);
+    int tsc_mode;
     xc_domain_max_vcpus(ctx->xch, domid, info->max_vcpus);
     xc_domain_setmaxmem(ctx->xch, domid, info->target_memkb + LIBXL_MAXMEM_CONSTANT);
     if (info->type == LIBXL_DOMAIN_TYPE_PV)
         xc_domain_set_memmap_limit(ctx->xch, domid,
                 (info->max_memkb + info->u.pv.slack_memkb));
-    xc_domain_set_tsc_info(ctx->xch, domid, info->tsc_mode, 0, 0, 0);
+    switch (info->tsc_mode) {
+    case LIBXL_TSC_MODE_DEFAULT:
+        tsc_mode = 0;
+        break;
+    case LIBXL_TSC_MODE_ALWAYS_EMULATE:
+        tsc_mode = 1;
+        break;
+    case LIBXL_TSC_MODE_NATIVE:
+        tsc_mode = 2;
+        break;
+    case LIBXL_TSC_MODE_NATIVE_PARAVIRT:
+        tsc_mode = 3;
+        break;
+    default:
+        abort();
+    }
+    xc_domain_set_tsc_info(ctx->xch, domid, tsc_mode, 0, 0, 0);
     if ( info->disable_migrate )
         xc_domain_disable_migrate(ctx->xch, domid);
 
diff -r 311982097842 -r 83484bd28cb2 tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Tue Nov 29 14:17:27 2011 +0000
+++ b/tools/libxl/libxl_types.idl	Tue Nov 29 14:17:27 2011 +0000
@@ -85,6 +85,13 @@
     (2, "SLEEP"),
     ])
 
+libxl_tsc_mode = Enumeration("tsc_mode", [
+    (0, "default"),
+    (1, "always_emulate"),
+    (2, "native"),
+    (3, "native_paravirt"),
+    ])
+
 #
 # Complex libxl types
 #
@@ -154,7 +161,7 @@
 libxl_domain_build_info = Struct("domain_build_info",[
     ("max_vcpus",       integer),
     ("cur_vcpus",       integer),
-    ("tsc_mode",        integer),
+    ("tsc_mode",        libxl_tsc_mode),
     ("max_memkb",       uint32),
     ("target_memkb",    uint32),
     ("video_memkb",     uint32),
diff -r 311982097842 -r 83484bd28cb2 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Tue Nov 29 14:17:27 2011 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Tue Nov 29 14:17:27 2011 +0000
@@ -328,7 +328,7 @@
 
     printf("\t(build_info)\n");
     printf("\t(max_vcpus %d)\n", b_info->max_vcpus);
-    printf("\t(tsc_mode %d)\n", b_info->tsc_mode);
+    printf("\t(tsc_mode %s)\n", libxl_tsc_mode_to_string(b_info->tsc_mode));
     printf("\t(max_memkb %d)\n", b_info->max_memkb);
     printf("\t(target_memkb %d)\n", b_info->target_memkb);
     printf("\t(nomigrate %d)\n", b_info->disable_migrate);
@@ -662,8 +662,28 @@
     if (!xlu_cfg_get_long (config, "nomigrate", &l, 0))
         b_info->disable_migrate = l;
 
-    if (!xlu_cfg_get_long(config, "tsc_mode", &l, 0))
+    if (!xlu_cfg_get_long(config, "tsc_mode", &l, 1)) {
+        const char *s = libxl_tsc_mode_to_string(l);
+        fprintf(stderr, "WARNING: specifying \"tsc_mode\" as an integer is deprecated. "
+                "Please use the named parameter variant. %s%s%s\n",
+                s ? "e.g. tsc_mode=\"" : "",
+                s ? s : "",
+                s ? "\"" : "");
+
+        if (l < LIBXL_TSC_MODE_DEFAULT ||
+            l > LIBXL_TSC_MODE_NATIVE_PARAVIRT) {
+            fprintf(stderr, "ERROR: invalid value %ld for \"tsc_mode\"\n", l);
+            exit (1);
+        }
         b_info->tsc_mode = l;
+    } else if (!xlu_cfg_get_string(config, "tsc_mode", &buf, 0)) {
+        fprintf(stderr, "got a tsc mode string: \"%s\"\n", buf);
+        if (libxl_tsc_mode_from_string(buf, &b_info->tsc_mode)) {
+            fprintf(stderr, "ERROR: invalid value \"%s\" for \"tsc_mode\"\n",
+                    buf);
+            exit (1);
+        }
+    }
 
     if (!xlu_cfg_get_long (config, "videoram", &l, 0))
         b_info->video_memkb = l * 1024;

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:29 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY73-0006Sh-Je; Wed, 30 Nov 2011 00:33:25 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY72-0006QX-HN
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-21.messagelabs.com!1322613165!6271664!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22212 invoked from network); 30 Nov 2011 00:32:46 -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;
	30 Nov 2011 00:32:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVYCs-0003uo-HG
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6q-0003kg-8i
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:12 +0000
Message-Id: <E1RVY6q-0003kg-8i@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: tweak markup and wording of
	qemu upstream doc slightly
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322576247 0
# Node ID faa863f0343f5e6e7dc813227bfd03a8cd04bfe7
# Parent  e203d31a7236d60f4e0545d0efd500d38a37dbe7
docs: tweak markup and wording of qemu upstream doc slightly

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


diff -r e203d31a7236 -r faa863f0343f docs/misc/qemu-upstream_howto_use_it.markdown
--- a/docs/misc/qemu-upstream_howto_use_it.markdown	Tue Nov 29 15:18:18 2011 +0000
+++ b/docs/misc/qemu-upstream_howto_use_it.markdown	Tue Nov 29 14:17:27 2011 +0000
@@ -1,11 +1,11 @@
-Help to use QEMU (upstream version) with Xen
-============================================
+Using Upstream QEMU with Xen
+============================
 
 Note
 ----
 
 All these steps will become unnecessary after the patches to integrate
-SeaBIOS/QEMU build will be applied.
+SeaBIOS/QEMU into the Xen build system have been applied.
 
 
 How to build it
@@ -15,14 +15,15 @@
 
 The new device-model needs a different BIOS, SeaBIOS. Clone the repository from:
 
-  - git://git.qemu.org/seabios.git
-  - http://git.qemu.org/git/seabios.git
+  - [git://git.qemu.org/seabios.git]()
+  - [http://git.qemu.org/git/seabios.git]()
 
-Put the `.config` file in the appendix at the root of seabios.git and build SeaBIOS.
+Put the `.config` file in the appendix at the root of `seabios.git`
+and build SeaBIOS by typing `make`.
 
-In xen-unstable source tree, add the file `.config` with
+In the xen-unstable source tree, add the file `.config` with
 `SEABIOS_DIR = /path/to/seabios.git`.
-To build hvmloader with SeaBIOS, you propably need to `make -C tools/firmware
+To build hvmloader with SeaBIOS, you probably need to `make -C tools/firmware
 clean` first and then `make tools`, to use the new SEABIOS_DIR parameter.
 
 
@@ -30,10 +31,10 @@
 
 Get QEMU upstream source from:
 
-  - git://xenbits.xensource.com/qemu-upstream-unstable.git
-  - http://xenbits.xensource.com/git-http/qemu-upstream-unstable.git
+  - [git://xenbits.xensource.com/qemu-upstream-unstable.git]()
+  - [http://xenbits.xensource.com/git-http/qemu-upstream-unstable.git]()
 
-To configure build QEMU upstream with Xen
+To configure QEMU upstream with support for Xen:
 
     ./configure --enable-xen --target-list=i386-softmmu --extra-cflags="-I$path_to_xen_source/tools/include -I$path_to_xen_source/tools/libxc -I$path_to_xen_source/tools/xenstore" --extra-ldflags="-L$path_to_xen_source/tools/libxc -L$path_to_xen_source/tools/xenstore"
 
@@ -43,15 +44,15 @@
 How to use QEMU upstream
 ------------------------
 
-Only xl support QEMU upstream.
+Only `xl` supports QEMU upstream.
 
 To actually use it, add or change this in your VM configuration file:
 
     device_model_version = 'qemu-xen'
     device_model_override = '/path/to/qemu/i386-softmmu/qemu'
 
-NB: On qemu-upstream repository, the default binary name has been renamed to
-`qemu-system-i386`.
+NB: In the `qemu-upstream` repository, the default binary name has been
+renamed to `qemu-system-i386`.
 
 
 Appendix

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:29 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY75-0006Tn-2f; Wed, 30 Nov 2011 00:33:27 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY74-0006Qp-7a
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:26 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-216.messagelabs.com!1322613166!5509612!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 422 invoked from network); 30 Nov 2011 00:32:47 -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;
	30 Nov 2011 00:32:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVYCt-0003uu-Ki
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6r-0003lA-8t
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:13 +0000
Message-Id: <E1RVY6r-0003lA-8t@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: move user and interface .tex
	documents under reference.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322576247 0
# Node ID 0c59c853135c6dbb4c9cd787657a18a65f388887
# Parent  b30064469a0355cbec71983b16139df19d0d6dca
docs: move user and interface .tex documents under reference.

Taking over the top level "user" entry with a relatively obsolete document is a
bit of an annoyance but these docs are not so out of date that they should be
deleted. Move them out of the top-level instead.

(the original motivation here was to allow for user/xl-domain-cfg.markdown but
we have since decided to go with man/xl.cfg.pod.5 instead so perhaps this is a
waste of time)

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


diff -r b30064469a03 -r 0c59c853135c docs/INDEX
--- a/docs/INDEX	Tue Nov 29 14:17:27 2011 +0000
+++ b/docs/INDEX	Tue Nov 29 14:17:27 2011 +0000
@@ -1,5 +1,5 @@
 misc/hvm-emulated-unplug	Xen HVM emulated device unplug protocol
 
 # These are not all that useful anymore, hide them from the index
-interface/index			NO-INDEX
-user/index			NO-INDEX
+reference/interface/index	NO-INDEX
+reference/user/index		NO-INDEX
diff -r b30064469a03 -r 0c59c853135c docs/Makefile
--- a/docs/Makefile	Tue Nov 29 14:17:27 2011 +0000
+++ b/docs/Makefile	Tue Nov 29 14:17:27 2011 +0000
@@ -14,7 +14,7 @@
 DOC_MARKDOWN	:= $(wildcard misc/*.markdown)
 DOC_PS		:= $(patsubst src/%.tex,ps/%.ps,$(DOC_TEX))
 DOC_PDF		:= $(patsubst src/%.tex,pdf/%.pdf,$(DOC_TEX))
-DOC_HTML	:= $(patsubst src/%.tex,html/%/index.html,$(DOC_TEX)) \
+DOC_HTML	:= $(patsubst src/%.tex,html/reference/%/index.html,$(DOC_TEX)) \
 		   $(patsubst %.markdown,html/%.html,$(DOC_MARKDOWN)) \
 		   $(patsubst man/%.pod.1,html/man/%.1.html,$(DOC_MAN1SRC)) \
 		   $(patsubst man/%.pod.5,html/man/%.5.html,$(DOC_MAN5SRC))
@@ -119,14 +119,14 @@
 %.eps: %.fig
 	$(FIG2DEV) -L eps $< $@
 
-html/%/index.html: src/%.tex
+html/reference/%/index.html: src/%.tex
 	@$(INSTALL_DIR) $(@D)
 	@set -e ; if which $(LATEX2HTML) 1>/dev/null 2>/dev/null; then \
-        echo "Running latex2html to generate $*/index.html ... "; \
+        echo "Running latex2html to generate reference/$*/index.html ... "; \
 	$(LATEX2HTML) -split 0 -show_section_numbers -toc_depth 3 -nonavigation \
 	-numbered_footnotes -local_icons -noinfo -math -dir $(@D) \
 	$< 1>/dev/null 2>/dev/null ; else \
-	echo "latex2html not installed; skipping $*."; fi
+	echo "latex2html not installed; skipping reference/$*."; fi
 
 html/index.html: $(DOC_HTML) ./gen-html-index INDEX
 	perl -w -- ./gen-html-index -i INDEX html $(DOC_HTML)

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:29 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY73-0006Sh-Je; Wed, 30 Nov 2011 00:33:25 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY72-0006QX-HN
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-21.messagelabs.com!1322613165!6271664!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22212 invoked from network); 30 Nov 2011 00:32:46 -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;
	30 Nov 2011 00:32:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVYCs-0003uo-HG
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6q-0003kg-8i
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:12 +0000
Message-Id: <E1RVY6q-0003kg-8i@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: tweak markup and wording of
	qemu upstream doc slightly
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322576247 0
# Node ID faa863f0343f5e6e7dc813227bfd03a8cd04bfe7
# Parent  e203d31a7236d60f4e0545d0efd500d38a37dbe7
docs: tweak markup and wording of qemu upstream doc slightly

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


diff -r e203d31a7236 -r faa863f0343f docs/misc/qemu-upstream_howto_use_it.markdown
--- a/docs/misc/qemu-upstream_howto_use_it.markdown	Tue Nov 29 15:18:18 2011 +0000
+++ b/docs/misc/qemu-upstream_howto_use_it.markdown	Tue Nov 29 14:17:27 2011 +0000
@@ -1,11 +1,11 @@
-Help to use QEMU (upstream version) with Xen
-============================================
+Using Upstream QEMU with Xen
+============================
 
 Note
 ----
 
 All these steps will become unnecessary after the patches to integrate
-SeaBIOS/QEMU build will be applied.
+SeaBIOS/QEMU into the Xen build system have been applied.
 
 
 How to build it
@@ -15,14 +15,15 @@
 
 The new device-model needs a different BIOS, SeaBIOS. Clone the repository from:
 
-  - git://git.qemu.org/seabios.git
-  - http://git.qemu.org/git/seabios.git
+  - [git://git.qemu.org/seabios.git]()
+  - [http://git.qemu.org/git/seabios.git]()
 
-Put the `.config` file in the appendix at the root of seabios.git and build SeaBIOS.
+Put the `.config` file in the appendix at the root of `seabios.git`
+and build SeaBIOS by typing `make`.
 
-In xen-unstable source tree, add the file `.config` with
+In the xen-unstable source tree, add the file `.config` with
 `SEABIOS_DIR = /path/to/seabios.git`.
-To build hvmloader with SeaBIOS, you propably need to `make -C tools/firmware
+To build hvmloader with SeaBIOS, you probably need to `make -C tools/firmware
 clean` first and then `make tools`, to use the new SEABIOS_DIR parameter.
 
 
@@ -30,10 +31,10 @@
 
 Get QEMU upstream source from:
 
-  - git://xenbits.xensource.com/qemu-upstream-unstable.git
-  - http://xenbits.xensource.com/git-http/qemu-upstream-unstable.git
+  - [git://xenbits.xensource.com/qemu-upstream-unstable.git]()
+  - [http://xenbits.xensource.com/git-http/qemu-upstream-unstable.git]()
 
-To configure build QEMU upstream with Xen
+To configure QEMU upstream with support for Xen:
 
     ./configure --enable-xen --target-list=i386-softmmu --extra-cflags="-I$path_to_xen_source/tools/include -I$path_to_xen_source/tools/libxc -I$path_to_xen_source/tools/xenstore" --extra-ldflags="-L$path_to_xen_source/tools/libxc -L$path_to_xen_source/tools/xenstore"
 
@@ -43,15 +44,15 @@
 How to use QEMU upstream
 ------------------------
 
-Only xl support QEMU upstream.
+Only `xl` supports QEMU upstream.
 
 To actually use it, add or change this in your VM configuration file:
 
     device_model_version = 'qemu-xen'
     device_model_override = '/path/to/qemu/i386-softmmu/qemu'
 
-NB: On qemu-upstream repository, the default binary name has been renamed to
-`qemu-system-i386`.
+NB: In the `qemu-upstream` repository, the default binary name has been
+renamed to `qemu-system-i386`.
 
 
 Appendix

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:29 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY74-0006TZ-TK; Wed, 30 Nov 2011 00:33:26 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY73-0006Qg-4K
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-174.messagelabs.com!1322613163!3621057!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-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13515 invoked from network); 30 Nov 2011 00:32:44 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Nov 2011 00:32: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 1RVYCq-0003uZ-4l
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6n-0003jT-OK
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:09 +0000
Message-Id: <E1RVY6n-0003jT-OK@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: add a document describing the
	xl cfg file syntax
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322576247 0
# Node ID 545cd3210f245305c77b143e27d48d93d0efc7c3
# Parent  bca64f372e4f76a85a9f0fa9f2a59ded1b6bb206
docs: add a document describing the xl cfg file syntax

Based on an initial version by Ian Jackson.

I believe that all keys are now present in the document although there are are
various omissions in the actual documentation of them. Hopefully however this
covers the majority of the most interesting keys.

Spice section:
Signed-off-by: Zhou Peng <zhoupeng@nfs.iscas.ac.cn>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>

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


diff -r bca64f372e4f -r 545cd3210f24 docs/man/xl.cfg.pod.5
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/man/xl.cfg.pod.5	Tue Nov 29 14:17:27 2011 +0000
@@ -0,0 +1,844 @@
+=head1 NAME
+
+xl.cfg - XL Domain Configuration File Syntax
+
+=head1 SYNOPSIS
+
+ /etc/xen/xldomain
+
+=head1 DESCRIPTION
+
+To create a VM (a domain in Xen terminology, sometimes called a guest)
+with xl requires the provision of a domain config file.  Typically
+these live in `/etc/xen/DOMAIN.cfg` where DOMAIN is the name of the
+domain.
+
+=head1 SYNTAX
+
+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
+any guest type while others relate only to specific guest types
+(e.g. PV or HVM guests).
+
+A value C<VALUE> is one of:
+
+=over 4
+
+=item B<"STRING">
+
+A string, surrounded by either single or double quotes.
+
+=item B<NUMBER>
+
+A number, in either decimal, octal (using a C<0> prefix) or
+hexadecimal (using an C<0x> prefix).
+
+=item B<BOOLEAN>
+
+A C<NUMBER> interpreted as C<False> (C<0>) or C<True> (any other
+value).
+
+=item B<[ VALUE, VALUE, ... ]>
+
+A list of C<VALUES> of the above types. Lists are homogeneous and are
+not nested.
+
+=back
+
+The semantics of each C<KEY> defines which form of C<VALUE> is required.
+
+=head1 OPTIONS
+
+=head2 Mandatory Configuration Items
+
+The following key is mandatory for any guest type:
+
+=over 4
+
+=item B<name="NAME">
+
+Specifies the name of the domain.  Names of domains existing on a
+single host must be unique.
+
+=back
+
+=head2 Selecting Guest Type
+
+=over 4
+
+=item B<builder="generic">
+
+Specifies that this is to be a PV domain. This is the default.
+
+=item B<builder="hvm">
+
+Specifies that this is to be an HVM domain.  That is, a fully
+virtualised computer with emulated BIOS, disk and network peripherals,
+etc.  The default is a PV domain, suitable for hosting Xen-aware guest
+operating systems.
+
+=back
+
+=head2 Global Options
+
+The following options apply to guests of any type.
+
+=over 4
+
+=item B<uuid="UUID">
+
+Specifies the UUID of the domain.  If not specified, a fresh unique
+UUID will be generated.
+
+=item B<pool="CPUPOOLNAME">
+
+Put the guest's vcpus into the named cpu pool.
+
+=item B<vcpus=N>
+
+Start the guest with N vcpus initially online.
+
+=item B<maxvcpus=M>
+
+Allow the guest to bring up a maximum of M vcpus. At start of day if
+`vcpus=N` is less than `maxvcpus=M` then the first `N` vcpus will be
+created online and the remainder will be offline.
+
+=item B<memory=MBYTES>
+
+Start the guest with MBYTES megabytes of RAM.
+
+=item B<on_poweroff="ACTION">
+
+Specifies what should be done with the domain if it shuts itself down.
+The C<ACTION>s are:
+
+=over 4
+
+=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 thenimmediately create a new
+domain with the same configuration as the original
+
+=item B<preserve>
+
+keep the domain.  It can be examined, and later destroyed with `xl
+destroy`.
+
+=item B<coredump-destroy>
+
+write a "coredump" of the domain to F</var/xen/dump/NAME> and then
+destroy the domain.
+
+=item B<coredump-restart>
+
+write a "coredump" of the domain to F</var/xen/dump/NAME> and then
+restart the domain.
+
+=back
+
+The default for C<on_poweroff> is C<destroy>.
+
+=item B<on_reboot="ACTION">
+
+Action to take if the domain shuts down with a reason code requesting
+a reboot.  Default is C<restart>.
+
+=item B<on_watchdog="ACTION">
+
+Action to take if the domain shuts down due to a Xen watchdog timeout.
+Default is C<destroy>.
+
+=item B<on_crash="ACTION">
+
+Action to take if the domain crashes.  Default is C<destroy>.
+
+=item B<seclabel="LABEL">
+
+Assign an XSM security label to this domain.
+
+=back
+
+=head2 Devices
+
+The following options define the paravirtual, emulated and physical
+devices which the guest will contain.
+
+=over 4
+
+=item B<disk=[ "DISK_SPEC_STRING", "DISK_SPEC_STRING", ...]>
+
+Specifies the disks (both emulated disks and Xen virtual block
+devices) which are to be provided to the guest, and what objects on
+the they should map to.  See F<docs/misc/xl-disk-configuration.txt>.
+
+=item B<vif=[ "NET_SPEC_STRING", "NET_SPEC_STRING", ...]>
+
+Specifies the networking provision (both emulated network adapters,
+and Xen virtual interfaces) to provided to the guest.  See
+F<docs/misc/xl-network-configuration.markdown>.
+
+=item B<vfb=[ "VFB_SPEC_STRING", "VFB_SPEC_STRING", ...]>
+
+Specifies the paravirtual framebuffer devices which should be supplied
+to the domain.
+
+This options does not control the emulated graphics card presented to
+an HVM guest. See L<Emulated VGA Graphics Device> below for how to
+configure the emulated device.
+
+Each B<VFB_SPEC_STRING> is a comma-separated list of C<KEY=VALUE>
+settings, from the following list:
+
+=over 4
+
+=item C<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 C<vnclisten="ADDRESS[:DISPLAYNUM]">
+
+Specifies the IP address, and optionally VNC display number, to use.
+
+=item C<vncdisplay=DISPLAYNUM>
+
+Specifies the VNC display number to use.  The actual TCP port number
+will be DISPLAYNUM+5900.
+
+=item C<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 C<vncpasswd="PASSWORD">
+
+Specifies the password for the VNC server.
+
+=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
+
+=item C<opengl=BOOLEAN>
+
+Enable OpenGL acceleration of the SDL display. Only effects machines
+using C<device_model_version="qemu-xen-traditonal"> and only if the
+device-model was compiled with OpenGL support. Disabled by default.
+
+=item C<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 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", ... ]>
+
+Specifies the host PCI devices to passthrough to this guest. Each B<PCI_SPEC_STRING>
+has the form C<[DDDD:]BB:DD.F[@VSLOT],KEY=VALUE,KEY=VALUE,...> where:
+
+=over 4
+
+=item B<DDDD:BB:DD.F>
+
+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
+is zero and it is optional here also. You may specify the function
+(B<F>) as B<*> to indicate all functions.
+
+=item B<@VSLOT>
+
+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?
+
+=item B<KEY=VALUE>
+
+Posible B<KEY>s are:
+
+=over 4
+
+=item B<msitranslate=BOOLEAN>
+
+XXX
+
+=item B<power_mgmt=BOOLEAN>
+
+XXX
+
+=back
+
+=back
+
+=back
+
+=head2 Paravirtualised (PV) Guest Specific Options
+
+The following options apply only to Paravirtual guests.
+
+=over 4
+
+=item B<kernel="PATHNAME">
+
+Load the specified file as the kernel image.  Either B<kernel> or
+B<bootloader> must be specified for PV guests.
+
+=item B<ramdisk="PATHNAME">
+
+Load the specified file as the ramdisk.
+
+=item B<bootloader="PROGRAM">
+
+Run C<PROGRAM> to find the kernel image and ramdisk to use.  Normally
+C<PROGRAM> would be C<pygrub>, which is an emulation of
+grub/grub2/syslinux.
+
+=item B<bootloader_args=STRING>
+
+Append B<STRING> (split into words at whitespace) to the arguments to
+the B<bootloader> program.  XXX this should be a list of strings.
+
+=item B<root="STRING">
+
+Append B<root="STRING"> to the kernel command line (Note: it is guest
+specific what meaning this has).
+
+=item B<extra="STRING">
+
+Append B<STRING> to the kernel command line. Note: it is guest
+specific what meaning this has).
+
+=item B<e820_host=BOOLEAN>
+
+Selects whether to expose the host e820 (memory map) to the guest via
+the virtual e820. When this option is false the guest psuedo-physical
+address space consists of a single contiguous RAM region. When this
+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.
+
+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 Operaring System dependant 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 configued and false otherwise. If you do not
+configure any passthrough devices at domain creation time but expect
+to hotplug devices later then you should set this option. Conversely
+if your particular guest kernel does not require this behaviour then
+it is safe to allow this to be enabled but you may wish to disable it
+anyway.
+
+=back
+
+=head2 Fully-virtualised (HVM) Guest Specific Options
+
+The following options apply only to HVM guests.
+
+=head3 Boot Device
+
+=over 4
+
+=item B<boot=[c|d|n]>
+
+Selects the emulated virtual device to boot from. Options are hard
+disk (B<c>), cd-rom (B<d>) or network/PXE (B<n>). Multiple options can be
+given and will be attempted in the order they are given. e.g. to boot
+from cd-rom but fallback to the hard disk you can give B<dc>. The
+default is B<cd>.
+
+=back
+
+=head3 Paging
+
+The following options control the mechanisms used to virtualise guest
+memory.  The defaults are selected to give the best results for the
+common case and so you should normally leave these options
+unspecified.
+
+=over 4
+
+=item B<hap=BOOLEAN>
+
+Turns "hardware assisted paging" (the use of the hardware nested page
+table feature) on or off.  This feature is called EPT (Extended Page
+Tables) by Intel and NPT (Nested Page Tables) or RVI (Rapid
+Virtualisation Indexing) by AMD.  Affects HVM guests only.  If turned
+off, Xen will run the guest in "shadow page table" mode where the
+guest's page table updates and/or TLB flushes etc. will be emulated.
+Use of HAP is the default when available.
+
+=item B<oos=BOOLEAN>
+
+Turns "out of sync pagetables" on or off.  When running in shadow page
+table mode, the guest's page table updates may be deferred as
+specified in the Intel/AMD architecture manuals.  However this may
+expose unexpected bugs in the guest, or find bugs in Xen, so it is
+possible to disable this feature.  Use of out of sync page tables,
+when Xen thinks it appropriate, is the default.
+
+=item B<shadow_memory=MBYTES>
+
+Number of megabytes to set aside for shadowing guest pagetable pages
+(effectively acting as a cache of translated pages) or to use for HAP
+state. By default this is 1MB per guest vcpu plus 8KB per MB of guest
+RAM. You should not normally need to adjust this value. However if you
+are not using hardware assisted paging (i.e. you are using shadow
+mode) and your guest workload consists of a a very large number of
+similar processes then increasing this value may improve performance.
+
+=back
+
+=head3 Processor and Platform Features
+
+The following options allow various processor and platform level
+features to be hidden or exposed from the guest's point of view. This
+can be useful when running older guest Operating Systems which may
+misbehave when faced with more modern features. In general you should
+accept the defaults for these options wherever possible.
+
+=over 4
+
+=item B<pae=BOOLEAN>
+
+Hide or expose the IA32 Physical Address Extensions. These extensions
+make it possible for a 32 bit guest Operating System to access more
+than 4GB of RAM. Enabling PAE also enabled other features such as
+NX. PAE is required if you wish to run a 64-bit guest Operating
+System. In general you should leave this enabled and allow the guest
+Operating System to choose whether or not to use PAE. (X86 only)
+
+=item B<acpi=BOOLEAN>
+
+Expose ACPI (Advanced Configuration and Power Interface) tables from
+the virtual firmware to the guest Operating System. ACPI is required
+by most modern guest Operating Systems. This option is enabled by
+default and usually you should omit it. However it may be necessary to
+disable ACPI for compatibility with some guest Operating Systems.
+
+=item B<apic=BOOLEAN>
+
+Include information regarding APIC (Advanced Programmable Interrupt
+Controller) in the firmware/BIOS tables on a single processor
+guest. This causes the MP (multiprocessor) and PIR (PCI Interrupt
+Routing) tables to be exported by the virtual firmware. This option
+has no effect on a guest with multiple virtual CPUS as they must
+always include these tables. This option is enabled by default and you
+should usually omit it but it may be necessary to disable these
+firmware tables when using certain older guest Operating
+Systems. These tables have been superceded by newer constructs within
+the ACPI tables. (X86 only)
+
+=item B<nx=BOOLEAN>
+
+Hides or exposes the No-eXecute capability. This allows a guest
+Operating system to map pages such that they cannot be executed which
+can enhance security. This options requires that PAE also be
+enabled. (X86 only)
+
+=item B<hpet=BOOLEAN>
+
+Enables or disables HPET (High Precision Event Timer). This option is
+enabled by default and you should usually omit it. It may be necessary
+to disable the HPET in order to improve compatibility with guest
+Operating Systems (X86 only)
+
+=item B<nestedhvm=BOOLEAN>
+
+Enable or disables guest access to hardware virtualisation features,
+e.g. it allows a guest Operating System to also function as a
+hypervisor. This option is disabled by default. You may want this
+option if you want to run another hypervisor (including another copy
+of Xen) within a Xen guest or to support a guest Operating System
+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.  XXX ???
+
+=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 (XXX which versions of Windows benefit?)
+
+=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 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.
+
+=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.
+
+=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-traditonal"> 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, depeending 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_args=[ "ARG", "ARG", ...]>
+
+Pass additional arbitrary options on the devide-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 devide-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 devide-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_passthrough=BOOLEAN>
+
+Enable graphics device PCI passthrough. XXX which device is passed through ?
+
+=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=XXX>
+
+XXX
+
+=back
+
+=head2 Keymaps
+
+The keymaps available are defined by the device-model which you are
+using. Commonly this includes:
+
+        ar  de-ch  es  fo     fr-ca  hu  ja  mk     no  pt-br  sv
+        da  en-gb  et  fr     fr-ch  is  lt  nl     pl  ru     th
+        de  en-us  fi  fr-be  hr     it  lv  nl-be  pt  sl     tr
+
+The default is B<en-us>.
+
+See L<qemu(1)> for more information.
+
+=head1 SEE ALSO
+
+=over 4
+
+=item L<xl(1)>
+
+=item F<xl-disk-configuration>
+
+=item F<xl-network-configuration>
+
+=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
+greatfully received on the xen-devel@lists.xensource.com mailing
+list. Please see L<http://wiki.xen.org/wiki/SubmittingXenPatches> for
+information on how to submit a patch to Xen.
+
diff -r bca64f372e4f -r 545cd3210f24 docs/man/xl.pod.1
--- a/docs/man/xl.pod.1	Tue Nov 29 14:17:27 2011 +0000
+++ b/docs/man/xl.pod.1	Tue Nov 29 14:17:27 2011 +0000
@@ -54,7 +54,7 @@
 
 =item B<create> [I<OPTIONS>] I<configfile>
 
-The create subcommand requires a config file: see L<xldomain.cfg> for
+The create subcommand requires a config file: see L<xl.cfg(5)> for
 full details of that file format and possible options.
 
 I<configfile> can either be an absolute path to a file, or a relative
@@ -232,7 +232,7 @@
 
 The domain has crashed, which is always a violent ending.  Usually
 this state can only occur if the domain has been configured not to
-restart on crash.  See L<xldomain.cfg> for more info.
+restart on crash.  See L<xl.cfg(5)> for more info.
 
 =item B<d - dying>
 
@@ -319,8 +319,8 @@
 domain actually reboots.
 
 The behavior of what happens to a domain when it reboots is set by the
-B<on_reboot> parameter of the xldomain.cfg file when the domain was
-created.
+B<on_reboot> parameter of the domain configuration file when the
+domain was created.
 
 =item B<restore> [I<OPTIONS>] [I<ConfigFile>] I<CheckpointFile>
 
@@ -372,8 +372,8 @@
 immediately after signally the domain unless that B<-w> flag is used.
 
 The behavior of what happens to a domain when it reboots is set by the
-B<on_shutdown> parameter of the xldomain.cfg file when the domain was
-created.
+B<on_shutdown> parameter of the domain configuration file when the
+domain was created.
 
 B<OPTIONS>
 
@@ -699,7 +699,7 @@
 =item I<disc-spec-component>
 
 A disc specification in the same format used for the B<disk> variable in
-the domain config file. See L<xldomain.cfg>.
+the domain config file. See F<xl-disk-configuration>.
 
 =back
 
@@ -733,9 +733,9 @@
 
 =item I<be-dev>
 
-the device in the backend domain (usually domain 0) to be exported; it can be a
-path to a file (file://path/to/file.iso). See B<disk> in L<xldomain.cfg> for the
-details.
+the device in the backend domain (usually domain 0) to be exported; it
+can be a path to a file (file://path/to/file.iso). See B<disk> in
+L<xl.cfg(5)> for the details.
 
 =back
 
@@ -754,7 +754,7 @@
 
 Creates a new network device in the domain specified by I<domain-id>.
 I<network-device> describes the device to attach, using the same format as the
-B<vif> string in the domain config file. See L<xldomain.cfg> for the
+B<vif> string in the domain config file. See L<xl.cfg(5)> for the
 description.
 
 =item B<network-detach> I<domain-id> I<devid|mac>
@@ -795,7 +795,7 @@
 
 =head1 SEE ALSO
 
-B<xldomain.cfg>(5), B<xlcpupool.cfg>(5), B<xentop>(1)
+L<xl.cfg(5)>, L<xlcpupool.cfg(5)>, B<xentop(1)>
 
 =head1 AUTHOR
 
diff -r bca64f372e4f -r 545cd3210f24 tools/examples/xlexample.hvm
--- a/tools/examples/xlexample.hvm	Tue Nov 29 14:17:27 2011 +0000
+++ b/tools/examples/xlexample.hvm	Tue Nov 29 14:17:27 2011 +0000
@@ -3,7 +3,7 @@
 # =====================================================================
 #
 # This is a fairly minimal example of what is required for an
-# HVM guest. For a more complete guide see <XXX Document TBD>
+# HVM guest. For a more complete guide see xl.cfg(5)
 
 # This configures an HVM rather than PV guest
 builder = "hvm"
diff -r bca64f372e4f -r 545cd3210f24 tools/examples/xlexample.pvlinux
--- a/tools/examples/xlexample.pvlinux	Tue Nov 29 14:17:27 2011 +0000
+++ b/tools/examples/xlexample.pvlinux	Tue Nov 29 14:17:27 2011 +0000
@@ -3,7 +3,7 @@
 # =====================================================================
 #
 # This is a fairly minimal example of what is required for a
-# Paravirtualised Linux guest. For a more complete guide see <XXX Document TBD>
+# Paravirtualised Linux guest. For a more complete guide see xl.cfg(5)
 
 # Guest name
 name = "example.pvlinux"

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:29 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY75-0006Tn-2f; Wed, 30 Nov 2011 00:33:27 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY74-0006Qp-7a
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:26 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-216.messagelabs.com!1322613166!5509612!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 422 invoked from network); 30 Nov 2011 00:32:47 -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;
	30 Nov 2011 00:32:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVYCt-0003uu-Ki
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6r-0003lA-8t
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:13 +0000
Message-Id: <E1RVY6r-0003lA-8t@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: move user and interface .tex
	documents under reference.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322576247 0
# Node ID 0c59c853135c6dbb4c9cd787657a18a65f388887
# Parent  b30064469a0355cbec71983b16139df19d0d6dca
docs: move user and interface .tex documents under reference.

Taking over the top level "user" entry with a relatively obsolete document is a
bit of an annoyance but these docs are not so out of date that they should be
deleted. Move them out of the top-level instead.

(the original motivation here was to allow for user/xl-domain-cfg.markdown but
we have since decided to go with man/xl.cfg.pod.5 instead so perhaps this is a
waste of time)

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


diff -r b30064469a03 -r 0c59c853135c docs/INDEX
--- a/docs/INDEX	Tue Nov 29 14:17:27 2011 +0000
+++ b/docs/INDEX	Tue Nov 29 14:17:27 2011 +0000
@@ -1,5 +1,5 @@
 misc/hvm-emulated-unplug	Xen HVM emulated device unplug protocol
 
 # These are not all that useful anymore, hide them from the index
-interface/index			NO-INDEX
-user/index			NO-INDEX
+reference/interface/index	NO-INDEX
+reference/user/index		NO-INDEX
diff -r b30064469a03 -r 0c59c853135c docs/Makefile
--- a/docs/Makefile	Tue Nov 29 14:17:27 2011 +0000
+++ b/docs/Makefile	Tue Nov 29 14:17:27 2011 +0000
@@ -14,7 +14,7 @@
 DOC_MARKDOWN	:= $(wildcard misc/*.markdown)
 DOC_PS		:= $(patsubst src/%.tex,ps/%.ps,$(DOC_TEX))
 DOC_PDF		:= $(patsubst src/%.tex,pdf/%.pdf,$(DOC_TEX))
-DOC_HTML	:= $(patsubst src/%.tex,html/%/index.html,$(DOC_TEX)) \
+DOC_HTML	:= $(patsubst src/%.tex,html/reference/%/index.html,$(DOC_TEX)) \
 		   $(patsubst %.markdown,html/%.html,$(DOC_MARKDOWN)) \
 		   $(patsubst man/%.pod.1,html/man/%.1.html,$(DOC_MAN1SRC)) \
 		   $(patsubst man/%.pod.5,html/man/%.5.html,$(DOC_MAN5SRC))
@@ -119,14 +119,14 @@
 %.eps: %.fig
 	$(FIG2DEV) -L eps $< $@
 
-html/%/index.html: src/%.tex
+html/reference/%/index.html: src/%.tex
 	@$(INSTALL_DIR) $(@D)
 	@set -e ; if which $(LATEX2HTML) 1>/dev/null 2>/dev/null; then \
-        echo "Running latex2html to generate $*/index.html ... "; \
+        echo "Running latex2html to generate reference/$*/index.html ... "; \
 	$(LATEX2HTML) -split 0 -show_section_numbers -toc_depth 3 -nonavigation \
 	-numbered_footnotes -local_icons -noinfo -math -dir $(@D) \
 	$< 1>/dev/null 2>/dev/null ; else \
-	echo "latex2html not installed; skipping $*."; fi
+	echo "latex2html not installed; skipping reference/$*."; fi
 
 html/index.html: $(DOC_HTML) ./gen-html-index INDEX
 	perl -w -- ./gen-html-index -i INDEX html $(DOC_HTML)

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:29 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY74-0006TZ-TK; Wed, 30 Nov 2011 00:33:26 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY73-0006Qg-4K
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-174.messagelabs.com!1322613163!3621057!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-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13515 invoked from network); 30 Nov 2011 00:32:44 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Nov 2011 00:32: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 1RVYCq-0003uZ-4l
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6n-0003jT-OK
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:09 +0000
Message-Id: <E1RVY6n-0003jT-OK@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: add a document describing the
	xl cfg file syntax
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322576247 0
# Node ID 545cd3210f245305c77b143e27d48d93d0efc7c3
# Parent  bca64f372e4f76a85a9f0fa9f2a59ded1b6bb206
docs: add a document describing the xl cfg file syntax

Based on an initial version by Ian Jackson.

I believe that all keys are now present in the document although there are are
various omissions in the actual documentation of them. Hopefully however this
covers the majority of the most interesting keys.

Spice section:
Signed-off-by: Zhou Peng <zhoupeng@nfs.iscas.ac.cn>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>

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


diff -r bca64f372e4f -r 545cd3210f24 docs/man/xl.cfg.pod.5
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/man/xl.cfg.pod.5	Tue Nov 29 14:17:27 2011 +0000
@@ -0,0 +1,844 @@
+=head1 NAME
+
+xl.cfg - XL Domain Configuration File Syntax
+
+=head1 SYNOPSIS
+
+ /etc/xen/xldomain
+
+=head1 DESCRIPTION
+
+To create a VM (a domain in Xen terminology, sometimes called a guest)
+with xl requires the provision of a domain config file.  Typically
+these live in `/etc/xen/DOMAIN.cfg` where DOMAIN is the name of the
+domain.
+
+=head1 SYNTAX
+
+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
+any guest type while others relate only to specific guest types
+(e.g. PV or HVM guests).
+
+A value C<VALUE> is one of:
+
+=over 4
+
+=item B<"STRING">
+
+A string, surrounded by either single or double quotes.
+
+=item B<NUMBER>
+
+A number, in either decimal, octal (using a C<0> prefix) or
+hexadecimal (using an C<0x> prefix).
+
+=item B<BOOLEAN>
+
+A C<NUMBER> interpreted as C<False> (C<0>) or C<True> (any other
+value).
+
+=item B<[ VALUE, VALUE, ... ]>
+
+A list of C<VALUES> of the above types. Lists are homogeneous and are
+not nested.
+
+=back
+
+The semantics of each C<KEY> defines which form of C<VALUE> is required.
+
+=head1 OPTIONS
+
+=head2 Mandatory Configuration Items
+
+The following key is mandatory for any guest type:
+
+=over 4
+
+=item B<name="NAME">
+
+Specifies the name of the domain.  Names of domains existing on a
+single host must be unique.
+
+=back
+
+=head2 Selecting Guest Type
+
+=over 4
+
+=item B<builder="generic">
+
+Specifies that this is to be a PV domain. This is the default.
+
+=item B<builder="hvm">
+
+Specifies that this is to be an HVM domain.  That is, a fully
+virtualised computer with emulated BIOS, disk and network peripherals,
+etc.  The default is a PV domain, suitable for hosting Xen-aware guest
+operating systems.
+
+=back
+
+=head2 Global Options
+
+The following options apply to guests of any type.
+
+=over 4
+
+=item B<uuid="UUID">
+
+Specifies the UUID of the domain.  If not specified, a fresh unique
+UUID will be generated.
+
+=item B<pool="CPUPOOLNAME">
+
+Put the guest's vcpus into the named cpu pool.
+
+=item B<vcpus=N>
+
+Start the guest with N vcpus initially online.
+
+=item B<maxvcpus=M>
+
+Allow the guest to bring up a maximum of M vcpus. At start of day if
+`vcpus=N` is less than `maxvcpus=M` then the first `N` vcpus will be
+created online and the remainder will be offline.
+
+=item B<memory=MBYTES>
+
+Start the guest with MBYTES megabytes of RAM.
+
+=item B<on_poweroff="ACTION">
+
+Specifies what should be done with the domain if it shuts itself down.
+The C<ACTION>s are:
+
+=over 4
+
+=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 thenimmediately create a new
+domain with the same configuration as the original
+
+=item B<preserve>
+
+keep the domain.  It can be examined, and later destroyed with `xl
+destroy`.
+
+=item B<coredump-destroy>
+
+write a "coredump" of the domain to F</var/xen/dump/NAME> and then
+destroy the domain.
+
+=item B<coredump-restart>
+
+write a "coredump" of the domain to F</var/xen/dump/NAME> and then
+restart the domain.
+
+=back
+
+The default for C<on_poweroff> is C<destroy>.
+
+=item B<on_reboot="ACTION">
+
+Action to take if the domain shuts down with a reason code requesting
+a reboot.  Default is C<restart>.
+
+=item B<on_watchdog="ACTION">
+
+Action to take if the domain shuts down due to a Xen watchdog timeout.
+Default is C<destroy>.
+
+=item B<on_crash="ACTION">
+
+Action to take if the domain crashes.  Default is C<destroy>.
+
+=item B<seclabel="LABEL">
+
+Assign an XSM security label to this domain.
+
+=back
+
+=head2 Devices
+
+The following options define the paravirtual, emulated and physical
+devices which the guest will contain.
+
+=over 4
+
+=item B<disk=[ "DISK_SPEC_STRING", "DISK_SPEC_STRING", ...]>
+
+Specifies the disks (both emulated disks and Xen virtual block
+devices) which are to be provided to the guest, and what objects on
+the they should map to.  See F<docs/misc/xl-disk-configuration.txt>.
+
+=item B<vif=[ "NET_SPEC_STRING", "NET_SPEC_STRING", ...]>
+
+Specifies the networking provision (both emulated network adapters,
+and Xen virtual interfaces) to provided to the guest.  See
+F<docs/misc/xl-network-configuration.markdown>.
+
+=item B<vfb=[ "VFB_SPEC_STRING", "VFB_SPEC_STRING", ...]>
+
+Specifies the paravirtual framebuffer devices which should be supplied
+to the domain.
+
+This options does not control the emulated graphics card presented to
+an HVM guest. See L<Emulated VGA Graphics Device> below for how to
+configure the emulated device.
+
+Each B<VFB_SPEC_STRING> is a comma-separated list of C<KEY=VALUE>
+settings, from the following list:
+
+=over 4
+
+=item C<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 C<vnclisten="ADDRESS[:DISPLAYNUM]">
+
+Specifies the IP address, and optionally VNC display number, to use.
+
+=item C<vncdisplay=DISPLAYNUM>
+
+Specifies the VNC display number to use.  The actual TCP port number
+will be DISPLAYNUM+5900.
+
+=item C<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 C<vncpasswd="PASSWORD">
+
+Specifies the password for the VNC server.
+
+=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
+
+=item C<opengl=BOOLEAN>
+
+Enable OpenGL acceleration of the SDL display. Only effects machines
+using C<device_model_version="qemu-xen-traditonal"> and only if the
+device-model was compiled with OpenGL support. Disabled by default.
+
+=item C<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 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", ... ]>
+
+Specifies the host PCI devices to passthrough to this guest. Each B<PCI_SPEC_STRING>
+has the form C<[DDDD:]BB:DD.F[@VSLOT],KEY=VALUE,KEY=VALUE,...> where:
+
+=over 4
+
+=item B<DDDD:BB:DD.F>
+
+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
+is zero and it is optional here also. You may specify the function
+(B<F>) as B<*> to indicate all functions.
+
+=item B<@VSLOT>
+
+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?
+
+=item B<KEY=VALUE>
+
+Posible B<KEY>s are:
+
+=over 4
+
+=item B<msitranslate=BOOLEAN>
+
+XXX
+
+=item B<power_mgmt=BOOLEAN>
+
+XXX
+
+=back
+
+=back
+
+=back
+
+=head2 Paravirtualised (PV) Guest Specific Options
+
+The following options apply only to Paravirtual guests.
+
+=over 4
+
+=item B<kernel="PATHNAME">
+
+Load the specified file as the kernel image.  Either B<kernel> or
+B<bootloader> must be specified for PV guests.
+
+=item B<ramdisk="PATHNAME">
+
+Load the specified file as the ramdisk.
+
+=item B<bootloader="PROGRAM">
+
+Run C<PROGRAM> to find the kernel image and ramdisk to use.  Normally
+C<PROGRAM> would be C<pygrub>, which is an emulation of
+grub/grub2/syslinux.
+
+=item B<bootloader_args=STRING>
+
+Append B<STRING> (split into words at whitespace) to the arguments to
+the B<bootloader> program.  XXX this should be a list of strings.
+
+=item B<root="STRING">
+
+Append B<root="STRING"> to the kernel command line (Note: it is guest
+specific what meaning this has).
+
+=item B<extra="STRING">
+
+Append B<STRING> to the kernel command line. Note: it is guest
+specific what meaning this has).
+
+=item B<e820_host=BOOLEAN>
+
+Selects whether to expose the host e820 (memory map) to the guest via
+the virtual e820. When this option is false the guest psuedo-physical
+address space consists of a single contiguous RAM region. When this
+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.
+
+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 Operaring System dependant 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 configued and false otherwise. If you do not
+configure any passthrough devices at domain creation time but expect
+to hotplug devices later then you should set this option. Conversely
+if your particular guest kernel does not require this behaviour then
+it is safe to allow this to be enabled but you may wish to disable it
+anyway.
+
+=back
+
+=head2 Fully-virtualised (HVM) Guest Specific Options
+
+The following options apply only to HVM guests.
+
+=head3 Boot Device
+
+=over 4
+
+=item B<boot=[c|d|n]>
+
+Selects the emulated virtual device to boot from. Options are hard
+disk (B<c>), cd-rom (B<d>) or network/PXE (B<n>). Multiple options can be
+given and will be attempted in the order they are given. e.g. to boot
+from cd-rom but fallback to the hard disk you can give B<dc>. The
+default is B<cd>.
+
+=back
+
+=head3 Paging
+
+The following options control the mechanisms used to virtualise guest
+memory.  The defaults are selected to give the best results for the
+common case and so you should normally leave these options
+unspecified.
+
+=over 4
+
+=item B<hap=BOOLEAN>
+
+Turns "hardware assisted paging" (the use of the hardware nested page
+table feature) on or off.  This feature is called EPT (Extended Page
+Tables) by Intel and NPT (Nested Page Tables) or RVI (Rapid
+Virtualisation Indexing) by AMD.  Affects HVM guests only.  If turned
+off, Xen will run the guest in "shadow page table" mode where the
+guest's page table updates and/or TLB flushes etc. will be emulated.
+Use of HAP is the default when available.
+
+=item B<oos=BOOLEAN>
+
+Turns "out of sync pagetables" on or off.  When running in shadow page
+table mode, the guest's page table updates may be deferred as
+specified in the Intel/AMD architecture manuals.  However this may
+expose unexpected bugs in the guest, or find bugs in Xen, so it is
+possible to disable this feature.  Use of out of sync page tables,
+when Xen thinks it appropriate, is the default.
+
+=item B<shadow_memory=MBYTES>
+
+Number of megabytes to set aside for shadowing guest pagetable pages
+(effectively acting as a cache of translated pages) or to use for HAP
+state. By default this is 1MB per guest vcpu plus 8KB per MB of guest
+RAM. You should not normally need to adjust this value. However if you
+are not using hardware assisted paging (i.e. you are using shadow
+mode) and your guest workload consists of a a very large number of
+similar processes then increasing this value may improve performance.
+
+=back
+
+=head3 Processor and Platform Features
+
+The following options allow various processor and platform level
+features to be hidden or exposed from the guest's point of view. This
+can be useful when running older guest Operating Systems which may
+misbehave when faced with more modern features. In general you should
+accept the defaults for these options wherever possible.
+
+=over 4
+
+=item B<pae=BOOLEAN>
+
+Hide or expose the IA32 Physical Address Extensions. These extensions
+make it possible for a 32 bit guest Operating System to access more
+than 4GB of RAM. Enabling PAE also enabled other features such as
+NX. PAE is required if you wish to run a 64-bit guest Operating
+System. In general you should leave this enabled and allow the guest
+Operating System to choose whether or not to use PAE. (X86 only)
+
+=item B<acpi=BOOLEAN>
+
+Expose ACPI (Advanced Configuration and Power Interface) tables from
+the virtual firmware to the guest Operating System. ACPI is required
+by most modern guest Operating Systems. This option is enabled by
+default and usually you should omit it. However it may be necessary to
+disable ACPI for compatibility with some guest Operating Systems.
+
+=item B<apic=BOOLEAN>
+
+Include information regarding APIC (Advanced Programmable Interrupt
+Controller) in the firmware/BIOS tables on a single processor
+guest. This causes the MP (multiprocessor) and PIR (PCI Interrupt
+Routing) tables to be exported by the virtual firmware. This option
+has no effect on a guest with multiple virtual CPUS as they must
+always include these tables. This option is enabled by default and you
+should usually omit it but it may be necessary to disable these
+firmware tables when using certain older guest Operating
+Systems. These tables have been superceded by newer constructs within
+the ACPI tables. (X86 only)
+
+=item B<nx=BOOLEAN>
+
+Hides or exposes the No-eXecute capability. This allows a guest
+Operating system to map pages such that they cannot be executed which
+can enhance security. This options requires that PAE also be
+enabled. (X86 only)
+
+=item B<hpet=BOOLEAN>
+
+Enables or disables HPET (High Precision Event Timer). This option is
+enabled by default and you should usually omit it. It may be necessary
+to disable the HPET in order to improve compatibility with guest
+Operating Systems (X86 only)
+
+=item B<nestedhvm=BOOLEAN>
+
+Enable or disables guest access to hardware virtualisation features,
+e.g. it allows a guest Operating System to also function as a
+hypervisor. This option is disabled by default. You may want this
+option if you want to run another hypervisor (including another copy
+of Xen) within a Xen guest or to support a guest Operating System
+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.  XXX ???
+
+=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 (XXX which versions of Windows benefit?)
+
+=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 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.
+
+=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.
+
+=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-traditonal"> 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, depeending 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_args=[ "ARG", "ARG", ...]>
+
+Pass additional arbitrary options on the devide-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 devide-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 devide-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_passthrough=BOOLEAN>
+
+Enable graphics device PCI passthrough. XXX which device is passed through ?
+
+=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=XXX>
+
+XXX
+
+=back
+
+=head2 Keymaps
+
+The keymaps available are defined by the device-model which you are
+using. Commonly this includes:
+
+        ar  de-ch  es  fo     fr-ca  hu  ja  mk     no  pt-br  sv
+        da  en-gb  et  fr     fr-ch  is  lt  nl     pl  ru     th
+        de  en-us  fi  fr-be  hr     it  lv  nl-be  pt  sl     tr
+
+The default is B<en-us>.
+
+See L<qemu(1)> for more information.
+
+=head1 SEE ALSO
+
+=over 4
+
+=item L<xl(1)>
+
+=item F<xl-disk-configuration>
+
+=item F<xl-network-configuration>
+
+=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
+greatfully received on the xen-devel@lists.xensource.com mailing
+list. Please see L<http://wiki.xen.org/wiki/SubmittingXenPatches> for
+information on how to submit a patch to Xen.
+
diff -r bca64f372e4f -r 545cd3210f24 docs/man/xl.pod.1
--- a/docs/man/xl.pod.1	Tue Nov 29 14:17:27 2011 +0000
+++ b/docs/man/xl.pod.1	Tue Nov 29 14:17:27 2011 +0000
@@ -54,7 +54,7 @@
 
 =item B<create> [I<OPTIONS>] I<configfile>
 
-The create subcommand requires a config file: see L<xldomain.cfg> for
+The create subcommand requires a config file: see L<xl.cfg(5)> for
 full details of that file format and possible options.
 
 I<configfile> can either be an absolute path to a file, or a relative
@@ -232,7 +232,7 @@
 
 The domain has crashed, which is always a violent ending.  Usually
 this state can only occur if the domain has been configured not to
-restart on crash.  See L<xldomain.cfg> for more info.
+restart on crash.  See L<xl.cfg(5)> for more info.
 
 =item B<d - dying>
 
@@ -319,8 +319,8 @@
 domain actually reboots.
 
 The behavior of what happens to a domain when it reboots is set by the
-B<on_reboot> parameter of the xldomain.cfg file when the domain was
-created.
+B<on_reboot> parameter of the domain configuration file when the
+domain was created.
 
 =item B<restore> [I<OPTIONS>] [I<ConfigFile>] I<CheckpointFile>
 
@@ -372,8 +372,8 @@
 immediately after signally the domain unless that B<-w> flag is used.
 
 The behavior of what happens to a domain when it reboots is set by the
-B<on_shutdown> parameter of the xldomain.cfg file when the domain was
-created.
+B<on_shutdown> parameter of the domain configuration file when the
+domain was created.
 
 B<OPTIONS>
 
@@ -699,7 +699,7 @@
 =item I<disc-spec-component>
 
 A disc specification in the same format used for the B<disk> variable in
-the domain config file. See L<xldomain.cfg>.
+the domain config file. See F<xl-disk-configuration>.
 
 =back
 
@@ -733,9 +733,9 @@
 
 =item I<be-dev>
 
-the device in the backend domain (usually domain 0) to be exported; it can be a
-path to a file (file://path/to/file.iso). See B<disk> in L<xldomain.cfg> for the
-details.
+the device in the backend domain (usually domain 0) to be exported; it
+can be a path to a file (file://path/to/file.iso). See B<disk> in
+L<xl.cfg(5)> for the details.
 
 =back
 
@@ -754,7 +754,7 @@
 
 Creates a new network device in the domain specified by I<domain-id>.
 I<network-device> describes the device to attach, using the same format as the
-B<vif> string in the domain config file. See L<xldomain.cfg> for the
+B<vif> string in the domain config file. See L<xl.cfg(5)> for the
 description.
 
 =item B<network-detach> I<domain-id> I<devid|mac>
@@ -795,7 +795,7 @@
 
 =head1 SEE ALSO
 
-B<xldomain.cfg>(5), B<xlcpupool.cfg>(5), B<xentop>(1)
+L<xl.cfg(5)>, L<xlcpupool.cfg(5)>, B<xentop(1)>
 
 =head1 AUTHOR
 
diff -r bca64f372e4f -r 545cd3210f24 tools/examples/xlexample.hvm
--- a/tools/examples/xlexample.hvm	Tue Nov 29 14:17:27 2011 +0000
+++ b/tools/examples/xlexample.hvm	Tue Nov 29 14:17:27 2011 +0000
@@ -3,7 +3,7 @@
 # =====================================================================
 #
 # This is a fairly minimal example of what is required for an
-# HVM guest. For a more complete guide see <XXX Document TBD>
+# HVM guest. For a more complete guide see xl.cfg(5)
 
 # This configures an HVM rather than PV guest
 builder = "hvm"
diff -r bca64f372e4f -r 545cd3210f24 tools/examples/xlexample.pvlinux
--- a/tools/examples/xlexample.pvlinux	Tue Nov 29 14:17:27 2011 +0000
+++ b/tools/examples/xlexample.pvlinux	Tue Nov 29 14:17:27 2011 +0000
@@ -3,7 +3,7 @@
 # =====================================================================
 #
 # This is a fairly minimal example of what is required for a
-# Paravirtualised Linux guest. For a more complete guide see <XXX Document TBD>
+# Paravirtualised Linux guest. For a more complete guide see xl.cfg(5)
 
 # Guest name
 name = "example.pvlinux"

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:29 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY71-0006RI-1u; Wed, 30 Nov 2011 00:33:23 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6z-0006Q8-R6
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-21.messagelabs.com!1322613162!6308143!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22006 invoked from network); 30 Nov 2011 00:32:43 -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;
	30 Nov 2011 00:32: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 1RVYCo-0003uP-LI
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6m-0003ik-8p
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:08 +0000
Message-Id: <E1RVY6m-0003ik-8p@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: xlexample.hvm is missing
	"builder = 'hvm'"
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322576247 0
# Node ID edc27cff4c0c0abab832d7cbdcb39bbda8c1c4a1
# Parent  2d18642355d4ac7b6662dc86d47006ca9b1c73b7
docs: xlexample.hvm is missing "builder = 'hvm'"

This is rather critical...

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


diff -r 2d18642355d4 -r edc27cff4c0c tools/examples/xlexample.hvm
--- a/tools/examples/xlexample.hvm	Tue Nov 29 13:53:31 2011 +0000
+++ b/tools/examples/xlexample.hvm	Tue Nov 29 14:17:27 2011 +0000
@@ -5,6 +5,9 @@
 # This is a fairly minimal example of what is required for an
 # HVM guest. For a more complete guide see <XXX Document TBD>
 
+# This configures an HVM rather than PV guest
+builder = "hvm"
+
 # Guest name
 name = "example.hvm"
 

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:29 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY71-0006RI-1u; Wed, 30 Nov 2011 00:33:23 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6z-0006Q8-R6
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-21.messagelabs.com!1322613162!6308143!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22006 invoked from network); 30 Nov 2011 00:32:43 -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;
	30 Nov 2011 00:32: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 1RVYCo-0003uP-LI
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6m-0003ik-8p
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:08 +0000
Message-Id: <E1RVY6m-0003ik-8p@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: xlexample.hvm is missing
	"builder = 'hvm'"
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322576247 0
# Node ID edc27cff4c0c0abab832d7cbdcb39bbda8c1c4a1
# Parent  2d18642355d4ac7b6662dc86d47006ca9b1c73b7
docs: xlexample.hvm is missing "builder = 'hvm'"

This is rather critical...

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


diff -r 2d18642355d4 -r edc27cff4c0c tools/examples/xlexample.hvm
--- a/tools/examples/xlexample.hvm	Tue Nov 29 13:53:31 2011 +0000
+++ b/tools/examples/xlexample.hvm	Tue Nov 29 14:17:27 2011 +0000
@@ -5,6 +5,9 @@
 # This is a fairly minimal example of what is required for an
 # HVM guest. For a more complete guide see <XXX Document TBD>
 
+# This configures an HVM rather than PV guest
+builder = "hvm"
+
 # Guest name
 name = "example.hvm"
 

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:29 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY73-0006SE-7f; Wed, 30 Nov 2011 00:33:25 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY71-0006QK-3c
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-216.messagelabs.com!1322613163!5569245!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16955 invoked from network); 30 Nov 2011 00:32:44 -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;
	30 Nov 2011 00:32: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 1RVYCp-0003uT-7b
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6m-0003iz-OU
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:08 +0000
Message-Id: <E1RVY6m-0003iz-OU@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] README: add markdown to dependency
	list
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322576247 0
# Node ID 0cfdb398d2f646a4a61d435bc1fdd6ecb28600b0
# Parent  edc27cff4c0c0abab832d7cbdcb39bbda8c1c4a1
README: add markdown to dependency list

although this tool is strictly speaking optional we are providing various user
docs in this format so increase the changes that they will install it.

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


diff -r edc27cff4c0c -r 0cfdb398d2f6 README
--- a/README	Tue Nov 29 14:17:27 2011 +0000
+++ b/README	Tue Nov 29 14:17:27 2011 +0000
@@ -57,6 +57,7 @@
     * GNU gettext
     * 16-bit x86 assembler, loader and compiler (dev86 rpm or bin86 & bcc debs)
     * ACPI ASL compiler (iasl)
+    * markdown
 
 Second, you need to acquire a suitable kernel for use in domain 0. If
 possible you should use a kernel provided by your OS distributor. If

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:29 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY74-0006TR-PM; Wed, 30 Nov 2011 00:33:26 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY73-0006Qi-BQ
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-216.messagelabs.com!1322613165!5549972!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6589 invoked from network); 30 Nov 2011 00:32:46 -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;
	30 Nov 2011 00:32:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVYCt-0003ur-1E
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6q-0003kv-Oq
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:12 +0000
Message-Id: <E1RVY6q-0003kv-Oq@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: generate an index for the html
	output
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322576247 0
# Node ID b30064469a0355cbec71983b16139df19d0d6dca
# Parent  faa863f0343f5e6e7dc813227bfd03a8cd04bfe7
docs: generate an index for the html output

nb: I'm not a Perl wizard...

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


diff -r faa863f0343f -r b30064469a03 docs/INDEX
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/INDEX	Tue Nov 29 14:17:27 2011 +0000
@@ -0,0 +1,5 @@
+misc/hvm-emulated-unplug	Xen HVM emulated device unplug protocol
+
+# These are not all that useful anymore, hide them from the index
+interface/index			NO-INDEX
+user/index			NO-INDEX
diff -r faa863f0343f -r b30064469a03 docs/Makefile
--- a/docs/Makefile	Tue Nov 29 14:17:27 2011 +0000
+++ b/docs/Makefile	Tue Nov 29 14:17:27 2011 +0000
@@ -45,7 +45,7 @@
 pdf: $(DOC_PDF)
 
 .PHONY: html
-html: $(DOC_HTML)
+html: $(DOC_HTML) html/index.html
 
 .PHONY: txt
 txt: $(DOC_TXT)
@@ -128,6 +128,9 @@
 	$< 1>/dev/null 2>/dev/null ; else \
 	echo "latex2html not installed; skipping $*."; fi
 
+html/index.html: $(DOC_HTML) ./gen-html-index INDEX
+	perl -w -- ./gen-html-index -i INDEX html $(DOC_HTML)
+
 html/%.html: %.markdown
 	@$(INSTALL_DIR) $(@D)
 	@set -e ; if which $(MARKDOWN) 1>/dev/null 2>/dev/null; then \
diff -r faa863f0343f -r b30064469a03 docs/gen-html-index
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/gen-html-index	Tue Nov 29 14:17:27 2011 +0000
@@ -0,0 +1,136 @@
+#!/usr/bin/env perl
+
+#
+# Generate indexes for html documentation
+#
+
+use strict;
+use warnings;
+
+use Getopt::Long;
+use IO::File;
+use File::Basename;
+use List::MoreUtils qw/ uniq /;
+
+Getopt::Long::Configure('bundling');
+
+@ARGV >= 2 or die;
+
+our @docs;
+our @dirs;
+our %index;
+
+our $outdir;
+
+GetOptions("i=s" => sub { read_index(@_);} )
+    or die;
+
+($outdir,@docs) = @ARGV;
+
+sub write_file ($$) {
+    my ($opath, $odata) = @_;
+    print STDOUT "Writing: $opath\n";
+    my $out = new IO::File "$opath.new", '>' or die "$opath $!";
+    print $out $odata or die $!;
+    rename "$opath.new", "$opath" or die "$opath $!";
+}
+
+sub make_page ($$$) {
+    my ($file,$title,$content) = @_;
+    my $o = '';
+    my $h1;
+    if ( $title eq "" )
+    {
+        $title = $h1 = "Xen Documentation";
+    }
+    else
+    {
+        $h1 = "<a href=\"../index.(?:html|txt)\">Xen Documentation</a> - $title";
+        $title = "Xen Documentation - $title";
+    }
+    $o .= <<END;
+<html><head><title>$title</title></head>
+<body>
+<h1>$h1</h1>
+<ul>
+$content
+</ul>
+</body></html>
+END
+    write_file($file, $o);
+}
+
+sub make_linktext ($) {
+    my ($l) = @_;
+    return "$1($2)" if $l =~ m,^man/(.*)\.([0-9].*)\.html,;
+    $l =~ s/.(html)$//g;
+    return $index{$l} if exists $index{$l};
+    return basename($l);
+}
+
+sub make_link ($$) {
+    my ($ref,$base) = @_;
+
+    my $txt = make_linktext($ref);
+    $ref = basename($ref) if $base;
+
+    return "<li><a href=\"$ref\">$txt</a></li>\n";
+}
+
+sub make_links ($$@) {
+    my ($dir,$base,@docs) = @_;
+    my $idx = '';
+    foreach my $of (sort { $a cmp $b } @docs) {
+        $idx .= make_link($of,$base);
+    }
+    return $idx;
+}
+
+sub read_index ($$) {
+    my ($opt, $val) = @_;
+    my $idx = new IO::File "$val", '<' or die "$val $!";
+    while ($_ = $idx->getline()) {
+	s/^\s+//;
+	s/\s+$//;
+	next if m/^\#/;
+	next unless m/\S/;
+	m/^(\S+)\s+(\S.*)$/ or die;
+        $index{$1} = $2;
+    }
+}
+
+for (@docs) { s,^\Q$outdir\E/,, }
+
+@docs = grep { -e "$outdir/$_" && (make_linktext($_) ne "NO-INDEX") } @docs;
+
+my $top = '';
+
+foreach my $od (sort { $a cmp $b } uniq map { dirname($_) } @docs) {
+    my @d = (grep /^\Q$od\E/, @docs);
+    if ( @d == 1 and $d[0] eq "$od/index.html" )
+    {
+        $top .= "<li><a href=\"${od}/index.html\">${od}/index.html</a></li>\n";
+    }
+    else
+    {
+	my $links = make_links($od,0,@d);
+	$top .= <<END;
+<li><a href=\"${od}/index.html\">$od</a></li>
+<ul>
+$links
+</ul>
+END
+
+	$links = make_links($od,1,@d);
+        my $idx = '';
+	$idx .= <<END;
+<li>$od</li>
+<ul>
+$links
+</ul>
+END
+        make_page("$outdir/$od/index.html", $od, $idx);
+    }
+}
+
+make_page("$outdir/index.html", "", $top);

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:29 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY73-0006SE-7f; Wed, 30 Nov 2011 00:33:25 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY71-0006QK-3c
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-216.messagelabs.com!1322613163!5569245!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16955 invoked from network); 30 Nov 2011 00:32:44 -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;
	30 Nov 2011 00:32: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 1RVYCp-0003uT-7b
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6m-0003iz-OU
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:08 +0000
Message-Id: <E1RVY6m-0003iz-OU@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] README: add markdown to dependency
	list
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322576247 0
# Node ID 0cfdb398d2f646a4a61d435bc1fdd6ecb28600b0
# Parent  edc27cff4c0c0abab832d7cbdcb39bbda8c1c4a1
README: add markdown to dependency list

although this tool is strictly speaking optional we are providing various user
docs in this format so increase the changes that they will install it.

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


diff -r edc27cff4c0c -r 0cfdb398d2f6 README
--- a/README	Tue Nov 29 14:17:27 2011 +0000
+++ b/README	Tue Nov 29 14:17:27 2011 +0000
@@ -57,6 +57,7 @@
     * GNU gettext
     * 16-bit x86 assembler, loader and compiler (dev86 rpm or bin86 & bcc debs)
     * ACPI ASL compiler (iasl)
+    * markdown
 
 Second, you need to acquire a suitable kernel for use in domain 0. If
 possible you should use a kernel provided by your OS distributor. If

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:30 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY74-0006Tg-WD; Wed, 30 Nov 2011 00:33:27 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY73-0006Qh-5S
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-174.messagelabs.com!1322613164!3571174!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14508 invoked from network); 30 Nov 2011 00:32:45 -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;
	30 Nov 2011 00:32:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVYCr-0003uf-1f
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6o-0003jx-PD
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:10 +0000
Message-Id: <E1RVY6o-0003jx-PD@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xlu: add "dont_warn" to xlu_cfg_*
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322576247 0
# Node ID 311982097842a03340556838f43e24db9a402dca
# Parent  bc1c875585f580e0a5c1483f8597141bbdb74b4f
xlu: add "dont_warn" to xlu_cfg_*

I want it for get_long but we might as well have it everywhere.

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


diff -r bc1c875585f5 -r 311982097842 tools/libxl/libxlu_cfg.c
--- a/tools/libxl/libxlu_cfg.c	Tue Nov 29 14:17:27 2011 +0000
+++ b/tools/libxl/libxlu_cfg.c	Tue Nov 29 14:17:27 2011 +0000
@@ -165,17 +165,18 @@
 }
 
 static int find_atom(const XLU_Config *cfg, const char *n,
-                     XLU_ConfigSetting **set_r) {
+                     XLU_ConfigSetting **set_r, int dont_warn) {
     XLU_ConfigSetting *set;
 
     set= find(cfg,n);
     if (!set) return ESRCH;
 
     if (set->avalues!=1) {
-        fprintf(cfg->report,
-                "%s:%d: warning: parameter `%s' is"
-                " a list but should be a single value\n",
-                cfg->filename, set->lineno, n);
+        if (!dont_warn)
+            fprintf(cfg->report,
+                    "%s:%d: warning: parameter `%s' is"
+                    " a list but should be a single value\n",
+                    cfg->filename, set->lineno, n);
         return EINVAL;
     }
     *set_r= set;
@@ -183,49 +184,51 @@
 }
 
 int xlu_cfg_get_string(const XLU_Config *cfg, const char *n,
-                       const char **value_r) {
+                       const char **value_r, int dont_warn) {
     XLU_ConfigSetting *set;
     int e;
 
-    e= find_atom(cfg,n,&set);  if (e) return e;
+    e= find_atom(cfg,n,&set,dont_warn);  if (e) return e;
     *value_r= set->values[0];
     return 0;
 }
 
 int xlu_cfg_replace_string(const XLU_Config *cfg, const char *n,
-                           char **value_r) {
+                           char **value_r, int dont_warn) {
     XLU_ConfigSetting *set;
     int e;
 
-    e= find_atom(cfg,n,&set);  if (e) return e;
+    e= find_atom(cfg,n,&set,dont_warn);  if (e) return e;
     free(*value_r);
     *value_r= strdup(set->values[0]);
     return 0;
 }
 
 int xlu_cfg_get_long(const XLU_Config *cfg, const char *n,
-                     long *value_r) {
+                     long *value_r, int dont_warn) {
     long l;
     XLU_ConfigSetting *set;
     int e;
     char *ep;
 
-    e= find_atom(cfg,n,&set);  if (e) return e;
+    e= find_atom(cfg,n,&set,dont_warn);  if (e) return e;
     errno= 0; l= strtol(set->values[0], &ep, 0);
     e= errno;
     if (errno) {
         e= errno;
         assert(e==EINVAL || e==ERANGE);
-        fprintf(cfg->report,
-                "%s:%d: warning: parameter `%s' could not be parsed"
-                " as a number: %s\n",
-                cfg->filename, set->lineno, n, strerror(e));
+        if (!dont_warn)
+            fprintf(cfg->report,
+                    "%s:%d: warning: parameter `%s' could not be parsed"
+                    " as a number: %s\n",
+                    cfg->filename, set->lineno, n, strerror(e));
         return e;
     }
     if (*ep || ep==set->values[0]) {
-        fprintf(cfg->report,
-                "%s:%d: warning: parameter `%s' is not a valid number\n",
-                cfg->filename, set->lineno, n);
+        if (!dont_warn)
+            fprintf(cfg->report,
+                    "%s:%d: warning: parameter `%s' is not a valid number\n",
+                    cfg->filename, set->lineno, n);
         return EINVAL;
     }
     *value_r= l;
diff -r bc1c875585f5 -r 311982097842 tools/libxl/libxlutil.h
--- a/tools/libxl/libxlutil.h	Tue Nov 29 14:17:27 2011 +0000
+++ b/tools/libxl/libxlutil.h	Tue Nov 29 14:17:27 2011 +0000
@@ -41,13 +41,17 @@
  * Return values are:
  *   0        OK
  *   ESRCH    not defined
- *   EINVAL   value found but wrong format for request (prints warning)
+ *   EINVAL   value found but wrong format for request (prints warning unless dont_warn=true)
  *   ERANGE   value out of range (from strtol)
  */
 
-int xlu_cfg_get_string(const XLU_Config*, const char *n, const char **value_r);
-int xlu_cfg_replace_string(const XLU_Config *cfg, const char *n, char **value_r); /* free/strdup version */
-int xlu_cfg_get_long(const XLU_Config*, const char *n, long *value_r);
+int xlu_cfg_get_string(const XLU_Config*, const char *n, const char **value_r,
+                       int dont_warn);
+/* free/strdup version */
+int xlu_cfg_replace_string(const XLU_Config *cfg, const char *n,
+                           char **value_r, int dont_warn);
+int xlu_cfg_get_long(const XLU_Config*, const char *n, long *value_r,
+                     int dont_warn);
 
 int xlu_cfg_get_list(const XLU_Config*, const char *n,
                      XLU_ConfigList **list_r /* may be 0 */,
diff -r bc1c875585f5 -r 311982097842 tools/libxl/xl.c
--- a/tools/libxl/xl.c	Tue Nov 29 14:17:27 2011 +0000
+++ b/tools/libxl/xl.c	Tue Nov 29 14:17:27 2011 +0000
@@ -62,10 +62,10 @@
         exit(1);
     }
 
-    if (!xlu_cfg_get_long (config, "autoballoon", &l))
+    if (!xlu_cfg_get_long (config, "autoballoon", &l, 0))
         autoballoon = l;
 
-    if (!xlu_cfg_get_string (config, "lockfile", &buf))
+    if (!xlu_cfg_get_string (config, "lockfile", &buf, 0))
         lockfile = strdup(buf);
     else {
         e = asprintf(&lockfile, "%s/xl", (char *)libxl_lock_dir_path());
@@ -75,7 +75,7 @@
         }
     }
 
-    if (!xlu_cfg_get_string (config, "vifscript", &buf))
+    if (!xlu_cfg_get_string (config, "vifscript", &buf, 0))
         default_vifscript = strdup(buf);
 
     xlu_cfg_destroy(config);
diff -r bc1c875585f5 -r 311982097842 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Tue Nov 29 14:17:27 2011 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Tue Nov 29 14:17:27 2011 +0000
@@ -554,7 +554,7 @@
     if (libxl_init_create_info(ctx, c_info))
         exit(1);
 
-    if (!xlu_cfg_get_string (config, "seclabel", &buf)) {
+    if (!xlu_cfg_get_string (config, "seclabel", &buf, 0)) {
         e = libxl_flask_context_to_sid(ctx, (char *)buf, strlen(buf),
                                     &c_info->ssidref);
         if (e) {
@@ -568,19 +568,19 @@
     }
 
     c_info->type = LIBXL_DOMAIN_TYPE_PV;
-    if (!xlu_cfg_get_string (config, "builder", &buf) &&
+    if (!xlu_cfg_get_string (config, "builder", &buf, 0) &&
         !strncmp(buf, "hvm", strlen(buf)))
         c_info->type = LIBXL_DOMAIN_TYPE_HVM;
 
-    if (!xlu_cfg_get_long (config, "hap", &l))
+    if (!xlu_cfg_get_long (config, "hap", &l, 0))
         c_info->hap = l;
 
-    if (xlu_cfg_replace_string (config, "name", &c_info->name)) {
+    if (xlu_cfg_replace_string (config, "name", &c_info->name, 0)) {
         fprintf(stderr, "Domain name must be specified.");
         exit(1);
     }
 
-    if (!xlu_cfg_get_string (config, "uuid", &buf) ) {
+    if (!xlu_cfg_get_string (config, "uuid", &buf, 0) ) {
         if ( libxl_uuid_from_string(&c_info->uuid, buf) ) {
             fprintf(stderr, "Failed to parse UUID: %s\n", buf);
             exit(1);
@@ -589,10 +589,10 @@
         libxl_uuid_generate(&c_info->uuid);
     }
 
-    if (!xlu_cfg_get_long(config, "oos", &l))
+    if (!xlu_cfg_get_long(config, "oos", &l, 0))
         c_info->oos = l;
 
-    if (!xlu_cfg_get_string (config, "pool", &buf)) {
+    if (!xlu_cfg_get_string (config, "pool", &buf, 0)) {
         c_info->poolid = -1;
         cpupool_qualifier_to_cpupoolid(buf, &c_info->poolid, NULL);
     }
@@ -606,37 +606,37 @@
         exit(1);
 
     /* the following is the actual config parsing with overriding values in the structures */
-    if (!xlu_cfg_get_long (config, "vcpus", &l)) {
+    if (!xlu_cfg_get_long (config, "vcpus", &l, 0)) {
         b_info->max_vcpus = l;
         b_info->cur_vcpus = (1 << l) - 1;
     }
 
-    if (!xlu_cfg_get_long (config, "maxvcpus", &l))
+    if (!xlu_cfg_get_long (config, "maxvcpus", &l, 0))
         b_info->max_vcpus = l;
 
-    if (!xlu_cfg_get_long (config, "memory", &l)) {
+    if (!xlu_cfg_get_long (config, "memory", &l, 0)) {
         b_info->max_memkb = l * 1024;
         b_info->target_memkb = b_info->max_memkb;
     }
 
-    if (!xlu_cfg_get_long (config, "maxmem", &l))
+    if (!xlu_cfg_get_long (config, "maxmem", &l, 0))
         b_info->max_memkb = l * 1024;
 
-    if (xlu_cfg_get_string (config, "on_poweroff", &buf))
+    if (xlu_cfg_get_string (config, "on_poweroff", &buf, 0))
         buf = "destroy";
     if (!parse_action_on_shutdown(buf, &d_config->on_poweroff)) {
         fprintf(stderr, "Unknown on_poweroff action \"%s\" specified\n", buf);
         exit(1);
     }
 
-    if (xlu_cfg_get_string (config, "on_reboot", &buf))
+    if (xlu_cfg_get_string (config, "on_reboot", &buf, 0))
         buf = "restart";
     if (!parse_action_on_shutdown(buf, &d_config->on_reboot)) {
         fprintf(stderr, "Unknown on_reboot action \"%s\" specified\n", buf);
         exit(1);
     }
 
-    if (xlu_cfg_get_string (config, "on_watchdog", &buf))
+    if (xlu_cfg_get_string (config, "on_watchdog", &buf, 0))
         buf = "destroy";
     if (!parse_action_on_shutdown(buf, &d_config->on_watchdog)) {
         fprintf(stderr, "Unknown on_watchdog action \"%s\" specified\n", buf);
@@ -644,7 +644,7 @@
     }
 
 
-    if (xlu_cfg_get_string (config, "on_crash", &buf))
+    if (xlu_cfg_get_string (config, "on_crash", &buf, 0))
         buf = "destroy";
     if (!parse_action_on_shutdown(buf, &d_config->on_crash)) {
         fprintf(stderr, "Unknown on_crash action \"%s\" specified\n", buf);
@@ -654,52 +654,52 @@
     /* libxl_get_required_shadow_memory() must be called after final values
      * (default or specified) for vcpus and memory are set, because the
      * calculation depends on those values. */
-    b_info->shadow_memkb = !xlu_cfg_get_long(config, "shadow_memory", &l)
+    b_info->shadow_memkb = !xlu_cfg_get_long(config, "shadow_memory", &l, 0)
         ? l * 1024
         : libxl_get_required_shadow_memory(b_info->max_memkb,
                                            b_info->max_vcpus);
 
-    if (!xlu_cfg_get_long (config, "nomigrate", &l))
+    if (!xlu_cfg_get_long (config, "nomigrate", &l, 0))
         b_info->disable_migrate = l;
 
-    if (!xlu_cfg_get_long(config, "tsc_mode", &l))
+    if (!xlu_cfg_get_long(config, "tsc_mode", &l, 0))
         b_info->tsc_mode = l;
 
-    if (!xlu_cfg_get_long (config, "videoram", &l))
+    if (!xlu_cfg_get_long (config, "videoram", &l, 0))
         b_info->video_memkb = l * 1024;
 
-    if (!xlu_cfg_get_long (config, "gfx_passthru", &l))
+    if (!xlu_cfg_get_long (config, "gfx_passthru", &l, 0))
         dm_info->gfx_passthru = l;
 
     switch(c_info->type) {
     case LIBXL_DOMAIN_TYPE_HVM:
-        if (!xlu_cfg_get_string (config, "kernel", &buf))
+        if (!xlu_cfg_get_string (config, "kernel", &buf, 0))
             fprintf(stderr, "WARNING: ignoring \"kernel\" directive for HVM guest. "
                     "Use \"firmware_override\" instead if you really want a non-default firmware\n");
 
         xlu_cfg_replace_string (config, "firmware_override",
-                                &b_info->u.hvm.firmware);
-        if (!xlu_cfg_get_long (config, "pae", &l))
+                                &b_info->u.hvm.firmware, 0);
+        if (!xlu_cfg_get_long (config, "pae", &l, 0))
             b_info->u.hvm.pae = l;
-        if (!xlu_cfg_get_long (config, "apic", &l))
+        if (!xlu_cfg_get_long (config, "apic", &l, 0))
             b_info->u.hvm.apic = l;
-        if (!xlu_cfg_get_long (config, "acpi", &l))
+        if (!xlu_cfg_get_long (config, "acpi", &l, 0))
             b_info->u.hvm.acpi = l;
-        if (!xlu_cfg_get_long (config, "acpi_s3", &l))
+        if (!xlu_cfg_get_long (config, "acpi_s3", &l, 0))
             b_info->u.hvm.acpi_s3 = l;
-        if (!xlu_cfg_get_long (config, "acpi_s4", &l))
+        if (!xlu_cfg_get_long (config, "acpi_s4", &l, 0))
             b_info->u.hvm.acpi_s4 = l;
-        if (!xlu_cfg_get_long (config, "nx", &l))
+        if (!xlu_cfg_get_long (config, "nx", &l, 0))
             b_info->u.hvm.nx = l;
-        if (!xlu_cfg_get_long (config, "viridian", &l))
+        if (!xlu_cfg_get_long (config, "viridian", &l, 0))
             b_info->u.hvm.viridian = l;
-        if (!xlu_cfg_get_long (config, "hpet", &l))
+        if (!xlu_cfg_get_long (config, "hpet", &l, 0))
             b_info->u.hvm.hpet = l;
-        if (!xlu_cfg_get_long (config, "vpt_align", &l))
+        if (!xlu_cfg_get_long (config, "vpt_align", &l, 0))
             b_info->u.hvm.vpt_align = l;
-        if (!xlu_cfg_get_long (config, "timer_mode", &l))
+        if (!xlu_cfg_get_long (config, "timer_mode", &l, 0))
             b_info->u.hvm.timer_mode = l;
-        if (!xlu_cfg_get_long (config, "nestedhvm", &l))
+        if (!xlu_cfg_get_long (config, "nestedhvm", &l, 0))
             b_info->u.hvm.nested_hvm = l;
         break;
     case LIBXL_DOMAIN_TYPE_PV:
@@ -707,12 +707,12 @@
         char *cmdline = NULL;
         const char *root = NULL, *extra = "";
 
-        xlu_cfg_replace_string (config, "kernel", &b_info->u.pv.kernel.path);
-
-        xlu_cfg_replace_string (config, "kernel", &b_info->u.pv.kernel.path);
-
-        xlu_cfg_get_string (config, "root", &root);
-        xlu_cfg_get_string (config, "extra", &extra);
+        xlu_cfg_replace_string (config, "kernel", &b_info->u.pv.kernel.path, 0);
+
+        xlu_cfg_replace_string (config, "kernel", &b_info->u.pv.kernel.path, 0);
+
+        xlu_cfg_get_string (config, "root", &root, 0);
+        xlu_cfg_get_string (config, "extra", &extra, 0);
 
         if (root) {
             if (asprintf(&cmdline, "root=%s %s", root, extra) == -1)
@@ -726,8 +726,10 @@
             exit(1);
         }
 
-        xlu_cfg_replace_string (config, "bootloader", &b_info->u.pv.bootloader);
-        xlu_cfg_replace_string (config, "bootloader_args", &b_info->u.pv.bootloader_args);
+        xlu_cfg_replace_string (config, "bootloader",
+                                &b_info->u.pv.bootloader, 0);
+        xlu_cfg_replace_string (config, "bootloader_args",
+                                &b_info->u.pv.bootloader_args, 0);
 
         if (!b_info->u.pv.bootloader && !b_info->u.pv.kernel.path) {
             fprintf(stderr, "Neither kernel nor bootloader specified\n");
@@ -735,7 +737,7 @@
         }
 
         b_info->u.pv.cmdline = cmdline;
-        xlu_cfg_replace_string (config, "ramdisk", &b_info->u.pv.ramdisk.path);
+        xlu_cfg_replace_string (config, "ramdisk", &b_info->u.pv.ramdisk.path, 0);
         break;
     }
     default:
@@ -910,15 +912,15 @@
         }
     }
 
-    if (!xlu_cfg_get_long (config, "pci_msitranslate", &l))
+    if (!xlu_cfg_get_long (config, "pci_msitranslate", &l, 0))
         pci_msitranslate = l;
 
-    if (!xlu_cfg_get_long (config, "pci_power_mgmt", &l))
+    if (!xlu_cfg_get_long (config, "pci_power_mgmt", &l, 0))
         pci_power_mgmt = l;
 
     /* To be reworked (automatically enabled) once the auto ballooning
      * after guest starts is done (with PCI devices passed in). */
-    if (!xlu_cfg_get_long (config, "e820_host", &l)) {
+    if (!xlu_cfg_get_long (config, "e820_host", &l, 0)) {
         switch (c_info->type) {
         case LIBXL_DOMAIN_TYPE_HVM:
             fprintf(stderr, "Can't do e820_host in HVM mode!");
@@ -986,7 +988,7 @@
         }
         break;
     case EINVAL:    /* config option is not a list, parse as a string */
-        if (!xlu_cfg_get_string(config, "cpuid", &buf)) {
+        if (!xlu_cfg_get_string(config, "cpuid", &buf, 0)) {
             char *buf2, *p, *strtok_ptr = NULL;
             const char *errstr;
 
@@ -1034,7 +1036,7 @@
     if (libxl_init_dm_info(ctx, dm_info, c_info, b_info))
         exit(1);
     /* parse device model arguments, this works for pv, hvm and stubdom */
-    if (!xlu_cfg_get_string (config, "device_model", &buf)) {
+    if (!xlu_cfg_get_string (config, "device_model", &buf, 0)) {
         fprintf(stderr,
                 "WARNING: ignoring device_model directive.\n"
                 "WARNING: Use \"device_model_override\" instead if you"
@@ -1053,8 +1055,8 @@
 
 
     xlu_cfg_replace_string (config, "device_model_override",
-                            &dm_info->device_model);
-    if (!xlu_cfg_get_string (config, "device_model_version", &buf)) {
+                            &dm_info->device_model, 0);
+    if (!xlu_cfg_get_string (config, "device_model_version", &buf, 0)) {
         if (!strcmp(buf, "qemu-xen-traditional")) {
             dm_info->device_model_version
                 = LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL;
@@ -1068,7 +1070,7 @@
         }
     } else if (dm_info->device_model)
         fprintf(stderr, "WARNING: device model override given without specific DM version\n");
-    if (!xlu_cfg_get_long (config, "device_model_stubdomain_override", &l))
+    if (!xlu_cfg_get_long (config, "device_model_stubdomain_override", &l, 0))
         dm_info->device_model_stubdomain = l;
 
 #define parse_extra_args(type)                                          \
@@ -1096,46 +1098,46 @@
 #undef parse_extra_args
 
     if (c_info->type == LIBXL_DOMAIN_TYPE_HVM) {
-        if (!xlu_cfg_get_long (config, "stdvga", &l))
+        if (!xlu_cfg_get_long (config, "stdvga", &l, 0))
             dm_info->stdvga = l;
-        if (!xlu_cfg_get_long (config, "vnc", &l))
+        if (!xlu_cfg_get_long (config, "vnc", &l, 0))
             dm_info->vnc = l;
-        xlu_cfg_replace_string (config, "vnclisten", &dm_info->vnclisten);
-        xlu_cfg_replace_string (config, "vncpasswd", &dm_info->vncpasswd);
-        if (!xlu_cfg_get_long (config, "vncdisplay", &l))
+        xlu_cfg_replace_string (config, "vnclisten", &dm_info->vnclisten, 0);
+        xlu_cfg_replace_string (config, "vncpasswd", &dm_info->vncpasswd, 0);
+        if (!xlu_cfg_get_long (config, "vncdisplay", &l, 0))
             dm_info->vncdisplay = l;
-        if (!xlu_cfg_get_long (config, "vncunused", &l))
+        if (!xlu_cfg_get_long (config, "vncunused", &l, 0))
             dm_info->vncunused = l;
-        xlu_cfg_replace_string (config, "keymap", &dm_info->keymap);
-        if (!xlu_cfg_get_long (config, "sdl", &l))
+        xlu_cfg_replace_string (config, "keymap", &dm_info->keymap, 0);
+        if (!xlu_cfg_get_long (config, "sdl", &l, 0))
             dm_info->sdl = l;
-        if (!xlu_cfg_get_long (config, "opengl", &l))
+        if (!xlu_cfg_get_long (config, "opengl", &l, 0))
             dm_info->opengl = l;
-        if (!xlu_cfg_get_long (config, "spice", &l))
+        if (!xlu_cfg_get_long (config, "spice", &l, 0))
             dm_info->spice = l;
-        if (!xlu_cfg_get_long (config, "spiceport", &l))
+        if (!xlu_cfg_get_long (config, "spiceport", &l, 0))
             dm_info->spiceport = l;
-        if (!xlu_cfg_get_long (config, "spicetls_port", &l))
+        if (!xlu_cfg_get_long (config, "spicetls_port", &l, 0))
             dm_info->spicetls_port = l;
-        xlu_cfg_replace_string (config, "spicehost", &dm_info->spicehost);
-        if (!xlu_cfg_get_long (config, "spicedisable_ticketing", &l))
+        xlu_cfg_replace_string (config, "spicehost", &dm_info->spicehost, 0);
+        if (!xlu_cfg_get_long (config, "spicedisable_ticketing", &l, 0))
             dm_info->spicedisable_ticketing = l;
-        xlu_cfg_replace_string (config, "spicepasswd", &dm_info->spicepasswd);
-        if (!xlu_cfg_get_long (config, "spiceagent_mouse", &l))
+        xlu_cfg_replace_string (config, "spicepasswd", &dm_info->spicepasswd, 0);
+        if (!xlu_cfg_get_long (config, "spiceagent_mouse", &l, 0))
             dm_info->spiceagent_mouse = l;
         else
             dm_info->spiceagent_mouse = 1;
-        if (!xlu_cfg_get_long (config, "nographic", &l))
+        if (!xlu_cfg_get_long (config, "nographic", &l, 0))
             dm_info->nographic = l;
-        if (!xlu_cfg_get_long (config, "gfx_passthru", &l))
+        if (!xlu_cfg_get_long (config, "gfx_passthru", &l, 0))
             dm_info->gfx_passthru = l;
-        xlu_cfg_replace_string (config, "serial", &dm_info->serial);
-        xlu_cfg_replace_string (config, "boot", &dm_info->boot);
-        if (!xlu_cfg_get_long (config, "usb", &l))
+        xlu_cfg_replace_string (config, "serial", &dm_info->serial, 0);
+        xlu_cfg_replace_string (config, "boot", &dm_info->boot, 0);
+        if (!xlu_cfg_get_long (config, "usb", &l, 0))
             dm_info->usb = l;
-        xlu_cfg_replace_string (config, "usbdevice", &dm_info->usbdevice);
-        xlu_cfg_replace_string (config, "soundhw", &dm_info->soundhw);
-        if (!xlu_cfg_get_long (config, "xen_platform_pci", &l))
+        xlu_cfg_replace_string (config, "usbdevice", &dm_info->usbdevice, 0);
+        xlu_cfg_replace_string (config, "soundhw", &dm_info->soundhw, 0);
+        if (!xlu_cfg_get_long (config, "xen_platform_pci", &l, 0))
             dm_info->xen_platform_pci = l;
     }
 
@@ -4766,7 +4768,7 @@
         return -ERROR_FAIL;
     }
 
-    if (!xlu_cfg_get_string (config, "name", &buf))
+    if (!xlu_cfg_get_string (config, "name", &buf, 0))
         name = strdup(buf);
     else
         name = libxl_basename(filename);
@@ -4775,7 +4777,7 @@
         return -ERROR_FAIL;
     }
 
-    if (!xlu_cfg_get_string (config, "sched", &buf)) {
+    if (!xlu_cfg_get_string (config, "sched", &buf, 0)) {
         if ((schedid = libxl_name_to_schedid(ctx, buf)) < 0) {
             fprintf(stderr, "Unknown scheduler\n");
             return -ERROR_FAIL;

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:29 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY74-0006TR-PM; Wed, 30 Nov 2011 00:33:26 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY73-0006Qi-BQ
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-216.messagelabs.com!1322613165!5549972!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6589 invoked from network); 30 Nov 2011 00:32:46 -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;
	30 Nov 2011 00:32:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVYCt-0003ur-1E
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6q-0003kv-Oq
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:12 +0000
Message-Id: <E1RVY6q-0003kv-Oq@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: generate an index for the html
	output
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322576247 0
# Node ID b30064469a0355cbec71983b16139df19d0d6dca
# Parent  faa863f0343f5e6e7dc813227bfd03a8cd04bfe7
docs: generate an index for the html output

nb: I'm not a Perl wizard...

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


diff -r faa863f0343f -r b30064469a03 docs/INDEX
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/INDEX	Tue Nov 29 14:17:27 2011 +0000
@@ -0,0 +1,5 @@
+misc/hvm-emulated-unplug	Xen HVM emulated device unplug protocol
+
+# These are not all that useful anymore, hide them from the index
+interface/index			NO-INDEX
+user/index			NO-INDEX
diff -r faa863f0343f -r b30064469a03 docs/Makefile
--- a/docs/Makefile	Tue Nov 29 14:17:27 2011 +0000
+++ b/docs/Makefile	Tue Nov 29 14:17:27 2011 +0000
@@ -45,7 +45,7 @@
 pdf: $(DOC_PDF)
 
 .PHONY: html
-html: $(DOC_HTML)
+html: $(DOC_HTML) html/index.html
 
 .PHONY: txt
 txt: $(DOC_TXT)
@@ -128,6 +128,9 @@
 	$< 1>/dev/null 2>/dev/null ; else \
 	echo "latex2html not installed; skipping $*."; fi
 
+html/index.html: $(DOC_HTML) ./gen-html-index INDEX
+	perl -w -- ./gen-html-index -i INDEX html $(DOC_HTML)
+
 html/%.html: %.markdown
 	@$(INSTALL_DIR) $(@D)
 	@set -e ; if which $(MARKDOWN) 1>/dev/null 2>/dev/null; then \
diff -r faa863f0343f -r b30064469a03 docs/gen-html-index
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/gen-html-index	Tue Nov 29 14:17:27 2011 +0000
@@ -0,0 +1,136 @@
+#!/usr/bin/env perl
+
+#
+# Generate indexes for html documentation
+#
+
+use strict;
+use warnings;
+
+use Getopt::Long;
+use IO::File;
+use File::Basename;
+use List::MoreUtils qw/ uniq /;
+
+Getopt::Long::Configure('bundling');
+
+@ARGV >= 2 or die;
+
+our @docs;
+our @dirs;
+our %index;
+
+our $outdir;
+
+GetOptions("i=s" => sub { read_index(@_);} )
+    or die;
+
+($outdir,@docs) = @ARGV;
+
+sub write_file ($$) {
+    my ($opath, $odata) = @_;
+    print STDOUT "Writing: $opath\n";
+    my $out = new IO::File "$opath.new", '>' or die "$opath $!";
+    print $out $odata or die $!;
+    rename "$opath.new", "$opath" or die "$opath $!";
+}
+
+sub make_page ($$$) {
+    my ($file,$title,$content) = @_;
+    my $o = '';
+    my $h1;
+    if ( $title eq "" )
+    {
+        $title = $h1 = "Xen Documentation";
+    }
+    else
+    {
+        $h1 = "<a href=\"../index.(?:html|txt)\">Xen Documentation</a> - $title";
+        $title = "Xen Documentation - $title";
+    }
+    $o .= <<END;
+<html><head><title>$title</title></head>
+<body>
+<h1>$h1</h1>
+<ul>
+$content
+</ul>
+</body></html>
+END
+    write_file($file, $o);
+}
+
+sub make_linktext ($) {
+    my ($l) = @_;
+    return "$1($2)" if $l =~ m,^man/(.*)\.([0-9].*)\.html,;
+    $l =~ s/.(html)$//g;
+    return $index{$l} if exists $index{$l};
+    return basename($l);
+}
+
+sub make_link ($$) {
+    my ($ref,$base) = @_;
+
+    my $txt = make_linktext($ref);
+    $ref = basename($ref) if $base;
+
+    return "<li><a href=\"$ref\">$txt</a></li>\n";
+}
+
+sub make_links ($$@) {
+    my ($dir,$base,@docs) = @_;
+    my $idx = '';
+    foreach my $of (sort { $a cmp $b } @docs) {
+        $idx .= make_link($of,$base);
+    }
+    return $idx;
+}
+
+sub read_index ($$) {
+    my ($opt, $val) = @_;
+    my $idx = new IO::File "$val", '<' or die "$val $!";
+    while ($_ = $idx->getline()) {
+	s/^\s+//;
+	s/\s+$//;
+	next if m/^\#/;
+	next unless m/\S/;
+	m/^(\S+)\s+(\S.*)$/ or die;
+        $index{$1} = $2;
+    }
+}
+
+for (@docs) { s,^\Q$outdir\E/,, }
+
+@docs = grep { -e "$outdir/$_" && (make_linktext($_) ne "NO-INDEX") } @docs;
+
+my $top = '';
+
+foreach my $od (sort { $a cmp $b } uniq map { dirname($_) } @docs) {
+    my @d = (grep /^\Q$od\E/, @docs);
+    if ( @d == 1 and $d[0] eq "$od/index.html" )
+    {
+        $top .= "<li><a href=\"${od}/index.html\">${od}/index.html</a></li>\n";
+    }
+    else
+    {
+	my $links = make_links($od,0,@d);
+	$top .= <<END;
+<li><a href=\"${od}/index.html\">$od</a></li>
+<ul>
+$links
+</ul>
+END
+
+	$links = make_links($od,1,@d);
+        my $idx = '';
+	$idx .= <<END;
+<li>$od</li>
+<ul>
+$links
+</ul>
+END
+        make_page("$outdir/$od/index.html", $od, $idx);
+    }
+}
+
+make_page("$outdir/index.html", "", $top);

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:30 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY74-0006TM-MS; Wed, 30 Nov 2011 00:33: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 1RVY73-0006Rt-2o
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-27.messagelabs.com!1322613123!58828962!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8194 invoked from network); 30 Nov 2011 00:32:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Nov 2011 00:32: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 1RVYCw-0003vC-HI
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6u-0003mg-8l
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:16 +0000
Message-Id: <E1RVY6u-0003mg-8l@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs/html/: Initial cut of header
	documentation massager
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Jackson <ian.jackson@eu.citrix.com>
# Date 1322581686 0
# Node ID 549b8f4b9560e4947f625656b80ad3218da91675
# Parent  dd7cf728df178676cab626986caa27c04492619a
docs/html/: Initial cut of header documentation massager

"xen-headers" generates HTML from header files.  So far this generates
just some type cross-references, if you say
   make -C docs html/hypercall/stamp

An index page, proper wiring into the build system, and a few more
annotations in the headers, and will be forthcoming.

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 dd7cf728df17 -r 549b8f4b9560 docs/Makefile
--- a/docs/Makefile	Tue Nov 29 14:19:59 2011 +0000
+++ b/docs/Makefile	Tue Nov 29 15:48:06 2011 +0000
@@ -154,6 +154,14 @@
 	$(POD2HTML) --infile=$< --outfile=$@.tmp
 	$(call move-if-changed,$@.tmp,$@)
 
+html/hypercall/stamp:
+	@$(INSTALL_DIR) $(@D)
+	./xen-headers -O $(@D) \
+		-T 'arch-x86_64 - Xen public headers' \
+		-X arch-ia64 -X arch-x86_32 -X xen-x86_32 \
+		../xen include/public
+	touch $@
+
 txt/%.txt: %.txt
 	$(INSTALL_DIR) $(@D)
 	cp $< $@.tmp
diff -r dd7cf728df17 -r 549b8f4b9560 docs/xen-headers
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/xen-headers	Tue Nov 29 15:48:06 2011 +0000
@@ -0,0 +1,292 @@
+#!/usr/bin/perl -w
+# usage: xen-headers OPTIONS... BASE-DIR INPUT-SUB-DIR...
+#  INPUT-SUB-DIR must be a relative path, and is interpreted
+#  relative to BASE-DIR.  Only files whose names end .h are processed
+# options:
+#   -O HTML-DIR             write html to this directory (mandatory)
+#   -T EXTRA-TITLE-HTML     tail of title string (used in <title>)
+#   -X GLOB | -I GLOB       include/exclude files matching;
+#                            glob patterns matched against /INPUT-SUB-FILE
+#                            first match wins; if no match, files included
+#   -D                      increase debug
+
+# Functionality:
+#  enum values --> selected function or struct
+#  type & function names, macro definitions --> definition
+#  function or struct selected by enum ++> ref to enum value
+
+#  definitions must start in LH column
+#  extra syntax:
+#    /* ` <definition>                          } parse as if <definition>
+#     * ` <definition>                          }  was not commented
+#   enum <name> { // <pattern>* => <func>()     } cross-reference
+#   enum <name> { // <pattern>* => struct <s>   }  enum values
+#   
+
+# 1st pass: find where things are defined and what references are wanted
+# 2rd pass: write out output
+
+use strict;
+use warnings;
+
+use Getopt::Long;
+use File::Find;
+use IO::File;
+
+Getopt::Long::Configure('bundling');
+
+our $outdir;
+our $debug=0;
+our $xtitle='';
+our @fglobs;
+
+sub includeexclude {
+    my ($yn, $optobj, $value) = @_;
+    push @fglobs, [ $value, $yn ];
+}
+
+GetOptions("O|output-dir=s" => \$outdir,
+           "D+" => \$debug,
+           "T=s" => \$xtitle,
+           "I=s" => sub { includeexclude(1, @_); },
+           "X=s" => sub { includeexclude(0, @_); })
+    or die;
+
+die unless defined $outdir;
+@ARGV>=2 or die;
+
+my ($basedir,@indirs) = @ARGV;
+
+# general globals
+our $pass;
+our %sdef; 
+# $sdef{$type}{$name} => {
+#     DefLocs => { "$leaf_path:$lineno" => $leaf_opath ,... }
+#     Xrefs => { "$leaf_path,$lineno" => "$xref", ... }
+#     Used => 1
+# }
+# $type might be  Func Struct Union Enum EnumVal
+
+# provided by the find() function
+our $leaf;
+our $leaf_opath;
+
+# reset at the start of each file
+our $o;
+our $in_enum;
+our @pending_xrefs;
+
+sub compile_fglobs () {
+    local ($_);
+    my $f = "sub file_wanted (\$) {\n    local (\$_) = \"/\$leaf\";\n";
+    foreach my $fglob (@fglobs) {
+	$_ = $fglob->[0];
+	$_ = "**$_**" unless m/[?*]/;
+	s/\W/\\$&/g;
+	s,\\\*\\\*,.*,g;
+	s,\\\*,[^/]*,g;
+	s,\\\?,[^/],g;
+	$f .= "    return $fglob->[1] if m,$_,o;\n";
+    }
+    $f .= "    return 1;\n}\n1;\n";
+    debug(3, $f);
+    eval $f or die "$@ ";
+}
+
+compile_fglobs();
+
+
+sub warning {
+    print STDERR "$leaf:$.: @_\n";
+}
+
+sub debug {
+    my $msglevel = scalar shift @_;
+    return unless $debug >= $msglevel;
+    print STDERR "DEBUG $pass $msglevel @_\n" or die $!;
+}
+
+sub in_enum ($$$) { $in_enum = [ @_ ]; } # [ $enumvalpfx, RefType, $refnamepfx ]
+
+sub aelem ($$$) {
+    my ($ntext,$ytext,$hparams) = @_;
+    return $ntext unless $hparams =~ m/\S/;
+    return "<a $hparams>$ytext</a>";
+}
+
+sub defn ($$$;$) {
+    my ($text,$type,$name,$hparams) = @_;
+    $hparams='' if !defined $hparams;
+    debug(2,"DEFN $. $type $name $hparams");
+    $sdef{$type}{$name}{DefLocs}{"$leaf:$."} = $leaf_opath;
+    my $xrefs = $sdef{$type}{$name}{Xrefs};
+    push @pending_xrefs, values %$xrefs if $xrefs;
+    $hparams .= " name=\"${type}_$name\"" if $sdef{$type}{$name}{Used};
+    return aelem($text, "<strong>$text</strong>", $hparams);
+}
+
+sub norm ($) {
+    local ($_) = @_;
+    my $no = '';
+    while (length) {
+	if (s/^(?:\s|^\W)+//) {
+	    $no .= $&;
+	} elsif (s/^(struct|union|enum)\s+(\w+)\b//) {
+	    $no .= ahref($&, (ucfirst $1), $2);
+	} elsif (s/^\w+\b//) {
+	    $no .= ahref($&, 'Func', $&);
+	} else {
+	    die "$_ ?";
+	}
+    }
+    return $no;
+}
+
+sub refhref ($$) {
+    my ($type,$name) = @_;
+    $sdef{$type}{$name}{Used} = 1;
+    my $locs = $sdef{$type}{$name}{DefLocs};
+    return '' unless $locs;
+    if ((scalar keys %$locs) != 1 && !$sdef{$type}{$name}{MultiWarned}) {
+	warning("multiple definitions of $type $name: $_")
+	    foreach keys %$locs;
+	$sdef{$type}{$name}{MultiWarned}=1;
+    }
+    my ($loc) = values %$locs;
+    return "href=\"$loc#${type}_$name\"";
+}
+
+sub ahref ($$$) {
+    my ($text,$type,$name) = @_;
+    return aelem($text,$text, refhref($type,$name));
+}
+
+sub defmacro ($) {
+    my ($valname) = @_;
+    if (!$in_enum) {
+	return $valname;
+    } elsif (substr($valname, 0, (length $in_enum->[0])) ne $in_enum->[0]) {
+	warning("in enum expecting $in_enum->[0]* got $valname");
+	return $valname;
+    } else {
+	my $reftype = $in_enum->[1];
+	my $refname = $in_enum->[2].substr($valname, (length $in_enum->[0]));
+	$sdef{$reftype}{$refname}{Xrefs}{$leaf,$.} =
+	    "[see <a href=\"$leaf_opath#EnumVal_$valname\">$valname</a>]";
+	$sdef{EnumVal}{$valname}{Used} = 1;
+	return defn($valname,'EnumVal',$valname, refhref($reftype,$refname));
+    }
+}
+
+sub out_xrefs ($) {
+    my ($linemapfunc) = @_;
+    foreach my $xref (@pending_xrefs) {
+	$o .= $linemapfunc->($xref);
+	$o .= "\n";
+    }
+    @pending_xrefs = ();
+}
+
+sub write_file ($$) {
+    my ($opath, $odata) = @_;
+    my $out = new IO::File "$opath.new", '>' or die "$opath $!";
+    print $out $odata or die $!;
+    rename "$opath.new", "$opath" or die "$opath $!";
+}
+
+sub process_file ($$) {
+    my ($infile, $outfile) = @_;
+    debug(1,"$pass $infile => $outfile");
+    my $in = new IO::File "$infile", '<' or die "$infile $!";
+
+    $o = '';
+    $in_enum = undef;
+    @pending_xrefs = ();
+
+    $o .= "<html><head><title>$leaf - $xtitle</title></head><body><pre>\n";
+    
+    while (<$in>) {
+	s/\&/\&amp;/g;
+	s/\</\&lt;/g;
+	s/\>/\&gt;/g;
+
+	if (m/^(.*\`)[ \t]*$/) {
+	    my $lhs = $1;
+	    out_xrefs(sub { "$1 $_[0]"; });
+	} elsif (m/^\s*$/) {
+	    out_xrefs(sub { sprintf "/* %70s */", $_[0]; });
+	}
+
+	# In case of comments, strip " /* ` " and " * ` ";
+	my $lstripped = s,^ \s* /? \* \s* \` \  ,,x ? $&: '';
+
+	# Strip trailing whitespace and perhaps trailing "*/" or "*"
+	s,(?: \s* \* /? )? \s* $,,x or die;
+	my $rstripped = $&;
+
+	# Now the actual functionality:
+
+	debug(3,"$. $_");
+
+	if (!m/^(?: __attribute__ | __pragma__ )\b/x &&
+	    s/^( (?: \w+\  )? ) (\w+[a-z]\w+) ( \( .*)$
+             / $1.defn($2,'Func',$2).norm($3) /xe) {
+	} elsif (s/^((struct|union|enum) \  (\w+)) ( \s+ \{ .* )$
+                  / defn($1,(ucfirst $2),$3).norm($4) /xe) {
+	    if ($2 eq 'enum') {
+		if (m,/[/*] (\w+)\* \=\&gt\; (\w+)\*\(\),) { 
+		    in_enum($1,'Func',$2)
+		} elsif (m,/[/*] (\w+)\* \=\&gt\; (struct) (\w+)\*,) { 
+		    in_enum($1,(ucfirst $2),$3);
+	        }
+	    }
+	} elsif (s/^( \s* \#define \s+ ) (\w+) ( \s+\S )
+                  / $1.defmacro($2).norm($3) /xe) {
+	} else {
+	    if (m/^\s*\}/) {
+		$in_enum = undef;
+	    }
+	    $_ = norm($_);
+	}
+
+	# Write the line out
+
+	if ($pass == 2) {
+	    $o .= $lstripped;
+	    $o .= $_;
+	    $o .= $rstripped;
+	}
+    }
+
+    warning("pending xrefs at end of file") if @pending_xrefs;
+
+    if ($pass == 2) {
+	$o .= "</pre></body></html>";
+	write_file($outfile, $o);
+    }
+}
+
+
+foreach $pass (qw(1 2)) {
+    find({ wanted => 
+	       sub {
+		   return unless m/\.h$/;
+		   lstat $File::Find::name or die "$File::Find::name $!";
+		   -f _ or die "$File::Find::name";
+		   substr($File::Find::name, 0, 1+length $basedir) 
+		       eq "$basedir/"
+		       or die "$File::Find::name $basedir";
+		   $leaf = substr($File::Find::name, 1+length $basedir);
+		   if (!file_wanted()) {
+		       debug(1,"$pass $File::Find::name excluded");
+		       return;
+		   }
+		   $leaf_opath = $leaf;
+		   $leaf_opath =~ s#/#,#g;
+		   $leaf_opath .= ".html";
+		   process_file($File::Find::name, $outdir.'/'.$leaf_opath);
+	   },
+	   no_chdir => 1,
+	 },
+	 map { "$basedir/$_" } @indirs);
+}

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:30 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY74-0006Tg-WD; Wed, 30 Nov 2011 00:33:27 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY73-0006Qh-5S
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-174.messagelabs.com!1322613164!3571174!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14508 invoked from network); 30 Nov 2011 00:32:45 -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;
	30 Nov 2011 00:32:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVYCr-0003uf-1f
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6o-0003jx-PD
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:10 +0000
Message-Id: <E1RVY6o-0003jx-PD@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xlu: add "dont_warn" to xlu_cfg_*
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322576247 0
# Node ID 311982097842a03340556838f43e24db9a402dca
# Parent  bc1c875585f580e0a5c1483f8597141bbdb74b4f
xlu: add "dont_warn" to xlu_cfg_*

I want it for get_long but we might as well have it everywhere.

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


diff -r bc1c875585f5 -r 311982097842 tools/libxl/libxlu_cfg.c
--- a/tools/libxl/libxlu_cfg.c	Tue Nov 29 14:17:27 2011 +0000
+++ b/tools/libxl/libxlu_cfg.c	Tue Nov 29 14:17:27 2011 +0000
@@ -165,17 +165,18 @@
 }
 
 static int find_atom(const XLU_Config *cfg, const char *n,
-                     XLU_ConfigSetting **set_r) {
+                     XLU_ConfigSetting **set_r, int dont_warn) {
     XLU_ConfigSetting *set;
 
     set= find(cfg,n);
     if (!set) return ESRCH;
 
     if (set->avalues!=1) {
-        fprintf(cfg->report,
-                "%s:%d: warning: parameter `%s' is"
-                " a list but should be a single value\n",
-                cfg->filename, set->lineno, n);
+        if (!dont_warn)
+            fprintf(cfg->report,
+                    "%s:%d: warning: parameter `%s' is"
+                    " a list but should be a single value\n",
+                    cfg->filename, set->lineno, n);
         return EINVAL;
     }
     *set_r= set;
@@ -183,49 +184,51 @@
 }
 
 int xlu_cfg_get_string(const XLU_Config *cfg, const char *n,
-                       const char **value_r) {
+                       const char **value_r, int dont_warn) {
     XLU_ConfigSetting *set;
     int e;
 
-    e= find_atom(cfg,n,&set);  if (e) return e;
+    e= find_atom(cfg,n,&set,dont_warn);  if (e) return e;
     *value_r= set->values[0];
     return 0;
 }
 
 int xlu_cfg_replace_string(const XLU_Config *cfg, const char *n,
-                           char **value_r) {
+                           char **value_r, int dont_warn) {
     XLU_ConfigSetting *set;
     int e;
 
-    e= find_atom(cfg,n,&set);  if (e) return e;
+    e= find_atom(cfg,n,&set,dont_warn);  if (e) return e;
     free(*value_r);
     *value_r= strdup(set->values[0]);
     return 0;
 }
 
 int xlu_cfg_get_long(const XLU_Config *cfg, const char *n,
-                     long *value_r) {
+                     long *value_r, int dont_warn) {
     long l;
     XLU_ConfigSetting *set;
     int e;
     char *ep;
 
-    e= find_atom(cfg,n,&set);  if (e) return e;
+    e= find_atom(cfg,n,&set,dont_warn);  if (e) return e;
     errno= 0; l= strtol(set->values[0], &ep, 0);
     e= errno;
     if (errno) {
         e= errno;
         assert(e==EINVAL || e==ERANGE);
-        fprintf(cfg->report,
-                "%s:%d: warning: parameter `%s' could not be parsed"
-                " as a number: %s\n",
-                cfg->filename, set->lineno, n, strerror(e));
+        if (!dont_warn)
+            fprintf(cfg->report,
+                    "%s:%d: warning: parameter `%s' could not be parsed"
+                    " as a number: %s\n",
+                    cfg->filename, set->lineno, n, strerror(e));
         return e;
     }
     if (*ep || ep==set->values[0]) {
-        fprintf(cfg->report,
-                "%s:%d: warning: parameter `%s' is not a valid number\n",
-                cfg->filename, set->lineno, n);
+        if (!dont_warn)
+            fprintf(cfg->report,
+                    "%s:%d: warning: parameter `%s' is not a valid number\n",
+                    cfg->filename, set->lineno, n);
         return EINVAL;
     }
     *value_r= l;
diff -r bc1c875585f5 -r 311982097842 tools/libxl/libxlutil.h
--- a/tools/libxl/libxlutil.h	Tue Nov 29 14:17:27 2011 +0000
+++ b/tools/libxl/libxlutil.h	Tue Nov 29 14:17:27 2011 +0000
@@ -41,13 +41,17 @@
  * Return values are:
  *   0        OK
  *   ESRCH    not defined
- *   EINVAL   value found but wrong format for request (prints warning)
+ *   EINVAL   value found but wrong format for request (prints warning unless dont_warn=true)
  *   ERANGE   value out of range (from strtol)
  */
 
-int xlu_cfg_get_string(const XLU_Config*, const char *n, const char **value_r);
-int xlu_cfg_replace_string(const XLU_Config *cfg, const char *n, char **value_r); /* free/strdup version */
-int xlu_cfg_get_long(const XLU_Config*, const char *n, long *value_r);
+int xlu_cfg_get_string(const XLU_Config*, const char *n, const char **value_r,
+                       int dont_warn);
+/* free/strdup version */
+int xlu_cfg_replace_string(const XLU_Config *cfg, const char *n,
+                           char **value_r, int dont_warn);
+int xlu_cfg_get_long(const XLU_Config*, const char *n, long *value_r,
+                     int dont_warn);
 
 int xlu_cfg_get_list(const XLU_Config*, const char *n,
                      XLU_ConfigList **list_r /* may be 0 */,
diff -r bc1c875585f5 -r 311982097842 tools/libxl/xl.c
--- a/tools/libxl/xl.c	Tue Nov 29 14:17:27 2011 +0000
+++ b/tools/libxl/xl.c	Tue Nov 29 14:17:27 2011 +0000
@@ -62,10 +62,10 @@
         exit(1);
     }
 
-    if (!xlu_cfg_get_long (config, "autoballoon", &l))
+    if (!xlu_cfg_get_long (config, "autoballoon", &l, 0))
         autoballoon = l;
 
-    if (!xlu_cfg_get_string (config, "lockfile", &buf))
+    if (!xlu_cfg_get_string (config, "lockfile", &buf, 0))
         lockfile = strdup(buf);
     else {
         e = asprintf(&lockfile, "%s/xl", (char *)libxl_lock_dir_path());
@@ -75,7 +75,7 @@
         }
     }
 
-    if (!xlu_cfg_get_string (config, "vifscript", &buf))
+    if (!xlu_cfg_get_string (config, "vifscript", &buf, 0))
         default_vifscript = strdup(buf);
 
     xlu_cfg_destroy(config);
diff -r bc1c875585f5 -r 311982097842 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Tue Nov 29 14:17:27 2011 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Tue Nov 29 14:17:27 2011 +0000
@@ -554,7 +554,7 @@
     if (libxl_init_create_info(ctx, c_info))
         exit(1);
 
-    if (!xlu_cfg_get_string (config, "seclabel", &buf)) {
+    if (!xlu_cfg_get_string (config, "seclabel", &buf, 0)) {
         e = libxl_flask_context_to_sid(ctx, (char *)buf, strlen(buf),
                                     &c_info->ssidref);
         if (e) {
@@ -568,19 +568,19 @@
     }
 
     c_info->type = LIBXL_DOMAIN_TYPE_PV;
-    if (!xlu_cfg_get_string (config, "builder", &buf) &&
+    if (!xlu_cfg_get_string (config, "builder", &buf, 0) &&
         !strncmp(buf, "hvm", strlen(buf)))
         c_info->type = LIBXL_DOMAIN_TYPE_HVM;
 
-    if (!xlu_cfg_get_long (config, "hap", &l))
+    if (!xlu_cfg_get_long (config, "hap", &l, 0))
         c_info->hap = l;
 
-    if (xlu_cfg_replace_string (config, "name", &c_info->name)) {
+    if (xlu_cfg_replace_string (config, "name", &c_info->name, 0)) {
         fprintf(stderr, "Domain name must be specified.");
         exit(1);
     }
 
-    if (!xlu_cfg_get_string (config, "uuid", &buf) ) {
+    if (!xlu_cfg_get_string (config, "uuid", &buf, 0) ) {
         if ( libxl_uuid_from_string(&c_info->uuid, buf) ) {
             fprintf(stderr, "Failed to parse UUID: %s\n", buf);
             exit(1);
@@ -589,10 +589,10 @@
         libxl_uuid_generate(&c_info->uuid);
     }
 
-    if (!xlu_cfg_get_long(config, "oos", &l))
+    if (!xlu_cfg_get_long(config, "oos", &l, 0))
         c_info->oos = l;
 
-    if (!xlu_cfg_get_string (config, "pool", &buf)) {
+    if (!xlu_cfg_get_string (config, "pool", &buf, 0)) {
         c_info->poolid = -1;
         cpupool_qualifier_to_cpupoolid(buf, &c_info->poolid, NULL);
     }
@@ -606,37 +606,37 @@
         exit(1);
 
     /* the following is the actual config parsing with overriding values in the structures */
-    if (!xlu_cfg_get_long (config, "vcpus", &l)) {
+    if (!xlu_cfg_get_long (config, "vcpus", &l, 0)) {
         b_info->max_vcpus = l;
         b_info->cur_vcpus = (1 << l) - 1;
     }
 
-    if (!xlu_cfg_get_long (config, "maxvcpus", &l))
+    if (!xlu_cfg_get_long (config, "maxvcpus", &l, 0))
         b_info->max_vcpus = l;
 
-    if (!xlu_cfg_get_long (config, "memory", &l)) {
+    if (!xlu_cfg_get_long (config, "memory", &l, 0)) {
         b_info->max_memkb = l * 1024;
         b_info->target_memkb = b_info->max_memkb;
     }
 
-    if (!xlu_cfg_get_long (config, "maxmem", &l))
+    if (!xlu_cfg_get_long (config, "maxmem", &l, 0))
         b_info->max_memkb = l * 1024;
 
-    if (xlu_cfg_get_string (config, "on_poweroff", &buf))
+    if (xlu_cfg_get_string (config, "on_poweroff", &buf, 0))
         buf = "destroy";
     if (!parse_action_on_shutdown(buf, &d_config->on_poweroff)) {
         fprintf(stderr, "Unknown on_poweroff action \"%s\" specified\n", buf);
         exit(1);
     }
 
-    if (xlu_cfg_get_string (config, "on_reboot", &buf))
+    if (xlu_cfg_get_string (config, "on_reboot", &buf, 0))
         buf = "restart";
     if (!parse_action_on_shutdown(buf, &d_config->on_reboot)) {
         fprintf(stderr, "Unknown on_reboot action \"%s\" specified\n", buf);
         exit(1);
     }
 
-    if (xlu_cfg_get_string (config, "on_watchdog", &buf))
+    if (xlu_cfg_get_string (config, "on_watchdog", &buf, 0))
         buf = "destroy";
     if (!parse_action_on_shutdown(buf, &d_config->on_watchdog)) {
         fprintf(stderr, "Unknown on_watchdog action \"%s\" specified\n", buf);
@@ -644,7 +644,7 @@
     }
 
 
-    if (xlu_cfg_get_string (config, "on_crash", &buf))
+    if (xlu_cfg_get_string (config, "on_crash", &buf, 0))
         buf = "destroy";
     if (!parse_action_on_shutdown(buf, &d_config->on_crash)) {
         fprintf(stderr, "Unknown on_crash action \"%s\" specified\n", buf);
@@ -654,52 +654,52 @@
     /* libxl_get_required_shadow_memory() must be called after final values
      * (default or specified) for vcpus and memory are set, because the
      * calculation depends on those values. */
-    b_info->shadow_memkb = !xlu_cfg_get_long(config, "shadow_memory", &l)
+    b_info->shadow_memkb = !xlu_cfg_get_long(config, "shadow_memory", &l, 0)
         ? l * 1024
         : libxl_get_required_shadow_memory(b_info->max_memkb,
                                            b_info->max_vcpus);
 
-    if (!xlu_cfg_get_long (config, "nomigrate", &l))
+    if (!xlu_cfg_get_long (config, "nomigrate", &l, 0))
         b_info->disable_migrate = l;
 
-    if (!xlu_cfg_get_long(config, "tsc_mode", &l))
+    if (!xlu_cfg_get_long(config, "tsc_mode", &l, 0))
         b_info->tsc_mode = l;
 
-    if (!xlu_cfg_get_long (config, "videoram", &l))
+    if (!xlu_cfg_get_long (config, "videoram", &l, 0))
         b_info->video_memkb = l * 1024;
 
-    if (!xlu_cfg_get_long (config, "gfx_passthru", &l))
+    if (!xlu_cfg_get_long (config, "gfx_passthru", &l, 0))
         dm_info->gfx_passthru = l;
 
     switch(c_info->type) {
     case LIBXL_DOMAIN_TYPE_HVM:
-        if (!xlu_cfg_get_string (config, "kernel", &buf))
+        if (!xlu_cfg_get_string (config, "kernel", &buf, 0))
             fprintf(stderr, "WARNING: ignoring \"kernel\" directive for HVM guest. "
                     "Use \"firmware_override\" instead if you really want a non-default firmware\n");
 
         xlu_cfg_replace_string (config, "firmware_override",
-                                &b_info->u.hvm.firmware);
-        if (!xlu_cfg_get_long (config, "pae", &l))
+                                &b_info->u.hvm.firmware, 0);
+        if (!xlu_cfg_get_long (config, "pae", &l, 0))
             b_info->u.hvm.pae = l;
-        if (!xlu_cfg_get_long (config, "apic", &l))
+        if (!xlu_cfg_get_long (config, "apic", &l, 0))
             b_info->u.hvm.apic = l;
-        if (!xlu_cfg_get_long (config, "acpi", &l))
+        if (!xlu_cfg_get_long (config, "acpi", &l, 0))
             b_info->u.hvm.acpi = l;
-        if (!xlu_cfg_get_long (config, "acpi_s3", &l))
+        if (!xlu_cfg_get_long (config, "acpi_s3", &l, 0))
             b_info->u.hvm.acpi_s3 = l;
-        if (!xlu_cfg_get_long (config, "acpi_s4", &l))
+        if (!xlu_cfg_get_long (config, "acpi_s4", &l, 0))
             b_info->u.hvm.acpi_s4 = l;
-        if (!xlu_cfg_get_long (config, "nx", &l))
+        if (!xlu_cfg_get_long (config, "nx", &l, 0))
             b_info->u.hvm.nx = l;
-        if (!xlu_cfg_get_long (config, "viridian", &l))
+        if (!xlu_cfg_get_long (config, "viridian", &l, 0))
             b_info->u.hvm.viridian = l;
-        if (!xlu_cfg_get_long (config, "hpet", &l))
+        if (!xlu_cfg_get_long (config, "hpet", &l, 0))
             b_info->u.hvm.hpet = l;
-        if (!xlu_cfg_get_long (config, "vpt_align", &l))
+        if (!xlu_cfg_get_long (config, "vpt_align", &l, 0))
             b_info->u.hvm.vpt_align = l;
-        if (!xlu_cfg_get_long (config, "timer_mode", &l))
+        if (!xlu_cfg_get_long (config, "timer_mode", &l, 0))
             b_info->u.hvm.timer_mode = l;
-        if (!xlu_cfg_get_long (config, "nestedhvm", &l))
+        if (!xlu_cfg_get_long (config, "nestedhvm", &l, 0))
             b_info->u.hvm.nested_hvm = l;
         break;
     case LIBXL_DOMAIN_TYPE_PV:
@@ -707,12 +707,12 @@
         char *cmdline = NULL;
         const char *root = NULL, *extra = "";
 
-        xlu_cfg_replace_string (config, "kernel", &b_info->u.pv.kernel.path);
-
-        xlu_cfg_replace_string (config, "kernel", &b_info->u.pv.kernel.path);
-
-        xlu_cfg_get_string (config, "root", &root);
-        xlu_cfg_get_string (config, "extra", &extra);
+        xlu_cfg_replace_string (config, "kernel", &b_info->u.pv.kernel.path, 0);
+
+        xlu_cfg_replace_string (config, "kernel", &b_info->u.pv.kernel.path, 0);
+
+        xlu_cfg_get_string (config, "root", &root, 0);
+        xlu_cfg_get_string (config, "extra", &extra, 0);
 
         if (root) {
             if (asprintf(&cmdline, "root=%s %s", root, extra) == -1)
@@ -726,8 +726,10 @@
             exit(1);
         }
 
-        xlu_cfg_replace_string (config, "bootloader", &b_info->u.pv.bootloader);
-        xlu_cfg_replace_string (config, "bootloader_args", &b_info->u.pv.bootloader_args);
+        xlu_cfg_replace_string (config, "bootloader",
+                                &b_info->u.pv.bootloader, 0);
+        xlu_cfg_replace_string (config, "bootloader_args",
+                                &b_info->u.pv.bootloader_args, 0);
 
         if (!b_info->u.pv.bootloader && !b_info->u.pv.kernel.path) {
             fprintf(stderr, "Neither kernel nor bootloader specified\n");
@@ -735,7 +737,7 @@
         }
 
         b_info->u.pv.cmdline = cmdline;
-        xlu_cfg_replace_string (config, "ramdisk", &b_info->u.pv.ramdisk.path);
+        xlu_cfg_replace_string (config, "ramdisk", &b_info->u.pv.ramdisk.path, 0);
         break;
     }
     default:
@@ -910,15 +912,15 @@
         }
     }
 
-    if (!xlu_cfg_get_long (config, "pci_msitranslate", &l))
+    if (!xlu_cfg_get_long (config, "pci_msitranslate", &l, 0))
         pci_msitranslate = l;
 
-    if (!xlu_cfg_get_long (config, "pci_power_mgmt", &l))
+    if (!xlu_cfg_get_long (config, "pci_power_mgmt", &l, 0))
         pci_power_mgmt = l;
 
     /* To be reworked (automatically enabled) once the auto ballooning
      * after guest starts is done (with PCI devices passed in). */
-    if (!xlu_cfg_get_long (config, "e820_host", &l)) {
+    if (!xlu_cfg_get_long (config, "e820_host", &l, 0)) {
         switch (c_info->type) {
         case LIBXL_DOMAIN_TYPE_HVM:
             fprintf(stderr, "Can't do e820_host in HVM mode!");
@@ -986,7 +988,7 @@
         }
         break;
     case EINVAL:    /* config option is not a list, parse as a string */
-        if (!xlu_cfg_get_string(config, "cpuid", &buf)) {
+        if (!xlu_cfg_get_string(config, "cpuid", &buf, 0)) {
             char *buf2, *p, *strtok_ptr = NULL;
             const char *errstr;
 
@@ -1034,7 +1036,7 @@
     if (libxl_init_dm_info(ctx, dm_info, c_info, b_info))
         exit(1);
     /* parse device model arguments, this works for pv, hvm and stubdom */
-    if (!xlu_cfg_get_string (config, "device_model", &buf)) {
+    if (!xlu_cfg_get_string (config, "device_model", &buf, 0)) {
         fprintf(stderr,
                 "WARNING: ignoring device_model directive.\n"
                 "WARNING: Use \"device_model_override\" instead if you"
@@ -1053,8 +1055,8 @@
 
 
     xlu_cfg_replace_string (config, "device_model_override",
-                            &dm_info->device_model);
-    if (!xlu_cfg_get_string (config, "device_model_version", &buf)) {
+                            &dm_info->device_model, 0);
+    if (!xlu_cfg_get_string (config, "device_model_version", &buf, 0)) {
         if (!strcmp(buf, "qemu-xen-traditional")) {
             dm_info->device_model_version
                 = LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL;
@@ -1068,7 +1070,7 @@
         }
     } else if (dm_info->device_model)
         fprintf(stderr, "WARNING: device model override given without specific DM version\n");
-    if (!xlu_cfg_get_long (config, "device_model_stubdomain_override", &l))
+    if (!xlu_cfg_get_long (config, "device_model_stubdomain_override", &l, 0))
         dm_info->device_model_stubdomain = l;
 
 #define parse_extra_args(type)                                          \
@@ -1096,46 +1098,46 @@
 #undef parse_extra_args
 
     if (c_info->type == LIBXL_DOMAIN_TYPE_HVM) {
-        if (!xlu_cfg_get_long (config, "stdvga", &l))
+        if (!xlu_cfg_get_long (config, "stdvga", &l, 0))
             dm_info->stdvga = l;
-        if (!xlu_cfg_get_long (config, "vnc", &l))
+        if (!xlu_cfg_get_long (config, "vnc", &l, 0))
             dm_info->vnc = l;
-        xlu_cfg_replace_string (config, "vnclisten", &dm_info->vnclisten);
-        xlu_cfg_replace_string (config, "vncpasswd", &dm_info->vncpasswd);
-        if (!xlu_cfg_get_long (config, "vncdisplay", &l))
+        xlu_cfg_replace_string (config, "vnclisten", &dm_info->vnclisten, 0);
+        xlu_cfg_replace_string (config, "vncpasswd", &dm_info->vncpasswd, 0);
+        if (!xlu_cfg_get_long (config, "vncdisplay", &l, 0))
             dm_info->vncdisplay = l;
-        if (!xlu_cfg_get_long (config, "vncunused", &l))
+        if (!xlu_cfg_get_long (config, "vncunused", &l, 0))
             dm_info->vncunused = l;
-        xlu_cfg_replace_string (config, "keymap", &dm_info->keymap);
-        if (!xlu_cfg_get_long (config, "sdl", &l))
+        xlu_cfg_replace_string (config, "keymap", &dm_info->keymap, 0);
+        if (!xlu_cfg_get_long (config, "sdl", &l, 0))
             dm_info->sdl = l;
-        if (!xlu_cfg_get_long (config, "opengl", &l))
+        if (!xlu_cfg_get_long (config, "opengl", &l, 0))
             dm_info->opengl = l;
-        if (!xlu_cfg_get_long (config, "spice", &l))
+        if (!xlu_cfg_get_long (config, "spice", &l, 0))
             dm_info->spice = l;
-        if (!xlu_cfg_get_long (config, "spiceport", &l))
+        if (!xlu_cfg_get_long (config, "spiceport", &l, 0))
             dm_info->spiceport = l;
-        if (!xlu_cfg_get_long (config, "spicetls_port", &l))
+        if (!xlu_cfg_get_long (config, "spicetls_port", &l, 0))
             dm_info->spicetls_port = l;
-        xlu_cfg_replace_string (config, "spicehost", &dm_info->spicehost);
-        if (!xlu_cfg_get_long (config, "spicedisable_ticketing", &l))
+        xlu_cfg_replace_string (config, "spicehost", &dm_info->spicehost, 0);
+        if (!xlu_cfg_get_long (config, "spicedisable_ticketing", &l, 0))
             dm_info->spicedisable_ticketing = l;
-        xlu_cfg_replace_string (config, "spicepasswd", &dm_info->spicepasswd);
-        if (!xlu_cfg_get_long (config, "spiceagent_mouse", &l))
+        xlu_cfg_replace_string (config, "spicepasswd", &dm_info->spicepasswd, 0);
+        if (!xlu_cfg_get_long (config, "spiceagent_mouse", &l, 0))
             dm_info->spiceagent_mouse = l;
         else
             dm_info->spiceagent_mouse = 1;
-        if (!xlu_cfg_get_long (config, "nographic", &l))
+        if (!xlu_cfg_get_long (config, "nographic", &l, 0))
             dm_info->nographic = l;
-        if (!xlu_cfg_get_long (config, "gfx_passthru", &l))
+        if (!xlu_cfg_get_long (config, "gfx_passthru", &l, 0))
             dm_info->gfx_passthru = l;
-        xlu_cfg_replace_string (config, "serial", &dm_info->serial);
-        xlu_cfg_replace_string (config, "boot", &dm_info->boot);
-        if (!xlu_cfg_get_long (config, "usb", &l))
+        xlu_cfg_replace_string (config, "serial", &dm_info->serial, 0);
+        xlu_cfg_replace_string (config, "boot", &dm_info->boot, 0);
+        if (!xlu_cfg_get_long (config, "usb", &l, 0))
             dm_info->usb = l;
-        xlu_cfg_replace_string (config, "usbdevice", &dm_info->usbdevice);
-        xlu_cfg_replace_string (config, "soundhw", &dm_info->soundhw);
-        if (!xlu_cfg_get_long (config, "xen_platform_pci", &l))
+        xlu_cfg_replace_string (config, "usbdevice", &dm_info->usbdevice, 0);
+        xlu_cfg_replace_string (config, "soundhw", &dm_info->soundhw, 0);
+        if (!xlu_cfg_get_long (config, "xen_platform_pci", &l, 0))
             dm_info->xen_platform_pci = l;
     }
 
@@ -4766,7 +4768,7 @@
         return -ERROR_FAIL;
     }
 
-    if (!xlu_cfg_get_string (config, "name", &buf))
+    if (!xlu_cfg_get_string (config, "name", &buf, 0))
         name = strdup(buf);
     else
         name = libxl_basename(filename);
@@ -4775,7 +4777,7 @@
         return -ERROR_FAIL;
     }
 
-    if (!xlu_cfg_get_string (config, "sched", &buf)) {
+    if (!xlu_cfg_get_string (config, "sched", &buf, 0)) {
         if ((schedid = libxl_name_to_schedid(ctx, buf)) < 0) {
             fprintf(stderr, "Unknown scheduler\n");
             return -ERROR_FAIL;

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:30 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY77-0006X1-HS; Wed, 30 Nov 2011 00:33:29 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY75-0006RC-QX
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1322613167!5150473!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28470 invoked from network); 30 Nov 2011 00:32:49 -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;
	30 Nov 2011 00:32:49 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVYCu-0003v0-Ij
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6s-0003le-A7
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:14 +0000
Message-Id: <E1RVY6s-0003le-A7@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl: make bootloader_args a list
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322580083 0
# Node ID 71ecbef5645f799233415bdd625a5a09957096a1
# Parent  312d959bc7dcd1cd6047e768d229504b4d807bf8
xl: make bootloader_args a list

This is much more natural. Continue to support the old syntax in xl
but deprecate it.

[ Fixed up a long line in xl_cmdimpl.c. -iwj ]

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


diff -r 312d959bc7dc -r 71ecbef5645f docs/man/xl.cfg.pod.5
--- a/docs/man/xl.cfg.pod.5	Tue Nov 29 14:17:27 2011 +0000
+++ b/docs/man/xl.cfg.pod.5	Tue Nov 29 15:21:23 2011 +0000
@@ -321,10 +321,11 @@
 C<PROGRAM> would be C<pygrub>, which is an emulation of
 grub/grub2/syslinux.
 
-=item B<bootloader_args=STRING>
+=item B<bootloader_args=[ "ARG", "ARG", ...]>
 
-Append B<STRING> (split into words at whitespace) to the arguments to
-the B<bootloader> program.  XXX this should be a list of strings.
+Append B<ARG>s to the arguments to the B<bootloader>
+program. Alternatively if the argument is a simple string then it will
+be split into words at whitespace (this second option is deprecated).
 
 =item B<root="STRING">
 
diff -r 312d959bc7dc -r 71ecbef5645f tools/libxl/libxl_bootloader.c
--- a/tools/libxl/libxl_bootloader.c	Tue Nov 29 14:17:27 2011 +0000
+++ b/tools/libxl/libxl_bootloader.c	Tue Nov 29 15:21:23 2011 +0000
@@ -58,13 +58,9 @@
     flexarray_set(args, nr++, libxl__sprintf(gc, "--output-directory=%s", "/var/run/libxl/"));
 
     if (info->u.pv.bootloader_args) {
-        char *saveptr;
-        /* Operate on a duplicate since strtok modifes the argument */
-        char *dup = libxl__strdup(gc, info->u.pv.bootloader_args);
-        char *t = strtok_r(dup, " \t\n", &saveptr);
-        do {
-            flexarray_set(args, nr++, t);
-        } while ((t = strtok_r(NULL, " \t\n", &saveptr)));
+        char *p = info->u.pv.bootloader_args[0];
+        while (*(p++))
+            flexarray_set(args, nr++, p);
     }
 
     flexarray_set(args, nr++, disk);
diff -r 312d959bc7dc -r 71ecbef5645f tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Tue Nov 29 14:17:27 2011 +0000
+++ b/tools/libxl/libxl_types.idl	Tue Nov 29 15:21:23 2011 +0000
@@ -187,7 +187,7 @@
                  ("pv", Struct(None, [("kernel", libxl_file_reference),
                                       ("slack_memkb", uint32),
                                       ("bootloader", string),
-                                      ("bootloader_args", string),
+                                      ("bootloader_args", libxl_string_list),
                                       ("cmdline", string),
                                       ("ramdisk", libxl_file_reference),
                                       ("features", string, True),
diff -r 312d959bc7dc -r 71ecbef5645f tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Tue Nov 29 14:17:27 2011 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Tue Nov 29 15:21:23 2011 +0000
@@ -334,9 +334,14 @@
     printf("\t(nomigrate %d)\n", 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 %s)\n", b_info->u.pv.bootloader_args);
+        if (b_info->u.pv.bootloader_args) {
+            printf("\t(bootloader_args");
+            for (i=0; b_info->u.pv.bootloader_args[i]; i++)
+                printf(" %s", b_info->u.pv.bootloader_args[i]);
+            printf(")\n");
+        }
     }
 
     printf("\t(image\n");
@@ -515,6 +520,51 @@
     parse_disk_config_multistring(config, 1, &spec, disk);
 }
 
+static void split_string_into_string_list(const char *str,
+                                          const char *delim,
+                                          libxl_string_list *psl)
+{
+    char *s, *saveptr;
+    const char *p;
+    libxl_string_list sl;
+
+    int i = 0, nr = 0;
+
+    s = strdup(str);
+    if (s == NULL) {
+        fprintf(stderr, "unable to allocate memory to parse bootloader args\n");
+        exit(-1);
+    }
+
+    /* Count number of entries */
+    p = strtok_r(s, delim, &saveptr);
+    do {
+        nr++;
+    } while ((p = strtok_r(NULL, delim, &saveptr)));
+
+    free(s);
+
+    s = strdup(str);
+
+    sl = malloc((nr+1) * sizeof (char *));
+    if (sl == NULL) {
+        fprintf(stderr, "unable to allocate memory for bootloader args\n");
+        exit(-1);
+    }
+
+    p = strtok_r(s, delim, &saveptr);
+    do {
+        assert(i < nr);
+        sl[i] = strdup(p);
+        i++;
+    } while ((p = strtok_r(NULL, delim, &saveptr)));
+    sl[i] = NULL;
+
+    *psl = sl;
+
+    free(s);
+}
+
 static void parse_config_data(const char *configfile_filename_report,
                               const char *configfile_data,
                               int configfile_len,
@@ -739,10 +789,27 @@
             exit(1);
         }
 
-        xlu_cfg_replace_string (config, "bootloader",
-                                &b_info->u.pv.bootloader, 0);
-        xlu_cfg_replace_string (config, "bootloader_args",
-                                &b_info->u.pv.bootloader_args, 0);
+        xlu_cfg_replace_string (config, "bootloader", &b_info->u.pv.bootloader, 0);
+        switch (xlu_cfg_get_list_as_string_list(config, "bootloader_args",
+                                      &b_info->u.pv.bootloader_args, 1))
+        {
+
+        case 0: break; /* Success */
+        case ESRCH: break; /* Option not present */
+        case EINVAL:
+            if (!xlu_cfg_get_string(config, "bootloader_args", &buf, 0)) {
+
+                fprintf(stderr, "WARNING: Specifying \"bootloader_args\""
+                        " as a string is deprecated. "
+                        "Please use a list of arguments.\n");
+                split_string_into_string_list(buf, " \t\n",
+                                              &b_info->u.pv.bootloader_args);
+            }
+            break;
+        default:
+            fprintf(stderr,"xl: Unable to parse bootloader_args.\n");
+            exit(-ERROR_FAIL);
+        }
 
         if (!b_info->u.pv.bootloader && !b_info->u.pv.kernel.path) {
             fprintf(stderr, "Neither kernel nor bootloader specified\n");

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:30 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY74-0006TM-MS; Wed, 30 Nov 2011 00:33: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 1RVY73-0006Rt-2o
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-27.messagelabs.com!1322613123!58828962!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8194 invoked from network); 30 Nov 2011 00:32:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Nov 2011 00:32: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 1RVYCw-0003vC-HI
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6u-0003mg-8l
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:16 +0000
Message-Id: <E1RVY6u-0003mg-8l@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs/html/: Initial cut of header
	documentation massager
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Jackson <ian.jackson@eu.citrix.com>
# Date 1322581686 0
# Node ID 549b8f4b9560e4947f625656b80ad3218da91675
# Parent  dd7cf728df178676cab626986caa27c04492619a
docs/html/: Initial cut of header documentation massager

"xen-headers" generates HTML from header files.  So far this generates
just some type cross-references, if you say
   make -C docs html/hypercall/stamp

An index page, proper wiring into the build system, and a few more
annotations in the headers, and will be forthcoming.

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 dd7cf728df17 -r 549b8f4b9560 docs/Makefile
--- a/docs/Makefile	Tue Nov 29 14:19:59 2011 +0000
+++ b/docs/Makefile	Tue Nov 29 15:48:06 2011 +0000
@@ -154,6 +154,14 @@
 	$(POD2HTML) --infile=$< --outfile=$@.tmp
 	$(call move-if-changed,$@.tmp,$@)
 
+html/hypercall/stamp:
+	@$(INSTALL_DIR) $(@D)
+	./xen-headers -O $(@D) \
+		-T 'arch-x86_64 - Xen public headers' \
+		-X arch-ia64 -X arch-x86_32 -X xen-x86_32 \
+		../xen include/public
+	touch $@
+
 txt/%.txt: %.txt
 	$(INSTALL_DIR) $(@D)
 	cp $< $@.tmp
diff -r dd7cf728df17 -r 549b8f4b9560 docs/xen-headers
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/xen-headers	Tue Nov 29 15:48:06 2011 +0000
@@ -0,0 +1,292 @@
+#!/usr/bin/perl -w
+# usage: xen-headers OPTIONS... BASE-DIR INPUT-SUB-DIR...
+#  INPUT-SUB-DIR must be a relative path, and is interpreted
+#  relative to BASE-DIR.  Only files whose names end .h are processed
+# options:
+#   -O HTML-DIR             write html to this directory (mandatory)
+#   -T EXTRA-TITLE-HTML     tail of title string (used in <title>)
+#   -X GLOB | -I GLOB       include/exclude files matching;
+#                            glob patterns matched against /INPUT-SUB-FILE
+#                            first match wins; if no match, files included
+#   -D                      increase debug
+
+# Functionality:
+#  enum values --> selected function or struct
+#  type & function names, macro definitions --> definition
+#  function or struct selected by enum ++> ref to enum value
+
+#  definitions must start in LH column
+#  extra syntax:
+#    /* ` <definition>                          } parse as if <definition>
+#     * ` <definition>                          }  was not commented
+#   enum <name> { // <pattern>* => <func>()     } cross-reference
+#   enum <name> { // <pattern>* => struct <s>   }  enum values
+#   
+
+# 1st pass: find where things are defined and what references are wanted
+# 2rd pass: write out output
+
+use strict;
+use warnings;
+
+use Getopt::Long;
+use File::Find;
+use IO::File;
+
+Getopt::Long::Configure('bundling');
+
+our $outdir;
+our $debug=0;
+our $xtitle='';
+our @fglobs;
+
+sub includeexclude {
+    my ($yn, $optobj, $value) = @_;
+    push @fglobs, [ $value, $yn ];
+}
+
+GetOptions("O|output-dir=s" => \$outdir,
+           "D+" => \$debug,
+           "T=s" => \$xtitle,
+           "I=s" => sub { includeexclude(1, @_); },
+           "X=s" => sub { includeexclude(0, @_); })
+    or die;
+
+die unless defined $outdir;
+@ARGV>=2 or die;
+
+my ($basedir,@indirs) = @ARGV;
+
+# general globals
+our $pass;
+our %sdef; 
+# $sdef{$type}{$name} => {
+#     DefLocs => { "$leaf_path:$lineno" => $leaf_opath ,... }
+#     Xrefs => { "$leaf_path,$lineno" => "$xref", ... }
+#     Used => 1
+# }
+# $type might be  Func Struct Union Enum EnumVal
+
+# provided by the find() function
+our $leaf;
+our $leaf_opath;
+
+# reset at the start of each file
+our $o;
+our $in_enum;
+our @pending_xrefs;
+
+sub compile_fglobs () {
+    local ($_);
+    my $f = "sub file_wanted (\$) {\n    local (\$_) = \"/\$leaf\";\n";
+    foreach my $fglob (@fglobs) {
+	$_ = $fglob->[0];
+	$_ = "**$_**" unless m/[?*]/;
+	s/\W/\\$&/g;
+	s,\\\*\\\*,.*,g;
+	s,\\\*,[^/]*,g;
+	s,\\\?,[^/],g;
+	$f .= "    return $fglob->[1] if m,$_,o;\n";
+    }
+    $f .= "    return 1;\n}\n1;\n";
+    debug(3, $f);
+    eval $f or die "$@ ";
+}
+
+compile_fglobs();
+
+
+sub warning {
+    print STDERR "$leaf:$.: @_\n";
+}
+
+sub debug {
+    my $msglevel = scalar shift @_;
+    return unless $debug >= $msglevel;
+    print STDERR "DEBUG $pass $msglevel @_\n" or die $!;
+}
+
+sub in_enum ($$$) { $in_enum = [ @_ ]; } # [ $enumvalpfx, RefType, $refnamepfx ]
+
+sub aelem ($$$) {
+    my ($ntext,$ytext,$hparams) = @_;
+    return $ntext unless $hparams =~ m/\S/;
+    return "<a $hparams>$ytext</a>";
+}
+
+sub defn ($$$;$) {
+    my ($text,$type,$name,$hparams) = @_;
+    $hparams='' if !defined $hparams;
+    debug(2,"DEFN $. $type $name $hparams");
+    $sdef{$type}{$name}{DefLocs}{"$leaf:$."} = $leaf_opath;
+    my $xrefs = $sdef{$type}{$name}{Xrefs};
+    push @pending_xrefs, values %$xrefs if $xrefs;
+    $hparams .= " name=\"${type}_$name\"" if $sdef{$type}{$name}{Used};
+    return aelem($text, "<strong>$text</strong>", $hparams);
+}
+
+sub norm ($) {
+    local ($_) = @_;
+    my $no = '';
+    while (length) {
+	if (s/^(?:\s|^\W)+//) {
+	    $no .= $&;
+	} elsif (s/^(struct|union|enum)\s+(\w+)\b//) {
+	    $no .= ahref($&, (ucfirst $1), $2);
+	} elsif (s/^\w+\b//) {
+	    $no .= ahref($&, 'Func', $&);
+	} else {
+	    die "$_ ?";
+	}
+    }
+    return $no;
+}
+
+sub refhref ($$) {
+    my ($type,$name) = @_;
+    $sdef{$type}{$name}{Used} = 1;
+    my $locs = $sdef{$type}{$name}{DefLocs};
+    return '' unless $locs;
+    if ((scalar keys %$locs) != 1 && !$sdef{$type}{$name}{MultiWarned}) {
+	warning("multiple definitions of $type $name: $_")
+	    foreach keys %$locs;
+	$sdef{$type}{$name}{MultiWarned}=1;
+    }
+    my ($loc) = values %$locs;
+    return "href=\"$loc#${type}_$name\"";
+}
+
+sub ahref ($$$) {
+    my ($text,$type,$name) = @_;
+    return aelem($text,$text, refhref($type,$name));
+}
+
+sub defmacro ($) {
+    my ($valname) = @_;
+    if (!$in_enum) {
+	return $valname;
+    } elsif (substr($valname, 0, (length $in_enum->[0])) ne $in_enum->[0]) {
+	warning("in enum expecting $in_enum->[0]* got $valname");
+	return $valname;
+    } else {
+	my $reftype = $in_enum->[1];
+	my $refname = $in_enum->[2].substr($valname, (length $in_enum->[0]));
+	$sdef{$reftype}{$refname}{Xrefs}{$leaf,$.} =
+	    "[see <a href=\"$leaf_opath#EnumVal_$valname\">$valname</a>]";
+	$sdef{EnumVal}{$valname}{Used} = 1;
+	return defn($valname,'EnumVal',$valname, refhref($reftype,$refname));
+    }
+}
+
+sub out_xrefs ($) {
+    my ($linemapfunc) = @_;
+    foreach my $xref (@pending_xrefs) {
+	$o .= $linemapfunc->($xref);
+	$o .= "\n";
+    }
+    @pending_xrefs = ();
+}
+
+sub write_file ($$) {
+    my ($opath, $odata) = @_;
+    my $out = new IO::File "$opath.new", '>' or die "$opath $!";
+    print $out $odata or die $!;
+    rename "$opath.new", "$opath" or die "$opath $!";
+}
+
+sub process_file ($$) {
+    my ($infile, $outfile) = @_;
+    debug(1,"$pass $infile => $outfile");
+    my $in = new IO::File "$infile", '<' or die "$infile $!";
+
+    $o = '';
+    $in_enum = undef;
+    @pending_xrefs = ();
+
+    $o .= "<html><head><title>$leaf - $xtitle</title></head><body><pre>\n";
+    
+    while (<$in>) {
+	s/\&/\&amp;/g;
+	s/\</\&lt;/g;
+	s/\>/\&gt;/g;
+
+	if (m/^(.*\`)[ \t]*$/) {
+	    my $lhs = $1;
+	    out_xrefs(sub { "$1 $_[0]"; });
+	} elsif (m/^\s*$/) {
+	    out_xrefs(sub { sprintf "/* %70s */", $_[0]; });
+	}
+
+	# In case of comments, strip " /* ` " and " * ` ";
+	my $lstripped = s,^ \s* /? \* \s* \` \  ,,x ? $&: '';
+
+	# Strip trailing whitespace and perhaps trailing "*/" or "*"
+	s,(?: \s* \* /? )? \s* $,,x or die;
+	my $rstripped = $&;
+
+	# Now the actual functionality:
+
+	debug(3,"$. $_");
+
+	if (!m/^(?: __attribute__ | __pragma__ )\b/x &&
+	    s/^( (?: \w+\  )? ) (\w+[a-z]\w+) ( \( .*)$
+             / $1.defn($2,'Func',$2).norm($3) /xe) {
+	} elsif (s/^((struct|union|enum) \  (\w+)) ( \s+ \{ .* )$
+                  / defn($1,(ucfirst $2),$3).norm($4) /xe) {
+	    if ($2 eq 'enum') {
+		if (m,/[/*] (\w+)\* \=\&gt\; (\w+)\*\(\),) { 
+		    in_enum($1,'Func',$2)
+		} elsif (m,/[/*] (\w+)\* \=\&gt\; (struct) (\w+)\*,) { 
+		    in_enum($1,(ucfirst $2),$3);
+	        }
+	    }
+	} elsif (s/^( \s* \#define \s+ ) (\w+) ( \s+\S )
+                  / $1.defmacro($2).norm($3) /xe) {
+	} else {
+	    if (m/^\s*\}/) {
+		$in_enum = undef;
+	    }
+	    $_ = norm($_);
+	}
+
+	# Write the line out
+
+	if ($pass == 2) {
+	    $o .= $lstripped;
+	    $o .= $_;
+	    $o .= $rstripped;
+	}
+    }
+
+    warning("pending xrefs at end of file") if @pending_xrefs;
+
+    if ($pass == 2) {
+	$o .= "</pre></body></html>";
+	write_file($outfile, $o);
+    }
+}
+
+
+foreach $pass (qw(1 2)) {
+    find({ wanted => 
+	       sub {
+		   return unless m/\.h$/;
+		   lstat $File::Find::name or die "$File::Find::name $!";
+		   -f _ or die "$File::Find::name";
+		   substr($File::Find::name, 0, 1+length $basedir) 
+		       eq "$basedir/"
+		       or die "$File::Find::name $basedir";
+		   $leaf = substr($File::Find::name, 1+length $basedir);
+		   if (!file_wanted()) {
+		       debug(1,"$pass $File::Find::name excluded");
+		       return;
+		   }
+		   $leaf_opath = $leaf;
+		   $leaf_opath =~ s#/#,#g;
+		   $leaf_opath .= ".html";
+		   process_file($File::Find::name, $outdir.'/'.$leaf_opath);
+	   },
+	   no_chdir => 1,
+	 },
+	 map { "$basedir/$_" } @indirs);
+}

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:30 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY77-0006X1-HS; Wed, 30 Nov 2011 00:33:29 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY75-0006RC-QX
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1322613167!5150473!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28470 invoked from network); 30 Nov 2011 00:32:49 -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;
	30 Nov 2011 00:32:49 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVYCu-0003v0-Ij
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6s-0003le-A7
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:14 +0000
Message-Id: <E1RVY6s-0003le-A7@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl: make bootloader_args a list
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322580083 0
# Node ID 71ecbef5645f799233415bdd625a5a09957096a1
# Parent  312d959bc7dcd1cd6047e768d229504b4d807bf8
xl: make bootloader_args a list

This is much more natural. Continue to support the old syntax in xl
but deprecate it.

[ Fixed up a long line in xl_cmdimpl.c. -iwj ]

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


diff -r 312d959bc7dc -r 71ecbef5645f docs/man/xl.cfg.pod.5
--- a/docs/man/xl.cfg.pod.5	Tue Nov 29 14:17:27 2011 +0000
+++ b/docs/man/xl.cfg.pod.5	Tue Nov 29 15:21:23 2011 +0000
@@ -321,10 +321,11 @@
 C<PROGRAM> would be C<pygrub>, which is an emulation of
 grub/grub2/syslinux.
 
-=item B<bootloader_args=STRING>
+=item B<bootloader_args=[ "ARG", "ARG", ...]>
 
-Append B<STRING> (split into words at whitespace) to the arguments to
-the B<bootloader> program.  XXX this should be a list of strings.
+Append B<ARG>s to the arguments to the B<bootloader>
+program. Alternatively if the argument is a simple string then it will
+be split into words at whitespace (this second option is deprecated).
 
 =item B<root="STRING">
 
diff -r 312d959bc7dc -r 71ecbef5645f tools/libxl/libxl_bootloader.c
--- a/tools/libxl/libxl_bootloader.c	Tue Nov 29 14:17:27 2011 +0000
+++ b/tools/libxl/libxl_bootloader.c	Tue Nov 29 15:21:23 2011 +0000
@@ -58,13 +58,9 @@
     flexarray_set(args, nr++, libxl__sprintf(gc, "--output-directory=%s", "/var/run/libxl/"));
 
     if (info->u.pv.bootloader_args) {
-        char *saveptr;
-        /* Operate on a duplicate since strtok modifes the argument */
-        char *dup = libxl__strdup(gc, info->u.pv.bootloader_args);
-        char *t = strtok_r(dup, " \t\n", &saveptr);
-        do {
-            flexarray_set(args, nr++, t);
-        } while ((t = strtok_r(NULL, " \t\n", &saveptr)));
+        char *p = info->u.pv.bootloader_args[0];
+        while (*(p++))
+            flexarray_set(args, nr++, p);
     }
 
     flexarray_set(args, nr++, disk);
diff -r 312d959bc7dc -r 71ecbef5645f tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Tue Nov 29 14:17:27 2011 +0000
+++ b/tools/libxl/libxl_types.idl	Tue Nov 29 15:21:23 2011 +0000
@@ -187,7 +187,7 @@
                  ("pv", Struct(None, [("kernel", libxl_file_reference),
                                       ("slack_memkb", uint32),
                                       ("bootloader", string),
-                                      ("bootloader_args", string),
+                                      ("bootloader_args", libxl_string_list),
                                       ("cmdline", string),
                                       ("ramdisk", libxl_file_reference),
                                       ("features", string, True),
diff -r 312d959bc7dc -r 71ecbef5645f tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Tue Nov 29 14:17:27 2011 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Tue Nov 29 15:21:23 2011 +0000
@@ -334,9 +334,14 @@
     printf("\t(nomigrate %d)\n", 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 %s)\n", b_info->u.pv.bootloader_args);
+        if (b_info->u.pv.bootloader_args) {
+            printf("\t(bootloader_args");
+            for (i=0; b_info->u.pv.bootloader_args[i]; i++)
+                printf(" %s", b_info->u.pv.bootloader_args[i]);
+            printf(")\n");
+        }
     }
 
     printf("\t(image\n");
@@ -515,6 +520,51 @@
     parse_disk_config_multistring(config, 1, &spec, disk);
 }
 
+static void split_string_into_string_list(const char *str,
+                                          const char *delim,
+                                          libxl_string_list *psl)
+{
+    char *s, *saveptr;
+    const char *p;
+    libxl_string_list sl;
+
+    int i = 0, nr = 0;
+
+    s = strdup(str);
+    if (s == NULL) {
+        fprintf(stderr, "unable to allocate memory to parse bootloader args\n");
+        exit(-1);
+    }
+
+    /* Count number of entries */
+    p = strtok_r(s, delim, &saveptr);
+    do {
+        nr++;
+    } while ((p = strtok_r(NULL, delim, &saveptr)));
+
+    free(s);
+
+    s = strdup(str);
+
+    sl = malloc((nr+1) * sizeof (char *));
+    if (sl == NULL) {
+        fprintf(stderr, "unable to allocate memory for bootloader args\n");
+        exit(-1);
+    }
+
+    p = strtok_r(s, delim, &saveptr);
+    do {
+        assert(i < nr);
+        sl[i] = strdup(p);
+        i++;
+    } while ((p = strtok_r(NULL, delim, &saveptr)));
+    sl[i] = NULL;
+
+    *psl = sl;
+
+    free(s);
+}
+
 static void parse_config_data(const char *configfile_filename_report,
                               const char *configfile_data,
                               int configfile_len,
@@ -739,10 +789,27 @@
             exit(1);
         }
 
-        xlu_cfg_replace_string (config, "bootloader",
-                                &b_info->u.pv.bootloader, 0);
-        xlu_cfg_replace_string (config, "bootloader_args",
-                                &b_info->u.pv.bootloader_args, 0);
+        xlu_cfg_replace_string (config, "bootloader", &b_info->u.pv.bootloader, 0);
+        switch (xlu_cfg_get_list_as_string_list(config, "bootloader_args",
+                                      &b_info->u.pv.bootloader_args, 1))
+        {
+
+        case 0: break; /* Success */
+        case ESRCH: break; /* Option not present */
+        case EINVAL:
+            if (!xlu_cfg_get_string(config, "bootloader_args", &buf, 0)) {
+
+                fprintf(stderr, "WARNING: Specifying \"bootloader_args\""
+                        " as a string is deprecated. "
+                        "Please use a list of arguments.\n");
+                split_string_into_string_list(buf, " \t\n",
+                                              &b_info->u.pv.bootloader_args);
+            }
+            break;
+        default:
+            fprintf(stderr,"xl: Unable to parse bootloader_args.\n");
+            exit(-ERROR_FAIL);
+        }
 
         if (!b_info->u.pv.bootloader && !b_info->u.pv.kernel.path) {
             fprintf(stderr, "Neither kernel nor bootloader specified\n");

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:31 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY77-0006WL-B0; Wed, 30 Nov 2011 00:33:29 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY75-0006R2-FN
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-174.messagelabs.com!1322613167!3630049!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30585 invoked from network); 30 Nov 2011 00:32:48 -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;
	30 Nov 2011 00:32:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVYCu-0003ux-5E
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6r-0003lP-Pe
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:13 +0000
Message-Id: <E1RVY6r-0003lP-Pe@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxlu: add
	xlu_cfg_get_list_as_string_list
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322576247 0
# Node ID 312d959bc7dcd1cd6047e768d229504b4d807bf8
# Parent  0c59c853135c6dbb4c9cd787657a18a65f388887
libxlu: add xlu_cfg_get_list_as_string_list

Returns a cfg list as a libxl_string_list.

Use this to simplify the parsing of device model extra args.

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


diff -r 0c59c853135c -r 312d959bc7dc tools/libxl/libxlu_cfg.c
--- a/tools/libxl/libxlu_cfg.c	Tue Nov 29 14:17:27 2011 +0000
+++ b/tools/libxl/libxlu_cfg.c	Tue Nov 29 14:17:27 2011 +0000
@@ -254,6 +254,29 @@
     return 0;
 }
 
+int xlu_cfg_get_list_as_string_list(const XLU_Config *cfg, const char *n,
+                     libxl_string_list *psl, int dont_warn) {
+    int i, rc, nr;
+    XLU_ConfigList *list;
+    libxl_string_list sl;
+
+    rc = xlu_cfg_get_list(cfg, n, &list, &nr, dont_warn);
+    if (rc)  return rc;
+
+    sl = malloc(sizeof(char*)*(nr + 1));
+    if (sl == NULL) return ENOMEM;
+
+    for (i=0; i<nr; i++) {
+        const char *a = xlu_cfg_get_listitem(list, i);
+        sl[i] = a ? strdup(a) : NULL;
+    }
+
+    sl[nr] = NULL;
+
+    *psl = sl;
+    return 0;
+}
+
 const char *xlu_cfg_get_listitem(const XLU_ConfigList *set, int entry) {
     if (entry < 0 || entry >= set->nvalues) return 0;
     return set->values[entry];
diff -r 0c59c853135c -r 312d959bc7dc tools/libxl/libxlutil.h
--- a/tools/libxl/libxlutil.h	Tue Nov 29 14:17:27 2011 +0000
+++ b/tools/libxl/libxlutil.h	Tue Nov 29 14:17:27 2011 +0000
@@ -58,6 +58,8 @@
                      int *entries_r /* may be 0 */,
                      int dont_warn);
   /* there is no need to free *list_r; lifetime is that of the XLU_Config */
+int xlu_cfg_get_list_as_string_list(const XLU_Config *cfg, const char *n,
+                                    libxl_string_list *sl, int dont_warn);
 const char *xlu_cfg_get_listitem(const XLU_ConfigList*, int entry);
   /* xlu_cfg_get_listitem cannot fail, except that if entry is
    * out of range it returns 0 (not setting errno) */
diff -r 0c59c853135c -r 312d959bc7dc tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Tue Nov 29 14:17:27 2011 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Tue Nov 29 14:17:27 2011 +0000
@@ -529,13 +529,6 @@
     int pci_msitranslate = 1;
     int e;
 
-    XLU_ConfigList *dmargs;
-    int nr_dmargs = 0;
-    XLU_ConfigList *dmargs_hvm;
-    int nr_dmargs_hvm = 0;
-    XLU_ConfigList *dmargs_pv;
-    int nr_dmargs_pv = 0;
-
     libxl_domain_create_info *c_info = &d_config->c_info;
     libxl_domain_build_info *b_info = &d_config->b_info;
 
@@ -1093,19 +1086,14 @@
     if (!xlu_cfg_get_long (config, "device_model_stubdomain_override", &l, 0))
         dm_info->device_model_stubdomain = l;
 
-#define parse_extra_args(type)                                          \
-    if (!xlu_cfg_get_list(config, "device_model_args"#type,             \
-                          &dmargs##type, &nr_dmargs##type, 0))          \
-    {                                                                   \
-        int i;                                                          \
-        dm_info->extra##type =                                          \
-            xmalloc(sizeof(char*)*(nr_dmargs##type + 1));               \
-        dm_info->extra##type[nr_dmargs##type] = NULL;                   \
-        for (i=0; i<nr_dmargs##type; i++) {                             \
-            const char *a = xlu_cfg_get_listitem(dmargs##type, i);      \
-            dm_info->extra##type[i] = a ? strdup(a) : NULL;             \
-        }                                                               \
-    }                                                                   \
+#define parse_extra_args(type)                                            \
+    e = xlu_cfg_get_list_as_string_list(config, "device_model_args"#type, \
+                                    &dm_info->extra##type, 0);            \
+    if (e && e != ESRCH) {                                                \
+        fprintf(stderr,"xl: Unable to parse device_model_args"#type".\n");\
+        exit(-ERROR_FAIL);                                                \
+    }
+
     /* parse extra args for qemu, common to both pv, hvm */
     parse_extra_args();
 

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:31 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY77-0006WL-B0; Wed, 30 Nov 2011 00:33:29 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY75-0006R2-FN
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-174.messagelabs.com!1322613167!3630049!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30585 invoked from network); 30 Nov 2011 00:32:48 -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;
	30 Nov 2011 00:32:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVYCu-0003ux-5E
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6r-0003lP-Pe
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:13 +0000
Message-Id: <E1RVY6r-0003lP-Pe@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxlu: add
	xlu_cfg_get_list_as_string_list
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322576247 0
# Node ID 312d959bc7dcd1cd6047e768d229504b4d807bf8
# Parent  0c59c853135c6dbb4c9cd787657a18a65f388887
libxlu: add xlu_cfg_get_list_as_string_list

Returns a cfg list as a libxl_string_list.

Use this to simplify the parsing of device model extra args.

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


diff -r 0c59c853135c -r 312d959bc7dc tools/libxl/libxlu_cfg.c
--- a/tools/libxl/libxlu_cfg.c	Tue Nov 29 14:17:27 2011 +0000
+++ b/tools/libxl/libxlu_cfg.c	Tue Nov 29 14:17:27 2011 +0000
@@ -254,6 +254,29 @@
     return 0;
 }
 
+int xlu_cfg_get_list_as_string_list(const XLU_Config *cfg, const char *n,
+                     libxl_string_list *psl, int dont_warn) {
+    int i, rc, nr;
+    XLU_ConfigList *list;
+    libxl_string_list sl;
+
+    rc = xlu_cfg_get_list(cfg, n, &list, &nr, dont_warn);
+    if (rc)  return rc;
+
+    sl = malloc(sizeof(char*)*(nr + 1));
+    if (sl == NULL) return ENOMEM;
+
+    for (i=0; i<nr; i++) {
+        const char *a = xlu_cfg_get_listitem(list, i);
+        sl[i] = a ? strdup(a) : NULL;
+    }
+
+    sl[nr] = NULL;
+
+    *psl = sl;
+    return 0;
+}
+
 const char *xlu_cfg_get_listitem(const XLU_ConfigList *set, int entry) {
     if (entry < 0 || entry >= set->nvalues) return 0;
     return set->values[entry];
diff -r 0c59c853135c -r 312d959bc7dc tools/libxl/libxlutil.h
--- a/tools/libxl/libxlutil.h	Tue Nov 29 14:17:27 2011 +0000
+++ b/tools/libxl/libxlutil.h	Tue Nov 29 14:17:27 2011 +0000
@@ -58,6 +58,8 @@
                      int *entries_r /* may be 0 */,
                      int dont_warn);
   /* there is no need to free *list_r; lifetime is that of the XLU_Config */
+int xlu_cfg_get_list_as_string_list(const XLU_Config *cfg, const char *n,
+                                    libxl_string_list *sl, int dont_warn);
 const char *xlu_cfg_get_listitem(const XLU_ConfigList*, int entry);
   /* xlu_cfg_get_listitem cannot fail, except that if entry is
    * out of range it returns 0 (not setting errno) */
diff -r 0c59c853135c -r 312d959bc7dc tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Tue Nov 29 14:17:27 2011 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Tue Nov 29 14:17:27 2011 +0000
@@ -529,13 +529,6 @@
     int pci_msitranslate = 1;
     int e;
 
-    XLU_ConfigList *dmargs;
-    int nr_dmargs = 0;
-    XLU_ConfigList *dmargs_hvm;
-    int nr_dmargs_hvm = 0;
-    XLU_ConfigList *dmargs_pv;
-    int nr_dmargs_pv = 0;
-
     libxl_domain_create_info *c_info = &d_config->c_info;
     libxl_domain_build_info *b_info = &d_config->b_info;
 
@@ -1093,19 +1086,14 @@
     if (!xlu_cfg_get_long (config, "device_model_stubdomain_override", &l, 0))
         dm_info->device_model_stubdomain = l;
 
-#define parse_extra_args(type)                                          \
-    if (!xlu_cfg_get_list(config, "device_model_args"#type,             \
-                          &dmargs##type, &nr_dmargs##type, 0))          \
-    {                                                                   \
-        int i;                                                          \
-        dm_info->extra##type =                                          \
-            xmalloc(sizeof(char*)*(nr_dmargs##type + 1));               \
-        dm_info->extra##type[nr_dmargs##type] = NULL;                   \
-        for (i=0; i<nr_dmargs##type; i++) {                             \
-            const char *a = xlu_cfg_get_listitem(dmargs##type, i);      \
-            dm_info->extra##type[i] = a ? strdup(a) : NULL;             \
-        }                                                               \
-    }                                                                   \
+#define parse_extra_args(type)                                            \
+    e = xlu_cfg_get_list_as_string_list(config, "device_model_args"#type, \
+                                    &dm_info->extra##type, 0);            \
+    if (e && e != ESRCH) {                                                \
+        fprintf(stderr,"xl: Unable to parse device_model_args"#type".\n");\
+        exit(-ERROR_FAIL);                                                \
+    }
+
     /* parse extra args for qemu, common to both pv, hvm */
     parse_extra_args();
 

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:31 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY77-0006XQ-Nq; Wed, 30 Nov 2011 00:33:29 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY75-0006RE-VJ
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-174.messagelabs.com!1322613168!3624429!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23317 invoked from network); 30 Nov 2011 00:32:49 -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;
	30 Nov 2011 00:32:49 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVYCv-0003v3-2g
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6s-0003lu-QO
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:14 +0000
Message-Id: <E1RVY6s-0003lu-QO@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: install txt files as html
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322576247 0
# Node ID 70c6aa688faf0da81bbde899bb442a9f4c7f80d8
# Parent  71ecbef5645f799233415bdd625a5a09957096a1
docs: install txt files as html

A browser will display them just fine.

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


diff -r 71ecbef5645f -r 70c6aa688faf docs/INDEX
--- a/docs/INDEX	Tue Nov 29 15:21:23 2011 +0000
+++ b/docs/INDEX	Tue Nov 29 14:17:27 2011 +0000
@@ -1,5 +1,7 @@
 misc/hvm-emulated-unplug	Xen HVM emulated device unplug protocol
 
+misc/console.txt		Xen PV Console notes
+
 # These are not all that useful anymore, hide them from the index
 reference/interface/index	NO-INDEX
 reference/user/index		NO-INDEX
diff -r 71ecbef5645f -r 70c6aa688faf docs/Makefile
--- a/docs/Makefile	Tue Nov 29 15:21:23 2011 +0000
+++ b/docs/Makefile	Tue Nov 29 14:17:27 2011 +0000
@@ -17,7 +17,8 @@
 DOC_HTML	:= $(patsubst src/%.tex,html/reference/%/index.html,$(DOC_TEX)) \
 		   $(patsubst %.markdown,html/%.html,$(DOC_MARKDOWN)) \
 		   $(patsubst man/%.pod.1,html/man/%.1.html,$(DOC_MAN1SRC)) \
-		   $(patsubst man/%.pod.5,html/man/%.5.html,$(DOC_MAN5SRC))
+		   $(patsubst man/%.pod.5,html/man/%.5.html,$(DOC_MAN5SRC)) \
+		   $(patsubst %.txt,html/%.txt,$(wildcard misc/*.txt))
 DOC_TXT         := $(patsubst %.txt,txt/%.txt,$(wildcard misc/*.txt)) \
 		   $(patsubst %.markdown,txt/%.txt,$(DOC_MARKDOWN)) \
 		   $(patsubst man/%.pod.1,txt/man/%.1.txt,$(DOC_MAN1SRC)) \
@@ -139,6 +140,10 @@
 	$(call move-if-changed,$@.tmp,$@) ; else \
 	echo "markdown not installed; skipping $*.html."; fi
 
+html/%.txt: %.txt
+	@$(INSTALL_DIR) $(@D)
+	cp $< $@
+
 html/man/%.1.html: man/%.pod.1 Makefile
 	$(INSTALL_DIR) $(@D)
 	$(POD2HTML) --infile=$< --outfile=$@.tmp

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:31 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY77-0006XQ-Nq; Wed, 30 Nov 2011 00:33:29 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY75-0006RE-VJ
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-174.messagelabs.com!1322613168!3624429!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23317 invoked from network); 30 Nov 2011 00:32:49 -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;
	30 Nov 2011 00:32:49 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVYCv-0003v3-2g
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6s-0003lu-QO
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:14 +0000
Message-Id: <E1RVY6s-0003lu-QO@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: install txt files as html
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322576247 0
# Node ID 70c6aa688faf0da81bbde899bb442a9f4c7f80d8
# Parent  71ecbef5645f799233415bdd625a5a09957096a1
docs: install txt files as html

A browser will display them just fine.

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


diff -r 71ecbef5645f -r 70c6aa688faf docs/INDEX
--- a/docs/INDEX	Tue Nov 29 15:21:23 2011 +0000
+++ b/docs/INDEX	Tue Nov 29 14:17:27 2011 +0000
@@ -1,5 +1,7 @@
 misc/hvm-emulated-unplug	Xen HVM emulated device unplug protocol
 
+misc/console.txt		Xen PV Console notes
+
 # These are not all that useful anymore, hide them from the index
 reference/interface/index	NO-INDEX
 reference/user/index		NO-INDEX
diff -r 71ecbef5645f -r 70c6aa688faf docs/Makefile
--- a/docs/Makefile	Tue Nov 29 15:21:23 2011 +0000
+++ b/docs/Makefile	Tue Nov 29 14:17:27 2011 +0000
@@ -17,7 +17,8 @@
 DOC_HTML	:= $(patsubst src/%.tex,html/reference/%/index.html,$(DOC_TEX)) \
 		   $(patsubst %.markdown,html/%.html,$(DOC_MARKDOWN)) \
 		   $(patsubst man/%.pod.1,html/man/%.1.html,$(DOC_MAN1SRC)) \
-		   $(patsubst man/%.pod.5,html/man/%.5.html,$(DOC_MAN5SRC))
+		   $(patsubst man/%.pod.5,html/man/%.5.html,$(DOC_MAN5SRC)) \
+		   $(patsubst %.txt,html/%.txt,$(wildcard misc/*.txt))
 DOC_TXT         := $(patsubst %.txt,txt/%.txt,$(wildcard misc/*.txt)) \
 		   $(patsubst %.markdown,txt/%.txt,$(DOC_MARKDOWN)) \
 		   $(patsubst man/%.pod.1,txt/man/%.1.txt,$(DOC_MAN1SRC)) \
@@ -139,6 +140,10 @@
 	$(call move-if-changed,$@.tmp,$@) ; else \
 	echo "markdown not installed; skipping $*.html."; fi
 
+html/%.txt: %.txt
+	@$(INSTALL_DIR) $(@D)
+	cp $< $@
+
 html/man/%.1.html: man/%.pod.1 Makefile
 	$(INSTALL_DIR) $(@D)
 	$(POD2HTML) --infile=$< --outfile=$@.tmp

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:31 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY78-0006ZN-Qu; Wed, 30 Nov 2011 00:33:30 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY76-0006RV-Ph
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-174.messagelabs.com!1322613169!3630052!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30610 invoked from network); 30 Nov 2011 00:32:50 -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;
	30 Nov 2011 00:32:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVYCw-0003v9-1f
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6t-0003mO-PI
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:15 +0000
Message-Id: <E1RVY6t-0003mO-PI@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: improve documantion of xl's
	viridian option
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322576399 0
# Node ID dd7cf728df178676cab626986caa27c04492619a
# Parent  a025f010790018448a3774c8f278e62e9a75622a
docs: improve documantion of xl's viridian option

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


diff -r a025f0107900 -r dd7cf728df17 docs/man/xl.cfg.pod.5
--- a/docs/man/xl.cfg.pod.5	Tue Nov 29 14:17:27 2011 +0000
+++ b/docs/man/xl.cfg.pod.5	Tue Nov 29 14:19:59 2011 +0000
@@ -555,7 +555,13 @@
 
 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 (XXX which versions of Windows benefit?)
+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
 

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:31 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY78-0006ZN-Qu; Wed, 30 Nov 2011 00:33:30 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY76-0006RV-Ph
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-174.messagelabs.com!1322613169!3630052!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30610 invoked from network); 30 Nov 2011 00:32:50 -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;
	30 Nov 2011 00:32:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVYCw-0003v9-1f
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6t-0003mO-PI
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:15 +0000
Message-Id: <E1RVY6t-0003mO-PI@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: improve documantion of xl's
	viridian option
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322576399 0
# Node ID dd7cf728df178676cab626986caa27c04492619a
# Parent  a025f010790018448a3774c8f278e62e9a75622a
docs: improve documantion of xl's viridian option

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


diff -r a025f0107900 -r dd7cf728df17 docs/man/xl.cfg.pod.5
--- a/docs/man/xl.cfg.pod.5	Tue Nov 29 14:17:27 2011 +0000
+++ b/docs/man/xl.cfg.pod.5	Tue Nov 29 14:19:59 2011 +0000
@@ -555,7 +555,13 @@
 
 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 (XXX which versions of Windows benefit?)
+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
 

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:32 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY7A-0006bV-4f; Wed, 30 Nov 2011 00:33:32 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY78-0006Rw-8X
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:30 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1322613170!5220175!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15921 invoked from network); 30 Nov 2011 00:32:51 -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;
	30 Nov 2011 00:32:51 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVYCx-0003vI-Hg
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6v-0003nt-93
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:17 +0000
Message-Id: <E1RVY6v-0003nt-93@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs/html/: Generate an "index.html"
	for hypercall docs
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Jackson <ian.jackson@eu.citrix.com>
# Date 1322581687 0
# Node ID f261080dca92d3df04fc7389fb904d432162f49b
# Parent  2d6bc8712c0135c51f32dd8ea7ed0de3a5100012
docs/html/: Generate an "index.html" for hypercall docs

Generate an "index.html" containing various useful links.

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 2d6bc8712c01 -r f261080dca92 docs/xen-headers
--- a/docs/xen-headers	Tue Nov 29 15:48:07 2011 +0000
+++ b/docs/xen-headers	Tue Nov 29 15:48:07 2011 +0000
@@ -17,6 +17,10 @@
 
 #  definitions must start in LH column
 #  extra syntax:
+#   `incontents <seq> <shortname> <anchor text html>...
+#                              make a table of contents entry; they
+#                              will be sorted by increasing seq, and
+#                              shortname will be used as the anchor target
 #    /* ` <definition>                          } parse as if <definition>
 #     * ` <definition>                          }  was not commented
 #   enum <name> { // <pattern>* => <func>()     } cross-reference
@@ -60,6 +64,8 @@
 # general globals
 our $pass;
 our %sdef; 
+our @incontents;
+our @outfiles;
 # $sdef{$type}{$name} => {
 #     DefLocs => { "$leaf_path:$lineno" => $leaf_opath ,... }
 #     Xrefs => { "$leaf_path,$lineno" => "$xref", ... }
@@ -187,6 +193,19 @@
     @pending_xrefs = ();
 }
 
+sub incontents ($$$) {
+    my ($text, $seq, $anchor) = @_;
+    $anchor = "incontents_$anchor";
+    if ($pass==2) {
+	push @incontents, { 
+	    Seq => $seq,
+	    Href => "$leaf_opath#$anchor",
+	    Title => $text,
+	};
+    }
+    return "<a name=\"$anchor\"><strong>$text</strong></a>";
+}
+
 sub write_file ($$) {
     my ($opath, $odata) = @_;
     my $out = new IO::File "$opath.new", '>' or die "$opath $!";
@@ -242,6 +261,8 @@
 	    }
 	} elsif (s/^( \s* \#define \s+ ) (\w+) ( \s+\S )
                   / $1.defmacro($2).norm($3) /xe) {
+	} elsif (s/( \`incontents \s+ (\d+) \s+ (\w+) \s+ )(\S .* \S)
+                 / norm($1).incontents($4, $2, $3) /xe) {
 	} else {
 	    if (m/^\s*\}/) {
 		$in_enum = undef;
@@ -261,11 +282,47 @@
     warning("pending xrefs at end of file") if @pending_xrefs;
 
     if ($pass == 2) {
+	push @outfiles, [ $leaf, $leaf_opath ];
 	$o .= "</pre></body></html>";
 	write_file($outfile, $o);
     }
 }
 
+sub output_index () {
+    my $title = "contents - $xtitle";
+    $o = '';
+    $o .= <<END;
+<html><head><title>$title</title></head>
+<body>
+<h1>$title</h1>
+<h2>Starting points</h2>
+<ul>
+END
+    foreach my $ic (sort { $a->{Seq} <=> $b->{Seq} } @incontents) {
+	$o .= "<li><a href=\"$ic->{Href}\">$ic->{Title}</a></li>\n";
+    }
+    $o .= "</ul>\n";
+    my $forkind = sub {
+	my ($type,$desc,$pfx,$sfx) = @_;
+	$o .= "<h2>$desc</h2><ul>\n";
+	foreach my $name (sort keys %{ $sdef{$type} }) {
+	    my $href = refhref($type,$name);
+	    next unless $href =~ m/\S/;
+	    $o .= "<li><a $href>$pfx$name$sfx</a></li>\n";
+	}
+	$o .= "</ul>\n";
+    };
+    $forkind->('Func','Functions','','()');
+    $forkind->('Struct','Structs','struct ','');
+    $forkind->('Enum','Enums and sets of #defines','','');
+    $forkind->('EnumVal','Enum values and individual #defines','','');
+    $o .= "</ul>\n<h2>Files</h2><ul>\n";
+    foreach my $of (sort { $a->[0] cmp $b->[0] } @outfiles) {
+	$o .= "<li><a href=\"$of->[1]\">$of->[0]</a></li>\n";
+    }
+    $o .= "</ul></body></html>\n";
+    write_file("$outdir/index.html", $o);
+}
 
 foreach $pass (qw(1 2)) {
     find({ wanted => 
@@ -290,3 +347,5 @@
 	 },
 	 map { "$basedir/$_" } @indirs);
 }
+
+output_index();
diff -r 2d6bc8712c01 -r f261080dca92 xen/include/public/xen.h
--- a/xen/include/public/xen.h	Tue Nov 29 15:48:07 2011 +0000
+++ b/xen/include/public/xen.h	Tue Nov 29 15:48:07 2011 +0000
@@ -55,7 +55,9 @@
  * HYPERCALLS
  */
 
-/* ` enum hypercall_num { // __HYPERVISOR_* => HYPERVISOR_*() */
+/* `incontents 100 hcalls List of hypercalls
+ * ` enum hypercall_num { // __HYPERVISOR_* => HYPERVISOR_*()
+ */
 
 #define __HYPERVISOR_set_trap_table        0
 #define __HYPERVISOR_mmu_update            1

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:32 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY79-0006b3-Sq; Wed, 30 Nov 2011 00:33:31 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY78-0006S1-8n
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:30 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-21.messagelabs.com!1322613171!17521!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8000 invoked from network); 30 Nov 2011 00:32:52 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Nov 2011 00:32:52 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVYCy-0003vO-G3
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6w-0003oN-7V
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:18 +0000
Message-Id: <E1RVY6w-0003oN-7V@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: improve index.html generation
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322583807 0
# Node ID 9c55908af1090b52c47f84a319f925f0805b71c6
# Parent  b264a2618f6cb3cdf67b1a786fa14193fcccb8e6
docs: improve index.html generation

Include hypercall documentation, fixing link generation for top level links to
use the INDEX.

Allow subsection links to be renamedi in the INDEX too.

Strip .txt suffixes as well as .html ones by moving the regex to the right
place instead of placing the literal text "(?:html|txt)" into the backlink to
the top level page. (oops)

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


diff -r b264a2618f6c -r 9c55908af109 docs/INDEX
--- a/docs/INDEX	Tue Nov 29 15:48:08 2011 +0000
+++ b/docs/INDEX	Tue Nov 29 16:23:27 2011 +0000
@@ -1,6 +1,10 @@
+hypercall/index			Hypercall Interfaces
+
+man				Man Pages
+
+misc				Miscellaneous Documentation
 misc/hvm-emulated-unplug	Xen HVM emulated device unplug protocol
-
-misc/console.txt		Xen PV Console notes
+misc/console			Xen PV Console notes
 
 # These are not all that useful anymore, hide them from the index
 reference/interface/index	NO-INDEX
diff -r b264a2618f6c -r 9c55908af109 docs/gen-html-index
--- a/docs/gen-html-index	Tue Nov 29 15:48:08 2011 +0000
+++ b/docs/gen-html-index	Tue Nov 29 16:23:27 2011 +0000
@@ -45,7 +45,7 @@
     }
     else
     {
-        $h1 = "<a href=\"../index.(?:html|txt)\">Xen Documentation</a> - $title";
+        $h1 = "<a href=\"../index.html\">Xen Documentation</a> - $title";
         $title = "Xen Documentation - $title";
     }
     $o .= <<END;
@@ -63,7 +63,7 @@
 sub make_linktext ($) {
     my ($l) = @_;
     return "$1($2)" if $l =~ m,^man/(.*)\.([0-9].*)\.html,;
-    $l =~ s/.(html)$//g;
+    $l =~ s/.(?:html|txt)$//g;
     return $index{$l} if exists $index{$l};
     return basename($l);
 }
@@ -109,13 +109,14 @@
     my @d = (grep /^\Q$od\E/, @docs);
     if ( @d == 1 and $d[0] eq "$od/index.html" )
     {
-        $top .= "<li><a href=\"${od}/index.html\">${od}/index.html</a></li>\n";
+        $top .= make_link("$od/index.html", 0);
     }
     else
     {
 	my $links = make_links($od,0,@d);
+	my $secttitle = make_linktext($od);
 	$top .= <<END;
-<li><a href=\"${od}/index.html\">$od</a></li>
+<li><a href=\"${od}/index.html\">$secttitle</a></li>
 <ul>
 $links
 </ul>
@@ -124,12 +125,12 @@
 	$links = make_links($od,1,@d);
         my $idx = '';
 	$idx .= <<END;
-<li>$od</li>
+<li>$secttitle</li>
 <ul>
 $links
 </ul>
 END
-        make_page("$outdir/$od/index.html", $od, $idx);
+        make_page("$outdir/$od/index.html", $secttitle, $idx);
     }
 }
 

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:32 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY7A-0006bV-4f; Wed, 30 Nov 2011 00:33:32 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY78-0006Rw-8X
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:30 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1322613170!5220175!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15921 invoked from network); 30 Nov 2011 00:32:51 -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;
	30 Nov 2011 00:32:51 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVYCx-0003vI-Hg
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6v-0003nt-93
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:17 +0000
Message-Id: <E1RVY6v-0003nt-93@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs/html/: Generate an "index.html"
	for hypercall docs
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Jackson <ian.jackson@eu.citrix.com>
# Date 1322581687 0
# Node ID f261080dca92d3df04fc7389fb904d432162f49b
# Parent  2d6bc8712c0135c51f32dd8ea7ed0de3a5100012
docs/html/: Generate an "index.html" for hypercall docs

Generate an "index.html" containing various useful links.

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 2d6bc8712c01 -r f261080dca92 docs/xen-headers
--- a/docs/xen-headers	Tue Nov 29 15:48:07 2011 +0000
+++ b/docs/xen-headers	Tue Nov 29 15:48:07 2011 +0000
@@ -17,6 +17,10 @@
 
 #  definitions must start in LH column
 #  extra syntax:
+#   `incontents <seq> <shortname> <anchor text html>...
+#                              make a table of contents entry; they
+#                              will be sorted by increasing seq, and
+#                              shortname will be used as the anchor target
 #    /* ` <definition>                          } parse as if <definition>
 #     * ` <definition>                          }  was not commented
 #   enum <name> { // <pattern>* => <func>()     } cross-reference
@@ -60,6 +64,8 @@
 # general globals
 our $pass;
 our %sdef; 
+our @incontents;
+our @outfiles;
 # $sdef{$type}{$name} => {
 #     DefLocs => { "$leaf_path:$lineno" => $leaf_opath ,... }
 #     Xrefs => { "$leaf_path,$lineno" => "$xref", ... }
@@ -187,6 +193,19 @@
     @pending_xrefs = ();
 }
 
+sub incontents ($$$) {
+    my ($text, $seq, $anchor) = @_;
+    $anchor = "incontents_$anchor";
+    if ($pass==2) {
+	push @incontents, { 
+	    Seq => $seq,
+	    Href => "$leaf_opath#$anchor",
+	    Title => $text,
+	};
+    }
+    return "<a name=\"$anchor\"><strong>$text</strong></a>";
+}
+
 sub write_file ($$) {
     my ($opath, $odata) = @_;
     my $out = new IO::File "$opath.new", '>' or die "$opath $!";
@@ -242,6 +261,8 @@
 	    }
 	} elsif (s/^( \s* \#define \s+ ) (\w+) ( \s+\S )
                   / $1.defmacro($2).norm($3) /xe) {
+	} elsif (s/( \`incontents \s+ (\d+) \s+ (\w+) \s+ )(\S .* \S)
+                 / norm($1).incontents($4, $2, $3) /xe) {
 	} else {
 	    if (m/^\s*\}/) {
 		$in_enum = undef;
@@ -261,11 +282,47 @@
     warning("pending xrefs at end of file") if @pending_xrefs;
 
     if ($pass == 2) {
+	push @outfiles, [ $leaf, $leaf_opath ];
 	$o .= "</pre></body></html>";
 	write_file($outfile, $o);
     }
 }
 
+sub output_index () {
+    my $title = "contents - $xtitle";
+    $o = '';
+    $o .= <<END;
+<html><head><title>$title</title></head>
+<body>
+<h1>$title</h1>
+<h2>Starting points</h2>
+<ul>
+END
+    foreach my $ic (sort { $a->{Seq} <=> $b->{Seq} } @incontents) {
+	$o .= "<li><a href=\"$ic->{Href}\">$ic->{Title}</a></li>\n";
+    }
+    $o .= "</ul>\n";
+    my $forkind = sub {
+	my ($type,$desc,$pfx,$sfx) = @_;
+	$o .= "<h2>$desc</h2><ul>\n";
+	foreach my $name (sort keys %{ $sdef{$type} }) {
+	    my $href = refhref($type,$name);
+	    next unless $href =~ m/\S/;
+	    $o .= "<li><a $href>$pfx$name$sfx</a></li>\n";
+	}
+	$o .= "</ul>\n";
+    };
+    $forkind->('Func','Functions','','()');
+    $forkind->('Struct','Structs','struct ','');
+    $forkind->('Enum','Enums and sets of #defines','','');
+    $forkind->('EnumVal','Enum values and individual #defines','','');
+    $o .= "</ul>\n<h2>Files</h2><ul>\n";
+    foreach my $of (sort { $a->[0] cmp $b->[0] } @outfiles) {
+	$o .= "<li><a href=\"$of->[1]\">$of->[0]</a></li>\n";
+    }
+    $o .= "</ul></body></html>\n";
+    write_file("$outdir/index.html", $o);
+}
 
 foreach $pass (qw(1 2)) {
     find({ wanted => 
@@ -290,3 +347,5 @@
 	 },
 	 map { "$basedir/$_" } @indirs);
 }
+
+output_index();
diff -r 2d6bc8712c01 -r f261080dca92 xen/include/public/xen.h
--- a/xen/include/public/xen.h	Tue Nov 29 15:48:07 2011 +0000
+++ b/xen/include/public/xen.h	Tue Nov 29 15:48:07 2011 +0000
@@ -55,7 +55,9 @@
  * HYPERCALLS
  */
 
-/* ` enum hypercall_num { // __HYPERVISOR_* => HYPERVISOR_*() */
+/* `incontents 100 hcalls List of hypercalls
+ * ` enum hypercall_num { // __HYPERVISOR_* => HYPERVISOR_*()
+ */
 
 #define __HYPERVISOR_set_trap_table        0
 #define __HYPERVISOR_mmu_update            1

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:32 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY79-0006b3-Sq; Wed, 30 Nov 2011 00:33:31 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY78-0006S1-8n
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:30 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-21.messagelabs.com!1322613171!17521!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8000 invoked from network); 30 Nov 2011 00:32:52 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Nov 2011 00:32:52 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVYCy-0003vO-G3
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6w-0003oN-7V
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:18 +0000
Message-Id: <E1RVY6w-0003oN-7V@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: improve index.html generation
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322583807 0
# Node ID 9c55908af1090b52c47f84a319f925f0805b71c6
# Parent  b264a2618f6cb3cdf67b1a786fa14193fcccb8e6
docs: improve index.html generation

Include hypercall documentation, fixing link generation for top level links to
use the INDEX.

Allow subsection links to be renamedi in the INDEX too.

Strip .txt suffixes as well as .html ones by moving the regex to the right
place instead of placing the literal text "(?:html|txt)" into the backlink to
the top level page. (oops)

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


diff -r b264a2618f6c -r 9c55908af109 docs/INDEX
--- a/docs/INDEX	Tue Nov 29 15:48:08 2011 +0000
+++ b/docs/INDEX	Tue Nov 29 16:23:27 2011 +0000
@@ -1,6 +1,10 @@
+hypercall/index			Hypercall Interfaces
+
+man				Man Pages
+
+misc				Miscellaneous Documentation
 misc/hvm-emulated-unplug	Xen HVM emulated device unplug protocol
-
-misc/console.txt		Xen PV Console notes
+misc/console			Xen PV Console notes
 
 # These are not all that useful anymore, hide them from the index
 reference/interface/index	NO-INDEX
diff -r b264a2618f6c -r 9c55908af109 docs/gen-html-index
--- a/docs/gen-html-index	Tue Nov 29 15:48:08 2011 +0000
+++ b/docs/gen-html-index	Tue Nov 29 16:23:27 2011 +0000
@@ -45,7 +45,7 @@
     }
     else
     {
-        $h1 = "<a href=\"../index.(?:html|txt)\">Xen Documentation</a> - $title";
+        $h1 = "<a href=\"../index.html\">Xen Documentation</a> - $title";
         $title = "Xen Documentation - $title";
     }
     $o .= <<END;
@@ -63,7 +63,7 @@
 sub make_linktext ($) {
     my ($l) = @_;
     return "$1($2)" if $l =~ m,^man/(.*)\.([0-9].*)\.html,;
-    $l =~ s/.(html)$//g;
+    $l =~ s/.(?:html|txt)$//g;
     return $index{$l} if exists $index{$l};
     return basename($l);
 }
@@ -109,13 +109,14 @@
     my @d = (grep /^\Q$od\E/, @docs);
     if ( @d == 1 and $d[0] eq "$od/index.html" )
     {
-        $top .= "<li><a href=\"${od}/index.html\">${od}/index.html</a></li>\n";
+        $top .= make_link("$od/index.html", 0);
     }
     else
     {
 	my $links = make_links($od,0,@d);
+	my $secttitle = make_linktext($od);
 	$top .= <<END;
-<li><a href=\"${od}/index.html\">$od</a></li>
+<li><a href=\"${od}/index.html\">$secttitle</a></li>
 <ul>
 $links
 </ul>
@@ -124,12 +125,12 @@
 	$links = make_links($od,1,@d);
         my $idx = '';
 	$idx .= <<END;
-<li>$od</li>
+<li>$secttitle</li>
 <ul>
 $links
 </ul>
 END
-        make_page("$outdir/$od/index.html", $od, $idx);
+        make_page("$outdir/$od/index.html", $secttitle, $idx);
     }
 }
 

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:32 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY79-0006aY-Lj; Wed, 30 Nov 2011 00:33:31 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY77-0006Rd-MS
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-182.messagelabs.com!1322613169!650681!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.2 required=7.0 tests=HOT_NASTY
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18476 invoked from network); 30 Nov 2011 00:32:51 -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;
	30 Nov 2011 00:32:51 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVYCv-0003v6-IH
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6t-0003m9-9S
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:15 +0000
Message-Id: <E1RVY6t-0003m9-9S@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: xlexample.hvm: mention the
	viridian setting.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322576247 0
# Node ID a025f010790018448a3774c8f278e62e9a75622a
# Parent  70c6aa688faf0da81bbde899bb442a9f4c7f80d8
docs: xlexample.hvm: mention the viridian setting.

Turning this on for Windows guests is recommended.

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


diff -r 70c6aa688faf -r a025f0107900 tools/examples/xlexample.hvm
--- a/tools/examples/xlexample.hvm	Tue Nov 29 14:17:27 2011 +0000
+++ b/tools/examples/xlexample.hvm	Tue Nov 29 14:17:27 2011 +0000
@@ -16,6 +16,11 @@
 # The default behavior is to generate a new UUID each time the guest is started.
 #uuid = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
 
+# Enable Microsoft Hyper-V compatibile paravirtualisation /
+# enlightenment interfaces. Turning this on can improve Windows guest
+# performance and is therefore recommended
+#viridian = 1
+
 # Initial memory allocation (MB)
 memory = 128
 

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:32 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY79-0006aY-Lj; Wed, 30 Nov 2011 00:33:31 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY77-0006Rd-MS
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-182.messagelabs.com!1322613169!650681!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.2 required=7.0 tests=HOT_NASTY
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18476 invoked from network); 30 Nov 2011 00:32:51 -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;
	30 Nov 2011 00:32:51 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVYCv-0003v6-IH
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6t-0003m9-9S
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:15 +0000
Message-Id: <E1RVY6t-0003m9-9S@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: xlexample.hvm: mention the
	viridian setting.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1322576247 0
# Node ID a025f010790018448a3774c8f278e62e9a75622a
# Parent  70c6aa688faf0da81bbde899bb442a9f4c7f80d8
docs: xlexample.hvm: mention the viridian setting.

Turning this on for Windows guests is recommended.

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


diff -r 70c6aa688faf -r a025f0107900 tools/examples/xlexample.hvm
--- a/tools/examples/xlexample.hvm	Tue Nov 29 14:17:27 2011 +0000
+++ b/tools/examples/xlexample.hvm	Tue Nov 29 14:17:27 2011 +0000
@@ -16,6 +16,11 @@
 # The default behavior is to generate a new UUID each time the guest is started.
 #uuid = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
 
+# Enable Microsoft Hyper-V compatibile paravirtualisation /
+# enlightenment interfaces. Turning this on can improve Windows guest
+# performance and is therefore recommended
+#viridian = 1
+
 # Initial memory allocation (MB)
 memory = 128
 

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:32 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY79-0006Zd-32; Wed, 30 Nov 2011 00:33:31 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY76-0006Ra-SV
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1322613169!5708!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30946 invoked from network); 30 Nov 2011 00:32:50 -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;
	30 Nov 2011 00:32:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVYCx-0003vF-18
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6u-0003mv-Oh
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:16 +0000
Message-Id: <E1RVY6u-0003mv-Oh@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs/html/: Annotations for two
	hypercalls
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Jackson <ian.jackson@eu.citrix.com>
# Date 1322581687 0
# Node ID 2d6bc8712c0135c51f32dd8ea7ed0de3a5100012
# Parent  549b8f4b9560e4947f625656b80ad3218da91675
docs/html/: Annotations for two hypercalls

Add annotations for a couple of the hypercalls:
 HYPERVISOR_set_trap_table
 HYPERVISOR_mmu_update

We do this by
 * annotating the list of #defines for hypercall numbers
 * annotating the list of error values
 * providing a function prototype for the systematically-named functions
The header generator does the rest.

This exercise revealed a couple of infelicities:
 * In the actual source code, do_mmu_update is defined to return an int
   and do_set_trap_table a long.  However both functions return either
   -Efoo (on error) or 0 for success.
 * The error numbers are defined only in the private header file
   xen/include/xen/errno.h and then only with names which will
   typically clash with other projects.  It would be nice to include a
   public version of this header which defines XEN_E*.  But for now
   we run xen-headers on errno.h too.

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 549b8f4b9560 -r 2d6bc8712c01 docs/Makefile
--- a/docs/Makefile	Tue Nov 29 15:48:06 2011 +0000
+++ b/docs/Makefile	Tue Nov 29 15:48:07 2011 +0000
@@ -159,7 +159,7 @@
 	./xen-headers -O $(@D) \
 		-T 'arch-x86_64 - Xen public headers' \
 		-X arch-ia64 -X arch-x86_32 -X xen-x86_32 \
-		../xen include/public
+		../xen include/public include/xen/errno.h
 	touch $@
 
 txt/%.txt: %.txt
diff -r 549b8f4b9560 -r 2d6bc8712c01 xen/include/public/arch-x86/xen.h
--- a/xen/include/public/arch-x86/xen.h	Tue Nov 29 15:48:06 2011 +0000
+++ b/xen/include/public/arch-x86/xen.h	Tue Nov 29 15:48:07 2011 +0000
@@ -82,7 +82,13 @@
 typedef unsigned long xen_ulong_t;
 
 /*
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_set_trap_table(const struct trap_info traps[]);
+ * `
+ */
+/*
  * Send an array of these to HYPERVISOR_set_trap_table().
+ * Terminate the array with a sentinel entry, with traps[].address==0.
  * The privilege level specifies which modes may enter a trap via a software
  * interrupt. On x86/64, since rings 1 and 2 are unavailable, we allocate
  * privilege levels as follows:
diff -r 549b8f4b9560 -r 2d6bc8712c01 xen/include/public/xen.h
--- a/xen/include/public/xen.h	Tue Nov 29 15:48:06 2011 +0000
+++ b/xen/include/public/xen.h	Tue Nov 29 15:48:07 2011 +0000
@@ -55,6 +55,8 @@
  * HYPERCALLS
  */
 
+/* ` enum hypercall_num { // __HYPERVISOR_* => HYPERVISOR_*() */
+
 #define __HYPERVISOR_set_trap_table        0
 #define __HYPERVISOR_mmu_update            1
 #define __HYPERVISOR_set_gdt               2
@@ -105,6 +107,8 @@
 #define __HYPERVISOR_arch_6               54
 #define __HYPERVISOR_arch_7               55
 
+/* ` } */
+
 /*
  * HYPERCALL COMPATIBILITY.
  */
@@ -163,8 +167,11 @@
 #define NR_VIRQS       24
 
 /*
- * HYPERVISOR_mmu_update(reqs, count, pdone, foreigndom)
- * 
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_mmu_update(const struct mmu_update reqs[],
+ * `                       unsigned count, unsigned *done_out,
+ * `                       unsigned foreigndom)
+ * `
  * @reqs is an array of mmu_update_t structures ((ptr, val) pairs).
  * @count is the length of the above array.
  * @pdone is an output parameter indicating number of completed operations
diff -r 549b8f4b9560 -r 2d6bc8712c01 xen/include/xen/errno.h
--- a/xen/include/xen/errno.h	Tue Nov 29 15:48:06 2011 +0000
+++ b/xen/include/xen/errno.h	Tue Nov 29 15:48:07 2011 +0000
@@ -1,6 +1,9 @@
 #ifndef _I386_ERRNO_H
 #define _I386_ERRNO_H
 
+/* ` enum neg_errnoval {  [ -Efoo for each Efoo in the list below ]  } */
+/* ` enum errnoval { */
+
 #define	EPERM		 1	/* Operation not permitted */
 #define	ENOENT		 2	/* No such file or directory */
 #define	ESRCH		 3	/* No such process */
@@ -129,4 +132,6 @@
 #define	ENOMEDIUM	123	/* No medium found */
 #define	EMEDIUMTYPE	124	/* Wrong medium type */
 
+/* ` } */
+
 #endif

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:32 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY79-0006Zd-32; Wed, 30 Nov 2011 00:33:31 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY76-0006Ra-SV
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1322613169!5708!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30946 invoked from network); 30 Nov 2011 00:32:50 -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;
	30 Nov 2011 00:32:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVYCx-0003vF-18
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6u-0003mv-Oh
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:16 +0000
Message-Id: <E1RVY6u-0003mv-Oh@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs/html/: Annotations for two
	hypercalls
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Jackson <ian.jackson@eu.citrix.com>
# Date 1322581687 0
# Node ID 2d6bc8712c0135c51f32dd8ea7ed0de3a5100012
# Parent  549b8f4b9560e4947f625656b80ad3218da91675
docs/html/: Annotations for two hypercalls

Add annotations for a couple of the hypercalls:
 HYPERVISOR_set_trap_table
 HYPERVISOR_mmu_update

We do this by
 * annotating the list of #defines for hypercall numbers
 * annotating the list of error values
 * providing a function prototype for the systematically-named functions
The header generator does the rest.

This exercise revealed a couple of infelicities:
 * In the actual source code, do_mmu_update is defined to return an int
   and do_set_trap_table a long.  However both functions return either
   -Efoo (on error) or 0 for success.
 * The error numbers are defined only in the private header file
   xen/include/xen/errno.h and then only with names which will
   typically clash with other projects.  It would be nice to include a
   public version of this header which defines XEN_E*.  But for now
   we run xen-headers on errno.h too.

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 549b8f4b9560 -r 2d6bc8712c01 docs/Makefile
--- a/docs/Makefile	Tue Nov 29 15:48:06 2011 +0000
+++ b/docs/Makefile	Tue Nov 29 15:48:07 2011 +0000
@@ -159,7 +159,7 @@
 	./xen-headers -O $(@D) \
 		-T 'arch-x86_64 - Xen public headers' \
 		-X arch-ia64 -X arch-x86_32 -X xen-x86_32 \
-		../xen include/public
+		../xen include/public include/xen/errno.h
 	touch $@
 
 txt/%.txt: %.txt
diff -r 549b8f4b9560 -r 2d6bc8712c01 xen/include/public/arch-x86/xen.h
--- a/xen/include/public/arch-x86/xen.h	Tue Nov 29 15:48:06 2011 +0000
+++ b/xen/include/public/arch-x86/xen.h	Tue Nov 29 15:48:07 2011 +0000
@@ -82,7 +82,13 @@
 typedef unsigned long xen_ulong_t;
 
 /*
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_set_trap_table(const struct trap_info traps[]);
+ * `
+ */
+/*
  * Send an array of these to HYPERVISOR_set_trap_table().
+ * Terminate the array with a sentinel entry, with traps[].address==0.
  * The privilege level specifies which modes may enter a trap via a software
  * interrupt. On x86/64, since rings 1 and 2 are unavailable, we allocate
  * privilege levels as follows:
diff -r 549b8f4b9560 -r 2d6bc8712c01 xen/include/public/xen.h
--- a/xen/include/public/xen.h	Tue Nov 29 15:48:06 2011 +0000
+++ b/xen/include/public/xen.h	Tue Nov 29 15:48:07 2011 +0000
@@ -55,6 +55,8 @@
  * HYPERCALLS
  */
 
+/* ` enum hypercall_num { // __HYPERVISOR_* => HYPERVISOR_*() */
+
 #define __HYPERVISOR_set_trap_table        0
 #define __HYPERVISOR_mmu_update            1
 #define __HYPERVISOR_set_gdt               2
@@ -105,6 +107,8 @@
 #define __HYPERVISOR_arch_6               54
 #define __HYPERVISOR_arch_7               55
 
+/* ` } */
+
 /*
  * HYPERCALL COMPATIBILITY.
  */
@@ -163,8 +167,11 @@
 #define NR_VIRQS       24
 
 /*
- * HYPERVISOR_mmu_update(reqs, count, pdone, foreigndom)
- * 
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_mmu_update(const struct mmu_update reqs[],
+ * `                       unsigned count, unsigned *done_out,
+ * `                       unsigned foreigndom)
+ * `
  * @reqs is an array of mmu_update_t structures ((ptr, val) pairs).
  * @count is the length of the above array.
  * @pdone is an output parameter indicating number of completed operations
diff -r 549b8f4b9560 -r 2d6bc8712c01 xen/include/xen/errno.h
--- a/xen/include/xen/errno.h	Tue Nov 29 15:48:06 2011 +0000
+++ b/xen/include/xen/errno.h	Tue Nov 29 15:48:07 2011 +0000
@@ -1,6 +1,9 @@
 #ifndef _I386_ERRNO_H
 #define _I386_ERRNO_H
 
+/* ` enum neg_errnoval {  [ -Efoo for each Efoo in the list below ]  } */
+/* ` enum errnoval { */
+
 #define	EPERM		 1	/* Operation not permitted */
 #define	ENOENT		 2	/* No such file or directory */
 #define	ESRCH		 3	/* No such process */
@@ -129,4 +132,6 @@
 #define	ENOMEDIUM	123	/* No medium found */
 #define	EMEDIUMTYPE	124	/* Wrong medium type */
 
+/* ` } */
+
 #endif

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:32 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY79-0006Zq-Fi; Wed, 30 Nov 2011 00:33:31 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY77-0006Rp-PT
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:30 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-21.messagelabs.com!1322613170!6094519!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10411 invoked from network); 30 Nov 2011 00:32:51 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Nov 2011 00:32:51 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVYCy-0003vL-0r
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6v-0003o8-Oc
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:17 +0000
Message-Id: <E1RVY6v-0003o8-Oc@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs/html/: Arrange for automatic
	build of hypercall docs
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Jackson <ian.jackson@eu.citrix.com>
# Date 1322581688 0
# Node ID b264a2618f6cb3cdf67b1a786fa14193fcccb8e6
# Parent  f261080dca92d3df04fc7389fb904d432162f49b
docs/html/: Arrange for automatic build of hypercall docs

- Use index.html rather than a stamp file.
- Automatically generate dependencies.
- Wire into the docs build system

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 f261080dca92 -r b264a2618f6c docs/Makefile
--- a/docs/Makefile	Tue Nov 29 15:48:07 2011 +0000
+++ b/docs/Makefile	Tue Nov 29 15:48:08 2011 +0000
@@ -18,7 +18,8 @@
 		   $(patsubst %.markdown,html/%.html,$(DOC_MARKDOWN)) \
 		   $(patsubst man/%.pod.1,html/man/%.1.html,$(DOC_MAN1SRC)) \
 		   $(patsubst man/%.pod.5,html/man/%.5.html,$(DOC_MAN5SRC)) \
-		   $(patsubst %.txt,html/%.txt,$(wildcard misc/*.txt))
+		   $(patsubst %.txt,html/%.txt,$(wildcard misc/*.txt)) \
+		   html/hypercall/index.html
 DOC_TXT         := $(patsubst %.txt,txt/%.txt,$(wildcard misc/*.txt)) \
 		   $(patsubst %.markdown,txt/%.txt,$(DOC_MARKDOWN)) \
 		   $(patsubst man/%.pod.1,txt/man/%.1.txt,$(DOC_MAN1SRC)) \
@@ -154,13 +155,15 @@
 	$(POD2HTML) --infile=$< --outfile=$@.tmp
 	$(call move-if-changed,$@.tmp,$@)
 
-html/hypercall/stamp:
+html/hypercall/index.html: ./xen-headers
+	rm -rf $(@D)
 	@$(INSTALL_DIR) $(@D)
 	./xen-headers -O $(@D) \
 		-T 'arch-x86_64 - Xen public headers' \
 		-X arch-ia64 -X arch-x86_32 -X xen-x86_32 \
 		../xen include/public include/xen/errno.h
-	touch $@
+
+-include html/hypercall/.deps
 
 txt/%.txt: %.txt
 	$(INSTALL_DIR) $(@D)
diff -r f261080dca92 -r b264a2618f6c docs/xen-headers
--- a/docs/xen-headers	Tue Nov 29 15:48:07 2011 +0000
+++ b/docs/xen-headers	Tue Nov 29 15:48:08 2011 +0000
@@ -325,6 +325,12 @@
 }
 
 foreach $pass (qw(1 2)) {
+    my $depspath = "$outdir/.deps";
+    my $depsout;
+    if ($pass==2) {
+	$depsout = new IO::File "$depspath.new", 'w' or die $!;
+    }
+
     find({ wanted => 
 	       sub {
 		   return unless m/\.h$/;
@@ -341,11 +347,19 @@
 		   $leaf_opath = $leaf;
 		   $leaf_opath =~ s#/#,#g;
 		   $leaf_opath .= ".html";
+		   print $depsout "$outdir/index.html: $File::Find::name\n"
+		       or die $!
+		       if $pass==2;
 		   process_file($File::Find::name, $outdir.'/'.$leaf_opath);
 	   },
 	   no_chdir => 1,
 	 },
 	 map { "$basedir/$_" } @indirs);
+
+    if ($pass==2) {
+	close $depsout or die $!;
+	rename "$depspath.new", "$depspath" or die $!;
+    }
 }
 
 output_index();

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:32 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00:33:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVY79-0006Zq-Fi; Wed, 30 Nov 2011 00:33:31 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY77-0006Rp-PT
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:30 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-21.messagelabs.com!1322613170!6094519!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10411 invoked from network); 30 Nov 2011 00:32:51 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Nov 2011 00:32:51 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVYCy-0003vL-0r
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6v-0003o8-Oc
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:17 +0000
Message-Id: <E1RVY6v-0003o8-Oc@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs/html/: Arrange for automatic
	build of hypercall docs
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Jackson <ian.jackson@eu.citrix.com>
# Date 1322581688 0
# Node ID b264a2618f6cb3cdf67b1a786fa14193fcccb8e6
# Parent  f261080dca92d3df04fc7389fb904d432162f49b
docs/html/: Arrange for automatic build of hypercall docs

- Use index.html rather than a stamp file.
- Automatically generate dependencies.
- Wire into the docs build system

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 f261080dca92 -r b264a2618f6c docs/Makefile
--- a/docs/Makefile	Tue Nov 29 15:48:07 2011 +0000
+++ b/docs/Makefile	Tue Nov 29 15:48:08 2011 +0000
@@ -18,7 +18,8 @@
 		   $(patsubst %.markdown,html/%.html,$(DOC_MARKDOWN)) \
 		   $(patsubst man/%.pod.1,html/man/%.1.html,$(DOC_MAN1SRC)) \
 		   $(patsubst man/%.pod.5,html/man/%.5.html,$(DOC_MAN5SRC)) \
-		   $(patsubst %.txt,html/%.txt,$(wildcard misc/*.txt))
+		   $(patsubst %.txt,html/%.txt,$(wildcard misc/*.txt)) \
+		   html/hypercall/index.html
 DOC_TXT         := $(patsubst %.txt,txt/%.txt,$(wildcard misc/*.txt)) \
 		   $(patsubst %.markdown,txt/%.txt,$(DOC_MARKDOWN)) \
 		   $(patsubst man/%.pod.1,txt/man/%.1.txt,$(DOC_MAN1SRC)) \
@@ -154,13 +155,15 @@
 	$(POD2HTML) --infile=$< --outfile=$@.tmp
 	$(call move-if-changed,$@.tmp,$@)
 
-html/hypercall/stamp:
+html/hypercall/index.html: ./xen-headers
+	rm -rf $(@D)
 	@$(INSTALL_DIR) $(@D)
 	./xen-headers -O $(@D) \
 		-T 'arch-x86_64 - Xen public headers' \
 		-X arch-ia64 -X arch-x86_32 -X xen-x86_32 \
 		../xen include/public include/xen/errno.h
-	touch $@
+
+-include html/hypercall/.deps
 
 txt/%.txt: %.txt
 	$(INSTALL_DIR) $(@D)
diff -r f261080dca92 -r b264a2618f6c docs/xen-headers
--- a/docs/xen-headers	Tue Nov 29 15:48:07 2011 +0000
+++ b/docs/xen-headers	Tue Nov 29 15:48:08 2011 +0000
@@ -325,6 +325,12 @@
 }
 
 foreach $pass (qw(1 2)) {
+    my $depspath = "$outdir/.deps";
+    my $depsout;
+    if ($pass==2) {
+	$depsout = new IO::File "$depspath.new", 'w' or die $!;
+    }
+
     find({ wanted => 
 	       sub {
 		   return unless m/\.h$/;
@@ -341,11 +347,19 @@
 		   $leaf_opath = $leaf;
 		   $leaf_opath =~ s#/#,#g;
 		   $leaf_opath .= ".html";
+		   print $depsout "$outdir/index.html: $File::Find::name\n"
+		       or die $!
+		       if $pass==2;
 		   process_file($File::Find::name, $outdir.'/'.$leaf_opath);
 	   },
 	   no_chdir => 1,
 	 },
 	 map { "$basedir/$_" } @indirs);
+
+    if ($pass==2) {
+	close $depsout or die $!;
+	rename "$depspath.new", "$depspath" or die $!;
+    }
 }
 
 output_index();

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:33 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00: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.xensource.com>)
	id 1RVY7B-0006dz-FB; Wed, 30 Nov 2011 00:33:33 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY79-0006Sm-1i
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:31 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1322613171!5531519!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12956 invoked from network); 30 Nov 2011 00:32:52 -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;
	30 Nov 2011 00:32:52 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVYCy-0003vR-V2
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6w-0003oc-MV
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:18 +0000
Message-Id: <E1RVY6w-0003oc-MV@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] doc: Update MMU_NORMAL_PT_UPDATE
	requirements.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
# Date 1322586121 18000
# Node ID b20bf5a5a9c756f9ba5adcf21afea8499748cc11
# Parent  9c55908af1090b52c47f84a319f925f0805b71c6
doc: Update MMU_NORMAL_PT_UPDATE requirements.

There are some implicit requirements when using the hypercall
which are not mentioned.

Mainly the requirement that the pagetable be RO.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 9c55908af109 -r b20bf5a5a9c7 xen/include/public/xen.h
--- a/xen/include/public/xen.h	Tue Nov 29 16:23:27 2011 +0000
+++ b/xen/include/public/xen.h	Tue Nov 29 12:02:01 2011 -0500
@@ -196,6 +196,40 @@
  * FD == DOMID_XEN: Map restricted areas of Xen's heap space.
  * ptr[:2]  -- Machine address of the page-table entry to modify.
  * val      -- Value to write.
+ *
+ * There also certain implicit requirements when using this hypercall. The
+ * pages that make up a pagetable must be mapped read-only in the guest.
+ * This prevents uncontrolled guest updates to the pagetable. Xen strictly
+ * enforces this, and will disallow any pagetable update which will end up
+ * mapping pagetable page RW, and will disallow using any writable page as a
+ * pagetable. In practice it means that when constructing a page table for a
+ * process, thread, etc, we MUST be very dilligient in following these rules:
+ *  1). Start with top-level page (PGD or in Xen language: L4). Fill out
+ *      the entries.
+ *  2). Keep on going, filling out the upper (PUD or L3), and middle (PMD
+ *      or L2).
+ *  3). Start filling out the PTE table (L1) with the PTE entries. Once
+ *  	done, make sure to set each of those entries to RO (so writeable bit
+ *  	is unset). Once that has been completed, set the PMD (L2) for this
+ *  	PTE table as RO.
+ *  4). When completed with all of the PMD (L2) entries, and all of them have
+ *  	been set to RO, make sure to set RO the PUD (L3). Do the same
+ *  	operation on PGD (L4) pagetable entries that have a PUD (L3) entry.
+ *  5). Now before you can use those pages (so setting the cr3), you MUST also
+ *      pin them so that the hypervisor can verify the entries. This is done
+ *      via the HYPERVISOR_mmuext_op(MMUEXT_PIN_L4_TABLE, guest physical frame
+ *      number of the PGD (L4)). And this point the HYPERVISOR_mmuext_op(
+ *      MMUEXT_NEW_BASEPTR, guest physical frame number of the PGD (L4)) can be
+ *      issued.
+ * For 32-bit guests, the L4 is not used (as there is less pagetables), so
+ * instead use L3.
+ * At this point the pagetables can be modified using the MMU_NORMAL_PT_UPDATE
+ * hypercall. Also if so desired the OS can also try to write to the PTE
+ * and be trapped by the hypervisor (as the PTE entry is RO).
+ *
+ * To deallocate the pages, the operations are the reverse of the steps
+ * mentioned above. The argument is MMUEXT_UNPIN_TABLE for all levels and the
+ * pagetable MUST not be in use (meaning that the cr3 is not set to it).
  * 
  * ptr[1:0] == MMU_MACHPHYS_UPDATE:
  * Updates an entry in the machine->pseudo-physical mapping table.

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:33 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00: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.xensource.com>)
	id 1RVY7B-0006dz-FB; Wed, 30 Nov 2011 00:33:33 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY79-0006Sm-1i
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:31 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1322613171!5531519!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12956 invoked from network); 30 Nov 2011 00:32:52 -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;
	30 Nov 2011 00:32:52 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVYCy-0003vR-V2
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6w-0003oc-MV
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:18 +0000
Message-Id: <E1RVY6w-0003oc-MV@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] doc: Update MMU_NORMAL_PT_UPDATE
	requirements.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
# Date 1322586121 18000
# Node ID b20bf5a5a9c756f9ba5adcf21afea8499748cc11
# Parent  9c55908af1090b52c47f84a319f925f0805b71c6
doc: Update MMU_NORMAL_PT_UPDATE requirements.

There are some implicit requirements when using the hypercall
which are not mentioned.

Mainly the requirement that the pagetable be RO.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 9c55908af109 -r b20bf5a5a9c7 xen/include/public/xen.h
--- a/xen/include/public/xen.h	Tue Nov 29 16:23:27 2011 +0000
+++ b/xen/include/public/xen.h	Tue Nov 29 12:02:01 2011 -0500
@@ -196,6 +196,40 @@
  * FD == DOMID_XEN: Map restricted areas of Xen's heap space.
  * ptr[:2]  -- Machine address of the page-table entry to modify.
  * val      -- Value to write.
+ *
+ * There also certain implicit requirements when using this hypercall. The
+ * pages that make up a pagetable must be mapped read-only in the guest.
+ * This prevents uncontrolled guest updates to the pagetable. Xen strictly
+ * enforces this, and will disallow any pagetable update which will end up
+ * mapping pagetable page RW, and will disallow using any writable page as a
+ * pagetable. In practice it means that when constructing a page table for a
+ * process, thread, etc, we MUST be very dilligient in following these rules:
+ *  1). Start with top-level page (PGD or in Xen language: L4). Fill out
+ *      the entries.
+ *  2). Keep on going, filling out the upper (PUD or L3), and middle (PMD
+ *      or L2).
+ *  3). Start filling out the PTE table (L1) with the PTE entries. Once
+ *  	done, make sure to set each of those entries to RO (so writeable bit
+ *  	is unset). Once that has been completed, set the PMD (L2) for this
+ *  	PTE table as RO.
+ *  4). When completed with all of the PMD (L2) entries, and all of them have
+ *  	been set to RO, make sure to set RO the PUD (L3). Do the same
+ *  	operation on PGD (L4) pagetable entries that have a PUD (L3) entry.
+ *  5). Now before you can use those pages (so setting the cr3), you MUST also
+ *      pin them so that the hypervisor can verify the entries. This is done
+ *      via the HYPERVISOR_mmuext_op(MMUEXT_PIN_L4_TABLE, guest physical frame
+ *      number of the PGD (L4)). And this point the HYPERVISOR_mmuext_op(
+ *      MMUEXT_NEW_BASEPTR, guest physical frame number of the PGD (L4)) can be
+ *      issued.
+ * For 32-bit guests, the L4 is not used (as there is less pagetables), so
+ * instead use L3.
+ * At this point the pagetables can be modified using the MMU_NORMAL_PT_UPDATE
+ * hypercall. Also if so desired the OS can also try to write to the PTE
+ * and be trapped by the hypervisor (as the PTE entry is RO).
+ *
+ * To deallocate the pages, the operations are the reverse of the steps
+ * mentioned above. The argument is MMUEXT_UNPIN_TABLE for all levels and the
+ * pagetable MUST not be in use (meaning that the cr3 is not set to it).
  * 
  * ptr[1:0] == MMU_MACHPHYS_UPDATE:
  * Updates an entry in the machine->pseudo-physical mapping table.

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:33 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00: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.xensource.com>)
	id 1RVY7B-0006e9-IR; Wed, 30 Nov 2011 00:33:33 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY79-0006T7-Jb
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:31 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-21.messagelabs.com!1322613172!17524!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8015 invoked from network); 30 Nov 2011 00:32:53 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Nov 2011 00:32:53 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVYCz-0003vU-HH
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6x-0003or-5U
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:19 +0000
Message-Id: <E1RVY6x-0003or-5U@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] doc: Update MMU_NORMAL_PT_UPDATE
	about the val.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
# Date 1322591439 18000
# Node ID df7cec2c6c03f07932555954948ce7c8d09e88f4
# Parent  b20bf5a5a9c756f9ba5adcf21afea8499748cc11
doc: Update MMU_NORMAL_PT_UPDATE about the val.

The val is used as the pagetable entry with the machine
frame number and some page table bits. This explains
what those page table bits are.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r b20bf5a5a9c7 -r df7cec2c6c03 xen/include/public/xen.h
--- a/xen/include/public/xen.h	Tue Nov 29 12:02:01 2011 -0500
+++ b/xen/include/public/xen.h	Tue Nov 29 13:30:39 2011 -0500
@@ -240,6 +240,72 @@
  * ptr[1:0] == MMU_PT_UPDATE_PRESERVE_AD:
  * As MMU_NORMAL_PT_UPDATE above, but A/D bits currently in the PTE are ORed
  * with those in @val.
+ *
+ * @val is usually the machine frame number along with some attributes.
+ * The attributes by default follow the architecture defined bits. Meaning that
+ * if this is a X86_64 machine and four page table layout is used, the layout
+ * of val is:
+ *  - 63 if set means No execute (NX)
+ *  - 46-13 the machine frame number
+ *  - 12 available for guest
+ *  - 11 available for guest
+ *  - 10 available for guest
+ *  - 9 available for guest
+ *  - 8 global
+ *  - 7 PAT (PSE is disabled, must use hypercall to make 4MB or 2MB pages)
+ *  - 6 dirty
+ *  - 5 accessed
+ *  - 4 page cached disabled
+ *  - 3 page write through
+ *  - 2 userspace accessible
+ *  - 1 writeable
+ *  - 0 present
+ *
+ *  The one bits that does not fit with the default layout is the PAGE_PSE
+ *  also called PAGE_PAT). The MMUEXT_[UN]MARK_SUPER arguments to the
+ *  HYPERVISOR_mmuext_op serve as mechanism to set a pagetable to be 4MB
+ *  (or 2MB) instead of using the PAGE_PSE bit.
+ *
+ *  The reason that the PAGE_PSE (bit 7) is not being utilized is due to Xen
+ *  using it as the Page Attribute Table (PAT) bit - for details on it please
+ *  refer to Intel SDM 10.12. The PAT allows to set the caching attributes of
+ *  pages instead of using MTRRs.
+ *
+ *  The PAT MSR is as follow (it is a 64-bit value, each entry is 8 bits):
+ *             PAT4                 PAT0
+ *   +---+----+----+----+-----+----+----+
+ *    WC | WC | WB | UC | UC- | WC | WB |  <= Linux
+ *   +---+----+----+----+-----+----+----+
+ *    WC | WT | WB | UC | UC- | WT | WB |  <= BIOS (default when machine boots)
+ *   +---+----+----+----+-----+----+----+
+ *    WC | WP | WC | UC | UC- | WT | WB |  <= Xen
+ *   +---+----+----+----+-----+----+----+
+ *
+ *  The lookup of this index table translates to looking up
+ *  Bit 7, Bit 4, and Bit 3 of val entry:
+ *
+ *  PAT/PSE (bit 7) ... PCD (bit 4) .. PWT (bit 3).
+ *
+ *  If all bits are off, then we are using PAT0. If bit 3 turned on,
+ *  then we are using PAT1, if bit 3 and bit 4, then PAT2..
+ *
+ *  As you can see, the Linux PAT1 translates to PAT4 under Xen. Which means
+ *  that if a guest that follows Linux's PAT setup and would like to set Write
+ *  Combined on pages it MUST use PAT4 entry. Meaning that Bit 7 (PAGE_PAT) is
+ *  set. For example, under Linux it only uses PAT0, PAT1, and PAT2 for the
+ *  caching as:
+ *
+ *   WB = none (so PAT0)
+ *   WC = PWT (bit 3 on)
+ *   UC = PWT | PCD (bit 3 and 4 are on).
+ *
+ * To make it work with Xen, it needs to translate the WC bit as so:
+ *
+ *  PWT (so bit 3 on) --> PAT (so bit 7 is on) and clear bit 3
+ *
+ * And to translate back it would:
+ *
+ * PAT (bit 7 on) --> PWT (bit 3 on) and clear bit 7.
  */
 #define MMU_NORMAL_PT_UPDATE      0 /* checked '*ptr = val'. ptr is MA.      */
 #define MMU_MACHPHYS_UPDATE       1 /* ptr = MA of frame to modify entry for */

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 00:33:33 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 00: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.xensource.com>)
	id 1RVY7B-0006e9-IR; Wed, 30 Nov 2011 00:33:33 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY79-0006T7-Jb
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:31 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-21.messagelabs.com!1322613172!17524!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8015 invoked from network); 30 Nov 2011 00:32:53 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Nov 2011 00:32:53 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVYCz-0003vU-HH
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:39:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVY6x-0003or-5U
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 00:33:19 +0000
Message-Id: <E1RVY6x-0003or-5U@xenbits.xen.org>
Date: Wed, 30 Nov 2011 00:33:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] doc: Update MMU_NORMAL_PT_UPDATE
	about the val.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
# Date 1322591439 18000
# Node ID df7cec2c6c03f07932555954948ce7c8d09e88f4
# Parent  b20bf5a5a9c756f9ba5adcf21afea8499748cc11
doc: Update MMU_NORMAL_PT_UPDATE about the val.

The val is used as the pagetable entry with the machine
frame number and some page table bits. This explains
what those page table bits are.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r b20bf5a5a9c7 -r df7cec2c6c03 xen/include/public/xen.h
--- a/xen/include/public/xen.h	Tue Nov 29 12:02:01 2011 -0500
+++ b/xen/include/public/xen.h	Tue Nov 29 13:30:39 2011 -0500
@@ -240,6 +240,72 @@
  * ptr[1:0] == MMU_PT_UPDATE_PRESERVE_AD:
  * As MMU_NORMAL_PT_UPDATE above, but A/D bits currently in the PTE are ORed
  * with those in @val.
+ *
+ * @val is usually the machine frame number along with some attributes.
+ * The attributes by default follow the architecture defined bits. Meaning that
+ * if this is a X86_64 machine and four page table layout is used, the layout
+ * of val is:
+ *  - 63 if set means No execute (NX)
+ *  - 46-13 the machine frame number
+ *  - 12 available for guest
+ *  - 11 available for guest
+ *  - 10 available for guest
+ *  - 9 available for guest
+ *  - 8 global
+ *  - 7 PAT (PSE is disabled, must use hypercall to make 4MB or 2MB pages)
+ *  - 6 dirty
+ *  - 5 accessed
+ *  - 4 page cached disabled
+ *  - 3 page write through
+ *  - 2 userspace accessible
+ *  - 1 writeable
+ *  - 0 present
+ *
+ *  The one bits that does not fit with the default layout is the PAGE_PSE
+ *  also called PAGE_PAT). The MMUEXT_[UN]MARK_SUPER arguments to the
+ *  HYPERVISOR_mmuext_op serve as mechanism to set a pagetable to be 4MB
+ *  (or 2MB) instead of using the PAGE_PSE bit.
+ *
+ *  The reason that the PAGE_PSE (bit 7) is not being utilized is due to Xen
+ *  using it as the Page Attribute Table (PAT) bit - for details on it please
+ *  refer to Intel SDM 10.12. The PAT allows to set the caching attributes of
+ *  pages instead of using MTRRs.
+ *
+ *  The PAT MSR is as follow (it is a 64-bit value, each entry is 8 bits):
+ *             PAT4                 PAT0
+ *   +---+----+----+----+-----+----+----+
+ *    WC | WC | WB | UC | UC- | WC | WB |  <= Linux
+ *   +---+----+----+----+-----+----+----+
+ *    WC | WT | WB | UC | UC- | WT | WB |  <= BIOS (default when machine boots)
+ *   +---+----+----+----+-----+----+----+
+ *    WC | WP | WC | UC | UC- | WT | WB |  <= Xen
+ *   +---+----+----+----+-----+----+----+
+ *
+ *  The lookup of this index table translates to looking up
+ *  Bit 7, Bit 4, and Bit 3 of val entry:
+ *
+ *  PAT/PSE (bit 7) ... PCD (bit 4) .. PWT (bit 3).
+ *
+ *  If all bits are off, then we are using PAT0. If bit 3 turned on,
+ *  then we are using PAT1, if bit 3 and bit 4, then PAT2..
+ *
+ *  As you can see, the Linux PAT1 translates to PAT4 under Xen. Which means
+ *  that if a guest that follows Linux's PAT setup and would like to set Write
+ *  Combined on pages it MUST use PAT4 entry. Meaning that Bit 7 (PAGE_PAT) is
+ *  set. For example, under Linux it only uses PAT0, PAT1, and PAT2 for the
+ *  caching as:
+ *
+ *   WB = none (so PAT0)
+ *   WC = PWT (bit 3 on)
+ *   UC = PWT | PCD (bit 3 and 4 are on).
+ *
+ * To make it work with Xen, it needs to translate the WC bit as so:
+ *
+ *  PWT (so bit 3 on) --> PAT (so bit 7 is on) and clear bit 3
+ *
+ * And to translate back it would:
+ *
+ * PAT (bit 7 on) --> PWT (bit 3 on) and clear bit 7.
  */
 #define MMU_NORMAL_PT_UPDATE      0 /* checked '*ptr = val'. ptr is MA.      */
 #define MMU_MACHPHYS_UPDATE       1 /* ptr = MA of frame to modify entry for */

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 15:33:27 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 15:33:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVm9x-0003Eh-Kk; Wed, 30 Nov 2011 15:33:21 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVm9v-0003EX-Ei
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 15:33:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-174.messagelabs.com!1322667159!3730957!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15231 invoked from network); 30 Nov 2011 15:32:40 -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;
	30 Nov 2011 15:32: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 1RVmFm-0006HJ-GE
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 15:39:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVm9j-0007gZ-5P
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 15:33:07 +0000
Message-Id: <E1RVm9j-0007gZ-5P@xenbits.xen.org>
Date: Wed, 30 Nov 2011 15:33:06 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/cpuidle: add Westmere-EX support
	to hw residencies reading logic
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1322645021 -3600
# Node ID 64088ba60263d3a623851b43a872c93c71cc3cbf
# Parent  df7cec2c6c03f07932555954948ce7c8d09e88f4
x86/cpuidle: add Westmere-EX support to hw residencies reading logic

This is in accordance with
http://software.intel.com/en-us/articles/intel-processor-identification-with-cpuid-model-and-family-numbers/

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Haitao Shan <maillists.shan@gmail.com>
---


diff -r df7cec2c6c03 -r 64088ba60263 xen/arch/x86/acpi/cpu_idle.c
--- a/xen/arch/x86/acpi/cpu_idle.c	Tue Nov 29 13:30:39 2011 -0500
+++ b/xen/arch/x86/acpi/cpu_idle.c	Wed Nov 30 10:23:41 2011 +0100
@@ -120,6 +120,7 @@
     /* Westmere */
     case 0x25:
     case 0x2C:
+    case 0x2F:
         GET_PC3_RES(hw_res->pc3);
         GET_PC6_RES(hw_res->pc6);
         GET_PC7_RES(hw_res->pc7);

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

From xen-changelog-bounces@lists.xensource.com Wed Nov 30 15:33:27 2011
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Nov 2011 15:33:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RVm9x-0003Eh-Kk; Wed, 30 Nov 2011 15:33:21 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVm9v-0003EX-Ei
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 15:33:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-174.messagelabs.com!1322667159!3730957!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15231 invoked from network); 30 Nov 2011 15:32:40 -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;
	30 Nov 2011 15:32: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 1RVmFm-0006HJ-GE
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 15:39:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RVm9j-0007gZ-5P
	for xen-changelog@lists.xensource.com; Wed, 30 Nov 2011 15:33:07 +0000
Message-Id: <E1RVm9j-0007gZ-5P@xenbits.xen.org>
Date: Wed, 30 Nov 2011 15:33:06 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/cpuidle: add Westmere-EX support
	to hw residencies reading logic
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1322645021 -3600
# Node ID 64088ba60263d3a623851b43a872c93c71cc3cbf
# Parent  df7cec2c6c03f07932555954948ce7c8d09e88f4
x86/cpuidle: add Westmere-EX support to hw residencies reading logic

This is in accordance with
http://software.intel.com/en-us/articles/intel-processor-identification-with-cpuid-model-and-family-numbers/

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Haitao Shan <maillists.shan@gmail.com>
---


diff -r df7cec2c6c03 -r 64088ba60263 xen/arch/x86/acpi/cpu_idle.c
--- a/xen/arch/x86/acpi/cpu_idle.c	Tue Nov 29 13:30:39 2011 -0500
+++ b/xen/arch/x86/acpi/cpu_idle.c	Wed Nov 30 10:23:41 2011 +0100
@@ -120,6 +120,7 @@
     /* Westmere */
     case 0x25:
     case 0x2C:
+    case 0x2F:
         GET_PC3_RES(hw_res->pc3);
         GET_PC6_RES(hw_res->pc6);
         GET_PC7_RES(hw_res->pc7);

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

